@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700;800;900&display=swap');

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

:root {
    --primary: #00e5a0;
    --primary-dark: #00b87a;
    --primary-glow: rgba(0, 229, 160, 0.25);
    --accent: #7c3aed;
    --accent-glow: rgba(124, 58, 237, 0.2);
    --blue: #3b82f6;
    --dark: #060b14;
    --dark-light: #0d1525;
    --dark-lighter: #162035;
    --dark-card: rgba(13, 21, 37, 0.8);
    --text: #f0f4ff;
    --text-gray: #6b7fa3;
    --text-muted: #3d4f6e;
    --border: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(0, 229, 160, 0.3);
    --gold: #f59e0b;
    --silver: #94a3b8;
    --bronze: #cd7f32;
}

body.light {
    --dark: #e8edf5;
    --dark-light: #0d1525;
    --dark-lighter: #162035;
    --dark-card: rgba(255, 255, 255, 0.95);
    --text: #2d3748;
    --text-gray: #4a5568;
    --text-muted: #7a8fa8;
    --border: rgba(0, 0, 0, 0.09);
    --border-hover: rgba(0, 180, 120, 0.45);
    --primary-glow: rgba(0, 184, 122, 0.25);
}

/* Gradient — mocny, widoczny na jasnym tle */
body.light::before {
    background:
        radial-gradient(ellipse 90% 60% at 5% 0%, rgba(0, 229, 160, 0.22) 0%, transparent 50%),
        radial-gradient(ellipse 70% 50% at 95% 100%, rgba(124, 58, 237, 0.18) 0%, transparent 50%),
        radial-gradient(ellipse 50% 40% at 50% 50%, rgba(59, 130, 246, 0.10) 0%, transparent 60%);
}

/* Navbar — zawsze ciemny */
body.light .navbar {
    background: rgba(6, 11, 20, 0.95);
    border-bottom-color: rgba(0, 229, 160, 0.15);
}

/* Przyciski w navbarze — muszą być widoczne na ciemnym tle */
body.light .navbar .btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #f0f4ff;
}
body.light .navbar .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.25);
}

/* Karty — białe z wyraźnym cieniem */
body.light .card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.07);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10), 0 1px 4px rgba(0, 0, 0, 0.06);
}
body.light .card-glow:hover {
    box-shadow: 0 0 30px rgba(0, 229, 160, 0.18), 0 20px 40px rgba(0, 0, 0, 0.13);
}

body.light .glass {
    background: rgba(255, 255, 255, 0.80);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
body.light .glass-hover:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), 0 0 30px rgba(0, 229, 160, 0.12);
}

/* Karty eventów (hardcoded w dashboard) */
body.light .event-card {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.09);
    color: #2d3748;
}
body.light .event-card:hover {
    background: #fff !important;
    border-color: rgba(0, 229, 160, 0.35) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), 0 0 30px rgba(0, 229, 160, 0.12) !important;
}
body.light .event-card .event-footer {
    border-top-color: rgba(0, 0, 0, 0.07);
}
body.light .event-card .event-date { color: #7a8fa8; }

/* Empty card */
body.light .empty-card {
    background: rgba(255,255,255,0.7) !important;
    border-color: rgba(0,0,0,0.1) !important;
}

/* Osiągnięcia — hardcoded rgba(255,255,255,0.04) w JS */
body.light #achievementModal > div {
    background: linear-gradient(145deg, #ffffff, #f8fafc) !important;
    border-color: rgba(0,180,120,0.2) !important;
}
body.light #achievementModal > div > div:first-child {
    background: linear-gradient(135deg, rgba(0,229,160,0.08), rgba(59,130,246,0.05)) !important;
    border-bottom-color: rgba(0,0,0,0.07) !important;
}
body.light #achievementModal #achModalTitle { color: #2d3748; }
body.light #achievementModal button {
    background: rgba(0,0,0,0.06) !important;
    color: #4a5568 !important;
}
body.light #achievementsList > div {
    background: rgba(0, 0, 0, 0.05) !important;
    border-color: rgba(0, 0, 0, 0.10) !important;
    color: #2d3748;
}
body.light #achievementsList > div:hover {
    background: rgba(0, 0, 0, 0.09) !important;
}
body.light #streakBadge {
    background: linear-gradient(135deg, rgba(245,158,11,0.18), rgba(251,191,36,0.10)) !important;
    border-color: rgba(245,158,11,0.35) !important;
}

/* Formularze */
body.light input, body.light textarea, body.light select {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.12);
    color: #2d3748;
}
body.light input::placeholder { color: #94a3b8; }
body.light input:focus, body.light textarea:focus, body.light select:focus {
    background: #fff;
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 3px rgba(0, 184, 122, 0.14);
}
body.light label { color: #4a5568; }

/* Przyciski poza navbarem */
body.light .btn-secondary {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.13);
    color: #1e293b;
}
body.light .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.10);
    border-color: rgba(0, 0, 0, 0.20);
}
body.light .btn-ghost { color: #4a5568; }
body.light .btn-ghost:hover { color: #2d3748; border-color: rgba(0,0,0,0.15); }

/* Badge */
body.light .badge-secondary {
    background: rgba(0, 0, 0, 0.07);
    color: #4a5568;
    border-color: rgba(0, 0, 0, 0.11);
}

/* Tabela */
body.light th {
    background: rgba(0, 0, 0, 0.03);
    color: #64748b;
    border-bottom-color: rgba(0, 0, 0, 0.08);
}
body.light td { border-bottom-color: rgba(0, 0, 0, 0.05); }
body.light tr:hover td { background: rgba(0, 229, 160, 0.05); }

/* Modal */
body.light .modal-content {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-color: rgba(0, 180, 120, 0.2);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
}
body.light .modal-header {
    background: linear-gradient(135deg, rgba(0, 229, 160, 0.09), rgba(59, 130, 246, 0.05));
    border-bottom-color: rgba(0, 0, 0, 0.07);
}
body.light .modal-close { background: rgba(0,0,0,0.06); color: #4a5568; }
body.light .modal-close:hover { background: rgba(0,0,0,0.12); color: #2d3748; }
body.light .modal-content input, body.light .modal-content textarea, body.light .modal-content select {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.12);
}

/* Toast */
body.light .toast {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* Cookie banner */
body.light #cookieBanner {
    background: rgba(255, 255, 255, 0.97);
    border-color: rgba(0, 180, 120, 0.2);
}

/* Info badge, tabs */
body.light .info-badge { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.09); }
body.light .tabs { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.09); }

/* Event title gradient */
body.light .event-title {
    background: linear-gradient(135deg, #2d3748 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

/* Footer — zawsze ciemny */
body.light .site-footer {
    background: rgba(6, 11, 20, 0.95);
    border-top-color: rgba(0, 229, 160, 0.1) !important;
}
body.light .site-footer a,
body.light .site-footer span,
body.light .site-footer button { color: #6b7fa3 !important; }

/* Scrollbar */
body.light ::-webkit-scrollbar-track { background: #e8edf5; }
body.light ::-webkit-scrollbar-thumb { background: #c0ccd8; }

/* Chat bubbles */
body.light #chatMessages > div > div[style*="rgba(255,255,255,0.06)"] {
    background: rgba(0,0,0,0.05) !important;
    color: #2d3748 !important;
}

/* Chat reaction picker */
body.light [id^="picker-"] {
    background: #ffffff !important;
    border-color: rgba(0,0,0,0.1) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15) !important;
}

/* Notification dropdown */
body.light #notifDropdown {
    background: #ffffff !important;
    border-color: rgba(0,0,0,0.1) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15) !important;
    color: #2d3748;
}

/* Country dropdown */
body.light .country-dropdown {
    background: #ffffff !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15) !important;
}
body.light .country-dropdown input {
    background: #f8fafc !important;
    color: #2d3748 !important;
    border-bottom-color: rgba(0,0,0,0.09) !important;
}
body.light .country-dropdown > div {
    background: #ffffff !important;
}

/* Event detail — ranking cards (hardcoded var(--dark-light)) */
body.light #rankingContainer > div > div {
    background: #ffffff !important;
    border-color: rgba(0,0,0,0.08) !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

/* Participant rows in ranking modal (hardcoded rgba(255,255,255,0.03)) */
body.light #participantsContainer > div {
    background: #f8fafc !important;
    border-color: rgba(0,0,0,0.08) !important;
}

/* Chart modal */
body.light #chartModal > div {
    background: linear-gradient(145deg, #ffffff, #f8fafc) !important;
    border-color: rgba(0,180,120,0.2) !important;
}
body.light #chartModal > div > div:first-child {
    background: linear-gradient(135deg, rgba(0,229,160,0.08), rgba(59,130,246,0.05)) !important;
    border-bottom-color: rgba(0,0,0,0.07) !important;
}
body.light #chartContainer {
    background: rgba(0,0,0,0.03) !important;
}
body.light #chartLegend > div {
    background: rgba(0,0,0,0.04) !important;
    border-color: rgba(0,0,0,0.09) !important;
}
/* Chart SVG grid lines and labels */
body.light #chartContainer line {
    stroke: rgba(0,0,0,0.08) !important;
}
body.light #chartContainer text {
    fill: rgba(0,0,0,0.35) !important;
}

/* Flags — border so white flags are visible on light bg */
body.light [style*="flagcdn.com"] {
    box-shadow: 0 0 0 1px rgba(0,0,0,0.12);
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Sora', 'Inter', sans-serif;
    background: var(--dark);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 10% 0%, rgba(0, 229, 160, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 90% 100%, rgba(124, 58, 237, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 40% 30% at 50% 50%, rgba(59, 130, 246, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--dark); }
::-webkit-scrollbar-thumb { background: var(--dark-lighter); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }

/* ─── CONTAINER ─── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* ─── NAVBAR ─── */
.navbar {
    background: rgba(6, 11, 20, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    padding-top: max(14px, env(safe-area-inset-top));
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 800;
    text-decoration: none;
    color: var(--text);
    letter-spacing: -0.5px;
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px var(--primary-glow);
    font-size: 18px;
    color: var(--dark);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, #34d399 50%, var(--primary) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    to { background-position: 200% center; }
}

/* ─── BUTTONS ─── */
.btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    font-size: 14px;
    font-family: 'Sora', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background 0.2s;
}

.btn:hover::after {
    background: rgba(255,255,255,0.05);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--dark);
    font-weight: 700;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px var(--primary-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-ghost {
    background: transparent;
    color: var(--text-gray);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    color: var(--text);
    border-color: var(--border);
}

/* ─── FORMS ─── */
input, textarea, select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: 'Sora', sans-serif;
    font-size: 14px;
    transition: all 0.2s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 229, 160, 0.04);
    box-shadow: 0 0 0 3px rgba(0, 229, 160, 0.1);
}

input::placeholder { color: var(--text-muted); }

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-gray);
    letter-spacing: 0.3px;
}

/* ─── AUTH ─── */
.auth-page {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    overflow-y: auto;
}

body:has(.auth-page) .site-footer { display: none; }

@media (max-width: 768px) {
    .auth-page { align-items: flex-start; position: static; min-height: calc(100dvh - 72px); }
}

/* ─── CARDS ─── */
.card {
    background: var(--dark-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    position: relative;
}

.card-glow {
    transition: all 0.3s ease;
}

.card-glow:hover {
    border-color: var(--border-hover);
    box-shadow: 0 0 30px rgba(0, 229, 160, 0.08), 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

/* ─── GLASS ─── */
.glass {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.glass-hover {
    transition: all 0.3s ease;
}

.glass-hover:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(0, 229, 160, 0.06);
}

/* ─── BADGE ─── */
.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.badge-primary {
    background: rgba(0, 229, 160, 0.15);
    color: var(--primary);
    border: 1px solid rgba(0, 229, 160, 0.2);
}

.badge-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-gray);
    border: 1px solid var(--border);
}

/* ─── UTILITIES ─── */
.text-center { text-align: center; }
.text-gray { color: var(--text-gray); }
.text-primary { color: var(--primary); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* ─── NUMBER INPUTS ─── */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] { -moz-appearance: textfield; }

/* ─── ANIMATIONS ─── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes guide-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0,229,160,0.5); }
    50% { box-shadow: 0 0 0 6px rgba(0,229,160,0); }
}
.guide-pulse { animation: guide-pulse 1.5s ease infinite; }

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px var(--primary-glow); }
    50% { box-shadow: 0 0 40px rgba(0, 229, 160, 0.4); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes count-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.4s ease both; }
.slide-up { animation: slideUp 0.4s ease both; }
.scale-in { animation: scaleIn 0.3s ease both; }

/* Staggered children */
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 60ms; }
.stagger > *:nth-child(3) { animation-delay: 120ms; }
.stagger > *:nth-child(4) { animation-delay: 180ms; }
.stagger > *:nth-child(5) { animation-delay: 240ms; }

/* ─── TOAST ─── */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.toast {
    position: relative;
    background: var(--dark-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
    min-width: 280px;
    max-width: 360px;
    opacity: 0;
    transform: translateX(420px);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success { border-left: 3px solid var(--primary); }
.toast-error { border-left: 3px solid #ef4444; }
.toast-info { border-left: 3px solid var(--blue); }

.toast i { font-size: 18px; flex-shrink: 0; }
.toast-success i { color: var(--primary); }
.toast-error i { color: #ef4444; }
.toast-info i { color: var(--blue); }

.toast span { font-size: 14px; font-weight: 500; line-height: 1.4; }

/* ─── TABLE ─── */
table { border-collapse: collapse; width: 100%; }

th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border);
}

td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 14px;
}

tr:last-child td { border-bottom: none; }

tr { transition: background 0.15s; }
tr:hover td { background: rgba(0, 229, 160, 0.03); }

/* ─── SCORE DISPLAY ─── */
.score-vs {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.score-num {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    min-width: 28px;
    text-align: center;
}

.score-sep {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 18px;
}

/* ─── SECTION TITLE ─── */
.section-title {
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
    letter-spacing: -0.3px;
}

.section-title i { color: var(--primary); }

/* ─── EMPTY STATE ─── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 40px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: block;
}

/* ─── PENDING CARD ─── */
.pending-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(59, 130, 246, 0.04);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 12px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.pending-card:hover {
    background: rgba(59, 130, 246, 0.07);
    border-color: rgba(59, 130, 246, 0.25);
}

/* ─── EVENT HEADER ─── */
.event-header {
    background: linear-gradient(135deg, rgba(0, 229, 160, 0.07) 0%, rgba(124, 58, 237, 0.05) 100%);
    border: 1px solid rgba(0, 229, 160, 0.15);
    border-radius: 20px;
    padding: 36px;
    position: relative;
    overflow: hidden;
}

.event-header::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(0, 229, 160, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.event-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -1px;
    line-height: 1.1;
    background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── INFO BADGE ─── */
.info-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
    transition: all 0.2s;
}

.info-badge:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
}

.invite-code {
    background: rgba(0, 229, 160, 0.12);
    padding: 4px 12px;
    border-radius: 6px;
    color: var(--primary);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 2px;
    border: 1px solid rgba(0, 229, 160, 0.2);
    font-family: 'Courier New', monospace;
}

/* ─── TABS ─── */
.tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 4px;
    border: 1px solid var(--border);
    gap: 4px;
}

.tab-btn {
    padding: 9px 20px;
    font-size: 13px;
    border-radius: 9px;
    margin: 0;
    font-weight: 600;
    transition: all 0.25s ease;
}

.tab-btn:active { transform: scale(0.93); }

.lock-active {
    background: rgba(239,68,68,0.15) !important;
    color: #ef4444 !important;
    border-color: rgba(239,68,68,0.35) !important;
    box-shadow: 0 0 10px rgba(239,68,68,0.25);
}

/* ─── MATCH EDIT SECTION ─── */
.match-edit-section {
    background: rgba(0, 229, 160, 0.03);
    border: 1px solid rgba(0, 229, 160, 0.12);
    border-radius: 16px;
    padding: 24px;
}

/* ─── POINTS BADGE ─── */
.points-3 { color: var(--primary); font-weight: 800; }
.points-1 { color: var(--gold); font-weight: 800; }
.points-0 { color: #ef4444; font-weight: 700; }

/* ─── RANK BADGE ─── */
.rank-1 { background: rgba(245, 158, 11, 0.15); color: var(--gold); border: 1px solid rgba(245, 158, 11, 0.25); }
.rank-2 { background: rgba(148, 163, 184, 0.15); color: var(--silver); border: 1px solid rgba(148, 163, 184, 0.25); }
.rank-3 { background: rgba(205, 127, 50, 0.15); color: var(--bronze); border: 1px solid rgba(205, 127, 50, 0.25); }

/* ─── MODAL ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-content {
    max-width: 500px;
    width: 100%;
    animation: scaleIn 0.25s ease;
    background: linear-gradient(145deg, #0f1923, #111827);
    border: 1px solid rgba(0,229,160,0.15);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}

.modal-header {
    padding: 22px 24px 18px;
    background: linear-gradient(135deg, rgba(0,229,160,0.08), rgba(59,130,246,0.05));
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.modal-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), #34d399);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-icon i { color: #000; font-size: 15px; }

.modal-icon.red { background: linear-gradient(135deg, #ef4444, #f87171); }
.modal-icon.blue { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.modal-icon.yellow { background: linear-gradient(135deg, #f59e0b, #fbbf24); }

.modal-title { font-size: 16px; font-weight: 800; letter-spacing: -0.3px; }
.modal-sub { font-size: 12px; color: var(--text-gray); margin-top: 2px; }

.modal-close {
    background: rgba(255,255,255,0.06);
    border: none;
    color: var(--text-gray);
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}
.modal-close:hover { background: rgba(255,255,255,0.12); color: var(--text); }

.modal-body {
    padding: 22px 24px;
}

.modal-content input,
.modal-content textarea,
.modal-content select {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.1);
}

/* ─── FLATPICKR OVERRIDE ─── */
.flatpickr-calendar {
    background: var(--dark-light) !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5) !important;
    font-family: 'Sora', sans-serif !important;
}
.flatpickr-months,
.flatpickr-month {
    background: var(--dark-light) !important;
    color: var(--text) !important;
    fill: var(--text) !important;
}
.flatpickr-current-month,
.flatpickr-current-month .cur-month,
.flatpickr-current-month input.cur-year {
    color: var(--text) !important;
    font-weight: 700 !important;
}
.flatpickr-prev-month, .flatpickr-next-month {
    fill: var(--text) !important;
    color: var(--text) !important;
}
.flatpickr-prev-month:hover svg, .flatpickr-next-month:hover svg {
    fill: var(--primary) !important;
}
.flatpickr-weekdays {
    background: var(--dark-light) !important;
}
.flatpickr-weekday {
    background: var(--dark-light) !important;
    color: var(--text-gray) !important;
    font-weight: 600 !important;
}
.flatpickr-day {
    color: var(--text) !important;
    border-radius: 8px !important;
}
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: rgba(255,255,255,0.2) !important;
}
.flatpickr-day.today {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #060b14 !important;
    font-weight: 700 !important;
}
.flatpickr-day:hover {
    background: rgba(0,229,160,0.15) !important;
    color: var(--text) !important;
}
.flatpickr-time {
    background: var(--dark-light) !important;
    border-top: 1px solid var(--border) !important;
}
.flatpickr-time input,
.flatpickr-time .flatpickr-am-pm {
    color: var(--text) !important;
    background: var(--dark-light) !important;
    font-weight: 600 !important;
}
.flatpickr-time input:hover,
.flatpickr-time input:focus {
    background: rgba(0,229,160,0.08) !important;
}
.numInputWrapper span.arrowUp:after {
    border-bottom-color: var(--text) !important;
}
.numInputWrapper span.arrowDown:after {
    border-top-color: var(--text) !important;
}

/* Flatpickr light mode */
body.light .flatpickr-calendar {
    background: #ffffff !important;
    border-color: rgba(0,0,0,0.1) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12) !important;
}
body.light .flatpickr-months,
body.light .flatpickr-month,
body.light .flatpickr-weekdays,
body.light .flatpickr-weekday {
    background: #f8fafc !important;
    color: #2d3748 !important;
    fill: #2d3748 !important;
}
body.light .flatpickr-current-month,
body.light .flatpickr-current-month .cur-month,
body.light .flatpickr-current-month input.cur-year {
    color: #2d3748 !important;
}
body.light .flatpickr-prev-month,
body.light .flatpickr-next-month {
    fill: #2d3748 !important;
    color: #2d3748 !important;
}
body.light .flatpickr-day {
    color: #2d3748 !important;
}
body.light .flatpickr-day.flatpickr-disabled,
body.light .flatpickr-day.prevMonthDay,
body.light .flatpickr-day.nextMonthDay {
    color: rgba(0,0,0,0.2) !important;
}
body.light .flatpickr-day:hover {
    background: rgba(0,184,122,0.12) !important;
    color: #2d3748 !important;
}
body.light .flatpickr-time,
body.light .flatpickr-time input,
body.light .flatpickr-time .flatpickr-am-pm {
    background: #f8fafc !important;
    color: #2d3748 !important;
    border-top-color: rgba(0,0,0,0.08) !important;
}
body.light .flatpickr-time input:hover,
body.light .flatpickr-time input:focus {
    background: rgba(0,184,122,0.08) !important;
}
body.light .numInputWrapper span.arrowUp:after {
    border-bottom-color: #2d3748 !important;
}
body.light .numInputWrapper span.arrowDown:after {
    border-top-color: #2d3748 !important;
}

/* ─── COUNTRY DROPDOWN ─── */
.country-dropdown {
    background: var(--dark-light);
    border: 1px solid var(--primary);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.6);
}

/* ─── LOADING SKELETON ─── */
@keyframes skeleton-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

.skeleton {
    background: var(--dark-lighter);
    border-radius: 8px;
    animation: skeleton-pulse 1.5s ease infinite;
}

/* Chat drawer */
@keyframes chatPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.6; }
}

body.light #chatDrawer {
    background: #ffffff !important;
    border-color: rgba(0,0,0,0.1) !important;
}
body.light #chatDrawer input {
    background: #f1f5f9;
    color: #2d3748;
    border-color: rgba(0,0,0,0.15);
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — mobile & small screens
   ═══════════════════════════════════════════════ */

/* ─── Bottom nav (mobile only) ─── */
.bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 200;
        background: rgba(6, 11, 20, 0.97);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border-top: 1px solid var(--border);
        padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    }

    .bottom-nav > div {
        display: flex;
        width: 100%;
        justify-content: space-around;
        align-items: center;
    }

    .bottom-nav a,
    .bottom-nav button {
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--text-gray);
        text-decoration: none;
        background: none;
        border: none;
        cursor: pointer;
        padding: 8px 16px;
        border-radius: 10px;
        transition: color 0.2s;
        position: relative;
        flex: 1;
    }

    .bottom-nav a i,
    .bottom-nav button i { font-size: 22px; }

    .bottom-nav a:hover,
    .bottom-nav button:hover,
    .bottom-nav a.active { color: var(--primary); }

    .bottom-nav .bnav-badge {
        position: absolute;
        top: 0;
        right: 6px;
        min-width: 16px;
        height: 16px;
        background: #ef4444;
        color: #fff;
        border-radius: 8px;
        font-size: 9px;
        font-weight: 700;
        line-height: 16px;
        text-align: center;
        padding: 0 3px;
    }

    .navbar-desktop-only { display: none !important; }
    .navbar { padding: 10px 0; padding-top: max(10px, env(safe-area-inset-top)); min-height: 75px; display: flex; align-items: center; }
    .navbar-content { position: relative; min-height: 55px; }
    .navbar-content > a.logo { position: absolute; left: 50%; transform: translateX(-50%); }
    body { padding-bottom: var(--bottom-nav-h, 72px); overflow-x: hidden; }
    html { overflow-x: hidden; }
    .site-footer { display: none; }
    .container { padding: 0 8px; }

    .page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }
    .page-title, .page-sub { text-align: center; width: 100%; }
    .page-header > div:last-child { width: 100%; display: flex; gap: 8px; }
    .page-header > div:last-child .btn { flex: 1; justify-content: center; }

    #statsRow { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }

    .card { padding: 14px !important; }
    .event-header { padding: 14px !important; }
    .event-title { font-size: 20px !important; }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -8px;
        padding: 0 8px;
    }
    table { min-width: 540px; }
    th, td { padding: 10px 8px !important; font-size: 12px !important; white-space: nowrap; }
    .score-num { font-size: 16px !important; min-width: 18px !important; }

    /* Flatpickr mobile native inputs */
    input.flatpickr-mobile { width: 100% !important; max-width: 100% !important; box-sizing: border-box !important; }

    .tabs { overflow-x: auto; flex-wrap: nowrap !important; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .tabs::-webkit-scrollbar { display: none; }
    .tab-btn { padding: 8px 12px !important; font-size: 12px !important; white-space: nowrap; }
    .tab-label { display: none; }
    .btn-label { display: none; }

    .modal-content {
        max-width: calc(100% - 24px) !important;
        max-height: 85vh;
        overflow-y: auto;
    }

    .toast-container { top: auto !important; bottom: 80px; right: 12px; left: 12px; align-items: stretch; }
    .toast { min-width: unset !important; max-width: 100% !important; }

    .section-title { font-size: 16px !important; }

    #chatDrawer { width: 100% !important; border-radius: 0 !important; }
    #chatFab { bottom: 84px !important; }

    .match-edit-section { padding: 14px 10px !important; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .container { padding: 0 16px; }
    #statsRow { grid-template-columns: repeat(2, 1fr) !important; }
    .event-title { font-size: 26px !important; }
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 580px; }
}

body.light .bottom-nav { background: rgba(6, 11, 20, 0.97); }
