body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #5d4037;
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    touch-action: none;
    user-select: none;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(180deg, #81c784 0%, #388e3c 40%, #1b5e20 100%);
}

#top-bar {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    box-sizing: border-box;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    pointer-events: none;
}

.stat-box {
    background: rgba(0,0,0,0.3);
    padding: 10px 20px;
    border-radius: 10px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5), 0 2px 0 rgba(255,255,255,0.2);
}

#grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 20px;
    width: 90%;
    max-width: 500px;
    margin-top: auto;
    margin-bottom: auto;
    perspective: 800px; /* 3D perspective */
}

/* 2.5D Hole */
.hole {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* square */
    background: radial-gradient(circle at center, #1a0f0a 30%, #3e2723 80%);
    border-radius: 50%;
    box-shadow: inset 0 10px 20px rgba(0,0,0,0.9), 0 5px 10px rgba(0,0,0,0.3), 0 2px 0 rgba(255,255,255,0.1);
    transform: rotateX(20deg); /* slight tilt for 2.5D */
    transform-style: preserve-3d;
}

/* The mole */
.mole {
    position: absolute;
    bottom: 10%;
    left: 15%;
    width: 70%;
    height: 90%;
    background: linear-gradient(90deg, #795548 0%, #a1887f 20%, #8d6e63 50%, #5d4037 100%);
    border-radius: 50% 50% 20% 20%;
    box-shadow: -5px 0 15px rgba(0,0,0,0.5) inset, 0 5px 15px rgba(0,0,0,0.5);
    transform: translateY(100%); /* hidden by default */
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    pointer-events: auto;
}

/* Mole Face */
.mole::before {
    content: '';
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 30%;
    background: #ffccbc;
    border-radius: 50%;
    box-shadow: inset 0 -3px 5px rgba(0,0,0,0.2);
}
/* Mole Nose */
.mole::after {
    content: '';
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translateX(-50%);
    width: 20%;
    height: 15%;
    background: #111;
    border-radius: 50%;
}

/* Dirt in front to hide the mole's bottom half */
.dirt-front {
    position: absolute;
    bottom: -10%;
    left: -5%;
    width: 110%;
    height: 40%;
    background: #4e342e;
    border-radius: 50%;
    box-shadow: inset 0 5px 10px rgba(0,0,0,0.4);
    pointer-events: none;
    z-index: 2;
}

/* Modifiers for popping */
.hole.up .mole {
    transform: translateY(0);
}

/* Bomb skin */
.mole.bomb {
    background: linear-gradient(90deg, #222 0%, #444 20%, #333 50%, #111 100%);
}
.mole.bomb::before {
    background: transparent;
    box-shadow: none;
    content: '💣';
    font-size: 2.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}
.mole.bomb::after {
    display: none;
}

/* Hit state */
.mole.hit {
    transform: translateY(10%) scaleY(0.5);
    filter: brightness(1.5) sepia(1) hue-rotate(-50deg) saturate(3);
    transition: transform 0.1s;
}

#start-screen, #game-over-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(46, 125, 50, 0.9);
    padding: 30px 40px;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6), inset 0 2px 10px rgba(255,255,255,0.3);
    text-align: center;
    backdrop-filter: blur(5px);
    border: 2px solid #81c784;
    z-index: 10;
}

h2 {
    font-size: 2.5rem;
    margin-top: 0;
    margin-bottom: 20px;
    color: #fff;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

p {
    font-size: 1.2rem;
    color: #e8f5e9;
    margin-bottom: 25px;
}

/* Button */
.btn {
    font-size: 1.4rem;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(to bottom, #ffeb3b 0%, #fbc02d 100%);
    color: #3e2723;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 10px rgba(0,0,0,0.3), inset 0 2px 5px rgba(255,255,255,0.7);
    transition: transform 0.1s, box-shadow 0.1s;
}
.btn:active {
    transform: translateY(3px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3), inset 0 2px 5px rgba(0,0,0,0.2);
}
