/* ═══════════════════════════════════════
   WHACK A MOLE — Premium Styles
   tools.dotiam.com
═══════════════════════════════════════ */

.wam-wrap {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 16px;
    --wam-accent: #ffb020;
    --wam-accent2: #ff5f6d;
    --wam-dark: #2b1a0f;
    --wam-hole: #1a0f08;
    cursor: default;
}

/* ═══ HUD ═══ */
.wam-hud {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #3a2416 0%, #241409 100%);
    border-radius: 18px;
    padding: 14px 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.06);
    margin-bottom: 14px;
}

.wam-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 62px;
    padding: 6px 10px;
    background: rgba(0,0,0,.25);
    border-radius: 12px;
    flex: 1 1 auto;
}

.wam-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #d8b98f;
    font-weight: 700;
}

.wam-stat-value {
    font-size: clamp(16px, 4vw, 22px);
    font-weight: 900;
    color: #fff;
    line-height: 1.3;
}

.wam-stat-combo .wam-stat-value {
    color: var(--wam-accent);
    transition: transform .15s ease;
}

.wam-stat-combo.pulse .wam-stat-value {
    animation: wamComboPulse .3s ease;
}

@keyframes wamComboPulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.35); color: #fff; }
    100% { transform: scale(1); }
}

.wam-stat-best .wam-stat-value { color: #7ee787; }

.wam-fs-btn {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    border: none;
    border-radius: 12px;
    background: rgba(255,255,255,.1);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: all .2s ease;
}

.wam-fs-btn:hover { background: rgba(255,255,255,.22); transform: scale(1.05); }
.wam-fs-btn:active { transform: scale(.94); }

/* ═══ BAR: difficulty + start ═══ */
.wam-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.wam-diff-group {
    display: flex;
    gap: 8px;
    background: #eee7dc;
    padding: 6px;
    border-radius: 14px;
    flex-wrap: wrap;
}

.wam-diff-btn {
    border: none;
    background: transparent;
    padding: 9px 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    color: #6b5a44;
    transition: all .2s ease;
    white-space: nowrap;
}

.wam-diff-btn.active {
    background: #fff;
    color: #2b1a0f;
    box-shadow: 0 3px 10px rgba(0,0,0,.15);
}

.wam-diff-btn:disabled { opacity: .5; cursor: not-allowed; }

.wam-time-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #eee7dc;
    padding: 8px 14px;
    border-radius: 14px;
}

.wam-time-label {
    font-size: 13px;
    font-weight: 700;
    color: #6b5a44;
    white-space: nowrap;
}

.wam-time-select {
    border: none;
    background: #fff;
    color: #2b1a0f;
    font-weight: 800;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,.1);
}

.wam-time-select:disabled { opacity: .5; cursor: not-allowed; }

.wam-start-btn {
    border: none;
    background: linear-gradient(135deg, var(--wam-accent) 0%, var(--wam-accent2) 100%);
    color: #fff;
    font-weight: 900;
    font-size: 16px;
    padding: 13px 28px;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(255,95,109,.35);
    transition: all .2s ease;
    letter-spacing: .02em;
}

.wam-start-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(255,95,109,.45); }
.wam-start-btn:active { transform: translateY(0); }
.wam-start-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ═══ LEADERBOARD ═══ */
.wam-leaderboard {
    background: linear-gradient(135deg, #3a2416 0%, #241409 100%);
    border-radius: 16px;
    padding: 14px 18px;
    margin-bottom: 16px;
    box-shadow: 0 8px 20px rgba(0,0,0,.2);
}

.wam-lb-title {
    color: #ffd166;
    font-weight: 800;
    font-size: 14px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.wam-lb-list { display: flex; flex-direction: column; gap: 6px; }

.wam-lb-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,.06);
    border-radius: 10px;
    padding: 7px 12px;
    font-size: 14px;
    color: #fff;
}

.wam-lb-rank { font-weight: 900; min-width: 26px; }
.wam-lb-score { font-weight: 800; color: var(--wam-accent); flex: 1; }
.wam-lb-date { font-size: 12px; color: #c9b299; }

.wam-lb-empty {
    color: #c9b299;
    font-size: 14px;
    padding: 6px 2px;
}

.wam-rank-text {
    color: #ffd166 !important;
    font-weight: 800;
    font-size: 16px !important;
    opacity: 1 !important;
}

/* ═══ FIELD ═══ */
.wam-field {
    position: relative;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(255,255,255,.05), transparent 60%),
        linear-gradient(180deg, #5b3a22 0%, #3d2513 55%, #2b1a0f 100%);
    border-radius: 24px;
    padding: clamp(16px, 4vw, 36px);
    box-shadow: 0 20px 50px rgba(0,0,0,.35), inset 0 2px 0 rgba(255,255,255,.08);
    overflow: hidden;
    min-height: 300px;
}

.wam-field::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(90deg, rgba(0,0,0,.08) 0 2px, transparent 2px 40px);
    pointer-events: none;
    opacity: .5;
}

.wam-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(10px, 3vw, 26px);
    max-width: 640px;
    margin: 0 auto;
}

/* ═══ HOLE ═══ */
.wam-hole {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 40%, var(--wam-hole) 0%, #100a05 70%);
    box-shadow:
        inset 0 8px 18px rgba(0,0,0,.7),
        inset 0 -4px 8px rgba(255,255,255,.05),
        0 4px 0 rgba(0,0,0,.3);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><text y="30" font-size="30">🔨</text></svg>') 8 8, pointer;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.wam-hole::after {
    content: '';
    position: absolute;
    left: 4%;
    right: 4%;
    bottom: -6%;
    height: 30%;
    background: radial-gradient(ellipse, rgba(0,0,0,.55), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.wam-mole {
    position: absolute;
    left: 50%;
    bottom: -100%;
    transform: translate(-50%, 0);
    font-size: clamp(34px, 9vw, 62px);
    line-height: 1;
    transition: bottom .12s cubic-bezier(.34,1.56,.64,1);
    pointer-events: none;
    filter: drop-shadow(0 6px 6px rgba(0,0,0,.4));
}

.wam-hole.up .wam-mole { bottom: 18%; }

.wam-hole.hit .wam-mole {
    animation: wamHitShrink .22s ease forwards;
}

@keyframes wamHitShrink {
    0%   { transform: translate(-50%, 0) scale(1) rotate(0); }
    50%  { transform: translate(-50%, 10%) scale(1.3) rotate(-15deg); }
    100% { transform: translate(-50%, 60%) scale(.2) rotate(20deg); opacity: 0; }
}

.wam-hole.bomb-hit .wam-mole {
    animation: wamBombShake .35s ease;
}

@keyframes wamBombShake {
    0%,100% { transform: translate(-50%, 0) rotate(0); }
    25%     { transform: translate(-58%, 2%) rotate(-8deg); }
    75%     { transform: translate(-42%, 2%) rotate(8deg); }
}

.wam-hole.golden .wam-mole { filter: drop-shadow(0 0 14px gold) drop-shadow(0 6px 6px rgba(0,0,0,.4)); }

/* score/miss popup text */
.wam-pop-text {
    position: absolute;
    top: 6%;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 900;
    font-size: clamp(14px, 3.2vw, 20px);
    pointer-events: none;
    animation: wamPopFloat .7s ease forwards;
    z-index: 3;
    white-space: nowrap;
}

@keyframes wamPopFloat {
    0%   { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -140%); }
}

.wam-pop-text.good  { color: #7ee787; text-shadow: 0 2px 4px rgba(0,0,0,.6); }
.wam-pop-text.bomb  { color: #ff6b6b; text-shadow: 0 2px 4px rgba(0,0,0,.6); }
.wam-pop-text.gold  { color: gold;    text-shadow: 0 2px 4px rgba(0,0,0,.6); }

/* particle canvas overlay inside a hole */
.wam-hole canvas.wam-burst {
    position: absolute;
    inset: -40%;
    pointer-events: none;
    z-index: 2;
}

/* ═══ OVERLAYS ═══ */
.wam-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10,6,3,.72);
    backdrop-filter: blur(3px);
    border-radius: 24px;
    animation: wamFadeIn .25s ease;
}

@keyframes wamFadeIn { from { opacity: 0; } to { opacity: 1; } }

.wam-overlay-card {
    text-align: center;
    color: #fff;
    max-width: 380px;
    padding: 28px 24px;
}

.wam-overlay-icon {
    font-size: 52px;
    margin-bottom: 14px;
}

.wam-overlay-card h2 {
    font-size: 26px;
    font-weight: 900;
    margin-bottom: 10px;
}

.wam-overlay-card p {
    font-size: 15px;
    opacity: .9;
    line-height: 1.6;
    margin-bottom: 18px;
}

.wam-final-score {
    font-size: 22px !important;
    font-weight: 800;
    opacity: 1 !important;
}

.wam-final-score span { color: var(--wam-accent); }

.wam-new-best {
    color: gold;
    font-weight: 800;
    font-size: 16px !important;
    opacity: 1 !important;
}

/* ═══ FULLSCREEN MODE ═══ */
.wam-wrap:fullscreen,
.wam-wrap:-webkit-full-screen {
    background: #1a0f08;
    max-width: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.wam-wrap:fullscreen .wam-field,
.wam-wrap:-webkit-full-screen .wam-field {
    flex: 1;
    display: flex;
    align-items: center;
}

.wam-wrap:fullscreen .wam-grid,
.wam-wrap:-webkit-full-screen .wam-grid {
    width: 100%;
    max-width: 780px;
}

/* Fallback "fake fullscreen" for browsers (mainly iOS Safari) that don't
   support the native Fullscreen API on arbitrary elements. Toggled via JS. */
.wam-wrap.wam-fake-fs {
    position: fixed;
    inset: 0;
    z-index: 9999;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    padding: 14px;
    background: #1a0f08;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
}

.wam-wrap.wam-fake-fs .wam-field {
    flex: 1;
    display: flex;
    align-items: center;
}

.wam-wrap.wam-fake-fs .wam-grid {
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
}

.wam-wrap.wam-fake-fs .wam-leaderboard { display: none; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 560px) {
    .wam-hud { padding: 10px 12px; gap: 6px; }
    .wam-stat { min-width: 50px; padding: 5px 6px; }
    .wam-bar { flex-direction: column; align-items: stretch; }
    .wam-diff-group { justify-content: center; }
    .wam-start-btn { width: 100%; text-align: center; }
    .wam-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}

@media (min-width: 700px) {
    .wam-grid.diff-hard { grid-template-columns: repeat(4, 1fr); }
}