/* ========================================================
   NEON CONNECT 4 — Stylesheet
   Theme: Cyan #00f7ff, Pink #ff2bd6, Board Blue #0f1c3f
======================================================== */

: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 65%),
        var(--dark);
    background-attachment: fixed;
    overflow-x: hidden;
    position: relative;
    padding-bottom: 30px;
}

/* Background Animated Orbs */
.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(--pink);
    top: -80px;
    left: -80px;
}
.bg-glow-2 {
    width: 420px;
    height: 420px;
    background: var(--cyan);
    bottom: -100px;
    right: -100px;
}

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

/* Header */
.c4-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;
}

.c4-title h1 {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-align: center;
}
.c4-title h1 span {
    color: var(--pink);
}

.c4-controls-top {
    display: flex;
    gap: 8px;
}
.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(--pink);
    color: var(--pink);
}
.mini-btn svg {
    width: 18px;
    height: 18px;
}

/* Mode & Turn Status 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);
}
.turn-indicator {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.disc-sample {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
}
.disc-p1 {
    background: var(--cyan);
    box-shadow: 0 0 10px var(--cyan);
}
.disc-p2 {
    background: var(--pink);
    box-shadow: 0 0 10px var(--pink);
}

/* Score Tracker */
.scoreboard {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 10px 16px;
}
.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.4rem;
    font-weight: 900;
}
.score-p1 strong { color: var(--cyan); }
.score-p2 strong { color: var(--pink); }
.score-ties strong { color: #ffffff; }

/* The Connect 4 Board */
.c4-board-wrap {
    background: linear-gradient(145deg, #0f1c3f, #09132b);
    border: 2px solid rgba(0, 247, 255, 0.4);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 247, 255, 0.15);
    border-radius: 20px;
    padding: 16px;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

/* Drop Column Indicators */
.drop-zone {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}
.col-selector-btn {
    background: transparent;
    border: none;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    transition: all 0.2s ease;
    border-radius: 8px;
}
.col-selector-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--cyan);
    transform: translateY(2px);
}
.col-selector-btn svg {
    width: 22px;
    height: 22px;
}

/* The Grid (7 columns x 6 rows) */
.c4-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 10px;
    aspect-ratio: 7 / 6;
    max-width: 600px;
    margin: 0 auto;
}

.c4-cell {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #050816;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.8);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s ease;
}
.c4-cell:hover {
    border-color: rgba(0, 247, 255, 0.5);
}

.c4-cell.player1 {
    background: radial-gradient(circle at 35% 35%, #99f6ff, var(--cyan) 60%, #0099aa);
    box-shadow: 0 0 16px rgba(0, 247, 255, 0.8), inset 0 2px 4px rgba(255, 255, 255, 0.7);
    border-color: var(--cyan);
    animation: dropBounce 0.35s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.c4-cell.player2 {
    background: radial-gradient(circle at 35% 35%, #ff9beb, var(--pink) 60%, #b80093);
    box-shadow: 0 0 16px rgba(255, 43, 214, 0.8), inset 0 2px 4px rgba(255, 255, 255, 0.7);
    border-color: var(--pink);
    animation: dropBounce 0.35s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.c4-cell.win-highlight {
    animation: pulseWin 0.8s ease-in-out infinite alternate !important;
}

@keyframes dropBounce {
    0% { transform: translateY(-80px) scale(0.9); opacity: 0.5; }
    70% { transform: translateY(4px) scale(1.05); }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes pulseWin {
    0% { transform: scale(1); filter: brightness(1); }
    100% { transform: scale(1.12); filter: brightness(1.4) drop-shadow(0 0 12px #fff); }
}

/* Action Controls */
.game-actions-bar {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 22px;
}
.c4-action-btn {
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}
.btn-reset {
    background: linear-gradient(135deg, var(--cyan), #0284c7);
    color: #050816;
    box-shadow: 0 4px 16px rgba(0, 247, 255, 0.3);
}
.btn-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 247, 255, 0.5);
}

/* Victory Banner Modal */
.victory-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(5, 8, 22, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.victory-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.victory-modal {
    background: var(--card-bg);
    border: 2px solid var(--cyan);
    border-radius: 20px;
    padding: 32px 28px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 0 40px rgba(0, 247, 255, 0.35);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.victory-modal-overlay.active .victory-modal {
    transform: scale(1);
}
.victory-modal h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-weight: 900;
}
.victory-modal p {
    color: var(--muted);
    font-size: 1rem;
    margin-bottom: 24px;
}
