/* ========================================================
   NEON CYBER PONG — Stylesheet
   Theme: Cyan #00f7ff, Pink #ff2bd6, Dark #050816
======================================================== */

:root {
    --cyan:        #00f7ff;
    --pink:        #ff2bd6;
    --purple:      #8b5cf6;
    --yellow:      #ffd700;
    --dark:        #050816;
    --text:        #ffffff;
    --card-bg:     rgba(13, 20, 44, 0.75);
    --card-border: rgba(255, 255, 255, 0.15);
    --muted:       #94a3b8;
}

body.light-theme {
    --dark:        #edf7ff;
    --text:        #0f172a;
    --card-bg:     rgba(255, 255, 255, 0.85);
    --card-border: rgba(15, 23, 42, 0.15);
    --muted:       #475569;
}

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

body {
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 20% 20%, #172554 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, #4c1d95 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, #0d1430 0%, transparent 70%),
        var(--dark);
    background-attachment: fixed;
    overflow-x: hidden;
    position: relative;
    padding-bottom: 30px;
}

.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
}
.bg-glow-1 {
    width: 380px;
    height: 380px;
    background: var(--cyan);
    top: -80px;
    left: -80px;
}
.bg-glow-2 {
    width: 420px;
    height: 420px;
    background: var(--pink);
    bottom: -100px;
    right: -100px;
}

.pong-container {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* Header */
.pong-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 14px 20px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    margin-bottom: 20px;
}
.nav-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--cyan);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 10px;
    background: rgba(0, 247, 255, 0.1);
    border: 1px solid rgba(0, 247, 255, 0.3);
    transition: all 0.2s ease;
}
.nav-back-link:hover {
    background: rgba(0, 247, 255, 0.22);
    box-shadow: 0 0 14px rgba(0, 247, 255, 0.3);
    transform: translateX(-3px);
}
.nav-back-link svg {
    width: 18px;
    height: 18px;
}

.pong-title h1 {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-align: center;
}
.pong-title h1 span {
    background: linear-gradient(135deg, var(--cyan), var(--pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mini-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.mini-btn:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}
.mini-btn svg {
    width: 18px;
    height: 18px;
}

/* Control & Mode Bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(14px);
    padding: 12px 18px;
    border-radius: 14px;
    margin-bottom: 20px;
}
.mode-selectors {
    display: flex;
    gap: 8px;
}
.mode-btn {
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s ease;
}
.mode-btn.active {
    background: linear-gradient(135deg, var(--cyan), #0284c7);
    color: #050816;
    border-color: var(--cyan);
    box-shadow: 0 0 12px rgba(0, 247, 255, 0.4);
}

/* Score Panel */
.pong-scoreboard {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 12px 18px;
    margin-bottom: 20px;
}
.score-box {
    text-align: center;
}
.score-box span {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    display: block;
    margin-bottom: 2px;
}
.score-box strong {
    font-size: 1.8rem;
    font-weight: 900;
}
.score-p1 strong { color: var(--cyan); }
.score-p2 strong { color: var(--pink); }

/* Canvas Stage */
.canvas-wrap {
    position: relative;
    background: #030614;
    border: 2px solid rgba(0, 247, 255, 0.4);
    border-radius: 20px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 35px rgba(0, 247, 255, 0.15);
    overflow: hidden;
    margin: 0 auto 20px;
    width: 100%;
    max-width: 680px;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}
#pongCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Overlay Start/Pause */
.canvas-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(5, 8, 22, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.canvas-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.canvas-overlay h2 {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 8px;
    color: #ffffff;
}
.canvas-overlay p {
    color: var(--muted);
    font-size: 0.95rem;
    max-width: 440px;
    margin-bottom: 22px;
}
.overlay-btn {
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--cyan), #0284c7);
    color: #050816;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0, 247, 255, 0.4);
    transition: all 0.2s ease;
}
.overlay-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 247, 255, 0.6);
}

/* Mobile Controls */
.mobile-controls {
    display: none;
    justify-content: space-between;
    gap: 16px;
    margin-top: 14px;
    user-select: none;
    -webkit-user-select: none;
}
@media (pointer: coarse), (max-width: 700px) {
    .mobile-controls {
        display: flex;
    }
}
.touch-btn-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}
.touch-btn {
    height: 54px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    touch-action: manipulation;
    transition: all 0.15s ease;
}
.touch-btn:active {
    background: rgba(0, 247, 255, 0.25);
    border-color: var(--cyan);
    transform: scale(0.95);
}
.touch-btn.pink:active {
    background: rgba(255, 43, 214, 0.25);
    border-color: var(--pink);
}
