/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-dark: #0d0d0d;
    --bg-card: #1a1a1a;
    --bg-card-hover: #222;
    --bg-input: #2a2a2a;
    --accent: #ff9000;
    --accent-hover: #ffb347;
    --accent-dark: #cc7300;
    --text: #e8e8e8;
    --text-muted: #888;
    --border: #333;
    --success: #4caf50;
    --danger: #f44336;
    --radius: 6px;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #07070a;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    position: relative;
}

/* === ATMOSPHERIC FX === */
.bg-fx {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* Crossfading slideshow — Light + Fury faction lineups */
.bg-slides { position: absolute; inset: 0; }
.bg-slides .slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 30%;
    background-repeat: no-repeat;
    animation: slideFade 20s infinite ease-in-out;
    will-change: opacity;
}
.bg-slides .slide-1 { background-image: url("/static/bg-light.jpg"); animation-delay: 0s; }
.bg-slides .slide-2 { background-image: url("/static/bg-fury.jpg"); animation-delay: -10s; }

@keyframes slideFade {
    0%   { opacity: 1; }
    45%  { opacity: 1; }
    50%  { opacity: 0; }
    95%  { opacity: 0; }
    100% { opacity: 1; }
}

/* Darkening + warm-glow overlay so text remains readable across all art */
.bg-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(8, 6, 12, 0.78) 0%, rgba(13, 8, 18, 0.88) 100%),
        radial-gradient(ellipse 70% 50% at 80% 0%, rgba(255, 90, 30, 0.10) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 10% 30%, rgba(120, 30, 180, 0.10) 0%, transparent 60%);
}

/* Subtle film grain — SVG noise as data URI */
.bg-grain {
    position: absolute;
    inset: -50%;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.4 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.15'/></svg>");
    opacity: 0.4;
    mix-blend-mode: overlay;
}

/* Lightning flicker — full-screen flash, fires every ~14s */
.lightning {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(220, 235, 255, 0.18) 0%, transparent 55%),
        linear-gradient(180deg, rgba(180, 200, 255, 0.10) 0%, transparent 30%);
    opacity: 0;
    animation: lightning 14s infinite;
    mix-blend-mode: screen;
}

@keyframes lightning {
    0%, 92%, 100%   { opacity: 0; }
    93%             { opacity: 0.9; }
    93.5%           { opacity: 0.2; }
    94%             { opacity: 0.7; }
    94.8%           { opacity: 0; }
}

/* Drifting embers — 25 dots animated upward at varied speeds/x positions */
.embers {
    position: absolute;
    inset: 0;
}
.embers span {
    position: absolute;
    bottom: -20px;
    width: 3px;
    height: 3px;
    background: radial-gradient(circle, rgba(255, 200, 100, 1) 0%, rgba(255, 144, 0, 0.6) 40%, transparent 70%);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(255, 144, 0, 0.8);
    opacity: 0;
    animation: emberRise linear infinite;
}

@keyframes emberRise {
    0%   { transform: translateY(0) translateX(0); opacity: 0; }
    10%  { opacity: 1; }
    50%  { transform: translateY(-50vh) translateX(20px); opacity: 0.8; }
    90%  { opacity: 0.4; }
    100% { transform: translateY(-110vh) translateX(-20px); opacity: 0; }
}

/* Stagger each ember: random left position, delay, duration, size */
.embers span:nth-child(1)  { left: 4%;  animation-duration: 14s; animation-delay: 0s;   }
.embers span:nth-child(2)  { left: 9%;  animation-duration: 18s; animation-delay: 2s;   transform: scale(1.4); }
.embers span:nth-child(3)  { left: 14%; animation-duration: 12s; animation-delay: 5s;   }
.embers span:nth-child(4)  { left: 19%; animation-duration: 22s; animation-delay: 1s;   transform: scale(0.7); }
.embers span:nth-child(5)  { left: 23%; animation-duration: 16s; animation-delay: 7s;   }
.embers span:nth-child(6)  { left: 28%; animation-duration: 20s; animation-delay: 3s;   transform: scale(1.2); }
.embers span:nth-child(7)  { left: 33%; animation-duration: 13s; animation-delay: 9s;   }
.embers span:nth-child(8)  { left: 38%; animation-duration: 17s; animation-delay: 0s;   transform: scale(0.9); }
.embers span:nth-child(9)  { left: 42%; animation-duration: 21s; animation-delay: 6s;   transform: scale(1.5); }
.embers span:nth-child(10) { left: 47%; animation-duration: 15s; animation-delay: 4s;   }
.embers span:nth-child(11) { left: 52%; animation-duration: 19s; animation-delay: 8s;   transform: scale(0.8); }
.embers span:nth-child(12) { left: 56%; animation-duration: 14s; animation-delay: 2s;   transform: scale(1.3); }
.embers span:nth-child(13) { left: 61%; animation-duration: 23s; animation-delay: 10s;  }
.embers span:nth-child(14) { left: 66%; animation-duration: 16s; animation-delay: 5s;   transform: scale(1.1); }
.embers span:nth-child(15) { left: 71%; animation-duration: 18s; animation-delay: 7s;   }
.embers span:nth-child(16) { left: 75%; animation-duration: 13s; animation-delay: 3s;   transform: scale(0.6); }
.embers span:nth-child(17) { left: 80%; animation-duration: 20s; animation-delay: 11s;  transform: scale(1.4); }
.embers span:nth-child(18) { left: 85%; animation-duration: 15s; animation-delay: 1s;   }
.embers span:nth-child(19) { left: 90%; animation-duration: 17s; animation-delay: 6s;   transform: scale(0.9); }
.embers span:nth-child(20) { left: 94%; animation-duration: 22s; animation-delay: 9s;   transform: scale(1.2); }
.embers span:nth-child(21) { left: 6%;  animation-duration: 16s; animation-delay: 4s;   transform: scale(0.8); }
.embers span:nth-child(22) { left: 30%; animation-duration: 19s; animation-delay: 12s;  }
.embers span:nth-child(23) { left: 60%; animation-duration: 14s; animation-delay: 0s;   transform: scale(1.3); }
.embers span:nth-child(24) { left: 78%; animation-duration: 21s; animation-delay: 8s;   }
.embers span:nth-child(25) { left: 50%; animation-duration: 18s; animation-delay: 13s;  transform: scale(1.5); }

/* Page content sits above the FX layer */
body > nav, body > section, body > .container, body > main, body > footer { position: relative; z-index: 1; }

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

/* === NAVBAR === */
.navbar {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--accent);
    box-shadow: 0 4px 24px rgba(255, 144, 0, 0.15), 0 1px 0 rgba(255, 144, 0, 0.3) inset;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0;
}

.navbar-brand .hub {
    background: linear-gradient(135deg, #ffb347 0%, var(--accent) 50%, #ff6a00 100%);
    color: #000;
    padding: 3px 10px;
    border-radius: 6px;
    margin-left: 6px;
    font-weight: 900;
    box-shadow: 0 2px 12px rgba(255, 144, 0, 0.5);
    letter-spacing: 1.5px;
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 0;
    align-items: center;
}

.navbar-nav a {
    color: var(--text);
    padding: 0 1rem;
    height: 60px;
    display: flex;
    align-items: center;
    font-weight: 500;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.navbar-nav a:hover,
.navbar-nav a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: rgba(255, 144, 0, 0.05);
}

.navbar-social {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-left: auto;
}

.navbar-social a {
    font-size: 1.3rem;
    transition: opacity 0.2s;
}

.navbar-social a:hover { opacity: 0.8; }

.navbar-social .fa-discord { color: #5865F2; }
.navbar-social .fa-youtube { color: #FF0000; }
.navbar-social .fa-facebook { color: #1877F2; }

/* Mobile menu */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 1.5rem;
    cursor: pointer;
}

/* === HERO === */
.hero {
    background:
        radial-gradient(ellipse 70% 80% at 50% 40%, rgba(255, 144, 0, 0.22) 0%, transparent 60%),
        radial-gradient(circle at 20% 80%, rgba(120, 30, 180, 0.20) 0%, transparent 55%),
        radial-gradient(circle at 80% 20%, rgba(255, 60, 0, 0.18) 0%, transparent 55%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, transparent 30%, transparent 70%, rgba(0, 0, 0, 0.6) 100%);
    border-bottom: 1px solid var(--accent);
    text-align: center;
    padding: 7rem 2rem 6rem;
    position: relative;
    overflow: hidden;
}

/* Rune corner ornaments on hero */
.hero > .corner {
    position: absolute;
    width: 90px;
    height: 90px;
    pointer-events: none;
    opacity: 0.6;
}
.hero > .corner.tl { top: 18px; left: 18px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.hero > .corner.tr { top: 18px; right: 18px; border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.hero > .corner.bl { bottom: 18px; left: 18px; border-bottom: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.hero > .corner.br { bottom: 18px; right: 18px; border-bottom: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.hero > .corner::before {
    content: "";
    position: absolute;
    width: 8px; height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--accent);
}
.hero > .corner.tl::before { top: -5px; left: -5px; }
.hero > .corner.tr::before { top: -5px; right: -5px; }
.hero > .corner.bl::before { bottom: -5px; left: -5px; }
.hero > .corner.br::before { bottom: -5px; right: -5px; }

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 144, 0, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 144, 0, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
    pointer-events: none;
    mix-blend-mode: overlay;
}

.hero > * { position: relative; z-index: 1; }

.hero h1 {
    font-size: 3.8rem;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 1rem;
    text-shadow: 0 0 40px rgba(255, 144, 0, 0.5), 0 4px 20px rgba(0, 0, 0, 0.8);
}

.hero-logo {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.hero-logo .hub {
    background: linear-gradient(135deg, #ffb347 0%, var(--accent) 50%, #ff5500 100%);
    color: #000;
    padding: 6px 18px;
    border-radius: 12px;
    margin-left: 12px;
    box-shadow: 0 0 40px rgba(255, 144, 0, 0.6), 0 4px 20px rgba(255, 60, 0, 0.4);
    animation: hubGlow 3s ease-in-out infinite;
}

@keyframes hubGlow {
    0%, 100% { box-shadow: 0 0 40px rgba(255, 144, 0, 0.6), 0 4px 20px rgba(255, 60, 0, 0.4); }
    50%      { box-shadow: 0 0 60px rgba(255, 144, 0, 0.85), 0 4px 30px rgba(255, 60, 0, 0.6); }
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, #ffb347 0%, var(--accent) 50%, #ff6a00 100%);
    color: #000;
    box-shadow: 0 4px 16px rgba(255, 144, 0, 0.35);
}
.btn-primary:hover {
    color: #000;
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(255, 144, 0, 0.6), 0 0 20px rgba(255, 144, 0, 0.3);
    filter: brightness(1.1);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
}
.btn-outline:hover {
    background: var(--accent);
    color: #000;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
}

/* === CONTAINERS === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
}

/* === CARDS === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s;
}

.stat-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(255, 144, 0, 0.1);
}

.stat-card .number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
}

.stat-card .label {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    margin-top: 0.3rem;
}

/* === FORMS === */
.form-container {
    max-width: 500px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group label .optional {
    color: #555;
    font-size: 0.75rem;
    text-transform: none;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(255, 144, 0, 0.15);
}

.form-control::placeholder { color: #555; }

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* === TABLES === */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #000;
}

th {
    padding: 0.8rem 1rem;
    text-align: left;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--accent);
}

td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
}

tbody tr {
    transition: background 0.15s;
}

tbody tr:hover {
    background: rgba(255, 144, 0, 0.05);
}

.rank-1 td { color: #ffd700; font-weight: 700; }
.rank-2 td { color: #c0c0c0; font-weight: 600; }
.rank-3 td { color: #cd7f32; font-weight: 600; }

/* === ALERTS === */
.alert {
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius);
    margin-bottom: 1.2rem;
    font-size: 0.95rem;
}

.alert-success {
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(244, 67, 54, 0.15);
    border: 1px solid var(--danger);
    color: var(--danger);
}

/* === FEATURES GRID === */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

.feature {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
}

.feature:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(255, 144, 0, 0.1);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature h3 {
    color: var(--accent);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.feature p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* === SEARCH === */
.search-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.search-bar .form-control {
    flex: 1;
}

/* === PAGINATION === */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.3rem;
    margin-top: 1.5rem;
    list-style: none;
}

.pagination a, .pagination span {
    padding: 0.5rem 0.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .active { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 700; }

/* === FACTION BADGES === */
.faction-light { color: #6ec6ff; }
.faction-fury { color: #ff6e6e; }

/* === FOOTER === */
.footer {
    margin-top: auto;
    background: #000;
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.footer-links a {
    font-size: 1.5rem;
    transition: opacity 0.2s;
}

.footer-links a:hover { opacity: 0.8; }

.footer-links .fa-discord { color: #5865F2; }
.footer-links .fa-youtube { color: #FF0000; }
.footer-links .fa-facebook { color: #1877F2; }

.footer p {
    color: #555;
    font-size: 0.85rem;
}

/* === TABS === */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.tab {
    padding: 0.7rem 1.5rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .navbar { padding: 0 1rem; }
    .navbar-nav {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: #000;
        flex-direction: column;
        border-bottom: 3px solid var(--accent);
    }
    .navbar-nav.open { display: flex; }
    .navbar-nav a {
        height: auto;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--border);
    }
    .navbar-social { display: none; }
    .menu-toggle { display: block; }
    .hero h1 { font-size: 2rem; }
    .hero { padding: 3rem 1rem; }
    .container { padding: 1.5rem; }
    .features { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-links { gap: 1.5rem; }
}
