@import url("https://fonts.googleapis.com/css2?family=Lilita+One&family=Nunito:wght@700;800;900&display=swap");

:root {
  --ink: #1b1220;
  --paper: #fff6ea;
  --plum: #1a0e22;
  --pink: #ff4d73;
  --gold: #ffc14d;
  --good: #b6f5c8;
  --bad: #ffc1cc;
  color: var(--ink);
  font-family: Nunito, "Trebuchet MS", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: #120814;
}

button, input { font: inherit; }

.app {
  width: min(100vw, 440px);
  height: 100dvh;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: var(--plum);
  color: var(--paper);
  display: flex;
  flex-direction: column;
}

.screen { min-height: 0; }

#game {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

#game[hidden] { display: none !important; }

.gate {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: calc(24px + env(safe-area-inset-top)) 20px calc(22px + env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse 80% 50% at 50% 18%, rgba(255, 193, 77, 0.45), transparent 60%),
    linear-gradient(180deg, #5a2878 0%, #1a0e22 58%);
}

.gate-art {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 180px;
}

.gate-art svg { width: min(240px, 70vw); height: auto; }

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

h1, h2 {
  font-family: "Lilita One", "Arial Black", sans-serif;
  font-weight: 400;
  letter-spacing: 0.01em;
  margin: 0;
}

.gate h1 {
  font-size: clamp(2.4rem, 12vw, 3.4rem);
  line-height: 0.9;
  text-transform: uppercase;
  color: var(--paper);
  text-shadow: 4px 4px 0 var(--ink);
}

.gate h1 span { color: var(--pink); }

.lede {
  margin: 12px 0 0;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.35;
  max-width: 28ch;
}

.fine {
  margin: 8px 0 0;
  color: rgba(255, 246, 234, 0.78);
  font-weight: 700;
  line-height: 1.35;
}

.gate-actions, .result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.btn {
  border: 3px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  border-radius: 16px;
  min-height: 54px;
  padding: 12px 16px;
  font-weight: 900;
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}

.btn.primary { background: var(--pink); color: #fff; }

.btn.ghost {
  background: transparent;
  color: var(--paper);
  box-shadow: none;
  border-color: rgba(255, 246, 234, 0.4);
}

.error {
  margin-top: 12px;
  font-weight: 800;
  color: #ffd0d8;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(8px + env(safe-area-inset-top)) 14px 0;
}

.top h1 {
  font-size: 1.15rem;
  text-transform: uppercase;
  color: var(--paper);
}

.top h1 span { color: var(--pink); }

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-weight: 900;
  box-shadow: 3px 3px 0 var(--ink);
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 0;
  font-weight: 900;
  font-size: 0.86rem;
}

.pill {
  background: var(--gold);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 2px 8px;
}

.band-label { margin-left: auto; color: var(--gold); }

.meter {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 3px;
  padding: 8px 14px 0;
}

.meter i {
  display: block;
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 246, 234, 0.16);
  border: 1px solid rgba(255, 246, 234, 0.18);
}

.meter i.zone { box-shadow: inset 0 0 0 1px rgba(255, 193, 77, 0.7); }

.meter i.on { background: var(--pink); border-color: var(--pink); }

.meter i.zone.on { background: var(--gold); border-color: var(--gold); }

.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 230px;
  margin-top: 6px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 55% at 50% 12%, rgba(255, 196, 120, 0.55), transparent 62%),
    linear-gradient(180deg, #4a2070 0%, #241038 46%, #1a0e16 100%);
}

.stage.band-flirt {
  background:
    radial-gradient(ellipse 90% 55% at 50% 12%, rgba(255, 170, 120, 0.5), transparent 62%),
    linear-gradient(180deg, #5a2468 0%, #2a1028 70%);
}

.stage.band-warm {
  background:
    radial-gradient(ellipse 90% 55% at 50% 16%, rgba(255, 120, 140, 0.48), transparent 62%),
    linear-gradient(180deg, #6a2058 0%, #2a0e20 72%);
}

.stage.band-hot,
.stage.band-quiz {
  background:
    radial-gradient(ellipse 90% 55% at 50% 16%, rgba(255, 80, 120, 0.55), transparent 60%),
    linear-gradient(180deg, #7a1848 0%, #2a0c18 74%);
}

.stage.band-bonus {
  background:
    radial-gradient(ellipse 100% 70% at 50% 42%, rgba(255, 248, 240, 0.92), transparent 58%),
    linear-gradient(180deg, #f6d5e6 0%, #6a3058 78%);
}

.stage::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 16%;
  background: linear-gradient(180deg, #7a4630, #3d2218);
  border-top: 4px solid var(--ink);
  z-index: 0;
}

.host {
  position: absolute;
  inset: 28px 0 0;
  z-index: 1;
}

.host-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.speech {
  position: absolute;
  z-index: 4;
  top: 8px;
  left: 10px;
  right: 74px;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 16px 16px 16px 6px;
  box-shadow: 4px 4px 0 var(--ink);
  padding: 8px 10px;
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.25;
  max-height: 5.4em;
  overflow: hidden;
}

.speech[data-band="hot"],
.speech[data-band="quiz"] { background: #ffe0ea; }

.speech[data-band="bonus"] { background: #fffdf8; }

.speech.is-rush { animation: nudge 0.35s ease; }

.timer {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 56px;
  height: 56px;
  z-index: 4;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 3px 3px 0 var(--ink);
}

.timer svg { width: 100%; height: 100%; display: block; }

.timer span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: "Lilita One", sans-serif;
  font-size: 1.15rem;
  color: var(--ink);
}

.ring-bg, .ring { fill: none; stroke-width: 4; }

.ring-bg { stroke: rgba(27, 18, 32, 0.12); }

.ring {
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-dasharray: 113.1;
  stroke-dashoffset: calc(113.1 * (1 - var(--p, 1)));
  transform: rotate(-90deg);
  transform-origin: 22px 22px;
}

.timer.is-low {
  animation: pulse 0.45s ease-in-out infinite;
}

.timer.is-low .ring { stroke: var(--pink); }

.timer.is-low span { color: var(--pink); }

.panel {
  flex: 0 0 auto;
  max-height: 56%;
  overflow: auto;
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
  background: #140a1c;
  border-top: 4px solid var(--ink);
}

.prompt {
  margin: 0 0 10px;
  min-height: 3.2em;
  font-size: 1.12rem;
  font-weight: 900;
  line-height: 1.25;
  color: var(--paper);
}

.answers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choice {
  width: 100%;
  text-align: left;
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 4px 4px 0 var(--ink);
  min-height: 52px;
  padding: 10px 12px;
  font-weight: 900;
  line-height: 1.2;
  cursor: pointer;
}

.choice:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}

.choice:disabled { cursor: default; }

.choice.is-right {
  background: var(--good);
}

.choice.is-wrong {
  background: var(--bad);
}

.intro p, .result p {
  margin: 0 0 12px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--paper);
}

.result h2 {
  font-size: 2.1rem;
  text-transform: uppercase;
  line-height: 0.95;
  margin-bottom: 8px;
  text-shadow: 3px 3px 0 var(--ink);
}

.score-num {
  font-family: "Lilita One", sans-serif;
  font-size: 2.6rem;
  color: var(--gold);
  margin: 0 0 4px;
}

.share-note {
  margin: 0;
  font-weight: 800;
  line-height: 1.35;
  color: var(--gold);
}

.burst {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 6;
  pointer-events: none;
  font-family: "Lilita One", sans-serif;
  font-size: 4.4rem;
  line-height: 1;
  color: #fffaf3;
  text-shadow:
    3px 3px 0 #1b1220,
    -3px -3px 0 #1b1220,
    3px -3px 0 #1b1220,
    -3px 3px 0 #1b1220,
    7px 7px 0 #ff2d6a;
}

.burst.go { animation: burst 0.7s cubic-bezier(.2, 1.4, .3, 1) both; }

.fx {
  pointer-events: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 3;
}

.heart {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #ff2d6a;
  transform: rotate(45deg);
  animation: floatUp 1s ease-out forwards;
}

.heart::before,
.heart::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  background: #ff2d6a;
  border-radius: 50%;
}

.heart::before { left: -6px; }

.heart::after { top: -6px; }

.blob {
  position: absolute;
  display: block;
  background: #f7f4ee;
  border: 3px solid var(--ink);
  border-radius: 58% 42% 50% 46%;
  animation: blobIn 0.45s cubic-bezier(.2, 1.5, .3, 1) both;
}

/* Host drawing */

.spot { fill: #ffc98a; opacity: 0.28; }
.band-hot .spot, .band-quiz .spot { fill: #ff8aa8; opacity: 0.34; }
.band-bonus .spot { fill: #fff6ea; opacity: 0.55; }
.ground { fill: #1b1220; opacity: 0.2; }

.ink { stroke: #1b1220; stroke-width: 3.5px; stroke-linejoin: round; stroke-linecap: round; }
.skin { fill: var(--skin); }
.hair-fill { fill: var(--hair); }
.torso-fill { fill: var(--shirt); }
.trousers, .shorts { fill: var(--pant); }
.sleeve, .cuff { fill: var(--sleeve); }
.shoe { fill: var(--shoe); }
.sock { fill: #f7f4ef; }
.sock-flash { fill: var(--trim); }
.sole { fill: #f4efe6; }
.inner-ear { fill: color-mix(in srgb, var(--skin) 72%, #000); }
.nose { fill: color-mix(in srgb, var(--skin) 78%, #000); }
.shine { fill: #fff; opacity: 0.18; }
.catch { fill: #fff; }
.pupil { fill: #1b1220; }
.sporran rect:first-child { fill: #1b1220; }

.hair-messy, .hair-sleek, .hair-wavy, .hair-short, .hair-tuft, .hair-curly,
.hat-beret, .hat-cap, .hat-cork, .mustache, .chain, .wine, .stein, .ball,
.kilt, .sporran, .socks, .vest, .jersey, .fiesta, .star, .shirt-v, .tie,
.collar, .scarf, .zinc, .sleeve-short { display: none; }

.outfit-scottish .hair-messy,
.outfit-french .hair-sleek,
.outfit-american .hair-tuft,
.outfit-italian .hair-wavy,
.outfit-german .hair-sleek,
.outfit-australian .hair-tuft,
.outfit-brazilian .hair-curly,
.outfit-mexican .hair-short,
.outfit-french .hat-beret,
.outfit-american .hat-cap,
.outfit-australian .hat-cork,
.outfit-french .mustache,
.outfit-italian .chain,
.outfit-french .wine,
.outfit-german .stein,
.outfit-brazilian .ball,
.outfit-scottish .kilt,
.outfit-scottish .sporran,
.outfit-scottish .socks,
.outfit-australian .socks,
.outfit-german .vest,
.outfit-brazilian .jersey,
.outfit-mexican .fiesta,
.outfit-american .star,
.outfit-scottish .shirt-v,
.outfit-scottish .tie,
.outfit-italian .collar,
.outfit-german .collar,
.outfit-australian .collar,
.outfit-french .scarf,
.outfit-australian .zinc { display: block; }

.shorts { display: none; }

.outfit-scottish .trousers,
.outfit-australian .trousers,
.outfit-brazilian .trousers { display: none; }

.outfit-australian .shorts,
.outfit-brazilian .shorts { display: block; }

.outfit-american .sleeve,
.outfit-australian .sleeve,
.outfit-brazilian .sleeve,
.outfit-mexican .sleeve { display: none; }

.outfit-american .sleeve-short,
.outfit-australian .sleeve-short,
.outfit-brazilian .sleeve-short,
.outfit-mexican .sleeve-short { display: block; }

.outfit-french .torso-fill,
.outfit-french .sleeve,
.outfit-french .cuff { fill: url(#stripes); }

.outfit-scottish .torso-fill { fill: #161616; }
.outfit-scottish .sleeve, .outfit-scottish .cuff { fill: #161616; }

.leg { fill: var(--pant); }
.outfit-scottish .leg,
.outfit-australian .leg,
.outfit-brazilian .leg { fill: var(--skin); }

.mustache { fill: #1b1220; }
.star { fill: #d7263d; stroke: #1b1220; stroke-width: 2px; }
.jersey-num {
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 42px;
  font-weight: 900;
  fill: #0d6a32;
  stroke: #1b1220;
  stroke-width: 2px;
}
.shirt-v { fill: #f7f4ef; }
.tie { fill: var(--trim); }
.collar path { fill: #f7f4ef; }
.scarf { fill: #e23d3d; }
.zinc { fill: #fff; stroke: #1b1220; stroke-width: 2px; opacity: 1; }
.pleats { fill: none; stroke: #1b1220; stroke-width: 2; opacity: 0.35; }

.blush { fill: #ff4d73; opacity: 0; }
.band-flirt .blush { opacity: 0.38; }
.band-warm .blush { opacity: 0.6; }
.band-hot .blush,
.band-quiz .blush,
.band-bonus .blush { opacity: 0.85; animation: pulse 0.55s ease-in-out infinite; }

.mouth-smirk, .mouth-grin, .mouth-bite, .mouth-o, .mouth-wrecked { display: none; }
.band-cold .mouth-smirk { display: block; }
.band-flirt .mouth-grin { display: block; }
.band-warm .mouth-bite { display: block; }
.band-hot .mouth-o,
.band-quiz .mouth-o { display: block; }
.band-bonus .mouth-wrecked { display: block; }

.lid { transform: translateY(1px); }
.band-flirt .lid { transform: translateY(-4px); }
.band-warm .lid { transform: translateY(-8px); }
.band-hot .lid,
.band-quiz .lid,
.band-bonus .lid { transform: translateY(-14px); }

.lash { fill: none; stroke: #1b1220; stroke-width: 3.5px; stroke-linecap: round; }
.brow { fill: none; stroke: #1b1220; stroke-width: 5px; stroke-linecap: round; }
.band-hot .brow,
.band-quiz .brow,
.band-bonus .brow { transform: translateY(-5px); }

.blink {
  transform-box: fill-box;
  transform-origin: center;
  animation: blink 4.8s infinite;
}
.band-bonus .blink { animation: none; transform: scaleY(0.04); }

.pupil-shift { animation: dart 4.4s ease-in-out infinite; }
.heart-pupil, .spiral-pupil { display: none; }
.band-hot .pupil-shift,
.band-quiz .pupil-shift,
.band-bonus .pupil-shift { display: none; }
.band-hot .heart-pupil,
.band-quiz .heart-pupil { display: block; }
.band-bonus .spiral-pupil {
  display: block;
  transform-box: fill-box;
  transform-origin: center;
  animation: spin 0.8s linear infinite;
}

.patch {
  opacity: var(--patch, 0);
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(calc(0.72 + var(--patch, 0) * 0.9));
}
.patch-core { fill: #16324c; }
.patch-shine { fill: #fff; opacity: 0.55; }
.band-quiz .patch-shine,
.band-bonus .patch-shine { animation: glint 0.7s ease-in-out infinite; }

.sweat { opacity: 0; }
.band-warm .sweat { opacity: 0.8; }
.band-hot .sweat,
.band-quiz .sweat,
.band-bonus .sweat { opacity: 1; }
.drop { fill: #d7f6ff; stroke: #1b1220; stroke-width: 2; }
.band-warm .drop,
.band-hot .drop,
.band-quiz .drop,
.band-bonus .drop { animation: drip 1.15s ease-in infinite; }
.d2 { animation-delay: 0.4s; }

.steam { opacity: 0; }
.band-quiz .steam,
.band-bonus .steam { opacity: 0.95; }
.steam path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.8);
  stroke-width: 3.5;
  stroke-linecap: round;
  animation: rise 1.4s ease-in infinite;
}
.steam path:nth-child(2) { animation-delay: 0.2s; }
.steam path:nth-child(3) { animation-delay: 0.45s; }

.splats { opacity: 0; }
.band-bonus .splats { opacity: 1; }
.splat { fill: #f6f3ea; stroke: #1b1220; stroke-width: 3; }
.band-bonus .splat {
  transform-box: fill-box;
  transform-origin: center;
  animation: splatPop 0.45s cubic-bezier(.2, 1.5, .3, 1) both;
}
.s2 { animation-delay: 0.05s; }
.s3 { animation-delay: 0.08s; }
.s4 { animation-delay: 0.12s; }
.s5 { animation-delay: 0.04s; }
.s6 { animation-delay: 0.1s; }
.s7 { animation-delay: 0.16s; }
.s8 { animation-delay: 0.14s; }
.s9 { animation-delay: 0.18s; }

.body-rock {
  transform-box: fill-box;
  transform-origin: 50% 92%;
}
.band-cold .body-rock { transform: rotate(-3deg); }
.band-flirt .body-rock { animation: sway 1.7s ease-in-out infinite; }
.band-warm .body-rock { animation: sway 0.75s ease-in-out infinite; }
.band-hot .body-rock,
.band-quiz .body-rock { animation: squirm 0.32s ease-in-out infinite; }
.band-bonus .body-rock { animation: wobble 0.55s ease-in-out infinite; }

.head-lag {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}
.band-hot .head-lag,
.band-quiz .head-lag { animation: headlag 0.32s ease-in-out infinite; }
.band-bonus .head-lag { animation: headlag 0.55s ease-in-out infinite; }

.arm-flap { transform-box: fill-box; transform-origin: 50% 0%; }
.band-hot .arm-back .arm-flap,
.band-quiz .arm-back .arm-flap,
.band-bonus .arm-back .arm-flap { animation: flap-back 0.36s ease-in-out infinite; }
.band-hot .arm-front .arm-flap,
.band-quiz .arm-front .arm-flap,
.band-bonus .arm-front .arm-flap { animation: flap-front 0.36s ease-in-out infinite; }

.outfit-italian .arm-front .arm-pose {
  transform: rotate(-38deg);
  transform-box: fill-box;
  transform-origin: 50% 10%;
}

.is-pop .pop-wrap { animation: pop 0.4s ease; }
.is-quizzing .rig { animation: shake 0.07s linear 8; }
.is-talking .mouth { animation: yap 0.14s steps(2) infinite; transform-box: fill-box; transform-origin: center; }

@keyframes sway {
  0%, 100% { transform: rotate(-2.5deg); }
  50% { transform: rotate(2.5deg); }
}
@keyframes squirm {
  0%, 100% { transform: rotate(-4deg) translateY(0); }
  50% { transform: rotate(4.5deg) translateY(3px); }
}
@keyframes wobble {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2.5deg) translateY(2px); }
}
@keyframes headlag {
  0%, 100% { transform: rotate(3deg); }
  50% { transform: rotate(-3.5deg); }
}
@keyframes flap-back {
  0%, 100% { transform: rotate(8deg); }
  50% { transform: rotate(-12deg); }
}
@keyframes flap-front {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(16deg); }
}
@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.05, 0.96); }
  100% { transform: scale(1); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
@keyframes yap {
  50% { transform: translateY(2px) scaleY(0.9); }
}
@keyframes blink {
  0%, 90%, 100% { transform: scaleY(0.03); }
  94%, 97% { transform: scaleY(1); }
}
@keyframes dart {
  0%, 42% { transform: translate(0, 0); }
  55%, 74% { transform: translate(3px, 1px); }
  86%, 100% { transform: translate(0, 0); }
}
@keyframes drip {
  0% { transform: translateY(0); opacity: 1; }
  75% { transform: translateY(18px); opacity: 0; }
  100% { opacity: 0; }
}
@keyframes rise {
  0% { transform: translateY(8px); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(-18px); opacity: 0; }
}
@keyframes pulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}
@keyframes glint {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.85; }
}
@keyframes splatPop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}
@keyframes blobIn {
  0% { transform: scale(0) rotate(-12deg); }
  100% { transform: scale(1) rotate(0deg); }
}
@keyframes floatUp {
  0% { opacity: 0; transform: translateY(10px) rotate(45deg) scale(0.6); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-80px) rotate(45deg) scale(1); }
}
@keyframes burst {
  0% { transform: translate(-50%, -50%) scale(0.2) rotate(-8deg); opacity: 0; }
  40% { opacity: 1; }
  100% { transform: translate(-50%, -62%) scale(1) rotate(6deg); opacity: 0; }
}
@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-3px); }
  60% { transform: translateX(3px); }
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
