:root {
    --bg-color: #050505;
    --text-color: #f8fafc;
    --neon-blue: #0ea5e9;
    --neon-pink: #ec4899;
    --neon-yellow: #facc15;
    --neon-green: #22c55e;
    --canvas-border: #1e1b4b;
    --font-stack: 'Exo 2', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
}

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

body {
    font-family: var(--font-stack);
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
    -webkit-tap-highlight-color: transparent;
    /* Dark grid background */
    background-image:
        linear-gradient(rgba(14, 165, 233, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(14, 165, 233, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
}

.page-container {
    max-width: 500px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

/* Header */
.seo-header {
    text-align: center;
    width: 100%;
    padding: 10px;
}

.seo-header h1 {
    font-size: 1.8rem;
    color: var(--neon-pink);
    text-shadow: 0 0 10px rgba(236, 72, 153, 0.5);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.seo-header p {
    font-size: 0.9rem;
    color: #94a3b8;
    line-height: 1.5;
}

.seo-header strong {
    color: var(--neon-blue);
}

/* Game Interface */
.game-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f172a;
    border: 2px solid var(--neon-blue);
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.2), inset 0 0 10px rgba(14, 165, 233, 0.2);
}

.score-container,
.balls-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.score-container span:first-child,
.balls-container span:first-child {
    font-size: 0.8rem;
    color: var(--neon-pink);
    letter-spacing: 2px;
    font-weight: 900;
}

#score {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: #fff;
    text-shadow: 0 0 5px #fff, 0 0 10px var(--neon-blue);
    letter-spacing: 2px;
}

#balls-display {
    font-size: 1.2rem;
    letter-spacing: 4px;
}

/* Canvas Area */
.canvas-container {
    width: 100%;
    aspect-ratio: 9/16;
    /* Pinball tables are tall */
    position: relative;
    overflow: hidden;
    background: #020617;
    border: 3px solid #312e81;
    /* Default frame */
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(236, 72, 153, 0.1);
    touch-action: none;
}

/* We will let Matter.js create the canvas inside the container */
.canvas-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Touch controls for mobile */
.touch-zone-left,
.touch-zone-right,
.launch-zone {
    position: absolute;
    bottom: 0;
    height: 100%;
    z-index: 5;
    /* Above canvas, below overlays */
}

.touch-zone-left {
    left: 0;
    width: 50%;
}

.touch-zone-right {
    right: 0;
    width: 50%;
}

/* Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: opacity 0.3s;
}

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

.overlay-content {
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid var(--neon-pink);
    padding: 30px 20px;
    border-radius: 12px;
    text-align: center;
    width: 85%;
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.3), inset 0 0 15px rgba(236, 72, 153, 0.2);
}

.overlay-content.transparent {
    background: transparent;
    border: none;
    box-shadow: none;
}

.neon-text {
    font-family: var(--font-mono);
    font-size: 2.2rem;
    color: #fff;
    text-shadow: 0 0 5px #fff, 0 0 15px var(--neon-yellow), 0 0 25px var(--neon-yellow);
    margin-bottom: 25px;
    letter-spacing: 1px;
}

.neon-text.danger {
    text-shadow: 0 0 5px #fff, 0 0 15px #ef4444, 0 0 25px #ef4444;
}

.controls-list {
    text-align: left;
    color: #cbd5e1;
    font-size: 0.9rem;
    margin-bottom: 25px;
    line-height: 1.6;
    padding-left: 10px;
}

.controls-list li {
    margin-bottom: 8px;
}

.controls-list strong {
    color: var(--neon-blue);
}

.final-score-text {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 25px;
}

#final-score {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    color: var(--neon-blue);
    display: block;
    margin-top: 10px;
    text-shadow: 0 0 10px rgba(14, 165, 233, 0.5);
}

.blink {
    color: var(--neon-green);
    font-size: 1.5rem;
    text-shadow: 0 0 10px var(--neon-green);
    animation: blinker 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes blinker {
    50% {
        opacity: 0;
    }
}

.neon-btn {
    background: #0f172a;
    border: 2px solid;
    color: #fff;
    padding: 15px 0;
    width: 100%;
    font-family: var(--font-stack);
    font-weight: 900;
    font-size: 1.1rem;
    letter-spacing: 1px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.ready-btn {
    border-color: var(--neon-green);
    color: var(--neon-green);
    box-shadow: inset 0 0 10px rgba(34, 197, 94, 0.2), 0 0 10px rgba(34, 197, 94, 0.2);
}

.ready-btn:hover,
.ready-btn:active {
    background: var(--neon-green);
    color: #000;
    box-shadow: 0 0 20px var(--neon-green);
}

.restart-btn {
    border-color: var(--neon-blue);
    color: var(--neon-blue);
    box-shadow: inset 0 0 10px rgba(14, 165, 233, 0.2), 0 0 10px rgba(14, 165, 233, 0.2);
}

.restart-btn:hover,
.restart-btn:active {
    background: var(--neon-blue);
    color: #000;
    box-shadow: 0 0 20px var(--neon-blue);
}

/* Article & SEO Area */
.seo-article {
    background: #0f172a;
    padding: 25px;
    width: 100%;
    border-radius: 12px;
    border: 1px solid #1e293b;
    color: #94a3b8;
    line-height: 1.7;
}

.seo-article h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-color);
}

.seo-article ul {
    list-style-position: inside;
}

.seo-article li {
    margin-bottom: 15px;
}

.seo-article ul ul {
    margin-top: 5px;
    margin-left: 20px;
    list-style-type: circle;
}

.seo-article strong {
    color: var(--neon-pink);
}

.back-link {
    margin-bottom: 40px;
    width: 100%;
    text-align: center;
}

.back-link a {
    color: var(--neon-blue);
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    padding: 10px 20px;
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 30px;
    display: inline-block;
    transition: all 0.2s;
}

.back-link a:hover {
    background: rgba(14, 165, 233, 0.1);
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.5);
    color: #fff;
}