/* Modern Jedaii Ranked Theme */
:root {
    --primary-color: #00F2FF; /* Holographic Teal (was bright blue) */
    --primary-glow: rgba(0, 242, 255, 0.5);
    --secondary-color: #121415; /* Deep Charcoal / Stone */
    --bg-color: #0d0f10; /* Darker Stone */
    --text-color: #E0E0E0;
    --text-muted: #8c9b9d;
    --glass-bg: rgba(26, 31, 33, 0.85); /* Holographic slate */
    --glass-border: rgba(0, 242, 255, 0.3); /* Tactical Teal */
    --jungle-green: #2D5A27; /* Deep Jungle Green for backgrounds */
    --gold: #FF9D00; /* Tactical Orange */
    --silver: #A9B0B3;
    --bronze: #8F6A48;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
    box-shadow: 0 0 5px var(--primary-glow);
}

::-webkit-scrollbar-thumb:hover {
    background: #33bbff;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-color); /* Ensure dark base */
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    color: var(--text-color);
    background-color: transparent; /* Allow canvas visibility over dark base */
    overflow-x: hidden;
    line-height: 1.6;
    min-height: 100vh;
}

/* Background Animation Canvas */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.3;
}

.content-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: linear-gradient(to bottom, rgba(45, 90, 39, 0.1), rgba(18, 20, 21, 0.95)); /* Subtle jungle green to dark stone */
}

/* Header & Nav */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 2rem;
    background: rgba(18, 20, 21, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.logo-container {
    flex-shrink: 0;
}

.logo-container a {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.logo {
    height: 50px;
    transition: filter 0.3s ease;
    will-change: filter;
    flex-shrink: 0;
}

.logo:hover {
    filter: drop-shadow(0 0 8px var(--primary-color));
}

header h1 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 8px var(--primary-glow);
    letter-spacing: 2px;
    text-transform: uppercase;
    white-space: nowrap;
}

.menu-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Navigation Links */
.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-item, .nav-group-title {
    color: var(--text-color);
    text-decoration: none;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.5rem 0.8rem;
    border-radius: 4px;
    transition: all 0.2s;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-item:hover, .nav-group:hover .nav-group-title {
    color: var(--primary-color);
    text-shadow: 0 0 8px var(--primary-glow);
}

.nav-item.active {
    color: var(--primary-color);
    text-shadow: 0 0 8px var(--primary-glow);
    border-bottom: 2px solid var(--primary-color);
}

.nav-item.highlight {
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    background: rgba(0, 242, 255, 0.05);
}

.nav-item.highlight:hover {
    background: var(--primary-color);
    color: #000;
    box-shadow: 0 0 15px var(--primary-glow);
}

/* Dropdown styling */
.nav-group {
    position: relative;
}

.nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    min-width: 180px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    padding: 0.5rem 0;
    z-index: 1001;
}

.nav-group:hover .nav-dropdown {
    display: flex;
    flex-direction: column;
}

.nav-dropdown .nav-item {
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
    border-radius: 0;
}

.nav-dropdown .nav-item:hover {
    background: rgba(0, 242, 255, 0.1);
}

.menu-button {
    display: none;
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    font-size: 1.5rem;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    border-radius: 4px;
}

.discord-icon a {
    color: #5865F2;
    font-size: 2rem;
    transition: transform 0.2s;
    display: flex;
}

.discord-icon a:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px #5865F2);
}

/* Legacy Dropdown Menu (duel_tree, contact, news, tournament_winners) */
.dropdown-menu {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    padding: 0.5rem 0;
    z-index: 1001;
    flex-direction: column;
}

.dropdown-content a {
    display: block;
    padding: 0.8rem 1.2rem;
    color: var(--text-color);
    text-decoration: none;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.dropdown-content a:hover {
    background: rgba(0, 242, 255, 0.1);
    color: var(--primary-color);
}

.dropdown-menu:hover .dropdown-content,
.dropdown-menu.active .dropdown-content {
    display: flex;
}

/* Desktop: legacy pages have no horizontal nav, so show dropdown content inline */
@media (min-width: 1025px) {
    .dropdown-menu {
        display: flex;
        align-items: center;
    }

    .dropdown-menu .dropdown-content {
        display: flex !important;
        position: static;
        background: transparent;
        border: none;
        box-shadow: none;
        backdrop-filter: none;
        flex-direction: row;
        padding: 0;
        min-width: auto;
        gap: 0.5rem;
    }

    .dropdown-content a {
        padding: 0.5rem 0.8rem;
        font-size: 1rem;
        border-bottom: none;
        border-radius: 4px;
    }
}

/* Main Sections */
main {
    flex: 1;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.section {
    padding: 3rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    scroll-margin-top: 80px;
    /* Offset for sticky header */
}

.section.dashboard-panel {
    padding: 2rem;
}

.section h2 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #fff;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.section h2 i {
    margin-right: 10px;
    color: var(--primary-color);
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 6rem 1rem;
    background: radial-gradient(circle at center, rgba(0, 242, 255, 0.1), transparent 70%);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.welcome-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 1rem;
    text-shadow: 0 0 15px var(--primary-glow);
}

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

.cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(45deg, var(--primary-color), #00a8b5);
    color: #000;
    text-decoration: none;
    font-weight: 700;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.2rem;
    border-radius: 4px;
    text-transform: uppercase;
    box-shadow: 0 0 20px var(--primary-glow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 35px var(--primary-glow);
}

/* Leaderboard & Tabs */
.section-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Ranks Redesign: Side-by-side and smaller */
.ranks-showcase {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.rank-card-box {
    text-align: center;
    width: 45%;
    max-width: 400px;
    /* Limit max width so they aren't huge */
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem;
    border-radius: 12px;
}

.rank-card-box h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.rank-card-box img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    /* Shadows handled inline in index.php but can be here too */
}

.season-tabs {
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.3rem;
    border-radius: 8px;
}

.tab-btn {
    padding: 0.6rem 1.2rem;
    text-decoration: none;
    color: #888;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.tab-btn.active {
    background: rgba(0, 242, 255, 0.15);
    color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.1);
}

.tab-btn:hover {
    color: #fff;
}

.leaderboard-table-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow-x: auto;
    /* Scrollable */
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 0.9rem 1.2rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.leaderboard-table th {
    background: rgba(0, 242, 255, 0.1);
    color: var(--primary-color);
    text-transform: uppercase;
    font-size: 0.9rem;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
}

.leaderboard-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.player-link {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}

.player-link:hover {
    color: var(--primary-color);
    text-shadow: 0 0 5px var(--primary-glow);
}

/* Rank Colors */
.gold td {
    color: var(--gold);
}

.gold .player-link {
    color: var(--gold);
}

.silver td {
    color: var(--silver);
}

.silver .player-link {
    color: var(--silver);
}

.bronze td {
    color: var(--bronze);
}

.bronze .player-link {
    color: var(--bronze);
}

.rank-icon-img {
    width: 30px;
    vertical-align: middle;
}

.badge-text {
    display: inline-block;
    width: 25px;
    height: 25px;
    line-height: 25px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 2rem;
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 242, 255, 0.15);
    border-color: var(--primary-color);
}

.stat-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 242, 255, 0.3);
    padding-bottom: 0.5rem;
    font-size: 1.3rem;
    font-family: 'Rajdhani', sans-serif;
    text-transform: uppercase;
}

.stat-card ul {
    list-style: none;
}

.stat-card li {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    align-items: center;
}

.stat-card li a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.stat-card li a:hover {
    color: var(--primary-color);
    text-shadow: 0 0 5px var(--primary-glow);
}

.stat-card li span {
    color: var(--primary-color);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
}

/* Tournaments Redesign */
.tournaments-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}

.featured-winner-card {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(0, 0, 0, 0.8));
    border: 2px solid var(--gold);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
    max-width: 500px;
    width: 100%;
    margin: 0 auto 3rem auto;
    position: relative;
    z-index: 10;
    overflow: hidden;
}

.featured-winner-card .crown-icon {
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.featured-winner-card h3 {
    color: #fff;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.featured-winner-card .champion-name {
    font-size: 2rem;
    font-weight: bold;
    color: var(--gold);
    margin: 0.5rem 0;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.featured-winner-card img {
    width: 250px;
    /* Huge trophy */
    margin-top: 1rem;
}

/* UPDATED: Bigger trophy */

.winners-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 1.5rem;
    width: 100%;
    max-width: 1200px;
}

.tournament-box {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 1.5rem;
    transition: transform 0.3s ease;
    /* Flex column to push button to bottom */
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tournament-box:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.tourney-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

/* ... headers ... */

.podium-rows {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    /* Ensure content takes available space but doesn't force button off if empty */
    margin-bottom: 1rem;
    flex-grow: 1;
    /* UPDATED: Force this to take available space */
}

.podium-row {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.02);
}

.podium-row i {
    width: 25px;
    text-align: center;
    margin-right: 10px;
}

.podium-row.gold {
    color: var(--gold);
    border-left: 3px solid var(--gold);
}

.podium-row.silver {
    color: var(--silver);
    border-left: 3px solid var(--silver);
}

.podium-row.bronze {
    color: var(--bronze);
    border-left: 3px solid var(--bronze);
}

.podium-row .score {
    margin-left: auto;
    font-family: monospace;
    opacity: 0.7;
}

/* UPDATED: YouTube button via Flexbox */
.replay-btn {
    margin-top: auto;
    /* Push to bottom */
    align-self: flex-end;
    /* Push to right */
    color: #ff0000;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 15px;
    border-radius: 5px;
    display: block;
    transition: all 0.2s;
}

.replay-btn:hover {
    background: #ff0000;
    color: #fff;
    box-shadow: 0 0 10px #ff0000;
}

/* Servers Guide (Holocron) */
.guide-content {
    max-width: 900px;
    margin: 0 auto;
    background: var(--glass-bg);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.guide-content h3 {
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
}

.guide-content p,
.guide-content ul {
    margin-bottom: 1rem;
    color: #ccc;
}

.guide-content hr {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 2rem 0;
}

.guide-content code {
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 6px;
    border-radius: 4px;
    color: #4dff4d;
    font-family: monospace;
}

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

.guide-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 8px;
}

.guide-card h4 {
    color: #fff;
    margin-bottom: 0.5rem;
}

/* Guide / Holocron Styles */
.guide-block {
    margin-bottom: 3rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 1.5rem;
    border-radius: 8px;
}

.guide-block h3 {
    margin-top: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.5rem;
}

.guide-steps .step {
    margin-bottom: 1.5rem;
}

.guide-steps strong {
    color: var(--text-color);
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.5rem;
}

.cmd-list {
    list-style: none;
    display: grid;
    gap: 0.5rem;
}

.cmd-list li {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
}

.cmd-list code {
    color: #4dff4d;
    font-weight: bold;
    margin-right: 0.5rem;
}

.rank-tiers {
    display: grid;
    gap: 0.5rem;
}

.tier {
    padding: 0.8rem;
    border-radius: 4px;
    font-weight: bold;
}

.tier.youngling {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
}

.tier.initiate {
    background: rgba(3, 169, 244, 0.1);
    color: #03a9f4;
}

.tier.padawan {
    background: rgba(255, 152, 0, 0.1);
    color: #ff9800;
}

.tier.knight {
    background: rgba(33, 150, 243, 0.1);
    color: #2196f3;
}

.tier.master {
    background: rgba(156, 39, 176, 0.1);
    color: #9c27b0;
}

.tier.grandmaster {
    background: rgba(255, 215, 0, 0.1);
    color: #ffd700;
    border: 1px solid var(--gold);
}

.force-footer {
    text-align: center;
    margin-top: 2rem;
    font-style: italic;
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* Commlink (Comments) */
.commlink-section {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.section-subtitle {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    color: #888;
    font-style: italic;
    margin-bottom: 2rem;
}

.comment-form-container textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--primary-color);
    color: #fff;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    min-height: 100px;
    resize: vertical;
    margin-bottom: 1rem;
}

.comment-form-container textarea:focus {
    outline: none;
    box-shadow: 0 0 15px rgba(0, 170, 255, 0.2);
}

.submit-btn {
    padding: 10px 30px;
    background: var(--primary-color);
    border: none;
    color: #000;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    letter-spacing: 1px;
    transition: all 0.2s;
}

.submit-btn:hover {
    background: #fff;
    box-shadow: 0 0 20px var(--primary-glow);
}

.comments-feed {
    margin-top: 3rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-bubble {
    background: rgba(22, 27, 34, 0.9);
    border-left: 3px solid var(--primary-color);
    padding: 1rem 1.5rem;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.comment-bubble .message {
    color: #e6edf3;
    font-size: 0.95rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.comment-bubble .timestamp {
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.5rem;
    text-align: right;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==============================
   TABLET & SMALL DESKTOP ADJUSTMENTS
   ============================== */
@media (max-width: 1200px) {
    header {
        padding: 0.8rem 1rem;
    }
    header h1 {
        font-size: 1.4rem;
        letter-spacing: 1px;
    }
    .logo {
        height: 40px;
    }
    .nav-links {
        gap: 0.8rem;
    }
    .nav-item, .nav-group-title {
        font-size: 0.95rem;
        padding: 0.4rem 0.6rem;
    }
}

/* ==============================
   MOBILE RESPONSIVENESS
   ============================== */
@media (max-width: 1024px) {
    img {
        max-width: 100%;
        height: auto;
    }

    /* Show hamburger */
    .menu-button {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        color: var(--primary-color);
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s;
    }

    .menu-button:hover {
        background: rgba(0, 242, 255, 0.1);
    }

    /* Mobile drawer: slides down from header */
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(18, 20, 21, 0.98);
        backdrop-filter: blur(15px);
        border-bottom: 1px solid var(--glass-border);
        padding: 0.5rem 0 1rem;
        gap: 0;
        z-index: 999;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .nav-links.active {
        display: flex;
    }

    /* Nav items full-width in drawer */
    .nav-item {
        width: 100%;
        text-align: left;
        padding: 0.9rem 1.5rem;
        border-radius: 0;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(255,255,255,0.04);
    }

    /* Nav groups on mobile: stack inline, no hover-dropdown */
    .nav-group {
        width: 100%;
    }

    .nav-group-title {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        text-align: left;
        padding: 0.9rem 1.5rem;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(255,255,255,0.04);
        color: var(--primary-color);
    }

    /* On mobile the dropdown is hidden by default, toggled via JS */
    .nav-dropdown {
        display: flex;
        position: static;
        background: rgba(0, 242, 255, 0.03);
        border: none;
        border-radius: 0;
        box-shadow: none;
        backdrop-filter: none;
        padding: 0;
        min-width: 100%;
        flex-direction: column;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    }

    .nav-group.active .nav-dropdown {
        max-height: 350px;
        opacity: 1;
    }

    .nav-group-title i {
        transition: transform 0.2s ease;
    }

    .nav-group.active .nav-group-title i {
        transform: rotate(180deg);
    }

    .nav-dropdown .nav-item {
        padding-left: 2.5rem;
        font-size: 1rem;
        color: var(--text-muted);
        border-bottom: 1px solid rgba(255,255,255,0.03);
    }

    .nav-dropdown .nav-item:hover {
        color: var(--primary-color);
        background: rgba(0, 242, 255, 0.08);
    }

    /* Legacy dropdown mobile drawer */
    .dropdown-menu.active .dropdown-content {
        display: flex;
        position: absolute;
        top: 100%;
        right: 0;
        left: auto;
        width: 250px;
        background: rgba(18, 20, 21, 0.98);
        border: 1px solid var(--glass-border);
        border-radius: 8px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
        padding: 0.5rem 0;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .dropdown-content a {
        padding: 0.9rem 1.5rem;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(255,255,255,0.04);
    }

    header {
        flex-wrap: wrap;
        padding: 0.8rem 1rem;
    }

    header h1 {
        font-size: 1.4rem;
    }

    .menu-container {
        gap: 0.5rem;
    }

    .hero-section {
        padding: 3rem 0.5rem;
    }

    .welcome-title {
        font-size: 2rem;
        letter-spacing: 1px;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .cta-button {
        padding: 12px 28px;
        font-size: 1rem;
    }

    .section h2 {
        font-size: 1.9rem;
        letter-spacing: 1px;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 0.6rem 0.4rem;
        font-size: 0.82rem;
    }

    .leaderboard-table-container {
        max-width: 100vw;
        margin: 0 -0.5rem;
        border-radius: 0;
    }

    .section {
        padding: 2rem 0.5rem;
    }

    .section.dashboard-panel {
        padding: 1rem 0.8rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .ranks-showcase {
        flex-direction: column;
        align-items: center;
    }

    .rank-card-box {
        width: 100%;
        max-width: 100%;
    }

    .search-form input {
        width: 75%;
    }

    .guide-content {
        padding: 1.5rem;
    }

    .winners-list-grid {
        grid-template-columns: 1fr;
    }

    .featured-winner-card img {
        width: 100%;
        max-width: 200px;
    }

    .featured-winner-card .champion-name {
        font-size: 1.5rem;
    }

    .tourney-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .tournament-box {
        padding: 1rem;
    }

    .section {
        padding: 3rem 1rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
        color: #ff9800;
    }
}

/* --- Jedi Archives (Sorting & Search) --- */
.archives-section .search-container {
    max-width: 800px;
    margin: 0 auto 2rem auto;
    text-align: center;
}

.search-form {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1.5rem;
}

/* Make search input sleek and centered */
.search-form input {
    width: 60%;
    padding: 12px 20px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    text-align: center;
}

.search-form input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-glow);
}

.search-form button {
    padding: 0 25px;
    border-radius: 30px;
    border: none;
    background: var(--primary-color);
    color: #000;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.search-form button:hover {
    background: #fff;
    box-shadow: 0 0 15px var(--primary-color);
}

.sorting-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    /* Center align buttons */
    align-items: center;
    gap: 15px;
    /* More space between buttons */
}

.sorting-row span {
    display: none;
    /* Hide "Sort By:" text if user wants clean look, or style it */
}

.sort-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    color: var(--text-muted);
    text-decoration: none !important;
    font-size: 0.95rem;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sort-tag:hover {
    background: rgba(0, 242, 255, 0.15);
    border-color: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--primary-glow);
}

.sort-tag.active {
    background: var(--primary-color);
    color: #000;
    border-color: var(--primary-color);
    box-shadow: 0 0 20px var(--primary-glow);
}

/* --- Tetris Integration --- */
.tetris-float-btn {
    position: fixed;
    top: 120px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: #000;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 170, 255, 0.5);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Removed conflicting transition: all */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: simpleFloat 3s infinite ease-in-out;
}

@keyframes simpleFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.tetris-float-btn:hover {
    animation-play-state: paused;
    transform: scale(1.1);
    background: #fff;
    box-shadow: 0 0 25px var(--primary-color);
}

.tetris-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

.tetris-modal.active {
    opacity: 1;
    pointer-events: all;
}

.tetris-container {
    width: 100%;
    height: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    /* Prevent internal scroll */
}

#tetris-frame {
    width: 100%;
    height: 100%;
    border: none;
    overflow: hidden;
}

.close-modal-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    background: transparent;
    border: none;
    color: var(--danger-color, #ff3333);
    font-size: 3rem;
    cursor: pointer;
    z-index: 10001;
    transition: transform 0.2s;
}

.close-modal-btn:hover {
    transform: scale(1.2) rotate(90deg);
    color: #fff;
}

/* ==============================
   STAT TABLE (stats.php)
   ============================== */
.stat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.stat-table thead tr {
    background: rgba(0, 242, 255, 0.08);
    border-bottom: 1px solid var(--glass-border);
}

.stat-table th {
    padding: 0.6rem 0.8rem;
    text-align: left;
    color: var(--primary-color);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.stat-table td {
    padding: 0.55rem 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-color);
}

.stat-table tr:hover td {
    background: rgba(0, 242, 255, 0.04);
}

.stat-table .rank-col {
    width: 40px;
    text-align: center;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
}

.stat-table .value-col {
    text-align: right;
    color: var(--primary-color);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

/* ==============================
   FOOTER
   ============================== */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(18, 20, 21, 0.6);
}

footer p {
    margin: 0;
    letter-spacing: 1px;
}

/* ==============================
   MOBILE ONLY NAV UTILITY
   ============================== */
.mobile-only-nav {
    display: none !important;
}

@media (max-width: 1024px) {
    .mobile-only-nav {
        display: inline-flex !important;
    }
}
