/* Whack a Mole */

.wm-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    user-select: none;
}

.wm-hud {
    display: flex;
    gap: 1.5rem;
    font-weight: 700;
    color: var(--color-text-light);
    font-variant-numeric: tabular-nums;
    min-height: 1.5em;
    align-items: center;
}

#timer {
    font-size: 1.3rem;
    color: var(--color-text);
}

.wm-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: min(380px, 88vw);
    aspect-ratio: 1;
}

/* Each hole is a dark ellipse; the mole rises out of it via translateY. */
.wm-hole {
    position: relative;
    border: none;
    padding: 0;
    border-radius: 50% 50% 45% 45%;
    background: #8a6a42;
    box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.22);
    cursor: pointer;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.wm-thing {
    position: absolute;
    left: 15%;
    right: 15%;
    bottom: -100%;
    height: 78%;
    border-radius: 45% 45% 30% 30%;
    transition: bottom 110ms ease-out;
    background: transparent;
}

.wm-hole.up .wm-thing { bottom: 6%; }

.wm-hole.mole .wm-thing {
    background: #a9713f;
    box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.18);
}

/* Eyes and nose, drawn with gradients so a mole needs no extra markup. */
.wm-hole.mole .wm-thing::after {
    content: '';
    position: absolute;
    inset: 18% 22% auto 22%;
    height: 34%;
    background:
        radial-gradient(circle at 22% 40%, #241a12 0 16%, transparent 17%),
        radial-gradient(circle at 78% 40%, #241a12 0 16%, transparent 17%),
        radial-gradient(circle at 50% 88%, #f0a3a3 0 22%, transparent 23%);
}

.wm-hole.bomb .wm-thing {
    background: #33333c;
    border-radius: 50%;
    height: 66%;
}

.wm-hole.bomb .wm-thing::after {
    content: '';
    position: absolute;
    left: 50%;
    top: -18%;
    width: 8%;
    height: 26%;
    background: var(--color-accent);
    border-radius: 2px;
    transform: translateX(-50%) rotate(12deg);
}

.wm-hole.whacked { background: var(--color-success); }
.wm-hole.boom { background: var(--color-accent); }
.wm-hole.miss { background: #6d5335; }

.wm-hole:focus-visible {
    outline: 3px solid var(--color-text);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .wm-thing { transition: none; }
}

.wm-feedback {
    min-height: 1.4em;
    margin: 0;
    font-weight: 700;
    color: var(--color-text-light);
    text-align: center;
}

.wm-btn {
    padding: 0.75rem 2rem;
    font-size: 1.05rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    background: var(--color-primary);
    color: var(--color-text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.wm-btn:hover { background: var(--color-primary-dark); }
.wm-btn:focus-visible {
    outline: 3px solid var(--color-text);
    outline-offset: 2px;
}

/* Hidden mid-round so it cannot steal a swing. */
.state-playing .wm-btn { visibility: hidden; }
