* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-main: #0b0f19;
    --grass-green: #15803d;
    --dirt-brown: #78350f;
    --hole-dark: #291807;
    --accent: #f59e0b;
    --accent-gradient: linear-gradient(135deg, #f59e0b, #ef4444);
    --gold: #fbbf24;
    --text: #f8fafc;
    --text-muted: #94a3b8;
}

body {
    background: radial-gradient(circle at 50% 15%, #14532d, var(--bg-main) 70%);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: 75px; /* Space for bottom banner ad */
    cursor: default;
}

/* Header & HUD */
header {
    width: 100%;
    max-width: 500px;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 50;
}

.title-group h1 {
    font-size: 1.25rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hud-stats {
    display: flex;
    gap: 8px;
}

.stat-chip {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 4px 10px;
    text-align: center;
    min-width: 55px;
}

.stat-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stat-value {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
}

/* Toolbar */
.toolbar {
    width: 100%;
    max-width: 480px;
    padding: 8px 12px 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bar-row {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pill-btn {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pill-btn:hover {
    color: #fff;
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
}

.pill-btn.active {
    background: var(--accent-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

/* Combo Banner */
#combo-banner {
    height: 22px;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--gold);
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
    display: none;
    text-align: center;
}

.pop-anim {
    animation: popBounce 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popBounce {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* Game Board & Holes */
.board-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    width: 100%;
    max-width: 480px;
    position: relative;
}

.mole-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 1;
}

.hole-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 85%, #451a03 0%, var(--hole-dark) 70%);
    border-radius: 50% / 35%;
    border: 4px solid #78350f;
    box-shadow: inset 0 8px 16px rgba(0, 0, 0, 0.9), 0 6px 12px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.hole-wrapper::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    right: 0;
    height: 38%;
    background: linear-gradient(to top, #78350f, #92400e);
    border-radius: 50% / 40%;
    z-index: 10;
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

/* Mole Character */
.mole {
    position: absolute;
    bottom: 8%;
    width: 78%;
    height: 82%;
    border-radius: 50% 50% 20% 20%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translateY(115%);
    transition: transform 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 5;
    pointer-events: auto;
}

.mole.up {
    transform: translateY(0);
}

.mole.whacked {
    transform: translateY(15%) scale(0.88) rotate(-10deg);
    filter: brightness(1.3);
}

/* Mole Varieties */
.mole.normal {
    background: linear-gradient(145deg, #a16207, #713f12);
    border: 3px solid #ca8a04;
    box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.2);
}

.mole.golden {
    background: linear-gradient(145deg, #fde047, #d97706);
    border: 3px solid #fef08a;
    box-shadow: 0 0 16px #facc15, inset 0 2px 8px #fff;
    animation: goldGlow 0.6s infinite alternate;
}

@keyframes goldGlow {
    from { filter: drop-shadow(0 0 4px #facc15); }
    to { filter: drop-shadow(0 0 12px #fef08a); }
}

.mole.bomb {
    background: linear-gradient(145deg, #475569, #1e293b);
    border: 3px solid #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
}

/* Mole Face Details */
.mole-face {
    font-size: 2.2rem;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.mole.golden .mole-face::before {
    content: '👑';
    position: absolute;
    top: -12px;
    font-size: 1.2rem;
}

.mole.bomb .mole-face {
    font-size: 2rem;
}

/* Floating Hit Text */
.hit-particle {
    position: absolute;
    font-size: 1.1rem;
    font-weight: 900;
    pointer-events: none;
    z-index: 30;
    animation: floatUp 0.6s ease-out forwards;
}

.hit-particle.bonus {
    color: var(--gold);
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.8);
}

.hit-particle.penalty {
    color: #ef4444;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
}

@keyframes floatUp {
    0% { transform: translateY(0) scale(0.6); opacity: 1; }
    50% { transform: translateY(-25px) scale(1.2); opacity: 1; }
    100% { transform: translateY(-45px) scale(1); opacity: 0; }
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    padding: 20px;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

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

.modal-box {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 28px 24px;
    text-align: center;
    max-width: 360px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-box h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    color: var(--gold);
    text-shadow: 0 0 15px rgba(251, 191, 36, 0.5);
}

.results-grid {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 12px;
    padding: 14px;
    margin: 16px 0 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.res-item span {
    display: block;
}

.res-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.res-val {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gold);
}

.action-btn {
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
}

.action-btn:active {
    transform: translateY(1px);
}
