/* Base styles shared by every DOM screen. Module CSS lives in css/hud.css and css/meta.css. */
:root {
  --ink: #f3ead8;          /* bone-white text */
  --ink-dim: #b9aac9;      /* muted violet-grey */
  --outline: #12081c;      /* dark text outline */
  --jade: #5dffa8;         /* necro glow accent */
  --violet: #7b4bb3;
  --gold: #ffd36a;         /* holy accent */
  --blood: #ff4d6d;
  --panel-fill: rgba(22, 12, 34, 0.92);
  --font: Georgia, "Times New Roman", serif;   /* main.js overwrites with the font stack for the language */
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #07040b; touch-action: none; user-select: none; -webkit-user-select: none; }
#app { position: fixed; inset: 0; overflow: hidden; font-family: var(--font); color: var(--ink); }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#hud, #screens, #toasts { position: absolute; inset: 0; pointer-events: none; }
#hud > *, #screens > *, #toasts > * { pointer-events: auto; }
#toasts { z-index: 30; }
#screens { z-index: 20; }
#hud { z-index: 10; }

/* outlined display text */
.txt { font-family: var(--font); font-weight: 700; color: var(--ink);
  text-shadow: -2px -2px 0 var(--outline), 2px -2px 0 var(--outline), -2px 2px 0 var(--outline), 2px 2px 0 var(--outline), 0 3px 0 var(--outline), 0 4px 6px rgba(0,0,0,.6); }
.txt-sm { font-size: 14px; }
.txt-md { font-size: 18px; }
.txt-lg { font-size: 26px; }
.txt-xl { font-size: 40px; }

/* 9-slice panel from assets/ui-panel.webp */
.panel { border-style: solid; border-width: 26px; border-image: url("assets/ui-panel.webp") 22% fill / 26px stretch;
  padding: 6px; color: var(--ink); filter: drop-shadow(0 8px 16px rgba(0,0,0,.6)); }
/* 9-slice button from assets/ui-button.webp */
.btn { font-family: var(--font); font-weight: 700; font-size: 18px; color: var(--ink); background: none; cursor: pointer;
  border-style: solid; border-width: 14px 20px; border-image: url("assets/ui-button.webp") 30% 18% fill / 14px 20px stretch;
  min-height: 48px; min-width: 96px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-shadow: -2px -2px 0 var(--outline), 2px -2px 0 var(--outline), -2px 2px 0 var(--outline), 2px 2px 0 var(--outline);
  transition: transform .12s ease, filter .12s ease; outline: none; white-space: nowrap; }
.btn:hover, .btn.focus { filter: brightness(1.25) drop-shadow(0 0 8px rgba(93,255,168,.55)); transform: scale(1.04); }
.btn.press { animation: btnPress .18s ease; }
.btn:disabled, .btn.disabled { filter: grayscale(.8) brightness(.6); cursor: default; transform: none; }
.btn.primary { color: #eafff3; filter: drop-shadow(0 0 10px rgba(93,255,168,.45)); }
.btn.primary:hover, .btn.primary.focus { filter: brightness(1.3) drop-shadow(0 0 14px rgba(93,255,168,.8)); }
.btn img { width: 26px; height: 26px; object-fit: contain; }
/* small square icon button on the ui-pause plate style (44–52 px) */
.icon-btn { width: 48px; height: 48px; padding: 0; border: none; cursor: pointer; background: url("assets/ui-pause.webp") center / 100% 100% no-repeat;
  display: inline-flex; align-items: center; justify-content: center; transition: transform .12s ease, filter .12s ease; }
.icon-btn.plain { background: url("assets/ui-trophy.webp") center / 100% 100% no-repeat; }
.icon-btn:hover, .icon-btn.focus { filter: brightness(1.25); transform: scale(1.06); }
.icon-btn img { width: 70%; height: 70%; object-fit: contain; }
.focus { outline: none; }

@keyframes btnPress { 0% { transform: scale(1); } 40% { transform: scale(.9, .86); } 100% { transform: scale(1); } }
@keyframes popIn { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }
@keyframes slideUp { 0% { transform: translateY(40px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: .55; transform: scale(1); } 50% { opacity: 1; transform: scale(1.04); } }
.pop { animation: popIn .28s cubic-bezier(.2,1.4,.4,1) both; }
.slide-up { animation: slideUp .25s ease-out both; }
.fade-in { animation: fadeIn .25s ease both; }

/* voice subtitles: bottom centre, above the thumbs */
.subtitle { position: absolute; left: 50%; bottom: 14%; transform: translateX(-50%); max-width: min(70%, 640px); text-align: center;
  font-size: 17px; padding: 6px 14px; border-radius: 10px; background: rgba(10, 4, 16, .6); opacity: 0; transition: opacity .25s ease;
  pointer-events: none !important; font-style: italic; }
.subtitle.on { opacity: 1; }
/* help modal */
.help-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 40; }
.help-panel { position: relative; width: min(520px, 86%); max-height: 84%; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 14px; }
.help-title { color: var(--jade); margin-bottom: 2px; font-size: 20px; }
.help-line { margin: 0; font-size: 14px; line-height: 1.35; text-align: left; align-self: stretch; }
.help-panel .btn { margin-top: 6px; min-width: 120px; min-height: 44px; position: sticky; bottom: 0; flex: none; }
@media (max-height: 460px) {
  .help-panel { width: min(780px, 95%); max-height: 94%; gap: 2px; padding: 8px 16px; }
  .help-title { margin-bottom: 0; }
  .help-line { font-size: 13px; line-height: 1.3; }
  .help-panel .btn { margin-top: 4px; }
  .subtitle { font-size: 15px; padding: 4px 10px; }
}
/* small phones: the line sits top-centre under the round label, between the HUD panels (toasts hide meanwhile) */
@media (max-width: 640px) {
  .subtitle { top: 46px !important; bottom: auto !important; left: 50% !important; max-width: 136px !important; font-size: 14px; line-height: 1.25; }
}

/* full-screen dim behind modal screens */
.modal-back { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(20,8,30,.55), rgba(5,2,8,.88)); animation: fadeIn .2s ease both; }
