/* Wheel of Misfortune: one dark casino world (single theme on purpose). */
:root {
  color-scheme: dark;
  --bg-0: #13041d;
  --bg-1: #25073c;
  --bg-2: #3f0f63;
  --card-top: #3b1060;
  --card-bot: #1d0633;
  --gold-1: #fff4b8;
  --gold-2: #ffd54a;
  --gold-3: #f2a900;
  --gold-4: #8f5200;
  --magenta: #ff2e97;
  --magenta-2: #d4006a;
  --magenta-3: #6d0e3f;
  --violet: #9b4dff;
  --cyan: #3be8ff;
  --ink: #fff6e8;
  --ink-dim: #dcc8ee;
  --ink-faint: #a88cc4;
  --paper: #fff8ea;
  --paper-ink: #2a0b3d;
  --paper-dim: #6c4a80;
  --font-logo: "Luckiest Guy", "Lilita One", "Arial Rounded MT Bold", Impact, sans-serif;
  --font-ui: "Lilita One", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
/* touch-action: manipulation — szybkie stuknięcia na iPhonie nie powiększają strony (przewijanie działa dalej) */
html { height: 100%; -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg-0);
  color: var(--ink);
  font: 600 16px/1.5 var(--font-body);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---------- Background ---------- */
.bg {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(900px 620px at 50% 30%, rgba(255, 46, 151, .22), transparent 70%),
    radial-gradient(1300px 900px at 50% 20%, var(--bg-2) 0%, var(--bg-1) 45%, var(--bg-0) 100%);
}
.bg-rays {
  position: absolute; left: 50%; top: 36%; width: 1800px; height: 1800px; margin: -900px 0 0 -900px;
  background: repeating-conic-gradient(from 0deg, rgba(255, 213, 74, .07) 0deg 7deg, transparent 7deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 0%, rgba(0,0,0,.6) 30%, transparent 62%);
          mask: radial-gradient(circle, #000 0%, rgba(0,0,0,.6) 30%, transparent 62%);
  animation: rot 90s linear infinite;
}
.bg-suits {
  position: absolute; inset: 0; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='%23ffd54a' font-family='Georgia,serif' font-size='26'%3E%3Ctext x='10' y='34'%3E%E2%99%A0%3C/text%3E%3Ctext x='70' y='34'%3E%E2%99%A5%3C/text%3E%3Ctext x='40' y='92'%3E%E2%99%A6%3C/text%3E%3Ctext x='96' y='98'%3E%E2%99%A3%3C/text%3E%3C/g%3E%3C/svg%3E");
  background-size: 120px 120px;
}
.twinkle { position: absolute; left: var(--x); top: var(--y); width: 18px; height: 18px; pointer-events: none; }
.twinkle::before {
  content: "✦"; position: absolute; inset: 0; color: var(--gold-1); font-size: 18px; line-height: 18px;
  text-shadow: 0 0 10px var(--gold-2); animation: twinkle 3.6s ease-in-out var(--d) infinite; opacity: 0;
}

/* ---------- App shell ---------- */
.app {
  max-width: 640px; margin: 0 auto;
  padding-inline: 16px; padding-block: 10px 28px;
  display: flex; flex-direction: column; gap: 6px;
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.chips {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 14px; border-radius: 999px;
  background: rgba(20, 3, 32, .55); border: 2px solid rgba(255, 213, 74, .45);
  box-shadow: inset 0 2px 8px rgba(0,0,0,.4);
}
.chips-label { font: 15px/1 var(--font-ui); letter-spacing: 1.5px; color: var(--gold-2); }
.chip-row { display: flex; gap: 6px; }
.chip {
  width: 24px; height: 24px; border-radius: 50%;
  background:
    radial-gradient(circle, #fff3c4 0 22%, #f2a900 24% 48%, transparent 50%),
    repeating-conic-gradient(#fff 0 20deg, #e0115f 20deg 40deg);
  box-shadow: 0 0 0 2px #6b0f3a, 0 2px 6px rgba(0,0,0,.5), 0 0 12px rgba(255, 213, 74, .55);
  transition: transform .3s, filter .3s, opacity .3s;
}
.chip.used { filter: grayscale(1) brightness(.45); box-shadow: 0 0 0 2px #2b1238; opacity: .7; transform: scale(.86); }
.chip.pop { animation: chip-pop .5s ease; }
.icon-btn {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #5a1a86, #230838); border: 2px solid rgba(255, 213, 74, .6);
  box-shadow: 0 4px 0 #12031d, 0 6px 16px rgba(0,0,0,.4);
}
.icon-btn svg { width: 24px; height: 24px; fill: none; stroke: var(--gold-1); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .spk { fill: var(--gold-1); stroke: none; }
.icon-btn .mute { display: none; }
.icon-btn[aria-pressed="false"] .wave { display: none; }
.icon-btn[aria-pressed="false"] .mute { display: inline; stroke: #ff6b9f; }
.icon-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #12031d; }

/* ---------- Marquee / logo ---------- */
.marquee { position: relative; text-align: center; padding: 6px 0 2px; }
.marquee-lights {
  position: absolute; left: 50%; top: 0; width: min(100%, 480px); height: 10px; transform: translateX(-50%);
  background:
    radial-gradient(circle, #fffbe0 0 2.5px, #ffc933 3.5px, transparent 5px) 0 0 / 24px 10px repeat-x,
    radial-gradient(circle, rgba(255, 201, 51, .35) 0 2.5px, transparent 4px) 12px 0 / 24px 10px repeat-x;
  animation: bulbs 0.9s steps(1) infinite;
}
.logo { margin: 12px 0 0; line-height: .9; font-weight: 400; }
.logo-top {
  display: block; font: 400 clamp(20px, 5.6vw, 30px)/1 var(--font-logo); letter-spacing: 3px; text-transform: uppercase;
  color: var(--ink); -webkit-text-stroke: 1px #5a0f3a;
  text-shadow: 0 3px 0 var(--magenta-2), 0 0 18px rgba(255, 46, 151, .8);
}
.logo-main {
  display: block; margin-top: 4px;
  font: 400 clamp(46px, 14.5vw, 88px)/.92 var(--font-logo); letter-spacing: 1px; text-transform: uppercase;
  background: linear-gradient(180deg, #fffbe3 0%, var(--gold-1) 18%, var(--gold-2) 45%, var(--gold-3) 62%, #ffe98a 78%, var(--gold-3) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 2px #4d1800;
  filter: drop-shadow(0 4px 0 #7a2400) drop-shadow(0 7px 0 #3d0d00) drop-shadow(0 14px 18px rgba(0,0,0,.55));
}
.tagline { margin: 10px 0 0; font: 400 clamp(16px, 4.4vw, 20px)/1.25 var(--font-ui); color: var(--ink-dim); letter-spacing: .4px; }
.tagline strong { font-weight: 400; color: var(--gold-2); text-shadow: 0 0 14px rgba(255, 213, 74, .45); }

/* ---------- Wheel ---------- */
.stage { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.wheel-wrap { position: relative; width: min(100%, 540px); margin-top: 4px; }
.wheel-glow {
  position: absolute; left: 50%; top: 52%; width: 92%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 46, 151, .55), rgba(155, 77, 255, .25) 45%, transparent 70%);
  filter: blur(18px); animation: glow 3s ease-in-out infinite;
}
.wheel { position: relative; width: 100%; aspect-ratio: 1040 / 1110; }
.wheel-frame, .wheel-top { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.wheel-top { pointer-events: none; }
.wheel-disc {
  position: absolute; left: 7.6923%; top: 10.8108%; width: 84.6154%; height: 79.2793%;
  transform-origin: 50% 50%; will-change: transform;
}
.wheel-disc svg { display: block; width: 100%; height: 100%; overflow: visible; }
.hub-btn {
  position: absolute; left: 38.4615%; top: 39.6396%; width: 23.0769%; height: 21.6216%;
  border-radius: 50%; border: 0; background: transparent; cursor: pointer; padding: 0;
}
.hub-btn:focus-visible { outline-offset: 2px; }
.wheel.shake { animation: shake .45s ease; }

/* SVG bits (classes set in app.js) */
.bulb-halo { fill: rgba(255, 214, 102, .55); opacity: 0; transition: opacity .12s; }
.bulb-core { fill: #7a4a14; stroke: #3a1d05; stroke-width: 3; transition: fill .12s; }
.bulb-on .bulb-halo { opacity: 1; }
.bulb-on .bulb-core { fill: #fffbe0; }
.seg-hl { fill: #fff; opacity: 0; pointer-events: none; }
.seg-hl.on { animation: seg-flash .38s ease-in-out infinite alternate; }
.seg-label { font-family: var(--font-ui); paint-order: stroke; stroke-linejoin: round; }
.hub-text { font-family: var(--font-logo); paint-order: stroke; stroke-linejoin: round; }
.hub-face { transition: filter .2s; }
.wheel.locked .hub-face { filter: grayscale(.85) brightness(.7); }
.wheel.locked .hub-lock { opacity: 1; }
.hub-lock { opacity: 0; transition: opacity .3s; }

/* ---------- Controls ---------- */
.controls { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: -6px; }
.spin-btn {
  position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-width: min(100%, 280px); padding: 12px 36px 14px; border-radius: 999px; cursor: pointer; overflow: hidden;
  color: #fff; border: 4px solid transparent;
  background:
    linear-gradient(180deg, #ff86c8 0%, var(--magenta) 46%, var(--magenta-2) 100%) padding-box,
    linear-gradient(180deg, var(--gold-1), var(--gold-3) 55%, var(--gold-4)) border-box;
  box-shadow: 0 8px 0 var(--magenta-3), 0 16px 30px rgba(0,0,0,.5), inset 0 3px 0 rgba(255,255,255,.45);
  transition: transform .08s ease, box-shadow .08s ease, filter .25s;
}
.spin-btn::after {
  content: ""; position: absolute; top: -20%; bottom: -20%; left: -40%; width: 30%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); transform: skewX(-20deg);
  animation: shine 3.2s ease-in-out infinite;
}
.spin-btn:hover { filter: brightness(1.07) saturate(1.1); }
.spin-btn:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--magenta-3), 0 6px 14px rgba(0,0,0,.45), inset 0 3px 0 rgba(255,255,255,.35); }
.spin-btn-label {
  font: 400 34px/1 var(--font-logo); letter-spacing: 1.5px;
  text-shadow: 0 3px 0 #8a0045, 0 0 16px rgba(255,255,255,.35);
}
.spin-btn-sub { font: 800 13px/1.2 var(--font-body); letter-spacing: .3px; opacity: .95; }
.spin-btn.attract { animation: attract 1.6s ease-in-out infinite; }
.spin-btn.is-busy, .spin-btn.is-locked {
  cursor: default; filter: saturate(.25) brightness(.8);
  background:
    linear-gradient(180deg, #8b6aa6 0%, #5d3f7a 50%, #3f2658 100%) padding-box,
    linear-gradient(180deg, #d8c8e6, #8a73a0 60%, #4b3560) border-box;
  box-shadow: 0 6px 0 #26133a, 0 12px 24px rgba(0,0,0,.45), inset 0 3px 0 rgba(255,255,255,.25);
}
.spin-btn.is-busy::after, .spin-btn.is-locked::after { display: none; }
.spin-btn.is-locked { filter: none; }
.spin-btn.is-locked .spin-btn-label { font-size: 26px; }
.spin-btn-small { min-width: 0; padding: 10px 26px 11px; }
.spin-btn-small .spin-btn-label { font-size: 24px; }
.odds { margin: 0; font-size: 14px; color: var(--ink-faint); text-align: center; }
.odds b { color: var(--ink-dim); font-weight: 800; }

/* ---------- Haul ---------- */
.haul {
  width: 100%; margin-top: 8px; padding: 16px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(59, 16, 96, .72), rgba(29, 6, 51, .72));
  border: 2px solid rgba(255, 213, 74, .22);
}
.haul-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.haul h2 { margin: 0; font: 400 22px/1.1 var(--font-ui); color: var(--gold-2); letter-spacing: .5px; }
.collected { font-size: 13px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.haul-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.haul-item {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 14px; cursor: pointer; text-align: left; width: 100%;
  background: rgba(10, 2, 18, .45); border: 1px solid rgba(255,255,255,.08);
  transition: background .2s, transform .15s;
}
.haul-item:hover { background: rgba(10, 2, 18, .7); transform: translateY(-1px); }
.haul-emoji { width: 40px; height: 40px; display: grid; place-items: center; font-size: 22px; border-radius: 12px; background: var(--c, #555); box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); }
.haul-text { font-size: 14px; line-height: 1.35; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.haul-go { font: 400 14px/1 var(--font-ui); color: var(--gold-2); white-space: nowrap; }
.haul-empty { margin: 10px 0 0; font-size: 14px; color: var(--ink-faint); }

.footer { margin-top: 18px; text-align: center; font-size: 13px; color: var(--ink-faint); line-height: 1.5; }
.footer p { margin: 0 auto 6px; max-width: 52ch; }
.footer strong { color: var(--ink-dim); }
.footer-small { font-size: 12px; opacity: .85; }

/* ---------- Modals ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50; display: flex; justify-content: center; align-items: flex-start;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
  overflow-y: auto; overscroll-behavior: contain;
}
.modal-backdrop { position: fixed; inset: 0; background: rgba(9, 0, 18, .78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sunburst {
  position: fixed; left: 50%; top: 42%; width: 1700px; height: 1700px; margin: -850px 0 0 -850px; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255, 213, 74, .2) 0deg 8deg, rgba(255, 46, 151, .05) 8deg 16deg);
  -webkit-mask: radial-gradient(circle, #000 0%, rgba(0,0,0,.5) 25%, transparent 55%);
          mask: radial-gradient(circle, #000 0%, rgba(0,0,0,.5) 25%, transparent 55%);
  animation: rot 30s linear infinite;
}
.close-x {
  position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; z-index: 3;
  border: 2px solid rgba(255, 213, 74, .5); background: rgba(20, 3, 32, .7); color: var(--gold-1); font-size: 16px;
}
.result-card, .story-card, .gate-card {
  position: relative; width: min(100%, 560px); margin: auto; border-radius: 28px;
  border: 3px solid transparent;
  background:
    linear-gradient(180deg, var(--card-top), var(--card-bot)) padding-box,
    linear-gradient(180deg, var(--gold-1), var(--gold-3) 40%, var(--gold-4) 70%, var(--gold-2)) border-box;
  box-shadow: 0 30px 80px rgba(0,0,0,.65), 0 0 0 8px rgba(255, 213, 74, .1), 0 0 60px rgba(255, 46, 151, .25);
}
#result { padding-top: max(44px, env(safe-area-inset-top, 0px)); }
.result-card { padding: 34px 18px 18px; animation: pop-in .6s cubic-bezier(.2, 1.35, .4, 1) both; }
.result-card > .close-x { top: 36px; right: 12px; }
.ribbon {
  position: absolute; left: 50%; top: -22px; transform: translateX(-50%); z-index: 2; white-space: nowrap;
  padding: 9px 22px 10px; border-radius: 8px;
  font: 400 clamp(15px, 4.2vw, 20px)/1 var(--font-ui); text-transform: uppercase; letter-spacing: 1px; color: #fff;
  background: linear-gradient(180deg, #ff6fb8, var(--magenta) 50%, var(--magenta-2));
  text-shadow: 0 2px 0 #8a0045;
  box-shadow: 0 5px 0 var(--magenta-3), 0 10px 20px rgba(0,0,0,.4), inset 0 2px 0 rgba(255,255,255,.4);
  border: 2px solid var(--gold-2);
}
.ribbon::before, .ribbon::after {
  content: ""; position: absolute; top: 8px; width: 20px; height: 100%; z-index: -1;
  background: var(--magenta-3); border: 2px solid var(--gold-3);
}
.ribbon::before { left: -14px; transform: skewY(20deg); border-right: 0; border-radius: 4px 0 0 4px; }
.ribbon::after { right: -14px; transform: skewY(-20deg); border-left: 0; border-radius: 0 4px 4px 0; }
.res-cat {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 4px auto 0;
  font: 400 18px/1.1 var(--font-ui); letter-spacing: .8px; text-transform: uppercase;
}
.cat-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 8px; border-radius: 999px;
  background: linear-gradient(180deg, var(--c1), var(--c2)); color: var(--ink2, #fff);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 4px 0 rgba(0,0,0,.35); border: 2px solid rgba(255,255,255,.55);
  text-shadow: 0 2px 0 rgba(0,0,0,.35);
}
.cat-badge .e { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: rgba(0,0,0,.25); font-size: 17px; text-shadow: none; }
.cat-tag { width: 100%; text-align: center; font: 700 13px/1.3 var(--font-body); text-transform: none; letter-spacing: 0; color: var(--ink-faint); }

.res-stage { display: flex; flex-direction: column; align-items: center; margin-top: 8px; }
.jester-wrap { width: 118px; height: 118px; position: relative; z-index: 2; margin-bottom: -14px; animation: bob 2.4s ease-in-out infinite; }
.jester-wrap svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 6px 8px rgba(0,0,0,.45)); }
.jester-wrap.talking { animation: bob .45s ease-in-out infinite; }
.bubble {
  position: relative; width: 100%; padding: 22px 18px 16px; border-radius: 22px;
  background: var(--paper); color: var(--paper-ink);
  box-shadow: 0 0 0 4px var(--gold-2), 0 0 0 8px #3a0d52, 0 16px 30px rgba(0,0,0,.45), inset 0 -6px 0 rgba(42, 11, 61, .08);
}
.bubble::before {
  content: ""; position: absolute; left: 50%; top: -17px; width: 30px; height: 30px; transform: translateX(-50%) rotate(45deg);
  background: var(--paper); border-radius: 4px; box-shadow: -4px -4px 0 0 var(--gold-2);
}
.insult {
  position: relative; margin: 0; text-align: center;
  font: 400 var(--fs, 28px)/1.22 var(--font-ui); letter-spacing: .2px; color: var(--paper-ink);
  text-wrap: balance; overflow-wrap: break-word;
}
.insult .w { display: inline-block; border-radius: 6px; transition: color .12s, transform .12s; }
.insult.reveal .w { animation: word-in .42s cubic-bezier(.2, 1.5, .4, 1) both; animation-delay: var(--dl, 0s); }
.insult .w.said { color: #c0126e; }
.insult .w.now { background: var(--gold-2); box-shadow: 0 0 0 3px var(--gold-2); color: var(--paper-ink); transform: scale(1.06); }
.insult .w.gl { text-decoration: underline dotted 3px rgba(122, 44, 214, .75); text-underline-offset: 5px; cursor: help; }
.res-src { margin: 10px 0 0; text-align: center; font: italic 700 14px/1.35 var(--font-body); color: var(--paper-dim); }
.res-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; cursor: pointer;
  font: 400 17px/1 var(--font-ui); letter-spacing: .4px; border: 2px solid transparent;
  transition: transform .08s, filter .2s;
}
.pill:active { transform: translateY(2px); }
.pill-ico { font-size: 15px; line-height: 1; }
.pill-play {
  color: #3d1600;
  background: linear-gradient(180deg, #fff1a8, var(--gold-2) 50%, var(--gold-3)) padding-box, linear-gradient(180deg, #fff, var(--gold-4)) border-box;
  box-shadow: 0 4px 0 var(--gold-4), 0 8px 16px rgba(0,0,0,.35);
}
.pill-play.playing { animation: attract-soft 1s ease-in-out infinite; }
.pill-wtf { color: var(--ink); background: rgba(155, 77, 255, .22); border-color: rgba(155, 77, 255, .7); box-shadow: 0 4px 0 #2a0b45; }
.pill-wtf[aria-expanded="true"] { background: rgba(155, 77, 255, .45); }
.gloss { margin-top: 14px; padding: 14px 16px; border-radius: 16px; background: rgba(10, 2, 18, .5); border: 1px solid rgba(155, 77, 255, .45); }
.gloss h3 { margin: 0 0 8px; font: 400 16px/1 var(--font-ui); letter-spacing: 1px; text-transform: uppercase; color: var(--violet); }
.gloss dl { margin: 0; display: grid; gap: 10px; }
.gloss dt { font: 400 18px/1.2 var(--font-ui); color: var(--gold-2); }
.gloss dt small { margin-left: 8px; padding: 2px 8px; border-radius: 999px; font: 800 11px/1.6 var(--font-body); color: var(--ink-dim); background: rgba(255,255,255,.1); vertical-align: 2px; white-space: nowrap; }
.gloss dd { margin: 2px 0 0; font-size: 15px; line-height: 1.4; color: var(--ink); }
.gloss .flash { animation: flash-bg 1.2s ease; border-radius: 8px; }
.gloss-empty { margin: 0; color: var(--ink-dim); font-size: 15px; }

/* say it out loud */
.sayit {
  margin-top: 18px; padding: 16px 16px 14px; border-radius: 20px; text-align: center;
  background: radial-gradient(circle at 50% 0%, rgba(255, 46, 151, .22), transparent 70%), rgba(10, 2, 18, .45);
  border: 2px solid rgba(255, 46, 151, .45);
}
.sayit-head h3 { margin: 0; font: 400 20px/1.15 var(--font-ui); letter-spacing: .4px; color: var(--ink); }
.sayit-head p { margin: 4px auto 12px; max-width: 40ch; font-size: 14px; line-height: 1.4; color: var(--ink-dim); }
.mic-btn {
  position: relative; width: 84px; height: 84px; border-radius: 50%; cursor: pointer; display: inline-grid; place-items: center;
  border: 4px solid var(--gold-2);
  background: radial-gradient(circle at 38% 30%, #ff8ac4, var(--magenta) 48%, var(--magenta-2));
  box-shadow: 0 6px 0 var(--magenta-3), 0 12px 24px rgba(0,0,0,.45), inset 0 3px 0 rgba(255,255,255,.4);
  transition: transform .1s, filter .2s;
}
.mic-btn svg { width: 38px; height: 38px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; position: relative; z-index: 1; }
.mic-btn svg rect { fill: #fff; stroke: none; }
.mic-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--magenta-3), 0 6px 14px rgba(0,0,0,.45); }
.mic-rings { position: absolute; inset: -4px; border-radius: 50%; pointer-events: none; }
.mic-btn.listening { background: radial-gradient(circle at 38% 30%, #ff9a8a, #ff3b30 50%, #b3140d); }
.mic-btn.listening .mic-rings { box-shadow: 0 0 0 0 rgba(255, 59, 48, .6); animation: mic-pulse 1.1s ease-out infinite; }
.mic-btn.busy { filter: saturate(.3) brightness(.85); cursor: progress; }
.mic-label { margin: 10px 0 0; font: 400 16px/1.2 var(--font-ui); color: var(--gold-2); letter-spacing: .3px; }
.sayit-live { min-height: 1.4em; margin: 8px auto 0; max-width: 46ch; font: italic 700 15px/1.4 var(--font-body); color: var(--ink); }
.sayit-live:empty { display: none; }
.sayit-result { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 12px; text-align: left; animation: pop-in .5s cubic-bezier(.2, 1.35, .4, 1) both; }
.score-ring {
  --p: 0; flex: 0 0 auto; width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; align-content: center; grid-auto-flow: column;
  background: radial-gradient(circle, #1d0633 58%, transparent 60%), conic-gradient(var(--sc, var(--gold-2)) calc(var(--p) * 1%), rgba(255,255,255,.12) 0);
  font: 400 30px/1 var(--font-logo); color: #fff;
}
.score-ring small { font-size: 14px; margin-left: 1px; color: var(--ink-dim); }
.stars { font-size: 22px; letter-spacing: 3px; color: rgba(255,255,255,.18); }
.stars b { color: var(--gold-2); font-weight: 400; text-shadow: 0 0 10px rgba(255, 213, 74, .7); }
.score-title { margin: 2px 0 0; font: 400 22px/1 var(--font-logo); letter-spacing: 1px; color: var(--gold-1); }
.score-verdict { margin: 4px 0 0; max-width: 30ch; font-size: 14px; line-height: 1.35; color: var(--ink-dim); }
.sayit-note { margin: 12px auto 0; max-width: 44ch; font-size: 12px; line-height: 1.4; color: var(--ink-faint); }
.insult .w.hit { color: #0f8a3a; }
.insult .w.miss { color: #d11a3f; text-decoration: underline wavy 2px rgba(209, 26, 63, .6); text-underline-offset: 5px; }
@keyframes mic-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 59, 48, .6); } 100% { box-shadow: 0 0 0 26px rgba(255, 59, 48, 0); } }

.share { margin-top: 18px; padding-top: 14px; border-top: 1px dashed rgba(255, 213, 74, .3); }
.share-title { margin: 0 0 12px; text-align: center; font: 400 18px/1.2 var(--font-ui); color: var(--ink); letter-spacing: .3px; }
.share-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.share-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer;
  font: 800 12px/1.1 var(--font-body); color: var(--ink-dim); text-decoration: none; text-align: center;
}
.share-btn svg {
  width: 52px; height: 52px; padding: 13px; border-radius: 50%;
  fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  background: var(--sb, #444); box-shadow: 0 4px 0 rgba(0,0,0,.4), inset 0 2px 0 rgba(255,255,255,.3);
  transition: transform .12s;
}
.share-btn svg .fill { fill: #fff; stroke: none; }
.share-btn:hover svg { transform: translateY(-2px) scale(1.05); }
.share-btn:active svg { transform: translateY(2px); }
.s-story { --sb: linear-gradient(45deg, #feda75, #fa7e1e 25%, #d62976 55%, #962fbf 80%, #4f5bd5); }
.s-x { --sb: #0b0b0b; }
.s-fb { --sb: #1877f2; }
.s-wa { --sb: #25d366; }
.s-tg { --sb: #2aabee; }
.s-copy { --sb: linear-gradient(180deg, #7b4bd6, #4a2192); }
.res-footer { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 18px; }
.text-btn { border: 0; background: none; cursor: pointer; padding: 8px 12px; font: 800 15px/1 var(--font-body); color: var(--ink-faint); text-decoration: underline; text-underline-offset: 3px; }
.text-btn:hover { color: var(--ink); }

.story-card { padding: 22px 18px 18px; text-align: center; animation: pop-in .45s cubic-bezier(.2, 1.35, .4, 1) both; }
.story-card h2 { margin: 0 0 12px; font: 400 24px/1.1 var(--font-ui); color: var(--gold-2); }
.story-card img { display: block; margin: 0 auto; max-width: 100%; max-height: 58vh; width: auto; border-radius: 16px; box-shadow: 0 12px 30px rgba(0,0,0,.5); background: #1d0633; }
.story-hint { margin: 12px auto 0; max-width: 42ch; font-size: 14px; color: var(--ink-dim); }
.story-actions { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 12px; }

.modal-gate { align-items: center; z-index: 70; }
.gate-card { padding: 0 22px 22px; text-align: center; overflow: hidden; animation: pop-in .5s cubic-bezier(.2, 1.35, .4, 1) both; }
.hazard { height: 22px; margin: 0 -22px 18px; background: repeating-linear-gradient(-45deg, var(--gold-2) 0 16px, #1b0a24 16px 32px); }
.gate-kicker { margin: 0; font: 800 13px/1 var(--font-body); letter-spacing: 2px; text-transform: uppercase; color: var(--gold-2); }
.gate-card h2 { margin: 10px 0 8px; font: 400 clamp(34px, 10vw, 46px)/1 var(--font-logo); color: var(--ink); text-shadow: 0 4px 0 var(--magenta-2), 0 0 24px rgba(255, 46, 151, .6); }
.gate-card p { margin: 0 auto 18px; max-width: 40ch; color: var(--ink-dim); }
.gate-card .text-btn { display: inline-block; margin-top: 10px; }
.gate-card .spin-btn { padding-inline: 22px; }
.gate-card .spin-btn-label { font-size: clamp(22px, 6.6vw, 30px); white-space: nowrap; }

/* ---------- FX / toast ---------- */
.fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 80; }
.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 90;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 999px; text-align: center;
  font: 800 15px/1.3 var(--font-body); color: #2a0b3d; background: var(--gold-2);
  box-shadow: 0 6px 0 var(--gold-4), 0 12px 30px rgba(0,0,0,.5); animation: toast-in .35s cubic-bezier(.2, 1.4, .4, 1) both;
}
/* ---------- Win celebration ---------- */
.celebrate { position: fixed; inset: 0; z-index: 45; pointer-events: none; }
.celebrate.skippable { pointer-events: auto; cursor: pointer; }
.flash { position: fixed; inset: 0; z-index: 84; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 45%, #fff 0%, rgba(255, 244, 184, .85) 35%, rgba(255, 46, 151, .35) 70%, transparent 100%); }
.flash.go { animation: flash .55s ease-out; }
.shock { position: fixed; z-index: 44; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; pointer-events: none; opacity: 0; border: 8px solid var(--gold-2); box-shadow: 0 0 30px var(--gold-2), inset 0 0 30px var(--magenta); }
.shock.go { animation: shock .8s cubic-bezier(.1, .7, .3, 1) forwards; }
.shock.two.go { animation-delay: .12s; border-color: var(--magenta); }
.wheel-wrap.punch { animation: punch .6s cubic-bezier(.2, 1.6, .4, 1); }
.win-slam { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; pointer-events: none; opacity: 0; }
.win-slam-inner { position: relative; display: grid; place-items: center; text-align: center; }
.win-rays {
  position: absolute; left: 50%; top: 50%; width: 760px; height: 760px; margin: -380px 0 0 -380px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 213, 74, .55) 0deg 10deg, transparent 10deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 12%, transparent 62%); mask: radial-gradient(circle, #000 12%, transparent 62%);
}
.win-word {
  position: relative; display: block; padding: 0 12px; white-space: nowrap;
  font: 400 clamp(60px, 18vw, 140px)/1 var(--font-logo); letter-spacing: 1px;
  background: linear-gradient(180deg, #fffbe3, var(--gold-2) 45%, var(--gold-3) 62%, #ffe98a 80%, var(--gold-3));
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: 3px #4d1800;
  filter: drop-shadow(0 6px 0 #7a2400) drop-shadow(0 10px 0 #3d0d00) drop-shadow(0 0 34px rgba(255, 213, 74, .85));
}
.win-sub {
  position: relative; display: inline-block; margin-top: 10px; padding: 8px 18px; border-radius: 999px;
  font: 400 clamp(16px, 4.6vw, 24px)/1 var(--font-ui); letter-spacing: 1px; color: #fff; text-transform: uppercase;
  background: linear-gradient(180deg, #ff6fb8, var(--magenta-2)); border: 3px solid var(--gold-2);
  box-shadow: 0 5px 0 var(--magenta-3), 0 10px 24px rgba(0,0,0,.5);
}
.win-slam.go { animation: slam-wrap 1.5s ease forwards; }
.win-slam.go .win-word { animation: slam 1.5s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.win-slam.go .win-sub { animation: sub-in 1.5s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.win-slam.go .win-rays { animation: rays-in 1.5s ease-out forwards; }
.win-slam.big.go, .win-slam.big.go .win-word, .win-slam.big.go .win-sub, .win-slam.big.go .win-rays { animation-duration: 2.3s; }
.win-slam.big .win-rays { background: repeating-conic-gradient(from 0deg, rgba(255, 213, 74, .75) 0deg 8deg, rgba(255, 46, 151, .35) 8deg 16deg); }
.app.quake { animation: quake .7s ease; }

/* card flip reveal */
.card-back {
  position: fixed; left: 50%; top: 50%; z-index: 55; width: min(78vw, 300px); aspect-ratio: 5 / 7; margin: 0;
  display: grid; place-items: center; align-content: center; gap: 10px; border-radius: 26px; pointer-events: none;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 213, 74, .35), transparent 45%),
    repeating-linear-gradient(45deg, rgba(255, 213, 74, .16) 0 12px, transparent 12px 24px),
    repeating-linear-gradient(-45deg, rgba(255, 213, 74, .16) 0 12px, transparent 12px 24px),
    linear-gradient(160deg, #6a1fb0, #2a0748);
  border: 6px solid var(--gold-2); outline: 3px solid #3a0d52; outline-offset: -14px;
  box-shadow: 0 30px 70px rgba(0,0,0,.6), 0 0 60px rgba(255, 213, 74, .45), inset 0 0 40px rgba(0,0,0,.4);
  transform: translate(-50%, -50%) scale(0); transform-style: preserve-3d;
}
.card-back .cb-emoji { width: 44%; aspect-ratio: 1; display: grid; place-items: center; font-size: clamp(54px, 16vw, 84px); border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6c2, var(--gold-2) 45%, var(--gold-4)); border: 5px solid #fff4b8; box-shadow: 0 8px 0 #6b3a00, 0 0 30px rgba(255, 213, 74, .7); }
.card-back .cb-label { font: 400 clamp(22px, 6.5vw, 30px)/1 var(--font-logo); color: var(--gold-1); letter-spacing: 1px; text-shadow: 0 3px 0 var(--magenta-2), 0 0 16px rgba(255, 46, 151, .8); }
.card-back::after { content: ""; position: absolute; inset: 0; border-radius: 20px; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.55) 45%, transparent 60%); background-size: 250% 100%; animation: card-shine 1.1s ease-in-out infinite; }
.card-back.show { animation: card-back-in .9s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.card-back.flip { animation: card-back-out .26s ease-in forwards; }
.result-card.flip-in { animation: card-front-in .5s cubic-bezier(.2, 1.3, .4, 1) both; }
.modal.revealing .result-card { visibility: hidden; }
.result-card::after {
  content: "✦   ✧   ✦   ✧   ✦"; position: absolute; left: 0; right: 0; bottom: -30px; text-align: center; pointer-events: none;
  color: var(--gold-1); font-size: 18px; letter-spacing: 6px; text-shadow: 0 0 10px var(--gold-2); animation: twinkle-row 2.4s ease-in-out infinite;
}

/* ---------- Keyframes ---------- */
@keyframes rot { to { transform: rotate(360deg); } }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.4) rotate(0deg); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }
@keyframes bulbs { 0% { background-position: 0 0, 12px 0; } 50% { background-position: 12px 0, 0 0; } }
@keyframes glow { 0%, 100% { opacity: .75; transform: translate(-50%, -50%) scale(.97); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.03); } }
@keyframes shine { 0%, 55% { left: -40%; } 85%, 100% { left: 130%; } }
@keyframes attract { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }
@keyframes attract-soft { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.15); } }
@keyframes chip-pop { 0% { transform: scale(1); } 40% { transform: scale(1.4) rotate(40deg); } 100% { transform: scale(.86); } }
@keyframes seg-flash { from { opacity: 0; } to { opacity: .45; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-10px) rotate(-1deg); } 40% { transform: translateX(9px) rotate(1deg); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
@keyframes quake { 0%, 100% { transform: translate(0, 0); } 15% { transform: translate(-8px, 4px); } 30% { transform: translate(7px, -6px); } 45% { transform: translate(-6px, -3px); } 60% { transform: translate(5px, 5px); } 75% { transform: translate(-3px, 2px); } }
@keyframes pop-in { 0% { opacity: 0; transform: translateY(40px) scale(.7); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes word-in { 0% { opacity: 0; transform: translateY(14px) scale(.6) rotate(-6deg); } 100% { opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-5px) rotate(2deg); } }
@keyframes flash-bg { 0%, 60% { background: rgba(255, 213, 74, .28); } 100% { background: transparent; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 20px) scale(.9); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes slam-wrap { 0% { opacity: 0; } 8% { opacity: 1; } 78% { opacity: 1; } 100% { opacity: 0; } }
@keyframes slam { 0% { transform: scale(3.2) rotate(-12deg); } 22% { transform: scale(.92) rotate(3deg); } 32% { transform: scale(1.05) rotate(-2deg); } 42%, 78% { transform: scale(1) rotate(0); } 100% { transform: translateY(-60px) scale(1.25); } }
@keyframes sub-in { 0%, 20% { opacity: 0; transform: translateY(20px) scale(.6); } 36%, 78% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-40px); } }
@keyframes rays-in { 0% { transform: scale(0) rotate(0deg); opacity: 0; } 25% { transform: scale(1) rotate(40deg); opacity: 1; } 100% { transform: scale(1.35) rotate(140deg); opacity: 0; } }
@keyframes flash { 0% { opacity: 0; } 12% { opacity: .85; } 100% { opacity: 0; } }
@keyframes shock { 0% { transform: scale(.2); opacity: 1; } 100% { transform: scale(7); opacity: 0; } }
@keyframes punch { 0% { transform: scale(1); } 30% { transform: scale(1.07); } 60% { transform: scale(.98); } 100% { transform: scale(1); } }
@keyframes card-back-in { 0% { transform: translate(-50%, -50%) scale(0) rotate(-20deg); } 55% { transform: translate(-50%, -50%) scale(1.06) rotate(3deg); } 75%, 100% { transform: translate(-50%, -50%) scale(1) rotate(0); } }
@keyframes card-back-out { from { transform: translate(-50%, -50%) perspective(900px) rotateY(0deg); } to { transform: translate(-50%, -50%) perspective(900px) rotateY(90deg); } }
@keyframes card-front-in { from { transform: perspective(1100px) rotateY(-90deg) scale(.9); } to { transform: perspective(1100px) rotateY(0deg) scale(1); } }
@keyframes card-shine { 0% { background-position: 150% 0; } 100% { background-position: -100% 0; } }
@keyframes twinkle-row { 0%, 100% { opacity: .35; letter-spacing: 6px; } 50% { opacity: 1; letter-spacing: 10px; } }

/* ---------- Link-preview render (?og): 1200x630 screenshot ---------- */
.og-mode body { overflow: hidden; }
.og-mode .topbar, .og-mode .controls, .og-mode .haul, .og-mode .footer, .og-mode .twinkle { display: none; }
.og-mode .app { max-width: none; width: 1200px; height: 630px; padding: 0 56px; display: grid; grid-template-columns: 1fr 530px; align-items: center; gap: 20px; }
.og-mode .marquee { text-align: left; }
.og-mode .marquee-lights { left: 0; transform: none; width: 520px; }
.og-mode .logo-top { font-size: 44px; }
.og-mode .logo-main { font-size: 104px; }
.og-mode .tagline { font-size: 30px; margin-top: 18px; }
.og-mode .og-extra { display: block; }
.og-mode .stage { grid-column: 2; grid-row: 1; }
.og-mode .wheel-wrap { width: 520px; margin: 0; }
.og-extra { display: none; margin-top: 22px; font: 800 22px/1.4 var(--font-body); color: var(--ink-dim); }
.og-extra b { color: var(--gold-2); }

@media (max-width: 440px) {
  .share-row { grid-template-columns: repeat(3, 1fr); row-gap: 12px; }
  .result-card { padding-inline: 14px; }
  .bubble { padding: 20px 14px 14px; }
  .spin-btn-label { font-size: 30px; }
}
@media (min-width: 980px) {
  .app {
    max-width: 1180px; display: grid; column-gap: 56px; align-items: start;
    grid-template-columns: minmax(0, 1fr) minmax(0, min(560px, 78vh));
    grid-template-areas: "top top" "marquee wheel" "controls wheel" "haul wheel" "footer footer";
    grid-template-rows: auto auto auto 1fr auto;
  }
  .topbar { grid-area: top; }
  .marquee { grid-area: marquee; text-align: left; margin-top: 28px; }
  .marquee-lights { left: 0; transform: none; }
  .logo-top { font-size: clamp(22px, 2.4vw, 34px); }
  .logo-main { font-size: clamp(46px, 5.5vw, 92px); }
  .tagline { font-size: clamp(18px, 1.7vw, 24px); }
  .stage { display: contents; }
  .wheel-wrap { grid-area: wheel; width: 100%; align-self: center; margin-top: 0; }
  .controls { grid-area: controls; align-items: flex-start; margin-top: 22px; }
  .odds { text-align: left; max-width: 44ch; }
  .haul { grid-area: haul; margin-top: 18px; }
  .footer { grid-area: footer; }
}
@media (prefers-reduced-motion: reduce) {
  .bg-rays, .sunburst, .twinkle::before, .wheel-glow, .spin-btn::after, .spin-btn.attract, .jester-wrap, .marquee-lights, .result-card::after, .card-back::after { animation: none !important; }
  .wheel-wrap.punch, .app.quake { animation: none !important; }
  .insult.reveal .w { animation-duration: .01s; }
}
