/*
 * LANERS.CA - User-selectable theme tokens and theme-specific visual effects.
 * Applied via html[data-theme="..."] set from the user's profile preference.
 */

/* Fallback / anonymous pages — Amber DOS default */
:root,
html[data-theme="amber-monitor"] {
    --bg-primary: #1a0f00;
    --bg-secondary: #2a1800;
    --bg-card: #331f00;
    --bg-hover: #3d2500;
    --text-primary: #ffb000;
    --text-secondary: #cc8800;
    --text-muted: #996600;
    --accent-primary: #ffb000;
    --accent-primary-dim: #cc8800;
    --accent-secondary: #ff8800;
    --accent-secondary-dim: #cc6600;
    --success: #ccff00;
    --warning: #ffcc00;
    --danger: #ff4400;
    --glow-primary: 0 0 20px rgba(255, 176, 0, 0.35);
    --glow-secondary: 0 0 20px rgba(255, 136, 0, 0.3);
    --glow-logo-from: 0 0 30px rgba(255, 176, 0, 0.3);
    --glow-logo-to: 0 0 60px rgba(255, 176, 0, 0.5);
    --glow-hover: 0 10px 30px rgba(255, 176, 0, 0.45);
    --shadow-card: 0 4px 16px rgba(255, 176, 0, 0.1);
    --border-subtle: rgba(255, 176, 0, 0.25);
    --border-faint: rgba(255, 176, 0, 0.12);
    --border-focus: rgba(255, 176, 0, 0.35);
    --font-display: 'Share Tech Mono', monospace;
    --font-body: 'Share Tech Mono', monospace;
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --btn-text: #1a0f00;
}

html[data-theme="crt-green"] {
    --bg-primary: #0a0f0a;
    --bg-secondary: #0d140d;
    --bg-card: #111a11;
    --bg-hover: #152015;
    --text-primary: #33ff66;
    --text-secondary: #22cc55;
    --text-muted: #1a9944;
    --accent-primary: #33ff66;
    --accent-primary-dim: #22aa44;
    --accent-secondary: #88ffaa;
    --accent-secondary-dim: #55cc77;
    --success: #33ff66;
    --warning: #aaff00;
    --danger: #ff3333;
    --glow-primary: 0 0 15px rgba(51, 255, 102, 0.4);
    --glow-secondary: 0 0 15px rgba(136, 255, 170, 0.3);
    --glow-logo-from: 0 0 20px rgba(51, 255, 102, 0.35);
    --glow-logo-to: 0 0 40px rgba(51, 255, 102, 0.55);
    --glow-hover: 0 10px 25px rgba(51, 255, 102, 0.45);
    --shadow-card: 0 0 10px rgba(51, 255, 102, 0.1);
    --border-subtle: rgba(51, 255, 102, 0.25);
    --border-faint: rgba(51, 255, 102, 0.12);
    --border-focus: rgba(51, 255, 102, 0.4);
    --font-display: 'VT323', monospace;
    --font-body: 'Share Tech Mono', monospace;
    --radius-sm: 0;
    --radius-md: 0;
    --radius-lg: 0;
    --radius-xl: 0;
    --btn-text: #0a0f0a;
}

html[data-theme="win95-lan"] {
    --bg-primary: #008080;
    --bg-secondary: #c0c0c0;
    --bg-card: #dfdfdf;
    --bg-hover: #ececec;
    --text-primary: #000000;
    --text-secondary: #333333;
    --text-muted: #666666;
    --accent-primary: #000080;
    --accent-primary-dim: #000060;
    --accent-secondary: #800000;
    --accent-secondary-dim: #600000;
    --success: #008000;
    --warning: #808000;
    --danger: #ff0000;
    --glow-primary: none;
    --glow-secondary: none;
    --glow-logo-from: 2px 2px 0 #808080;
    --glow-logo-to: 2px 2px 0 #808080;
    --glow-hover: none;
    --shadow-card: none;
    --border-subtle: #808080;
    --border-faint: #808080;
    --border-focus: #000080;
    --font-display: Tahoma, 'Segoe UI', sans-serif;
    --font-body: Tahoma, 'Segoe UI', sans-serif;
    --radius-sm: 0;
    --radius-md: 0;
    --radius-lg: 0;
    --radius-xl: 0;
    --btn-text: #000000;
}

html[data-theme="corn-field-day"] {
    --bg-primary: #f5f0e1;
    --bg-secondary: #e8dfc8;
    --bg-card: #fffdf7;
    --bg-hover: #f0e8d0;
    --text-primary: #2c2416;
    --text-secondary: #5c4a32;
    --text-muted: #8a7555;
    --accent-primary: #d4a017;
    --accent-primary-dim: #b8860b;
    --accent-secondary: #3d7a37;
    --accent-secondary-dim: #2d5a28;
    --success: #3d7a37;
    --warning: #e6a817;
    --danger: #c0392b;
    --glow-primary: 0 2px 12px rgba(212, 160, 23, 0.25);
    --glow-secondary: 0 2px 12px rgba(61, 122, 55, 0.2);
    --glow-logo-from: 0 4px 16px rgba(44, 36, 22, 0.12);
    --glow-logo-to: 0 8px 24px rgba(44, 36, 22, 0.18);
    --glow-hover: 0 8px 20px rgba(212, 160, 23, 0.3);
    --shadow-card: 0 4px 16px rgba(44, 36, 22, 0.08);
    --border-subtle: rgba(212, 160, 23, 0.35);
    --border-faint: rgba(212, 160, 23, 0.2);
    --border-focus: rgba(212, 160, 23, 0.5);
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --btn-text: #fffdf7;
}

html[data-theme="lcars"] {
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-card: #1a1a24;
    --bg-hover: #222230;
    --text-primary: #f0f0ff;
    --text-secondary: #99ccff;
    --text-muted: #8888aa;
    --accent-primary: #ff9900;
    --accent-primary-dim: #cc7700;
    --accent-secondary: #99ccff;
    --accent-secondary-dim: #6699cc;
    --success: #99cc66;
    --warning: #ffcc66;
    --danger: #cc6666;
    --glow-primary: 0 0 20px rgba(255, 153, 0, 0.25);
    --glow-secondary: 0 0 20px rgba(153, 204, 255, 0.2);
    --glow-logo-from: 0 0 24px rgba(255, 153, 0, 0.3);
    --glow-logo-to: 0 0 40px rgba(153, 204, 255, 0.35);
    --glow-hover: 0 8px 28px rgba(255, 153, 0, 0.35);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.45);
    --border-subtle: rgba(255, 153, 0, 0.35);
    --border-faint: rgba(153, 204, 255, 0.15);
    --border-focus: rgba(255, 153, 0, 0.55);
    --font-display: 'Antonio', sans-serif;
    --font-body: 'Inter', sans-serif;
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-xl: 40px;
    --btn-text: #0a0a0f;
}

/* Amber DOS — warm monitor vignette */
html[data-theme="amber-monitor"] body {
    background: var(--bg-primary);
}

html[data-theme="amber-monitor"] body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.45) 100%);
}

/* CRT Phosphor — scanlines and glow */
html[data-theme="crt-green"] body {
    text-shadow: 0 0 8px rgba(51, 255, 102, 0.35);
}

html[data-theme="crt-green"] body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.12) 2px,
        rgba(0, 0, 0, 0.12) 4px
    );
}

/* Win95 — beveled controls */
html[data-theme="win95-lan"] .main-nav,
html[data-theme="win95-lan"] .main-footer {
    border-width: 2px;
    border-style: solid;
}

html[data-theme="win95-lan"] .dashboard-card,
html[data-theme="win95-lan"] .event-card,
html[data-theme="win95-lan"] .archive-card,
html[data-theme="win95-lan"] .game-card,
html[data-theme="win95-lan"] .profile-card,
html[data-theme="win95-lan"] .admin-card,
html[data-theme="win95-lan"] .form-input,
html[data-theme="win95-lan"] .btn {
    border-radius: 0;
    box-shadow: none;
}

html[data-theme="win95-lan"] .dashboard-card,
html[data-theme="win95-lan"] .event-card,
html[data-theme="win95-lan"] .archive-card,
html[data-theme="win95-lan"] .game-card,
html[data-theme="win95-lan"] .profile-card,
html[data-theme="win95-lan"] .admin-card {
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
}

html[data-theme="win95-lan"] .btn-primary {
    background: #c0c0c0;
    color: #000;
    border: 2px solid;
    border-color: #ffffff #000000 #000000 #ffffff;
    box-shadow: none;
}

html[data-theme="win95-lan"] .btn-secondary {
    background: #c0c0c0;
    color: #000;
    border: 2px solid;
    border-color: #ffffff #000000 #000000 #ffffff;
}

html[data-theme="win95-lan"] .form-input {
    border: 2px inset #808080;
    background: #fff;
    color: #000;
}

/* LCARS — pill bars and colored section caps */
html[data-theme="lcars"] .main-nav,
html[data-theme="lcars"] .main-footer {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    border-bottom: none;
}

html[data-theme="lcars"] .main-footer {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-top: none;
}

html[data-theme="lcars"] .btn {
    border-radius: var(--radius-md);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

html[data-theme="lcars"] .btn-primary {
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-primary-dim));
}

html[data-theme="lcars"] .btn-secondary {
    background: linear-gradient(90deg, var(--accent-secondary-dim), var(--accent-secondary));
    color: var(--btn-text);
    border-color: transparent;
}

html[data-theme="lcars"] .page-header h1,
html[data-theme="lcars"] .dashboard-card h2,
html[data-theme="lcars"] .profile-card h2 {
    position: relative;
    padding-left: 1rem;
}

html[data-theme="lcars"] .page-header h1::before,
html[data-theme="lcars"] .dashboard-card h2::before,
html[data-theme="lcars"] .profile-card h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    border-radius: var(--radius-sm);
    background: var(--accent-primary);
}

html[data-theme="lcars"] .dashboard-card h2::before {
    background: var(--accent-secondary);
}

html[data-theme="lcars"] .nav-link-admin {
    color: var(--accent-primary);
}

/* Profile theme picker */
.theme-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.theme-option {
    position: relative;
    cursor: pointer;
}

.theme-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-option-card {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border: 2px solid var(--border-faint);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    transition: border-color 0.15s, box-shadow 0.15s;
    height: 100%;
}

.theme-option input:checked + .theme-option-card {
    border-color: var(--accent-primary);
    box-shadow: var(--glow-primary);
}

.theme-option input:focus-visible + .theme-option-card {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.theme-option-name {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.theme-option-swatches {
    display: flex;
    gap: 0.35rem;
}

.theme-option-swatches span {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-faint);
}
