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

body {
    font-family: 'Fredoka', sans-serif;
    background-color: #8b5a2b; /* Brown dirt color */
    background-image: radial-gradient(circle, #a0522d 0%, #8b4513 100%);
    color: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Custom Hammer Cursor (Large) */
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" viewBox="0 0 64 64"><rect x="28" y="24" width="8" height="38" fill="%238D6E63" rx="3"/><rect x="12" y="6" width="40" height="18" fill="%239E9E9E" rx="4"/><rect x="10" y="10" width="44" height="10" fill="%23BDBDBD" rx="2"/></svg>') 32 16, auto;
}

body.hitting {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" viewBox="0 0 64 64"><g transform="rotate(-35 32 32)"><rect x="28" y="24" width="8" height="38" fill="%238D6E63" rx="3"/><rect x="12" y="6" width="40" height="18" fill="%239E9E9E" rx="4"/><rect x="10" y="10" width="44" height="10" fill="%23BDBDBD" rx="2"/></g></svg>') 20 20, auto;
}

/* Header HUD */
.header {
    background: rgba(0,0,0,0.5);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    z-index: 10;
}
.logo { font-size: 1.5rem; font-weight: 700; color: #ffeb3b; }
.stats { display: flex; gap: 20px; }
.stat-box { display: flex; flex-direction: column; align-items: center; background: rgba(0,0,0,0.4); padding: 5px 20px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.15); }
.stat-label { font-size: 0.7rem; color: #ccc; letter-spacing: 1px; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: white; }
.btn { border: none; padding: 8px 16px; border-radius: 8px; font-weight: 600; cursor: pointer; transition: 0.2s; font-family: 'Fredoka', sans-serif; font-size: 1rem; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: #4caf50; color: white; }
.btn-primary:hover { background: #43a047; }
.btn-warning { background: #ff9800; color: white; margin-right: 5px; }
.btn-secondary { background: #607d8b; color: white; }

/* Ad Banner Area */
.ad-banner {
    width: 100%;
    max-width: 728px;
    min-height: 90px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    margin: 10px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.ad-banner ins {
    max-width: 100%;
    overflow: hidden;
}
.ad-label {
    position: absolute;
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 0;
}
.ad-bottom { margin-top: auto; margin-bottom: 15px; }

/* Game Area */
.game-area {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
    max-width: min(90vw, 50vh);
    aspect-ratio: 1;
}

/* Hole & Dirt */
.hole {
    background: #3e2723; /* Dark brown hole */
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 10px 20px rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.dirt {
    position: absolute;
    bottom: -15%;
    width: 120%;
    height: 40%;
    background: #5d4037;
    border-radius: 50%;
    z-index: 5;
    box-shadow: inset 0 5px 10px rgba(0,0,0,0.5);
}

/* Characters */
.character {
    position: absolute;
    bottom: -100%; /* Hidden by default */
    width: 65%;
    height: 80%;
    border-radius: 40% 40% 10% 10%;
    transition: bottom 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
}

.character.up {
    bottom: 10%;
}

.character.hit {
    bottom: 0%;
    transform: scale(0.9) rotate(5deg);
    filter: brightness(0.5);
}

/* Character Types */
.character.mole { background: #8d6e63; }
.character.mole::after { content: '🐹'; font-size: 3.5rem; margin-top: -10px; }

.character.golden { background: #ffd54f; box-shadow: 0 0 20px #ffc107; }
.character.golden::after { content: '👑'; font-size: 3.5rem; margin-top: -10px; }

.character.bomb { background: #424242; }
.character.bomb::after { content: '💣'; font-size: 3.5rem; margin-top: -10px; }


/* Modals */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: 0.3s;
    z-index: 9999;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-card { background: #fff; color: #333; padding: 30px; border-radius: 20px; text-align: center; min-width: 320px; box-shadow: 0 10px 40px rgba(0,0,0,0.6); border: 4px solid #4caf50; }
.modal-card h2 { color: #e91e63; margin-bottom: 15px; font-size: 2.2rem; }

.leaderboard-box {
    max-height: 250px; overflow-y: auto; text-align: left; background: #f9fafb; padding: 15px; border-radius: 10px; margin-bottom: 15px; border: 1px solid #ddd; font-size: 1.1rem;
}

/* Floating Points */
.float-text {
    position: absolute;
    font-size: 1.5rem;
    font-weight: bold;
    pointer-events: none;
    z-index: 100;
    animation: floatUp 0.8s forwards;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}
.float-text.positive { color: #4caf50; }
.float-text.golden-text { color: #ffc107; font-size: 2rem; }
.float-text.negative { color: #f44336; }

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

@media (max-width: 600px) {
    .board { max-width: 350px; gap: 10px; }
    .character::after { font-size: 2.5rem; }
    .ad-banner { height: 50px; }
}
