/* Neon Pacman Arcade Styles */

:root {
    --neon-blue: #0ff;
    --neon-pink: #ff00ff;
    --neon-yellow: #ffea00;
    --neon-green: #39ff14;
    --neon-red: #ff3333;
    --bg-dark: #050510;
    --grid-color: rgba(0, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

body {
    background-color: var(--bg-dark);
    color: white;
    /* Removed overflow: hidden so users can scroll down to read SEO content */
}

#game-wrapper {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #111122 0%, var(--bg-dark) 100%);
    background-image: 
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 30px 30px;
    background-position: center center;
}

#canvas-container {
    position: relative;
    box-shadow: 0 0 20px var(--neon-blue), inset 0 0 20px var(--neon-blue);
    border: 2px solid var(--neon-blue);
    border-radius: 8px;
    overflow: hidden;
    background-color: #000;
}

canvas {
    display: block;
    max-width: 100vw;
    /* Maintain aspect ratio 560/620 = 0.903 */
    max-height: calc(100vh - 120px); 
    object-fit: contain;
}

/* Touch controls overlay for mobile */
.touch-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: none; /* Blocked by JS on desktop, flex on mobile */
}

@media (pointer: coarse) {
    .touch-controls {
        display: block;
    }
}

/* UI Overlays */
#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through */
    z-index: 20;
}

.scoreboard-compact {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 40px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 25px;
    border-radius: 30px;
    border: 1px solid var(--neon-blue);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    z-index: 30;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-box .label {
    font-size: 0.7rem;
    color: #888;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.stat-box .val {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--neon-yellow);
    text-shadow: 0 0 5px var(--neon-yellow);
    font-family: monospace;
}

.stat-box.right .val {
    color: var(--neon-pink);
    text-shadow: 0 0 5px var(--neon-pink);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 10, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: auto; /* Catch clicks */
    z-index: 40;
}

.overlay.hidden {
    display: none;
}

.neon-box {
    background: rgba(5, 5, 15, 0.9);
    padding: 40px;
    border-radius: 15px;
    border: 2px solid var(--neon-blue);
    box-shadow: 0 0 15px var(--neon-blue), inset 0 0 15px rgba(0,255,255,0.2);
    text-align: center;
    max-width: 90%;
    width: 450px;
}

.neon-text {
    font-size: 2.8rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 
        0 0 5px #fff,
        0 0 10px var(--neon-blue),
        0 0 20px var(--neon-blue),
        0 0 40px var(--neon-blue);
    margin-bottom: 5px;
    text-transform: uppercase;
    font-style: italic;
    letter-spacing: 2px;
}

.neon-text.red {
    text-shadow: 
        0 0 5px #fff,
        0 0 10px var(--neon-red),
        0 0 20px var(--neon-red),
        0 0 40px var(--neon-red);
}

.neon-text.green {
    text-shadow: 
        0 0 5px #fff,
        0 0 10px var(--neon-green),
        0 0 20px var(--neon-green),
        0 0 40px var(--neon-green);
}

.pmg-btn.neon-btn {
    background: transparent;
    color: var(--neon-blue);
    border: 2px solid var(--neon-blue);
    box-shadow: 0 0 10px var(--neon-blue), inset 0 0 10px rgba(0,255,255,0.2);
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 15px;
    width: 100%;
}

.pmg-btn.neon-btn:hover {
    background: var(--neon-blue);
    color: #000;
    box-shadow: 0 0 20px var(--neon-blue), inset 0 0 10px #fff;
}

.instructions-box {
    margin-top: 25px;
    background: rgba(255,255,255,0.05);
    padding: 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #aaa;
    text-align: left;
    border-left: 3px solid var(--neon-pink);
}

.instructions-box p {
    margin-bottom: 8px;
}
.instructions-box p:last-child {
    margin-bottom: 0;
}

.back-link {
    display: block;
    margin-top: 20px;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 1;
    text-shadow: 0 0 5px #fff;
}

.back-button-corner {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10000;
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 700;
    background: rgba(0,0,0,0.6);
    border: 1px solid var(--neon-blue);
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: 0 0 8px rgba(0,255,255,0.3);
    transition: all 0.2s;
}

.back-button-corner:hover {
    background: rgba(0,255,255,0.2);
    box-shadow: 0 0 12px rgba(0,255,255,0.6);
}

/* Info Section (bottom) */
.game-description {
    font-family: 'Segoe UI', sans-serif;
}
.game-description h1 {
    font-weight: 800;
}
.game-description h2 {
    font-weight: 700;
    margin-bottom: 15px;
}
.game-description p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 15px;
}
