/* ==========================================================================
   Neural Coin Predictor & Binary Sequence Classifier Styles
   ========================================================================== */

.predictor-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

/* Hero & Architecture Banner */
.predictor-hero {
    margin-bottom: 28px;
    text-align: left;
}

.predictor-hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    color: #002d5a;
    margin-bottom: 8px;
    font-weight: 800;
    line-height: 1.2;
}

.predictor-subtitle {
    font-size: 1.05rem;
    color: #475569;
    margin-bottom: 16px;
    line-height: 1.5;
}

.model-spec-ribbon {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 12px 16px;
    background: #0f172a;
    color: #f8fafc;
    border-radius: 8px;
    font-size: 0.82rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    border: 1px solid #1e293b;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.spec-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.spec-chip-highlight {
    color: #38bdf8;
    font-weight: 700;
}

.spec-sep {
    color: #475569;
}

/* Main Interactive Layout Grid */
.predictor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

@media (max-width: 900px) {
    .predictor-grid {
        grid-template-columns: 1fr;
    }
}

/* Coin Toss Stage */
.coin-stage-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 6px 16px rgba(0, 45, 90, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.coin-viewport {
    width: 100%;
    height: 210px;
    perspective: 800px;
    margin: 16px auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

.coin-disc {
    width: 175px;
    height: 175px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out;
    cursor: default;
}

.coin-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    user-select: none;
    cursor: default;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28), inset 0 0 0 5px rgba(255, 255, 255, 0.35);
}

.coin-face * {
    cursor: default;
}

.coin-face-heads {
    background: radial-gradient(circle at 35% 30%, #fef08a 0%, #eab308 55%, #ca8a04 100%);
    border: 3px solid #a16207;
    color: #713f12;
}

.coin-face-tails {
    background: radial-gradient(circle at 35% 30%, #f1f5f9 0%, #cbd5e1 55%, #94a3b8 100%);
    border: 3px solid #64748b;
    color: #1e293b;
    transform: rotateY(180deg);
}

.coin-emblem {
    font-size: 2.8rem;
    line-height: 1;
    margin-bottom: 4px;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.2));
}

.coin-label {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.coin-motto {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

/* Coin Flip Animations */
@keyframes spinToHeads {
    0% { transform: rotateY(0deg) scale(1); }
    30% { transform: rotateY(720deg) scale(1.18); }
    70% { transform: rotateY(1440deg) scale(1.12); }
    100% { transform: rotateY(2160deg) scale(1); }
}

@keyframes spinToTails {
    0% { transform: rotateY(0deg) scale(1); }
    30% { transform: rotateY(720deg) scale(1.18); }
    70% { transform: rotateY(1440deg) scale(1.12); }
    100% { transform: rotateY(2340deg) scale(1); }
}

.coin-spinning-heads {
    animation: spinToHeads 1.0s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

.coin-spinning-tails {
    animation: spinToTails 1.0s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

.coin-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-flip-primary {
    background: #0056b3;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 14px 20px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.25);
    transition: all 0.15s ease;
}

.btn-flip-primary:hover:not(:disabled) {
    background: #004494;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 86, 179, 0.35);
}

.btn-flip-primary:disabled {
    opacity: 0.65;
    cursor: wait;
}

.sim-btn-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.btn-sim-secondary {
    background: #f1f5f9;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 4px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-sim-secondary:hover:not(:disabled) {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.btn-auto-stream {
    background: #0f172a;
    color: #38bdf8;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s ease;
}

.btn-auto-stream.streaming {
    background: #dc2626;
    color: #ffffff;
    border-color: #b91c1c;
}

/* Real-Time Prediction & Telemetry HUD */
.hud-card {
    background: #0a0f1d;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 22px;
    color: #f8fafc;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hud-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 8px;
}

.hud-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hud-live-badge {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.hud-pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: hudPulse 1.8s infinite;
}

@keyframes hudPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.hud-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}

@media (max-width: 540px) {
    .hud-metrics-grid {
        grid-template-columns: 1fr;
    }
}

.metric-box-span-2 {
    grid-column: 1 / -1;
}

.hud-reasoning-panel {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hud-reasoning-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1e293b;
    padding-bottom: 6px;
}

.metric-box {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 8px;
    padding: 14px;
}

.metric-label {
    font-size: 0.76rem;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
}

.metric-val-large {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.1;
    color: #f8fafc;
    margin-bottom: 6px;
}

.metric-val-heads {
    color: #facc15;
    text-shadow: 0 0 16px rgba(250, 204, 21, 0.35);
}

.metric-val-tails {
    color: #38bdf8;
    text-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
}

.metric-sub {
    font-size: 0.75rem;
    color: #cbd5e1;
}

/* Confidence Bar */
.confidence-bar-bg {
    width: 100%;
    height: 8px;
    background: #1e293b;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 6px;
}

.confidence-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #38bdf8 0%, #10b981 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Sequence Tape */
.sequence-tape-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 28px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.tape-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.tape-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tape-stream {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 6px 2px 10px;
    min-height: 48px;
    align-items: center;
}

.tape-chip {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    position: relative;
    user-select: none;
}

.tape-chip-heads {
    background: #fef08a;
    color: #854d0e;
    border: 1px solid #facc15;
}

.tape-chip-tails {
    background: #e2e8f0;
    color: #1e293b;
    border: 1px solid #cbd5e1;
}

.tape-chip-correct::after {
    content: "✓";
    position: absolute;
    top: -4px;
    right: -4px;
    background: #10b981;
    color: #ffffff;
    font-size: 0.55rem;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ffffff;
}

.tape-chip-missed::after {
    content: "✕";
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.55rem;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ffffff;
}

/* Interactive Charts Section */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

@media (max-width: 900px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    background: #0a0f1d;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    color: #f8fafc;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.chart-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
}

.chart-subtitle {
    font-size: 0.78rem;
    color: #94a3b8;
}

.canvas-container {
    width: 100%;
    height: 240px;
    position: relative;
    margin-top: 8px;
}

.canvas-container canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* CPU Training Lab Deck */
.training-deck {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 36px;
    box-shadow: 0 6px 20px rgba(0, 45, 90, 0.05);
}

.training-deck h3 {
    margin-top: 0;
    font-size: 1.3rem;
    color: #002d5a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.deck-controls-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr) auto;
    gap: 16px;
    align-items: flex-end;
    margin: 20px 0;
}

@media (max-width: 800px) {
    .deck-controls-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 500px) {
    .deck-controls-row {
        grid-template-columns: 1fr;
    }
}

.deck-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}

.deck-field select, .deck-field input {
    width: 100%;
    padding: 9px 12px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    font-size: 0.9rem;
    background: #f8fafc;
    color: #0f172a;
}

.btn-deck-train {
    background: #059669;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
    transition: all 0.15s ease;
    height: 42px;
}

.btn-deck-train:hover:not(:disabled) {
    background: #047857;
}

.btn-deck-train:disabled {
    opacity: 0.6;
    cursor: wait;
}

.training-progress-bar {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 14px;
    display: none;
}

.training-progress-fill {
    height: 100%;
    background: #059669;
    width: 0%;
    transition: width 0.1s linear;
}

/* Theory & Architecture Breakdown */
.theory-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 40px;
}

.theory-section h3 {
    margin-top: 0;
    color: #002d5a;
    font-size: 1.25rem;
}

.theory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 16px;
}

@media (max-width: 800px) {
    .theory-grid {
        grid-template-columns: 1fr;
    }
}

.theory-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.theory-card h4 {
    margin: 0 0 8px;
    color: #0056b3;
    font-size: 0.95rem;
}

.theory-card p {
    margin: 0;
    font-size: 0.84rem;
    color: #475569;
    line-height: 1.5;
}

/* Dark Mode Overrides */
@media (prefers-color-scheme: dark) {
    .coin-stage-card, .sequence-tape-card, .training-deck, .theory-card {
        background: #0f172a;
        border-color: #1e293b;
        color: #f8fafc;
    }

    .predictor-hero h1, .training-deck h3, .theory-section h3 {
        color: #f8fafc;
    }

    .predictor-subtitle, .theory-card p {
        color: #94a3b8;
    }

    .tape-title {
        color: #f8fafc;
    }

    .tape-chip-tails {
        background: #1e293b;
        color: #e2e8f0;
        border-color: #334155;
    }

    .theory-section {
        background: #0b1120;
        border-color: #1e293b;
    }

    .deck-field label {
        color: #cbd5e1;
    }

    .deck-field select, .deck-field input {
        background: #1e293b;
        border-color: #334155;
        color: #f8fafc;
    }

    .btn-sim-secondary {
        background: #1e293b;
        border-color: #334155;
        color: #e2e8f0;
    }

    .btn-sim-secondary:hover:not(:disabled) {
        background: #334155;
    }
}

/* ==========================================================================
   Human vs AI Neural Match & Versus Scoreboard Styles
   ========================================================================== */

.match-setup-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.match-pills {
    display: flex;
    gap: 6px;
}

.match-pill-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.match-pill-btn:hover {
    border-color: #0056b3;
    color: #0056b3;
}

.match-pill-btn.active {
    background: #0056b3;
    color: #ffffff;
    border-color: #004494;
}

.match-round-tag {
    font-size: 0.82rem;
    font-weight: 800;
    color: #002d5a;
    background: #e2e8f0;
    padding: 4px 10px;
    border-radius: 999px;
}

/* Versus Scoreboard */
.vs-scoreboard {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: center;
    width: 100%;
    margin-bottom: 16px;
}

.vs-player-card {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 12px 14px;
    text-align: center;
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.vs-player-user {
    border-color: #93c5fd;
    background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
}

.vs-player-ai {
    border-color: #cbd5e1;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.vs-player-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 4px;
}

.vs-player-score {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 4px;
}

.vs-player-user .vs-player-score {
    color: #0284c7;
}

.vs-player-ai .vs-player-score {
    color: #6366f1;
}

.vs-player-sub {
    font-size: 0.72rem;
    color: #64748b;
}

.vs-divider {
    font-size: 1.1rem;
    font-weight: 900;
    color: #94a3b8;
    background: #e2e8f0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Guess Action Buttons */
.guess-actions-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.guess-btn-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    margin-bottom: 12px;
}

.btn-guess-heads {
    background: linear-gradient(180deg, #eab308 0%, #ca8a04 100%);
    color: #713f12;
    border: 2px solid #a16207;
    border-radius: 8px;
    padding: 12px 10px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(202, 138, 4, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.btn-guess-heads:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(202, 138, 4, 0.35);
}

.btn-guess-tails {
    background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
    color: #ffffff;
    border: 2px solid #475569;
    border-radius: 8px;
    padding: 12px 10px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(100, 116, 139, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.btn-guess-tails:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(100, 116, 139, 0.35);
}

.btn-guess-heads:disabled, .btn-guess-tails:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* Neural Mind Stream HUD */
.neural-mind-hud {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.82rem;
    color: #94a3b8;
    line-height: 1.55;
    text-align: left;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.thought-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.thought-tag {
    color: #38bdf8;
    font-weight: 700;
    flex-shrink: 0;
    background: rgba(56, 189, 248, 0.12);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.74rem;
}

.thought-text {
    color: #f8fafc;
}

/* Victory / Game Over Banner */
.match-victory-banner {
    background: #0f172a;
    border: 2px solid #38bdf8;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: center;
    color: #f8fafc;
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.25);
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.match-victory-title {
    font-size: 1.25rem;
    font-weight: 900;
    margin-bottom: 6px;
}

.match-victory-user {
    border-color: #10b981;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.match-victory-ai {
    border-color: #818cf8;
    box-shadow: 0 8px 24px rgba(129, 140, 248, 0.3);
}

.match-victory-sub {
    font-size: 0.85rem;
    color: #cbd5e1;
    margin-bottom: 12px;
}

.btn-rematch {
    background: #0284c7;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3);
    transition: all 0.15s ease;
}

.btn-rematch:hover {
    background: #0369a1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-color-scheme: dark) {
    .match-setup-bar {
        background: #111827;
        border-color: #1f2937;
    }
    .match-pill-btn {
        background: #1e293b;
        border-color: #334155;
        color: #e2e8f0;
    }
    .match-pill-btn:hover {
        border-color: #38bdf8;
        color: #38bdf8;
    }
    .match-round-tag {
        background: #1e293b;
        color: #f8fafc;
    }
    .vs-player-card {
        background: #111827;
        border-color: #1f2937;
    }
    .vs-player-user {
        border-color: #0369a1;
        background: linear-gradient(180deg, #0c2136 0%, #111827 100%);
    }
    .vs-player-ai {
        border-color: #3730a3;
        background: linear-gradient(180deg, #181938 0%, #111827 100%);
    }
    .vs-divider {
        background: #1e293b;
        color: #64748b;
    }
}


/* Responsive Diagnostics Grid & Mobile Touch Optimizations */
.diag-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 20px;
}

.table-responsive-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 860px) {
    .diag-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

@media (max-width: 480px) {
    .predictor-container {
        padding: 0 10px 32px;
    }
    .coin-stage-card, .hud-card {
        padding: 16px 12px;
    }
    .vs-scoreboard {
        gap: 6px;
    }
    .vs-player-card {
        padding: 8px 4px;
    }
    .vs-player-score {
        font-size: 1.6rem;
    }
    .vs-divider {
        width: 26px;
        height: 26px;
        font-size: 0.8rem;
    }
    .guess-btn-row {
        gap: 8px;
    }
    .btn-guess-heads, .btn-guess-tails {
        padding: 10px 6px;
        font-size: 0.85rem;
    }
    .match-setup-bar {
        padding: 8px 10px;
    }
    .match-pills {
        flex-wrap: wrap;
        gap: 4px;
    }
    .match-pill-btn {
        padding: 4px 8px;
        font-size: 0.72rem;
    }
    .match-round-tag {
        font-size: 0.75rem;
        padding: 3px 8px;
    }
    .coin-viewport {
        width: 140px;
        height: 140px;
        margin: 10px auto 16px;
    }
    .coin-disc {
        width: 120px;
        height: 120px;
    }
    .coin-emblem {
        font-size: 1.8rem;
    }
    .coin-label {
        font-size: 0.85rem;
    }
}
/* Explanations stay readable while chart surfaces follow the active season. */
.coin-advanced { margin: 16px 0; color: #334155; }
.coin-advanced summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.coin-learning-steps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; list-style: none; padding: 0 !important; margin: 18px 0; }
.coin-learning-steps li { border: 1px solid #d5e0eb; border-top: 3px solid var(--s-primary,#155b97); background: var(--s-tint,#f1f7fc); border-radius: 8px; padding: 14px; }
.coin-learning-steps strong { display: block; color: #18334d; }
.coin-rule-guide { border-left: 4px solid var(--s-primary,#155b97); background: var(--s-tint,#f1f7fc); border-radius: 6px; margin: 16px 0; padding: 16px 18px; }
body .coin-rule-guide h3 { color: #18334d !important; }
.coin-start-guide label { display: block; margin: 12px 0 8px; }
.coin-training-explanation { font-size: .9rem; line-height: 1.7; color: #e2e8f0; margin: 12px 0 0; }
.coin-training-explanation code { font-family: ui-monospace,Consolas,monospace; white-space: nowrap; }
.chart-card {
 --coin-chart-primary: var(--s-accent-bright,#38bdf8);
 --coin-chart-secondary: #6ee7b7;
 --coin-chart-grid: rgba(255,255,255,.14);
 background: var(--s-dark-grad,#0a0f1d);
 border-color: var(--s-border-accent,#334155);
 min-width: 0;
}
body .chart-card .chart-title { color: #f8fafc !important; line-height: 1.4; }
body .chart-card .chart-subtitle { color: #d5deea; display: block; margin-top: 5px; line-height: 1.55; }
.chart-header { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
.chart-header > div { flex: 1 1 210px; min-width: 0; }
body .chart-header > span { background: rgba(255,255,255,.12) !important; color: #f8fafc !important; border: 1px solid var(--s-border-accent,#475569); font-size: .75rem; border-radius: 999px; padding: 4px 9px; }
body.christmas-theme .chart-card { --coin-chart-secondary: #fda4af; }
body.valentines-theme .chart-card { --coin-chart-secondary: #a5d8ff; }
@media(max-width:600px){ .coin-learning-steps { grid-template-columns: minmax(0,1fr); gap: 8px; } .chart-card { padding: 14px; } .model-spec-ribbon { overflow-wrap: anywhere; } }
.coin-hud-details { color: #dbe5ef; border-top: 1px solid #475569; padding-top: 12px; }
.coin-hud-details summary { cursor: pointer; padding: 8px 0; font-size: .85rem; }
body .coin-stage-card #stage-title { font-size: 1.25rem; color: #18334d !important; margin: 0 0 16px; }
.coin-control-note { width: 100%; font-size: .85rem; line-height: 1.7; color: #526375; margin: 10px 0; text-align: left; }
.coin-diagram-glossary { color: #e2e8f0; margin-top: 16px; font-size: .9rem; line-height: 1.7; }
.coin-diagram-glossary summary { cursor: pointer; font-weight: 700; }
.coin-diagram-glossary dt { font-weight: 700; margin-top: 10px; }
.coin-diagram-glossary dd { margin-left: 0; }
.coin-inline-help { width: 100%; margin: 10px 0; font-size: .85rem; line-height: 1.7; color: #334155; border-top: 1px solid #d5e0eb; }
.coin-inline-help summary { cursor: pointer; display: list-item; padding: 11px 0; font-weight: 700; min-height: 44px; }
.coin-inline-help summary:focus-visible, .coin-advanced summary:focus-visible { outline: 2px solid var(--s-primary,#155b97); outline-offset: 3px; }
.hud-card .coin-inline-help { color: #e2e8f0; border-color: #475569; }
/* Keep the learning controls light, including when the browser prefers dark mode. */
body .predictor-container .coin-stage-card,
body .predictor-container .sequence-tape-card { background: #fff; color: #334155; border-color: var(--s-border-accent,#d5e0eb); }
body .predictor-container .tape-title { color: #18334d !important; }
body .predictor-container .match-setup-bar,
body .predictor-container .match-round-tag { background: var(--s-tint,#f1f5f9); border-color: var(--s-primary,#cbd5e1); color: #18334d; }
body .predictor-container .match-pill-btn { background: #fff; color: #334155; border-color: #cbd5e1; }
body .predictor-container .match-pill-btn.active { background: var(--s-primary,#155b97); color: #fff; border-color: var(--s-primary,#155b97); }
body .predictor-container .vs-player-card { background: var(--s-tint,#f8fafc); border-color: var(--s-primary,#cbd5e1); }
body .predictor-container .vs-player-header { color: #334155; }
body .predictor-container .vs-player-sub { color: #526375; }
body .predictor-container .vs-player-score { color: var(--s-primary,#155b97); }
body .predictor-container .vs-divider { background: #e2e8f0; color: #526375; }
body .predictor-container .btn-sim-secondary { background: #fff; border-color: var(--s-primary,#cbd5e1); color: #334155; }
body .predictor-container .btn-auto-stream { background: var(--s-primary,#155b97); color: #fff; border-color: var(--s-primary,#155b97); }
body .predictor-container .btn-auto-stream.streaming { background: #b42318; border-color: #b42318; }
body .predictor-container .hud-card { background: var(--s-dark-grad,#0a0f1d); border-color: var(--s-border-accent,#334155); color: #f8fafc; }
body .predictor-container .hud-title { color: #f8fafc !important; }
body .predictor-container :is(.metric-box,.hud-reasoning-panel,.neural-mind-hud) { background: var(--s-dark-2,#111827); border-color: var(--s-border-accent,#334155); }
body .predictor-container .metric-label, body .predictor-container .metric-sub { color: #dbe5ef !important; }
body .predictor-container .hud-live-badge { background: rgba(255,255,255,.12); border-color: var(--s-border-accent,#475569); color: #f8fafc; }
body .predictor-container .confidence-bar-fill { background: linear-gradient(90deg,var(--s-accent-bright,#38bdf8),#6ee7b7); }
body .predictor-container .predictor-subtitle { color: #475569; }
body .predictor-container .model-spec-ribbon { background: var(--s-dark-grad,#0f172a); border-color: var(--s-border-accent,#334155); }
body .predictor-container .spec-chip-highlight { color: var(--s-accent-bright,#38bdf8); }
.predictor-grid { align-items: start; }
body .predictor-container .hud-card { justify-content: flex-start; gap: 16px; }
