/**
 * Funquizo Games - Reaction Duel Stylesheet
 *
 * Highly responsive, mobile-first design with high contrast,
 * massive tap surface, and smooth visual feedback.
 */

.rd-container {
    max-width: 640px;
    margin: 1.5rem auto 3rem auto;
    padding: 0 16px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* Mode Switcher */
.rd-mode-switch {
    display: inline-flex;
    background: #f1f5f9;
    border-radius: 9999px;
    padding: 4px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.rd-mode-tab {
    padding: 8px 18px;
    border-radius: 9999px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #64748b;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.rd-mode-tab:hover {
    color: #0f172a;
}

.rd-mode-tab.is-active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* HUD / Scoreboard */
.rd-hud {
    width: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 14px 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rd-player {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 110px;
}

.rd-player.is-p2 {
    align-items: flex-end;
}

.rd-player-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: #1e293b;
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rd-player-badge {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.5px;
}

.rd-score-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.rd-round-indicator {
    font-size: 0.8rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.rd-dots-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rd-player-dots {
    display: flex;
    gap: 5px;
}

.rd-dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #e2e8f0;
    transition: all 0.2s ease;
}

.rd-dot.is-won {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.rd-score-vs {
    font-size: 0.8rem;
    font-weight: 900;
    color: #94a3b8;
}

/* Arena (Massive Tap Surface) */
.rd-arena {
    width: 100%;
    min-height: 380px;
    height: 52vh;
    max-height: 480px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    transition: background 0.15s ease, transform 0.08s ease;
    touch-action: manipulation;
}

.rd-arena:active {
    transform: scale(0.995);
}

/* Arena States */
/* 1. Ready / Idle */
.rd-arena.state-ready {
    background: #1e293b;
    color: #ffffff;
}

/* 2. Countdown / WAIT (Red) */
.rd-arena.state-countdown {
    background: #dc2626;
    color: #ffffff;
    box-shadow: 0 0 35px rgba(220, 38, 38, 0.35);
}

/* 3. GO! (Vibrant Green) */
.rd-arena.state-go {
    background: #059669;
    color: #ffffff;
    box-shadow: 0 0 45px rgba(5, 150, 105, 0.55);
}

/* 4. False Start (Orange / Red) */
.rd-arena.state-false-start {
    background: #ea580c;
    color: #ffffff;
    box-shadow: 0 0 35px rgba(234, 88, 12, 0.35);
}

/* 5. Round Result / Tapped */
.rd-arena.state-result {
    background: #0f172a;
    color: #ffffff;
}

/* Arena Content Elements */
.rd-arena-icon {
    font-size: 3.5rem;
    margin-bottom: 12px;
    line-height: 1;
}

.rd-arena-title {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.rd-arena-sub {
    font-size: 1.05rem;
    font-weight: 600;
    opacity: 0.9;
    max-width: 320px;
}

/* Live Round Comparison in Arena */
.rd-compare-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 14px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 20px;
}

.rd-compare-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rd-compare-name {
    font-size: 0.78rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.rd-compare-time {
    font-size: 1.6rem;
    font-weight: 900;
}

.rd-compare-item.is-winner .rd-compare-time {
    color: #34d399;
}

.rd-compare-item.is-loser .rd-compare-time {
    color: #f87171;
}

/* Match End Summary Card */
.rd-match-end-card {
    width: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 28px 24px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
    text-align: center;
    margin-top: 16px;
}

.rd-end-trophy {
    font-size: 3.2rem;
    margin-bottom: 8px;
}

.rd-end-headline {
    font-size: 1.7rem;
    font-weight: 900;
    color: #0f172a;
    margin-bottom: 4px;
}

.rd-end-sub {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 20px;
}

.rd-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
    background: #f8fafc;
    border-radius: 14px;
    padding: 16px;
    border: 1px solid #e2e8f0;
}

.rd-stat-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.rd-stat-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: #334155;
    text-transform: uppercase;
}

.rd-stat-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 0.82rem;
    color: #64748b;
}

.rd-stat-row span:last-child {
    font-weight: 700;
    color: #0f172a;
}

/* Action Buttons (Consistent green rgb(5, 150, 105)) */
.rd-btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgb(5, 150, 105);
    color: #ffffff;
    font-weight: 800;
    font-size: 1.02rem;
    border: none;
    border-radius: 12px;
    padding: 13px 26px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
    transition: transform 0.1s ease;
    text-decoration: none;
    width: 100%;
    max-width: 320px;
    margin: 6px auto;
}

.rd-btn-action:active {
    transform: scale(0.98);
}

.rd-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #475569;
    font-weight: 700;
    font-size: 0.92rem;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 11px 22px;
    cursor: pointer;
    text-decoration: none;
    width: 100%;
    max-width: 320px;
    margin: 6px auto;
    transition: background 0.15s ease;
}

.rd-btn-secondary:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* 1v1 Initial Ready Card */
.rd-ready-card {
    width: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.rd-ready-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 6px;
}

.rd-ready-desc {
    font-size: 0.92rem;
    color: #64748b;
    margin-bottom: 18px;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
}

.rd-ready-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

@media (max-width: 600px) {
    .rd-arena {
        min-height: 340px;
        height: 50vh;
    }
    .rd-arena-title {
        font-size: 1.85rem;
    }
    .rd-arena-sub {
        font-size: 0.95rem;
    }
    .rd-player {
        min-width: 80px;
    }
    .rd-player-name {
        max-width: 90px;
    }
}
.rd-round-history{margin:1.5rem 0 1.25rem;text-align:left}.rd-round-history h3{margin:0 0 .7rem;font-size:1rem;color:#0f172a}.rd-round-history-table-wrap{overflow-x:auto;border:1px solid #dbe4f0;border-radius:12px;background:#fff}.rd-round-history-table{width:100%;border-collapse:collapse;min-width:460px;font-size:.9rem}.rd-round-history-table th,.rd-round-history-table td{padding:.65rem .75rem;border-bottom:1px solid #e2e8f0;text-align:left;white-space:nowrap}.rd-round-history-table thead th{background:#f8fafc;color:#475569;font-weight:800}.rd-round-history-table tbody tr:last-child th,.rd-round-history-table tbody tr:last-child td{border-bottom:0}.rd-round-history-table tbody th{color:#64748b;font-weight:800}.rd-round-history-table td:nth-child(2),.rd-round-history-table td:nth-child(3){font-variant-numeric:tabular-nums;font-weight:800;color:#1e293b}.rd-round-history-table td:last-child{font-weight:800;color:#059669}@media(max-width:600px){.rd-round-history-table{min-width:390px;font-size:.82rem}.rd-round-history-table th,.rd-round-history-table td{padding:.55rem .5rem}}
