/* 반응속도 테스트 스타일 */
.game-container {
    max-width: 520px;
    margin: 0 auto;
    padding: 40px 20px;
    padding-bottom: calc(var(--fixed-banner-height, 50px) + 24px);
    min-height: 100vh;
}

.game-header {
    text-align: center;
    margin-bottom: 28px;
}

.game-title {
    font-size: 38px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(255,255,255,0.8), 0 0 10px rgba(255,182,193,0.5);
}

.game-subtitle {
    font-size: 16px;
    color: var(--text-medium);
    font-weight: 500;
}

/* 게임 영역 */
.game-area {
    background: white;
    border-radius: var(--radius-xl);
    padding: 28px 24px 32px;
    box-shadow: var(--shadow-lg);
}

/* 진행 표시 */
.progress-bar-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.progress-dots {
    display: flex;
    gap: 10px;
}

.dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #e8e8e8;
    transition: background 0.3s ease, transform 0.2s ease;
    display: block;
}

.dot.done {
    background: var(--primary-pink);
    transform: scale(1.1);
}

.dot.current {
    background: var(--gradient-1);
    background: linear-gradient(135deg, #FFB6C1, #DDA0DD);
    box-shadow: 0 0 0 3px rgba(255,182,193,0.35);
    transform: scale(1.2);
}

.progress-label {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
    min-width: 60px;
}

/* 메인 패널 */
.reaction-panel {
    width: 100%;
    aspect-ratio: 1 / 0.68;
    border-radius: var(--radius-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.1s ease;
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    outline: none;
    position: relative;
    overflow: hidden;
    /* 모바일 300ms 딜레이 제거 (touchstart 없이 click만 사용) */
    touch-action: manipulation;
}

.reaction-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.2s ease;
    background: radial-gradient(circle at center, rgba(255,255,255,0.3) 0%, transparent 70%);
}

.reaction-panel:hover::before {
    opacity: 1;
}

/* 상태별 배경 */
.reaction-panel.state-idle {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.reaction-panel.state-waiting {
    background: linear-gradient(135deg, #FFDAB9 0%, #FFB6C1 50%, #E6E6FA 100%);
    animation: waitingPulse 1.6s ease-in-out infinite;
}

@keyframes waitingPulse {
    0%, 100% { box-shadow: var(--shadow-md); }
    50% { box-shadow: 0 8px 32px rgba(255,182,193,0.5); }
}

.reaction-panel.state-go {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
    animation: goFlash 0.15s ease-out;
}

@keyframes goFlash {
    0% { transform: scale(0.97); }
    100% { transform: scale(1); }
}

.reaction-panel.state-early {
    background: linear-gradient(135deg, #f44336 0%, #ff7043 100%);
    animation: earlyShake 0.4s ease;
}

@keyframes earlyShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

.reaction-panel.state-result {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 패널 내용 */
.panel-inner {
    text-align: center;
    padding: 20px;
    pointer-events: none;
}

.panel-icon {
    font-size: 52px;
    margin-bottom: 12px;
    display: block;
    transition: transform 0.3s ease;
}

.reaction-panel.state-go .panel-icon {
    animation: iconBounce 0.3s ease;
}

@keyframes iconBounce {
    0% { transform: scale(0.8); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.panel-msg {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
    transition: color 0.15s;
}

.reaction-panel.state-waiting .panel-msg,
.reaction-panel.state-go .panel-msg,
.reaction-panel.state-early .panel-msg,
.reaction-panel.state-result .panel-msg {
    color: white;
}

.panel-sub {
    font-size: 14px;
    color: var(--text-medium);
    line-height: 1.5;
    transition: color 0.15s;
}

.reaction-panel.state-waiting .panel-sub,
.reaction-panel.state-go .panel-sub,
.reaction-panel.state-early .panel-sub,
.reaction-panel.state-result .panel-sub {
    color: rgba(255,255,255,0.85);
}

/* 결과 시간 크게 표시 */
.result-time {
    font-size: 52px;
    font-weight: 700;
    color: white;
    line-height: 1;
    margin-bottom: 4px;
    display: block;
}

.result-unit {
    font-size: 16px;
    color: rgba(255,255,255,0.8);
    font-weight: 500;
    margin-bottom: 6px;
    display: block;
}

.result-grade {
    font-size: 17px;
    color: rgba(255,255,255,0.95);
    font-weight: 600;
}

/* 회차별 결과 */
.round-results {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
    min-height: 36px;
}

.round-tag {
    background: linear-gradient(135deg, #FFF0F5 0%, #F0E6FF 100%);
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    border: 1px solid rgba(255,182,193,0.3);
    animation: tagIn 0.25s ease-out;
}

@keyframes tagIn {
    from { opacity: 0; transform: scale(0.7); }
    to   { opacity: 1; transform: scale(1); }
}

.round-tag.best-round {
    background: var(--gradient-1);
    color: white;
    border-color: transparent;
}

/* 최종 결과 평균 태그 */
.avg-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--radius-sm);
    padding: 8px 20px;
    font-size: 16px;
    font-weight: 700;
    border: none;
}

/* 최고 기록 */
.best-record {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #FFF8DC 0%, #FFF0F5 100%);
    border-radius: var(--radius-md);
}

.best-icon { font-size: 20px; }

.best-label {
    font-size: 14px;
    color: var(--text-medium);
    font-weight: 500;
}

.best-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
}

.best-unit {
    font-size: 14px;
    color: var(--text-light);
}

/* 등급 뱃지 */
.grade-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    background: rgba(255,255,255,0.25);
    color: white;
    margin-top: 6px;
}

/* ─── 기록 섹션 ─────────────────────────────────────────── */
.ranking-section {
    margin-top: 24px;
    animation: fadeInUp 0.5s ease 0.1s both;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ranking-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 28px 24px;
    box-shadow: var(--shadow-lg);
}

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

.ranking-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
}

.reset-ranking-btn {
    padding: 7px 14px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-ranking-btn:hover {
    background: #ffebee;
    border-color: #f44336;
    color: #f44336;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #fafafa;
    border-radius: var(--radius-sm);
    border: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.ranking-item:hover {
    background: #f5f5f5;
    transform: translateX(3px);
}

.ranking-item.top-1 {
    background: linear-gradient(135deg, #fff8e1, #fff3cd);
    border-color: #ffd54f;
}

.ranking-item.top-2 {
    background: linear-gradient(135deg, #f5f5f5, #eeeeee);
    border-color: #bdbdbd;
}

.ranking-item.top-3 {
    background: linear-gradient(135deg, #fbe9e7, #ffe0b2);
    border-color: #ffab91;
}

.ranking-rank {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-light);
    min-width: 28px;
    text-align: center;
}

.top-1 .ranking-rank { color: #f9a825; }
.top-2 .ranking-rank { color: #757575; }
.top-3 .ranking-rank { color: #bf360c; }

.ranking-info {
    flex: 1;
    margin-left: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ranking-ms {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
}

.ranking-ms-unit {
    font-size: 13px;
    color: var(--text-light);
}

.ranking-grade {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    background: linear-gradient(135deg, #FFF0F5, #F0E6FF);
    color: var(--text-medium);
    white-space: nowrap;
}

.ranking-date {
    font-size: 12px;
    color: var(--text-light);
    margin-left: auto;
}

.no-ranking {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-light);
    font-size: 15px;
}

/* 반응형 */
@media (max-width: 480px) {
    .game-container {
        padding: 20px 14px;
        padding-bottom: calc(var(--fixed-banner-height, 50px) + 20px);
    }

    .game-title { font-size: 30px; }

    .game-area { padding: 20px 16px 24px; }

    .panel-msg { font-size: 22px; }

    .result-time { font-size: 42px; }
}
