.roulette-body {
    background:
        radial-gradient(circle at top, rgba(151, 20, 27, 0.28), transparent 32%),
        linear-gradient(180deg, #141215 0%, #0d0b0d 58%, #090709 100%);
}

.roulette-page {
    padding: 2rem 1rem 3rem;
}

.roulette-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
    gap: 1.5rem;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 55%),
        linear-gradient(180deg, rgba(39, 18, 22, 0.98), rgba(15, 13, 16, 0.98));
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.32);
    overflow: hidden;
}

.roulette-hero::after {
    content: "";
    position: absolute;
    inset: auto -5% -35% auto;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(184, 64, 231, 0.12), transparent 70%);
    pointer-events: none;
}

.hero-copy {
    position: relative;
    z-index: 1;
}

.eyebrow {
    margin-bottom: 0.65rem;
    color: #d78f93;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.roulette-hero h1 {
    margin-bottom: 0.75rem;
    font-size: clamp(2.8rem, 6vw, 4.8rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
}

.page-lead {
    max-width: 44rem;
    color: var(--text-dim);
    font-size: 1.08rem;
}

.hero-actions {
    margin-top: 1.4rem;
}

.mode-panel {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.2rem;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
}

.mode-title {
    margin-bottom: 0.25rem;
    color: #f5e8d1;
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mode-copy {
    color: var(--text-dim);
    font-size: 0.92rem;
}

.mode-toggle {
    align-self: center;
}

.cw-mode .roulette-hero {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.045), transparent 55%),
        linear-gradient(180deg, rgba(28, 28, 38, 0.98), rgba(13, 17, 24, 0.98));
}

.cw-mode .roulette-body,
body.roulette-body.cw-mode {
    background:
        radial-gradient(circle at top, rgba(64, 117, 184, 0.22), transparent 34%),
        linear-gradient(180deg, #10151b 0%, #0c1117 58%, #090d12 100%);
}

.cw-mode .eyebrow {
    color: #9ab7d4;
}

.cw-mode .btn.primary {
    background: linear-gradient(135deg, #4f7eca, #28528f);
    color: #eef5ff;
}

.cw-mode .btn.danger {
    background: linear-gradient(135deg, #4f7eca, #2c5a9b);
    color: #eef5ff;
}

.cw-mode .btn.warn {
    background: linear-gradient(135deg, #5e8bc0, #355b88);
    color: #eef5ff;
}

.cw-mode .btn.outline.active {
    border-color: rgba(130, 174, 228, 0.6);
    background: rgba(130, 174, 228, 0.12);
    color: #c7ddfb;
}

.cw-mode .turn-indicator {
    background: rgba(130, 174, 228, 0.12);
    color: #c7ddfb;
}

.cw-mode .progress-bar.live {
    background: linear-gradient(90deg, rgba(61, 98, 148, 0.96), rgba(99, 143, 209, 0.98));
}

.cw-mode .action-feed.live,
.cw-mode .action-feed.loss {
    border-color: rgba(99, 143, 209, 0.45);
    box-shadow: inset 0 0 30px rgba(99, 143, 209, 0.1);
}

.cw-mode .opponent-chip.aim,
.cw-mode .opponent-chip.self,
.cw-mode .opponent-chip.skip {
    border-color: rgba(130, 174, 228, 0.28);
}

.hero-art {
    position: relative;
    min-height: 260px;
    display: grid;
    place-items: center;
}

.hero-ring,
.hero-ring.inner {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 0 25px rgba(255, 255, 255, 0.05);
}

.hero-ring {
    width: 230px;
    height: 230px;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.04), transparent 56%),
        conic-gradient(from 90deg, rgba(151, 20, 27, 0.44), rgba(255, 255, 255, 0.04), rgba(184, 64, 231, 0.18), rgba(151, 20, 27, 0.44));
}

.hero-ring.inner {
    width: 132px;
    height: 132px;
    background: radial-gradient(circle, rgba(11, 8, 11, 0.94), rgba(22, 14, 18, 0.88));
}

.hero-glow {
    position: absolute;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 183, 71, 0.28), transparent 68%);
    filter: blur(16px);
}

.hero-glyph {
    position: relative;
    z-index: 1;
    color: #f5e8d1;
    font-size: 2rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

.roulette-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
    gap: 1.25rem;
}

.story-rail,
.intel-rail {
    display: grid;
    gap: 1rem;
}

.scene {
    display: none;
}

.scene.active {
    display: block;
}

.scene h2,
.panel-head h2 {
    margin-bottom: 0.45rem;
}

.scene-copy {
    color: var(--text-dim);
    margin-bottom: 1.25rem;
}

.scene-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
    margin-bottom: 1rem;
}

.btn-row {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
    align-items: center;
}

.btn.primary {
    background: linear-gradient(135deg, #ca5057, #7a1e29);
    color: #fff0f1;
}

.btn.danger {
    background: linear-gradient(135deg, #d44c3a, #7f1d17);
    color: #fff2ee;
}

.btn.warn {
    background: linear-gradient(135deg, #ce9340, #83521b);
    color: #fff3dc;
}

.btn.outline {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
}

.btn.outline.active {
    border-color: rgba(255, 183, 71, 0.55);
    background: rgba(255, 183, 71, 0.1);
    color: #ffd7a1;
}

.btn.ghost {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    color: var(--text);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.info-grid,
.setup-meta {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.info-chip,
.meta-card,
.stat,
.action-feed,
.fair-box,
.prob-bars {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)),
        rgba(17, 15, 18, 0.9);
    border-radius: 18px;
}

.info-chip,
.meta-card {
    padding: 0.95rem 1rem;
}

.chip-label,
.meta-label,
.stat-label,
.fair-label {
    display: block;
    color: var(--text-dim-dark);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chip-value,
.meta-card code {
    display: block;
    margin-top: 0.35rem;
    color: var(--text);
    font-weight: 600;
}

.scene-actions,
.result-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.3rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.55rem;
    color: var(--text);
    font-weight: 600;
}

.seed-row {
    display: flex;
    gap: 0.6rem;
}

.seed-row input {
    flex: 1;
    min-width: 0;
}

.pill,
.status-pill,
.history-count,
.turn-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 0.42rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 0.86rem;
}

.turn-indicator {
    background: rgba(255, 183, 71, 0.1);
    color: #ffd9a7;
}

.scene-game {
    min-height: 540px;
}

.chamber-stage {
    padding: 1.1rem;
    border-radius: 24px;
    background:
        radial-gradient(circle at top, rgba(255, 183, 71, 0.09), transparent 42%),
        linear-gradient(180deg, rgba(28, 21, 25, 0.96), rgba(11, 10, 13, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.chamber-core {
    display: grid;
    place-items: center;
    gap: 0.3rem;
    min-height: 220px;
    margin-bottom: 1rem;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.03), transparent 60%),
        linear-gradient(180deg, rgba(47, 38, 43, 0.92), rgba(16, 12, 15, 0.94));
    text-align: center;
}

.core-label {
    color: var(--text-dim-dark);
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.chamber-core strong {
    font-size: clamp(2rem, 4vw, 2.8rem);
}

.chamber-core span:last-child {
    color: var(--text-dim);
}

.chamber-track {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
    gap: 0.7rem;
}

.chamber-slot {
    position: relative;
    min-height: 92px;
    padding: 0.9rem 0.6rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.015)),
        rgba(18, 16, 19, 0.96);
    text-align: center;
    overflow: hidden;
}

.chamber-slot::after {
    content: "";
    position: absolute;
    inset: auto -20% -40% -20%;
    height: 60px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 72%);
    pointer-events: none;
}

.chamber-slot.current {
    border-color: rgba(255, 183, 71, 0.5);
    box-shadow: 0 0 0 1px rgba(255, 183, 71, 0.18);
}

.chamber-slot.spent.live {
    border-color: rgba(244, 67, 54, 0.5);
}

.chamber-slot.spent.blank {
    border-color: rgba(76, 175, 80, 0.5);
}

.chamber-slot.spent.skipped {
    border-color: rgba(255, 183, 71, 0.35);
}

.chamber-slot.revealed.live {
    background:
        linear-gradient(180deg, rgba(244, 67, 54, 0.16), rgba(80, 13, 16, 0.24)),
        rgba(18, 16, 19, 0.96);
}

.chamber-slot.revealed.blank {
    background:
        linear-gradient(180deg, rgba(76, 175, 80, 0.16), rgba(14, 48, 18, 0.24)),
        rgba(18, 16, 19, 0.96);
}

.slot-index {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-dim-dark);
    font-size: 0.74rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.slot-state {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.slot-state.live {
    color: #ff8f86;
}

.slot-state.blank {
    color: #8bdb95;
}

.slot-state.skipped {
    color: #ffd9a7;
}

.action-feed {
    margin-top: 1rem;
    padding: 1rem 1.1rem;
}

.action-feed-title {
    margin-bottom: 0.35rem;
    font-size: 1rem;
    font-weight: 700;
}

.action-feed.neutral {
    border-color: rgba(255, 255, 255, 0.08);
}

.action-feed.live {
    border-color: rgba(244, 67, 54, 0.4);
    box-shadow: inset 0 0 30px rgba(244, 67, 54, 0.08);
}

.action-feed.blank {
    border-color: rgba(76, 175, 80, 0.4);
    box-shadow: inset 0 0 30px rgba(76, 175, 80, 0.08);
}

.action-feed.skip {
    border-color: rgba(255, 183, 71, 0.4);
    box-shadow: inset 0 0 30px rgba(255, 183, 71, 0.08);
}

.action-feed.loss {
    border-color: rgba(244, 67, 54, 0.5);
}

.action-feed.win {
    border-color: rgba(76, 175, 80, 0.5);
}

.action-row {
    margin-top: 1rem;
    justify-content: space-between;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
    margin-bottom: 1rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.stat {
    padding: 0.9rem;
}

.stat-value {
    display: block;
    margin-top: 0.35rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.stat-value.live {
    color: #ff8f86;
}

.stat-value.blank {
    color: #8bdb95;
}

.stat-value.warn {
    color: #ffd9a7;
}

.prob-bars {
    padding: 0.9rem;
}

.prob-row {
    display: grid;
    grid-template-columns: minmax(78px, 1fr) minmax(0, 4fr) auto;
    gap: 0.7rem;
    align-items: center;
    margin-bottom: 0.7rem;
}

.prob-row:last-child {
    margin-bottom: 0;
}

.progress {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.progress-bar {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.74rem;
    color: #fff;
    font-weight: 700;
    transition: width 0.3s ease;
}

.progress-bar.live {
    background: linear-gradient(90deg, rgba(122, 30, 41, 0.96), rgba(212, 76, 58, 0.98));
}

.progress-bar.blank {
    background: linear-gradient(90deg, rgba(37, 92, 48, 0.92), rgba(76, 175, 80, 0.98));
}

.prob-value {
    font-weight: 700;
}

.prob-value.live {
    color: #ff8f86;
}

.prob-value.blank {
    color: #8bdb95;
}

.opponent-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 0.7rem;
}

.opponent-chip {
    padding: 0.85rem 0.75rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 13, 17, 0.88);
}

.opponent-chip.used {
    opacity: 0.42;
}

.opponent-chip.aim {
    border-color: rgba(244, 67, 54, 0.28);
}

.opponent-chip.skip {
    border-color: rgba(255, 183, 71, 0.28);
}

.opponent-chip.self {
    border-color: rgba(184, 64, 231, 0.28);
}

.opponent-step {
    display: block;
    color: var(--text-dim-dark);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.opponent-label {
    display: block;
    margin: 0.25rem 0;
    font-weight: 700;
}

.opponent-value {
    color: var(--text-dim);
    font-size: 0.82rem;
}

.fair-box {
    padding: 1rem;
    margin-bottom: 1rem;
}

.fair-row {
    display: flex;
    justify-content: space-between;
    gap: 0.7rem;
    align-items: start;
    margin-bottom: 0.7rem;
}

.fair-row:last-child {
    margin-bottom: 0;
}

.fair-box code,
.meta-card code {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.82rem;
    word-break: break-word;
}

.verify-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    align-items: center;
}

.status-pill.pass {
    color: #8bdb95;
    border-color: rgba(76, 175, 80, 0.38);
    background: rgba(76, 175, 80, 0.12);
}

.status-pill.fail {
    color: #ff8f86;
    border-color: rgba(244, 67, 54, 0.38);
    background: rgba(244, 67, 54, 0.12);
}

.hint {
    color: var(--text-dim);
    font-size: 0.85rem;
}

.alert {
    border-radius: 18px;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015)),
        rgba(16, 14, 18, 0.9);
}

.alert.win {
    border-color: rgba(76, 175, 80, 0.45);
}

.alert.lose {
    border-color: rgba(244, 67, 54, 0.45);
}

.alert.hide {
    display: none;
}

.alert-title {
    margin-bottom: 0.35rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.log {
    max-height: 320px;
    overflow-y: auto;
    padding-right: 0.35rem;
}

.log-entry {
    margin-bottom: 0.75rem;
    padding: 0.8rem 0.9rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(13, 12, 15, 0.92);
}

.log-entry:last-child {
    margin-bottom: 0;
}

.entry-tone {
    display: block;
    color: var(--text-dim-dark);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.entry-text {
    display: block;
    margin-top: 0.28rem;
}

@media (max-width: 1080px) {
    .roulette-workspace,
    .roulette-hero {
        grid-template-columns: 1fr;
    }

    .hero-art {
        min-height: 220px;
    }
}

@media (max-width: 720px) {
    .roulette-page {
        padding-inline: 0.5rem;
    }

    .mode-panel,
    .scene-header,
    .panel-head,
    .verify-row {
        flex-direction: column;
        align-items: start;
    }

    .seed-row,
    .action-row,
    .scene-actions,
    .result-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .prob-row {
        grid-template-columns: 1fr;
    }

    .chamber-track {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* Action preview grid (stack / press / cashout outcomes) */
.action-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
    margin: 1rem 0 1.1rem 0;
}
.action-preview {
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.18);
    border-radius: 10px;
    padding: 0.7rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.action-preview .preview-label {
    font-size: 0.78rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.action-preview .preview-value {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
}
.action-preview .preview-hint {
    font-size: 0.78rem;
    color: var(--text-dim-dark);
}
.action-preview.stack { border-color: rgba(244, 67, 54, 0.35); }
.action-preview.press { border-color: rgba(184, 64, 231, 0.35); }
.action-preview.cashout { border-color: rgba(76, 175, 80, 0.35); }
@media (max-width: 640px) {
    .action-preview-grid { grid-template-columns: 1fr; }
}

/* Verifier trace */
.verify-trace {
    margin-top: 1rem;
    border-top: 1px solid var(--border);
    padding-top: 0.85rem;
}
.verify-trace.hide { display: none; }
.verify-trace-head {
    font-size: 0.82rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.trace-section {
    margin-bottom: 0.85rem;
    padding: 0.55rem 0.7rem;
    background: rgba(0,0,0,0.15);
    border-radius: 8px;
    border: 1px solid var(--border);
}
.trace-section h4 {
    font-size: 0.85rem;
    margin: 0 0 0.4rem 0;
    color: var(--text);
    font-weight: 600;
}
.trace-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.6rem;
    align-items: baseline;
    margin-bottom: 0.25rem;
    font-size: 0.82rem;
}
.trace-row .trace-label {
    color: var(--text-dim);
    min-width: 180px;
    font-size: 0.78rem;
}
.trace-row code {
    font-size: 0.78rem;
    color: var(--text);
    word-break: break-all;
}
.trace-step {
    padding: 0.4rem 0;
    border-top: 1px dashed rgba(255,255,255,0.06);
}
.trace-step:first-child { border-top: none; }
.trace-step-head {
    font-size: 0.8rem;
    color: var(--text);
    margin-bottom: 0.2rem;
}
.trace-pill {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    border: 1px solid var(--border);
}
.trace-pill.ok { background: rgba(76, 175, 80, 0.18); color: #b5e3b8; border-color: rgba(76, 175, 80, 0.5); }
.trace-pill.bad { background: rgba(244, 67, 54, 0.18); color: #f5b8b3; border-color: rgba(244, 67, 54, 0.5); }

.inline-link {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(184, 64, 231, 0.4);
}
.inline-link:hover { border-bottom-color: var(--primary); }
