/* ==========================================================================
   WHO'S THAT FOOTBALLER? — broadcast-style design system
   ========================================================================== */
:root {
  --bg: #040a18;
  --bg-2: #08132b;
  --panel: rgba(17, 22, 32, 0.88);
  --panel-solid: #121823;
  --panel-2: #1a2130;
  --panel-3: #222b3c;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.13);
  --text: #f4f7fb;
  --muted: #8b97ac;
  --muted-2: #5f6b80;
  --em: #18d68c;
  --em-2: #0fae6c;
  --em-deep: #07603d;
  --em-glow: rgba(24, 214, 140, 0.35);
  --p2: #5cbcff;
  --p2-glow: rgba(92, 188, 255, 0.32);
  --gold: #f4c55a;
  --gold-2: #c9982f;
  --gold-glow: rgba(244, 197, 90, 0.4);
  --red: #ff5b6b;
  --amber: #ffb547;
  --radius: 18px;
  --radius-sm: 12px;
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --app-h: 100dvh;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--em); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--em); outline-offset: 3px; }

/* ---------- stadium backdrop ---------- */
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.backdrop::before {
  content: ""; position: absolute; inset: -10%;
  background:
    radial-gradient(60% 45% at 12% -5%, rgba(120, 180, 255, 0.16), transparent 70%),
    radial-gradient(55% 40% at 92% -8%, rgba(120, 255, 200, 0.12), transparent 70%),
    radial-gradient(90% 60% at 50% 115%, rgba(24, 214, 140, 0.13), transparent 70%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 55%, #030814 100%);
}
.backdrop .stripes {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,0.012) 0 90px, transparent 90px 180px);
  mask-image: linear-gradient(180deg, transparent 0%, #000 45%, #000 100%);
}
.backdrop .pitch { position: absolute; left: 50%; top: 58%; width: min(1400px, 190vw); transform: translate(-50%, -50%); opacity: 0.075; }
.backdrop .beam {
  position: absolute; top: -20%; width: 46vw; height: 140%;
  background: linear-gradient(180deg, rgba(200, 230, 255, 0.10), transparent 70%);
  filter: blur(30px); transform-origin: top center;
  animation: beam 14s ease-in-out infinite alternate;
}
.backdrop .beam.l { left: -6vw; transform: rotate(-22deg); }
.backdrop .beam.r { right: -6vw; transform: rotate(22deg); animation-delay: -7s; }
@keyframes beam { from { opacity: .55; } to { opacity: 1; } }
.backdrop .grain {
  position: absolute; inset: 0; opacity: .05; 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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- app shell ---------- */
.app { position: relative; z-index: 1; min-height: var(--app-h); display: flex; flex-direction: column; }
.topbar {
  position: relative; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + var(--safe-t)) calc(16px + var(--safe-r)) 10px calc(16px + var(--safe-l));
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-style: italic; letter-spacing: .04em; font-size: 17px; text-transform: uppercase; line-height: 1; }
.brand-name b { color: var(--em); font-weight: 800; }
.topbar-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  border: 1px solid var(--line); background: rgba(255,255,255,0.03); color: var(--text);
  transition: background .2s, border-color .2s, transform .15s;
}
.icon-btn:hover { background: rgba(255,255,255,0.07); border-color: var(--line-2); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 20px; height: 20px; }

.screens { position: relative; flex: 1; display: flex; flex-direction: column; }
.screen {
  flex: 1; display: none; flex-direction: column;
  padding: 8px calc(16px + var(--safe-r)) calc(20px + var(--safe-b)) calc(16px + var(--safe-l));
}
.screen.active { display: flex; animation: screen-in .5s var(--ease-out) both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

/* ---------- buttons ---------- */
.btn {
  --h: 56px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h); padding: 0 24px; border-radius: 14px; border: 0;
  font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none; user-select: none; -webkit-user-select: none; touch-action: manipulation;
  transition: transform .15s var(--ease-out), box-shadow .25s, background .25s, opacity .2s, filter .2s;
}
.btn svg { width: 22px; height: 22px; flex: none; }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.985); }
.btn:disabled { opacity: .42; cursor: not-allowed; filter: saturate(.4); }
.btn-primary {
  color: #03140c;
  background: linear-gradient(180deg, #3cf0a8 0%, var(--em) 45%, var(--em-2) 100%);
  box-shadow: 0 10px 30px -10px var(--em-glow), inset 0 1px 0 rgba(255,255,255,.45), inset 0 -3px 0 rgba(0,0,0,.18);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 14px 38px -10px rgba(24,214,140,.6), inset 0 1px 0 rgba(255,255,255,.5), inset 0 -3px 0 rgba(0,0,0,.18); }
.btn-primary::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.45) 50%, transparent 65%);
  background-size: 250% 100%; background-position: 150% 0; opacity: 0;
}
.btn-primary:hover:not(:disabled)::after { opacity: 1; animation: sheen 1.1s var(--ease-out); }
@keyframes sheen { to { background-position: -50% 0; } }
.btn-secondary {
  color: var(--text); background: linear-gradient(180deg, #232c3d, #1a2130);
  box-shadow: inset 0 0 0 1px var(--line-2), inset 0 1px 0 rgba(255,255,255,.06), 0 10px 26px -14px rgba(0,0,0,.8);
}
.btn-secondary:hover:not(:disabled) { background: linear-gradient(180deg, #28324a, #1d2536); box-shadow: inset 0 0 0 1px rgba(24,214,140,.45), 0 10px 26px -14px rgba(0,0,0,.8); }
.btn-ghost { color: var(--muted); background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover:not(:disabled) { color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-gold { color: #2a1b00; background: linear-gradient(180deg, #ffe08f, var(--gold) 50%, var(--gold-2)); box-shadow: 0 10px 30px -10px var(--gold-glow), inset 0 1px 0 rgba(255,255,255,.6); }
.btn-sm { --h: 42px; font-size: 16px; padding: 0 16px; border-radius: 11px; }
.btn-block { width: 100%; }
.btn .spinner { width: 20px; height: 20px; }

.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 6px; }
.link-btn:hover { color: var(--text); }

/* ---------- panels / inputs ---------- */
.panel {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.panel-edge::before {
  content: ""; position: absolute; left: 22px; right: 22px; top: -1px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--em), transparent); opacity: .8;
}
.label { display: block; font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.field {
  width: 100%; height: 56px; padding: 0 18px; border-radius: 14px;
  background: #0b111d; border: 1px solid var(--line-2); color: var(--text);
  font-size: 18px; font-weight: 600; outline: none; transition: border-color .2s, box-shadow .2s;
}
.field::placeholder { color: var(--muted-2); font-weight: 500; }
.field:focus { border-color: var(--em); box-shadow: 0 0 0 4px rgba(24,214,140,.15); }
.field.invalid { border-color: var(--red); box-shadow: 0 0 0 4px rgba(255,91,107,.15); }
.hint { font-size: 14px; color: var(--muted); }
.error-text { color: var(--red); font-size: 14px; min-height: 20px; margin-top: 8px; font-weight: 600; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: rgba(255,255,255,.06); color: var(--muted); }
.chip svg { width: 14px; height: 14px; }
.chip-em { background: rgba(24,214,140,.13); color: var(--em); }
.chip-gold { background: rgba(244,197,90,.14); color: var(--gold); }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255,255,255,.18); border-top-color: currentColor; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   HOME
   ========================================================================== */
.home { justify-content: center; align-items: center; gap: 22px; }
.home-grid { width: 100%; max-width: 1080px; margin: 0 auto; display: grid; gap: 22px; align-items: center; }
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; }
.kicker { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: .24em; text-transform: uppercase; color: var(--em); margin-bottom: 10px; }
.kicker::before, .kicker::after { content: ""; width: 22px; height: 2px; background: currentColor; opacity: .6; border-radius: 2px; }
.title {
  margin: 0; font-family: var(--font-display); font-weight: 800; font-style: italic; text-transform: uppercase;
  line-height: .86; letter-spacing: -.005em; font-size: clamp(52px, 15.5vw, 112px);
  text-shadow: 0 6px 30px rgba(0,0,0,.5);
}
.title .l1 { display: block; color: var(--text); }
.title .l2 { display: block; background: linear-gradient(180deg, #ffffff 0%, #c9d6ea 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.title .q { color: var(--em); -webkit-text-fill-color: var(--em); text-shadow: 0 0 28px var(--em-glow); display: inline-block; animation: q-bob 2.8s ease-in-out infinite; }
@keyframes q-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(6deg); } }
.subtitle { margin: 14px 0 0; color: #b5c0d3; font-size: clamp(16px, 4.2vw, 20px); font-weight: 500; max-width: 30ch; }

.mystery { position: relative; width: min(52vw, 230px); aspect-ratio: 4 / 5; margin: 6px auto 22px; perspective: 900px; }
.mystery-card {
  position: absolute; inset: 0; border-radius: 20px; overflow: hidden; transform: rotate(-4deg);
  background: #0c1322; border: 1px solid var(--line-2);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.85), 0 0 0 6px rgba(255,255,255,.025), 0 0 60px -10px var(--em-glow);
  animation: card-float 6s ease-in-out infinite;
}
.mystery-card.back { transform: rotate(7deg) translate(16px, 8px); opacity: .5; animation: none; filter: brightness(.6); }
@keyframes card-float { 0%, 100% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(-2deg) translateY(-8px); } }
.mystery-card canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; transition: opacity .6s; }
.mystery-card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(4,10,24,0) 40%, rgba(4,10,24,.85) 100%), linear-gradient(120deg, rgba(255,255,255,.12), transparent 40%);
}
.mystery-q {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 10px; text-align: center;
  font-family: var(--font-display); font-weight: 800; font-style: italic; font-size: 64px; line-height: 1; color: var(--text);
  text-shadow: 0 4px 20px rgba(0,0,0,.6);
}
.mystery-tag { position: absolute; z-index: 2; top: 10px; left: 10px; white-space: nowrap; font-size: 10.5px; height: 22px; padding: 0 8px; }

.home-panel { width: 100%; max-width: 440px; margin: 0 auto; padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.home-panel .btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.home-panel .btn-row .btn, .results-actions .btn { font-size: 17px; padding: 0 12px; white-space: nowrap; }
@media (max-width: 899px) {
  .home { justify-content: flex-start; gap: 16px; }
  .mystery { width: min(34vw, 150px); margin: 2px auto 16px; }
  .title { font-size: clamp(46px, 13.5vw, 96px); }
}
.home-foot { text-align: center; color: var(--muted-2); font-size: 13px; }
.home-foot button { color: var(--muted); }

@media (min-width: 900px) {
  .home-grid { grid-template-columns: 1.15fr 1fr; gap: 56px; }
  .hero { align-items: flex-start; text-align: left; }
  .mystery { margin: 0 0 30px 6px; width: 170px; }
  .title { font-size: clamp(80px, 8.6vw, 124px); }
}

/* ==========================================================================
   MODAL / SHEET
   ========================================================================== */
.modal-root { position: fixed; inset: 0; z-index: 60; display: none; align-items: flex-end; justify-content: center; }
.modal-root.open { display: flex; }
.modal-scrim { position: absolute; inset: 0; background: rgba(2, 6, 15, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade-in .25s both; }
.modal {
  position: relative; width: 100%; max-width: 560px; max-height: calc(var(--app-h) - 40px); overflow: auto;
  border-radius: 24px 24px 0 0; padding: 22px 20px calc(22px + var(--safe-b));
  background: linear-gradient(180deg, #161d2b, #10161f); border: 1px solid var(--line-2); border-bottom: 0;
  box-shadow: 0 -30px 80px -20px rgba(0,0,0,.8); animation: sheet-up .42s var(--ease-out) both;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-style: italic; text-transform: uppercase; font-size: 30px; letter-spacing: .02em; }
.modal .grabber { width: 44px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.18); margin: -8px auto 14px; }
@media (min-width: 640px) {
  .modal-root { align-items: center; }
  .modal { border-radius: 24px; border-bottom: 1px solid var(--line-2); animation: pop-in .38s var(--ease-out) both; }
  .modal .grabber { display: none; }
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(16px) scale(.97); } }

.code-input {
  width: 100%; height: 72px; text-align: center; text-transform: uppercase;
  font-family: var(--font-display); font-weight: 800; font-size: 40px; letter-spacing: .42em; padding-left: .42em;
}
.howto { display: grid; gap: 12px; }
.howto-step { display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: start; }
.howto-step .n { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgba(24,214,140,.13); color: var(--em); font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.howto-step h3 { margin: 4px 0 2px; font-size: 17px; }
.howto-step p { margin: 0; color: var(--muted); font-size: 15px; }
.mode-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.mode-tile { border-radius: 12px; padding: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.mode-tile strong { display: block; font-family: var(--font-display); text-transform: uppercase; letter-spacing: .06em; font-size: 16px; }
.mode-tile span { color: var(--muted); font-size: 13px; }
.credits-list { display: grid; gap: 8px; font-size: 13px; color: var(--muted); }
.credits-list .c { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center; padding: 6px; border-radius: 10px; background: rgba(255,255,255,.02); }
.credits-list img { width: 44px; height: 55px; border-radius: 6px; object-fit: cover; }
.credits-list b { color: var(--text); font-weight: 600; }

/* ==========================================================================
   WAITING / INVITE
   ========================================================================== */
.center-stack { margin: auto; width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 16px; align-items: stretch; text-align: center; }
.center-stack h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-style: italic; text-transform: uppercase; font-size: 38px; line-height: .95; }
.center-stack p { margin: 0; color: var(--muted); }
.invite-card { padding: 24px 22px; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.invite-from { display: flex; gap: 14px; align-items: center; }
.pulse-ring { width: 84px; height: 84px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; position: relative; color: var(--em); }
.pulse-ring::before, .pulse-ring::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--em); animation: ring 2s var(--ease-out) infinite; }
.pulse-ring::after { animation-delay: 1s; }
@keyframes ring { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.35); opacity: 0; } }

/* ==========================================================================
   LOBBY
   ========================================================================== */
.lobby { gap: 16px; max-width: 980px; width: 100%; margin: 0 auto; }
.lobby-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.room-code {
  display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 16px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line-2);
}
.room-code .lbl { font-family: var(--font-display); font-weight: 700; letter-spacing: .18em; font-size: 12px; color: var(--muted); }
.room-code .code { font-family: var(--font-display); font-weight: 800; font-size: 28px; letter-spacing: .2em; line-height: 1; }
.versus { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 10px; }
.vs-badge {
  align-self: center; width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; transform: rotate(45deg);
  background: linear-gradient(135deg, #1f2838, #121823); border: 1px solid var(--line-2); box-shadow: 0 10px 30px -10px rgba(0,0,0,.9);
}
.vs-badge span { transform: rotate(-45deg); font-family: var(--font-display); font-weight: 800; font-style: italic; font-size: 22px; color: var(--gold); }
.pcard {
  --pc: var(--em); --pg: var(--em-glow);
  position: relative; overflow: hidden; border-radius: var(--radius); padding: 18px 14px 16px; min-height: 196px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01)), var(--panel-solid);
  border: 1px solid var(--line); box-shadow: 0 24px 50px -28px rgba(0,0,0,.9);
  transition: border-color .3s, box-shadow .3s;
}
.pcard.p2 { --pc: var(--p2); --pg: var(--p2-glow); }
.pcard::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--pc); box-shadow: 0 0 20px var(--pg); }
.pcard::after { content: ""; position: absolute; inset: auto -30% -60% -30%; height: 80%; background: radial-gradient(closest-side, var(--pg), transparent); opacity: .5; pointer-events: none; }
.pcard.filled { animation: card-in .55s var(--ease-spring) both; }
@keyframes card-in { from { opacity: 0; transform: translateY(10px) scale(.94); } }
.avatar {
  width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; position: relative;
  font-family: var(--font-display); font-weight: 800; font-size: 30px; color: #04120b; text-transform: uppercase;
  background: linear-gradient(160deg, color-mix(in srgb, var(--pc) 70%, white), var(--pc));
  box-shadow: 0 0 0 4px rgba(255,255,255,.06), 0 0 30px -4px var(--pg);
}
.pcard .pname { font-family: var(--font-display); font-weight: 800; font-size: 26px; line-height: 1.05; text-transform: uppercase; letter-spacing: .02em; word-break: break-word; }
.pcard .tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.conn { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--muted); }
.conn i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted-2); }
.conn.on i { background: var(--em); box-shadow: 0 0 0 0 var(--em-glow); animation: live 2s infinite; }
.conn.on { color: #bfe9d4; }
.conn.off i { background: var(--amber); }
.conn.off { color: var(--amber); }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(24,214,140,.55); } 70% { box-shadow: 0 0 0 8px rgba(24,214,140,0); } 100% { box-shadow: 0 0 0 0 rgba(24,214,140,0); } }
.pcard.empty { border-style: dashed; border-color: var(--line-2); background: rgba(255,255,255,.015); }
.pcard.empty::before, .pcard.empty::after { display: none; }
.pcard.empty .avatar { background: rgba(255,255,255,.05); color: var(--muted); box-shadow: none; animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.06); opacity: .7; } }
.pcard.empty .pname { color: var(--muted); font-size: 20px; }

.requests { display: grid; gap: 8px; }
.request { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: 14px; background: rgba(244,197,90,.08); border: 1px solid rgba(244,197,90,.3); animation: card-in .4s var(--ease-spring) both; }
.request .who { flex: 1; font-weight: 600; }
.request .who b { color: var(--gold); }

.invite-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.invite-link { height: 46px; display: flex; align-items: center; padding: 0 14px; border-radius: 12px; background: #0b111d; border: 1px solid var(--line); color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.settings { padding: 18px; display: grid; gap: 16px; }
.settings-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.settings-head h3 { margin: 0; font-family: var(--font-display); font-weight: 800; font-style: italic; text-transform: uppercase; font-size: 22px; letter-spacing: .03em; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 13px; background: #0b111d; border: 1px solid var(--line); }
.seg button {
  height: 42px; border: 0; border-radius: 10px; background: transparent; color: var(--muted);
  font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: .05em; text-transform: uppercase;
  transition: background .2s, color .2s, box-shadow .2s;
}
.seg button:hover:not(:disabled) { color: var(--text); }
.seg button.on { background: linear-gradient(180deg, #2a3446, #202839); color: var(--text); box-shadow: inset 0 0 0 1px rgba(24,214,140,.55), 0 6px 16px -8px rgba(0,0,0,.8); }
.seg button.on::after { content: ""; display: block; height: 2px; width: 18px; margin: 3px auto 0; border-radius: 2px; background: var(--em); }
.seg button:disabled { cursor: default; }
.modes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.mode-btn {
  position: relative; display: grid; grid-template-columns: 46px 1fr; gap: 10px; align-items: center; text-align: left;
  padding: 10px; border-radius: 13px; background: #0b111d; border: 1px solid var(--line); color: var(--text);
  transition: border-color .2s, background .2s, transform .15s;
}
.mode-btn:hover:not(:disabled) { border-color: var(--line-2); }
.mode-btn.on { border-color: var(--em); background: linear-gradient(180deg, rgba(24,214,140,.10), rgba(24,214,140,.03)); }
.mode-btn:disabled { cursor: default; }
.mode-btn strong { display: block; font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: 16px; line-height: 1.1; }
.mode-btn span { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.25; }
.mode-btn.wide { grid-column: 1 / -1; }
.mode-ico { width: 46px; height: 56px; border-radius: 8px; overflow: hidden; position: relative; background: linear-gradient(160deg, #2b3a55, #121a2a); }
.mode-ico::before { content: ""; position: absolute; left: 50%; top: 18%; width: 46%; height: 36%; border-radius: 50%; background: #9fb3cf; transform: translateX(-50%); }
.mode-ico::after { content: ""; position: absolute; left: 50%; bottom: -16%; width: 92%; height: 46%; border-radius: 50% 50% 0 0; background: #6f86a8; transform: translateX(-50%); }
.mode-ico.blur::before, .mode-ico.blur::after { filter: blur(4px); }
.mode-ico.zoom { background: #9fb3cf; }
.mode-ico.zoom::before { width: 120%; height: 90%; top: 10%; background: #b8c8de; }
.mode-ico.zoom::after { display: none; }
.mode-ico.hidden { background-image: linear-gradient(160deg, #2b3a55, #121a2a); }
.mode-ico .tiles { position: absolute; inset: 0; z-index: 2; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(4, 1fr); gap: 1px; }
.mode-ico .tiles i { background: #1b2436; }
.mode-ico .tiles i:nth-child(3n+2), .mode-ico .tiles i:nth-child(5) { background: transparent; }
.mode-ico.mix { background: conic-gradient(from 45deg, #18d68c, #5cbcff, #f4c55a, #18d68c); }
.mode-ico.mix::before { background: rgba(4,10,24,.8); }
.mode-ico.mix::after { background: rgba(4,10,24,.6); }
.lobby-foot { display: grid; gap: 10px; }
.h2h { text-align: center; color: var(--muted); font-size: 14px; }
.h2h b { color: var(--text); font-family: var(--font-display); font-size: 18px; letter-spacing: .06em; }

@media (min-width: 900px) {
  .lobby-body { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; align-items: start; }
  .pcard { min-height: 250px; }
  .avatar { width: 92px; height: 92px; font-size: 38px; }
  .pcard .pname { font-size: 32px; }
}
@media (max-width: 899px) { .lobby-body { display: grid; gap: 16px; } }
@media (max-width: 380px) {
  .pcard { padding: 14px 8px; min-height: 170px; }
  .avatar { width: 58px; height: 58px; font-size: 24px; }
  .pcard .pname { font-size: 21px; }
  .vs-badge { width: 42px; height: 42px; }
}

/* ==========================================================================
   GAME
   ========================================================================== */
.screen.game { padding: 0; height: var(--app-h); min-height: 0; overflow: hidden; }
.game-top { padding: calc(8px + var(--safe-t)) calc(10px + var(--safe-r)) 6px calc(10px + var(--safe-l)); display: grid; gap: 6px; }
.scorebug { display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: stretch; filter: drop-shadow(0 12px 22px rgba(0,0,0,.6)); }
.sb-btn { width: 36px; height: auto; border-radius: 10px; background: rgba(18,24,35,.9); }
.sb-btn:first-child { margin-right: 6px; }
.sb-btn:last-child { margin-left: 6px; }
.sb-btn svg { width: 16px; height: 16px; }
.sb-side.me { background: linear-gradient(180deg, #26324a, #172033); }
.sb-side.me .sb-name::before { content: "YOU · "; color: var(--pc); }
.sb-side {
  --pc: var(--em);
  display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 12px; height: 52px;
  background: linear-gradient(180deg, #1c2434, #121823); border: 1px solid var(--line);
}
.sb-side.p2 { --pc: var(--p2); flex-direction: row-reverse; }
.sb-side.left { border-radius: 14px 0 0 14px; clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%); padding-right: 18px; box-shadow: inset 4px 0 0 var(--pc); }
.sb-side.right { border-radius: 0 14px 14px 0; clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%); padding-left: 18px; box-shadow: inset -4px 0 0 var(--pc); }
.sb-name { flex: 1; min-width: 0; font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-side.p2 .sb-name { text-align: right; }
.sb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--em); flex: none; }
.sb-dot.off { background: var(--amber); }
.sb-score { font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1; min-width: 2.2ch; text-align: center; font-variant-numeric: tabular-nums; }
.sb-score.bump { animation: bump .6s var(--ease-spring); color: var(--pc); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
.sb-mid {
  position: relative; z-index: 2; margin: 0 -6px; min-width: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #f5f8fc, #d8e0eb); color: #0a1324; border-radius: 12px; padding: 4px 12px;
  box-shadow: 0 0 0 3px rgba(4,10,24,.9);
}
.sb-round { font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #3a4a66; line-height: 1.1; }
.sb-timer { font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.sb-mid.urgent { background: linear-gradient(180deg, #ff7b88, var(--red)); color: #fff; animation: urgent .5s ease-in-out infinite alternate; }
.sb-mid.urgent .sb-round { color: rgba(255,255,255,.85); }
@keyframes urgent { to { transform: scale(1.06); } }
.timebar { height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.timebar i { display: block; height: 100%; width: 100%; transform-origin: left; background: linear-gradient(90deg, var(--em-2), var(--em)); border-radius: 4px; }
.timebar.urgent i { background: linear-gradient(90deg, #ff8a5b, var(--red)); }

.stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; padding: 6px 12px; }
.frame {
  position: relative; border-radius: 22px; overflow: hidden; background: #0a0f1a;
  box-shadow: 0 0 0 1px var(--line-2), 0 0 0 6px rgba(255,255,255,.025), 0 40px 80px -30px rgba(0,0,0,.95);
  isolation: isolate; transform: translateZ(0);
}
.frame .photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; will-change: transform, filter; transform-origin: 50% 50%; user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; }
.frame .photo.blurred { transform: scale(1.08); }
.frame .shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(4,10,24,.35) 0%, transparent 18%, transparent 62%, rgba(4,10,24,.82) 100%); z-index: 3; }
.frame .tiles { position: absolute; inset: 0; z-index: 2; display: grid; }
.frame .tile {
  background: linear-gradient(145deg, #1d2638, #131a28); border: 1px solid rgba(255,255,255,.035);
  display: grid; place-items: center; transition: transform .45s var(--ease-out), opacity .45s; backface-visibility: hidden;
}
.frame .tile::after { content: ""; width: 26%; aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(255,255,255,.05); }
.frame .tile.gone { transform: rotateY(90deg) scale(.6); opacity: 0; }
.frame .mode-badge { position: absolute; z-index: 5; top: 12px; left: 12px; }
.frame .credit-mini { position: absolute; z-index: 5; right: 12px; bottom: 10px; left: 12px; text-align: right; font-size: 10.5px; color: rgba(255,255,255,.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frame .veil { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; text-align: center; background: radial-gradient(closest-side, rgba(10,16,30,.6), rgba(4,8,18,.94)); transition: opacity .35s; }
.frame .veil.off { opacity: 0; pointer-events: none; }
.intro-round { font-family: var(--font-display); font-weight: 700; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); font-size: 15px; }
.intro-mode { font-family: var(--font-display); font-weight: 800; font-style: italic; text-transform: uppercase; font-size: clamp(30px, 8vw, 46px); line-height: .95; margin: 6px 0 14px; }
.intro-count { font-family: var(--font-display); font-weight: 800; font-size: 92px; line-height: 1; color: var(--em); text-shadow: 0 0 40px var(--em-glow); }
.intro-count.tick { animation: count-pop .9s var(--ease-out); }
@keyframes count-pop { from { transform: scale(1.8); opacity: 0; } 30% { opacity: 1; } to { transform: scale(1); } }

.reveal {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 7; padding: 70px 16px 14px; display: none;
  background: linear-gradient(180deg, rgba(4,10,24,0) 0%, rgba(4,10,24,.78) 38%, rgba(4,10,24,.95) 100%);
}
.reveal.show { display: block; animation: fade-in .4s both; }
.reveal.show ~ .credit-mini, .frame:has(.reveal.show) .credit-mini { display: none; }
.reveal-nat { display: inline-flex; gap: 8px; align-items: center; font-family: var(--font-display); font-weight: 700; letter-spacing: .18em; font-size: 13px; text-transform: uppercase; color: var(--em); animation: slide-up .5s var(--ease-out) .05s both; }
.reveal-name {
  margin: 2px 0 10px; font-family: var(--font-display); font-weight: 800; font-style: italic; text-transform: uppercase;
  font-size: clamp(32px, 9.5vw, 54px); line-height: .9; letter-spacing: .005em; text-shadow: 0 4px 24px rgba(0,0,0,.7);
  animation: name-in .7s var(--ease-out) .1s both;
}
@keyframes name-in { from { opacity: 0; transform: translateX(-24px); clip-path: inset(0 100% 0 0); } to { opacity: 1; transform: none; clip-path: inset(0 0 0 0); } }
@keyframes slide-up { from { opacity: 0; transform: translateY(10px); } }
.reveal-rows { display: grid; gap: 6px; }
.rrow { --pc: var(--em); display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 12px; background: rgba(10,15,26,.82); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: slide-up .45s var(--ease-out) both; }
.rrow.p2 { --pc: var(--p2); }
.rrow:nth-child(2) { animation-delay: .12s; }
.rrow .place { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 15px; background: var(--pc); color: #04120b; }
.rrow .who { font-weight: 700; text-transform: uppercase; font-family: var(--font-display); letter-spacing: .04em; font-size: 18px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rrow .who small { color: var(--muted); font-family: var(--font-body); font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 13px; margin-left: 6px; }
.rrow .pts { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--pc); }
.rrow.none { grid-template-columns: 1fr; text-align: center; color: var(--muted); font-weight: 600; }
.reveal-foot { margin-top: 8px; display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: rgba(255,255,255,.6); }
.reveal-foot a { color: rgba(255,255,255,.75); }
.reveal-next { flex: none; font-weight: 700; color: var(--text); }

.opp-status { position: absolute; z-index: 8; top: 12px; right: 12px; }
.opp-status .chip { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); background: rgba(10,15,26,.7); }

.answer-bar { padding: 6px calc(12px + var(--safe-r)) calc(10px + var(--safe-b)) calc(12px + var(--safe-l)); display: grid; gap: 6px; width: 100%; max-width: 620px; margin: 0 auto; }
.feedback { min-height: 22px; text-align: center; font-weight: 700; font-size: 15px; letter-spacing: .01em; }
.feedback.ok { color: var(--em); }
.feedback.bad { color: var(--red); }
.feedback.warn { color: var(--amber); }
.feedback.info { color: var(--muted); }
.answer-form { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.answer-form .field { height: 58px; font-size: 19px; padding-right: 12px; }
.answer-form .btn { --h: 58px; padding: 0 20px; }
.answer-form.shake { animation: shake .42s; }
@keyframes shake { 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
.answer-form.locked .field { border-color: rgba(24,214,140,.5); color: var(--em); background: rgba(24,214,140,.06); }
.cooldown { position: absolute; left: 10px; right: 10px; bottom: 5px; height: 3px; border-radius: 3px; background: var(--red); transform-origin: left; transform: scaleX(0); pointer-events: none; }
.cooldown.run { animation: cool var(--cd, 1.2s) linear forwards; }
@keyframes cool { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.float-pts { position: absolute; z-index: 9; left: 50%; top: 40%; font-family: var(--font-display); font-weight: 800; font-size: 64px; color: var(--em); text-shadow: 0 0 30px var(--em-glow); pointer-events: none; animation: float-up 1.3s var(--ease-out) forwards; }
@keyframes float-up { from { opacity: 0; transform: translate(-50%, 20px) scale(.6); } 20% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } to { opacity: 0; transform: translate(-50%, -70px) scale(1); } }
.frame.correct { box-shadow: 0 0 0 3px var(--em), 0 0 60px -6px var(--em-glow), 0 40px 80px -30px rgba(0,0,0,.95); transition: box-shadow .3s; }
.game-menu { position: absolute; z-index: 9; left: calc(10px + var(--safe-l)); bottom: calc(100% + 6px); }

@media (min-width: 900px) {
  .game-top { max-width: 760px; width: 100%; margin: 0 auto; padding-top: calc(16px + var(--safe-t)); }
  .sb-side { height: 60px; }
  .sb-name { font-size: 20px; }
  .sb-score { font-size: 36px; }
  .sb-timer { font-size: 34px; }
  .stage { padding: 14px; }
}
/* phones: name on its own line above the score so it never shrinks to "E.." */
@media (max-width: 560px) {
  .sb-btn { width: 32px; }
  .sb-side { display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: center; column-gap: 6px; row-gap: 1px; height: 56px; padding: 0 10px; }
  .sb-side.left { padding-right: 16px; }
  .sb-side.right { padding-left: 16px; }
  .sb-side .sb-dot { grid-column: 1; grid-row: 1; align-self: center; }
  .sb-side .sb-name { grid-column: 2; grid-row: 1; font-size: 13.5px; }
  .sb-side .sb-score { grid-column: 1 / -1; grid-row: 2; font-size: 27px; text-align: left; min-width: 0; }
  .sb-side.p2 { grid-template-columns: minmax(0, 1fr) auto; }
  .sb-side.p2 .sb-dot { grid-column: 2; }
  .sb-side.p2 .sb-name { grid-column: 1; text-align: right; }
  .sb-side.p2 .sb-score { text-align: right; }
  .sb-side.me .sb-name::before { content: none; }
  .sb-side.me .sb-name { color: var(--pc); }
  .sb-mid { min-width: 76px; padding: 4px 8px; }
  .stage { padding: 6px 8px; }
}
@media (max-height: 560px) {
  .sb-side { height: 42px; }
  .sb-score, .sb-timer { font-size: 24px; }
  .answer-form .field, .answer-form .btn { --h: 50px; height: 50px; }
}

/* ==========================================================================
   RESULTS
   ========================================================================== */
.results { align-items: center; justify-content: center; gap: 18px; text-align: center; }
.results-inner { width: 100%; max-width: 620px; display: flex; flex-direction: column; gap: 18px; align-items: center; }
.trophy-wrap { position: relative; width: 150px; height: 150px; }
.trophy-wrap::before { content: ""; position: absolute; inset: -30%; background: radial-gradient(closest-side, var(--gold-glow), transparent); animation: glow 2.6s ease-in-out infinite; }
.trophy-wrap .rays { position: absolute; inset: -40%; background: repeating-conic-gradient(from 0deg, rgba(244,197,90,.13) 0 8deg, transparent 8deg 22deg); border-radius: 50%; mask-image: radial-gradient(closest-side, #000 30%, transparent 75%); animation: spin 22s linear infinite; }
.trophy { position: relative; width: 100%; height: 100%; animation: trophy-in 1s var(--ease-spring) both; filter: drop-shadow(0 18px 30px rgba(0,0,0,.6)); }
.trophy .shine { animation: trophy-shine 3s ease-in-out 1.2s infinite; }
@keyframes trophy-in { from { transform: translateY(40px) scale(.4) rotate(-12deg); opacity: 0; } }
@keyframes trophy-shine { 0%, 60% { transform: translateX(-120px); } 100% { transform: translateX(160px); } }
@keyframes glow { 50% { opacity: .55; transform: scale(.92); } }
.results h2 { margin: 0; font-family: var(--font-display); font-weight: 700; letter-spacing: .3em; font-size: 15px; color: var(--gold); text-transform: uppercase; }
.winner-name { margin: -6px 0 0; padding: 0 .08em; font-family: var(--font-display); font-weight: 800; font-style: italic; text-transform: uppercase; font-size: clamp(44px, 13vw, 84px); line-height: .9; background: linear-gradient(180deg, #fff6d6, var(--gold) 55%, var(--gold-2)); -webkit-background-clip: text; background-clip: text; color: transparent; animation: name-in .8s var(--ease-out) .25s both; word-break: break-word; }
.winner-name.draw { background: linear-gradient(180deg, #fff, #c8d3e6); -webkit-background-clip: text; background-clip: text; }
.final-board { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fcard { --pc: var(--em); position: relative; padding: 16px 12px; border-radius: var(--radius); background: var(--panel-solid); border: 1px solid var(--line); text-align: center; animation: slide-up .6s var(--ease-out) both; }
.fcard.p2 { --pc: var(--p2); animation-delay: .1s; }
.fcard.win { border-color: rgba(244,197,90,.6); box-shadow: 0 0 0 1px rgba(244,197,90,.3), 0 20px 50px -20px var(--gold-glow); }
.fcard .crown { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); width: 30px; height: 30px; color: var(--gold); }
.fcard .fname { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: 22px; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcard .fscore { font-family: var(--font-display); font-weight: 800; font-size: 54px; line-height: 1; color: var(--pc); font-variant-numeric: tabular-nums; }
.fcard .fstats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.fcard .stat { padding: 8px 4px; border-radius: 10px; background: rgba(255,255,255,.035); }
.fcard .stat b { display: block; font-family: var(--font-display); font-size: 22px; font-weight: 800; line-height: 1; }
.fcard .stat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.results-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.results-note { color: var(--muted); font-size: 14px; min-height: 20px; }
.confetti { position: fixed; inset: 0; z-index: 50; pointer-events: none; }

/* ==========================================================================
   TOASTS / BANNERS
   ========================================================================== */
.toasts { position: fixed; z-index: 80; left: 0; right: 0; top: calc(10px + var(--safe-t)); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 12px; }
.toast {
  pointer-events: auto; max-width: 440px; display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 14px;
  background: rgba(22, 29, 43, .96); border: 1px solid var(--line-2); box-shadow: 0 20px 40px -16px rgba(0,0,0,.9);
  font-weight: 600; font-size: 15px; animation: toast-in .45s var(--ease-spring) both;
}
.toast.out { animation: toast-out .3s ease-in forwards; }
.toast svg { width: 18px; height: 18px; flex: none; }
.toast.ok svg { color: var(--em); }
.toast.err { border-color: rgba(255,91,107,.45); }
.toast.err svg { color: var(--red); }
.toast.gold { border-color: rgba(244,197,90,.5); }
.toast.gold svg { color: var(--gold); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(.95); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px) scale(.97); } }
.netbar { position: fixed; z-index: 90; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%); display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-radius: 99px; background: #2a1f08; border: 1px solid rgba(255,181,71,.5); color: var(--amber); font-weight: 700; font-size: 14px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.9); }
.netbar .spinner { width: 16px; height: 16px; border-width: 2px; }
.boot { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg); transition: opacity .4s; }
.boot.done { opacity: 0; pointer-events: none; }
.boot .spinner { color: var(--em); width: 34px; height: 34px; }

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .backdrop .beam, .mystery-card, .title .q, .trophy-wrap .rays { animation: none !important; }
  .spinner { animation: spin 1.6s linear infinite !important; animation-duration: 1.6s !important; animation-iteration-count: infinite !important; }
}
