/* Copied from CODENAME HINTLE (the collaborator's Next.js game, local repo) hintle/app/globals.css
   @ 64f6a35, i-000009: everything but Tailwind's @import/@theme and the body rule (app.css has
   the page's own). Styles for the radio, the TV and the popups wait for i-000010. */

/* The source's two pixel fonts, self-hosted (SIL OFL 1.1, web/fonts/README.md): no request to
   Google Fonts. Subsets: latin and latin-ext. */
@font-face {
  font-family: "Press Start 2P"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/press-start-2p-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Press Start 2P"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/press-start-2p-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "VT323"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/vt323-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "VT323"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/vt323-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
:root { --font-press-start: "Press Start 2P", monospace; --font-vt323: "VT323", monospace; }

.pixelated { image-rendering: pixelated; }

/* ---------- old CRT TV look, laid over everything (pointer-events: none keeps it click-through) ---------- */
.crt {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background:
    repeating-linear-gradient(transparent 0 2px, #00000038 2px 3px),
    radial-gradient(ellipse at center, transparent 55%, #000000b0 100%);
  animation: flicker 0.12s steps(2) infinite;
}
/* bright band rolling down the screen, like a badly tuned TV */
.crt::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -25%;
  height: 22%;
  background: linear-gradient(transparent, #ffffff0c 45%, #ffffff16 50%, #ffffff0c 55%, transparent);
  animation: roll 7s linear infinite;
}
/* occasional interference stripes that jump around */
.crt::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 14px;
  background: repeating-linear-gradient(transparent 0 3px, #ffffff1f 3px 4px);
  opacity: 0;
  animation: interference 6s steps(1) infinite;
}
@keyframes flicker { 50% { opacity: 0.93; } }
@keyframes roll { to { transform: translateY(560%); } }
@keyframes interference {
  0%, 71%, 74%, 88%, 90%, 100% { opacity: 0; }
  72% { opacity: 1; transform: translateY(35vh); }
  73% { opacity: 1; transform: translateY(37vh) scaleX(1.02); }
  89% { opacity: 0.8; transform: translateY(72vh); }
}

/* TV switching on when the page loads */
.crt-on { animation: crt-on 0.7s steps(9); }
@keyframes crt-on {
  0% { transform: scale(0.15, 0.003); filter: brightness(6); }
  40% { transform: scale(1, 0.003); filter: brightness(4); }
  70% { transform: scale(1, 1.04); filter: brightness(1.6); }
  100% { transform: none; filter: none; }
}

/* ---------- logo ---------- */
.glitch { text-shadow: -3px 0 #f472b6, 3px 0 #22d3ee; }
.logo { text-shadow: -3px 0 #f472b6, 3px 0 #22d3ee; animation: logo-glitch 4s steps(1) infinite; }
.letter { animation: letter-float 2.4s steps(4) infinite; animation-delay: calc(var(--i) * 0.15s); }
@keyframes letter-float { 50% { transform: translateY(-4px); } }
@keyframes logo-glitch {
  0%, 89%, 93%, 100% { text-shadow: -3px 0 #f472b6, 3px 0 #22d3ee; transform: none; }
  90% { text-shadow: -9px 0 #f472b6, 7px 0 #22d3ee; transform: translateX(3px) skewX(-8deg); }
  92% { text-shadow: 6px 0 #f472b6, -6px 0 #22d3ee; transform: translateX(-2px); }
}
/* on START: glitch burst, letters crouch and jump off one after another */
.title-out .logo { animation: burst 0.35s steps(3); }
.title-out .letter { animation: letter-out 0.8s steps(8) forwards; animation-delay: calc(var(--i) * 0.06s); }
.title-out .tagline { animation: fade-out 0.3s steps(3) forwards; }
@keyframes burst { 50% { text-shadow: -14px 0 #f472b6, 14px 0 #22d3ee; transform: scale(1.08); } }
@keyframes letter-out {
  25% { transform: translateY(8px) scaleY(0.8); }
  100% { transform: translateY(-60vh) scaleY(1.3); opacity: 0; }
}
@keyframes fade-out { to { opacity: 0; } }
/* coming back from the score: letters drop back in */
.title-in .letter { animation: letter-in 0.7s steps(7) backwards, letter-float 2.4s steps(4) 0.7s infinite; animation-delay: calc(var(--i) * 0.06s), calc(0.7s + var(--i) * 0.15s); }
.title-in .tagline { animation: rise 0.5s steps(5) 0.4s backwards; }
@keyframes letter-in { from { transform: translateY(-60vh); opacity: 0; } 80% { transform: translateY(6px) scaleY(0.85); } }

/* ---------- panels ---------- */
.console {
  background: #1f1a33;
  border: 4px solid #07050d;
  box-shadow: inset 4px 4px 0 #3d3560, inset -4px -4px 0 #120e20, 6px 6px 0 #07050d;
}
.screen {
  background: #03141c;
  border: 3px solid #07050d;
  box-shadow: inset 3px 3px 0 #000, inset -2px -2px 0 #0f3340;
  text-shadow: 0 0 6px #22d3ee55;
}
.label { font-family: var(--font-press-start); font-size: 8px; letter-spacing: 0.2em; color: #5eead4aa; }

.arcade {
  color: #2a0717;
  background: #f472b6;
  border: 4px solid #07050d;
  box-shadow: inset -4px -4px 0 #be185d, inset 4px 4px 0 #fbcfe8, 0 5px 0 #07050d;
  transition: transform 60ms;
}
.arcade:not(:disabled):hover { background: #f9a8d4; }
.arcade:not(:disabled):active { transform: translateY(4px); box-shadow: inset 4px 4px 0 #be185d, 0 1px 0 #07050d; }
.arcade:disabled { filter: grayscale(0.8) brightness(0.6); }
.arcade:focus-visible { outline: 3px solid #22d3ee; outline-offset: 3px; }

/* ---------- the radio (game controls) ---------- */
.radio {
  border-radius: 22px;
  background:
    repeating-linear-gradient(90deg, #ffffff05 0 2px, transparent 2px 5px), /* brushed metal */
    linear-gradient(#51457acc, #3a3160cc 45%, #2a2348cc); /* see-through: the world stays visible behind it */
  border: 4px solid #0b0816;
  box-shadow:
    inset 0 3px 0 #7c6db0, inset 0 -5px 0 #1b1530, inset 3px 0 0 #5e5290, inset -3px 0 0 #231d3d,
    0 7px 0 #0b0816, 0 14px 30px #0008;
}
/* telescopic antenna; its tip lights up while transmitting */
.antenna {
  position: absolute;
  right: 44px;
  bottom: calc(100% + 2px);
  width: 6px;
  height: 64px;
  background: linear-gradient(90deg, #64748b, #e2e8f0 40%, #94a3b8);
  border: 2px solid #0b0816;
  border-bottom: 0;
}
.antenna::before {
  content: "";
  position: absolute;
  left: -5px;
  top: -10px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #0b0816;
  background: #6b2147;
}
.antenna.on::before { background: #f472b6; box-shadow: 0 0 12px #f472b6; animation: blink 0.25s steps(2) infinite; }

.grille {
  border-radius: 12px;
  border: 3px solid #0b0816;
  background: radial-gradient(circle, #0b0816 1.6px, transparent 2px) 0 0 / 7px 7px, #2a2348;
  box-shadow: inset 2px 2px 0 #0006, inset -2px -2px 0 #6d5f99;
}
.knob {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid #0b0816;
  background:
    linear-gradient(#f472b6, #f472b6) 50% 3px / 3px 9px no-repeat, /* pointer notch */
    radial-gradient(circle at 35% 30%, #cbd5e1, #64748b 55%, #334155);
  box-shadow: 0 3px 0 #0b0816;
  transition: rotate 0.15s steps(3);
}
.lcd {
  position: relative;
  border-radius: 12px;
  background: linear-gradient(#0b2a30d9, #061b20d9);
  border: 3px solid #0b0816;
  box-shadow: inset 3px 3px 0 #000a, inset -2px -2px 0 #1b4a52, 0 2px 0 #6d5f99;
  text-shadow: 0 0 6px #22d3ee66;
  overflow: hidden;
}
/* glass reflection */
.lcd::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(160deg, #ffffff12 0 25%, transparent 25%);
}
/* round push-to-talk button */
.ptt {
  border-radius: 50%;
  color: #2a0717;
  border: 4px solid #0b0816;
  background: radial-gradient(circle at 35% 30%, #fce7f3, #f472b6 45%, #be185d);
  box-shadow: 0 6px 0 #0b0816, inset 0 -4px 0 #9d174d;
  transition: transform 60ms;
}
/* lit (b-000019): hard-edged rings that pulse in two steps, on hover and keyboard focus */
.ptt:not(:disabled):hover,
.ptt:not(:disabled):focus-visible {
  filter: brightness(1.1);
  box-shadow: 0 6px 0 #0b0816, inset 0 -4px 0 #9d174d, 0 0 0 3px #0b0816, 0 0 0 6px #f9a8d4;
  animation: ptt-ring 0.8s steps(1, end) infinite;
}
@keyframes ptt-ring {
  50% { box-shadow: 0 6px 0 #0b0816, inset 0 -4px 0 #9d174d, 0 0 0 3px #0b0816, 0 0 0 6px #f472b6, 0 0 0 9px #0b0816, 0 0 0 12px #f9a8d466; }
}
@media (prefers-reduced-motion: reduce) {
  .ptt:not(:disabled):hover, .ptt:not(:disabled):focus-visible { animation: none; }
}
.ptt:not(:disabled):active { animation: none; transform: translateY(5px); box-shadow: 0 1px 0 #0b0816, inset 0 3px 0 #9d174d; }
.ptt:disabled { filter: grayscale(0.7) brightness(0.6); }
.ptt:focus-visible { outline: 3px solid #22d3ee; outline-offset: 3px; }
.led { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #0b0816; }

/* ---------- transitions (hard steps = 8-bit feel) ---------- */
.rise { animation: rise 0.45s steps(5); }
.rise-late { animation: rise 0.5s steps(5) 0.35s backwards; }
@keyframes rise { from { transform: translateY(60px); opacity: 0; } }

.slide-in { animation: slide-in 0.4s steps(4) 0.4s backwards; }
@keyframes slide-in { from { transform: translateX(-120%); } }

.pop { animation: pop 0.25s steps(3); }
@keyframes pop { from { transform: scale(0.85); opacity: 0; } }

/* ---------- result: the alien's TV set ---------- */
.tv {
  border-radius: 28px;
  background:
    repeating-linear-gradient(90deg, #ffffff06 0 2px, transparent 2px 6px),
    linear-gradient(#7a5bb8, #553f8f 40%, #3b2c66);
  border: 4px solid #0b0816;
  box-shadow:
    inset 0 4px 0 #a48ae0, inset 0 -6px 0 #261c45, inset 4px 0 0 #8a70cc, inset -4px 0 0 #2e2253,
    0 8px 0 #0b0816, 0 0 60px #22d3ee40;
}
/* rabbit-ear antenna */
.tv::before,
.tv::after {
  content: "";
  position: absolute;
  bottom: calc(100% - 4px);
  left: 50%;
  width: 5px;
  height: 78px;
  background: linear-gradient(90deg, #94a3b8, #f1f5f9 50%, #64748b);
  border: 2px solid #0b0816;
  transform-origin: bottom center;
  transform: rotate(-28deg);
}
.tv::after { transform: rotate(28deg); }
.tv-screen {
  border-radius: 40px / 30px; /* bulging tube */
  background:
    repeating-linear-gradient(transparent 0 3px, #00000040 3px 4px),
    radial-gradient(ellipse at 50% 40%, #22164a, #0a0620 75%);
  border: 6px solid #0b0816;
  box-shadow: inset 0 0 40px #22d3ee30, inset 0 0 0 2px #22d3ee40, 0 0 0 4px #2a2348, 0 0 0 7px #0b0816;
  overflow: hidden;
}
.tv-screen::after { /* glass glare */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 25% 12%, #ffffff1c, transparent 40%);
}
.tv-legs::before,
.tv-legs::after {
  content: "";
  position: absolute;
  top: 100%;
  width: 10px;
  height: 26px;
  background: #2a2348;
  border: 3px solid #0b0816;
  border-top: 0;
}
.tv-legs::before { left: 22%; transform: skewX(14deg); }
.tv-legs::after { right: 22%; transform: skewX(-14deg); }

/* word-switch banner and new-word screen */
.banner { animation: banner 1.8s steps(12) both; }
@keyframes banner {
  0% { transform: scale(3); opacity: 0; filter: brightness(3); }
  15% { transform: scale(1); opacity: 1; filter: none; }
  80% { opacity: 1; }
  100% { transform: translateY(-30px); opacity: 0; }
}
.tune-in { animation: tune-in 0.5s steps(5); }
@keyframes tune-in {
  0% { filter: brightness(4) blur(1px); transform: scaleY(0.1); }
  50% { transform: scaleY(1) skewX(8deg); }
}
/* the alien's answer types itself out */
/* the alien reads a hint word by word: a highlight runs along it until its thoughts come in */
.scan { animation: scan 1.2s steps(1) infinite; animation-delay: calc(var(--d) * 0.12s); }
@keyframes scan { 0% { color: #ffffff; text-shadow: 0 0 8px #22d3ee; } 14% { color: inherit; text-shadow: inherit; } }
.think-in { display: inline-block; overflow: hidden; white-space: nowrap; vertical-align: bottom; animation: type-in 0.25s steps(8) both; }
.answer-in { display: inline-block; overflow: hidden; white-space: nowrap; vertical-align: bottom; animation: type-in 0.6s steps(14) both; }
@keyframes type-in { from { max-width: 0; } to { max-width: 44ch; } }
.bubble {
  background: #f8fafc;
  color: #1e1b2e;
  border: 3px solid #0b0816;
  box-shadow: 4px 4px 0 #0b0816;
}
.bubble::before { /* speech bubble tail pointing at the alien */
  content: "";
  position: absolute;
  left: -11px;
  top: 40%;
  border: 8px solid transparent;
  border-right: 10px solid #0b0816;
  border-left: 0;
}
.bar {
  width: 100%;
  max-width: 26px;
  height: 18px;
  border: 3px solid #0b0816;
  box-shadow: inset 0 3px 0 #ffffff66, inset 0 -3px 0 #0006, 0 3px 0 #0b0816;
  animation: bar-on 0.3s steps(3) both;
}
@keyframes bar-on {
  from { transform: scale(0.3) translateY(10px); filter: brightness(3); opacity: 0; }
}
.backdrop-in { animation: backdrop-in 1s steps(5) both; }
@keyframes backdrop-in { from { background: transparent; } to { background: #05030fb3; } }

/* win: the card comes down the tractor beam spinning, then unfolds */
.beam-in { animation: beam-in 1.3s steps(16) both; }
@keyframes beam-in {
  0% { transform: translateY(-55vh) scale(0.12) rotate(-25deg); filter: brightness(3) drop-shadow(0 0 12px #4ade80); }
  50% { transform: translateY(0) scale(0.12) rotate(340deg); filter: brightness(3) drop-shadow(0 0 12px #4ade80); }
  65% { transform: scale(1.15, 0.06); filter: brightness(2.5); }
  82% { transform: scale(0.96, 1.06); filter: brightness(1.3); }
  100% { transform: none; filter: none; }
}
/* loss: the card tunes in through TV static */
.static-in { animation: static-in 0.9s steps(9) both; }
@keyframes static-in {
  0% { transform: scaleY(0.02); opacity: 0; }
  20% { transform: scaleY(0.02); opacity: 1; filter: brightness(4); }
  45% { transform: scaleY(1.04) skewX(6deg); }
  60% { transform: translateX(-6px) skewX(-4deg); }
  100% { transform: none; }
}
.noise {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence baseFrequency='0.85'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: screen;
  animation: noise 0.15s steps(3) infinite, fade-out 1.2s steps(6) 0.5s forwards;
}
@keyframes noise { to { background-position: 47px 83px; } }
.blink-slow { animation: blink 1s steps(2) infinite; }

.blink-fast { animation: blink 0.3s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

/* SUPERNOVA: the name flares up a few times */
.nova { animation: nova 0.4s steps(4) 4; }
@keyframes nova { 50% { text-shadow: 0 0 12px #fff, 0 0 28px #fde047, 0 0 50px #fb923c; transform: scale(1.08); } }

/* TELEPATHY (rarest rank): bigger, longer pop; letters bob in a rainbow wave */
.rank-pop-psy { animation: rank-pop-psy 3.2s steps(24) both; }
@keyframes rank-pop-psy {
  0% { transform: scale(4) rotate(-10deg); opacity: 0; filter: brightness(4); }
  8% { transform: scale(0.9) rotate(3deg); opacity: 1; filter: brightness(2); }
  12% { transform: scale(1.06) rotate(-2deg); filter: none; }
  16%, 85% { transform: none; opacity: 1; }
  100% { transform: translateY(-30px) scale(1.1); opacity: 0; }
}
.psy-letter {
  animation: rainbow 0.7s steps(5) infinite, psy-bob 0.6s steps(4) infinite;
  animation-delay: calc(var(--i) * -0.1s), calc(var(--i) * 0.07s);
}
@keyframes psy-bob { 50% { transform: translateY(-10px) rotate(-6deg); } }
/* psychedelic rainbow rings washing over the whole sky */
.psy-wash {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: repeating-radial-gradient(ellipse at 50% 30%, #f472b6 0 18px, #fb923c 18px 36px, #fde047 36px 54px, #4ade80 54px 72px, #22d3ee 72px 90px, #818cf8 90px 108px, #e879f9 108px 126px);
  mix-blend-mode: overlay;
  transform-origin: 50% 30%;
  animation: psy-wash 3s steps(24) both;
}
@keyframes psy-wash {
  0% { opacity: 0; transform: scale(0.2); filter: hue-rotate(0deg); }
  12% { opacity: 0.7; }
  70% { opacity: 0.45; }
  100% { opacity: 0; transform: scale(1.8); filter: hue-rotate(360deg); }
}
/* the player's radio glows in rainbow colors while the mind link is up */
.radio-psy {
  position: absolute;
  inset: -6px;
  border-radius: 26px;
  pointer-events: none;
  animation: radio-psy 0.42s steps(1) infinite;
}
@keyframes radio-psy {
  0% { box-shadow: 0 0 0 3px #f472b6, 0 0 34px #f472b6; }
  14% { box-shadow: 0 0 0 3px #fb923c, 0 0 34px #fb923c; }
  28% { box-shadow: 0 0 0 3px #fde047, 0 0 34px #fde047; }
  42% { box-shadow: 0 0 0 3px #4ade80, 0 0 34px #4ade80; }
  57% { box-shadow: 0 0 0 3px #22d3ee, 0 0 34px #22d3ee; }
  71% { box-shadow: 0 0 0 3px #818cf8, 0 0 34px #818cf8; }
  85% { box-shadow: 0 0 0 3px #e879f9, 0 0 34px #e879f9; }
}

@media (prefers-reduced-motion: reduce) {
  .psy-wash, .radio-psy { display: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .title-out { visibility: hidden; }
}

/* ---------- signal ranks ---------- */
/* rank name popping up in the sky when a word gets through */
.rank-pop { animation: rank-pop 2.3s steps(14) both; }
@keyframes rank-pop {
  0% { transform: scale(2.6); opacity: 0; filter: brightness(3); }
  12% { transform: scale(0.94); opacity: 1; filter: brightness(1.6); }
  18% { transform: none; filter: none; }
  80% { opacity: 1; transform: none; }
  100% { transform: translateY(-24px); opacity: 0; }
}
/* the best rank cycles through colors */
.rainbow { animation: rainbow 0.8s steps(5) infinite; }
@keyframes rainbow {
  0%, 100% { color: #f0abfc; }
  20% { color: #fde047; }
  40% { color: #4ade80; }
  60% { color: #22d3ee; }
  80% { color: #a78bfa; }
}
/* rank stamped onto the score TV */
.stamp { animation: stamp 0.45s steps(5) both; }
@keyframes stamp {
  0% { transform: scale(2.4) rotate(-6deg); opacity: 0; filter: brightness(3); }
  70% { transform: scale(0.95); opacity: 1; }
}
.bar-grow { transform-origin: left; animation: bar-grow 0.6s steps(6) both; }
@keyframes bar-grow { from { transform: scaleX(0); } }
/* the gauge row of a finished word flashes */
.gauge-lock { animation: blink 0.25s steps(2) 6; }

/* secondary arcade button (free play) */
.arcade-alt { color: #04222a; background: #22d3ee; box-shadow: inset -4px -4px 0 #0e7490, inset 4px 4px 0 #cffafe, 0 5px 0 #07050d; }
.arcade-alt:not(:disabled):hover { background: #67e8f9; }
.arcade-alt:not(:disabled):active { box-shadow: inset 4px 4px 0 #0e7490, 0 1px 0 #07050d; }

/* game mode tabs on the title screen */
.tab {
  padding: 8px 12px;
  color: #c4b5fd;
  background: #1e1340;
  border: 3px solid #07050d;
  box-shadow: inset 2px 2px 0 #3d2f6b, 0 3px 0 #07050d;
}
.tab:hover { color: #ffffff; }
.tab.on { color: #2a1a02; background: #fde047; box-shadow: inset -3px -3px 0 #ca8a04, inset 3px 3px 0 #fef9c3, 0 3px 0 #07050d; }
.tab:focus-visible { outline: 3px solid #22d3ee; outline-offset: 2px; }
