/* =============================================
   두더지 잡기 게임 스타일
   테마: 다크 + 그린 (#22C55E)
   ============================================= */

html { background: #0f0f23; }

.wm-body {
    overflow: hidden;
    height: 100dvh;
    max-width: 480px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #f0f0f0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

/* Game Area */
.wm-game {
    width: 100%;
    height: 100dvh;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #0f0f23;
}

/* Top Bar */
.wm-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    z-index: 10;
    flex-shrink: 0;
}
.wm-back {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}
.wm-back:hover { color: #fff; }
.wm-info-badge {
    font-size: 13px;
    font-weight: 600;
    color: #22C55E;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Content area */
.wm-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 16px 20px;
    overflow-y: auto;
}

/* ===== INTRO ===== */
.state-intro .wm-info-badge { display: none; }
.state-intro .wm-content {
    justify-content: center;
    padding-top: 0;
}

.wm-intro-emoji { font-size: 72px; margin-bottom: 16px; }
.wm-intro-title {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
}
.wm-intro-desc {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: center;
}
.wm-intro-desc strong { color: #22C55E; }

.wm-best {
    background: rgba(34, 197, 94, 0.1);
    border-radius: 10px;
    padding: 10px 18px;
    margin-bottom: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.wm-challenge {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 20px;
    font-size: 16px;
    color: #22C55E;
    text-align: center;
}
.wm-challenge strong { font-size: 22px; }

.wm-rules {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    justify-content: center;
}
.wm-rule-chip {
    padding: 6px 14px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 20px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.wm-btn-start {
    display: inline-block;
    padding: 16px 48px;
    background: linear-gradient(135deg, #22C55E, #16A34A);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s;
}
.wm-btn-start:active { transform: scale(0.95); }

/* ===== COUNTDOWN ===== */
.state-countdown { background: #0f0f1a; }
.state-countdown .wm-info-badge { display: none; }
.state-countdown .wm-content {
    justify-content: center;
    padding: 0;
}
.wm-countdown-wrap { text-align: center; }
.wm-countdown-num {
    font-size: 120px;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    animation: wmCountPop 0.5s ease-out;
}
.wm-countdown-num.wm-countdown-pop {
    animation: wmCountPop 0.5s ease-out;
}
.wm-countdown-label {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 16px;
}
@keyframes wmCountPop {
    0% { transform: scale(1.6); opacity: 0.3; }
    50% { transform: scale(0.95); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* ===== PLAYING ===== */
.state-playing .wm-content {
    justify-content: flex-start;
    padding-top: 8px;
}

/* Timer bar */
.wm-timer-bar-wrap {
    width: 100%;
    max-width: 340px;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    margin-bottom: 8px;
    overflow: hidden;
    flex-shrink: 0;
}
.wm-timer-bar {
    height: 100%;
    background: linear-gradient(90deg, #22C55E, #16A34A);
    border-radius: 4px;
    transition: width 0.1s linear;
    width: 100%;
}
.wm-timer-bar.wm-timer-low {
    background: linear-gradient(90deg, #EF4444, #DC2626);
}

.wm-timer-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
    flex-shrink: 0;
}

/* Grid */
.wm-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 340px;
    flex-shrink: 0;
}

/* Hole */
.wm-hole {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, #1a1a2e 40%, #13132b 100%);
    border: 3px solid #2d2d44;
    overflow: hidden;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.wm-hole::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 5%;
    width: 90%;
    height: 35%;
    background: radial-gradient(ellipse at center bottom, #1a1a2e 0%, transparent 70%);
    border-radius: 50% 50% 0 0;
    z-index: 2;
    pointer-events: none;
}

/* Mole */
.wm-mole {
    position: absolute;
    bottom: -100%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0;
    line-height: 1;
    z-index: 1;
    transition: bottom 0.15s ease-out, opacity 0.1s;
    pointer-events: none;
}
.wm-mole.wm-mole-up {
    bottom: 15%;
    font-size: 44px;
    pointer-events: auto;
}
.wm-mole.wm-mole-whacked {
    bottom: 15%;
    font-size: 44px;
    opacity: 0;
    transform: translateX(-50%) scale(0.5);
    transition: opacity 0.15s, transform 0.15s;
    pointer-events: none;
}

/* Hit effect */
.wm-hit-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px;
    font-weight: 800;
    z-index: 5;
    pointer-events: none;
    animation: wmHitFloat 0.6s ease-out forwards;
}
.wm-hit-plus { color: #22C55E; }
.wm-hit-bonus { color: #F59E0B; }
.wm-hit-bomb { color: #EF4444; }

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

/* Whack animation on hole */
.wm-hole.wm-hole-hit {
    animation: wmHoleHit 0.15s ease;
}
@keyframes wmHoleHit {
    0% { transform: scale(1); }
    50% { transform: scale(0.92); }
    100% { transform: scale(1); }
}

/* Score display */
.wm-score-display {
    margin-top: 16px;
    display: flex;
    gap: 20px;
    flex-shrink: 0;
}
.wm-score-item {
    text-align: center;
}
.wm-score-val {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    display: block;
}
.wm-score-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

/* ===== GAMEOVER overlay ===== */
.wm-gameover-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 15, 35, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    animation: wmFadeIn 0.3s ease;
}
@keyframes wmFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.wm-gameover-text {
    font-size: 32px;
    font-weight: 900;
    color: #22C55E;
    margin-bottom: 16px;
    text-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
}

.wm-gameover-score {
    font-size: 48px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 4px;
}
.wm-gameover-score small { font-size: 18px; color: rgba(255,255,255,0.5); }

.wm-gameover-detail {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 24px;
}

.wm-btn-result {
    padding: 16px 48px;
    background: linear-gradient(135deg, #22C55E, #16A34A);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s;
}
.wm-btn-result:active { transform: scale(0.95); }

/* ===== RESULT ===== */
.state-result .wm-info-badge { display: none; }
.state-result .wm-content {
    justify-content: flex-start;
    padding-top: 24px;
}

/* Result -- 공통 game-result.css 사용 */

/* Toast */
.wm-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.wm-toast-show {
    opacity: 1;
    pointer-events: auto;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .wm-grid {
        max-width: calc(100vw - 80px);
        gap: 10px;
    }
    .wm-intro-title { font-size: 24px; }
    .wm-intro-emoji { font-size: 56px; }
    .wm-gameover-score { font-size: 40px; }
    .wm-mole.wm-mole-up,
    .wm-mole.wm-mole-whacked {
        font-size: 36px;
    }
}

@media (max-width: 360px) {
    .wm-top-bar { padding: 10px 12px; }
    .wm-content { padding: 12px 16px; }
    .wm-grid {
        max-width: calc(100vw - 60px);
        gap: 8px;
    }
    .wm-mole.wm-mole-up,
    .wm-mole.wm-mole-whacked {
        font-size: 30px;
    }
    .wm-hole {
        border-width: 2px;
    }
}
