:root {
  --bg: #0a0911;
  --panel: rgba(25, 23, 36, .82);
  --panel-strong: rgba(31, 28, 44, .96);
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .18);
  --text: #f8f7ff;
  --muted: #aaa6b7;
  --muted-2: #777282;
  --violet: #8067ff;
  --violet-2: #ad91ff;
  --pink: #ff5f8f;
  --green: #5ed9b4;
  --danger: #ff718f;
  --shadow: 0 24px 70px rgba(0, 0, 0, .38);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-width: 320px; min-height: 100vh; min-height: 100svh; background: var(--bg); overscroll-behavior: none; }
button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; opacity: .58; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(173, 145, 255, .48); outline-offset: 3px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-shell {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% -20%, rgba(128, 103, 255, .16), transparent 42%),
    linear-gradient(180deg, #0d0b17 0%, #090810 58%, #07070c 100%);
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

.ambient { position: fixed; z-index: -2; border-radius: 999px; filter: blur(90px); opacity: .23; pointer-events: none; }
.ambient-one { width: 300px; height: 300px; right: -110px; top: -90px; background: #7959ff; }
.ambient-two { width: 260px; height: 260px; left: -120px; bottom: -90px; background: #ff4e83; }
.noise { position: fixed; inset: 0; z-index: -1; opacity: .035; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%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)' opacity='.65'/%3E%3C/svg%3E"); }

.app-header {
  position: relative;
  z-index: 10;
  width: min(100%, 620px);
  height: calc(70px + env(safe-area-inset-top));
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 18px 10px;
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 10px;
}

.header-brand { justify-self: center; display: flex; align-items: center; gap: 8px; color: #bdb4dd; font-size: 10px; font-weight: 850; letter-spacing: .16em; }
.brand-dot { width: 7px; height: 7px; border-radius: 50%; background: linear-gradient(135deg, var(--violet-2), var(--pink)); box-shadow: 0 0 16px rgba(173,145,255,.8); }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.055); color: #f4f2ff; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.icon-button:active { transform: scale(.94); }
.back-button[hidden] { visibility: hidden; display: grid; }
.sound-off { display: none; }
.sound-muted .sound-on { display: none; }
.sound-muted .sound-off { display: block; }
.network-badge { display: none; padding: 7px 10px; border: 1px solid rgba(94,217,180,.2); border-radius: 999px; color: var(--green); background: rgba(94,217,180,.08); font-size: 10px; font-weight: 750; }
.network-badge.offline { display: inline-flex; color: #ffb6c6; border-color: rgba(255,113,143,.22); background: rgba(255,113,143,.09); }

.screen { position: relative; z-index: 2; width: min(100%, 590px); min-height: calc(100svh - 70px - env(safe-area-inset-top)); margin: 0 auto; padding: 18px 20px calc(38px + env(safe-area-inset-bottom)); }
.screen-enter { animation: screenEnter .38s cubic-bezier(.2,.8,.2,1) both; }

.eyebrow { color: #aea0ff; font-size: 11px; font-weight: 850; letter-spacing: .15em; }
.hero { padding-top: clamp(38px, 8vh, 78px); }
.hero h1 { margin: 19px 0 15px; font-size: clamp(48px, 14vw, 70px); line-height: .98; letter-spacing: -.065em; }
.hero h1 span { background: linear-gradient(105deg, #fff 3%, #c6b8ff 53%, #ff9cba 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-copy { max-width: 420px; margin: 0 0 28px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.mini-badge { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.04); color: #c5c0d0; font-size: 11px; }
.mini-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(94,217,180,.65); }

.mode-grid { display: grid; gap: 13px; }
.mode-card { position: relative; overflow: hidden; width: 100%; min-height: 118px; padding: 18px; display: grid; grid-template-columns: 64px minmax(0,1fr) 26px; gap: 16px; align-items: center; text-align: left; color: #fff; border: 1px solid var(--line); border-radius: 26px; background: linear-gradient(145deg, rgba(255,255,255,.085), rgba(255,255,255,.035)); box-shadow: 0 16px 45px rgba(0,0,0,.19); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.mode-card::after { content: ""; position: absolute; inset: auto -60px -90px auto; width: 180px; height: 180px; border-radius: 50%; opacity: .12; filter: blur(4px); }
.mode-card:hover { transform: translateY(-3px); border-color: rgba(173,145,255,.36); box-shadow: 0 21px 50px rgba(0,0,0,.28); }
.mode-card:active { transform: scale(.986); }
.mode-card.dice::after { background: var(--violet); }
.mode-card.wheel::after { background: var(--pink); }
.mode-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 20px; font-size: 31px; box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 12px 24px rgba(0,0,0,.2); }
.dice .mode-icon { background: linear-gradient(145deg, #927dff, #6045e7); }
.wheel .mode-icon { background: linear-gradient(145deg, #ff829e, #e34172); }
.mode-card small { color: #9e98ad; font-size: 11px; }
.mode-card h2 { margin: 3px 0 5px; font-size: 21px; letter-spacing: -.025em; }
.mode-card p { margin: 0; color: #b5b0bf; font-size: 12px; line-height: 1.45; }
.mode-arrow { justify-self: end; color: #a7a1b4; font-size: 25px; }
.safety-note { margin: 24px auto 0; color: #696573; text-align: center; font-size: 11px; line-height: 1.6; }

.page-head { padding-top: 15px; }
.page-head h1 { margin: 10px 0 8px; font-size: clamp(34px, 10vw, 43px); line-height: 1.05; letter-spacing: -.045em; }
.page-head p { margin: 0; color: var(--muted); line-height: 1.65; font-size: 14px; }
.panel { margin-top: 17px; padding: 19px; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); box-shadow: 0 18px 48px rgba(0,0,0,.18); }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 800; }
.panel-title small { color: var(--muted-2); font-weight: 600; }
.counter { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; margin: 18px 0 15px; }
.counter strong { text-align: center; font-size: 54px; line-height: 1; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.counter button { height: 50px; border: 1px solid var(--line); border-radius: 16px; background: #1d1a29; color: #fff; font-size: 24px; transition: transform .15s ease, background .15s ease; }
.counter button:active { transform: scale(.94); background: #29243a; }
.quick-row { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-row button, .segment button { min-height: 39px; border: 0; border-radius: 12px; background: #1c1927; color: #9e99aa; font-size: 12px; font-weight: 750; transition: background .16s ease, color .16s ease, transform .16s ease; }
.quick-row button { padding: 0 13px; }
.quick-row button.active, .segment button.active { color: #fff; background: linear-gradient(135deg, #765af2, #8d6cff); box-shadow: 0 8px 20px rgba(118,90,242,.2); }
.segment { display: grid; grid-template-columns: repeat(var(--segments, 2), 1fr); gap: 4px; margin-top: 15px; padding: 4px; border-radius: 15px; background: #121019; }
.segment button { padding: 10px 7px; }
.segment button:active, .quick-row button:active { transform: scale(.97); }
.helper { margin: 10px 0 0; color: #777282; font-size: 11px; line-height: 1.55; }

.player-inputs { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; margin-top: 15px; }
.player-input { position: relative; }
.player-input span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #827b93; font-size: 11px; pointer-events: none; }
.player-input input { width: 100%; height: 46px; padding: 0 11px 0 36px; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; background: #16131f; color: #fff; min-width: 0; }
.player-input input::placeholder { color: #625d6d; }
.player-input input:focus { border-color: rgba(173,145,255,.48); background: #1b1727; }

.primary-button { width: 100%; height: 58px; margin-top: 20px; border: 0; border-radius: 18px; color: #fff; background: linear-gradient(105deg, #7356ee, #9b70ff); box-shadow: 0 16px 32px rgba(116,86,238,.27); font-size: 16px; font-weight: 850; letter-spacing: .01em; transition: transform .16s ease, filter .16s ease, box-shadow .16s ease; }
.primary-button:hover { filter: brightness(1.06); box-shadow: 0 20px 38px rgba(116,86,238,.34); }
.primary-button:active { transform: scale(.975); }
.primary-button.wheel-cta { background: linear-gradient(105deg, #e84776, #ff7398); box-shadow: 0 16px 32px rgba(232,71,118,.24); }

.game-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.game-head small { color: #8e84b5; font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.game-head h1 { margin: 3px 0 0; font-size: 30px; letter-spacing: -.04em; }
.rule-pill { flex: none; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.05); color: #c5c0d0; font-size: 11px; }

.player-track { display: flex; gap: 8px; margin: 0 -20px; padding: 4px 20px 12px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.player-track::-webkit-scrollbar { display: none; }
.player-chip { flex: 0 0 auto; min-width: 78px; padding: 9px 11px; display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.04); scroll-snap-align: center; transition: border-color .2s ease, background .2s ease, transform .2s ease, opacity .2s ease; }
.player-chip span { color: #9690a2; font-size: 10px; max-width: 82px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-chip strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.player-chip.current { border-color: rgba(153,124,255,.7); background: rgba(123,91,246,.18); transform: translateY(-2px); }
.player-chip.done strong { color: #c7bbff; }
.player-chip.selected { border-color: rgba(255,113,143,.72); background: rgba(255,95,143,.15); transform: translateY(-2px) scale(1.025); }
.player-chip.dimmed { opacity: .48; }

.dice-board { position: relative; margin-top: 8px; padding: 23px 18px 19px; overflow: hidden; text-align: center; border: 1px solid var(--line); border-radius: 28px; background: radial-gradient(circle at 50% 20%, rgba(128,103,255,.18), transparent 48%), var(--panel); box-shadow: var(--shadow); contain: layout paint; }
.dice-board::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(120deg, transparent 35%, rgba(255,255,255,.035), transparent 66%); }
.turn-label { position: relative; z-index: 2; margin: 0; color: #b9b3c3; font-size: 13px; }
.turn-label strong { color: #fff; }
.dice-scene { position: relative; width: 136px; height: 136px; margin: 24px auto 21px; perspective: 700px; }
.dice-shadow { position: absolute; left: 50%; bottom: -12px; width: 92px; height: 22px; transform: translateX(-50%); border-radius: 50%; background: rgba(0,0,0,.48); filter: blur(10px); transition: transform .2s ease, opacity .2s ease; }
.dice-cube { position: absolute; inset: 12px; transform-style: preserve-3d; transform: rotateX(var(--rx, -18deg)) rotateY(var(--ry, 28deg)); }
.dice-cube.is-rolling { will-change: transform; }
.dice-cube.is-rolling + .dice-shadow { transform: translateX(-50%) scale(.7); opacity: .56; }
.dice-face { position: absolute; width: 112px; height: 112px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 18px; border: 1px solid rgba(255,255,255,.74); border-radius: 24px; background: linear-gradient(145deg, #fff, #ded8ef); box-shadow: inset -7px -8px 16px rgba(85,68,111,.11), inset 5px 5px 12px rgba(255,255,255,.7); backface-visibility: hidden; }
.face-1 { transform: translateZ(56px); }
.face-6 { transform: rotateY(180deg) translateZ(56px); }
.face-3 { transform: rotateY(90deg) translateZ(56px); }
.face-4 { transform: rotateY(-90deg) translateZ(56px); }
.face-2 { transform: rotateX(90deg) translateZ(56px); }
.face-5 { transform: rotateX(-90deg) translateZ(56px); }
.pip { width: 17px; height: 17px; align-self: center; justify-self: center; border-radius: 50%; background: #191522; box-shadow: inset 0 2px 2px rgba(0,0,0,.38); }
.p-tl { grid-area: 1 / 1; } .p-tc { grid-area: 1 / 2; } .p-tr { grid-area: 1 / 3; }
.p-ml { grid-area: 2 / 1; } .p-mc { grid-area: 2 / 2; } .p-mr { grid-area: 2 / 3; }
.p-bl { grid-area: 3 / 1; } .p-bc { grid-area: 3 / 2; } .p-br { grid-area: 3 / 3; }
.roll-button { position: relative; z-index: 2; min-width: 152px; height: 50px; padding: 0 25px; border: 0; border-radius: 16px; color: #fff; background: linear-gradient(105deg, #7255ee, #9470ff); box-shadow: 0 12px 28px rgba(114,85,238,.28); font-weight: 800; transition: transform .16s ease, filter .16s ease; }
.roll-button:active { transform: scale(.97); }
.dice-hint { margin: 11px 0 0; color: #777180; font-size: 10px; }

.wheel-zone { position: relative; margin-top: 8px; padding: 16px 10px 18px; border: 1px solid var(--line); border-radius: 29px; background: radial-gradient(circle at 50% 42%, rgba(255,95,143,.12), transparent 55%), var(--panel); box-shadow: var(--shadow); contain: layout paint; }
.wheel-stage { position: relative; width: min(82vw, 358px); aspect-ratio: 1; margin: 30px auto 14px; }
.wheel-glow { position: absolute; inset: 7%; border-radius: 50%; background: rgba(255,95,143,.17); filter: blur(24px); transition: opacity .3s ease, transform .3s ease; }
.wheel-stage.is-spinning .wheel-glow { opacity: .8; transform: scale(1.05); }
.wheel-rim { position: absolute; inset: 0; z-index: 1; border-radius: 50%; background: linear-gradient(145deg, #373342, #111018 62%, #4a4355); box-shadow: 0 27px 58px rgba(0,0,0,.45), inset 0 2px 0 rgba(255,255,255,.18), inset 0 -6px 12px rgba(0,0,0,.55); }
.wheel-rim::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 1px solid rgba(255,255,255,.14); background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.34) 0deg 1.2deg, transparent 1.2deg 30deg); mask: radial-gradient(circle, transparent 0 91%, #000 91% 100%); }
.wheel-rotor { position: absolute; inset: 14px; z-index: 2; overflow: hidden; border-radius: 50%; transform: rotate(var(--rotation, 0deg)); box-shadow: inset 0 0 0 8px rgba(8,8,13,.64), inset 0 0 28px rgba(0,0,0,.35); }
.wheel-rotor.is-spinning { will-change: transform; }
.wheel-rotor::before { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: 50%; background: repeating-conic-gradient(from 0deg, transparent 0deg calc(var(--step) - .8deg), rgba(9,8,14,.52) calc(var(--step) - .8deg) var(--step)); }
.wheel-rotor::after { content: ""; position: absolute; inset: 0; z-index: 3; border-radius: 50%; pointer-events: none; background: radial-gradient(circle at 35% 25%, rgba(255,255,255,.22), transparent 18%), radial-gradient(circle, transparent 0 58%, rgba(0,0,0,.16) 100%); }
.wheel-label { position: absolute; z-index: 4; left: var(--x); top: var(--y); width: 35px; height: 35px; display: grid; place-items: center; transform: translate(-50%, -50%) rotate(var(--label-angle)); border-radius: 12px; color: #fff; background: rgba(9,8,15,.24); border: 1px solid rgba(255,255,255,.16); box-shadow: 0 5px 14px rgba(0,0,0,.18); font-size: 13px; font-weight: 900; text-shadow: 0 1px 5px rgba(0,0,0,.5); }
.wheel-center { position: absolute; z-index: 6; left: 50%; top: 50%; width: 83px; height: 83px; transform: translate(-50%,-50%); display: grid; place-items: center; border: 7px solid #f5f1ff; border-radius: 50%; color: #fff; background: linear-gradient(145deg, #292532, #121019); box-shadow: 0 12px 25px rgba(0,0,0,.38), inset 0 2px 3px rgba(255,255,255,.12); font-weight: 900; letter-spacing: .08em; transition: transform .16s ease, filter .16s ease; }
.wheel-center:active { transform: translate(-50%,-50%) scale(.95); }
.wheel-center span { font-size: 11px; }
.wheel-pointer { position: absolute; z-index: 8; left: 50%; top: -17px; width: 58px; height: 62px; transform: translateX(-50%); filter: drop-shadow(0 9px 9px rgba(0,0,0,.45)); transform-origin: 50% 13px; }
.wheel-pointer::before { content: ""; position: absolute; left: 50%; top: 6px; width: 30px; height: 39px; transform: translateX(-50%); clip-path: polygon(50% 100%, 0 0, 100% 0); background: linear-gradient(135deg, #fff, #d7d0e8); }
.wheel-pointer::after { content: ""; position: absolute; left: 50%; top: 0; width: 20px; height: 20px; transform: translateX(-50%); border: 5px solid #f7f3ff; border-radius: 50%; background: #ff5f8f; box-shadow: 0 4px 10px rgba(0,0,0,.32); }
.wheel-pointer.tick { animation: pointerTick .105s ease-out; }
.wheel-status { min-height: 22px; margin: 2px 0 0; color: #aaa4b2; text-align: center; font-size: 12px; }
.wheel-status strong { color: #fff; }
.wheel-player-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin: 12px auto 2px; max-width: 420px; }
.wheel-player-chip { max-width: 120px; padding: 7px 10px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(255,255,255,.08); border-radius: 999px; background: rgba(255,255,255,.04); color: #aca7b5; font-size: 10px; transition: opacity .2s ease, transform .2s ease, border-color .2s ease, background .2s ease; }
.wheel-player-chip b { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; color: #fff; background: var(--chip-color); font-size: 9px; }
.wheel-player-chip span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wheel-player-chip.selected { transform: translateY(-2px) scale(1.04); border-color: rgba(255,113,143,.7); background: rgba(255,95,143,.13); color: #fff; }
.wheel-player-chip.dimmed { opacity: .42; }

.result-overlay { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; padding: 15px; background: rgba(5,5,9,.72); animation: fadeIn .22s ease both; }
@supports (backdrop-filter: blur(10px)) { .result-overlay { backdrop-filter: blur(12px); } .panel, .dice-board, .wheel-zone { backdrop-filter: blur(18px); } }
.result-sheet { position: relative; width: min(100%, 520px); padding: 11px 22px calc(21px + env(safe-area-inset-bottom)); overflow: hidden; border: 1px solid var(--line-strong); border-radius: 29px; background: linear-gradient(180deg, #211e2c, #14121c); box-shadow: 0 25px 80px rgba(0,0,0,.55); text-align: center; animation: sheetUp .44s cubic-bezier(.18,.86,.23,1.05) both; }
.sheet-handle { width: 42px; height: 4px; margin: 0 auto 17px; border-radius: 999px; background: rgba(255,255,255,.16); }
.result-kicker { color: #918b9a; font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.result-sheet h2 { margin: 7px 0 17px; font-size: clamp(31px, 9vw, 41px); letter-spacing: -.05em; }
.punishment-type { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; color: #b8a7ff; background: rgba(128,103,255,.14); font-size: 12px; font-weight: 850; }
.punishment-type.dare { color: #ff9cb8; background: rgba(255,95,143,.13); }
.punishment-level { color: #777180; font-weight: 650; }
.punishment-text { min-height: 86px; margin: 18px 0 19px; display: grid; place-items: center; color: #fff; font-size: clamp(18px, 5.5vw, 23px); font-weight: 720; line-height: 1.52; }
.type-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.type-switch button, .result-actions button { height: 47px; border: 1px solid var(--line); border-radius: 14px; background: #211e2a; color: #d3cfda; font-size: 12px; font-weight: 780; }
.type-switch button.active { border-color: rgba(173,145,255,.38); color: #fff; background: rgba(128,103,255,.12); }
.type-switch button:last-child.active { border-color: rgba(255,95,143,.38); background: rgba(255,95,143,.11); }
.result-actions { display: grid; grid-template-columns: .88fr 1.12fr; gap: 9px; }
.result-actions .again { border: 0; color: #fff; background: linear-gradient(105deg, #7256ee, #9b70ff); }
.result-actions .again.wheel-again { background: linear-gradient(105deg, #e84776, #ff7398); }
.consent-note { margin: 12px 0 0; color: #686270; font-size: 10px; }

.toast { position: fixed; z-index: 80; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); max-width: min(86vw, 420px); padding: 11px 15px; transform: translate(-50%, 20px); border: 1px solid var(--line); border-radius: 999px; background: #25212f; color: #f5f2fb; box-shadow: 0 14px 35px rgba(0,0,0,.32); opacity: 0; pointer-events: none; font-size: 12px; transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

@keyframes screenEnter { from { opacity: 0; transform: translateY(10px); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes sheetUp { from { opacity: 0; transform: translateY(34px) scale(.985); } }
@keyframes pointerTick { 0% { transform: translateX(-50%) rotate(0); } 45% { transform: translateX(-50%) rotate(-11deg); } 100% { transform: translateX(-50%) rotate(0); } }

@media (min-width: 700px) {
  .screen { padding-left: 28px; padding-right: 28px; }
  .hero { padding-top: 82px; }
  .player-inputs { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .mode-grid { grid-template-columns: 1fr 1fr; }
  .mode-card { grid-template-columns: 58px 1fr; min-height: 168px; align-content: center; }
  .mode-icon { width: 58px; height: 58px; }
  .mode-arrow { position: absolute; right: 18px; top: 18px; }
}

@media (max-height: 720px) and (max-width: 560px) {
  .hero { padding-top: 18px; }
  .hero h1 { font-size: 48px; }
  .hero-copy { margin-bottom: 20px; }
  .hero-badges { margin-bottom: 18px; }
  .mode-card { min-height: 102px; padding: 14px; }
  .mode-icon { width: 56px; height: 56px; border-radius: 18px; }
  .wheel-stage { width: min(72vh, 82vw, 325px); margin-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .ambient { display: none; }
}

/* v5 player setup: all counts + explicit custom naming */
.count-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}
.count-grid button {
  min-width: 0;
  padding: 0;
  font-variant-numeric: tabular-nums;
}
.count-helper { margin-top: 11px; }
.name-toolbar {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.name-toolbar button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: #1b1825;
  color: #bdb7c8;
  font-size: 11px;
  font-weight: 760;
  transition: transform .16s ease, border-color .16s ease, color .16s ease, background .16s ease;
}
.name-toolbar button:hover {
  border-color: rgba(173,145,255,.34);
  color: #fff;
  background: #242031;
}
.name-toolbar button:active { transform: scale(.97); }
.player-input input:not(:placeholder-shown) { font-weight: 720; }

@media (max-width: 390px) {
  .count-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* v6 adult-only intensity */
.adult-mini-badge { border-color: rgba(255, 99, 126, .18); color: #ffb0c0; }
.adult-mini-badge::before { background: #ff657f; box-shadow: 0 0 10px rgba(255, 101, 127, .68); }
.intensity-segment button { min-width: 0; }
.intensity-segment .adult-option { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.intensity-segment .adult-option small { padding: 2px 4px; border-radius: 5px; color: #ff9db0; background: rgba(255, 101, 127, .11); font-size: 8px; line-height: 1; }
.intensity-segment .adult-option.active { background: linear-gradient(135deg, #9d2549, #e64a71); box-shadow: 0 8px 24px rgba(230, 74, 113, .24); }
.intensity-segment .adult-option.active small { color: #fff; background: rgba(255,255,255,.15); }
.punishment-type.adult { color: #ffc0cc; background: linear-gradient(135deg, rgba(151,35,70,.28), rgba(232,71,111,.17)); box-shadow: inset 0 0 0 1px rgba(255,120,148,.14); }
.punishment-type.adult .punishment-level { color: #ff91a8; }

.adult-gate-overlay { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; padding: 15px; background: rgba(5,5,9,.78); animation: fadeIn .2s ease both; }
@supports (backdrop-filter: blur(10px)) { .adult-gate-overlay { backdrop-filter: blur(14px); } }
.adult-gate-sheet { width: min(100%, 500px); padding: 24px 22px calc(21px + env(safe-area-inset-bottom)); border: 1px solid rgba(255,113,143,.22); border-radius: 29px; background: radial-gradient(circle at 50% 0, rgba(232,71,118,.17), transparent 42%), linear-gradient(180deg, #241923, #151119 70%); box-shadow: 0 28px 90px rgba(0,0,0,.62); animation: sheetUp .4s cubic-bezier(.18,.86,.23,1.05) both; }
.adult-gate-badge { display: inline-flex; padding: 6px 9px; border: 1px solid rgba(255,120,148,.22); border-radius: 999px; color: #ff9db1; background: rgba(232,71,118,.09); font-size: 9px; font-weight: 900; letter-spacing: .13em; }
.adult-gate-sheet h2 { margin: 14px 0 8px; font-size: 27px; letter-spacing: -.035em; }
.adult-gate-sheet > p { margin: 0; color: #b8aeb9; font-size: 13px; line-height: 1.65; }
.adult-gate-sheet ul { margin: 18px 0; padding: 14px 14px 14px 32px; border: 1px solid rgba(255,255,255,.065); border-radius: 17px; background: rgba(255,255,255,.035); color: #d4cdd5; font-size: 12px; line-height: 1.75; }
.adult-gate-sheet li::marker { color: #ff6f91; }
.adult-gate-actions { display: grid; grid-template-columns: .8fr 1.2fr; gap: 9px; }
.adult-gate-actions button { min-height: 49px; padding: 0 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 15px; color: #c9c1ca; background: #211a23; font-size: 12px; font-weight: 800; }
.adult-gate-actions .confirm { border: 0; color: #fff; background: linear-gradient(105deg, #aa2c52, #ef557b); box-shadow: 0 12px 28px rgba(198,47,91,.24); }
.adult-gate-actions button:active { transform: scale(.975); }

@media (max-width: 420px) {
  .intensity-segment { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adult-gate-actions { grid-template-columns: 1fr; }
  .adult-gate-actions .confirm { grid-row: 1; }
}
