.rg-root {
    min-height: calc(100vh - 88px);
    margin-top: 88px;
    padding: 18px;
    font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
    color: #e5ecff;
    background:
        radial-gradient(circle at 8% 6%, rgba(45, 212, 191, 0.22), transparent 34%),
        radial-gradient(circle at 92% 10%, rgba(96, 165, 250, 0.18), transparent 36%),
        linear-gradient(145deg, #050b1f 0%, #09142f 45%, #0c1b3d 100%);
}

.rg-topbar {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    border: 1px solid rgba(147, 197, 253, 0.24);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.7);
    padding: 12px 16px;
    margin-bottom: 14px;
}

.rg-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rg-brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    background: linear-gradient(160deg, rgba(99, 102, 241, 0.9), rgba(59, 130, 246, 0.9));
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

.rg-brand h1 {
    margin: 0;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.rg-brand p {
    margin: 2px 0 0;
    color: rgba(191, 219, 254, 0.9);
    font-size: 0.9rem;
}

.rg-btn {
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease;
}

.rg-btn:hover {
    transform: translateY(-1px);
}

.rg-btn:active {
    transform: translateY(0);
}

.rg-btn-primary {
    color: #ffffff;
    background: linear-gradient(145deg, #4f46e5, #6366f1);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
}

.rg-btn-ghost {
    color: #dbeafe;
    border-color: rgba(148, 163, 184, 0.45);
    background: rgba(15, 23, 42, 0.72);
}

.rg-screen {
    display: none;
}

.rg-screen.is-active {
    display: block;
}

.rg-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.rg-mode-card {
    text-align: left;
    border-radius: 16px;
    border: 1px solid rgba(129, 140, 248, 0.45);
    padding: 18px;
    color: #e0e7ff;
    background: linear-gradient(145deg, rgba(49, 46, 129, 0.85), rgba(37, 99, 235, 0.7));
    cursor: pointer;
}

.rg-mode-card-alt {
    border-color: rgba(251, 146, 60, 0.45);
    background: linear-gradient(145deg, rgba(124, 45, 18, 0.85), rgba(234, 88, 12, 0.7));
}

.rg-mode-card strong {
    display: block;
    font-size: clamp(1rem, 1.7vw, 1.2rem);
    margin-bottom: 4px;
}

.rg-mode-card span {
    color: rgba(224, 231, 255, 0.9);
    font-size: 0.95rem;
}

.rg-panel {
    border: 1px solid rgba(147, 197, 253, 0.22);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.64);
    padding: 14px;
}

.rg-panel h2 {
    margin: 0 0 10px;
    font-size: 1rem;
}

.rg-leaderboard {
    margin: 0;
    padding-left: 22px;
}

.rg-leaderboard li {
    margin-bottom: 8px;
    font-size: 1rem;
}

.rg-empty-rank {
    color: #93c5fd;
    list-style: none;
    margin-left: -22px;
}

.rg-screen-head {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.rg-stage {
    min-height: min(62vh, 520px);
    border-radius: 20px;
    border: 2px solid rgba(148, 163, 184, 0.28);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    padding: 18px;
    user-select: none;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.rg-stage-main {
    font-weight: 900;
    font-size: clamp(2rem, 6vw, 4.8rem);
    line-height: 1.08;
}

.rg-stage-sub {
    margin: 0;
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: #d1e3ff;
}

.rg-stage-idle {
    background: linear-gradient(145deg, #1e293b, #334155);
}

.rg-stage-waiting {
    background: linear-gradient(145deg, #b91c1c, #ef4444);
}

.rg-stage-ready {
    background: linear-gradient(145deg, #15803d, #22c55e);
    transform: scale(1.005);
}

.rg-stage-finished {
    background: linear-gradient(145deg, #0f172a, #1e293b);
}

.rg-stage-foul {
    background: linear-gradient(145deg, #7f1d1d, #991b1b);
}

.rg-note {
    margin-top: 8px;
    color: #bfdbfe;
    font-size: 0.95rem;
}

.rg-battle-wrap {
    min-height: min(68vh, 560px);
    display: grid;
    grid-template-columns: 1fr minmax(220px, 26%) 1fr;
    gap: 10px;
}

.rg-battle-side {
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 20px;
    background: #1f2937;
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background-color 0.14s ease, opacity 0.14s ease;
}

.rg-battle-side strong {
    font-size: clamp(1.9rem, 5vw, 4.1rem);
}

.rg-battle-label {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    font-weight: 800;
    color: #dbeafe;
}

.rg-battle-side.is-ready.rg-p1 {
    background: #2563eb;
}

.rg-battle-side.is-ready.rg-p2 {
    background: #c2410c;
}

.rg-battle-side.is-winner.rg-p1 {
    background: #1d4ed8;
}

.rg-battle-side.is-winner.rg-p2 {
    background: #ea580c;
}

.rg-battle-side.is-foul {
    background: #7f1d1d;
}

.rg-battle-side.is-muted {
    opacity: 0.5;
}

.rg-battle-center {
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.72);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
    gap: 14px;
}

#rg-battle-status {
    margin: 0;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    font-weight: 800;
    color: #dbeafe;
}

.is-hidden {
    display: none !important;
}

@media (max-width: 900px) {
    .rg-root {
        margin-top: 76px;
        min-height: calc(100vh - 76px);
        padding: 12px;
    }

    .rg-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .rg-card-grid {
        grid-template-columns: 1fr;
    }

    .rg-stage {
        min-height: min(60vh, 420px);
    }

    .rg-battle-wrap {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .rg-battle-side {
        min-height: 180px;
    }
}

