/**
 * Online Football Squares - Main Stylesheet
 * Design: Bold, Professional, Approachable
 */

/* ============================================
   CSS Variables & Theme
   ============================================ */

:root {
    /* Colors - Light Theme (Default) */
    --bg: #fafafa;
    --bg-alt: #f1f5f9;
    --surface: #ffffff;
    --surface-hover: #f8fafc;
    --text: #1a1a2e;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* Brand Colors */
    --primary: #0f172a;
    --primary-hover: #1e293b;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.2);
    
    /* Status Colors */
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    --info: #0ea5e9;
    --info-bg: rgba(14, 165, 233, 0.1);
    
    /* Winner Colors */
    --winner-q1: #22c55e;
    --winner-q2: #3b82f6;
    --winner-q3: #f59e0b;
    --winner-final: #a855f7;
    
    /* Typography */
    --font-display: 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Space Mono', ui-monospace, monospace;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg: #0f172a;
    --bg-alt: #1e293b;
    --surface: #1e293b;
    --surface-hover: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    --border: #334155;
    --border-light: #1e293b;
    
    --primary: #f1f5f9;
    --primary-hover: #e2e8f0;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ============================================
   Reset & Base
   ============================================ */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-display);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-light);
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   Layout
   ============================================ */

.container {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

@media (min-width: 640px) {
    .container {
        padding: 0 var(--space-lg);
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 var(--space-xl);
    }
}

/* ============================================
   Navigation
   ============================================ */

.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: var(--space-md) var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(250, 250, 250, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .site-nav {
    background: rgba(15, 23, 42, 0.9);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.03em;
    color: var(--text);
    text-decoration: none;
}

.logo:hover {
    color: var(--text);
}

.logo-mark {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .logo-mark {
    background: var(--accent);
}

.logo-mark::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(90deg, transparent 48%, var(--accent) 48%, var(--accent) 52%, transparent 52%),
        linear-gradient(0deg, transparent 48%, var(--accent) 48%, var(--accent) 52%, transparent 52%);
}

[data-theme="dark"] .logo-mark::before {
    background: 
        linear-gradient(90deg, transparent 48%, var(--primary) 48%, var(--primary) 52%, transparent 52%),
        linear-gradient(0deg, transparent 48%, var(--primary) 48%, var(--primary) 52%, transparent 52%);
}

.nav-links {
    display: flex;
    gap: var(--space-lg);
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.nav-links a:hover {
    color: var(--text);
}

.nav-links .btn {
    margin-left: var(--space-sm);
}

@media (max-width: 768px) {
    .site-nav {
        padding: var(--space-sm) var(--space-md);
    }
    
    .logo {
        font-size: 1rem;
    }
    
    .logo-mark {
        width: 32px;
        height: 32px;
    }
    
    /* Thicker crosshairs on mobile for visibility */
    .logo-mark::before {
        background: 
            linear-gradient(90deg, transparent 45%, var(--accent) 45%, var(--accent) 55%, transparent 55%),
            linear-gradient(0deg, transparent 45%, var(--accent) 45%, var(--accent) 55%, transparent 55%);
    }
    
    [data-theme="dark"] .logo-mark::before {
        background: 
            linear-gradient(90deg, transparent 45%, var(--primary) 45%, var(--primary) 55%, transparent 55%),
            linear-gradient(0deg, transparent 45%, var(--primary) 45%, var(--primary) 55%, transparent 55%);
    }
    
    .nav-links a:not(.btn) {
        display: none;
    }
    
    .nav-links {
        gap: var(--space-sm);
    }
    
    .nav-links .btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .site-nav {
        padding: 8px 12px;
    }
    
    .logo {
        font-size: 0.85rem;
        gap: 6px;
        white-space: nowrap;
    }
    
    .logo-mark {
        width: 28px;
        height: 28px;
    }
    
    .nav-links {
        gap: 6px;
    }
    
    .nav-links .btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    
    /* Hide secondary button on very small screens */
    .nav-links .btn-secondary {
        display: none;
    }
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.85rem 1.75rem;
    border-radius: var(--radius-lg);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

[data-theme="dark"] .btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

[data-theme="dark"] .btn-primary:hover {
    background: var(--accent-light);
    color: white;
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--text);
    color: var(--text);
}

.btn-outline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

.btn-accent {
    background: var(--accent);
    color: white;
}

.btn-accent:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 10px 40px var(--accent-glow);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    color: white;
}

/* ============================================
   Cards
   ============================================ */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--transition-normal);
}

.card-hover:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    letter-spacing: -0.01em;
}

.card-text {
    color: var(--text-muted);
    line-height: 1.65;
    font-size: 0.95rem;
}

/* ============================================
   Forms
   ============================================ */

.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.form-input::placeholder {
    color: var(--text-light);
}

.form-hint {
    margin-top: var(--space-xs);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 0.9rem;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--accent);
}

/* ============================================
   Alerts
   ============================================ */

.alert {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    font-size: 0.95rem;
}

.alert-success {
    background: var(--success-bg);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-error {
    background: var(--error-bg);
    border: 1px solid var(--error);
    color: var(--error);
}

.alert-warning {
    background: var(--warning-bg);
    border: 1px solid var(--warning);
    color: #92400e;
}

.alert-info {
    background: var(--info-bg);
    border: 1px solid var(--info);
    color: var(--info);
}

/* ============================================
   Badges
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: #92400e;
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

.badge-gray {
    background: var(--bg-alt);
    color: var(--text-muted);
}

/* ============================================
   Utilities
   ============================================ */

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }

.mt-1 { margin-top: var(--space-md); }
.mt-2 { margin-top: var(--space-lg); }
.mt-3 { margin-top: var(--space-xl); }
.mb-1 { margin-bottom: var(--space-md); }
.mb-2 { margin-bottom: var(--space-lg); }
.mb-3 { margin-bottom: var(--space-xl); }

.hidden { display: none !important; }

.flex { display: flex; }
.gap-1 { gap: var(--space-md); }
.gap-2 { gap: var(--space-lg); }

/* ============================================
   Footer
   ============================================ */

.site-footer {
    margin-top: var(--space-3xl);
    padding: var(--space-2xl) 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr 2fr;
    }
}

.footer-brand a {
    color: var(--text);
    text-decoration: none;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 700;
    font-size: 1.1rem;
}

.footer-logo .logo-mark {
    width: 28px;
    height: 28px;
}

.footer-tagline {
    margin-top: var(--space-sm);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: var(--space-2xl);
}

.footer-col h4 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.footer-col a {
    display: block;
    color: var(--text);
    font-size: 0.9rem;
    padding: var(--space-xs) 0;
    transition: color var(--transition-fast);
}

.footer-col a:hover {
    color: var(--accent);
}

.footer-bottom {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.footer-copy {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-actions {
    display: flex;
    gap: var(--space-sm);
}

.footer-btn {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.footer-btn:hover {
    background: var(--surface-hover);
    color: var(--text);
}

/* Theme toggle icons */
[data-theme="light"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: none; }

/* ============================================
   Homepage Hero
   ============================================ */

.hero {
    padding: 6rem 0 4rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
    align-items: start;
}

@media (min-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.hero-content {
    max-width: 560px;
}

.trust-badges {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.trust-badge svg {
    width: 18px;
    height: 18px;
    color: var(--success);
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin-bottom: var(--space-lg);
    color: var(--text);
}

@media (min-width: 640px) {
    .hero h1 {
        font-size: 3.75rem;
    }
}

.highlight {
    position: relative;
    display: inline-block;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    height: 12px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    opacity: 0.3;
    z-index: -1;
    border-radius: 4px;
}

.hero-text {
    font-size: 1.15rem;
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: var(--space-xl);
}

.hero-actions {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: var(--space-md);
}

.hero-actions-secondary {
    margin-bottom: var(--space-xl);
}

.hero-note {
    font-size: 0.9rem;
    color: var(--text-muted);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
}

/* Hero Grid Preview */
.hero-visual {
    position: relative;
}

@media (max-width: 1023px) {
    .hero-visual {
        max-width: 500px;
        margin: 0 auto;
    }
}

.grid-preview {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    box-shadow: var(--shadow-lg);
}

.grid-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.preview-game-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}

.preview-game-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.preview-score {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.team-score {
    text-align: center;
}

.team-score .name {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.team-score .points {
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
}

.score-separator {
    font-size: 1.25rem;
    color: var(--border);
    font-weight: 300;
}

.quarter-badge {
    padding: 0.4rem 0.8rem;
    background: var(--warning-bg);
    color: #92400e;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
}

/* Mini Preview Grid */
.preview-squares {
    display: grid;
    grid-template-columns: 28px repeat(10, 1fr);
    grid-template-rows: 28px repeat(10, 1fr);
    gap: 2px;
}

.preview-corner {
    background: transparent;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
}

.preview-header.col-header {
    color: var(--accent);
}

.preview-header.row-header {
    color: var(--text);
}

.preview-square {
    aspect-ratio: 1;
    background: var(--bg-alt);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.preview-square.taken {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

.preview-square.winner {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: white;
    border: none;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.preview-square.empty {
    background: repeating-linear-gradient(
        45deg,
        var(--bg),
        var(--bg) 4px,
        var(--bg-alt) 4px,
        var(--bg-alt) 8px
    );
    color: transparent;
}

/* Floating Cards */
.float-card {
    position: absolute;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    box-shadow: var(--shadow-lg);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.float-card.winner-card {
    top: -20px;
    right: -20px;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.winner-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.winner-info {
    display: flex;
    flex-direction: column;
}

.winner-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.winner-name {
    font-weight: 700;
    color: var(--text);
}

.float-card.live-card {
    bottom: 60px;
    left: -30px;
    animation-delay: -3s;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

.live-text {
    font-size: 0.85rem;
    font-weight: 600;
}

@media (max-width: 1023px) {
    .float-card {
        display: none;
    }
}

/* ============================================
   Sports Section
   ============================================ */

.sports-section {
    padding: var(--space-2xl) 0;
    background: var(--bg-alt);
}

.sports-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto var(--space-xl);
}

.sports-header h2 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-sm);
}

.sports-header p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
}

.sports-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    max-width: 900px;
    margin: 0 auto;
}

@media (min-width: 640px) {
    .sports-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 900px) {
    .sports-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.sport-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg) var(--space-md);
    text-align: center;
    transition: all var(--transition-normal);
}

.sport-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.sport-icon {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
}

.sport-name {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.sport-detail {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   Features Section
   ============================================ */

.features {
    padding: var(--space-3xl) 0;
}

.features-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto var(--space-2xl);
}

.features-header h2 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-md);
}

.features-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.7;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

@media (min-width: 640px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all var(--transition-normal);
}

.feature-card:hover {
    border-color: var(--accent);
    box-shadow: 0 20px 60px var(--accent-glow);
    transform: translateY(-4px);
}

.feature-icon {
    width: 56px;
    height: 56px;
    background: var(--info-bg);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: var(--space-lg);
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    letter-spacing: -0.01em;
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.65;
    font-size: 0.95rem;
}

/* ============================================
   CTA Section
   ============================================ */

.cta-section {
    background: var(--primary);
    margin: var(--space-2xl) var(--space-md);
    border-radius: var(--radius-xl);
    padding: var(--space-3xl) var(--space-xl);
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .cta-section {
    background: var(--accent);
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(129, 140, 248, 0.2) 0%, transparent 40%);
}

.cta-content {
    position: relative;
    z-index: 1;
}

.cta-section h2 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-md);
}

.cta-section p {
    font-size: 1.15rem;
    opacity: 0.9;
    margin-bottom: var(--space-xl);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.cta-section .btn {
    background: white;
    color: var(--primary);
    font-size: 1rem;
    padding: 1rem 2.5rem;
}

.cta-section .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 50px rgba(255, 255, 255, 0.2);
    color: var(--primary);
}

@media (min-width: 768px) {
    .cta-section {
        margin: var(--space-3xl);
    }
}

/* ============================================
   Join Game Section
   ============================================ */

.join-section {
    padding: var(--space-2xl) 0;
}

.join-card {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.join-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.share-box {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.share-box .form-input {
    flex: 1;
}

/* ============================================
   Game Page Styles
   ============================================ */

.game-header {
    padding-top: 5rem;
    margin-bottom: var(--space-lg);
}

.game-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.teams-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-bottom: var(--space-md);
}

.team-pill {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
}

.vs-badge {
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.game-info-row {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.game-info-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.game-status-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.status-pill {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.status-live {
    background: var(--success-bg);
    color: var(--success);
}

.status-final {
    background: var(--info-bg);
    color: var(--info);
}

.status-scheduled {
    background: var(--warning-bg);
    color: #92400e;
}

.status-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.game-cta {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
}

/* Custom Message */
.custom-message {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    font-size: 0.95rem;
    color: var(--text);
}

/* Admin Bar */
.admin-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    padding: var(--space-md);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

.admin-assign-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    padding: var(--space-md);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
}

/* Player Name Bar */
.player-name-bar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
}

.player-name-display {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.player-claim-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.player-name-input {
    display: flex;
    gap: var(--space-sm);
    flex: 1;
}

.player-name-input .form-input {
    flex: 1;
    max-width: 200px;
}

/* ============================================
   Squares Grid
   ============================================ */

.grid-wrapper {
    margin-bottom: var(--space-xl);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.grid-outer {
    display: inline-flex;
    flex-direction: column;
    min-width: 100%;
}

.grid-outer.size-xlarge {
    font-size: 14px;
}

.team-label {
    padding: 0.75rem 1rem;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
    text-align: center;
    border-radius: var(--radius-sm);
}

.team-label-top {
    margin-bottom: var(--space-sm);
    margin-left: 40px;
}

.team-label-left {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    margin-right: var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-with-label {
    display: flex;
}

.squares-grid {
    display: grid;
    grid-template-columns: 36px repeat(10, minmax(40px, 1fr));
    grid-template-rows: 36px repeat(10, minmax(40px, 1fr));
    gap: 2px;
    background: var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    padding: 2px;
}

.grid-corner {
    background: var(--bg);
}

.grid-header {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 700;
    background: var(--bg);
}

.grid-header.col-header {
    color: var(--accent);
}

.grid-header.row-header {
    color: var(--text);
}

.grid-header.not-assigned {
    color: var(--text-light);
}

.square {
    aspect-ratio: 1;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    min-width: 40px;
    min-height: 40px;
}

.square:hover {
    background: var(--surface-hover);
    transform: scale(1.02);
    z-index: 1;
}

.square.claimed {
    background: var(--bg-alt);
}

.square.locked {
    cursor: default;
}

.square.locked:hover {
    transform: none;
}

.player-name {
    font-size: 0.65rem;
    font-weight: 600;
    text-align: center;
    word-break: break-word;
    padding: 2px;
    color: var(--text);
    line-height: 1.2;
    max-height: 100%;
    overflow: hidden;
}

/* Winner Squares */
.square.winner {
    color: white;
    font-weight: 700;
}

.square.winner .player-name {
    color: white;
}

.square.winner-q1 { background: var(--winner-q1); }
.square.winner-q2 { background: var(--winner-q2); }
.square.winner-q3 { background: var(--winner-q3); }
.square.winner-final { background: var(--winner-final); }

.square.winner-current {
    animation: winnerPulse 2s infinite;
}

@keyframes winnerPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0); }
}

/* ============================================
   Scores Panel
   ============================================ */

.scores-panel {
    margin-bottom: var(--space-lg);
}

.scores-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
}

.score-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
}

.score-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.score-value {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.score-winner {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    margin-top: var(--space-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-box.winner-q1 { border-color: var(--winner-q1); background: rgba(34, 197, 94, 0.05); }
.score-box.winner-q2 { border-color: var(--winner-q2); background: rgba(59, 130, 246, 0.05); }
.score-box.winner-q3 { border-color: var(--winner-q3); background: rgba(245, 158, 11, 0.05); }
.score-box.winner-final { border-color: var(--winner-final); background: rgba(168, 85, 247, 0.05); }

/* ============================================
   Refresh Indicator
   ============================================ */

.page-refresh-bar {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.refresh-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.refresh-indicator.live {
    color: var(--success);
}

.score-delay-notice {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: var(--space-xs);
}

/* ============================================
   Leaderboard & Change Log
   ============================================ */

.leaderboard-list {
    max-height: 300px;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border);
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-rank {
    width: 24px;
    height: 24px;
    background: var(--bg-alt);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
}

.leaderboard-name {
    flex: 1;
    font-weight: 500;
}

.leaderboard-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Change Log */
.change-log {
    max-height: 250px;
    overflow-y: auto;
}

.log-entry {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    color: var(--text-light);
    font-size: 0.75rem;
    min-width: 60px;
}

.log-square {
    font-family: var(--font-mono);
    background: var(--bg-alt);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

.log-old {
    color: var(--error);
    text-decoration: line-through;
}

.log-new {
    color: var(--success);
    font-weight: 500;
}

/* ============================================
   Game Info Section
   ============================================ */

.game-info-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.game-info-section h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.game-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
}

.game-info-grid .game-info-item {
    display: flex;
    gap: var(--space-sm);
}

.game-info-grid .icon {
    font-size: 1.25rem;
}

.game-info-grid .details {
    flex: 1;
}

.game-info-grid .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.game-info-grid .value {
    font-weight: 600;
    color: var(--text);
}

/* ============================================
   Modals
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-md);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: var(--space-lg);
}

/* ============================================
   Details/Summary (Collapsible)
   ============================================ */

details.card {
    cursor: default;
}

details.card summary {
    cursor: pointer;
    user-select: none;
    list-style: none;
}

details.card summary::-webkit-details-marker {
    display: none;
}

details.card summary::before {
    content: '▸';
    margin-right: var(--space-sm);
    transition: transform var(--transition-fast);
}

details.card[open] summary::before {
    transform: rotate(90deg);
}

/* ============================================
   Player & Admin Guides
   ============================================ */

.guide-section {
    margin-bottom: var(--space-lg);
}

.guide-section h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.guide-section p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.guide-section ul {
    padding-left: var(--space-lg);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.guide-section li {
    margin-bottom: var(--space-xs);
}

/* ============================================
   Color Pickers (Settings)
   ============================================ */

.color-pickers {
    display: flex;
    gap: var(--space-lg);
}

.color-picker-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.color-picker-group input[type="color"] {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0;
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .site-nav,
    .site-footer,
    .admin-bar,
    .admin-assign-bar,
    .player-name-bar,
    .game-cta,
    .page-refresh-bar,
    .modal-overlay,
    details,
    .btn {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .squares-grid {
        border: 1px solid #000;
    }
    
    .square {
        border: 1px solid #ccc;
    }
}