/* ===== 80s NEON ARCADE STYLE ===== */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Press+Start+2P&display=swap');

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

:root {
    --neon-pink: #ff00ff;
    --neon-cyan: #00ffff;
    --neon-yellow: #ffff00;
    --neon-orange: #ff6600;
    --neon-green: #00ff00;
    --neon-blue: #0066ff;
    --neon-purple: #9900ff;
    --dark-bg: #0a0015;
    --darker-bg: #050008;
}

body {
    background: var(--dark-bg);
    background-image: 
        radial-gradient(ellipse at center, rgba(100, 0, 150, 0.3) 0%, transparent 70%),
        linear-gradient(180deg, var(--darker-bg) 0%, var(--dark-bg) 50%, #150025 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Orbitron', sans-serif;
    overflow: hidden;
    padding: 10px;
}

/* Scanline effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 1000;
}

.arcade-cabinet {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 600px;
    width: 100%;
}

/* ===== BACKBOX / HEADER ===== */
.backbox {
    background: linear-gradient(180deg, #1a0030 0%, #0d0018 100%);
    border: 4px solid;
    border-image: linear-gradient(90deg, var(--neon-purple), var(--neon-cyan), var(--neon-purple)) 1;
    border-radius: 15px 15px 5px 5px;
    padding: 15px 20px;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow: 
        0 0 30px var(--neon-cyan),
        inset 0 0 30px rgba(0, 255, 255, 0.1);
    animation: borderGradient 3s linear infinite;
    background-clip: padding-box;
}

.game-title {
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 0 8px rgba(0, 255, 255, 0.6)) 
            drop-shadow(0 0 15px rgba(255, 0, 255, 0.4));
    letter-spacing: 4px;
    margin-bottom: 15px;
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { 
        filter: drop-shadow(0 0 8px rgba(0, 255, 255, 0.6)) 
                drop-shadow(0 0 15px rgba(255, 0, 255, 0.4));
    }
    50% { 
        filter: drop-shadow(0 0 12px rgba(0, 255, 255, 0.8)) 
                drop-shadow(0 0 25px rgba(255, 0, 255, 0.5));
    }
}

@keyframes softYellowGlow {
    0%, 100% { 
        text-shadow: 
            0 0 10px rgba(255, 255, 0, 0.8),
            0 0 20px rgba(255, 255, 0, 0.6),
            0 0 30px rgba(255, 200, 0, 0.4);
    }
    50% { 
        text-shadow: 
            0 0 15px rgba(255, 255, 0, 0.9),
            0 0 30px rgba(255, 255, 0, 0.7),
            0 0 45px rgba(255, 200, 0, 0.5);
    }
}

.score-panel {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    flex-wrap: wrap;
}

.score-display, .high-score-display, .ball-display {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-label {
    font-size: 0.7rem;
    color: var(--neon-orange);
    text-shadow: 0 0 10px var(--neon-orange);
    margin-bottom: 5px;
}

.score-value {
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: var(--neon-green);
    text-shadow: 
        0 0 10px var(--neon-green),
        0 0 20px var(--neon-green);
    background: rgba(0, 255, 0, 0.1);
    padding: 8px 15px;
    border: 2px solid var(--neon-green);
    border-radius: 5px;
}

.ball-value {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.5rem;
    color: var(--neon-yellow);
    text-shadow: 
        0 0 10px var(--neon-yellow),
        0 0 20px var(--neon-yellow);
}

.multiplier-display {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--neon-purple);
    text-shadow: 0 0 10px var(--neon-purple);
}

#multiplier {
    font-weight: 900;
    color: var(--neon-yellow);
    text-shadow: 0 0 15px var(--neon-yellow);
    animation: multiplierPulse 0.5s ease-in-out infinite;
}

@keyframes multiplierPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ===== PLAYFIELD ===== */
.playfield-container {
    position: relative;
    width: 100%;
    border: 6px solid;
    border-image: linear-gradient(90deg, var(--neon-purple), var(--neon-cyan), var(--neon-purple)) 1;
    border-radius: 5px 5px 20px 20px;
    box-shadow: 
        0 0 40px var(--neon-cyan),
        inset 0 0 60px rgba(0, 255, 255, 0.1);
    background: linear-gradient(180deg, #0a0020 0%, #15003a 100%);
    overflow: hidden;
    animation: borderGradient 3s linear infinite;
    background-clip: padding-box;
}

@keyframes borderGradient {
    0% {
        border-image: linear-gradient(90deg, var(--neon-purple), var(--neon-cyan), var(--neon-purple)) 1;
    }
    25% {
        border-image: linear-gradient(180deg, var(--neon-purple), var(--neon-cyan), var(--neon-purple)) 1;
    }
    50% {
        border-image: linear-gradient(270deg, var(--neon-purple), var(--neon-cyan), var(--neon-purple)) 1;
    }
    75% {
        border-image: linear-gradient(360deg, var(--neon-purple), var(--neon-cyan), var(--neon-purple)) 1;
    }
    100% {
        border-image: linear-gradient(450deg, var(--neon-purple), var(--neon-cyan), var(--neon-purple)) 1;
    }
}

#pinballCanvas {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    background: transparent;
}

.neon-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: 
        radial-gradient(circle at 30% 20%, rgba(255, 0, 255, 0.1) 0%, transparent 30%),
        radial-gradient(circle at 70% 30%, rgba(0, 255, 255, 0.1) 0%, transparent 25%),
        radial-gradient(circle at 50% 70%, rgba(255, 255, 0, 0.05) 0%, transparent 40%);
}

/* ===== CONTROLS INFO ===== */
.controls-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 15px;
    padding: 15px;
    background: rgba(20, 0, 40, 0.8);
    border: 2px solid var(--neon-purple);
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(153, 0, 255, 0.5);
}

.control-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.key {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    padding: 8px 12px;
    background: linear-gradient(180deg, #333 0%, #111 100%);
    color: var(--neon-cyan);
    border: 2px solid var(--neon-cyan);
    border-radius: 5px;
    box-shadow: 
        0 4px 0 #000,
        0 0 10px var(--neon-cyan);
}

.action {
    font-size: 0.65rem;
    color: var(--neon-pink);
    text-shadow: 0 0 5px var(--neon-pink);
}

/* ===== GAME MESSAGE OVERLAY ===== */
.game-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 0, 15, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 500;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.game-message.hidden {
    opacity: 0;
    pointer-events: none;
}

.message-content {
    text-align: center;
    animation: messageFloat 3s ease-in-out infinite;
}

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

.message-content h2 {
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(2rem, 6vw, 4rem);
    color: var(--neon-yellow);
    text-shadow: 
        0 0 10px rgba(255, 255, 0, 0.8),
        0 0 20px rgba(255, 255, 0, 0.6),
        0 0 30px rgba(255, 200, 0, 0.4);
    margin-bottom: 30px;
    animation: softYellowGlow 3s ease-in-out infinite;
}

.message-content p {
    font-size: 1rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
    margin-bottom: 20px;
}

.blink-text {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem;
    color: var(--neon-yellow);
    text-shadow: 0 0 20px var(--neon-yellow);
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 500px) {
    .controls-info {
        gap: 10px;
    }
    
    .control-item {
        flex: 1 1 40%;
    }
    
    .score-panel {
        gap: 10px;
    }
}

/* ===== GRID BACKGROUND EFFECT ===== */
body::after {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: 
        linear-gradient(transparent 0%, rgba(255, 0, 255, 0.1) 100%),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 50px,
            rgba(255, 0, 255, 0.03) 50px,
            rgba(255, 0, 255, 0.03) 51px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 50px,
            rgba(0, 255, 255, 0.03) 50px,
            rgba(0, 255, 255, 0.03) 51px
        );
    perspective: 500px;
    transform: rotateX(60deg);
    transform-origin: center bottom;
    pointer-events: none;
    z-index: -1;
}
