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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(45deg, #000428 0%, #004e92 100%);
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 10px;
    color: #FFFF00;
    overflow-x: hidden;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Pokemon-style animated background stars */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #fff, transparent),
        radial-gradient(2px 2px at 40px 70px, #fff, transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, #fff, transparent),
        radial-gradient(2px 2px at 160px 30px, #fff, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: twinkle 3s infinite;
    z-index: -1;
    opacity: 0.3;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.1; }
}

.game-container {
    background: linear-gradient(135deg, #000 0%, #1a1a2e 50%, #16213e 100%);
    border: 6px solid transparent;
    border-radius: 15px;
    background-clip: padding-box;
    box-shadow: 
        0 0 30px rgba(255, 255, 0, 0.4),
        0 0 60px rgba(0, 102, 255, 0.3),
        inset 0 0 30px rgba(255, 255, 0, 0.05);
    padding: 25px;
    text-align: center;
    max-width: 950px;
    position: relative;
    animation: containerGlow 2s ease-in-out infinite alternate;
}

/* Pokemon-style border gradient */
.game-container::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4, #45B7D1, #96CEB4, #FFEAA7, #DDA0DD, #FF6B6B);
    background-size: 400% 400%;
    border-radius: 15px;
    z-index: -1;
    animation: gradientShift 3s ease infinite;
}

@keyframes containerGlow {
    0% { box-shadow: 0 0 30px rgba(255, 255, 0, 0.4), 0 0 60px rgba(0, 102, 255, 0.3), inset 0 0 30px rgba(255, 255, 0, 0.05); }
    100% { box-shadow: 0 0 40px rgba(255, 255, 0, 0.6), 0 0 80px rgba(0, 102, 255, 0.5), inset 0 0 40px rgba(255, 255, 0, 0.1); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.game-header {
    margin-bottom: 20px;
}

.game-header h1 {
    color: #FFFF00;
    font-size: 3.2em;
    text-shadow: 
        0 0 5px #FFFF00,
        0 0 10px #FFFF00,
        0 0 15px #FFFF00,
        0 0 20px #FF6600,
        2px 2px 0px #FF6600,
        4px 4px 0px #CC4400;
    margin-bottom: 20px;
    font-weight: bold;
    letter-spacing: 4px;
    text-transform: uppercase;
    animation: titlePulse 2s ease-in-out infinite alternate;
    position: relative;
}

/* Pokemon logo-style subtitle */
.game-header h1::after {
    content: 'GOTTA CATCH 'EM ALL!';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.3em;
    color: #FF6600;
    text-shadow: 0 0 5px #FF6600;
    letter-spacing: 2px;
    animation: subtitleGlow 1.5s ease-in-out infinite alternate;
}

@keyframes titlePulse {
    0% { 
        text-shadow: 
            0 0 5px #FFFF00,
            0 0 10px #FFFF00,
            0 0 15px #FFFF00,
            0 0 20px #FF6600,
            2px 2px 0px #FF6600,
            4px 4px 0px #CC4400;
    }
    100% { 
        text-shadow: 
            0 0 10px #FFFF00,
            0 0 20px #FFFF00,
            0 0 30px #FFFF00,
            0 0 40px #FF6600,
            2px 2px 0px #FF6600,
            4px 4px 0px #CC4400;
    }
}

@keyframes subtitleGlow {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

.game-info {
    display: flex;
    justify-content: space-between;
    background: linear-gradient(90deg, #000080 0%, #0000CD 50%, #000080 100%);
    color: #FFFF00;
    padding: 15px 30px;
    border: 3px solid transparent;
    border-radius: 8px;
    font-size: 1.4em;
    font-weight: bold;
    position: relative;
    box-shadow: 
        0 0 15px rgba(255, 255, 0, 0.3),
        inset 0 0 15px rgba(255, 255, 0, 0.1);
    animation: infoPulse 3s ease-in-out infinite;
}

/* Pokemon Pokedex-style border */
.game-info::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #FFFF00, #FF6600, #FFFF00);
    border-radius: 8px;
    z-index: -1;
    animation: borderPulse 2s ease-in-out infinite alternate;
}

/* Individual stat styling */
.game-info span {
    position: relative;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    text-shadow: 0 0 5px #FFFF00;
}

.game-info span::before {
    content: attr(data-label);
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7em;
    color: #FF6600;
    text-shadow: 0 0 3px #FF6600;
}

@keyframes infoPulse {
    0%, 100% { background: linear-gradient(90deg, #000080 0%, #0000CD 50%, #000080 100%); }
    50% { background: linear-gradient(90deg, #0000CD 0%, #4169E1 50%, #0000CD 100%); }
}

@keyframes borderPulse {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}
    font-weight: bold;
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.3);
}

.score, .lives {
    display: flex;
    align-items: center;
    gap: 5px;
}

#gameCanvas {
    border: 4px solid #0066FF;
    border-radius: 8px;
    background: #000;
    display: block;
    margin: 0 auto;
    box-shadow: 0 0 15px rgba(0, 102, 255, 0.5), inset 0 0 15px rgba(0, 102, 255, 0.1);
}

.game-controls {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #2E8B57 0%, #228B22 100%);
    border: 2px solid #32CD32;
    border-radius: 10px;
    color: #FFFF00;
    box-shadow: 0 0 10px rgba(50, 205, 50, 0.3);
}

.game-controls p {
    margin: 10px 0;
    font-size: 1.1em;
    text-shadow: 0 0 8px #FFFF00;
    font-weight: bold;
    line-height: 1.4;
    text-align: center;
    animation: controlsGlow 2s ease-in-out infinite alternate;
}

@keyframes controlsGlow {
    0% { text-shadow: 0 0 8px #FFFF00; }
    100% { text-shadow: 0 0 15px #FFFF00, 0 0 20px #32CD32; }
}

.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(0, 0, 139, 0.95) 0%, rgba(25, 25, 112, 0.95) 100%);
    color: #FFFF00;
    padding: 50px;
    border: 4px solid transparent;
    border-radius: 15px;
    text-align: center;
    z-index: 1000;
    box-shadow: 
        0 0 40px rgba(255, 215, 0, 0.6),
        inset 0 0 20px rgba(255, 255, 0, 0.1);
    animation: gameOverPulse 1.5s ease-in-out infinite alternate;
}

.game-over::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(45deg, #FFD700, #FF6600, #FFD700, #FF6600);
    border-radius: 15px;
    z-index: -1;
    animation: gameOverBorder 2s linear infinite;
}

.game-over h2 {
    color: #FFD700;
    font-size: 2.8em;
    margin-bottom: 25px;
    text-shadow: 
        0 0 10px #FFD700,
        0 0 20px #FFD700,
        0 0 30px #FF6600;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 3px;
    animation: titleFlicker 0.5s ease-in-out infinite alternate;
}

.game-over p {
    font-size: 1.4em;
    margin: 15px 0;
    text-shadow: 0 0 8px #FFFF00;
}

.game-over button {
    background: linear-gradient(135deg, #FF6600 0%, #FF4500 100%);
    color: #FFFFFF;
    border: 3px solid #FFD700;
    padding: 15px 30px;
    font-size: 1.3em;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(255, 102, 0, 0.5);
}

.game-over button:hover {
    background: linear-gradient(135deg, #FF4500 0%, #FF6600 100%);
    box-shadow: 0 0 25px rgba(255, 102, 0, 0.8);
    transform: scale(1.05);
}

@keyframes gameOverPulse {
    0% { box-shadow: 0 0 40px rgba(255, 215, 0, 0.6), inset 0 0 20px rgba(255, 255, 0, 0.1); }
    100% { box-shadow: 0 0 60px rgba(255, 215, 0, 0.9), inset 0 0 30px rgba(255, 255, 0, 0.2); }
}

@keyframes gameOverBorder {
    0% { background: linear-gradient(45deg, #FFD700, #FF6600, #FFD700, #FF6600); }
    25% { background: linear-gradient(45deg, #FF6600, #FFD700, #FF6600, #FFD700); }
    50% { background: linear-gradient(45deg, #FFD700, #FF6600, #FFD700, #FF6600); }
    75% { background: linear-gradient(45deg, #FF6600, #FFD700, #FF6600, #FFD700); }
    100% { background: linear-gradient(45deg, #FFD700, #FF6600, #FFD700, #FF6600); }
}

@keyframes titleFlicker {
    0% { opacity: 0.9; }
    100% { opacity: 1; }
}

.game-over p {
    font-size: 1.4em;
    margin-bottom: 25px;
    color: #FFFF00;
    text-shadow: 0 0 8px #FFFF00;
}

#restartBtn {
    background: #000080;
    color: #FFFF00;
    border: 2px solid #FFFF00;
    padding: 15px 30px;
    font-size: 1.3em;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.3);
}

#restartBtn:hover {
    background: #FFFF00;
    color: #000080;
    box-shadow: 0 0 20px #FFFF00;
}

.hidden {
    display: none;
}

/* Responsive design */
@media (max-width: 768px) {
    .game-container {
        padding: 10px;
    }
    
    .game-header h1 {
        font-size: 2em;
    }
    
    #gameCanvas {
        width: 100%;
        height: auto;
    }
    
    .game-info {
        font-size: 1em;
        padding: 8px 15px;
    }
}
