body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: 'Arial', sans-serif;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    background-color: #1a1a2e;
    overflow: hidden;
    cursor: grab;
}

#game-canvas {
    display: block;
    background-color: #7ec850;
    position: absolute;
    top: 0;
    left: 0;
    cursor: grab;
    image-rendering: crisp-edges;
}

#waiting-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, #87CEEB 0%, #98D8C8 50%, #FFD93D 100%);
    color: white;
    z-index: 10;
    padding: 20px;
    box-sizing: border-box;
    font-family: 'Comic Sans MS', cursive;
    overflow: hidden;
}

/* Floating golf emoji background */
#waiting-screen::before {
    content: '⛳ 🏌️ ⛳ 🏌️ ⛳ 🏌️ ⛳ 🏌️ ⛳ 🏌️';
    position: absolute;
    top: -50px;
    left: 0;
    width: 200%;
    font-size: 40px;
    opacity: 0.15;
    animation: float-emojis 25s linear infinite;
    white-space: nowrap;
    pointer-events: none;
}

#waiting-screen::after {
    content: '🏌️ ⛳ 🏌️ ⛳ 🏌️ ⛳ 🏌️ ⛳ 🏌️ ⛳';
    position: absolute;
    bottom: -50px;
    right: 0;
    width: 200%;
    font-size: 40px;
    opacity: 0.15;
    animation: float-emojis-reverse 30s linear infinite;
    white-space: nowrap;
    pointer-events: none;
}

@keyframes float-emojis {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes float-emojis-reverse {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

#waiting-screen.hidden {
    display: none;
}

#waiting-screen h1 {
    font-size: 4em;
    margin: 10px 0;
    color: #FF1744;
    text-shadow: 4px 4px 0px #FFF, 8px 8px 0px rgba(0,0,0,0.3), 3px 3px 15px rgba(255,255,255,0.8);
    transform: rotate(-5deg);
    animation: bounce 2s infinite;
}

#waiting-screen h2 {
    font-size: 2em;
    margin: 15px 0;
    color: #FFD700;
    text-shadow: 3px 3px 0px #FF69B4, 5px 5px 0px rgba(0,0,0,0.2);
    transform: rotate(3deg);
}

#waiting-screen h3 {
    margin-bottom: 15px;
    color: #FF69B4;
    font-size: 1.8em;
    text-shadow: 2px 2px 0px #FFF;
}

#waiting-screen ul {
    list-style-position: inside;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 20px;
    border: 4px solid #FFD700;
}

#waiting-screen li {
    margin: 12px 0;
    font-size: 1.3em;
    color: #333;
    text-shadow: 1px 1px 0px rgba(255,255,255,0.8);
    font-weight: bold;
}

#player-count {
    margin-top: 20px;
    font-size: 2.2em;
    color: #FF1744;
    font-weight: bold;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    padding: 15px 30px;
    border-radius: 20px;
    border: 5px solid #FF69B4;
    box-shadow: 0 6px 0 #CC8800, 0 8px 20px rgba(0,0,0,0.3);
    text-shadow: 2px 2px 0px #FFF;
    animation: pulse 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-15px) rotate(-5deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

#start-game-btn:hover {
    background: linear-gradient(135deg, #66BB6A 0%, #4CAF50 100%);
    transform: scale(1.1);
}

#start-game-btn:active {
    transform: scale(0.95) translateY(4px);
    box-shadow: 0 2px 0 #2d6b2f, 0 4px 10px rgba(0,0,0,0.3);
}

#leave-room-btn:hover {
    background: linear-gradient(135deg, #FF8A80 0%, #FF5252 100%);
    transform: scale(1.1);
}

#leave-room-btn:active {
    transform: scale(0.95) translateY(4px);
    box-shadow: 0 2px 0 #B71C1C, 0 4px 10px rgba(0,0,0,0.3);
}

#scoreboard {
    position: fixed;
    top: 20px;
    left: 20px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(30, 30, 30, 0.95));
    color: white;
    padding: 20px;
    border-radius: 15px;
    font-size: 18px;
    min-width: 280px;
    max-width: 350px;
    z-index: 1000;
    border: 3px solid #FFD700;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    display: none; /* Hidden by default */
}

#scoreboard.hidden-by-ball {
    transform: translateY(-120%);
    opacity: 0.3;
}

/* Find My Ball Button */
#find-ball-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
    border: 5px solid #FF8C00;
    padding: 15px 30px;
    font-size: 20px;
    font-weight: bold;
    font-family: 'Comic Sans MS', cursive;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 0 5px 0 #FF8C00, 0 6px 15px rgba(0,0,0,0.3);
    z-index: 50;
    transition: all 0.2s;
    pointer-events: auto;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    display: none; /* Hidden by default */
}

#reset-ball-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #FF6B6B 0%, #FF1744 100%);
    color: white;
    border: 5px solid #B71C1C;
    padding: 15px 30px;
    font-size: 20px;
    font-weight: bold;
    font-family: 'Comic Sans MS', cursive;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 0 5px 0 #B71C1C, 0 6px 15px rgba(0,0,0,0.3);
    z-index: 50;
    transition: all 0.2s;
    pointer-events: auto;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    display: none; /* Hidden by default */
}

#find-ball-btn:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #FFE34D 0%, #FFB84D 100%);
}

#find-ball-btn:active {
    transform: scale(0.95) translateY(4px);
    box-shadow: 0 2px 0 #CC8800, 0 3px 8px rgba(0,0,0,0.3);
}

#reset-ball-btn:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #FF8A80 0%, #FF5252 100%);
}

#reset-ball-btn:active {
    transform: scale(0.95) translateY(4px);
    box-shadow: 0 2px 0 #B71C1C, 0 3px 8px rgba(0,0,0,0.3);
}

/* Direction Arrow to Hole */
#direction-arrow {
    position: fixed;
    width: 80px;
    height: 80px;
    z-index: 900;
    pointer-events: none;
    font-size: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    animation: pulse-arrow 1s infinite;
}

@keyframes pulse-arrow {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

#scoreboard h3 {
    margin: 0 0 15px 0;
    font-size: 22px;
    border-bottom: 3px solid #FFD700;
    padding-bottom: 8px;
    text-align: center;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

.player-score {
    margin: 10px 0;
    padding: 12px 15px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 15px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-success {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

.toast-error {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

.toast-info {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

/* Mobile-friendly styles */
@media (max-width: 1200px) {
    body {
        padding: 10px;
    }
    
    #game-container {
        width: 100%;
        height: calc(100vh - 20px);
        max-width: 100vw;
    }
    
    #game-canvas {
        width: 100%;
        height: 100%;
    }
    
    #scoreboard {
        font-size: 14px;
        padding: 15px;
        top: 40px;
        right: 10px;
        min-width: 180px;
    }
    
    #scoreboard h3 {
        font-size: 18px;
    }
    
    .player-score {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    #waiting-screen h1 {
        font-size: 2em;
    }
    
    #waiting-screen h2 {
        font-size: 1.2em;
    }
    
    .toast {
        font-size: 14px;
        padding: 12px 20px;
        bottom: 10px;
    }
}
