:root{--bg:#87CEEB;--text:#333;--muted:#555;--border:#4caf50;--accent:#ffeb3b}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    margin: 0;
    padding: 0;
    user-select: none;
    overflow-y: auto;
    overflow-x: hidden;
    touch-action: manipulation;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Grass Background Texture */
.grass-bg {
    background: linear-gradient(to bottom, #87CEEB 0%, #87CEEB 20%, #4caf50 20%, #43a047 100%);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Cloud Decoration */
.cloud {
    position: absolute;
    background: white;
    border-radius: 50px;
    opacity: 0.8;
    animation: moveCloud 20s linear infinite;
}

@keyframes moveCloud {
    0% { left: -20%; }
    100% { left: 120%; }
}

/* HUD */
.hud {
    position: absolute;
    top: 0;
    width: 100%;
    max-width: 800px; /* Constrain width to match game container */
    left: 50%;
    transform: translateX(-50%); /* Center it */
    padding: 16px;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    z-index: 30;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    box-sizing: border-box; /* Ensure padding is included in width */
}

.score-box, .time-box {
    text-align: center;
}

.label {
    font-size: 14px;
    color: #fff9c4; /* Light yellow */
    display: block;
}

.value {
    font-size: 32px;
    font-weight: bold;
}

.back {
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    text-decoration: none;
    font-size: 14px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.3);
    margin-bottom: 8px;
}
.back:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* Game Container */
.game-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 10;
    padding-top: 100px; /* Space for HUD */
    padding-bottom: 20px;
    /* Removed flex: 1 to prevent taking up all space unnecessarily */
}

/* Start Screen */
.start-screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 40;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    transition: opacity 0.3s;
}

.start-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.title {
    font-size: 48px;
    color: #ffeb3b;
    font-weight: bold;
    margin-bottom: 16px;
    text-shadow: 0 4px 8px rgba(0,0,0,0.5);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-20px);}
    60% {transform: translateY(-10px);}
}

.subtitle {
    color: white;
    font-size: 20px;
    margin-bottom: 32px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.btn {
    padding: 16px 32px;
    background: #ffeb3b;
    color: #5d4037;
    border: none;
    border-radius: 50px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 6px 0 #fbc02d;
    transition: transform 0.1s, box-shadow 0.1s;
}

.btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #fbc02d;
}

/* Game Over Screen */
.modal {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: white;
    padding: 32px;
    border-radius: 24px;
    text-align: center;
    border: 4px solid #4caf50;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-width: 90%;
    width: 320px;
}

.modal-title {
    font-size: 32px;
    color: #2e7d32;
    margin-bottom: 8px;
    font-weight: bold;
}

.final-score {
    font-size: 48px;
    font-weight: bold;
    color: #333;
    margin: 16px 0;
}

.message {
    color: #666;
    margin-bottom: 24px;
}

.play-again-btn {
    width: 100%;
    padding: 12px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 0 #2e7d32;
    transition: transform 0.1s;
}

.play-again-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #2e7d32;
}

/* Game Area (Wrapper for Game elements) */
.game-area {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* Game Board */
.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
    padding: 16px;
    margin-bottom: 20px;
}

/* Hole */
.hole {
    position: relative;
    overflow: hidden;
    z-index: 10;
    aspect-ratio: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    border-bottom: 4px solid rgba(255, 255, 255, 0.1);
}

/* Dirt Mound */
.dirt {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 30%;
    background: #8d6e63;
    border-radius: 50% 50% 10px 10px;
    z-index: 20;
    box-shadow: inset 0 -5px 10px rgba(0,0,0,0.3);
}

.dirt::after {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    width: 80%;
    height: 20px;
    background: #6d4c41;
    border-radius: 50%;
}

/* Mole */
.mole {
    width: 70%;
    height: 80%;
    position: absolute;
    bottom: 10%;
    left: 15%;
    background-color: #a1887f;
    border-radius: 40% 40% 10% 10%;
    transition: transform 0.1s;
    transform: translateY(100%);
    z-index: 15;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hole.up .mole {
    transform: translateY(0);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mole-face {
    width: 100%;
    height: 100%;
}

.hole.bonked .mole {
    background-color: #ef9a9a;
    transform: scale(0.9) translateY(5px);
    transition: transform 0.1s;
    pointer-events: none;
}

.hidden {
    display: none;
}

/* Floating Score */
.score-pop {
    position: absolute;
    font-size: 2rem;
    color: #ffeb3b;
    font-weight: bold;
    pointer-events: none;
    animation: floatUp 0.8s ease-out forwards;
    z-index: 30;
    text-shadow: 2px 2px 0 #000;
}

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

/* Footer */
.site-footer {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    padding: 10px;
    text-align: center;
    font-size: 14px;
    z-index: 100;
    backdrop-filter: blur(2px);
    margin-top: auto;
}

/* Cursor (Desktop) */
@media (min-width: 768px) {
    .game-board {
        cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewport="0 0 100 100" style="fill:black;font-size:30px;"><text y="50%">🔨</text></svg>') 16 0, auto;
    }
    .hole:active {
        cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewport="0 0 100 100" style="fill:black;font-size:30px;transform:rotate(-45deg);"><text y="50%">🔨</text></svg>') 16 0, auto;
    }
}
