/* ==========================================================================
   BOO TAG — interface
   Halloween arcade: ink panels, acid green, hot pink, hard shadows.
   ========================================================================== */

@font-face {
  font-family: 'Barlow Condensed';
  src: url('./assets/fonts/barlow-condensed-800.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('./assets/fonts/space-grotesk-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('./assets/fonts/space-grotesk-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0a0712;
  --ink-2: #140b24;
  --panel: rgba(20, 11, 36, 0.88);
  --line: rgba(255, 244, 214, 0.16);
  --acid: #b6ff3b;
  --acid-dim: #8fd41f;
  --pink: #ff4fa3;
  --cream: #fff4d6;
  --gold: #ffd166;
  --violet: #8b5cf6;
  --shadow: 7px 7px 0 rgba(0, 0, 0, 0.72);
  --display: 'Barlow Condensed', Impact, 'Arial Narrow', sans-serif;
  --body: 'Space Grotesk', system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
}

body {
  font-family: var(--body);
  color: var(--cream);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
}

.is-hidden {
  display: none !important;
}

/* ------------------------------------------------------------------ stage */

#app {
  position: fixed;
  inset: 0;
  isolation: isolate;
}

#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}

body.is-locked #stage {
  cursor: none;
}

.fx-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background:
    radial-gradient(ellipse at 50% 45%, transparent 42%, rgba(5, 3, 10, 0.55) 88%),
    linear-gradient(180deg, rgba(5, 3, 10, 0.25), transparent 22%, transparent 78%, rgba(5, 3, 10, 0.55));
}

.fx-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

.flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 7;
  opacity: 0;
  background: radial-gradient(circle at 50% 60%, rgba(255, 79, 163, 0.55), rgba(255, 79, 163, 0) 62%);
}

.flash.is-hit {
  animation: flashHit 0.45s ease-out;
}
.flash.is-boo {
  animation: flashBoo 0.32s ease-out;
}

@keyframes flashHit {
  0% { opacity: 0.95; }
  100% { opacity: 0; }
}
@keyframes flashBoo {
  0% { opacity: 0.5; }
  100% { opacity: 0; }
}

/* -------------------------------------------------------------------- HUD */

.hud {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 16px;
  padding: max(18px, env(safe-area-inset-top)) 26px 0;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.hud.is-live {
  opacity: 1;
  transform: none;
}

.hud__left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.stat {
  display: flex;
  flex-direction: column;
  line-height: 1;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.7);
}

.stat__k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--acid);
  margin-bottom: 5px;
}

.stat__v {
  font-family: var(--display);
  font-size: clamp(34px, 4.4vw, 56px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  line-height: 0.9;
}

.combo {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--pink);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.65);
  padding: 5px 10px 5px 8px;
  transform: rotate(-3deg) translateY(6px);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.combo.is-on {
  opacity: 1;
}

.combo__x {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.combo__track {
  display: block;
  width: 46px;
  height: 6px;
  background: rgba(10, 7, 18, 0.35);
  border: 1px solid rgba(10, 7, 18, 0.5);
}

.combo__track u {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--ink);
  transform-origin: left center;
}

.hud__center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.timer {
  font-family: var(--display);
  font-size: clamp(38px, 5vw, 62px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 0.85;
  text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.65);
  padding: 2px 6px;
  transition: color 0.2s ease;
}

.timer.is-low {
  color: var(--pink);
  animation: lowPulse 0.7s ease-in-out infinite alternate;
}

@keyframes lowPulse {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

.hype {
  width: clamp(150px, 22vw, 280px);
}

.hype__label {
  display: block;
  font-size: 9px;
  letter-spacing: 0.32em;
  font-weight: 700;
  text-align: center;
  color: rgba(255, 244, 214, 0.65);
  margin-bottom: 4px;
}

.hype__track {
  height: 12px;
  background: rgba(10, 7, 18, 0.72);
  border: 2px solid rgba(255, 244, 214, 0.28);
  padding: 2px;
}

.hype__fill {
  height: 100%;
  width: 0%;
  background: var(--acid);
  transition: width 0.18s linear, background 0.2s ease;
}

.hype__fill.is-frenzy {
  background: linear-gradient(90deg, var(--pink), var(--gold));
}

.hud__right {
  display: flex;
  justify-content: flex-end;
  pointer-events: auto;
}

.icon-btn {
  appearance: none;
  border: 2px solid rgba(255, 244, 214, 0.35);
  background: rgba(10, 7, 18, 0.55);
  color: var(--cream);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  padding: 9px 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.icon-btn:hover {
  border-color: var(--acid);
  color: var(--acid);
}

.icon-btn.is-off {
  color: rgba(255, 244, 214, 0.4);
}

/* ---------------------------------------------------------- center pieces */

.prompt {
  position: fixed;
  z-index: 22;
  left: 50%;
  bottom: max(13vh, 96px);
  transform: translate(-50%, 14px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 10px 10px;
  background: rgba(10, 7, 18, 0.84);
  border: 2px solid var(--acid);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.prompt.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.prompt kbd {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: var(--acid);
  color: var(--ink);
  font-family: var(--body);
  font-size: 22px;
  font-weight: 700;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.6);
}

.prompt__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.prompt__body b {
  font-family: var(--display);
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0.04em;
}

.prompt__body span {
  font-size: 9px;
  letter-spacing: 0.24em;
  color: var(--acid);
}

.prompt.is-clean .prompt__body span {
  color: var(--gold);
}

.toasts {
  position: fixed;
  z-index: 23;
  left: 50%;
  top: 20vh;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  pointer-events: none;
  width: min(92vw, 620px);
}

.toast {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  padding: 8px 14px;
  background: rgba(10, 7, 18, 0.9);
  border-left: 3px solid var(--cream);
  color: var(--cream);
  animation: toastIn 0.22s ease-out both;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast--good { border-color: var(--acid); color: var(--acid); }
.toast--bad { border-color: var(--pink); color: var(--pink); }
.toast--frenzy { border-color: var(--gold); color: var(--gold); }
.toast--info { border-color: rgba(255, 244, 214, 0.4); color: rgba(255, 244, 214, 0.8); }

.toast.is-out {
  animation: toastOut 0.3s ease-in forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(-8px); }
}

.countdown {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
}

.countdown.is-on {
  opacity: 1;
}

.countdown span {
  font-family: var(--display);
  font-size: clamp(120px, 26vw, 300px);
  font-weight: 800;
  line-height: 0.8;
  color: var(--acid);
  -webkit-text-stroke: 4px var(--ink);
  text-shadow: 12px 12px 0 rgba(0, 0, 0, 0.55);
  animation: countPop 0.9s ease-out both;
}

.countdown em {
  position: absolute;
  top: 63%;
  font-family: var(--display);
  font-style: normal;
  font-size: clamp(28px, 5vw, 64px);
  letter-spacing: 0.3em;
  color: var(--cream);
  opacity: 0.35;
}

@keyframes countPop {
  0% { transform: scale(1.7); opacity: 0; }
  30% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.94); opacity: 0.9; }
}

.frenzy {
  position: fixed;
  z-index: 21;
  top: 132px;
  left: 50%;
  transform: translateX(-50%) rotate(-4deg) scale(0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--display);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: linear-gradient(90deg, var(--gold), var(--pink));
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.6);
  padding: 4px 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.frenzy span {
  font-family: var(--body);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.3em;
  margin-top: -2px;
}

.frenzy.is-on {
  opacity: 1;
  transform: translateX(-50%) rotate(-4deg) scale(1);
  animation: frenzyWobble 0.5s ease-in-out infinite alternate;
}

@keyframes frenzyWobble {
  from { transform: translateX(-50%) rotate(-5deg) scale(1); }
  to { transform: translateX(-50%) rotate(-2deg) scale(1.04); }
}

.hint {
  position: fixed;
  z-index: 20;
  left: 26px;
  bottom: 22px;
  display: flex;
  gap: 16px;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: rgba(255, 244, 214, 0.45);
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.hint b {
  color: rgba(255, 244, 214, 0.8);
}

.hint.is-dim {
  opacity: 0;
}

/* ------------------------------------------------------------------ menu */

.screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  padding: clamp(18px, 4vw, 64px);
  overflow-y: auto;
}

.screen--menu {
  background:
    linear-gradient(100deg, rgba(8, 5, 16, 0.96) 0%, rgba(8, 5, 16, 0.86) 42%, rgba(8, 5, 16, 0.28) 78%, rgba(8, 5, 16, 0.5) 100%),
    radial-gradient(circle at 78% 30%, rgba(182, 255, 59, 0.1), transparent 45%);
}

.menu__card {
  position: relative;
  width: min(660px, 100%);
  padding: clamp(24px, 4vw, 44px);
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: 16px 16px 0 rgba(0, 0, 0, 0.55), inset 0 0 80px rgba(139, 92, 246, 0.08);
  backdrop-filter: blur(6px);
}

.kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--acid);
}

.kicker .dot {
  width: 7px;
  height: 7px;
  background: var(--pink);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255, 79, 163, 0.18);
  animation: dotBlink 1.6s ease-in-out infinite;
}

@keyframes dotBlink {
  50% { opacity: 0.3; }
}

.logo {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  line-height: 0.72;
  letter-spacing: -0.01em;
  transform: rotate(-1.5deg);
  transform-origin: left bottom;
}

.logo__boo {
  font-size: clamp(98px, 14vw, 158px);
  color: var(--cream);
  text-shadow: 7px 7px 0 var(--pink), 11px 11px 0 rgba(0, 0, 0, 0.55);
}

.logo__tag {
  font-size: clamp(52px, 7.6vw, 86px);
  color: transparent;
  -webkit-text-stroke: 3px var(--acid);
  padding-bottom: 8px;
  letter-spacing: 0.02em;
}

.tagline {
  margin: 22px 0 0;
  font-family: var(--display);
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: var(--cream);
}

.menu__rules {
  display: grid;
  gap: 8px;
  margin: 22px 0 26px;
}

.rule {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 12.5px;
  line-height: 1.45;
  color: rgba(255, 244, 214, 0.78);
  border-top: 1px solid rgba(255, 244, 214, 0.09);
  padding-top: 8px;
}

.rule b {
  font-family: var(--display);
  font-size: 19px;
  color: var(--pink);
  line-height: 1.1;
}

.rule em {
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink);
  background: var(--acid);
  padding: 2px 5px;
  margin-right: 4px;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 3px solid var(--ink);
  padding: 14px 26px;
  font-family: var(--display);
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.2s ease;
}

.btn--primary {
  background: var(--acid);
  color: var(--ink);
  box-shadow: 7px 7px 0 rgba(0, 0, 0, 0.7);
}

.btn--primary:hover {
  background: var(--cream);
  transform: translate(-2px, -2px);
  box-shadow: 9px 9px 0 rgba(0, 0, 0, 0.7);
}

.btn--primary:active {
  transform: translate(3px, 3px);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.7);
}

.btn--ghost {
  background: transparent;
  color: var(--cream);
  border-color: rgba(255, 244, 214, 0.35);
  font-size: 17px;
  padding: 12px 20px;
}

.btn--ghost:hover {
  border-color: var(--pink);
  color: var(--pink);
}

.btn__arrow {
  font-size: 16px;
  transform: translateY(-1px);
}

.menu__note {
  margin: 20px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: rgba(255, 244, 214, 0.55);
  max-width: 52ch;
}

.menu__note b {
  color: var(--gold);
}

.menu__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 244, 214, 0.1);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: rgba(255, 244, 214, 0.42);
}

.menu__foot a {
  text-decoration: none;
  color: rgba(255, 244, 214, 0.65);
  border-bottom: 1px solid rgba(255, 244, 214, 0.18);
  padding-bottom: 1px;
}

.menu__foot a:hover {
  color: var(--acid);
  border-color: var(--acid);
}

.sep {
  opacity: 0.35;
}

.menu__side {
  position: absolute;
  right: clamp(24px, 6vw, 110px);
  top: 21vh;
  width: 300px;
  height: 300px;
  pointer-events: none;
}

.sticker {
  position: absolute;
  padding: 10px 16px;
  font-family: var(--display);
  font-size: 27px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.6);
}

.sticker--boo {
  top: 0;
  right: 0;
  background: var(--pink);
  color: var(--ink);
  transform: rotate(-6deg);
  font-size: 56px;
}

.sticker--clean {
  display: none;
}

.sticker--cat {
  top: 102px;
  right: 26px;
  background: var(--cream);
  color: var(--ink);
  transform: rotate(-4deg);
  font-size: 17px;
  text-align: center;
  line-height: 1.05;
}

.spook {
  position: absolute;
  right: 0;
  bottom: -126px;
  font-family: var(--display);
  font-size: 44px;
  font-weight: 800;
  line-height: 0.82;
  text-align: right;
  color: transparent;
  -webkit-text-stroke: 2px rgba(255, 244, 214, 0.32);
  transform: rotate(3deg);
}

/* --------------------------------------------------------------- results */

.screen--results {
  justify-content: center;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 79, 163, 0.12), transparent 55%),
    rgba(8, 5, 16, 0.9);
  backdrop-filter: blur(5px);
}

.results__card {
  width: min(660px, 100%);
  padding: clamp(24px, 4vw, 40px);
  background: var(--panel);
  border: 3px solid var(--acid);
  box-shadow: 14px 14px 0 rgba(0, 0, 0, 0.65);
  text-align: center;
}

.results__card .kicker {
  justify-content: center;
  margin-bottom: 10px;
}

.results__rank {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: clamp(44px, 7vw, 76px);
  font-weight: 800;
  line-height: 0.9;
  color: var(--cream);
  text-shadow: 5px 5px 0 var(--pink);
  transform: rotate(-1deg);
}

.results__line {
  margin: 10px 0 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(255, 244, 214, 0.6);
  text-transform: uppercase;
}

.results__clout {
  margin: 22px 0 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.results__clout span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: var(--acid);
}

.results__clout b {
  font-family: var(--display);
  font-size: clamp(64px, 11vw, 108px);
  font-weight: 800;
  line-height: 0.85;
  color: var(--acid);
  text-shadow: 5px 5px 0 rgba(0, 0, 0, 0.55);
  font-variant-numeric: tabular-nums;
}

.results__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 20px 0 26px;
  border-top: 1px solid rgba(255, 244, 214, 0.12);
  border-bottom: 1px solid rgba(255, 244, 214, 0.12);
}

.results__grid > div {
  padding: 12px 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid rgba(255, 244, 214, 0.08);
}

.results__grid > div:last-child {
  border-right: 0;
}

.results__grid b {
  font-family: var(--display);
  font-size: 32px;
  line-height: 1;
  color: var(--cream);
}

.results__grid span {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: rgba(255, 244, 214, 0.45);
}

.results__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.results__tiny {
  margin: 20px 0 0;
  font-size: 9px;
  line-height: 1.5;
  color: rgba(255, 244, 214, 0.32);
}

/* ----------------------------------------------------------------- touch */

.touch {
  position: fixed;
  z-index: 25;
  inset: 0;
  pointer-events: none;
  display: none;
}

body.is-touch .touch.is-live {
  display: block;
}

.stick {
  position: absolute;
  left: 22px;
  bottom: max(24px, env(safe-area-inset-bottom));
  width: 118px;
  height: 118px;
  border-radius: 50%;
  border: 2px solid rgba(255, 244, 214, 0.28);
  background: rgba(10, 7, 18, 0.35);
  pointer-events: auto;
  touch-action: none;
}

.stick__knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: rgba(182, 255, 59, 0.85);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
}

.touch__right {
  position: absolute;
  right: 18px;
  bottom: max(26px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  gap: 10px;
  align-items: end;
  pointer-events: auto;
}

.tbtn {
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6);
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.04em;
  color: var(--ink);
  padding: 12px 14px;
  touch-action: none;
  user-select: none;
}

.tbtn--boo {
  grid-row: 1 / span 2;
  grid-column: 2;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--pink);
  font-size: 26px;
  align-self: end;
}

.tbtn--sneak {
  background: var(--cream);
  grid-column: 1;
  grid-row: 2;
}

.tbtn--sprint {
  background: var(--acid);
  grid-column: 1;
  grid-row: 1;
}

.tbtn.is-on {
  background: var(--gold);
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6);
}

/* --------------------------------------------------------------- loading */

.loading {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--ink);
  transition: opacity 0.45s ease, visibility 0.45s;
}

.loading.is-gone {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading__inner {
  text-align: center;
}

.loading__boo {
  font-family: var(--display);
  font-size: clamp(90px, 18vw, 200px);
  font-weight: 800;
  line-height: 0.8;
  color: var(--acid);
  animation: loadPulse 1.1s ease-in-out infinite alternate;
}

.loading p {
  margin: 10px 0 0;
  font-size: 9px;
  letter-spacing: 0.32em;
  color: rgba(255, 244, 214, 0.5);
}

@keyframes loadPulse {
  from { opacity: 0.55; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1.02); }
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--display);
  font-size: 28px;
  text-align: center;
  padding: 24px;
}

/* ----------------------------------------------------------- responsive */

@media (max-width: 1100px) {
  .menu__side {
    display: none;
  }
}

@media (max-width: 720px) {
  .screen {
    padding: 14px;
  }

  .screen--menu {
    align-items: flex-start;
    padding-top: max(26px, env(safe-area-inset-top));
    background: linear-gradient(180deg, rgba(8, 5, 16, 0.9) 0%, rgba(8, 5, 16, 0.72) 65%, rgba(8, 5, 16, 0.85) 100%);
  }

  .menu__card {
    padding: 22px;
    box-shadow: 9px 9px 0 rgba(0, 0, 0, 0.5);
  }

  .kicker {
    font-size: 8px;
    letter-spacing: 0.2em;
    margin-bottom: 12px;
  }

  .logo__boo {
    font-size: 96px;
    text-shadow: 5px 5px 0 var(--pink), 8px 8px 0 rgba(0, 0, 0, 0.5);
  }

  .logo__tag {
    font-size: 52px;
    padding-bottom: 5px;
  }

  .tagline {
    margin-top: 16px;
    font-size: 21px;
  }

  .menu__rules {
    margin: 16px 0 20px;
    gap: 6px;
  }

  .rule {
    font-size: 11.5px;
    grid-template-columns: 24px 1fr;
  }

  .rule b {
    font-size: 16px;
  }

  .btn {
    font-size: 22px;
    padding: 13px 20px;
  }

  .menu__note {
    font-size: 10.5px;
    margin-top: 14px;
  }

  .menu__foot {
    margin-top: 16px;
    font-size: 8px;
  }

  .hud {
    grid-template-columns: 1fr auto;
    padding: max(12px, env(safe-area-inset-top)) 14px 0;
  }

  .hud__center {
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
  }

  .hud__left {
    gap: 8px;
  }

  .stat__v {
    font-size: 34px;
  }

  .combo {
    padding: 3px 7px;
    transform: rotate(-3deg) translateY(8px);
  }

  .combo__x {
    font-size: 22px;
  }

  .combo__track {
    display: none;
  }

  .timer {
    font-size: 40px;
  }

  .hype {
    width: 128px;
  }

  .hype__label {
    font-size: 7px;
  }

  .hype__track {
    height: 9px;
  }

  .hud__right {
    position: absolute;
    right: 14px;
    top: max(12px, env(safe-area-inset-top));
  }

  .icon-btn {
    font-size: 8px;
    padding: 7px 9px;
  }

  .prompt {
    bottom: 166px;
  }

  .toasts {
    top: 14vh;
  }

  .hint {
    display: none;
  }

  .frenzy {
    top: 106px;
    font-size: 24px;
  }

  .results__card {
    padding: 22px;
    box-shadow: 9px 9px 0 rgba(0, 0, 0, 0.5);
  }

  .results__rank {
    font-size: 44px;
  }

  .results__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .results__grid > div:nth-child(2) {
    border-right: 0;
  }

  .results__grid > div:nth-child(-n + 2) {
    border-bottom: 1px solid rgba(255, 244, 214, 0.08);
  }

  .results__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .results__actions .btn {
    width: 100%;
  }
}

@media (max-height: 700px) and (max-width: 720px) {
  .logo__boo { font-size: 74px; }
  .logo__tag { font-size: 42px; }
  .tagline { font-size: 18px; }
  .menu__note { display: none; }
  .menu__rules { margin: 12px 0 16px; }
}

body.is-touch .hint {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* score bump feedback */
.stat__v.is-bump {
  animation: cloutBump 0.28s ease-out;
}
@keyframes cloutBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.16); color: var(--acid); }
  100% { transform: scale(1); }
}
.combo.is-bump {
  animation: comboBump 0.24s ease-out;
}
@keyframes comboBump {
  0% { transform: rotate(-3deg) translateY(6px) scale(1); }
  50% { transform: rotate(-3deg) translateY(6px) scale(1.14); }
  100% { transform: rotate(-3deg) translateY(6px) scale(1); }
}


/* ------------------------------------------------------------ boo cam */
.cam {
  position: fixed;
  right: 26px;
  bottom: 24px;
  z-index: 21;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  pointer-events: none;
  transform: rotate(2deg);
  transition: opacity 0.3s ease;
}

body.is-menu .cam,
body.is-menu .hint {
  opacity: 0;
}

.cam__frame {
  position: relative;
  width: 104px;
  height: 104px;
  background: #f7d84a;
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.55);
  border-radius: 8px;
  overflow: hidden;
}

.cam__frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.09) 0 2px, transparent 2px 5px);
  opacity: 0.5;
}

.cam__eye {
  position: absolute;
  top: 30px;
  width: 15px;
  height: 19px;
  background: #17131f;
  border-radius: 50%;
}

.cam__eye--l { left: 25px; }
.cam__eye--r { right: 25px; }

.cam__eye i {
  position: absolute;
  top: 6px;
  left: 5px;
  width: 5px;
  height: 5px;
  background: #fff8ec;
  border-radius: 50%;
  transition: left 0.12s ease;
}

.cam__mouth {
  position: absolute;
  left: 50%;
  top: 64px;
  width: 28px;
  height: 12px;
  transform: translateX(-50%);
  border-bottom: 4px solid #17131f;
  border-radius: 0 0 50% 50%;
  transition: all 0.12s ease;
}

.cam.is-boo .cam__eye--l i { left: 9px; }
.cam.is-boo .cam__eye--r i { left: 1px; }

.cam.is-boo .cam__mouth {
  top: 62px;
  height: 22px;
  background: #17131f;
  border-bottom: 0;
  border-radius: 50%;
}

.cam.is-boo .cam__frame {
  animation: camShake 0.4s ease-in-out;
}

@keyframes camShake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-3px, 2px) rotate(-1.5deg); }
  60% { transform: translate(3px, -2px) rotate(1.5deg); }
}

.cam__rec {
  position: absolute;
  top: 8px;
  left: 10px;
  z-index: 2;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--ink);
}

.cam__rec i {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 3px;
  border-radius: 50%;
  background: #ff2d55;
  animation: recBlink 1s steps(2, end) infinite;
}

@keyframes recBlink {
  50% { opacity: 0.15; }
}

.cam__label {
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: rgba(255, 244, 214, 0.55);
}

@media (max-width: 900px) {
  body.is-touch .cam { display: none; }
}
