@font-face { font-family: Bricolage; src: url("/assets/fonts/bricolage-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/assets/fonts/dm-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/assets/fonts/dm-sans-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
:root {
  --bg: #0a1512;
  --panel: rgba(14, 30, 26, 0.92);
  --line: rgba(120, 200, 170, 0.18);
  --ink: #eaf6f0;
  --dim: #93b3a6;
  --faint: #5f7d72;
  --alert: #ff5a5a;
  --camo: #6fe0b0;
  --warm: #ffd479;
  --heart: #ff8f6b;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --font: "DM Sans", ui-rounded, "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); overflow: hidden; }
body { position: fixed; inset: 0; user-select: none; }
#app {
  position: absolute; inset: 0; overflow: hidden;
  background: radial-gradient(120% 90% at 50% -10%, #16302a 0%, var(--bg) 55%, #07110e 100%);
}
.glow { position: absolute; border-radius: 50%; filter: blur(60px); pointer-events: none; }
.glow-a { width: 55vmax; height: 55vmax; left: -18vmax; top: -20vmax; background: #1d6b52; opacity: 0.35; }
.glow-b { width: 46vmax; height: 46vmax; right: -16vmax; bottom: -18vmax; background: #6b3f2e; opacity: 0.28; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
.hud { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.hud.is-hidden { opacity: 0; }
.chip, .meter, .timer, .icon-btn {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  backdrop-filter: blur(6px);
}
.chip { display: flex; flex-direction: column; gap: 2px; padding: 7px 12px; min-width: 0; }
.k { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.v { font-size: 22px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.hearts { display: flex; gap: 5px; padding-top: 4px; }
.heart { width: 14px; height: 14px; background: var(--heart); clip-path: polygon(50% 92%, 8% 40%, 12% 18%, 32% 6%, 50% 22%, 68% 6%, 88% 18%, 92% 40%); }
.heart.is-lost { background: #33504a; opacity: 0.55; transform: scale(0.82); }
.actions { display: flex; gap: 8px; pointer-events: auto; }
.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center; color: var(--ink); cursor: pointer; padding: 0;
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .off { display: none; }
.icon-btn.is-muted .on { display: none; }
.icon-btn.is-muted .off { display: block; }
.meter { padding: 7px 10px 9px; }
.meter-head { display: flex; justify-content: space-between; margin-bottom: 5px; }
.meter-num { font-size: 11px; font-weight: 800; color: var(--dim); font-variant-numeric: tabular-nums; }
.track { height: 9px; border-radius: 6px; background: rgba(255,255,255,0.08); overflow: hidden; }
.fill { height: 100%; width: 0; border-radius: 6px; }
.meter-alert .fill { background: linear-gradient(90deg, #ffb06a, var(--alert)); }
.meter-camo .fill { background: linear-gradient(90deg, #4fd6a4, var(--camo)); }
.meter-alert.is-hot { animation: hot 0.5s ease-in-out infinite; }
@keyframes hot { 50% { box-shadow: 0 0 16px rgba(255,90,90,0.45); } }
.hint { font-size: 12px; color: var(--dim); text-align: center; font-weight: 650; min-height: 16px; }
.timer { display: flex; flex-direction: column; align-items: center; padding: 6px 16px; }
.timer.is-hidden { display: none; }
.timer .v { font-size: 20px; }
.timer.is-urgent .v { color: var(--warm); }
.is-portrait .topbar {
  position: absolute; top: calc(var(--safe-t) + 8px); left: calc(var(--safe-l) + 10px); right: calc(var(--safe-r) + 10px);
  display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: start;
}
.is-portrait .lives { justify-self: center; align-items: center; }
.is-portrait .timer { position: absolute; top: calc(var(--safe-t) + 78px); left: 50%; transform: translateX(-50%); }
.is-portrait .botbar {
  position: absolute; bottom: calc(var(--safe-b) + 10px); left: calc(var(--safe-l) + 10px); right: calc(var(--safe-r) + 10px);
  display: flex; flex-direction: column; gap: 8px;
}
.is-landscape .topbar {
  position: absolute; top: calc(var(--safe-t) + 10px); left: calc(var(--safe-l) + 10px); bottom: calc(var(--safe-b) + 10px);
  width: 118px; display: flex; flex-direction: column; gap: 8px;
}
.is-landscape .actions { margin-top: auto; }
.is-landscape .timer { position: absolute; top: calc(var(--safe-t) + 10px); right: calc(var(--safe-r) + 10px); width: 132px; }
.is-landscape .botbar {
  position: absolute; top: calc(var(--safe-t) + 86px); right: calc(var(--safe-r) + 10px); bottom: calc(var(--safe-b) + 10px);
  width: 132px; display: flex; flex-direction: column; gap: 8px;
}
.banner {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -40%) scale(0.96);
  text-align: center; z-index: 6; pointer-events: none; opacity: 0; transition: opacity 0.22s ease, transform 0.22s ease;
}
.banner.is-shown { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.banner-main { font-family: Bricolage, var(--font); font-size: clamp(32px, 8vw, 54px); font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; text-shadow: 0 4px 24px rgba(0,0,0,0.55); }
.banner-sub { margin-top: 4px; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.tone-hide .banner-main, .tone-good .banner-main { color: var(--camo); }
.tone-seek .banner-main { color: var(--warm); }
.tone-bad .banner-main { color: var(--alert); }
.cue {
  position: absolute; left: 50%; bottom: calc(var(--safe-b) + 7%); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; z-index: 7; opacity: 0; transition: opacity 0.6s ease; pointer-events: none; text-align: center;
}
.cue.is-shown { opacity: 1; }
.cue-title { font-family: Bricolage, var(--font); font-size: 26px; font-weight: 800; letter-spacing: 0.28em; text-indent: 0.28em; }
.cue-tag { font-size: 12px; color: var(--dim); }
.cue-tap { margin-top: 8px; font-size: 13px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--warm); }
.overlay {
  position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; padding: 16px;
  background: rgba(6, 14, 12, 0.62);
}
.overlay.is-hidden, .panel.is-hidden, .is-hidden { display: none !important; }
.panel {
  width: min(420px, 100%); background: linear-gradient(180deg, #12241f, #0d1c18);
  border: 1px solid var(--line); border-radius: 22px; padding: 22px; text-align: center;
  box-shadow: 0 30px 70px rgba(0,0,0,0.5);
}
.emblem { width: 58px; height: 58px; margin: 0 auto 10px; border-radius: 50%; background: radial-gradient(circle at 38% 32%, #ff9a7a, #a8342a 72%); }
.panel h1 { margin: 0 0 4px; font-family: Bricolage, var(--font); font-size: 30px; letter-spacing: 0.03em; text-transform: uppercase; }
.panel .sub { margin: 0 0 16px; color: var(--dim); font-size: 13px; font-weight: 650; }
.scores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.score-box { background: rgba(255,255,255,0.05); border: 1px solid var(--line); border-radius: 12px; padding: 8px 4px; display: flex; flex-direction: column; gap: 3px; }
.score-box b { font-size: 20px; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; margin-bottom: 12px; padding: 4px 12px; border-radius: 999px; background: linear-gradient(90deg, var(--warm), #ff7a5c); color: #2a1408; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.btn {
  width: 100%; min-height: 52px; border: 0; border-radius: 14px; background: linear-gradient(180deg, #6fe0b0, #34a97e);
  color: #06231a; font: inherit; font-size: 17px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer;
}
.ghost { margin-top: 10px; min-height: 46px; background: transparent; color: var(--dim); border: 1px solid var(--line); }
.howto { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.howto div { display: grid; grid-template-columns: 78px 1fr; gap: 10px; align-items: center; }
.howto b { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--warm); background: rgba(255,212,121,0.1); border-radius: 7px; padding: 5px 6px; text-align: center; }
.howto span { font-size: 12px; color: var(--dim); line-height: 1.35; }
.back-link { position: absolute; left: 14px; bottom: 64px; z-index: 6; color: var(--dim); font-size: 11px; background: rgba(8,16,14,.72); border-radius: 999px; padding: 3px 8px; }
.is-portrait .back-link { left: 50%; bottom: 6px; transform: translateX(-50%); }
@media (prefers-reduced-motion: reduce) {
  .meter-alert.is-hot, .banner { animation: none; transition: none; }
}
