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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
}

#game-container {
    text-align: center;
    padding: 20px;
    max-width: 1000px;
}

#header {
    margin-bottom: 15px;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
    animation: bounce 2s ease infinite;
}

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

#stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    font-size: 1.2em;
    background: rgba(255,255,255,0.15);
    padding: 12px 25px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
}

#stats strong {
    color: #ffe66d;
    font-size: 1.4em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

#game-area {
    position: relative;
    display: inline-block;
}

canvas {
    border: 4px solid rgba(255,255,255,0.3);
    border-radius: 15px;
    background: linear-gradient(180deg, #87CEEB 0%, #E0F6FF 50%, #98FB98 50%, #90EE90 100%);
    box-shadow: 0 15px 50px rgba(0,0,0,0.4);
    cursor: crosshair;
}

#controls {
    margin-top: 15px;
}

#controls p {
    margin: 8px 0;
    color: #f0f0f0;
    font-size: 1.1em;
}

button {
    padding: 14px 35px;
    margin: 8px;
    font-size: 1.2em;
    font-weight: bold;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

#startBtn {
    background: #48dbfb;
    color: #2d3436;
}

#startBtn:hover {
    background: #0abde3;
    transform: scale(1.08);
    box-shadow: 0 5px 20px rgba(72, 219, 251, 0.4);
}

#resetBtn {
    background: #ff9ff3;
    color: #2d3436;
}

#resetBtn:hover:not(:disabled) {
    background: #f368e0;
    transform: scale(1.08);
}

#resetBtn:disabled {
    background: #b2bec3;
    cursor: not-allowed;
}

#playAgainBtn {
    background: #1dd1a1;
    color: white;
}

#playAgainBtn:hover {
    background: #10ac84;
    transform: scale(1.08);
}

#game-over, #message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.9);
    padding: 40px 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 15px 50px rgba(0,0,0,0.5);
    z-index: 100;
}

#game-over h2 {
    font-size: 2.8em;
    margin-bottom: 20px;
    color: #ff6b6b;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

#game-over p {
    font-size: 1.4em;
    margin: 10px 0;
}

#message {
    font-size: 2em;
    color: #ffe66d;
    padding: 20px 40px;
    animation: popIn 0.3s ease;
}

@keyframes popIn {
    0% { transform: translate(-50%, -50%) scale(0); }
    80% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.hidden {
    display: none !important;
}

.notice {
    background: rgba(255, 193, 7, 0.9);
    color: #333;
    padding: 20px 30px;
    border-radius: 15px;
    margin-top: 20px;
    text-align: left;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.notice h3 {
    margin-bottom: 10px;
    font-size: 1.3em;
}

.notice p {
    margin: 5px 0;
    font-size: 1em;
}

.notice code {
    background: rgba(0,0,0,0.1);
    padding: 2px 8px;
    border-radius: 5px;
    font-family: monospace;
}

.hit-message {
    color: #1dd1a1 !important;
}

.miss-message {
    color: #ff6b6b !important;
}

/* Canvas overlay for welcome screen */
.canvas-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 40px 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 15px 50px rgba(0,0,0,0.5);
    z-index: 50;
    max-width: 700px;
    opacity: 1;
    transition: opacity 0.8s ease-out;
}

.canvas-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.canvas-overlay h2 {
    font-size: 2.2em;
    margin-bottom: 20px;
    color: #ffe66d;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.canvas-overlay p {
    font-size: 1.3em;
    margin: 12px 0;
    color: #f0f0f0;
}

/* Warning overlay with zoom animation */
.warning-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-family: 'Comic Sans MS', 'Comic Sans', 'Chalkboard SE', 'Comic Neue', cursive;
    font-size: 1.8em;
    color: #ff6b6b;
    background: rgba(255, 255, 255, 0.95);
    padding: 25px 40px;
    border-radius: 15px;
    border: 4px solid #ff6b6b;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    z-index: 60;
    opacity: 0;
    transition: opacity 0.5s ease-out;
    animation: zoomIn 0.5s ease forwards;
}

.warning-overlay.visible {
    opacity: 1;
}

.warning-overlay.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

@keyframes zoomIn {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    70% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}
