/* =============================================
   Liga WOC — Esports Tournament Platform
   Design v5 — Vibrant Competitive
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* ===== Palette ===== */
    --bg-base: #0e1015;
    --bg-panel: #14171f;
    --bg-card: #1a1e28;
    --bg-card-hover: #1f2433;
    --bg-elevated: #252a38;
    --bg-input: #111318;

    --accent: #7c5cfc;
    --accent-bright: #956aff;
    --accent-dim: #5a3fd4;
    --accent-light: #bba4ff;
    --accent-bg: rgba(124, 92, 252, 0.08);
    --accent-glow: 0 0 30px rgba(124, 92, 252, 0.3);

    --gradient-accent: linear-gradient(135deg, #7c5cfc, #a855f7);
    --gradient-accent-h: linear-gradient(90deg, #7c5cfc, #a855f7);
    --gradient-sidebar: linear-gradient(180deg, #181b2a 0%, #0e1015 100%);
    --gradient-gold: linear-gradient(135deg, #fbbf24, #f59e0b);
    --gradient-silver: linear-gradient(135deg, #d1d5db, #9ca3af);
    --gradient-bronze: linear-gradient(135deg, #d97706, #92400e);

    --green: #00d68f;
    --yellow: #ffb800;
    --red: #ff3d71;
    --cyan: #00b8d4;
    --pink: #ff3d71;
    --orange: #ff6b35;

    --text-1: #f4f5f7;
    --text-2: #9ba2b5;
    --text-3: #5c6478;
    --font-display: var(--font-heading);
    --neon-orchid: var(--accent);
    --electric-indigo: var(--accent);

    --text-primary: var(--text-1);
    --text-secondary: var(--text-2);
    --text-muted: var(--text-3);
    --text-dimmed: var(--text-3);

    --success: var(--green);
    --success-soft: rgba(0, 214, 143, 0.1);
    --warning: var(--yellow);
    --warning-soft: rgba(255, 184, 0, 0.1);
    --danger: var(--red);
    --danger-soft: rgba(255, 61, 113, 0.1);
    --info: var(--cyan);
    --info-soft: rgba(0, 184, 212, 0.1);
    --neon-cyan: var(--cyan);
    --neon-green: var(--green);
    --neon-pink: var(--pink);
    --neon-yellow: var(--yellow);
    --neon-orange: var(--orange);

    --border: rgba(255, 255, 255, 0.05);
    --border-hover: rgba(255, 255, 255, 0.1);
    --border-subtle: var(--border);

    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.6);
    --shadow-card: var(--shadow-sm);
    --shadow-glow: var(--accent-glow);

    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;

    --sidebar-w: 260px;
    --topnav-h: 58px;
    --mobile-nav-h: 60px;
    --r: 10px;
    --r-sm: 6px;
    --r-lg: 14px;
    --r-xl: 20px;
    --r-full: 9999px;

    --radius-sm: var(--r-sm);
    --radius-md: var(--r);
    --radius-lg: var(--r-lg);
    --radius-xl: var(--r-xl);
    --radius-full: var(--r-full);

    --nav-height: var(--topnav-h);
    --sidebar-width: var(--sidebar-w);
    --mobile-nav-height: var(--mobile-nav-h);

    --t: 0.2s ease;
}

/* ===== Reset ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-base);
    color: var(--text-1);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent-light);
    text-decoration: none;
    transition: color .15s;
}

a:hover {
    color: #d4c5ff;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
}

hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 3px;
}

/* ===== Icons ===== */
.icon-svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-svg.sm {
    width: 14px;
    height: 14px;
}

.icon-svg.lg {
    width: 22px;
    height: 22px;
}

.icon-svg.xl {
    width: 30px;
    height: 30px;
}

.icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r);
    flex-shrink: 0;
}

.icon-box.sm {
    width: 34px;
    height: 34px;
}

.icon-box.md {
    width: 42px;
    height: 42px;
}

.icon-box.lg {
    width: 50px;
    height: 50px;
}

.icon-box.purple {
    background: var(--accent-bg);
    color: var(--accent-bright);
}

.icon-box.green {
    background: rgba(0, 214, 143, 0.1);
    color: var(--green);
}

.icon-box.blue {
    background: rgba(0, 184, 212, 0.1);
    color: var(--cyan);
}

.icon-box.orange {
    background: rgba(255, 107, 53, 0.1);
    color: var(--orange);
}

.icon-box.red {
    background: rgba(255, 61, 113, 0.1);
    color: var(--red);
}

/* ===== Layout ===== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    padding: calc(var(--topnav-h) + 28px) 36px 40px;
    max-width: 100%;
}

/* ====================================================
   SIDEBAR — gradient bg, glowing logo, clean sections
   ==================================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--gradient-sidebar);
    display: flex;
    flex-direction: column;
    z-index: 200;
    border-right: 1px solid var(--border);
}

/* — Logo area — */
.sidebar-logo {
    height: 68px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 22px;
    position: relative;
}

.sidebar-logo::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: var(--gradient-accent-h);
    opacity: 0.35;
}

.sidebar-logo-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-accent);
    border-radius: var(--r);
    color: #fff;
    box-shadow: 0 0 20px rgba(124, 92, 252, 0.4);
}

.sidebar-logo-icon .icon-svg {
    stroke: white;
    width: 18px;
    height: 18px;
}

.sidebar-logo-text {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* — Nav links — */
.sidebar-nav {
    padding: 16px 14px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 4px;
}

.sidebar-section-title {
    font-size: 0.55rem;
    font-weight: 800;
    color: var(--accent-bright);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 20px 0 8px 10px;
    opacity: 0.7;
}

.sidebar-section:first-child .sidebar-section-title {
    margin-top: 2px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: var(--r);
    color: var(--text-2);
    font-weight: 500;
    font-size: 0.84rem;
    transition: all .15s;
    margin-bottom: 2px;
}

.sidebar-link:hover {
    color: var(--text-1);
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-link.active {
    background: var(--accent-bg);
    color: var(--accent-bright);
    font-weight: 700;
    position: relative;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--gradient-accent);
    border-radius: 0 3px 3px 0;
}

.sidebar-link .icon {
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-link .icon .icon-svg {
    width: 17px;
    height: 17px;
    opacity: 0.55;
}

.sidebar-link:hover .icon .icon-svg,
.sidebar-link.active .icon .icon-svg {
    opacity: 1;
}

/* ====================================================
   TOPNAV
   ==================================================== */
.topnav {
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    height: var(--topnav-h);
    background: rgba(14, 16, 21, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 36px;
    z-index: 100;
}

.topnav-title {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.topnav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* User */
.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 4px 10px 4px 4px;
    border-radius: var(--r-full);
    transition: background .15s;
}

.user-menu:hover {
    background: rgba(255, 255, 255, 0.04);
}

.user-menu-name {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-1);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.user-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: .7rem;
    color: #fff;
}

.notif-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    padding: 7px;
    border-radius: var(--r);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}

.notif-btn:hover {
    color: var(--accent-bright);
    background: var(--accent-bg);
}

.notif-badge {
    position: absolute;
    top: 1px;
    right: 1px;
    min-width: 14px;
    height: 14px;
    background: var(--red);
    color: #fff;
    font-size: .5rem;
    font-weight: 700;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-panel);
}

.notif-badge.active {
    display: flex;
}

/* ====================================================
   CARDS — with colored left accent stripe
   ==================================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 22px;
    position: relative;
    transition: all var(--t);
}

.card:hover {
    border-color: var(--border-hover);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-family: var(--font-heading);
    font-size: .92rem;
    font-weight: 800;
    color: var(--text-1);
    letter-spacing: .01em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 22px;
    border-radius: var(--r);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .76rem;
    cursor: pointer;
    transition: all var(--t);
    border: none;
    text-transform: uppercase;
    letter-spacing: .8px;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-accent);
    color: #fff;
    box-shadow: 0 4px 20px rgba(124, 92, 252, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(124, 92, 252, 0.4);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-2);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    color: var(--text-1);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--red);
    color: #fff;
}

.btn-danger:hover {
    background: #e6274e;
    transform: translateY(-2px);
    color: #fff;
}

.btn-success {
    background: var(--green);
    color: #000;
}

.btn-success:hover {
    background: #00c07e;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid rgba(124, 92, 252, 0.4);
    color: var(--accent-light);
}

.btn-outline:hover {
    background: var(--accent-bg);
    border-color: var(--accent);
    color: #fff;
}

.btn-cta {
    background: var(--gradient-accent);
    color: #fff;
    box-shadow: 0 4px 20px rgba(124, 92, 252, 0.25);
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(124, 92, 252, 0.4);
    color: #fff;
}

.btn-accent {
    background: var(--gradient-accent);
    color: #fff;
}

.btn-accent:hover {
    transform: translateY(-2px);
    color: #fff;
}

.btn-sm {
    padding: 6px 14px;
    font-size: .68rem;
    border-radius: var(--r-sm);
}

.btn-lg {
    padding: 14px 32px;
    font-size: .88rem;
    letter-spacing: 1.2px;
    border-radius: var(--r);
}

.btn-block {
    width: 100%;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: .72rem;
    color: var(--text-3);
    letter-spacing: .06em;
    text-transform: uppercase;
}

.form-control {
    width: 100%;
    padding: 11px 15px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text-1);
    font-size: .88rem;
    transition: all .15s;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.12);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-3);
}

.form-row {
    display: flex;
    gap: 14px;
}

.form-row .form-group {
    flex: 1;
}

/* ===== Grid ===== */
.grid {
    display: grid;
    gap: 18px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ===== Page Header ===== */
.page-header {
    margin-bottom: 28px;
}

.page-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--text-1);
    text-transform: uppercase;
    letter-spacing: -.01em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-subtitle {
    color: var(--text-3);
    font-size: .88rem;
    margin-top: 4px;
}

/* ====================================================
   STAT CARDS — each with unique colored accent
   ==================================================== */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--t);
    overflow: hidden;
    position: relative;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--r);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.purple {
    background: rgba(124, 92, 252, 0.12);
    color: var(--accent-bright);
}

.stat-icon.green {
    background: rgba(0, 214, 143, 0.12);
    color: var(--green);
}

.stat-icon.blue {
    background: rgba(0, 184, 212, 0.12);
    color: var(--cyan);
}

.stat-icon.orange {
    background: rgba(255, 107, 53, 0.12);
    color: var(--orange);
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -.03em;
    line-height: 1;
    color: var(--text-1);
}

.stat-label {
    font-size: .6rem;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-top: 3px;
}

/* ====================================================
   NEWS / TOURNAMENT / TEAM CARDS
   ==================================================== */
.news-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: all var(--t);
    display: flex;
    flex-direction: column;
}

.news-card:hover,
.tournament-card:hover,
.team-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), var(--accent-glow);
}

.news-card-img {
    width: 100%;
    aspect-ratio: 16/9;
    height: auto;
    object-fit: cover;
    transition: transform .3s;
}

.news-card:hover .news-card-img {
    transform: scale(1.05);
}

.news-card-img-placeholder {
    width: 100%;
    height: 170px;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
}

.news-card-body {
    padding: 18px;
}

.news-card-title {
    font-family: var(--font-heading);
    font-size: .95rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-1);
    line-height: 1.3;
}

.news-card-excerpt {
    color: var(--text-2);
    font-size: .8rem;
    margin-bottom: 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-category {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-size: .58rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 8px;
    background: var(--gradient-accent);
    color: #fff;
}

.news-card-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: .7rem;
    color: var(--text-3);
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

/* Tournament card */
.tournament-card-header {
    padding: 16px 18px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border);
}

.tournament-card-body {
    padding: 18px;
}

.tournament-card-footer {
    padding: 14px 18px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tournament-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: var(--r-full);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: .58rem;
    text-transform: uppercase;
    letter-spacing: .8px;
}

.tournament-status.registration {
    background: rgba(0, 214, 143, 0.12);
    color: var(--green);
}

.tournament-status.ready {
    background: rgba(0, 184, 212, 0.12);
    color: var(--cyan);
}

.tournament-status.in_progress {
    background: rgba(255, 184, 0, 0.12);
    color: var(--yellow);
}

.tournament-status.completed {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-2);
}

.tournament-status.draft {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-3);
}

.tournament-status.cancelled {
    background: var(--danger-soft);
    color: var(--red);
}

.tournament-info-item {
    font-size: .78rem;
    color: var(--text-2);
}

.tournament-info-item strong {
    color: var(--text-1);
    font-weight: 600;
}

/* ===== Tables ===== */
.table-wrapper {
    border-radius: var(--r);
    border: 1px solid var(--border);
    overflow-x: auto;
    background: var(--bg-card);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: rgba(124, 92, 252, 0.05);
    padding: 12px 16px;
    text-align: left;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: .6rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-bright);
    border-bottom: 2px solid rgba(124, 92, 252, 0.15);
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: .84rem;
}

.table tr:hover td {
    background: var(--accent-bg);
}

.table tr:last-child td {
    border-bottom: none;
}

/* ===== Badges ===== */
.badge {
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-size: .58rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    display: inline-flex;
    align-items: center;
}

.badge-purple {
    background: rgba(124, 92, 252, 0.12);
    color: var(--accent-bright);
}

.badge-green {
    background: rgba(0, 214, 143, 0.12);
    color: var(--green);
}

.badge-blue {
    background: rgba(0, 184, 212, 0.12);
    color: var(--cyan);
}

.badge-yellow {
    background: rgba(255, 184, 0, 0.12);
    color: var(--yellow);
}

.badge-red {
    background: rgba(255, 61, 113, 0.12);
    color: var(--red);
}

/* ===== Alerts — strong left bar ===== */
.alert {
    padding: 14px 18px;
    border-radius: var(--r-sm);
    margin-bottom: 16px;
    font-weight: 500;
    font-size: .84rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid transparent;
}

.alert-success {
    background: var(--success-soft);
    border-left-color: var(--green);
    color: var(--green);
}

.alert-error {
    background: var(--danger-soft);
    border-left-color: var(--red);
    color: var(--red);
}

.alert-warning {
    background: var(--warning-soft);
    border-left-color: var(--yellow);
    color: var(--yellow);
}

.alert-info {
    background: var(--info-soft);
    border-left-color: var(--cyan);
    color: var(--cyan);
}

/* ====================================================
   TABS — Challonge pill style
   ==================================================== */
.tabs {
    display: inline-flex;
    gap: 4px;
    background: var(--bg-panel);
    padding: 4px;
    border-radius: var(--r);
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.tab {
    padding: 9px 20px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .72rem;
    color: var(--text-3);
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--r-sm);
    transition: all .15s;
    text-decoration: none;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: .8px;
}

.tab:hover {
    color: var(--text-1);
    background: rgba(255, 255, 255, 0.03);
}

.tab.active {
    background: var(--gradient-accent);
    color: #fff;
    box-shadow: 0 2px 12px rgba(124, 92, 252, 0.3);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeUp .25s ease;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Tournament Bracket CSS ===== */
.bracket-container {
    display: flex;
    gap: 40px;
    padding: 20px 0;
    overflow-x: auto;
    align-items: center;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 30px;
    min-width: 220px;
    position: relative;
}

.bracket-round-header {
    text-align: center;
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--accent-light);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: absolute;
    top: -40px;
    width: 100%;
}

.bracket-match {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    overflow: hidden;
    min-width: 220px;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: all var(--t);
    z-index: 2;
}

.bracket-match:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 15px rgba(124, 92, 252, 0.2);
    transform: translateY(-2px);
}

.bracket-team {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    font-size: .8rem;
    font-weight: 500;
}

.bracket-team+.bracket-team {
    border-top: 1px solid var(--border);
}

.bracket-team.winner {
    font-weight: 700;
    background: var(--accent-bg);
}

.bracket-team.winner .bracket-score {
    color: var(--green);
    font-weight: 900;
}

.bracket-score {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: .88rem;
    color: var(--text-2);
}

/* ===== Rankings ===== */
.rank-medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: .72rem;
}

.rank-1 .rank-medal {
    background: var(--gradient-gold);
    color: #1c1917;
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.4);
}

.rank-2 .rank-medal {
    background: var(--gradient-silver);
    color: #1c1917;
}

.rank-3 .rank-medal {
    background: var(--gradient-bronze);
    color: #fef3c7;
}

.rank-position {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .84rem;
    color: var(--text-3);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 52px 20px;
    color: var(--text-3);
}

.empty-state-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    background: var(--accent-bg);
    border-radius: var(--r-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
}

.empty-state-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-2);
    margin-bottom: 4px;
    text-transform: uppercase;
}

/* ====================================================
   AUTH PAGES
   ==================================================== */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(ellipse at 25% 25%, rgba(124, 92, 252, 0.07) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 75%, rgba(168, 85, 247, 0.04) 0%, transparent 50%),
        var(--bg-base);
}

.auth-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    width: 100%;
    max-width: 440px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo-icon {
    width: 56px;
    height: 56px;
    background: var(--gradient-accent);
    border-radius: var(--r-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    color: #fff;
    box-shadow: 0 4px 28px rgba(124, 92, 252, 0.35);
}

.auth-logo-icon .icon-svg {
    width: 28px;
    height: 28px;
    stroke: white;
}

.auth-logo-text {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-logo-sub {
    font-size: .8rem;
    color: var(--text-3);
    margin-top: 4px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    font-size: .84rem;
    color: var(--text-3);
}

/* ====================================================
   HERO / LANDING
   ==================================================== */
.hero-section {
    text-align: center;
    padding: 80px 24px 56px;
    max-width: 760px;
    margin: 0 auto;
}

.hero-logo {
    width: 72px;
    height: 72px;
    background: var(--gradient-accent);
    border-radius: var(--r-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 28px;
    box-shadow: 0 0 48px rgba(124, 92, 252, 0.35);
    color: #fff;
}

.hero-logo .icon-svg {
    width: 36px;
    height: 36px;
    stroke: white;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 900;
    color: var(--text-1);
    letter-spacing: -.02em;
    line-height: 1.05;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.hero-title .accent {
    color: var(--accent-bright);
}

.hero-subtitle {
    color: var(--text-2);
    font-size: clamp(.9rem, 1.8vw, 1.05rem);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.8;
}

.hero-subtitle strong {
    color: var(--text-1);
    font-weight: 600;
}

.hero-cta {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 36px;
    flex-wrap: wrap;
}

.hero-features {
    max-width: 920px;
    margin: 56px auto 0;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 56px;
    margin-top: 64px;
    padding-top: 28px;
    border-top: 2px solid rgba(124, 92, 252, 0.15);
    flex-wrap: wrap;
}

.hero-stat {
    text-align: center;
}

.hero-stat-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-1);
    line-height: 1;
    margin-bottom: 4px;
    letter-spacing: -.03em;
}

.hero-stat-label {
    font-size: .58rem;
    color: var(--accent-bright);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hero-footer {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: .7rem;
    color: var(--text-3);
    font-family: var(--font-heading);
    font-weight: 500;
}

/* ========================= RESPONSIVE HEROES SCREEN ========================= */


/* Feature cards — top gradient accent */
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 28px;
    text-align: left;
    transition: all var(--t);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
    opacity: 0;
    transition: opacity .2s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card .icon-box {
    margin-bottom: 16px;
}

.feature-card h3 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text-1);
    text-transform: uppercase;
    letter-spacing: .02em;
}

.feature-card p {
    font-size: .82rem;
    color: var(--text-2);
    line-height: 1.7;
}

/* ===== Live / Progress ===== */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: var(--r-full);
    background: var(--danger-soft);
    color: var(--red);
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: .6rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.live-dot {
    width: 7px;
    height: 7px;
    background: var(--red);
    border-radius: 50%;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: .3;
        transform: scale(.5);
    }
}

.progress-bar {
    height: 5px;
    background: var(--bg-elevated);
    border-radius: var(--r-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-accent);
    border-radius: var(--r-full);
    transition: width .3s;
}

/* Welcome Banner */
.welcome-banner {
    padding: 24px;
    border-left: 4px solid var(--accent);
    position: relative;
}

.welcome-banner::after {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 4px;
    box-shadow: 0 0 20px rgba(124, 92, 252, 0.5);
}

/* ML Data Box */
.ml-data-box {
    padding: 16px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--r-sm);
    margin-bottom: 18px;
    background: var(--accent-bg);
}

.ml-data-box .ml-data-title {
    font-size: .72rem;
    font-weight: 800;
    color: var(--accent-bright);
    margin-bottom: 12px;
    font-family: var(--font-heading);
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* ===== Dropdown ===== */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 6px;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 300;
}

.dropdown-menu.show {
    display: block;
    animation: dropIn .15s ease;
}

@keyframes dropIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text-2);
    font-weight: 500;
    font-size: .82rem;
    border-radius: var(--r-sm);
    text-decoration: none;
    transition: all .15s;
}

.dropdown-item:hover {
    background: var(--accent-bg);
    color: var(--text-1);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* ===== Utilities ===== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-3);
}

.text-success {
    color: var(--green);
}

.text-danger {
    color: var(--red);
}

.text-warning {
    color: var(--yellow);
}

.text-accent {
    color: var(--accent-bright);
}

.fw-bold {
    font-weight: 700;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

/* ====================================================
   PAGINATION
   ==================================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
}

.pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--r-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--t);
}

.pagination .page-link:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    color: var(--text-1);
}

.pagination .page-link.active {
    background: var(--accent-bg);
    border-color: var(--accent);
    color: var(--accent-bright);
    pointer-events: none;
}

/* ====================================================
   TABLE RESPONSIVE
   ==================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ====================================================
   RESPONSIVE — Tablet (769px – 1024px)
   ==================================================== */
@media (max-width: 1024px) and (min-width: 769px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ====================================================
   RESPONSIVE — Desktop hide mobile-only elements
   ==================================================== */
@media (min-width: 769px) {

    .mobile-nav,
    .mobile-header,
    .menu-toggle {
        display: none !important;
    }
}

/* ====================================================
   RESPONSIVE — Mobile (≤ 768px)
   ==================================================== */
@media (max-width: 768px) {
    :root {
        --sidebar-w: 0px;
        --topnav-h: 50px;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 260px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .topnav {
        display: none;
    }

    .main-content {
        padding: 14px 16px 76px;
    }

    .mobile-header {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 18px;
    }

    .mobile-logo {
        font-family: var(--font-heading);
        font-size: 1.1rem;
        font-weight: 900;
        letter-spacing: .04em;
        text-transform: uppercase;
        display: flex;
        align-items: center;
        gap: 8px;
        background: var(--gradient-accent);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        white-space: nowrap;
    }

    .mobile-logo .icon-svg {
        width: 20px;
        height: 20px;
        -webkit-text-fill-color: initial;
        color: var(--accent-bright);
    }

    .mobile-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-panel);
        border-top: 1px solid var(--border);
        height: var(--mobile-nav-h);
        justify-content: space-around;
        align-items: center;
        z-index: 200;
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        color: var(--text-3);
        font-size: .52rem;
        font-weight: 700;
        gap: 3px;
        padding: 6px 2px;
        text-decoration: none;
        transition: color .15s;
        text-transform: uppercase;
        letter-spacing: .5px;
    }

    .mobile-nav-item.active {
        color: var(--accent-bright);
    }

    .mobile-nav-item .icon-svg {
        width: 20px;
        height: 20px;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .hero-section {
        padding: 40px 16px 36px;
    }

    .hero-stats {
        gap: 32px;
    }

    .hero-cta .btn {
        width: 100%;
        min-width: auto;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    /* ── Brackets Mobile — Formato lista vertical ── */
    .bracket-container {
        flex-direction: column;
        gap: 36px;
        padding: 24px 16px;
        overflow-x: hidden;
        scroll-snap-type: none;
    }

    .bracket-container::-webkit-scrollbar {
        display: none;
    }

    .bracket-round {
        display: flex;
        flex-direction: column;
        width: 100%;
        min-width: 100%;
        gap: 16px;
        flex-shrink: 0;
        scroll-snap-align: none;
        position: relative;
    }

    .bracket-round-header {
        position: static;
        font-size: 1.05rem;
        font-weight: 800;
        letter-spacing: 1px;
        text-transform: uppercase;
        color: var(--accent-light);
        margin-bottom: 4px;
        border-bottom: 2px solid rgba(255, 255, 255, 0.08);
        padding-bottom: 10px;
        text-align: left;
        opacity: 1;
    }

    .bracket-match-wrapper {
        display: block;
        width: 100%;
        position: relative;
    }

    .bracket-match {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        border-radius: 12px;
        background: var(--bg-card);
        border: 1px solid rgba(255, 255, 255, 0.08);
        overflow: hidden;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
        margin: 0;
        flex-shrink: 0;
    }

    .bracket-match .bracket-team:first-child {
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .bracket-team {
        display: flex;
        align-items: center;
        padding: 14px 16px;
        gap: 12px;
        font-size: 0.85rem;
        transition: background 0.15s;
    }

    .bracket-team.winner {
        background: rgba(99, 210, 140, 0.06);
    }

    .bracket-team.winner .team-name {
        color: #63d28c;
        font-weight: 700;
    }

    .bracket-team.winner .bracket-score {
        color: #63d28c;
        background: rgba(99, 210, 140, 0.15);
    }

    .bracket-team.loser {
        opacity: 0.5;
    }

    .bracket-team .team-seed {
        font-size: 0.65rem;
        color: #666;
        min-width: 14px;
        text-align: center;
    }

    .bracket-team .team-logo {
        width: 22px;
        height: 22px;
        border-radius: 50%;
        object-fit: contain;
        flex-shrink: 0;
    }

    .bracket-team .team-name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        flex: 1;
        font-size: 0.85rem;
        color: #dde1ef;
        letter-spacing: 0.2px;
    }

    .bracket-score {
        font-size: 0.9rem;
        font-weight: 800;
        min-width: 32px;
        text-align: center;
        flex-shrink: 0;
        color: #c8cce0;
        background: rgba(255, 255, 255, 0.06);
        padding: 5px 8px;
        border-radius: 6px;
        margin-left: auto;
    }

    .bracket-round:not(:last-child) .bracket-match::after,
    .bracket-round:not(:first-child) .bracket-match::before,
    .bracket-round:not(:last-child) .bracket-match:nth-child(odd)::after,
    .bracket-round:not(:last-child) .bracket-match:nth-child(even)::after {
        display: none !important;
    }

    .bracket-scroll-hint {
        display: none !important;
    }

    .bracket-team.tbd .team-name {
        color: #666;
        font-style: italic;
    }

    .bracket-team.tbd .bracket-score {
        color: #444;
        background: transparent;
    }

    .bracket-round.active .bracket-round-header {
        color: #63d28c;
        border-color: rgba(99, 210, 140, 0.3);
    }

    .bracket-round.active .bracket-match {
        border-color: rgba(99, 210, 140, 0.25);
    }
}