.whack-page {
    gap: 16px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.stats-bar {
    display: flex;
    gap: 24px;
    font-size: clamp(0.95rem, 3vw, 1.1rem);
    color: #999;
}

.stats-bar span span {
    color: #667eea;
    font-weight: 700;
}

.mode-selector {
    color: #999;
    font-size: clamp(0.85rem, 2.8vw, 0.95rem);
}

.mode-selector select {
    background: #1a1a2e;
    color: #e0e0e0;
    border: 1px solid #2a2a4a;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.95rem;
    margin-left: 8px;
}

.mole-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: clamp(6px, 1.5vw, 12px);
    margin: 10px 0;
    width: clamp(240px, 85vmin, 420px);
    aspect-ratio: 1 / 1;
}

.hole {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a2e;
    border: 2px solid #2a2a4a;
    border-radius: 14px;
    font-size: clamp(2rem, 10vmin, 3rem);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: visible;
}

.hole:hover {
    border-color: #3a3a5a;
}

.hole.active {
    background: #252545;
    border-color: #667eea;
    animation: popUp 0.2s ease-out;
}

.hole:active {
    transform: scale(0.93);
}

.hole.whacked {
    background: rgba(102, 234, 130, 0.15);
    border-color: #66ea82;
}

@keyframes popUp {
    0%   { transform: scale(0.7); }
    50%  { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Floating score text */
.floating-text {
    position: absolute;
    top: 10%;
    right: 10%;
    font-size: clamp(0.8rem, 3.5vmin, 1rem);
    font-weight: 700;
    color: #66ea82;
    pointer-events: none;
    animation: floatUp 0.5s ease-out forwards;
    z-index: 10;
}

@keyframes floatUp {
    0%   { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-30px); }
}

/* Score flash effects */
#score.hit {
    color: #66ea82;
    animation: scoreFlash 0.3s;
}

#score.miss {
    color: #ff6b6b;
    animation: scoreFlash 0.3s;
}

@keyframes scoreFlash {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ---------- Responsive breakpoints ---------- */

/* Small phones (portrait, very narrow) */
@media (max-width: 360px) {
    .whack-page {
        gap: 12px;
        padding: 16px 8px;
    }

    .game-title {
        font-size: 1.4rem;
    }

    .mole-board {
        width: 95vw;
    }

    .hole {
        border-radius: 10px;
        border-width: 1.5px;
    }

    .stats-bar {
        gap: 16px;
    }

    .back-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
        top: 12px;
        left: 12px;
    }
}

/* Medium phones */
@media (min-width: 361px) and (max-width: 500px) {
    .mole-board {
        width: 88vmin;
    }
}

/* Tablets and up — fixed max width */
@media (min-width: 501px) {
    .mole-board {
        width: 420px;
    }
}

/* Very small screens (e.g. SE landscape) */
@media (max-height: 500px) and (orientation: landscape) {
    .game-title {
        font-size: 1.2rem;
        margin-bottom: 4px;
    }

    .whack-page {
        gap: 8px;
        padding: 16px 12px;
    }

    .mole-board {
        width: clamp(200px, 50vmin, 300px);
        margin: 4px 0;
    }

    .mode-selector {
        font-size: 0.8rem;
    }

    .game-btn {
        margin-top: 8px;
        padding: 8px 20px;
        font-size: 0.9rem;
    }
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
    .hole:active {
        transform: scale(0.9);
    }
}
