/* ================= WaspBee — Phase 1 ================= */

:root {
  --bg: #16130c;
  --bg-panel: #221d12;
  --honey: #f4b62a;
  --honey-deep: #c98d0e;
  --charcoal: #1c1a14;
  --ink: #f5ecd7;
  --ink-dim: #a99d80;
  --danger: #e0432e;
  --ok: #7ec850;
  --wasp-yellow: #ffd012;
  font-size: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: var(--bg);
  background-image: radial-gradient(ellipse at 50% -20%, #2c2410 0%, var(--bg) 60%);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.hidden { display: none !important; }

/* ---------- screens ---------- */
.screen {
  position: fixed; inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.screen.active { display: flex; }

/* ---------- title ---------- */
.title-wrap { text-align: center; max-width: 30rem; }

.fuse-logo { height: 1.7rem; display: block; margin: 0 auto; }
.presents {
  font-size: 0.7rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0.5rem 0 1rem;
}
.logo-manus {
  display: block;
  font-size: 0.34em;
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  margin-bottom: 0.1em;
}
.fuse-logo-footer { height: 1.2rem; margin-top: 1.6rem; opacity: 0.75; }

.logo {
  font-size: clamp(3rem, 14vw, 5.5rem);
  letter-spacing: -0.03em;
  line-height: 1;
}
.logo-bee { color: var(--honey); }
.logo-wasp {
  color: var(--charcoal);
  background: repeating-linear-gradient(135deg, var(--wasp-yellow) 0 12px, #111 12px 24px);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  font-style: italic;
  color: var(--ink-dim);
  margin: 0.4rem 0 1.6rem;
  font-size: 1.15rem;
}

.how { color: var(--ink-dim); line-height: 1.7; margin-bottom: 1.4rem; }
.how strong { color: var(--ink); }
.stung-word { color: var(--danger); }

.key-hints { color: var(--ink-dim); margin-bottom: 1.6rem; font-size: 1.05rem; }
.key {
  display: inline-block;
  min-width: 1.9rem;
  padding: 0.15rem 0.4rem;
  border-radius: 0.4rem;
  font-weight: 800;
  text-align: center;
  border-bottom: 3px solid rgba(0,0,0,0.45);
}
.key-bee  { background: var(--honey); color: #241a02; }
.key-wasp { background: var(--wasp-yellow); color: #111; }

.btn-big {
  font: inherit;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.06em;
  color: #241a02;
  background: linear-gradient(180deg, #ffcf56, var(--honey) 55%, var(--honey-deep));
  border: none;
  border-radius: 1rem;
  padding: 1rem 2.4rem;
  cursor: pointer;
  box-shadow: 0 6px 0 #7a5606, 0 10px 24px rgba(0,0,0,0.5);
  transition: transform 0.08s ease;
}
.btn-big:active { transform: translateY(4px); box-shadow: 0 2px 0 #7a5606; }

.best-line { margin-top: 1.2rem; color: var(--ink-dim); font-size: 0.95rem; }

/* ---------- game HUD ---------- */
#screen-game { justify-content: flex-start; gap: 0.75rem; padding-top: 0.9rem; }

.hud {
  width: min(92vw, 30rem);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.hud-item { display: flex; flex-direction: column; align-items: center; min-width: 4.5rem; }
.hud-label {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.hud-item span:last-child { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.hud-score span:last-child { color: var(--honey); font-size: 1.6rem; }

/* ---------- stage ---------- */
.stage-wrap { display: flex; justify-content: center; width: 100%; }

.stage {
  position: relative;
  width: min(92vw, 62vh, 30rem);
  aspect-ratio: 1;
  border-radius: 0.9rem;
  overflow: hidden;
  background: #000;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}

.zoomer {
  position: absolute; inset: 0;
  will-change: transform;
}
.zoomer svg { display: block; width: 100%; height: 100%; }
.zoomer img.photo { display: block; width: 100%; height: 100%; object-fit: cover; }
.zoomer.night { filter: grayscale(1) contrast(1.12) brightness(1.05); }

.ring {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.ring rect { fill: none; stroke-width: 3; vector-effect: non-scaling-stroke; }
#ring-track { stroke: rgba(255,255,255,0.12); }
#ring-fill  { stroke: var(--honey); stroke-linecap: round; transition: stroke 0.3s; }
#ring-fill.low { stroke: var(--danger); }

.mult-badge {
  position: absolute;
  top: 0.6rem; right: 0.6rem;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(244,182,42,0.5);
  color: var(--honey);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding: 0.25rem 0.6rem;
  border-radius: 2rem;
  font-size: 1rem;
  backdrop-filter: blur(4px);
}

/* ---------- verdict overlay ---------- */
.verdict {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(10, 8, 4, 0.72);
  backdrop-filter: blur(2px);
  text-align: center;
  padding: 1rem;
  animation: verdict-in 0.18s ease-out;
}
@keyframes verdict-in { from { opacity: 0; } to { opacity: 1; } }

.verdict-word { font-size: 2.6rem; font-weight: 900; letter-spacing: 0.04em; }
.verdict-word.good { color: var(--ok); }
.verdict-word.bad  { color: var(--danger); }
.verdict-word.meh  { color: var(--ink-dim); font-size: 2rem; }
.verdict-word.cat  { color: var(--wasp-yellow); font-size: 2rem; }

.verdict-points { font-size: 1.4rem; font-weight: 800; color: var(--honey); min-height: 1.6rem; }
.verdict-fact {
  color: var(--ink-dim);
  font-size: 0.98rem;
  line-height: 1.5;
  max-width: 22rem;
  font-style: italic;
}

/* ---------- deal-with-it meme (quick correct answers) ---------- */
.manu-meme {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.manu-wrap {
  position: relative;
  width: clamp(7rem, 38%, 10rem);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--honey);
  box-shadow: 0 8px 26px rgba(0,0,0,0.55);
  animation: manu-spin-in 0.55s cubic-bezier(0.22, 1.1, 0.36, 1) both;
}
.manu-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@keyframes manu-spin-in {
  from { transform: rotate(-720deg) scale(0); }
  to   { transform: rotate(0deg) scale(1); }
}
.dwi-glasses {
  position: absolute;
  left: 50%;
  width: 64%;
  transform: translateX(-50%);
  top: -34%;
  animation: dwi-drop 0.45s ease-in 0.6s forwards;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.4));
}
@keyframes dwi-drop {
  to { top: 25%; }
}
.dwi-text {
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 0.22em;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
  opacity: 0;
  animation: dwi-fade 0.25s ease-out 1.05s forwards;
}
@keyframes dwi-fade { to { opacity: 1; } }

.vignette {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(224, 67, 46, 0.55) 100%);
}
.vignette.stung { animation: sting-flash 0.7s ease-out; }
@keyframes sting-flash { 0% { opacity: 1; } 100% { opacity: 0; } }

.stage.shake { animation: shake 0.45s; }
@keyframes shake {
  0%, 100% { transform: translate(0,0); }
  15% { transform: translate(-8px, 3px) rotate(-1deg); }
  30% { transform: translate(7px, -4px) rotate(1deg); }
  45% { transform: translate(-6px, -3px); }
  60% { transform: translate(5px, 4px) rotate(0.6deg); }
  75% { transform: translate(-3px, 2px); }
}

.stage.pop { animation: pop 0.3s ease-out; }
@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.035); }
  100% { transform: scale(1); }
}

/* ---------- answer buttons ---------- */
.answers {
  display: flex;
  gap: 0.8rem;
  width: min(92vw, 30rem);
}
.btn-answer {
  flex: 1;
  font: inherit;
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  padding: 1.1rem 0;
  border: none;
  border-radius: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: transform 0.06s ease, filter 0.15s;
}
.btn-answer:active { transform: scale(0.96); }
.btn-answer:disabled { filter: grayscale(0.7) brightness(0.55); cursor: default; }

.btn-key {
  font-size: 0.8rem;
  font-weight: 800;
  background: rgba(0,0,0,0.28);
  color: inherit;
  border-radius: 0.35rem;
  padding: 0.15rem 0.45rem;
  border-bottom: 2px solid rgba(0,0,0,0.4);
}

.btn-bee {
  background: linear-gradient(180deg, #ffcf56, var(--honey) 60%, var(--honey-deep));
  color: #241a02;
  box-shadow: 0 5px 0 #7a5606;
}
.btn-wasp {
  background: repeating-linear-gradient(135deg, var(--wasp-yellow) 0 14px, #15130a 14px 28px);
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9), 0 0 6px rgba(0,0,0,0.7);
  box-shadow: 0 5px 0 #6b5800;
}
.btn-wasp .btn-key { background: rgba(0,0,0,0.55); }

.btn-mimic {
  background: linear-gradient(180deg, #4bd0f6, #2ba6d6 60%, #1f86b0);
  color: #04222e;
  box-shadow: 0 5px 0 #14586f;
  max-width: 8rem;
}
.btn-mimic .btn-key { background: rgba(0,0,0,0.3); }
.answers.has-mimic .btn-answer { font-size: 1.25rem; }

.streak-line {
  height: 1.4rem;
  color: var(--honey);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

/* ---------- results ---------- */
.results-wrap {
  text-align: center;
  max-width: 32rem;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  padding: 0.5rem;
}
.results-kicker {
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  color: var(--ink-dim);
  margin-bottom: 0.4rem;
}
.rank-title {
  font-size: clamp(1.7rem, 7vw, 2.6rem);
  color: var(--honey);
  line-height: 1.1;
  margin-bottom: 1.2rem;
}
.results-stats {
  display: flex;
  justify-content: center;
  gap: 2.2rem;
  margin-bottom: 1rem;
}
.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 1.9rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink-dim); }

.perfect-banner {
  color: #241a02;
  background: linear-gradient(90deg, var(--honey), #ffe27a, var(--honey));
  font-weight: 900;
  border-radius: 0.6rem;
  padding: 0.5rem;
  margin-bottom: 1rem;
}

.round-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.45rem;
  margin: 0 auto 1.2rem;
  max-width: 24rem;
}
.chip {
  background: var(--bg-panel);
  border-radius: 0.55rem;
  padding: 0.45rem 0.2rem;
  font-size: 0.78rem;
  line-height: 1.35;
  border: 1px solid rgba(255,255,255,0.06);
}
.chip .chip-mark { font-size: 1rem; display: block; }
.chip .chip-zoom { color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.chip.chip-good { border-color: rgba(126, 200, 80, 0.4); }
.chip.chip-bad  { border-color: rgba(224, 67, 46, 0.45); }

#res-best { margin: 0 0 1.2rem; }
#res-best.new-best { color: var(--honey); font-weight: 800; }
.chip.chip-mimic { border-color: rgba(75, 208, 246, 0.6); }
.chip.chip-cat { border-color: rgba(255, 208, 18, 0.7); }

/* ================= Phase 3/4 additions ================= */

/* mute button */
.btn-mute {
  position: fixed;
  top: 0.6rem; right: 0.6rem;
  z-index: 40;
  width: 2.4rem; height: 2.4rem;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.btn-mute:active { transform: scale(0.92); }

/* streak flame on the score */
.hud-score span:last-child.streaking,
#hud-score.streaking {
  color: #ff8a1e;
  text-shadow: 0 0 8px rgba(255, 138, 30, 0.8), 0 0 18px rgba(244, 90, 20, 0.6);
  animation: flame 0.5s ease-in-out infinite alternate;
}
@keyframes flame { from { transform: translateY(0) scale(1); } to { transform: translateY(-1px) scale(1.06); } }

/* round-intro banner (non-blocking top strip) */
.round-banner {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 6;
  padding: 0.5rem 0.6rem;
  text-align: center;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(180deg, rgba(10,8,4,0.9), rgba(10,8,4,0));
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}
.round-banner.show { animation: banner 2s ease-out forwards; }
@keyframes banner {
  0% { opacity: 0; transform: translateY(-8px); }
  12% { opacity: 1; transform: translateY(0); }
  75% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-8px); }
}

/* Cage "you don't say" fail meme */
.cage-meme {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}
.cage-wrap {
  width: clamp(9rem, 62%, 15rem);
  border-radius: 0.7rem;
  overflow: hidden;
  border: 4px solid var(--danger);
  box-shadow: 0 8px 26px rgba(0,0,0,0.6);
  animation: cage-in 0.5s cubic-bezier(0.34, 1.4, 0.5, 1) both;
}
.cage-wrap img { display: block; width: 100%; height: auto; }
@keyframes cage-in {
  0% { transform: scale(0.2) rotate(8deg); opacity: 0; }
  60% { transform: scale(1.08) rotate(-3deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}
.cage-text {
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  color: var(--danger);
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
  animation: cage-shake 0.4s ease-in-out 0.5s 2;
}
@keyframes cage-shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-4px) rotate(-1deg); }
  75% { transform: translateX(4px) rotate(1deg); }
}

/* subliminal Bea Arthur flash */
.bea-flash {
  position: fixed; inset: 0;
  z-index: 60;
  background: #000 center/contain no-repeat;
  background-image: url('assets/bea-arthur.jpg');
  opacity: 0;
  pointer-events: none;
}
.bea-flash.flash { animation: bea 0.18s steps(1) 1; }
@keyframes bea {
  0% { opacity: 0; }
  30% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; }
}

/* confetti hexagons */
.confetti-layer {
  position: fixed; inset: 0;
  z-index: 50;
  pointer-events: none;
  overflow: hidden;
}
.hexi {
  position: absolute;
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  opacity: 0.95;
  will-change: transform, opacity;
  animation-name: hexfall;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
}
@keyframes hexfall {
  0% { transform: translate(0,0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .bea-flash.flash { animation-duration: 0.12s; }
  .hexi { display: none; }
}
