/* Icebreaker: component styles.
   Rule of thumb for 60fps on budget Android: only animate transform and opacity.
   Blurs and shadows are painted once on their own layer, never animated. */

:root {
  --bg: #071428;
  --bg-top: #0c2546;
  --surface: rgba(12, 40, 72, 0.55);
  --surface-strong: #0c2546;
  --line: rgba(186, 230, 253, 0.2);
  --text: #f0f9ff;
  --muted: #94a3b8;
  --ice: #7dd3fc;
  --ice-bright: #bae6fd;
  --ice-strong: #38bdf8;
  --ice-deep: #0284c7;
  --frost: #e0f2fe;
  --indigo: #4f46e5;
  --love: #ff3cac;
  --match: #34d399;
  --clash: #fb7185;
  --radius: 1.25rem;
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* The hidden attribute must win over Tailwind display utilities like `flex`. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { font-family: var(--font); background: var(--bg); color: var(--text); overflow-x: hidden; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; border-radius: 0.5rem; }

/* ---------- Icy night background + snowfall ---------- */
.bg-ice {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(90% 55% at 50% -12%, rgba(125, 211, 252, 0.3), transparent 70%),
    radial-gradient(55% 40% at 88% 28%, rgba(255, 60, 172, 0.08), transparent 70%),
    radial-gradient(70% 45% at 0% 105%, rgba(224, 242, 254, 0.14), transparent 70%),
    radial-gradient(70% 45% at 100% 105%, rgba(224, 242, 254, 0.12), transparent 70%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 58%, #040b18 100%);
}
/* Frosted-window edges: painted once, never animated. */
.bg-ice::after {
  content: ""; position: absolute; inset: 0;
  box-shadow: inset 0 0 90px rgba(186, 230, 253, 0.16), inset 0 0 22px rgba(224, 242, 254, 0.12);
}
/* A soft snowdrift along the bottom. */
.bg-ice::before {
  content: ""; position: absolute; left: -10%; right: -10%; bottom: -60px; height: 140px;
  background: radial-gradient(60% 100% at 25% 100%, rgba(224, 242, 254, 0.14), transparent 70%),
              radial-gradient(55% 100% at 78% 100%, rgba(224, 242, 254, 0.12), transparent 70%);
}

/* Each snow layer is one tiled image moved with a transform: GPU-only, no repaints.
   It moves exactly one tile per loop, so the loop is seamless. */
.snow {
  --tile: 240px;
  position: fixed; left: 0; right: 0; top: calc(var(--tile) * -1); height: calc(100% + var(--tile));
  z-index: 1; pointer-events: none; background-repeat: repeat; background-size: var(--tile) var(--tile);
  will-change: transform; animation: snowfall 24s linear infinite;
}
.snow-1 {
  opacity: 0.55;
  background-image:
    radial-gradient(circle at 20px 30px, #fff 1.2px, transparent 2px),
    radial-gradient(circle at 110px 80px, #fff 1px, transparent 1.8px),
    radial-gradient(circle at 190px 20px, #fff 1.3px, transparent 2px),
    radial-gradient(circle at 60px 150px, #fff 1px, transparent 1.8px),
    radial-gradient(circle at 160px 190px, #fff 1.2px, transparent 2px),
    radial-gradient(circle at 220px 120px, #fff 0.9px, transparent 1.6px);
}
.snow-2 {
  --tile: 320px; opacity: 0.7; animation-duration: 16s;
  background-image:
    radial-gradient(circle at 40px 60px, #fff 1.8px, transparent 2.6px),
    radial-gradient(circle at 210px 140px, #fff 1.6px, transparent 2.4px),
    radial-gradient(circle at 280px 260px, #fff 2px, transparent 2.8px),
    radial-gradient(circle at 120px 280px, #fff 1.5px, transparent 2.3px);
}
.snow-3 {
  --tile: 420px; opacity: 0.45; animation-duration: 11s;
  background-image:
    radial-gradient(circle at 90px 110px, #fff 2.6px, transparent 3.6px),
    radial-gradient(circle at 330px 320px, #fff 2.3px, transparent 3.3px);
  filter: blur(0.6px);
}
@keyframes snowfall { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, var(--tile), 0); } }

/* ---------- Header ---------- */
.brand { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.brand-logo { width: 2.1rem; height: 2.1rem; filter: drop-shadow(0 0 10px rgba(125, 211, 252, 0.45)); }
.brand-name {
  font-weight: 900; font-size: 1.05rem; letter-spacing: 0.01em;
  background: linear-gradient(90deg, #ffffff, var(--ice-bright) 60%, var(--ice));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.mode-pill {
  font-size: 0.7rem; padding: 0.25rem 0.6rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ice-bright); background: rgba(3, 105, 161, 0.3);
}
.icon-btn {
  width: 2.25rem; height: 2.25rem; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(7, 20, 40, 0.6); font-size: 1rem; cursor: pointer; display: grid; place-items: center;
}
.icon-btn[aria-pressed="false"] { opacity: 0.6; }

.eyebrow { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ice-bright); font-weight: 700; }
.text-neon {
  background: linear-gradient(90deg, #67e8f9, #c4b5fd 55%, #f9a8d4);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.live-counter {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.8rem; border-radius: 999px;
  font-size: 0.78rem; color: var(--frost); background: rgba(3, 105, 161, 0.3); border: 1px solid rgba(125, 211, 252, 0.35);
}

/* ---------- Buttons ---------- */
.btn-neon {
  position: relative; display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  min-height: 3.25rem; padding: 0.85rem 1.25rem; border-radius: 999px; border: 0;
  font-weight: 800; letter-spacing: 0.01em; color: #fff; cursor: pointer;
  background: linear-gradient(95deg, var(--ice-deep), #2563eb 55%, var(--indigo));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18) inset, 0 10px 30px -8px rgba(14, 165, 233, 0.75), 0 0 40px -10px rgba(125, 211, 252, 0.9);
  transition: transform 0.15s var(--ease-out), opacity 0.15s;
}
.btn-neon:active { transform: scale(0.97); }
.btn-neon:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-xl { min-height: 3.75rem; font-size: 1.1rem; }
.btn-xl::after {
  content: ""; position: absolute; inset: -6px; border-radius: inherit; z-index: -1;
  background: linear-gradient(95deg, #67e8f9, var(--indigo));
  filter: blur(14px); opacity: 0.5; animation: breathe 2.6s ease-in-out infinite;
}
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; text-align: center; text-decoration: none;
  min-height: 3rem; padding: 0.7rem 1rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(7, 20, 40, 0.55); color: var(--frost); font-weight: 600;
  transition: transform 0.15s var(--ease-out), border-color 0.15s;
}
.btn-ghost:active { transform: scale(0.97); }
.btn-ghost:hover { border-color: rgba(125, 211, 252, 0.6); }
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.45rem 0.9rem; border-radius: 999px;
  border: 1px solid rgba(251, 113, 133, 0.45); background: rgba(136, 19, 55, 0.25); font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.chip.is-on { background: linear-gradient(95deg, #e11d48, var(--love)); border-color: transparent; }

/* ---------- Cards and forms (frosted glass) ---------- */
.card, .greeting-card, .prompt-card, .answer-bubble, .pick-card, .result-row {
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.card { padding: 1.25rem; }
.greeting-card { padding: 1.5rem 1.25rem; box-shadow: 0 0 50px -18px rgba(125, 211, 252, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.prompt-card { padding: 1.25rem; box-shadow: 0 0 40px -16px rgba(125, 211, 252, 0.9); }
.answer-bubble { padding: 1rem 1.1rem; }
.pick-card { padding: 0.85rem 1rem; }

.field { display: block; }
.field-label { display: block; font-size: 0.85rem; font-weight: 600; color: #e2e8f0; margin-bottom: 0.4rem; }
.field-label .opt { color: var(--muted); font-weight: 400; }
.field-hint { display: block; margin-top: 0.35rem; font-size: 0.72rem; color: var(--muted); }
.field-error { display: block; margin-top: 0.35rem; font-size: 0.75rem; color: var(--clash); }
.input {
  width: 100%; border-radius: 0.9rem; border: 1px solid var(--line); background: rgba(4, 14, 30, 0.92);
  color: var(--text); padding: 0.8rem 0.95rem; font-size: 1rem; /* 16px stops iOS zoom-on-focus */
  transition: border-color 0.15s, box-shadow 0.15s; resize: none;
}
.input::placeholder { color: #64748b; }
.input:focus { outline: none; border-color: var(--ice-strong); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25); }
.input[aria-invalid="true"] { border-color: var(--clash); }

.toggle { display: flex; align-items: center; gap: 0.75rem; font-size: 0.9rem; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-ui { flex: none; position: relative; width: 2.6rem; height: 1.5rem; border-radius: 999px; background: #334155; transition: background 0.2s; }
.toggle-ui::after {
  content: ""; position: absolute; top: 0.2rem; left: 0.2rem; width: 1.1rem; height: 1.1rem; border-radius: 999px;
  background: #fff; transition: transform 0.2s var(--ease-out);
}
.toggle input:checked + .toggle-ui { background: linear-gradient(95deg, var(--ice-deep), var(--indigo)); }
.toggle input:checked + .toggle-ui::after { transform: translateX(1.1rem); }
.toggle input:focus-visible + .toggle-ui { outline: 2px solid var(--ice); outline-offset: 2px; }
.toggle.is-disabled { opacity: 0.45; pointer-events: none; }

/* ---------- The Ice Capsule: tap -> hammer swings -> cracks -> shatters ---------- */
.ice {
  position: relative; display: block; width: min(64vw, 240px); aspect-ratio: 1;
  border: 0; padding: 0; background: none; cursor: pointer;
  animation: float 4.2s ease-in-out infinite;
}
.ice > * { pointer-events: none; }
.ice-glow {
  position: absolute; inset: -24%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(125, 211, 252, 0.5), rgba(56, 189, 248, 0.2) 55%, transparent 78%);
  filter: blur(14px); animation: breathe 3s ease-in-out infinite;
}
.ice-heart {
  position: absolute; left: 50%; top: 54%; z-index: 1; transform: translate(-50%, -50%);
  font-size: 4.2rem; line-height: 1; color: var(--love);
  text-shadow: 0 0 18px rgba(255, 60, 172, 0.9), 0 0 40px rgba(255, 60, 172, 0.5);
}
.ice-shards { position: absolute; inset: 0; z-index: 2; }
.ice-shards > i {
  position: absolute; inset: 0; border-radius: 1.5rem; clip-path: var(--clip);
  background:
    radial-gradient(70% 45% at 22% 12%, rgba(255, 255, 255, 0.85), transparent 60%),
    radial-gradient(30% 20% at 78% 80%, rgba(255, 255, 255, 0.35), transparent 70%),
    linear-gradient(155deg, rgba(240, 249, 255, 0.88), rgba(165, 228, 255, 0.55) 38%, rgba(14, 165, 233, 0.42) 72%, rgba(186, 230, 253, 0.8));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6), inset 0 -14px 28px rgba(3, 105, 161, 0.4), inset 0 12px 20px rgba(255, 255, 255, 0.35);
  transition: transform 0.75s var(--ease-out), opacity 0.75s ease;
}
.ice-cracks { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; overflow: visible; }
/* Hidden until the hammer lands, then "drawn" outward from the impact point. The ice block is
   square, so stroke widths in viewBox units stay even (no vector-effect: it breaks dash maths). */
.ice-cracks polyline {
  fill: none; stroke: #ffffff; stroke-width: 0.9; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 1 1; stroke-dashoffset: 1; opacity: 0;
  filter: drop-shadow(0 0 1.5px rgba(186, 230, 253, 0.95));
}
.ice-flash {
  position: absolute; left: 58%; top: 8%; z-index: 4; width: 70%; aspect-ratio: 1; transform: translate(-50%, -50%) scale(0.2);
  border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 255, 0.95), rgba(186, 230, 253, 0.4) 50%, transparent 72%);
  opacity: 0;
}
/* Hammer pivots around the hand (right end of the handle). Resting = raised. */
.ice-hammer {
  position: absolute; z-index: 5; left: 44%; top: -30%; width: 70%; aspect-ratio: 2 / 1;
  transform-origin: 93% 43%; transform: rotate(12deg);
  animation: hammer-idle 1.8s ease-in-out infinite alternate;
  filter: drop-shadow(0 6px 10px rgba(2, 6, 23, 0.55));
}
.ice-hammer svg { width: 100%; height: 100%; display: block; }
.ice-hint { font-size: 0.85rem; color: var(--ice-bright); letter-spacing: 0.06em; animation: breathe 2.2s ease-in-out infinite; }

.ice.is-hit { animation: ice-shake 0.32s linear 0.3s 1; }
.ice.is-hit .ice-hammer { animation: hammer-swing 0.52s cubic-bezier(0.5, 0, 0.75, 0) forwards; }
.ice.is-hit .ice-cracks polyline { animation: crack-draw 0.35s ease-out 0.3s forwards; }
.ice.is-hit .ice-flash { animation: flash 0.4s ease-out 0.3s 1; }
.ice.is-shattered { animation: none; }
.ice.is-shattered .ice-shards > i { transform: translate(var(--tx), var(--ty)) rotate(var(--r)) scale(0.85); opacity: 0; }
.ice.is-shattered .ice-cracks, .ice.is-shattered .ice-glow { opacity: 0; transition: opacity 0.2s; }
.ice.is-shattered .ice-hammer { opacity: 0; transition: opacity 0.3s; }
.ice.is-shattered .ice-heart { animation: heart-free 0.6s var(--ease-pop) forwards; }

/* ---------- Game ---------- */
.presence { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.presence-dot { width: 0.5rem; height: 0.5rem; border-radius: 999px; background: #64748b; }
.presence[data-state="online"] { color: #a7f3d0; }
.presence[data-state="online"] .presence-dot { background: var(--match); box-shadow: 0 0 10px var(--match); }
.presence[data-state="away"] .presence-dot { background: #f59e0b; }
.presence[data-state="offline"] .presence-dot { background: var(--clash); }

.progress { height: 0.35rem; border-radius: 999px; background: rgba(148, 163, 184, 0.18); overflow: hidden; }
.progress > span {
  display: block; height: 100%; width: 100%; transform-origin: left; transform: scaleX(0);
  background: linear-gradient(90deg, #67e8f9, var(--ice-strong), var(--indigo)); transition: transform 0.4s var(--ease-out);
}
.sponsor-line { font-size: 0.72rem; color: #a5b4fc; }
.seat-notice {
  padding: 1rem; border-radius: var(--radius); border: 1px solid rgba(245, 158, 11, 0.45);
  background: rgba(120, 53, 15, 0.25); color: #fde68a; font-size: 0.9rem; text-align: center;
}

.vs-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 0.6rem; }
.vs { align-self: center; font-weight: 900; font-size: 0.85rem; color: var(--ice-bright); text-shadow: 0 0 14px rgba(125, 211, 252, 0.9); }
.choice {
  width: 100%; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
  font-weight: 700; cursor: pointer; text-align: center; contain: layout paint;
  transition: transform 0.15s var(--ease-out), border-color 0.2s, background-color 0.2s, opacity 0.2s;
}
.choice-tall { min-height: 9rem; padding: 1rem 0.75rem; font-size: 1.05rem; display: grid; place-items: center; }
.choice-row { min-height: 3.5rem; padding: 0.85rem 1rem; text-align: left; font-weight: 600; }
.choice:active { transform: scale(0.97); }
.choice.is-picked { border-color: var(--ice); background: rgba(3, 105, 161, 0.35); box-shadow: 0 0 24px -6px rgba(125, 211, 252, 0.85); }
.choice.is-theirs { border-color: #c4b5fd; }
.choice.is-picked.is-theirs { border-color: var(--match); background: rgba(5, 150, 105, 0.25); box-shadow: 0 0 24px -6px rgba(52, 211, 153, 0.9); }
.choice:disabled { cursor: default; }
.choice:disabled:not(.is-picked):not(.is-theirs) { opacity: 0.45; }

.guess-box {
  padding: 1rem; border-radius: var(--radius); border: 1px dashed rgba(186, 230, 253, 0.5);
  background: rgba(3, 105, 161, 0.18); text-align: center;
}
.guess-btn {
  min-height: 2.75rem; padding: 0.6rem 0.9rem; border-radius: 0.9rem; border: 1px solid var(--line);
  background: rgba(2, 10, 24, 0.5); font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: transform 0.15s var(--ease-out), border-color 0.15s;
}
.guess-btn:active { transform: scale(0.97); }
.guess-btn:hover { border-color: rgba(125, 211, 252, 0.7); }
.guess-result { font-size: 0.9rem; font-weight: 600; color: var(--frost); text-align: center; }

.status {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem; text-align: center;
  padding: 0.9rem 1rem; border-radius: var(--radius); border: 1px dashed var(--line); color: var(--frost); font-size: 0.9rem;
}
.dots { display: inline-flex; gap: 0.25rem; flex: none; }
.dots i { width: 0.35rem; height: 0.35rem; border-radius: 999px; background: var(--ice); animation: dot 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }

/* Spin the wheel: one conic-gradient, rotated with a single transform transition. */
.wheel-wrap { position: relative; width: min(72vw, 270px); aspect-ratio: 1; margin-inline: auto; }
.wheel {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(#0284c7 0 45deg, #1e3a8a 45deg 90deg, #0ea5e9 90deg 135deg, #312e81 135deg 180deg,
    #0891b2 180deg 225deg, #1d4ed8 225deg 270deg, #db2777 270deg 315deg, #4f46e5 315deg 360deg);
  box-shadow: 0 0 0 4px rgba(224, 242, 254, 0.25), 0 0 50px -6px rgba(125, 211, 252, 0.75);
  transition: transform 3.4s cubic-bezier(0.12, 0.8, 0.1, 1);
}
.wheel > span {
  position: absolute; left: 50%; top: 50%; width: 2rem; margin-left: -1rem; text-align: center;
  font-weight: 800; font-size: 1rem; color: #fff;
  transform: rotate(calc(var(--i) * 45deg + 22.5deg)) translateY(-6.5em);
}
.wheel-pointer {
  position: absolute; left: 50%; top: -0.6rem; z-index: 2; width: 0; height: 0; margin-left: -0.75rem;
  border-left: 0.75rem solid transparent; border-right: 0.75rem solid transparent; border-top: 1.3rem solid #fff;
  filter: drop-shadow(0 0 8px rgba(125, 211, 252, 0.9));
}
.wheel-hub {
  position: absolute; left: 50%; top: 50%; width: 3rem; height: 3rem; margin: -1.5rem 0 0 -1.5rem;
  display: grid; place-items: center; border-radius: 999px; background: var(--bg); color: var(--love);
  box-shadow: 0 0 0 3px rgba(224, 242, 254, 0.25);
}

/* ---------- Match / Disagree breakout (one reusable overlay, pooled sparks) ---------- */
.breakout { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; pointer-events: none; }
.breakout-ring {
  position: absolute; width: 60vmin; height: 60vmin; border-radius: 50%;
  border: 3px solid currentColor; box-shadow: 0 0 60px currentColor, inset 0 0 60px currentColor; opacity: 0;
}
.breakout-text {
  position: relative; font-size: clamp(3rem, 16vw, 5.5rem); font-weight: 900; letter-spacing: -0.02em; color: #fff;
  -webkit-text-stroke: 2px var(--glow, var(--ice));
  text-shadow: 0 0 10px var(--glow, var(--ice)), 0 0 28px var(--glow, var(--ice)), 0 0 60px var(--glow, var(--ice)); opacity: 0;
}
.breakout-sparks { position: absolute; left: 50%; top: 50%; }
.breakout-sparks > i {
  position: absolute; width: 0.55rem; height: 0.55rem; margin: -0.275rem; border-radius: 2px; transform: rotate(45deg);
  background: currentColor; box-shadow: 0 0 12px currentColor; opacity: 0;
}
.breakout.is-long .breakout-text { font-size: clamp(2.2rem, 11vw, 4rem); text-align: center; padding: 0 1rem; }
.is-paused [data-panel], .is-paused [data-ref="guessBox"], .is-paused [data-ref="nextBtn"] { opacity: 0.4; pointer-events: none; }
.breakout.is-match { color: var(--match); --glow: var(--match); }
.breakout.is-clash { color: var(--clash); --glow: var(--clash); }
.breakout.is-playing .breakout-text { animation: breakout-text 1.3s var(--ease-pop) forwards; }
.breakout.is-playing .breakout-ring { animation: breakout-ring 1.1s var(--ease-out) forwards; }
.breakout.is-playing .breakout-sparks > i { animation: spark 0.95s var(--ease-out) forwards; }

/* ---------- Results ---------- */
.score-ring {
  --p: 0; position: relative; width: 11rem; height: 11rem; margin-inline: auto; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(#67e8f9 0, var(--ice-strong) calc(var(--p) * 0.5%), var(--indigo) calc(var(--p) * 1%), rgba(148, 163, 184, 0.15) 0);
  box-shadow: 0 0 60px -10px rgba(125, 211, 252, 0.8);
}
.score-ring::before { content: ""; position: absolute; inset: 0.7rem; border-radius: 50%; background: var(--bg); }
.score-ring > span { position: relative; font-size: 2.6rem; font-weight: 900; }
.big-answer {
  padding: 0.9rem 1rem; border-radius: var(--radius); background: rgba(190, 24, 93, 0.2);
  border: 1px solid rgba(255, 60, 172, 0.45); color: #fbcfe8; font-weight: 600;
}
.result-row { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.75rem 0.9rem; font-size: 0.88rem; }
.result-badge { flex: none; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.08em; padding: 0.2rem 0.5rem; border-radius: 999px; margin-top: 0.1rem; }
.result-badge.is-match { background: rgba(52, 211, 153, 0.18); color: #6ee7b7; }
.result-badge.is-clash { background: rgba(251, 113, 133, 0.18); color: #fda4af; }
.result-badge.is-spark { background: rgba(125, 211, 252, 0.18); color: var(--ice-bright); }
.unmasked { font-size: 1.15rem; font-weight: 700; color: #fbcfe8; }

/* ---------- Sponsors, brand page, stats ---------- */
.sponsor-card {
  padding: 1rem 1.1rem; border-radius: var(--radius); border: 1px solid rgba(165, 180, 252, 0.3);
  background: linear-gradient(135deg, rgba(12, 40, 72, 0.75), rgba(49, 46, 129, 0.45));
}
.sponsor-label { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: #a5b4fc; font-weight: 700; }
.sponsor-cta {
  flex: none; padding: 0.45rem 0.9rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700; color: #fff;
  background: linear-gradient(95deg, var(--ice-deep), var(--indigo)); text-decoration: none;
}
.stat-tile { padding: 0.9rem; border-radius: 1rem; border: 1px solid var(--line); background: var(--surface); text-align: center; }
.stat-value { font-size: 1.6rem; font-weight: 900; }
.stat-label { font-size: 0.72rem; color: var(--muted); }
.table-wrap { max-width: 100%; overflow-x: auto; border-radius: 1rem; border: 1px solid var(--line); }
.stats-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.stats-table th, .stats-table td { padding: 0.5rem 0.6rem; text-align: right; white-space: nowrap; border-bottom: 1px solid rgba(148, 163, 184, 0.12); }
.stats-table th:first-child, .stats-table td:first-child { text-align: left; }
.stats-table th { color: var(--ice-bright); font-weight: 700; background: rgba(12, 40, 72, 0.7); }

/* ---------- Viral banner ---------- */
.viral-banner {
  position: fixed; left: 50%; bottom: calc(0.9rem + env(safe-area-inset-bottom)); z-index: 40;
  display: flex; align-items: center; gap: 0.25rem; width: min(calc(100% - 2rem), 26rem); transform: translateX(-50%);
  padding: 0.35rem 0.35rem 0.35rem 0.5rem; border-radius: 999px;
  background: rgba(7, 20, 40, 0.94); border: 1px solid rgba(125, 211, 252, 0.45);
  box-shadow: 0 10px 40px -10px rgba(14, 165, 233, 0.7);
  animation: rise-in 0.5s var(--ease-pop) both;
}
.viral-cta { flex: 1; display: flex; align-items: center; gap: 0.55rem; padding: 0.4rem; text-align: left; font-size: 0.8rem; line-height: 1.25; background: none; border: 0; cursor: pointer; }
.viral-strong { font-weight: 700; color: var(--ice-bright); }
.viral-long { color: #cbd5e1; }
.viral-spark { font-size: 1.1rem; }
.viral-x { flex: none; width: 2rem; height: 2rem; border-radius: 999px; border: 0; background: rgba(148, 163, 184, 0.12); color: var(--muted); cursor: pointer; }
body[data-view="game"] .viral-banner,
body[data-view="stats"] .viral-banner,
body[data-view="advertise"] .viral-banner { display: none; }

/* ---------- Modal, toast, network banner ---------- */
.modal { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(2, 6, 23, 0.75); animation: fade-in 0.2s ease both; }
.modal-sheet {
  position: relative; width: 100%; max-width: 28rem; max-height: 92vh; overflow-y: auto;
  padding: 1.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
  border-radius: 1.5rem 1.5rem 0 0; background: #0a1c36; border: 1px solid var(--line); border-bottom: 0;
  animation: sheet-up 0.35s var(--ease-out) both;
}
@media (min-width: 640px) {
  .modal { align-items: center; }
  .modal-sheet { border-radius: 1.5rem; border-bottom: 1px solid var(--line); }
}
.modal-x { position: absolute; right: 0.9rem; top: 0.9rem; width: 2.2rem; height: 2.2rem; border-radius: 999px; border: 0; background: rgba(148, 163, 184, 0.12); cursor: pointer; }
.method { min-height: 2.75rem; border-radius: 0.8rem; border: 1px solid var(--line); background: rgba(2, 10, 24, 0.5); font-size: 0.78rem; font-weight: 600; cursor: pointer; }
.method.is-active { border-color: var(--ice); background: rgba(3, 105, 161, 0.3); }
.share-preview { display: grid; place-items: center; min-height: 18rem; border-radius: 1rem; background: rgba(2, 10, 24, 0.6); overflow: hidden; }
.share-preview img { width: auto; max-width: 100%; max-height: 52vh; border-radius: 0.75rem; }

.spinner { width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 3px solid rgba(125, 211, 252, 0.25); border-top-color: var(--ice); animation: spin 0.8s linear infinite; }
.boot-loader { display: flex; justify-content: center; gap: 0.4rem; padding-top: 30vh; }
.boot-loader span { width: 0.6rem; height: 0.6rem; border-radius: 999px; background: var(--ice); animation: dot 1.2s infinite ease-in-out; }
.boot-loader span:nth-child(2) { animation-delay: 0.15s; }
.boot-loader span:nth-child(3) { animation-delay: 0.3s; }

.toast {
  position: fixed; left: 50%; top: calc(1rem + env(safe-area-inset-top)); z-index: 80; transform: translateX(-50%);
  max-width: calc(100% - 2rem); padding: 0.7rem 1rem; border-radius: 0.9rem; font-size: 0.85rem;
  background: #0c2546; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  animation: toast-in 0.25s var(--ease-out) both;
}
.toast[data-tone="error"] { border-color: rgba(251, 113, 133, 0.6); }
.toast[data-tone="ok"] { border-color: rgba(52, 211, 153, 0.6); }

.net-banner {
  position: relative; z-index: 50; display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.55rem 1rem; font-size: 0.78rem; text-align: center; background: #451a03; color: #fde68a;
}
.net-dot { width: 0.5rem; height: 0.5rem; border-radius: 999px; background: #f59e0b; }

/* ---------- Entry animations ---------- */
.view-enter { animation: view-in 0.35s var(--ease-out) both; }
.pop-in { animation: pop-in 0.5s var(--ease-pop) both; }

@keyframes view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { 0% { opacity: 0; transform: scale(0.82); } 100% { opacity: 1; transform: scale(1); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes breathe { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
@keyframes hammer-idle { from { transform: rotate(9deg); } to { transform: rotate(16deg); } }
@keyframes hammer-swing {
  0% { transform: rotate(12deg); }
  40% { transform: rotate(34deg); }   /* wind up */
  62% { transform: rotate(-5deg); }   /* SMASH */
  78% { transform: rotate(3deg); }
  100% { transform: rotate(0deg); }
}
@keyframes ice-shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5px, 2px) rotate(-1deg); }
  40% { transform: translate(4px, -2px) rotate(1deg); }
  60% { transform: translate(-3px, 1px); }
  80% { transform: translate(2px, -1px); }
}
@keyframes crack-draw { from { opacity: 1; } to { opacity: 1; stroke-dashoffset: 0; } }
@keyframes flash { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.2); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.3); } }
@keyframes heart-free { 0% { transform: translate(-50%, -50%) scale(1); } 60% { transform: translate(-50%, -50%) scale(1.6); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1.3); opacity: 0; } }
@keyframes breakout-text { 0% { opacity: 0; transform: scale(0.3) rotate(-8deg); } 35% { opacity: 1; transform: scale(1.12) rotate(2deg); } 55% { transform: scale(1) rotate(0); } 82% { opacity: 1; } 100% { opacity: 0; transform: scale(1.05); } }
@keyframes breakout-ring { 0% { opacity: 0.9; transform: scale(0.2); } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes spark { 0% { opacity: 1; transform: translate(0, 0) rotate(45deg) scale(1); } 100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(225deg) scale(0.3); } }
@keyframes dot { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise-in { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Respect users who turn motion off (snow stops too), and save battery on low-end phones. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .snow { animation: none !important; }
}

/* ---------- Creator credit ---------- */
.credit { text-align: center; padding-top: 1.25rem; border-top: 1px solid rgba(186, 230, 253, 0.12); }
.credit-line { font-size: 0.85rem; color: var(--muted); }
.credit-line strong { color: var(--frost); font-weight: 700; }
.credit-links { margin-top: 0.75rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.credit-link {
  display: inline-flex; align-items: center; min-height: 2.25rem; padding: 0.35rem 0.85rem; border-radius: 999px;
  font-size: 0.78rem; font-weight: 600; color: var(--ice-bright); text-decoration: none;
  border: 1px solid var(--line); background: rgba(7, 20, 40, 0.55);
}
.credit-link:hover { border-color: rgba(125, 211, 252, 0.6); }

/* ---------- Reviews ---------- */
.feedback-card { padding: 1rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.stars { display: flex; justify-content: center; gap: 0.25rem; }
.star {
  width: 2.75rem; height: 2.75rem; border: 0; background: none; cursor: pointer; font-size: 1.9rem; line-height: 1;
  color: rgba(148, 163, 184, 0.45); transition: transform 0.15s var(--ease-pop), color 0.15s;
}
.star.is-on { color: #fbbf24; text-shadow: 0 0 14px rgba(251, 191, 36, 0.6); }
.star:active { transform: scale(1.2); }
.star:disabled { cursor: default; }
.review-bar { display: flex; align-items: center; gap: 0.5rem; }
.review-bar > span:first-child { width: 2.2rem; color: #fbbf24; }
.review-bar > i { height: 0.5rem; border-radius: 999px; background: linear-gradient(90deg, #fbbf24, #f59e0b); }
