/* ═══════════════════════════════════════════════════════════════
   경마 게임 — 프리미엄 UI
   ═══════════════════════════════════════════════════════════════ */

.game-page-body {
    --game-hero-inset-x: clamp(16px, 4vw, 32px);
    --game-hero-inset-y: clamp(16px, 3vw, 28px);
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0a1628;
    background-image:
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(74, 95, 193, 0.35) 0%, transparent 55%),
        radial-gradient(ellipse 80% 50% at 100% 50%, rgba(201, 162, 39, 0.08) 0%, transparent 50%),
        linear-gradient(180deg, #0d1b2a 0%, #0a1628 40%, #061018 100%);
    min-height: 100vh;
    overflow-x: clip;
}

.game-page-body main.game-page.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px 100px;
    width: 100%;
    box-sizing: border-box;
}

/* ── 히어로 (전체 가로 폭) ── */
.game-hero-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    margin: 0 0 28px;
}

.game-hero {
    position: relative;
    width: 100%;
    min-height: 300px;
    overflow: hidden;
}

.game-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 5vw 44px;
    box-sizing: border-box;
}

.game-home-btn {
    position: absolute;
    left: max(var(--game-hero-inset-x), env(safe-area-inset-left, 0px));
    top: max(var(--game-hero-inset-y), env(safe-area-inset-top, 0px));
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
    max-width: calc(100% - var(--game-hero-inset-x) * 2);
}

.game-home-btn i {
    font-size: 15px;
    color: #f0d78c;
}

.game-home-btn:hover {
    background: rgba(201, 162, 39, 0.22);
    border-color: rgba(201, 162, 39, 0.45);
    transform: translateY(-2px);
    color: #fff;
}

.game-home-btn:focus-visible {
    outline: 2px solid #f0d78c;
    outline-offset: 2px;
}

.game-hero-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            180deg,
            rgba(10, 22, 40, 0.55) 0%,
            rgba(10, 22, 40, 0.78) 55%,
            rgba(6, 16, 24, 0.92) 100%
        ),
        linear-gradient(
            135deg,
            rgba(201, 162, 39, 0.18) 0%,
            transparent 45%
        ),
        url('../image/game-hero-racetrack.jpg?v=2') center center / cover no-repeat;
    border-bottom: 1px solid rgba(201, 162, 39, 0.25);
}

.game-hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 80% 60% at 50% 40%,
        transparent 0%,
        rgba(0, 0, 0, 0.25) 100%
    );
    pointer-events: none;
}

.game-hero-bg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 30h60M30 0v60' stroke='%23c9a227' stroke-opacity='0.06'/%3E%3C/svg%3E");
    opacity: 0.8;
}

.game-hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.game-hero-eyebrow {
    display: inline-block;
    margin: 0 0 12px;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: #c9a227;
    background: rgba(201, 162, 39, 0.12);
    border: 1px solid rgba(201, 162, 39, 0.35);
    border-radius: 999px;
}

.game-title {
    font-size: clamp(32px, 6vw, 42px);
    font-weight: 800;
    margin: 0 0 12px;
    color: #fff;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    letter-spacing: -0.02em;
}

.game-sub {
    color: rgba(255, 255, 255, 0.88);
    font-size: 15px;
    margin: 0 auto 20px;
    max-width: 680px;
    line-height: 1.7;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
}

.game-sub strong {
    color: #f0d78c;
}

.game-hero-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.game-kst-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.08);
    color: #e8eaf6;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
}

.game-admin-badge {
    display: block;
    max-width: 480px;
    margin: 16px auto 0;
    background: rgba(230, 81, 0, 0.15);
    color: #ffb74d;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(255, 183, 77, 0.4);
}

/* ── 카드 공통 ── */
.game-card {
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
    border-radius: 20px;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.04),
        0 24px 48px rgba(0, 0, 0, 0.18);
    padding: 28px 24px;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.game-section-title {
    font-size: 18px;
    font-weight: 800;
    color: #1a2744;
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.game-section-title i {
    color: #c9a227;
}

.game-rewards-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 15px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.game-rewards-table th,
.game-rewards-table td {
    padding: 14px 16px;
    text-align: center;
}

.game-rewards-table thead th {
    background: linear-gradient(180deg, #1a2744 0%, #243b55 100%);
    color: #f0d78c;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.05em;
}

.game-rewards-table tbody tr:nth-child(odd) {
    background: #f8fafc;
}

.game-rewards-table tbody tr:nth-child(even) {
    background: #fff;
}

.game-rewards-table tbody td:first-child {
    font-weight: 800;
    color: #1a2744;
}

.game-rewards-table tbody td:last-child {
    font-weight: 700;
    color: #c9a227;
}

.game-rewards-loading {
    color: #64748b;
    font-size: 14px;
    padding: 20px 16px !important;
}

.game-status-banner {
    margin: 0 0 16px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
    display: none;
}

.game-status-banner.is-loading,
.game-status-banner.is-error {
    display: block;
}

.game-status-banner.is-loading {
    background: #eef2ff;
    color: #4338ca;
    border-left: 4px solid #4a5fc1;
}

.game-status-banner.is-error {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid #dc2626;
}

/* ── 메시지 ── */
.game-message {
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
    background: #f1f5f9;
    border-left: 4px solid #4a5fc1;
}

.game-message.game-msg-error {
    background: #fef2f2;
    border-left-color: #dc2626;
    color: #991b1b;
}

/* ── 말 선택 ── */
.horse-pick-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 8px 0 24px;
}

@media (min-width: 600px) {
    .horse-pick-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.horse-pick-btn {
    position: relative;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 12px 8px 16px;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    text-align: center;
    overflow: hidden;
}

.horse-pick-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.03) 100%);
    pointer-events: none;
}

.horse-pick-btn:hover:not(:disabled) {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(26, 39, 68, 0.12);
    border-color: #94a3b8;
}

.horse-pick-btn.selected {
    border-color: #c9a227;
    box-shadow:
        0 0 0 3px rgba(201, 162, 39, 0.25),
        0 16px 32px rgba(201, 162, 39, 0.2);
    transform: translateY(-4px);
}

.horse-pick-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.pick-silk {
    display: block;
    height: 6px;
    margin: 0 0 8px;
    border-radius: 4px 4px 0 0;
}

.pick-silk-1 { background: linear-gradient(90deg, #c62828, #ef5350); }
.pick-silk-2 { background: linear-gradient(90deg, #1565c0, #42a5f5); }
.pick-silk-3 { background: linear-gradient(90deg, #2e7d32, #66bb6a); }
.pick-silk-4 { background: linear-gradient(90deg, #6a1b9a, #ab47bc); }

.pick-horse-preview {
    height: 80px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin-bottom: 8px;
}

.horse-figure-pick {
    width: 100%;
    max-width: 120px;
    height: auto;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.pick-num {
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: #1a2744;
    line-height: 1;
}

.horse-pick-btn.selected .pick-num {
    color: #9a7b0a;
}

.pick-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-top: 4px;
}

/* ── 버튼 ── */
.game-play-btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 17px;
    font-weight: 800;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #c9a227 0%, #9a7b0a 50%, #c9a227 100%);
    background-size: 200% auto;
    color: #1a1200;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(201, 162, 39, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.game-play-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(201, 162, 39, 0.45);
}

.game-play-btn:disabled {
    background: #94a3b8;
    color: #fff;
    box-shadow: none;
    cursor: not-allowed;
}

.game-play-again {
    margin-top: 20px;
    background: linear-gradient(135deg, #4a5fc1 0%, #3d4fb8 100%);
    color: #fff;
}

/* ── 로그인 ── */
.game-login-prompt {
    text-align: center;
    padding: 48px 28px;
}

.game-login-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #4a5fc1;
}

.game-login-prompt h2 {
    margin: 0 0 8px;
    font-size: 22px;
    color: #1a2744;
}

.game-login-prompt p {
    color: #64748b;
    margin: 0 0 24px;
}

.game-login-btn {
    max-width: 320px;
    margin: 0 auto;
    text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════════
   경주장
   ═══════════════════════════════════════════════════════════════ */
.game-race-card {
    padding: 0;
    overflow: hidden;
    background: #0d2818;
}

.race-stadium {
    position: relative;
}

.race-stadium-sky {
    position: relative;
    height: 72px;
    background:
        radial-gradient(ellipse 40% 60% at 20% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 30% 50% at 80% 15%, rgba(255, 248, 220, 0.06) 0%, transparent 45%),
        linear-gradient(180deg, #0f2744 0%, #1a3a5c 45%, #2d5a3d 100%);
    overflow: hidden;
}

.race-stadium-sky::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 10% 30%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(1px 1px at 25% 20%, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(1px 1px at 40% 35%, rgba(255, 255, 255, 0.35), transparent),
        radial-gradient(1px 1px at 55% 15%, rgba(255, 255, 255, 0.45), transparent),
        radial-gradient(1px 1px at 70% 28%, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(1px 1px at 85% 22%, rgba(255, 255, 255, 0.5), transparent);
    opacity: 0.6;
}

.race-stadium-lights {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 30% 80% at 15% 0%, rgba(255, 248, 200, 0.25) 0%, transparent 70%),
        radial-gradient(ellipse 30% 80% at 50% 0%, rgba(255, 248, 200, 0.2) 0%, transparent 70%),
        radial-gradient(ellipse 30% 80% at 85% 0%, rgba(255, 248, 200, 0.25) 0%, transparent 70%);
}

.race-stadium-crowd {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 32px;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='16' viewBox='0 0 24 16'%3E%3Cpath fill='%23143228' d='M2 14h2v-4l2-3 2 3v4h2V8l2-2 2 2v6h2V7l2-2 2 2v7h2V6l1-2 2 2v8h1V14z'/%3E%3C/svg%3E")
            repeat-x center bottom,
        linear-gradient(180deg, transparent 0%, #143020 40%, #0f2818 100%);
    opacity: 0.92;
}

.race-status-text {
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    color: #f0d78c;
    margin: 0;
    padding: 16px 16px 8px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.02em;
}

.race-track-outer {
    position: relative;
    padding: 8px 12px 20px 64px;
}

.race-start-gate {
    position: absolute;
    left: 8px;
    top: 8px;
    bottom: 20px;
    width: 48px;
    background: linear-gradient(90deg, #2c3e50 0%, #34495e 100%);
    border-radius: 6px;
    border: 2px solid #7f8c8d;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.3);
}

.race-start-gate span {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: #ecf0f1;
}

.race-track-wrap {
    position: relative;
    border-radius: 12px;
    padding: 16px 64px 16px 12px;
    background:
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 48px,
            rgba(255, 255, 255, 0.05) 48px,
            rgba(255, 255, 255, 0.05) 50px
        ),
        radial-gradient(ellipse 80% 40% at 50% 100%, rgba(0, 0, 0, 0.12) 0%, transparent 70%),
        linear-gradient(180deg, #4a9f58 0%, #3d8b4a 25%, #2d6b38 55%, #256130 80%, #1e4f28 100%);
    border: 3px solid #8b6914;
    box-shadow:
        inset 0 2px 24px rgba(255, 255, 255, 0.1),
        inset 0 -6px 20px rgba(0, 0, 0, 0.28),
        0 8px 32px rgba(0, 0, 0, 0.35);
    overflow: visible;
}

.race-track-wrap::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 56px;
    bottom: 6px;
    height: 3px;
    border-radius: 2px;
    background: repeating-linear-gradient(
        90deg,
        rgba(139, 105, 20, 0.35) 0,
        rgba(139, 105, 20, 0.35) 12px,
        transparent 12px,
        transparent 24px
    );
    pointer-events: none;
    z-index: 1;
}

.race-rail {
    position: absolute;
    left: 8px;
    right: 56px;
    height: 4px;
    background: linear-gradient(90deg, #f5f5f5, #e0e0e0);
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    z-index: 2;
    pointer-events: none;
}

.race-rail-top { top: 10px; }
.race-rail-bottom { bottom: 10px; }

.race-finish-line {
    position: absolute;
    top: 4px;
    right: 16px;
    bottom: 4px;
    width: 28px;
    z-index: 12;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.race-finish-line::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    background: repeating-linear-gradient(
        180deg,
        #fff 0,
        #fff 10px,
        #c0392b 10px,
        #c0392b 20px
    );
    border-radius: 2px;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

.finish-arch {
    position: absolute;
    top: -8px;
    right: 36px;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    background: #c0392b;
    padding: 4px 10px;
    border-radius: 4px;
    letter-spacing: 0.1em;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.race-track {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.race-lane {
    position: relative;
    height: 88px;
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.08) 0%,
        rgba(255, 255, 255, 0.06) 50%,
        rgba(0, 0, 0, 0.05) 100%
    );
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: visible;
}

.lane-label {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: #1a2744;
    background: linear-gradient(135deg, #f0d78c, #c9a227);
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    z-index: 3;
}

.race-horse {
    position: absolute;
    left: 72px;
    top: 50%;
    transform: translateY(-50%) translateX(0);
    width: 118px;
    height: 78px;
    z-index: 6;
    transition: none;
    will-change: transform;
    pointer-events: none;
    overflow: visible;
}

.horse-dust-track {
    position: absolute;
    left: -20px;
    bottom: 4px;
    width: 40px;
    height: 12px;
    border-radius: 50%;
    background: transparent;
    opacity: 0;
    pointer-events: none;
}

.race-horse.race-running .horse-dust-track {
    animation: dust-puff 0.35s ease-out infinite;
}

@keyframes dust-puff {
    0% {
        opacity: 0.5;
        transform: scale(0.6) translateX(0);
        background: radial-gradient(ellipse, rgba(210, 180, 140, 0.6) 0%, transparent 70%);
    }
    100% {
        opacity: 0;
        transform: scale(1.4) translateX(-16px);
        background: radial-gradient(ellipse, rgba(210, 180, 140, 0.3) 0%, transparent 70%);
    }
}

.horse-figure {
    width: 118px;
    height: auto;
    max-height: 78px;
    display: block;
    transform-origin: center bottom;
    filter: drop-shadow(2px 4px 4px rgba(0, 0, 0, 0.45));
    visibility: visible;
    opacity: 1;
}

#gameRacePanel .race-horse .horse-figure {
    width: 100%;
    max-width: 118px;
}

.race-horse.race-running .horse-gallop-group {
    animation: horse-gallop-bob 0.38s ease-in-out infinite;
}

.race-horse.race-running .horse-mane {
    animation: mane-flutter 0.22s ease-in-out infinite alternate;
    transform-origin: 168px 30px;
}

.race-horse.race-running .horse-tail {
    animation: tail-sway 0.38s ease-in-out infinite;
    transform-origin: 22px 50px;
}

.race-horse.race-running .horse-leg-near-fore {
    animation: leg-near-fore 0.38s ease-in-out infinite;
    transform-origin: 150px 76px;
}

.race-horse.race-running .horse-leg-near-hind {
    animation: leg-near-hind 0.38s ease-in-out infinite;
    transform-origin: 68px 78px;
}

.race-horse.race-running .horse-leg-far-fore {
    animation: leg-far-fore 0.38s ease-in-out infinite;
    transform-origin: 134px 80px;
}

.race-horse.race-running .horse-leg-far-hind {
    animation: leg-far-hind 0.38s ease-in-out infinite;
    transform-origin: 52px 82px;
}

@keyframes horse-gallop-bob {
    0%, 100% { transform: translateY(0) scaleY(1); }
    25% { transform: translateY(-6px) scaleY(1.03); }
    50% { transform: translateY(-2px) scaleY(0.97); }
    75% { transform: translateY(-7px) scaleY(1.02); }
}

@keyframes mane-flutter {
    from { transform: rotate(-2deg); }
    to { transform: rotate(4deg); }
}

@keyframes tail-sway {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(8deg); }
}

@keyframes leg-near-fore {
    0%, 100% { transform: rotate(0deg) translateY(0); }
    35% { transform: rotate(-22deg) translateY(-4px); }
    65% { transform: rotate(8deg) translateY(2px); }
}

@keyframes leg-near-hind {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(16deg); }
}

@keyframes leg-far-fore {
    0%, 100% { transform: rotate(4deg); }
    50% { transform: rotate(-14deg); }
}

@keyframes leg-far-hind {
    0%, 100% { transform: rotate(-6deg); }
    50% { transform: rotate(10deg); }
}

.race-horse.is-pick .horse-figure {
    filter: drop-shadow(0 0 10px rgba(255, 224, 130, 0.95))
        drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.race-horse.is-winner .horse-figure {
    animation: horse-win-glow 0.8s ease-in-out infinite;
}

@keyframes horse-win-glow {
    0%, 100% { filter: drop-shadow(0 0 8px gold) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4)); }
    50% { filter: drop-shadow(0 0 20px #ffd700) drop-shadow(0 4px 16px rgba(255, 215, 0, 0.5)); }
}

.race-lane.lane-finished {
    background: linear-gradient(
        90deg,
        rgba(201, 162, 39, 0.15) 0%,
        rgba(255, 255, 255, 0.1) 100%
    );
}

.race-live-rank {
    margin: 0;
    padding: 16px 20px 20px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: #e8f5e9;
    min-height: 28px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.35));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.race-countdown {
    display: inline-block;
    font-size: 56px;
    font-weight: 800;
    color: #f0d78c;
    text-shadow:
        0 0 40px rgba(240, 215, 140, 0.6),
        0 4px 0 #1a2744;
    animation: countdown-pop 0.5s ease-out;
    line-height: 1.2;
}

@keyframes countdown-pop {
    from { transform: scale(1.5); opacity: 0.4; }
    to { transform: scale(1); opacity: 1; }
}

/* ── 결과 ── */
.game-result {
    text-align: center;
    padding: 40px 28px 36px;
    position: relative;
    overflow: hidden;
}

.game-result-confetti {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(201, 162, 39, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(74, 95, 193, 0.1) 0%, transparent 35%);
    pointer-events: none;
}

.game-result-label {
    position: relative;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #64748b;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.game-result-rank {
    position: relative;
    font-size: clamp(48px, 12vw, 64px);
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 12px;
    background: linear-gradient(135deg, #c9a227 0%, #9a7b0a 50%, #c9a227 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.game-result-pick {
    position: relative;
    font-size: 16px;
    color: #475569;
    margin: 0 0 8px;
}

.game-result-reward-line {
    position: relative;
    font-size: 18px;
    color: #1a2744;
    margin: 0 0 24px;
}

.game-result-reward-line strong {
    color: #c9a227;
    font-size: 22px;
}

.game-ranking-list {
    position: relative;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 24px;
}

.game-ranking-item {
    background: #f1f5f9;
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 600;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.game-ranking-item.is-pick {
    background: linear-gradient(135deg, #1a2744, #2d4a6f);
    color: #f0d78c;
    border-color: #c9a227;
    box-shadow: 0 4px 16px rgba(26, 39, 68, 0.25);
}

.game-result-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #4a5fc1;
    font-weight: 700;
    text-decoration: none;
    font-size: 15px;
}

.game-result-link:hover {
    text-decoration: underline;
}

/* 태블릿·모바일 */
@media (max-width: 768px) {
    .game-page-body {
        --game-hero-inset-x: 16px;
        --game-hero-inset-y: 16px;
    }

    .game-hero {
        min-height: 260px;
    }

    .game-hero-inner {
        padding: 72px 16px 32px;
    }

    .game-home-btn {
        padding: 10px 14px;
        font-size: 13px;
        gap: 6px;
    }

    .game-title {
        font-size: clamp(26px, 7vw, 34px);
    }

    .game-sub {
        font-size: 14px;
        line-height: 1.65;
        padding: 0 4px;
    }

    .game-kst-badge {
        font-size: 12px;
        padding: 8px 12px;
        max-width: 100%;
        word-break: keep-all;
    }

    .game-admin-badge {
        margin-left: auto;
        margin-right: auto;
        font-size: 12px;
    }

    .horse-pick-grid {
        gap: 12px;
    }

    .horse-pick-btn {
        padding: 10px 6px 14px;
    }

    .pick-num {
        font-size: 24px;
    }

    .game-card {
        padding: 22px 18px;
    }

    .game-page-body main.game-page.container {
        padding-left: 16px;
        padding-right: 16px;
    }
}

@media (max-width: 480px) {
    .game-page-body {
        --game-hero-inset-x: 12px;
        --game-hero-inset-y: 12px;
    }

    .game-hero {
        min-height: 240px;
    }

    .game-hero-inner {
        padding: 64px 12px 28px;
    }

    .game-home-btn span {
        white-space: nowrap;
    }

    .game-hero-eyebrow {
        font-size: 10px;
        padding: 5px 10px;
        letter-spacing: 0.1em;
    }

    .game-sub {
        font-size: 13px;
    }

    .game-kst-badge {
        font-size: 11px;
        padding: 7px 10px;
    }

    .horse-pick-grid {
        gap: 10px;
    }

    .pick-horse-preview {
        height: 64px;
    }

    .game-play-btn {
        padding: 14px 20px;
        font-size: 16px;
    }

    .race-status-text {
        font-size: 17px;
        padding: 12px 12px 8px;
    }

    .race-track-outer {
        padding-left: 52px;
    }

    .race-start-gate {
        width: 40px;
    }

    .race-horse {
        left: 58px;
        width: 96px;
    }

    .horse-figure {
        width: 96px;
    }

    .race-lane {
        height: 72px;
    }
}
