/* ============================================================
   WORLD WARDLE — Design System
   Visual Language: "Connected Flow"

   A calm, premium, modern design system for a global
   asynchronous word puzzle competition platform.

   Inspired by: Linear, Notion, Apple system UI
   Identity: connected nodes, quiet intelligence, global motion
   ============================================================ */


/* ============================================================
   1. DESIGN TOKENS (CSS Custom Properties)
   ============================================================ */

:root {
    /* ----------------------------------------------------------
       BACKGROUND LAYERS

       Dark palette built on deep navy-slate. Not pure black —
       the blue undertone conveys depth and connection.
       950 is the canvas, 800 is cards, 700 is elevated/hover.
       ---------------------------------------------------------- */
    --bg-950: #090d16;      /* page canvas — deepest layer */
    --bg-900: #0e1321;      /* main content backdrop */
    --bg-800: #151b2e;      /* card surfaces, panels */
    --bg-700: #1c2540;      /* elevated: hover, active cards */
    --bg-600: #253052;      /* pressed states, selected items */

    /* ----------------------------------------------------------
       TEXT HIERARCHY

       Cool gray-blue tones. Strong for headings, default for
       body, soft for secondary info, muted for disabled/hints.
       ---------------------------------------------------------- */
    --text-strong: #e8ecf4;  /* headings, primary content */
    --text-default: #b0b8cc; /* body text, readable on dark */
    --text-soft: #6b7a94;    /* meta, captions, timestamps */
    --text-muted: #3d4a5e;   /* disabled, placeholders */

    /* ----------------------------------------------------------
       ACCENT: PRIMARY (Blue)

       Actions, links, primary buttons, focus rings.
       The workhorse accent — trustworthy, clear, versatile.
       ---------------------------------------------------------- */
    --accent-blue: #3b82f6;
    --accent-blue-hover: #5b9aff;
    --accent-blue-muted: rgba(59, 130, 246, 0.15);
    --accent-blue-subtle: rgba(59, 130, 246, 0.08);

    /* ----------------------------------------------------------
       ACCENT: TEAL (Success / Connection)

       Active states, live data, connected players, success.
       The "pulse" of the system — things that are alive/flowing.
       ---------------------------------------------------------- */
    --accent-teal: #14b8a6;
    --accent-teal-hover: #2dd4bf;
    --accent-teal-muted: rgba(20, 184, 166, 0.15);
    --accent-teal-subtle: rgba(20, 184, 166, 0.08);

    /* ----------------------------------------------------------
       ACCENT: VIOLET (Highlight / Premium)

       Achievements, featured content, tournaments, prestige.
       Used sparingly to mark things that matter.
       ---------------------------------------------------------- */
    --accent-violet: #8b5cf6;
    --accent-violet-hover: #a78bfa;
    --accent-violet-muted: rgba(139, 92, 246, 0.15);
    --accent-violet-subtle: rgba(139, 92, 246, 0.08);

    /* ----------------------------------------------------------
       PODIUM COLORS (Medals)

       Gold / Silver / Bronze for competitive rankings.
       Warm tones that stand out against the cool palette.
       ---------------------------------------------------------- */
    --medal-gold: #f5c542;
    --medal-gold-muted: rgba(245, 197, 66, 0.15);
    --medal-silver: #94a3b8;
    --medal-silver-muted: rgba(148, 163, 184, 0.12);
    --medal-bronze: #d97706;
    --medal-bronze-muted: rgba(217, 119, 6, 0.12);

    /* ----------------------------------------------------------
       SEMANTIC COLORS
       ---------------------------------------------------------- */
    --color-win: #22c55e;
    --color-loss: #ef4444;
    --color-tie: #94a3b8;
    --color-bye: #6b7a94;

    /* ----------------------------------------------------------
       BORDERS

       Translucent white borders create depth without hard lines.
       Subtle for cards, default for dividers, strong for focus.
       ---------------------------------------------------------- */
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-default: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --border-accent: var(--accent-blue);

    /* ----------------------------------------------------------
       SURFACES

       Card background, overlay, and glass-effect values.
       ---------------------------------------------------------- */
    --card-bg: var(--bg-800);
    --card-bg-hover: var(--bg-700);
    --card-border: var(--border-default);
    --overlay-bg: rgba(9, 13, 22, 0.7);

    /* ----------------------------------------------------------
       GLOW + LIGHT EFFECTS

       Subtle luminance for the "Connected Flow" identity.
       Soft = ambient, strong = interactive/focus, pulse = live.
       Never sci-fi — think moonlight on water.
       ---------------------------------------------------------- */
    --glow-blue-soft: 0 0 20px rgba(59, 130, 246, 0.10);
    --glow-blue-strong: 0 0 30px rgba(59, 130, 246, 0.20);
    --glow-teal-soft: 0 0 20px rgba(20, 184, 166, 0.10);
    --glow-teal-strong: 0 0 30px rgba(20, 184, 166, 0.20);
    --glow-violet-soft: 0 0 20px rgba(139, 92, 246, 0.10);
    --glow-violet-strong: 0 0 30px rgba(139, 92, 246, 0.20);
    --glow-gold-soft: 0 0 20px rgba(245, 197, 66, 0.12);

    /* ----------------------------------------------------------
       ELEVATION (Box Shadows)

       Layered shadows for depth. Subtle — no heavy drop shadows.
       ---------------------------------------------------------- */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-glow: var(--glow-blue-soft);

    /* ----------------------------------------------------------
       BORDER RADIUS

       Rounded but not bubbly. Modern, consistent.
       ---------------------------------------------------------- */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* ----------------------------------------------------------
       SPACING SCALE (4px base)
       ---------------------------------------------------------- */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* ----------------------------------------------------------
       TRANSITIONS
       ---------------------------------------------------------- */
    --transition-fast: 120ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 350ms ease;

    /* ----------------------------------------------------------
       TYPOGRAPHY

       Inter for UI clarity. System fallbacks for performance.
       Slightly warm letter-spacing, modern weights.
       ---------------------------------------------------------- */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;

    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.65;

    --tracking-tight: -0.02em;
    --tracking-normal: -0.01em;
    --tracking-wide: 0.04em;

    /* ----------------------------------------------------------
       NETWORK / CONNECTION LINES

       For the world map, connection visuals, flow indicators.
       ---------------------------------------------------------- */
    --line-network: rgba(59, 130, 246, 0.12);
    --line-network-active: rgba(20, 184, 166, 0.25);
    --line-network-pulse: rgba(20, 184, 166, 0.40);
}


/* ============================================================
   2. BASE RESET & BODY
   ============================================================ */

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

body.ww-theme {
    background-color: var(--bg-950);
    color: var(--text-default);
    font-family: var(--font-sans);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    letter-spacing: var(--tracking-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle radial gradient on the page background for depth */
body.ww-theme::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60vh;
    background: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(59, 130, 246, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body.ww-theme > * {
    position: relative;
    z-index: 1;
}


/* ============================================================
   3. TYPOGRAPHY SYSTEM
   ============================================================ */

/* Display — Hero headlines, promo banners */
.ww-display {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--text-strong);
}

/* Heading 1 — Page titles, section headers */
.ww-h1 {
    font-size: 1.75rem;
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--text-strong);
}

/* Heading 2 — Card titles, panel headers */
.ww-h2 {
    font-size: 1.25rem;
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    letter-spacing: var(--tracking-normal);
    color: var(--text-strong);
}

/* Heading 3 — Subsections, list group titles */
.ww-h3 {
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--text-strong);
}

/* Body — Standard content */
.ww-body {
    font-size: 0.9375rem;
    line-height: var(--line-height-relaxed);
    color: var(--text-default);
}

/* Meta — Timestamps, labels, captions */
.ww-meta {
    font-size: 0.8125rem;
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-normal);
    letter-spacing: var(--tracking-wide);
    color: var(--text-soft);
    text-transform: uppercase;
}

/* Stat — Large numbers (scores, countdowns, player counts) */
.ww-stat {
    font-size: 2rem;
    font-weight: var(--font-weight-bold);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: var(--text-strong);
}

.ww-stat-sm {
    font-size: 1.5rem;
}

.ww-stat-lg {
    font-size: 2.75rem;
}

/* Mono — Wordle numbers, countdown timers */
.ww-mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}


/* ============================================================
   4. SURFACE + DEPTH SYSTEM
   ============================================================ */

/* --- Cards --- */

.ww-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    transition: border-color var(--transition-base),
                box-shadow var(--transition-base);
}

.ww-card:hover {
    border-color: var(--border-strong);
}

/* Elevated card — interactive items, clickable panels */
.ww-card-elevated {
    box-shadow: var(--shadow-md);
}

.ww-card-elevated:hover {
    box-shadow: var(--shadow-lg);
}

/* Glass card — subtle frosted effect for overlays */
.ww-card-glass {
    background: rgba(21, 27, 46, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
}

/* Card with glow accent (for featured/live content) */
.ww-card-glow {
    box-shadow: var(--glow-teal-soft);
    border-color: rgba(20, 184, 166, 0.15);
}

.ww-card-glow:hover {
    box-shadow: var(--glow-teal-strong);
    border-color: rgba(20, 184, 166, 0.25);
}

/* Card header bar */
.ww-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: var(--space-4);
    margin-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
}

/* Compact card variant */
.ww-card-compact {
    padding: var(--space-4);
}


/* --- Sections --- */

.ww-section {
    margin-bottom: var(--space-12);
}

.ww-section-header {
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}


/* ============================================================
   5. GLOW + ACCENT SYSTEM

   Glow is used sparingly to indicate:
   - Live/active state (teal glow)
   - Interactive focus (blue glow)
   - Achievement/prestige (violet glow)
   - Ranking (gold glow)

   Rules:
   - Max 1-2 glowing elements per viewport
   - Glow should be ambient, not attention-grabbing
   - Never animate glow continuously (only on state change)
   ============================================================ */

/* Pulse animation — for live indicators only */
@keyframes ww-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Live dot — indicates active/running state */
.ww-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--accent-teal);
    box-shadow: var(--glow-teal-soft);
    animation: ww-pulse 2s ease-in-out infinite;
}

/* Glow ring — wraps around avatars or nodes for emphasis */
.ww-glow-ring {
    box-shadow: 0 0 0 2px var(--bg-800), var(--glow-teal-strong);
}

/* Accent line — horizontal divider with subtle glow */
.ww-accent-line {
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--accent-teal) 20%,
        var(--accent-blue) 80%,
        transparent
    );
    opacity: 0.2;
    border: none;
}

/* Node highlight — for player nodes on maps or grids */
.ww-node {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--accent-teal);
    box-shadow: var(--glow-teal-soft);
}

.ww-node-active {
    background: var(--accent-teal);
    box-shadow: var(--glow-teal-strong);
}


/* ============================================================
   6. BASE COMPONENT STYLES
   ============================================================ */

/* --- Buttons --- */

.ww-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-5);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.ww-btn:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* Primary — main actions */
.ww-btn-primary {
    background: var(--accent-blue);
    color: #fff;
    border-color: var(--accent-blue);
}

.ww-btn-primary:hover {
    background: var(--accent-blue-hover);
    border-color: var(--accent-blue-hover);
    box-shadow: var(--glow-blue-soft);
    color: #fff;
}

.ww-btn-primary:active {
    background: #2563eb;
}

/* Secondary — less prominent actions */
.ww-btn-secondary {
    background: transparent;
    color: var(--text-default);
    border-color: var(--border-strong);
}

.ww-btn-secondary:hover {
    background: var(--bg-700);
    color: var(--text-strong);
    border-color: var(--border-strong);
}

.ww-btn-secondary:active {
    background: var(--bg-600);
}

/* Ghost — minimal presence, nav-like */
.ww-btn-ghost {
    background: transparent;
    color: var(--text-soft);
    border-color: transparent;
}

.ww-btn-ghost:hover {
    color: var(--text-strong);
    background: var(--bg-700);
}

/* Small variant */
.ww-btn-sm {
    padding: var(--space-1) var(--space-3);
    font-size: 0.8125rem;
}


/* --- Tags / Labels / Badges --- */

.ww-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 2px var(--space-2);
    font-size: 0.75rem;
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    border-radius: var(--radius-xs);
    line-height: 1.5;
}

.ww-tag-blue {
    background: var(--accent-blue-muted);
    color: var(--accent-blue);
}

.ww-tag-teal {
    background: var(--accent-teal-muted);
    color: var(--accent-teal);
}

.ww-tag-violet {
    background: var(--accent-violet-muted);
    color: var(--accent-violet);
}

.ww-tag-win {
    background: rgba(34, 197, 94, 0.15);
    color: var(--color-win);
}

.ww-tag-loss {
    background: rgba(239, 68, 68, 0.12);
    color: var(--color-loss);
}

.ww-tag-tie {
    background: rgba(148, 163, 184, 0.12);
    color: var(--color-tie);
}


/* --- Avatar / Player Node --- */

.ww-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--border-default);
    transition: border-color var(--transition-fast);
}

.ww-avatar:hover {
    border-color: var(--accent-teal);
}

.ww-avatar-sm {
    width: 24px;
    height: 24px;
}

.ww-avatar-lg {
    width: 48px;
    height: 48px;
}

/* Avatar with podium ring */
.ww-avatar-gold {
    border-color: var(--medal-gold);
    box-shadow: var(--glow-gold-soft);
}

.ww-avatar-silver {
    border-color: var(--medal-silver);
}

.ww-avatar-bronze {
    border-color: var(--medal-bronze);
}


/* --- List Rows --- */

.ww-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
}

.ww-row:hover {
    background: var(--bg-700);
}

.ww-row + .ww-row {
    border-top: 1px solid var(--border-subtle);
}

/* Clickable row variant */
.ww-row-link {
    cursor: pointer;
}

.ww-row-link:hover {
    background: var(--bg-700);
}


/* --- Podium Rows (Leaderboard) --- */

.ww-podium-1 {
    background: var(--medal-gold-muted);
    border-left: 3px solid var(--medal-gold);
}

.ww-podium-2 {
    background: var(--medal-silver-muted);
    border-left: 3px solid var(--medal-silver);
}

.ww-podium-3 {
    background: var(--medal-bronze-muted);
    border-left: 3px solid var(--medal-bronze);
}


/* --- Tables --- */

.ww-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.ww-table thead th {
    font-size: 0.6875rem;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--text-soft);
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--border-default);
    text-align: left;
}

.ww-table tbody td {
    padding: var(--space-3);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-default);
    vertical-align: middle;
}

.ww-table tbody tr {
    transition: background-color var(--transition-fast);
}

.ww-table tbody tr:hover {
    background: var(--bg-700);
}


/* --- Dividers --- */

.ww-divider {
    height: 1px;
    background: var(--border-subtle);
    border: none;
    margin: var(--space-6) 0;
}


/* --- Tabs --- */

.ww-tabs {
    display: flex;
    gap: var(--space-1);
    border-bottom: 1px solid var(--border-default);
    padding-bottom: 0;
}

.ww-tab {
    padding: var(--space-2) var(--space-4);
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    color: var(--text-soft);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color var(--transition-fast),
                border-color var(--transition-fast);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    margin-bottom: -1px;
}

.ww-tab:hover {
    color: var(--text-strong);
}

.ww-tab.active,
.ww-tab-active {
    color: var(--text-strong);
    border-bottom-color: var(--accent-blue);
}


/* --- Countdown / Timer Display --- */

.ww-countdown {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
    font-variant-numeric: tabular-nums;
    color: var(--text-strong);
    letter-spacing: 0.02em;
}

.ww-countdown-sm {
    font-size: 1rem;
}

.ww-countdown-label {
    font-size: 0.75rem;
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--text-soft);
    margin-top: var(--space-1);
}


/* --- Navbar (World Wardle themed) --- */

.ww-navbar {
    background: var(--bg-900);
    border-bottom: 1px solid var(--border-default);
    padding: 0 var(--space-6);
    height: 56px;
    display: flex;
    align-items: center;
}

.ww-navbar-brand {
    font-size: 1.125rem;
    font-weight: var(--font-weight-bold);
    color: var(--text-strong);
    text-decoration: none;
    letter-spacing: var(--tracking-tight);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.ww-navbar-brand:hover {
    color: inherit;
}

.ww-nav-link {
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    color: var(--text-soft);
    text-decoration: none;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast),
                background-color var(--transition-fast);
}

.ww-nav-link:hover {
    color: var(--text-strong);
    background: var(--bg-700);
}

.ww-nav-link.active {
    color: var(--text-strong);
    background: var(--bg-700);
}


/* --- Hero / Promo Area --- */

.ww-hero {
    background: var(--bg-800);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-12) var(--space-8);
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Subtle gradient sweep behind hero content */
.ww-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 140%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 50%, var(--accent-blue-subtle), transparent 60%),
                radial-gradient(ellipse at 70% 50%, var(--accent-teal-subtle), transparent 60%);
    pointer-events: none;
}

.ww-hero > * {
    position: relative;
}

.ww-hero-title {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: var(--font-weight-bold);
    color: var(--text-strong);
    letter-spacing: var(--tracking-tight);
    margin-bottom: var(--space-3);
}

.ww-hero-subtitle {
    font-size: 1.0625rem;
    color: var(--text-soft);
    max-width: 540px;
    margin: 0 auto var(--space-6);
    line-height: var(--line-height-relaxed);
}


/* --- Wordle Number Cards (status indicators) --- */

.ww-wordle-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    text-align: center;
    transition: border-color var(--transition-base),
                box-shadow var(--transition-base);
}

.ww-wordle-card:hover {
    border-color: var(--border-strong);
}

.ww-wordle-number {
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: var(--font-weight-bold);
    color: var(--text-strong);
    line-height: 1;
}

.ww-wordle-players {
    font-size: 0.9375rem;
    font-weight: var(--font-weight-semibold);
    color: var(--accent-teal);
    margin-top: var(--space-2);
}

.ww-wordle-status {
    font-size: 0.75rem;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    margin-top: var(--space-2);
}


/* --- Footer --- */

.ww-footer {
    border-top: 1px solid var(--border-default);
    padding: var(--space-6) var(--space-8);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8125rem;
}


/* ============================================================
   7. UTILITY CLASSES
   ============================================================ */

.ww-text-strong { color: var(--text-strong); }
.ww-text-default { color: var(--text-default); }
.ww-text-soft { color: var(--text-soft); }
.ww-text-muted { color: var(--text-muted); }
.ww-text-blue { color: var(--accent-blue); }
.ww-text-teal { color: var(--accent-teal); }
.ww-text-violet { color: var(--accent-violet); }
.ww-text-win { color: var(--color-win); }
.ww-text-loss { color: var(--color-loss); }
.ww-text-gold { color: var(--medal-gold); }

.ww-bg-800 { background-color: var(--bg-800); }
.ww-bg-700 { background-color: var(--bg-700); }

.ww-border-subtle { border-color: var(--border-subtle); }

/* Tabular nums for any numeric display */
.ww-tabular { font-variant-numeric: tabular-nums; }


/* ============================================================
   8. SEASON THEMING

   Seasons override accent colors via inline CSS custom properties
   set on body.ww-theme from the season.theme JSONB.

   --season-primary and --season-secondary are set inline.
   These cascade into the season-specific elements below.
   The base accent-blue/teal/violet remain for non-seasonal UI.
   ============================================================ */

/* Season tag in navbar */
.ww-season-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 2px var(--space-2);
    font-size: 0.75rem;
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    border-radius: var(--radius-xs);
    line-height: 1.5;
    color: var(--season-primary, var(--accent-violet));
    background: var(--season-bg-accent, var(--accent-violet-muted));
}

.ww-season-tag i {
    font-size: 0.6875rem;
}

/* Season accent overrides — applied when --season-primary is set */
.ww-hero::before {
    background: radial-gradient(ellipse at 30% 50%, var(--season-bg-accent, var(--accent-blue-subtle)), transparent 60%),
                radial-gradient(ellipse at 70% 50%, var(--season-bg-accent, var(--accent-teal-subtle)), transparent 60%);
}

/* Season-colored glow for the live dot */
body.ww-theme .ww-live-dot {
    background: var(--season-primary, var(--accent-teal));
    box-shadow: 0 0 20px color-mix(in srgb, var(--season-primary, var(--accent-teal)) 20%, transparent);
}

/* Season accent line gradient */
body.ww-theme .ww-accent-line {
    background: linear-gradient(
        90deg,
        transparent,
        var(--season-primary, var(--accent-teal)) 20%,
        var(--season-secondary, var(--accent-blue)) 80%,
        transparent
    );
    opacity: 0.2;
}


/* ============================================================
   9. RESPONSIVE ADJUSTMENTS
   ============================================================ */

@media (max-width: 768px) {
    .ww-display {
        font-size: 1.75rem;
    }

    .ww-h1 {
        font-size: 1.375rem;
    }

    .ww-stat {
        font-size: 1.5rem;
    }

    .ww-card {
        padding: var(--space-4);
    }

    .ww-hero {
        padding: var(--space-8) var(--space-4);
    }

    .ww-navbar {
        padding: 0 var(--space-3);
    }
}

@media (max-width: 480px) {
    .ww-stat {
        font-size: 1.25rem;
    }

    .ww-countdown {
        font-size: 1.125rem;
    }

    .ww-card {
        padding: var(--space-3);
        border-radius: var(--radius-md);
    }

    .ww-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ww-tab {
        white-space: nowrap;
        font-size: 0.8125rem;
    }
}


/* ============================================================
   9. BOOTSTRAP OVERRIDES (for ww-theme pages)

   These override Bootstrap/Flatly defaults when the ww-theme
   class is applied to body. This allows admin pages to keep
   their existing Flatly styling untouched.
   ============================================================ */

body.ww-theme .container-fluid,
body.ww-theme .container {
    color: var(--text-default);
}

/* Override Bootstrap card within ww-theme */
body.ww-theme .card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-default);
}

body.ww-theme .card-header {
    background: var(--bg-700);
    border-bottom: 1px solid var(--border-default);
    color: var(--text-strong);
}

body.ww-theme .card-body {
    color: var(--text-default);
}

/* Override Bootstrap table within ww-theme */
body.ww-theme .table {
    color: var(--text-default);
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--bg-700);
    --bs-table-border-color: var(--border-subtle);
}

body.ww-theme .table thead th {
    color: var(--text-soft);
    border-bottom-color: var(--border-default);
}

/* Override Bootstrap nav-tabs within ww-theme */
body.ww-theme .nav-tabs {
    border-bottom-color: var(--border-default);
}

body.ww-theme .nav-tabs .nav-link {
    color: var(--text-soft);
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: var(--space-2) var(--space-4);
    font-weight: var(--font-weight-medium);
    font-size: 0.875rem;
    transition: color var(--transition-fast),
                border-color var(--transition-fast);
}

body.ww-theme .nav-tabs .nav-link:hover {
    color: var(--text-strong);
    border-bottom-color: var(--border-strong);
}

body.ww-theme .nav-tabs .nav-link.active {
    color: var(--text-strong);
    background: transparent;
    border-bottom-color: var(--accent-blue);
}

/* Override Bootstrap buttons within ww-theme */
body.ww-theme .btn-primary {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

body.ww-theme .btn-primary:hover {
    background: var(--accent-blue-hover);
    border-color: var(--accent-blue-hover);
}

body.ww-theme .btn-outline-secondary {
    color: var(--text-default);
    border-color: var(--border-strong);
}

body.ww-theme .btn-outline-secondary:hover {
    background: var(--bg-700);
    color: var(--text-strong);
    border-color: var(--border-strong);
}

/* Override form controls within ww-theme */
body.ww-theme .form-control,
body.ww-theme .form-select {
    background-color: var(--bg-700);
    border-color: var(--border-default);
    color: var(--text-strong);
}

body.ww-theme .form-control:focus,
body.ww-theme .form-select:focus {
    background-color: var(--bg-700);
    border-color: var(--accent-blue);
    box-shadow: var(--glow-blue-soft);
    color: var(--text-strong);
}

body.ww-theme .form-control::placeholder {
    color: var(--text-muted);
}

/* Override badges within ww-theme */
body.ww-theme .badge {
    font-weight: var(--font-weight-semibold);
    font-size: 0.6875rem;
    letter-spacing: var(--tracking-wide);
}

/* Links */
body.ww-theme a {
    color: var(--accent-blue);
}

body.ww-theme a.ww-btn {
    color: inherit;
}

body.ww-theme a.ww-btn-primary {
    color: #fff;
}

body.ww-theme a:hover {
    color: var(--accent-blue-hover);
}

/* Text muted override */
body.ww-theme .text-muted {
    color: var(--text-soft) !important;
}
