@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap');

:root {
    --bg-dark: #0b0f19;
    --panel-bg: #1e293b;
    --border-slate: rgba(255, 255, 255, 0.08);
    --p1-color: #6366f1;
    --p2-color: #06b6d4;
    --p3-color: #10b981;
    --p4-color: #f59e0b;
    --p5-color: #ec4899;
    --p6-color: #a855f7;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: #f8fafc;
    min-height: 100vh;
    overflow-x: hidden;
    touch-action: manipulation;
}

/* Background Grid Pattern */
.bg-grid {
    background-size: 40px 40px;
    background-image: linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

/* Glowing Background Blobs */
@keyframes pulseGlow {
    0%, 100% { opacity: 0.35; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.08); }
}

.animate-glow {
    animation: pulseGlow 6s ease-in-out infinite;
}

/* Glassmorphism Components */
.glass-panel {
    background: rgba(30, 41, 59, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-slate);
}

.glass-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-slate);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

/* Universal Fixed Grid Arena Container & Square Cells */
.fixed-grid-container {
    width: 320px !important;
    height: 320px !important;
    max-width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    margin: 0 auto !important;
    flex-shrink: 0 !important;
}

.grid-cell-square {
    aspect-ratio: 1 / 1 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    touch-action: manipulation;
}

/* Sleek Option Pill Buttons */
.pill-option-btn {
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-slate);
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pill-option-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}

.pill-option-btn.active {
    background: rgba(99, 102, 241, 0.25);
    border-color: #6366f1;
    color: #818cf8;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

/* Color Swatch Picker */
.color-swatch-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.color-swatch-btn:hover {
    transform: scale(1.15);
}

.color-swatch-btn.selected {
    border-color: #ffffff;
    box-shadow: 0 0 12px currentColor;
    transform: scale(1.15);
}

/* Symbol Selection Grid */
.symbol-option-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-slate);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.25rem;
    color: #94a3b8;
}

.symbol-option-btn:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}

.symbol-option-btn.selected {
    background: rgba(99, 102, 241, 0.25);
    border-color: #6366f1;
    color: #818cf8;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

.symbol-option-btn.disabled {
    opacity: 0.2;
    cursor: not-allowed;
    border-color: transparent;
    pointer-events: none;
}

/* SVG Line & Board Styles for Dots & Boxes */
svg.dots-board {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.line-hitbox { cursor: pointer; touch-action: manipulation; }
.line-hitbox:hover + .line-active {
    stroke-opacity: 0.6 !important;
    stroke: #38bdf8 !important;
}

/* Connect Four Column Wrapper & Discs */
.connect4-column {
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    touch-action: manipulation;
    padding: 2px;
    border-radius: 16px;
    transition: background 0.15s ease;
}

.connect4-column:hover {
    background: rgba(255, 255, 255, 0.05);
}

.disc-slot {
    aspect-ratio: 1 / 1 !important;
    width: 100%;
    height: 100%;
    background: #0f172a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.6);
}

.disc-item {
    width: 88%;
    height: 88%;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translateY(-120%);
}

.disc-item.dropped { transform: translateY(0); }

/* Orb Explosion Pulse Animations */
.orb-pulse {
    animation: orbPulse 1.4s infinite alternate ease-in-out;
}

@keyframes orbPulse {
    from { transform: scale(0.85); }
    to { transform: scale(1.15); }
}

/* Custom Scrollbars */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 4px; }
