:root {
    --bonk-yellow: #FFB800;
    --bonk-orange: #FF8A00;
    --bonk-brown: #553311;
    --bonk-white: #FFFFFF;
    --bonk-black: #000000;
    --game-bg: #FFA500;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Press Start 2P', cursive;
    background: var(--game-bg);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    padding: 20px;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
    justify-content: space-between;
}

.game-container {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    flex: 1;
    min-width: 0;
    max-width: 800px;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    color: var(--bonk-orange);
    font-size: 2rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px var(--bonk-brown);
}

.game-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

button {
    font-family: 'Press Start 2P', cursive;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 10px;
    background-color: var(--bonk-orange);
    color: white;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.3s;
}

button:hover {
    background-color: var(--bonk-yellow);
    transform: scale(1.05);
}

button:active {
    transform: scale(0.95);
}

.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 2rem 0;
    cursor: url('bat-cursor.png') 16 16, auto;
}

/* Active game cursor (hammer) */
.game-board.playing {
    cursor: url('bat-cursor.png') 16 16, pointer;
}

/* Hammer swing animation when clicking */
.game-board.playing:active {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><path d="M12 20L16 16L24 24M16 16L12 4L20 4L16 16" stroke="%23553311" stroke-width="4" fill="%23FFB800"/></svg>') 16 16, pointer;
}

.hole {
    width: 100px;
    height: 100px;
    background-color: var(--bonk-brown);
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    cursor: inherit;
    box-shadow: inset 0 10px 20px rgba(0,0,0,0.5),
                0 0 0 4px var(--bonk-orange),
                0 0 10px rgba(0,0,0,0.3);
    margin: auto;
}

.bonk {
    position: absolute;
    width: 140%;
    height: 140%;
    left: -20%;
    top: -20%;
    background-image: url('bonk.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    cursor: pointer;
    z-index: 1;
}

.hole.up .bonk {
    transform: translateY(0);
    animation: popup 0.3s ease-out;
}

.hole.missed {
    animation: shake 0.5s ease-in-out;
}

@keyframes popup {
    0% { transform: translateY(100%); }
    50% { transform: translateY(-10%); }
    100% { transform: translateY(0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.score-display {
    font-size: 1rem;
    color: var(--bonk-brown);
    margin: 0 10px;
    min-width: 120px;
    text-align: center;
}

.time-display {
    font-size: 1rem;
    color: var(--bonk-brown);
    margin: 0 10px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

#highScore {
    color: var(--bonk-orange);
    font-size: 0.8rem;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
}

.modal-content h2 {
    color: var(--bonk-orange);
    margin-bottom: 1rem;
}

.modal-content p {
    margin: 0.5rem 0;
    font-size: 0.8rem;
    color: var(--bonk-brown);
}

.hit-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: hit 0.3s ease-out forwards;
}

@keyframes hit {
    0% { 
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }
    100% { 
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .game-board {
        gap: 0.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    button {
        padding: 0.6rem 1rem;
        font-size: 0.7rem;
    }

    .score-display, .time-display {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 1rem;
    }

    h1 {
        font-size: 1.2rem;
    }

    .game-controls {
        gap: 0.5rem;
    }
}

.leaderboard {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    width: 280px;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    margin-left: auto;
}

.leaderboard h2 {
    color: var(--bonk-orange);
    font-size: 1rem;
    margin-bottom: 1rem;
    text-align: center;
    text-shadow: 1px 1px var(--bonk-brown);
}

.leaderboard-entries {
    display: grid;
    gap: 0.8rem;
}

.leaderboard-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    background-color: rgba(255, 184, 0, 0.1);
    border-radius: 5px;
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.leaderboard-entry:hover {
    transform: scale(1.02);
    background-color: rgba(255, 184, 0, 0.2);
}

.leaderboard-entry .rank {
    color: var(--bonk-orange);
    font-weight: bold;
    width: 2rem;
}

.leaderboard-entry .name {
    color: var(--bonk-brown);
    font-weight: bold;
    text-transform: uppercase;
}

.leaderboard-entry .score {
    color: var(--bonk-orange);
}

#nameModal .modal-content {
    max-width: 300px;
}

#nameInput {
    font-family: 'Press Start 2P', cursive;
    width: 100%;
    padding: 0.5rem;
    margin: 1rem 0;
    text-align: center;
    font-size: 1.2rem;
    border: 2px solid var(--bonk-orange);
    border-radius: 5px;
    background-color: white;
    color: var(--bonk-brown);
}

#nameInput:focus {
    outline: none;
    border-color: var(--bonk-yellow);
    box-shadow: 0 0 5px var(--bonk-orange);
}

.controls-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Media query for smaller screens */
@media (max-width: 1200px) {
    .game-wrapper {
        flex-direction: column;
        gap: 1rem;
        padding: 10px;
    }
    
    .game-container {
        order: 2;
        max-width: 100%;
    }
    
    .leaderboard {
        order: 1;
        width: 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .game-wrapper {
        padding: 5px;
    }
    
    .game-container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .game-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    button {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
    
    .score-display, .time-display {
        font-size: 0.8rem;
        min-width: auto;
    }
    
    .game-board {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        margin: 1rem 0;
    }
    
    .hole {
        width: 80px;
        height: 80px;
    }
    
    .leaderboard h2 {
        font-size: 0.9rem;
        padding: 0.5rem;
    }
    
    .leaderboard-entry {
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 10px;
        max-width: 90%;
    }
    
    .modal-content h2 {
        font-size: 1.2rem;
    }
    
    .modal-content p {
        font-size: 0.8rem;
    }
    
    #nameInput {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 0.5rem;
    }
    
    h1 {
        font-size: 1.2rem;
    }
    
    .game-controls {
        flex-direction: column;
        gap: 0.3rem;
    }
    
    button {
        padding: 0.5rem 0.8rem;
        font-size: 0.7rem;
    }
    
    .game-board {
        gap: 0.3rem;
    }
    
    .hole {
        width: 70px;
        height: 70px;
    }
    
    .score-display, .time-display {
        font-size: 0.7rem;
    }
    
    .leaderboard h2 {
        font-size: 0.8rem;
    }
    
    .leaderboard-entry {
        font-size: 0.6rem;
        padding: 0.2rem 0.4rem;
    }
    
    .modal-content {
        padding: 1rem;
        margin: 5px;
    }
    
    .modal-content h2 {
        font-size: 1rem;
    }
    
    .modal-content p {
        font-size: 0.7rem;
    }
    
    #nameInput {
        font-size: 0.7rem;
        padding: 0.4rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Mobile touch devices */
    button {
        min-height: 44px; /* iOS recommended touch target */
        min-width: 44px;
    }
    
    .hole {
        min-height: 60px;
        min-width: 60px;
    }
    
    /* Remove hover effects on touch devices */
    button:hover {
        transform: none;
        background-color: var(--bonk-orange);
    }
    
    .leaderboard-entry:hover {
        background-color: rgba(255, 184, 0, 0.1);
    }
}

/* Prevent zoom on input focus (iOS) */
@media screen and (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
} 