:root {
    color-scheme: dark;
    font-family: Inter, Arial, sans-serif;
    background: #020617;
    color: #e8f1ff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: radial-gradient(circle at top, rgba(32,103,255,0.16), transparent 40%),
                linear-gradient(180deg, #020617 0%, #050a1e 100%);
}

a {
    color: #61dafb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    position: sticky;
    top: 0;
    background: rgba(3, 10, 26, 0.95);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    z-index: 10;
}

.brand {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.main-nav a {
    margin-left: 18px;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.main-nav a:hover {
    color: #8c9eff;
}

.page-shell {
    max-width: 1160px;
    margin: 0 auto;
    padding: 32px 24px 48px;
}

.flash-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 24px;
}

.flash {
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
}

.flash-success { border-color: #29d6be; }
.flash-danger { border-color: #ff7b72; }
.flash-warning { border-color: #ffc85c; }

.hero {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    padding: 36px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px;
    margin-bottom: 32px;
}

.hero h1 {
    margin: 0 0 12px;
    font-size: 2.6rem;
}

.hero p {
    max-width: 520px;
    line-height: 1.6;
    color: #c8d2ff;
}

.grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 22px;
    padding: 24px;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(97,218,251,0.4);
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.status {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.status.approved { background: rgba(64, 255, 192, 0.16); color: #b7ffe1; }

.meta {
    margin: 0 0 16px;
    color: #9bb7ff;
}

.players-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.players-list li {
    padding: 12px 14px;
    background: rgba(255,255,255,0.04);
    border-radius: 14px;
}

.empty-state {
    padding: 40px;
    background: rgba(255,255,255,0.03);
    border: 1px dashed rgba(255,255,255,0.12);
    border-radius: 20px;
    text-align: center;
}

.form-panel, .logs-panel, .match-page, .bracket-shell {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 24px;
    padding: 28px;
}

.form-card {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.form-card label {
    font-weight: 600;
    color: #b4c1ff;
}

.form-card input, .form-card select {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    background: rgba(255,255,255,0.06);
    padding: 14px 16px;
    color: #f7f9ff;
}

.form-card button, .button, .ghost-button {
    border: none;
    cursor: pointer;
    border-radius: 14px;
    padding: 14px 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #45b8ff, #7d5cff);
    color: white;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.form-card button:hover, .button:hover, .ghost-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.ghost-button {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: #d2e1ff;
}

.admin-dashboard {
    display: grid;
    gap: 18px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 24px 0;
}

.tab-button {
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: #e9f0ff;
    padding: 12px 18px;
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.tab-button.active {
    background: linear-gradient(135deg, #45b8ff, #7d5cff);
    color: white;
}

.tab-button:hover {
    transform: translateY(-1px);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

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

.row {
    display: grid;
    grid-template-columns: 60px 1.6fr 1.6fr 1.2fr 1fr 1.8fr;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.header {
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3ff;
}

.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-buttons form {
    display: inline;
}

.action-buttons button {
    padding: 10px 14px;
    background: #2b3e75;
    color: white;
}

.action-buttons .warn { background: #ff8a8a; }
.action-buttons .danger { background: #ff4b6e; }

.button-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.match-list, .log-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.match-list li, .log-list li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.bracket-tree {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.bracket-column {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 22px;
    padding: 20px;
}

.bracket-column h2 {
    margin-top: 0;
    color: #b1c4ff;
}

.match-card {
    display: block;
    text-decoration: none;

    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 16px;

    transition: transform 0.2s ease, border-color 0.2s ease;
}

.match-card:hover {
    transform: translateY(-2px);
    border-color: rgba(97,218,251,0.5);
    text-decoration: none;
}

.match-card.winner {
    border-color: #72ffce;
    box-shadow: 0 0 20px rgba(114,255,206,0.12);
}

.match-meta {
    display: block;
    margin-top: 8px;
    color: #a8b8ff;
}

.twitch-frame {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    margin-top: 24px;
    min-height: 420px;
    background: #050a1d;
}

.twitch-frame iframe {
    width: 100%;
    min-height: 420px;
    border: 0;
}

.stream-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff8a8a;
    font-size: 1.1rem;
    background: rgba(0, 0, 0, 0.65);
}

.hidden {
    display: none;
}

@media (max-width: 900px) {
    .topbar { flex-direction: column; align-items: flex-start; }
    .bracket-tree { grid-template-columns: 1fr; }
    .row { grid-template-columns: 1fr; }
}

/* ===== NEW SIDEBAR SYSTEM ===== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: rgba(3, 10, 26, 0.95);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    z-index: 1000;
}

.menu-btn {
    font-size: 22px;
    background: none;
    border: none;
    color: #e8f1ff;
    cursor: pointer;
}

.sidebar {
    position: fixed;
    top: 0;
    left: -260px;
    width: 260px;
    height: 100%;
    background: #050a1e;
    padding: 80px 20px 20px;
    transition: 0.3s ease;
    z-index: 1100;
}

.sidebar.active {
    left: 0;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar a {
    padding: 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 1050;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Content spacing wegen navbar */
.page-content {
    padding: 100px 24px 40px;
}

.match-teams {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.team-name {
    font-weight: 600;
    color: #eaf2ff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.score {
    font-weight: 800;
    color: #61dafb;
    font-size: 1.1rem;
    min-width: 24px;
    text-align: right;
}

.vs {
    text-align: center;
    font-size: 0.75rem;
    opacity: 0.5;
    letter-spacing: 0.25em;
}