@font-face { font-family: "Azeret Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/azeret-mono-400.woff2) format("woff2"); }
@font-face { font-family: "Azeret Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts/azeret-mono-700.woff2) format("woff2"); }
@font-face { font-family: "Familjen Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts/familjen-grotesk-700.woff2) format("woff2"); }

:root {
  --acid: #d8f000;
  --ink: #0a0a08;
  --dim: #8e8e86;
  --mono: "Azeret Mono", ui-monospace, monospace;
  --sans: "Familjen Grotesk", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; color: #e8e8e2; font-family: var(--mono); overscroll-behavior: none; }

#frame { position: relative; width: 100%; height: 100dvh; overflow: hidden; background: #000; }
#stage { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }

#grain {
  position: absolute; top: -4%; right: -4%; bottom: -4%; left: -4%;
  pointer-events: none; z-index: 3; opacity: .5;
  background-image:
    repeating-linear-gradient(to bottom, #00000057 0, #00000057 1px, #0000 1px, #0000 3px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 100% 3px, 180px 180px;
  animation: drift 7s steps(9) infinite;
}
@keyframes drift { 0% { background-position: 0 0, 0 0; } to { background-position: 0 3px, 0 180px; } }
body.glitch #stage { transform: translate3d(2px, -1px, 0); filter: contrast(1.25) hue-rotate(4deg); }

#hud, #rail, #readout, #mark, #ask { position: absolute; z-index: 5; }
#hud {
  top: max(14px, env(safe-area-inset-top)); left: 0; right: 0;
  display: flex; justify-content: space-between; gap: 10px; padding: 0 16px;
  font-size: 11px; letter-spacing: .16em; color: var(--dim); text-shadow: 0 1px 3px #000;
}
#rec { display: inline-flex; align-items: center; gap: 7px; color: #ff4d4d; }
#rec i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: blink 2.4s steps(1) infinite; }
@keyframes blink { 0%, 55% { opacity: 1; } 56%, to { opacity: .15; } }

#mark {
  top: clamp(42px, 7vh, 74px); left: 50%; translate: -50% 0;
  margin: 0; width: clamp(230px, 42vw, 460px);
  filter: drop-shadow(0 0 18px rgba(216, 240, 0, .35));
  pointer-events: none;
}
#mark img { display: block; width: 100%; height: auto; }

#readout {
  left: 0; right: 0; bottom: clamp(96px, 15vh, 132px);
  display: grid; justify-items: center; gap: 12px; padding: 0 16px; text-align: center;
}
#act {
  margin: 0; font-size: clamp(20px, 5.2vw, 40px); font-weight: 700; letter-spacing: .06em;
  color: var(--acid); text-shadow: 0 0 26px rgba(216, 240, 0, .45); transition: opacity .25s ease;
}
#act.idle { color: #b9b9ae; text-shadow: none; opacity: .75; }
#meter { display: flex; align-items: center; gap: 10px; }
#meter .tag { font-size: 9px; letter-spacing: .24em; color: var(--dim); }
#gauge { width: min(200px, 46vw); height: 6px; border: 1px solid rgba(232, 232, 226, .35); background: #00000073; }
#fill { display: block; height: 100%; width: 0; background: var(--acid); transition: width .4s linear; }
#gauge.full #fill { animation: strain 1.1s ease-in-out infinite; }
@keyframes strain { 50% { opacity: .55; } }

#ask {
  left: 50%; translate: -50% 0; bottom: clamp(42px, 7vh, 62px);
  min-width: 168px; padding: 14px 30px; border: 0; background: var(--acid); color: var(--ink);
  font-family: var(--sans); font-size: 17px; font-weight: 700; letter-spacing: .22em; cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  transition: transform .12s ease, filter .2s ease;
}
#ask:hover { filter: brightness(1.12); }
#ask:active { transform: translateY(1px); }
#ask:disabled { opacity: .5; cursor: wait; }

#rail {
  position: absolute; z-index: 5; left: 0; right: 0; bottom: max(10px, env(safe-area-inset-bottom));
  display: flex; justify-content: center; gap: 18px; font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
}
#rail a, #rail button { border: 0; background: none; padding: 4px 2px; color: var(--dim); font: inherit; letter-spacing: inherit; text-decoration: none; cursor: pointer; }
#rail a:hover, #rail button:hover { color: var(--acid); }

#answer { border: 1px solid rgba(216, 240, 0, .5); background: #05050a; color: #e8e8e2; padding: 0; width: min(560px, 92vw); max-width: none; }
#answer::backdrop { background: #000000d1; }
#shot { display: block; width: 100%; height: auto; border-bottom: 1px solid rgba(216, 240, 0, .3); background: #000; }
#slug { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 16px 4px; }
#verdict { margin: 0; font-size: clamp(17px, 4vw, 25px); font-weight: 700; color: var(--acid); letter-spacing: .05em; }
#stamp { margin: 0; font-size: 11px; letter-spacing: .12em; color: var(--dim); }
#note { margin: 6px 16px 0; font-size: 11px; line-height: 1.5; letter-spacing: .05em; color: var(--dim); }
#acts { display: flex; gap: 10px; padding: 10px 16px 16px; }
#acts button { flex: 1; padding: 11px; border: 1px solid rgba(232, 232, 226, .35); background: none; color: #e8e8e2; font: 600 12px/1 var(--mono); letter-spacing: .2em; cursor: pointer; }
#acts button:hover { border-color: var(--acid); color: var(--acid); }

@media (max-width: 760px) {
  #mark { top: 44px; width: min(78vw, 340px); }
  #ask { min-width: 62vw; }
}
@media (prefers-reduced-motion: reduce) {
  #grain { animation: none; opacity: .3; }
  #rec i, #gauge.full #fill { animation: none; }
  body.glitch #stage { transform: none; filter: none; }
}
