/* 두더지 잡기 게임 스타일 */
.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);
    position: relative;
    overflow: hidden;
}

/* 상태바 */
.status-bar {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 20px;
}

.status-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #FFF0F5 0%, #F0E6FF 100%);
    border-radius: var(--radius-md);
    padding: 12px 8px;
}

.status-label {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 500;
    white-space: nowrap;
}

.status-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

#timeLeft.urgent {
    color: #F44336;
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* 게임 중 현재 난이도 표시 */
.difficulty-display {
    text-align: center;
    margin-bottom: 14px;
}

.diff-badge {
    display: inline-block;
    padding: 5px 16px;
    background: linear-gradient(135deg, #FFF0F5 0%, #F0E6FF 100%);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-medium);
    border: 1px solid rgba(255,182,193,0.4);
}

/* 오버레이 안 난이도 선택 */
.overlay-difficulty {
    margin: 16px 0 20px;
    width: 100%;
}

.difficulty-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-medium);
    margin-bottom: 10px;
}

.difficulty-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.diff-btn {
    flex: 1;
    padding: 10px 0;
    border: 2px solid #f0f0f0;
    border-radius: var(--radius-md);
    background: white;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.2s ease;
}

.diff-btn:hover {
    border-color: var(--primary-pink);
    color: var(--text-dark);
}

.diff-btn.active {
    background: var(--gradient-1);
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-sm);
}

/* 두더지 그리드 */
.mole-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    position: relative;
    z-index: 1;
}

/* 구멍 */
.hole {
    position: relative;
    aspect-ratio: 1;
    cursor: pointer;
    border-radius: 50%;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.dirt {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: radial-gradient(ellipse at center bottom, #c8a882 0%, #b0926a 60%, #9a7d5a 100%);
    border-radius: 0 0 50% 50% / 0 0 40% 40%;
    z-index: 2;
    box-shadow: inset 0 -4px 8px rgba(0,0,0,0.15);
}

.dirt::before {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 10%;
    right: 10%;
    height: 60%;
    background: radial-gradient(ellipse at center, #a07850 20%, transparent 80%);
    border-radius: 50%;
    opacity: 0.5;
}

/* 구멍 배경 */
.hole::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, #2a1a0a 0%, #3d2812 60%, #5c3d1e 100%);
    border-radius: 50%;
    box-shadow: inset 0 4px 12px rgba(0,0,0,0.5);
}

/* 두더지 래퍼 */
.mole-wrap {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 3;
    overflow: hidden;
    border-radius: 50%;
    padding-bottom: 10%;
}

.mole {
    font-size: clamp(28px, 10vw, 52px);
    display: block;
    transform: translateY(120%);
    transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    filter: drop-shadow(0 -2px 4px rgba(0,0,0,0.2));
}

/* 두더지 나타남 */
.hole.active .mole {
    transform: translateY(0%);
}

/* 두더지 맞았을 때 */
.hole.whacked .mole {
    transform: translateY(120%);
    transition: transform 0.08s ease-in;
}

.hole.whacked::after {
    content: '💥';
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(20px, 8vw, 40px);
    z-index: 10;
    animation: hitEffect 0.4s ease-out forwards;
    pointer-events: none;
}

@keyframes hitEffect {
    0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.5); }
    50%  { opacity: 1; transform: translate(-50%, -70%) scale(1.3); }
    100% { opacity: 0; transform: translate(-50%, -90%) scale(1); }
}

/* 점수 팝업 */
.score-popup {
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    font-weight: 700;
    color: #E91E63;
    z-index: 20;
    pointer-events: none;
    animation: scoreFloat 0.7s ease-out forwards;
}

@keyframes scoreFloat {
    0%   { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-36px); }
}

/* 오버레이 */
.overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(6px);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    transition: opacity 0.3s ease;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-content {
    text-align: center;
    padding: 20px;
}

.overlay-emoji {
    font-size: 60px;
    margin-bottom: 12px;
    display: block;
}

.overlay-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.overlay-desc {
    font-size: 15px;
    color: var(--text-medium);
    margin-bottom: 24px;
    line-height: 1.6;
}

.overlay-score {
    font-size: 48px;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
    display: block;
}

.overlay-score-label {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 20px;
    display: block;
}

.overlay-best {
    font-size: 14px;
    color: var(--text-medium);
    margin-bottom: 20px;
}

.start-btn {
    padding: 14px 40px;
    background: var(--gradient-1);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md);
    letter-spacing: 0.3px;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

/* ─── 기록 섹션 ─────────────────────────────────────────── */
.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-diff-badge {
    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-score {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
}

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

.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;
    }

    .mole-grid {
        gap: 10px;
    }

    .status-value {
        font-size: 22px;
    }
}
