:root {
  --navy: var(--bg-primary);
  --navy-2: var(--bg-secondary);
  --panel: var(--bg-card);
  --line: rgba(255, 255, 255, .1);
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --cyan: var(--accent-purple);
  --cyan-deep: var(--accent-purple-dark);
  --coral: var(--accent-blue);
  --coral-deep: #3651c5;
  --lime: var(--success);
  --danger: var(--error);
  --radius: 24px;
  --settings-accent: var(--cyan);
  --settings-accent-dark: var(--cyan-deep);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible,
input:focus-visible { outline: 3px solid #ffffff; outline-offset: 3px; }
.topbar-spacer { min-width: 1px; min-height: 1px; }
.timer-badge { justify-self: end; width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--cyan); font-size: 18px; font-weight: 700; }
.timer-badge.urgent { color: #fff; background: var(--danger); animation: pulse .5s ease infinite alternate; }
.screen-scroll { width: 100%; margin: 0 auto; padding-bottom: 30px; }
.center-panel { min-height: calc(100dvh - 130px); width: 100%; margin: 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
h1, h2, p { margin-top: 0; }
h2 { font-size: 18px; line-height: 1.2; font-weight: 700; }
.eyebrow { margin-bottom: 12px; color: var(--cyan); font-size: 12px; font-weight: 700; letter-spacing: .12em; }
.eyebrow.danger { color: var(--danger); }
.lead { max-width: 580px; color: var(--muted); font-size: 16px; line-height: 1.55; }

.player-count, .phase-progress { margin-top: 14px; padding: 10px 14px; border-radius: 999px; color: #d9e4f8; background: rgba(255,255,255,.06); font-size: 13px; font-weight: 700; }

.form-message { min-height: 19px; margin: 0 0 6px; color: #ff9cb4; font-size: 13px; }

.role-panel { position: relative; }
.role-panel.imposter::before, .role-panel.imposter::after { content: "IMPOSTER"; position: absolute; top: 25%; left: 50%; transform: translate(-50%,-50%) rotate(-8deg); color: rgba(248,113,113,.08); font-size: clamp(45px, 16vw, 82px); font-weight: 800; letter-spacing: -.08em; pointer-events: none; }
.role-panel.imposter::after { transform: translate(-48%,-47%) rotate(-8deg); color: rgba(34,211,238,.05); }
.role-symbol { width: 116px; height: 116px; margin-bottom: 24px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 38px; color: white; background: var(--cyan); font-size: 54px; font-weight: 800; }
.role-panel.imposter .role-symbol { color: #2c0714; background: var(--coral); animation: glitch .8s steps(2,end) 2; }
.privacy-note { margin: 10px 0 24px; color: #71809c; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }

.decision-layout { min-height: calc(100dvh - 120px); width: 100%; margin: 0 auto; display: flex; flex-direction: column; }
.phase-line { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .09em; }
.phase-line strong { color: white; letter-spacing: 0; }
.decision-heading { margin: 22px 0 14px; text-align: center; }
.decision-heading h1 { font-size: clamp(24px, 6vw, 32px); }
.choice-card { min-height: clamp(300px, 45dvh, 430px); position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border: 0; border-radius: 0; overflow: visible; box-shadow: none; touch-action: pan-y; user-select: none; transition: transform .25s ease, opacity .25s ease; }
.choice-card.dragging { transition: none; }
.choice-card.swipe-demo { animation: swipe-cue 1.55s cubic-bezier(.45, 0, .2, 1) .3s both; }
.choice-card.swipe-demo .stamp-right { animation: swipe-cue-right 1.55s ease .3s both; }
.choice-card.swipe-demo .stamp-left { animation: swipe-cue-left 1.55s ease .3s both; }
.choice-card.submitted { opacity: .55; pointer-events: none; }
.choice-side { padding: clamp(20px, 5vw, 30px) clamp(14px, 4vw, 22px); display: flex; flex-direction: column; justify-content: center; align-items: center; border: 2px solid transparent; border-radius: 20px; color: var(--text); background: var(--panel); text-align: center; transition: border-color .2s, background .2s, transform .2s; }
.choice-side.left { color: var(--text); border-color: rgba(124,58,237,.42); background: var(--panel); }
.choice-side.right { color: var(--text); border-color: rgba(74,108,247,.42); background: var(--panel); }
.side-label { width: 40px; height: 40px; margin-bottom: 18px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--cyan); font-size: 12px; font-weight: 700; letter-spacing: 0; }
.choice-side.right .side-label { background: var(--coral); }
.choice-side p { max-width: 290px; margin: 0; font-size: clamp(16px, 4.3vw, 20px); line-height: 1.35; font-weight: 600; overflow-wrap: anywhere; }
.fork-divider { display: none; }
.swipe-stamp { position: absolute; z-index: 5; top: 18px; width: 58px; height: 58px; display: grid; place-items: center; border: 4px solid; border-radius: 17px; opacity: 0; font-size: 26px; font-weight: 800; }
.stamp-left { left: 18px; color: var(--cyan); border-color: var(--cyan); transform: rotate(-8deg); }
.stamp-right { right: 18px; color: var(--coral); border-color: var(--coral); transform: rotate(8deg); }
.swipe-hint { margin: 15px 0 11px; text-align: center; color: var(--muted); font-size: 12px; }
.swipe-hint span { color: white; }
.choice-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice-button { min-height: 56px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--line); border-radius: 18px; color: white; background: var(--panel); cursor: pointer; }
.choice-button span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: white; font-weight: 800; }
.choice-button.left span { background: var(--cyan); }
.choice-button.right span { background: var(--coral); }
.choice-button:disabled { opacity: .35; }
.choice-button.selected { opacity: 1; border-color: var(--coral); background: rgba(74,108,247,.15); box-shadow: none; }

#round-results-screen { padding: 0; overflow: hidden; }
.wyr-round-reveal { position: absolute; inset: 0; }
.wyr-round-reveal .rr-screen1,
.wyr-round-reveal .rr-screen2 { padding: calc(82px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom)); }
.wyr-round-reveal .rr-context-text { color: var(--muted); font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.wyr-round-reveal .rr-context-subtext { margin-top: 12px; padding: 12px 14px; border-radius: 14px; color: white; background: rgba(124,58,237,.14); font-size: 14px; }
.wyr-round-reveal .rr-option { padding: 16px; border-radius: 18px; background: var(--panel); border-color: var(--line); }
.wyr-round-reveal .rr-option-text { font-size: 16px; line-height: 1.4; }
.wyr-round-reveal .rr-vote-count { color: var(--muted); }
.wyr-round-reveal .rr-badge-majority { color: white; background: var(--cyan); }
.wyr-round-reveal .rr-voter { background: var(--navy-2); }
.wyr-round-reveal .rr-lb-row { background: var(--panel); }
.wyr-round-reveal .rr-lb-row.rr-leading { border-color: var(--cyan); background: rgba(124,58,237,.18); }
.wyr-round-reveal .rr-lb-delta { color: var(--lime); }

.vote-scroll > h1, .reveal-scroll > h1, .final-scroll > h1 { font-size: clamp(28px, 7vw, 38px); }
.personal-result { margin: 20px 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.05); font-weight: 700; }
.personal-result.correct { color: #11230a; border-color: var(--lime); background: var(--lime); }
.personal-result.wrong { color: #ffe8ed; border-color: rgba(255,107,104,.45); background: rgba(185,54,82,.35); }
.avatar { flex: 0 0 auto; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; color: white; background: #111d38; font-size: 10px; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.scoreboard, .vote-ledger, .question-ledger { margin-top: 22px; }
.scoreboard h2, .vote-ledger h2, .question-ledger h2 { font-size: 16px; }





.vote-scroll { text-align: center; }
.vote-scroll .lead { margin-left: auto; margin-right: auto; }
.phase-progress { display: inline-block; margin: 4px auto 18px; }
.candidate-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.candidate-button { min-height: 70px; display: flex; align-items: center; gap: 11px; padding: 10px; border: 1px solid var(--line); border-radius: 18px; color: white; background: var(--panel); text-align: left; cursor: pointer; }
.candidate-button .avatar { width: 42px; height: 42px; border-radius: 14px; }
.candidate-button.selected { color: #2c0714; border-color: var(--coral); background: var(--coral); }
.candidate-button:disabled { cursor: default; opacity: .55; }

.reveal-identity { margin: 8px 0 18px; display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px solid rgba(255,107,104,.45); border-radius: 22px; background: rgba(185,54,82,.2); }
.reveal-identity .avatar { width: 58px; height: 58px; border-radius: 18px; background: var(--coral-deep); }
.reveal-identity h1 { margin: 0; font-size: clamp(22px, 6vw, 36px); }
.reveal-identity p { margin: 5px 0 0; color: #ffbdc9; }
.vote-item { padding: 11px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.vote-item strong { color: white; }
.question-pair { margin-bottom: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.035); }
.question-pair > span { color: var(--muted); font-size: 11px; font-weight: 800; }
.question-version { margin-top: 10px; padding-left: 10px; border-left: 3px solid var(--cyan); }
.question-version.imposter { border-left-color: var(--coral); }
.question-version b { display: block; margin-bottom: 3px; color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.question-version p { margin: 0; font-size: 13px; line-height: 1.45; }

.final-scroll { text-align: center; padding-top: 4dvh; }
.final-symbol { width: 92px; height: 92px; margin: 0 auto 22px; display: grid; place-items: center; border-radius: 30px; color: var(--navy); background: linear-gradient(135deg,var(--cyan),var(--coral)); font-size: 46px; }
.final-scoreboard { margin: 24px 0; text-align: left; }
.final-scoreboard .score-item:first-child { border-color: var(--cyan); }

.connection-overlay { --rp-connection-z: 80; --rp-connection-gap: 12px; --rp-connection-color: var(--muted); --rp-connection-bg: rgba(7,17,38,.94); text-align: center; } /* base: ../connection-overlay.css */
.spinner { width: 42px; height: 42px; border: 3px solid rgba(255,255,255,.1); border-top-color: var(--cyan); border-radius: 50%; animation: spin .8s linear infinite; }
/* Shared toast (../toast.css), keeping this game's crimson pill. */
.rp-toast { --rp-toast-bg: #a42f4a; --rp-toast-color: #fff; --rp-toast-border: 0; --rp-toast-radius: 14px; --rp-toast-padding: 12px 16px; --rp-toast-shadow: none; --rp-toast-font-size: 16px; --rp-toast-font-weight: 700; --rp-toast-max-width: calc(100% - 36px); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.1); } }
@keyframes orbit { to { transform: translate(92px, 95px) rotate(180deg); } }
@keyframes glitch { 20% { transform: translate(3px,-2px) skewX(5deg); } 40% { transform: translate(-4px,2px); } 70% { transform: translate(2px,1px) skewX(-4deg); } }
/* Same cue as «Я никогда не»: right, back, left, back, with the matching stamp. */
@keyframes swipe-cue { 0%,43%,88%,100% { transform: translate3d(0,0,0) rotate(0); } 24% { transform: translate3d(34px,0,0) rotate(2.6deg); } 69% { transform: translate3d(-34px,0,0) rotate(-2.6deg); } }
@keyframes swipe-cue-right { 0%,8%,43%,100% { opacity: 0; } 24%,31% { opacity: .92; } }
@keyframes swipe-cue-left { 0%,49%,88%,100% { opacity: 0; } 69%,76% { opacity: .92; } }

@media (max-width: 520px) {
  .choice-card { min-height: 330px; }
  .choice-side { padding: 24px 13px; }
  .choice-side p { font-size: 17px; }
  .choice-button strong { font-size: 12px; }
  .candidate-grid { grid-template-columns: 1fr; }
}

@media (orientation: landscape) and (max-height: 620px) {
  .screen { padding-top: calc(64px + env(safe-area-inset-top)); }
  .decision-layout { min-height: auto; }
  .choice-card { min-height: 260px; }
  .role-symbol { width: 76px; height: 76px; border-radius: 24px; font-size: 38px; margin-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .choice-card.swipe-demo, .choice-card.swipe-demo .swipe-stamp { animation: none !important; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
/* Explicit gameplay overrides: swipe choices, private role, full-screen reveal. */
.screen { position: relative; }
#round-results-screen { height: var(--app-height, 100dvh); }
/* Shared preparation geometry; only game content below keeps special layouts. */
#onboarding-screen { padding: 0; height: auto; overflow: visible; }
#onboarding-screen .onboarding-container { min-height: 100dvh; padding: calc(64px + env(safe-area-inset-top, 0px)) 24px calc(24px + env(safe-area-inset-bottom, 0px)); }
#onboarding-screen .onboarding-dots { margin-top: 24px; }
#onboarding-screen .dot { border: 0; padding: 0; position: relative; }
#onboarding-screen .dot::before { content: ""; position: absolute; inset: -19px -5px; }
#config-screen, #waiting-screen { padding: 0; height: auto; min-height: 100dvh; }
/* Pack gallery: screen-tall, the gallery scrolls and Play stays pinned at the bottom. */
#config-screen.packs-illustrated-screen { height: 100vh; height: var(--app-height, 100dvh); min-height: 0; overflow: hidden; }
#config-screen .screen-content, #waiting-screen .screen-content { padding-top: calc(80px + env(safe-area-inset-top, 0px)); }
#waiting-copy { text-align: center; color: var(--text-secondary); margin: 24px 0; }

/* Onboarding: animated flat SVG characters (static copies via <picture> for reduced motion). */
#onboarding-screen .slide-icon { width: min(240px, 55vw); margin-bottom: 18px; font-size: 0; line-height: 0; }
#onboarding-screen .slide-icon picture,
#onboarding-screen .slide-icon img { display: block; width: 100%; height: auto; }
@media (max-height: 600px) {
  #onboarding-screen .slide-icon { width: 120px; margin-bottom: 8px; }
}
