:root {
    --green: #1fff87;
    --purple: #a044ff;
    --gold: #ffca28;
    --bg: #080510;
    --card: #100c18;
    --card2: #130f1e;
    --border: rgba(160, 68, 255, 0.18);
    --red: #ff4d4d;
    --blue: #4fc3f7;

    --ink-1: #f4f4f8;
    --ink-2: #a8adc2;
    --ink-3: #767c94;
    --ink-4: #4a4f66;
    --purple-soft: #c9a3ff;
    --green-soft: #7dffbf;
    --gold-soft: #ffdb7a;

    --panel: #0e0a18;
    --panel-border: #241a3a;
    --line: rgba(160, 68, 255, 0.35);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    background: var(--bg);
    color: var(--ink-1);
    font-family: 'Inter', sans-serif;
    height: 100%;
    overflow: hidden;
}

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--panel-border); border-radius: 7px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple); }

/* ── AMBIENT BACKGROUND ─────────────────────────── */
.bg-glow {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(50% 40% at 15% 0%, rgba(160,68,255,0.14), transparent 60%),
        radial-gradient(45% 35% at 100% 100%, rgba(31,255,135,0.08), transparent 60%);
}
.bg-particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-particle {
    position: absolute; border-radius: 50%;
    background: var(--purple);
    animation: floaty linear infinite;
}
@keyframes floaty {
    0%   { transform: translateY(0) translateX(0); }
    50%  { transform: translateY(-30px) translateX(12px); }
    100% { transform: translateY(0) translateX(0); }
}

/* ── LAYOUT ──────────────────────────────────────── */
.main-layout { position: relative; z-index: 1; display: flex; height: 100vh; }

/* ── SIDEBAR ─────────────────────────────────────── */
.sidebar {
    width: 320px; flex-shrink: 0;
    background: #0b0715;
    border-right: 1px solid var(--border);
    padding: 26px 22px 22px;
    display: flex; flex-direction: column;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 26px; padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.sidebar-brand img { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; }
.sidebar-brand span {
    font-family: 'Rajdhani', sans-serif; font-size: 20px; font-weight: 800;
    letter-spacing: 2.5px; color: var(--purple-soft);
}

.control-group { margin-bottom: 22px; }
.label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.label-row label {
    font-size: 10px; font-weight: 800; color: var(--ink-3);
    text-transform: uppercase; letter-spacing: 1.8px;
}

.count-badge {
    font-family: 'Rajdhani', sans-serif; font-size: 13px; font-weight: 800;
    color: var(--ink-3); background: var(--panel); border: 1px solid var(--panel-border);
    padding: 2px 9px; border-radius: 20px; transition: 0.2s;
}
.count-badge.valid   { color: #05170c; background: var(--green); border-color: var(--green); }
.count-badge.invalid { color: var(--red); border-color: rgba(255,77,77,0.4); background: rgba(255,77,77,0.08); }

.input-hint { font-size: 10.5px; color: var(--ink-4); margin-bottom: 9px; line-height: 1.5; min-height: 16px; }

@keyframes flashField {
    0%, 100% { border-color: var(--panel-border); }
    40% { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31,255,135,0.15); }
}

/* ── ROSTER INPUT ───────────────────────────────── */
.add-row { display: flex; gap: 6px; margin-bottom: 8px; }
.add-input {
    flex: 1; min-width: 0;
    background: var(--panel); border: 1px solid var(--panel-border); color: var(--ink-1);
    padding: 10px 11px; border-radius: var(--radius-sm);
    font: 600 13px 'Inter', sans-serif; transition: border-color 0.2s;
}
.add-input:focus { border-color: var(--purple); outline: none; }
.add-input::placeholder { color: var(--ink-4); }
.add-input.bad { border-color: var(--red); animation: flashField 0.4s ease; }
.add-btn {
    width: 40px; flex-shrink: 0; border: none; cursor: pointer;
    background: var(--purple); color: #fff; border-radius: var(--radius-sm);
    font-size: 20px; font-weight: 800; transition: 0.2s;
}
.add-btn:hover { background: #b560ff; }

.roster-tools { display: flex; gap: 6px; margin-bottom: 10px; }
.roster-tools button {
    flex: 1; padding: 7px 0; cursor: pointer;
    background: transparent; border: 1px solid var(--panel-border); border-radius: 6px;
    font: 800 9.5px 'Inter', sans-serif; letter-spacing: 1px; color: var(--ink-3); transition: 0.2s;
}
.roster-tools button:hover { color: var(--purple-soft); border-color: var(--purple); }

.bulk-box { margin-bottom: 10px; }
.bulk-box[hidden] { display: none; }
.bulk-box textarea {
    width: 100%; min-height: 110px; resize: vertical;
    background: var(--panel); border: 1px solid var(--panel-border); color: var(--ink-1);
    padding: 10px 12px; border-radius: var(--radius-sm);
    font: 600 12.5px/1.6 'Inter', sans-serif;
}
.bulk-box textarea:focus { border-color: var(--purple); outline: none; }
.bulk-box textarea::placeholder { color: var(--ink-4); }
.bulk-add {
    width: 100%; margin-top: 6px; padding: 9px; cursor: pointer; border: none;
    background: var(--green); color: #05170c; border-radius: var(--radius-sm);
    font: 800 11px 'Inter', sans-serif; letter-spacing: 1px;
}

.roster { list-style: none; display: flex; flex-direction: column; gap: 5px; max-height: 260px; overflow-y: auto; }
.roster-item {
    display: flex; align-items: center; gap: 8px;
    background: var(--panel); border: 1px solid var(--panel-border);
    border-radius: var(--radius-sm); padding: 7px 8px 7px 10px;
}
.roster-num { font: 800 11px 'Rajdhani', sans-serif; color: var(--purple-soft); width: 18px; }
.roster-name { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roster-del {
    background: none; border: none; cursor: pointer; color: var(--ink-4);
    font-size: 16px; line-height: 1; padding: 0 4px; transition: color 0.2s;
}
.roster-del:hover { color: var(--red); }

/* ── MODE SWITCH (solo / duo) ───────────────────── */
.mode-switch {
    position: relative; display: flex;
    background: var(--panel); border: 1px solid var(--panel-border); border-radius: 999px;
    padding: 3px;
}
.mode-thumb {
    position: absolute; top: 3px; left: 3px;
    width: calc(50% - 3px); height: calc(100% - 6px);
    background: var(--purple); border-radius: 999px;
    transition: transform 0.28s cubic-bezier(0.65,0,0.35,1);
    z-index: 0;
}
.mode-switch.is-duo .mode-thumb { transform: translateX(100%); background: var(--gold); }
.mode-btn {
    position: relative; z-index: 1; flex: 1;
    background: none; border: none; cursor: pointer;
    padding: 9px 0; font-family: 'Inter', sans-serif;
    font-size: 11.5px; font-weight: 800; letter-spacing: 1px;
    color: var(--ink-3); transition: color 0.25s; border-radius: 999px;
}
.mode-btn.active { color: #0a0612; }

/* ── ACTION BUTTONS ──────────────────────────────── */
.action-stack { display: flex; flex-direction: column; gap: 9px; margin-bottom: 10px; }
.action-stack button {
    display: flex; align-items: center; justify-content: center; gap: 9px;
    width: 100%; padding: 13px; border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif; font-size: 12.5px; font-weight: 800;
    letter-spacing: 0.8px; cursor: pointer; border: none; transition: 0.2s;
}
.action-stack svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary { background: var(--purple); color: white; }
.btn-primary:hover { background: #b560ff; transform: translateY(-1px); }

.btn-shuffle { background: var(--panel); border: 1px solid var(--panel-border) !important; color: var(--ink-2); }
.btn-shuffle:hover { border-color: var(--blue) !important; color: var(--blue); }

.btn-outline { background: transparent; border: 1px solid var(--panel-border) !important; color: var(--ink-3); font-size: 11px !important; padding: 10px !important; }
.btn-outline:hover { border-color: rgba(255,77,77,0.4) !important; color: var(--red); }

.sidebar.shake { animation: shakeX 0.5s ease; }
@keyframes shakeX {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(7px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(3px); }
}

/* ── SIDEBAR FOOTER: legend + history ───────────── */
.sidebar-footer { margin-top: auto; padding-top: 20px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 20px; }

.round-legend { display: flex; flex-direction: column; gap: 7px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; color: var(--ink-3); }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--panel-border); flex-shrink: 0; }
.legend-item.done { color: var(--green-soft); }
.legend-item.done .legend-dot { background: var(--green); box-shadow: 0 0 6px var(--green); }

.history-block { display: flex; flex-direction: column; }
.history-clear {
    background: none; border: none; cursor: pointer;
    font-size: 9px; font-weight: 800; letter-spacing: 1px;
    color: var(--ink-4); transition: color 0.2s;
}
.history-clear:hover { color: var(--red); }

.history-list { display: flex; flex-direction: column; gap: 7px; max-height: 220px; overflow-y: auto; }
.history-empty { font-size: 11px; color: var(--ink-4); font-weight: 600; padding: 6px 0; }
.history-item {
    display: flex; align-items: center; gap: 10px;
    background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius-sm);
    padding: 9px 11px;
}
.history-trophy { font-size: 16px; flex-shrink: 0; filter: grayscale(0.15); }
.history-info { min-width: 0; }
.history-winner { font-size: 12.5px; font-weight: 800; color: var(--gold-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-sub { font-size: 9.5px; color: var(--ink-4); font-weight: 700; margin-top: 1px; }

/* ── MAIN CONTENT AREA ───────────────────────────── */
.content-area { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.scroll-wrapper { flex: 1; overflow-y: auto; }

.tourney-header { text-align: center; padding: 48px 24px 28px; }
.header-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 4px; color: var(--purple-soft); margin-bottom: 10px; }
.tourney-title {
    font-family: 'Rajdhani', sans-serif; font-size: 46px; font-weight: 800;
    letter-spacing: 2px; color: var(--ink-1); line-height: 1;
}
.tourney-title span {
    background: linear-gradient(90deg, var(--purple-soft), var(--gold-soft));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.header-line { width: 70px; height: 3px; margin: 18px auto 0; border-radius: 3px; background: linear-gradient(90deg, var(--purple), var(--gold)); }
.bracket-meta {
    margin-top: 14px; font-size: 11px; font-weight: 800; letter-spacing: 1.4px;
    color: var(--ink-3); text-transform: uppercase; min-height: 14px;
}

/* ── BRACKET LAYOUT (connector-line converging tree) ── */
.bracket-scroll { overflow-x: auto; overflow-y: hidden; padding: 10px 40px 30px; }
.bracket-container {
    display: flex; align-items: center;
    gap: 56px;
    min-width: max-content;
    padding: 20px 10px;
}

.round-column {
    width: 234px; flex-shrink: 0;
    display: flex; flex-direction: column;
    animation: colIn 0.5s cubic-bezier(0.2,0.7,0.3,1) both;
}
@keyframes colIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.round-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 11px; font-weight: 800; letter-spacing: 1.8px; color: var(--ink-3);
    text-transform: uppercase; margin-bottom: 14px; white-space: nowrap;
}
.round-label-num {
    font-family: 'Rajdhani', sans-serif; font-size: 11px; font-weight: 800;
    color: var(--purple-soft); background: rgba(160,68,255,0.14);
    border: 1px solid rgba(160,68,255,0.3); border-radius: 5px;
    padding: 2px 6px;
}

.round-matches { display: flex; flex-direction: column; justify-content: space-around; align-items: stretch; }

.match-wrapper { position: relative; }

/* connector stubs: incoming from previous round */
.round-column:not(.r-0) .match-wrapper::before {
    content: ''; position: absolute; top: 50%; left: -28px;
    width: 28px; height: 1px; background: var(--line);
}
/* connector stubs: outgoing toward next round */
.round-column:not(.champion-col) .match-wrapper::after {
    content: ''; position: absolute; top: 50%; right: -28px;
    width: 28px; height: 1px; background: var(--line);
}

.bracket-container.reshuffled,
#bracketDisplay.reshuffled .round-column { animation: reshuffleFlash 0.5s ease; }
@keyframes reshuffleFlash {
    0%, 100% { filter: brightness(1); }
    35% { filter: brightness(1.35); }
}

/* ── MATCHUP CARD ────────────────────────────────── */
.matchup-box {
    background: var(--card2); border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius-md); overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.matchup-box:hover { border-color: rgba(160,68,255,0.4); }
.matchup-box.decided { border-color: rgba(31,255,135,0.3); }

.player-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; padding: 11px 13px;
    background: transparent; transition: background 0.2s, opacity 0.2s;
}
.player-row.active { background: rgba(255,255,255,0.015); }
.player-row.winner { background: rgba(31,255,135,0.09); }
.player-row.loser { opacity: 0.42; }

.p-name {
    font-size: 12.5px; font-weight: 700; color: var(--ink-1);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0;
}
.player-row.winner .p-name { color: var(--green-soft); font-weight: 800; }
.player-row.loser .p-name { text-decoration: line-through; text-decoration-color: var(--ink-4); color: var(--ink-3); }
.player-row:not(.active) .p-name { color: var(--ink-4); font-style: italic; }

.p-score {
    width: 46px; flex-shrink: 0;
    background: var(--panel); border: 1px solid var(--panel-border); color: var(--ink-1);
    border-radius: 6px; padding: 5px 4px; text-align: center;
    font-family: 'Rajdhani', sans-serif; font-weight: 800; font-size: 14px;
    transition: border-color 0.2s;
}
.p-score:focus { border-color: var(--purple); outline: none; }
.p-score:disabled { opacity: 0.3; cursor: not-allowed; }
.player-row.winner .p-score { border-color: rgba(31,255,135,0.4); color: var(--green-soft); }

.vs-divider {
    display: flex; align-items: center; gap: 8px;
    padding: 0 13px; height: 1px; background: rgba(255,255,255,0.06);
    position: relative;
}
.vs-divider span {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    background: var(--card2); padding: 0 8px;
    font-family: 'Rajdhani', sans-serif; font-size: 9.5px; font-weight: 800;
    color: var(--ink-4); letter-spacing: 1px;
}

/* ── CHAMPION COLUMN ─────────────────────────────── */
.champion-col { width: 200px; }
.champion-display {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    background: var(--card2); border: 2px dashed var(--panel-border);
    border-radius: var(--radius-lg); padding: 22px 14px;
    position: relative; transition: 0.3s;
}
.champion-display.revealed {
    border: 2px solid var(--gold);
    background: radial-gradient(120% 100% at 50% 0%, rgba(255,202,40,0.14), transparent 70%), var(--card2);
    box-shadow: 0 0 34px rgba(255,202,40,0.22);
}
.champ-trophy-wrap { width: 40px; height: 40px; margin-bottom: 10px; opacity: 0.35; transition: 0.3s; }
.champion-display.revealed .champ-trophy-wrap { opacity: 1; }
.trophy-icon { width: 100%; height: 100%; fill: var(--gold); }
.champ-name {
    font-family: 'Rajdhani', sans-serif; font-size: 17px; font-weight: 800;
    color: var(--ink-4); text-transform: uppercase; word-break: break-word;
    transition: color 0.3s;
}
.champion-display.revealed .champ-name { color: var(--gold-soft); }
.champ-glow-ring {
    position: absolute; inset: -2px; border-radius: var(--radius-lg);
    box-shadow: 0 0 0 1px rgba(255,202,40,0.4);
    animation: ringPulse 2s ease-in-out infinite;
    pointer-events: none;
}
@keyframes ringPulse {
    0%, 100% { box-shadow: 0 0 0 1px rgba(255,202,40,0.4); }
    50% { box-shadow: 0 0 0 5px rgba(255,202,40,0.12); }
}

/* ── EMPTY STATE ─────────────────────────────────── */
.empty-state { text-align: center; padding: 90px 40px; color: var(--ink-4); }
.empty-icon { width: 52px; height: 52px; margin: 0 auto 18px; opacity: 0.35; }
.empty-icon svg { width: 100%; height: 100%; }
.empty-text { font-size: 15px; font-weight: 800; letter-spacing: 0.8px; color: var(--ink-3); }
.empty-sub { font-size: 12px; color: var(--ink-4); margin-top: 8px; }

/* ── FOOTER ──────────────────────────────────────── */
.footer-v2 { border-top: 1px solid var(--border); padding: 24px 40px; margin-top: 40px; }
.footer-content { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand img { width: 22px; height: 22px; border-radius: 5px; object-fit: cover; }
.footer-brand p { font-size: 11px; color: var(--ink-4); font-weight: 600; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 11px; font-weight: 800; letter-spacing: 1px; color: var(--ink-3); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--purple-soft); }
.footer-credit { font-size: 10.5px; color: var(--ink-4); }
.footer-credit .vman { color: var(--purple-soft); text-decoration: none; font-weight: 700; }

/* ── CHAMPION MODAL ──────────────────────────────── */
.champ-modal {
    position: fixed; inset: 0; z-index: 999;
    background: rgba(4, 2, 9, 0.85); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.champ-modal.open { opacity: 1; pointer-events: auto; }
.champ-modal-inner {
    position: relative; width: min(90vw, 380px);
    background: linear-gradient(180deg, #150c26, #0c0716);
    border: 1px solid rgba(255,202,40,0.4); border-radius: 22px;
    padding: 44px 30px 30px; text-align: center;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 60px rgba(255,202,40,0.15);
    transform: scale(0.9); transition: transform 0.3s;
}
.champ-modal.open .champ-modal-inner { transform: scale(1); }
.champ-fireworks { position: absolute; inset: 0; overflow: hidden; border-radius: 22px; pointer-events: none; }
.fw-particle {
    position: absolute; width: 5px; height: 5px; border-radius: 50%;
    animation: fw 1s ease-out forwards;
}
@keyframes fw {
    0% { transform: translate(0,0) scale(1); opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}
.champ-crown { width: 46px; height: 46px; margin: 0 auto 12px; }
.champ-crown svg { width: 100%; height: 100%; fill: var(--gold); filter: drop-shadow(0 0 12px rgba(255,202,40,0.6)); }
.champ-label { font-size: 11px; font-weight: 800; letter-spacing: 4px; color: var(--purple-soft); margin-bottom: 10px; }
.champ-name-display {
    font-family: 'Rajdhani', sans-serif; font-size: 30px; font-weight: 800;
    color: var(--gold-soft); text-transform: uppercase; word-break: break-word; margin-bottom: 26px;
}
.champ-close {
    background: var(--purple); color: white; border: none; cursor: pointer;
    padding: 12px 30px; border-radius: 10px; font-weight: 800; font-size: 12px;
    letter-spacing: 1px; transition: 0.2s;
}
.champ-close:hover { background: #b560ff; }

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 900px) {
    .main-layout { flex-direction: column; height: auto; overflow: visible; }
    html, body { overflow: auto; height: auto; }
    .sidebar { width: 100%; }
    .tourney-title { font-size: 32px; }
}

/* ══════════════════════════════════════════════════
   PREDICTIONS / POINTS / MULTI-TOURNAMENT (added)
   ══════════════════════════════════════════════════ */
.pts-card {
    display: flex; align-items: baseline; justify-content: space-between;
    background: linear-gradient(135deg, rgba(129,38,255,0.18), rgba(31,255,135,0.08));
    border: 1px solid rgba(160,68,255,0.35); border-radius: var(--radius-md); padding: 12px 14px;
}
.pts-label { font: 800 10px 'Inter', sans-serif; letter-spacing: 1.6px; color: var(--ink-3); }
.pts-card b { font: 800 26px 'Rajdhani', sans-serif; color: var(--green); line-height: 1; }
.login-note {
    display: block; margin-top: 10px; font-size: 11px; font-weight: 700; line-height: 1.5;
    color: var(--purple-soft); text-decoration: none;
}
.login-note:hover { color: #fff; }

.t-list { list-style: none; display: flex; flex-direction: column; gap: 6px; max-height: 210px; overflow-y: auto; }
.t-item {
    background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius-sm);
    padding: 9px 11px; cursor: pointer; transition: 0.2s;
}
.t-item:hover { border-color: var(--purple); }
.t-item.on { border-color: var(--green); box-shadow: 0 0 0 1px rgba(31,255,135,0.25); }
.t-item-name { font-size: 12.5px; font-weight: 800; color: var(--ink-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-item-sub { font-size: 9.5px; color: var(--ink-4); font-weight: 700; margin-top: 2px; }

.st { font-weight: 800; letter-spacing: 0.6px; }
.st-open { color: var(--green); }
.st-locked { color: var(--gold); }
.st-finished { color: var(--ink-3); }

.admin-zone {
    border: 1px dashed rgba(160,68,255,0.4); border-radius: var(--radius-md);
    padding: 14px 12px 4px; margin-bottom: 22px; background: rgba(129,38,255,0.04);
}
.admin-tag { font: 800 9.5px 'Inter', sans-serif; letter-spacing: 1.8px; color: var(--purple-soft); margin-bottom: 14px; }

/* tournament bar (title, status, actions) */
.t-bar {
    max-width: 1100px; margin: 0 auto 22px; padding: 14px 18px;
    background: var(--card); border: 1px solid var(--panel-border); border-radius: var(--radius-lg);
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
}
.t-bar[hidden] { display: none; }
.t-bar-main { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.t-bar-name { font: 800 20px 'Rajdhani', sans-serif; letter-spacing: 1px; color: #fff; }
.t-bar-main .st { font-size: 10px; padding: 3px 9px; border-radius: 999px; border: 1px solid currentColor; }
.t-bar-meta { font-size: 11.5px; font-weight: 700; color: var(--ink-3); }
.t-bar-meta b { color: var(--green); }
.t-bar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.t-bar-help { flex-basis: 100%; font-size: 11.5px; line-height: 1.6; color: var(--ink-3); font-weight: 600; border-top: 1px solid var(--panel-border); padding-top: 10px; }
.tb-btn {
    background: transparent; border: 1px solid var(--panel-border); color: var(--ink-2);
    padding: 9px 14px; border-radius: var(--radius-sm); font: 800 11px 'Rajdhani', sans-serif; letter-spacing: 1.2px;
    text-decoration: none; cursor: pointer; transition: 0.2s;
}
.tb-btn:hover { border-color: var(--purple); color: #fff; }
.tb-btn.primary { background: var(--purple); border-color: var(--purple); color: #fff; }
.tb-btn.primary:hover { background: #b560ff; }
.tb-btn.danger:hover { border-color: rgba(255,77,77,0.5); color: var(--red); }
.tb-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* standings */
.standings { flex-basis: 100%; border-top: 1px solid var(--panel-border); padding-top: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 14px; }
.standings-title { grid-column: 1 / -1; font: 800 10px 'Inter', sans-serif; letter-spacing: 1.8px; color: var(--ink-3); }
.st-row { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--ink-2); padding: 4px 6px; border-radius: 6px; }
.st-row.me { background: rgba(31,255,135,0.08); color: var(--green-soft); }
.st-row img { width: 18px; height: 18px; border-radius: 50%; }
.st-rank { font: 800 12px 'Rajdhani', sans-serif; color: var(--purple-soft); width: 16px; }
.st-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-score { font: 800 13px 'Rajdhani', sans-serif; color: var(--green); }

/* prediction picking */
.matchup-box.predict .player-row.pickable { cursor: pointer; }
.matchup-box.predict .player-row.pickable:hover { background: rgba(160,68,255,0.14); }
.player-row.picked { background: rgba(31,255,135,0.12); box-shadow: inset 3px 0 0 var(--green); }
.player-row.picked .p-name { color: var(--green-soft); font-weight: 800; }
.matchup-box.predict .player-row.loser .p-name { text-decoration: none; }
.pick-mark { font: 800 9px 'Inter', sans-serif; letter-spacing: 0.8px; color: var(--green); background: rgba(31,255,135,0.12); border: 1px solid rgba(31,255,135,0.3); border-radius: 999px; padding: 2px 7px; white-space: nowrap; }
.pick-mark.ok { color: #05170c; background: var(--green); }
.p-score.ro { background: transparent; border-color: transparent; color: var(--ink-3); padding: 5px 0; }
.player-row.winner .p-score.ro { color: var(--green-soft); }
.pick-result { font-size: 10.5px; font-weight: 800; letter-spacing: 0.4px; padding: 6px 13px; border-top: 1px solid rgba(255,255,255,0.06); }
.pick-result.ok { color: var(--green-soft); background: rgba(31,255,135,0.07); }
.pick-result.bad { color: var(--red); background: rgba(255,77,77,0.06); }

/* toast */
.toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 99;
    background: #0b0715; border: 1px solid rgba(31,255,135,0.35); color: var(--green);
    padding: 10px 18px; border-radius: 12px; font-weight: 700; font-size: 13px;
    opacity: 0; pointer-events: none; transition: 0.3s;
}
.toast.on { opacity: 1; }
.toast.bad { border-color: rgba(255,77,77,0.5); color: #ff9a9a; }

/* ══════════════════════════════════════════════════
   ADMIN PREDICTIONS SWITCH + PAST TOURNAMENTS
   ══════════════════════════════════════════════════ */
.view-switch {
    display: inline-flex; padding: 3px; gap: 2px;
    background: var(--panel); border: 1px solid var(--panel-border); border-radius: 10px;
}
.view-switch button {
    background: transparent; border: none; border-radius: 8px; padding: 7px 12px;
    font: 800 10.5px 'Inter', sans-serif; letter-spacing: 1px; color: var(--ink-3);
    cursor: pointer; transition: color .2s, background .2s;
}
.view-switch button:hover { color: #fff; }
.view-switch button.on { background: rgba(129,38,255,0.35); color: #fff; box-shadow: inset 0 0 0 1px rgba(160,68,255,0.5); }

.history-block .label-row { margin-bottom: 10px; }
.history-list { max-height: 300px; }
.history-item { cursor: pointer; transition: border-color .2s; }
.history-item:hover { border-color: var(--purple); }
.history-item.on { border-color: var(--green); box-shadow: 0 0 0 1px rgba(31,255,135,0.25); }

/* ── FITS THE SITE SHELL ──────────────────────────────
   The shell's top bar already shows the page name and the member's points, and the left nav is
   already on screen, so this page's own panel is slimmed down instead of repeating them. */
.sidebar-brand { display: none; }
.pts-card { display: none !important; }
.sidebar { width: 290px; padding: 22px 18px 20px; }
.sidebar .btn-primary, .sidebar .btn-secondary { letter-spacing: .6px; white-space: nowrap; }
.sidebar > .control-group:first-of-type { margin-top: -4px; }
@media (max-width: 1180px) and (min-width: 901px) { .sidebar { width: 262px; padding: 20px 14px; } }
@media (max-width: 900px) {
    .sidebar { padding: 18px 14px; border-right: 0; border-bottom: 1px solid var(--border); overflow: visible; }
    .tourney-title { font-size: 28px; }
}

/* ══════════════════════════════════════════════════
   TOP LAYOUT  (create / pick on top · bracket fits the width · predictions underneath)
   There is no side panel any more: the site menu is the only sidebar.
   ══════════════════════════════════════════════════ */
.main-layout { display: block; height: 100vh; }
.content-area { height: 100%; }
.scroll-wrapper { height: 100%; overflow-y: auto; overflow-x: hidden; }

.tourney-header { padding: 26px 24px 14px; }
.tourney-title { font-size: 38px; }

.top-zone { max-width: 1280px; margin: 0 auto 16px; padding: 0 24px; display: flex; flex-direction: column; gap: 12px; }
.tz-card { background: var(--card); border: 1px solid var(--panel-border); border-radius: var(--radius-lg); padding: 14px 16px; }
.tz-card > .label-row { justify-content: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 11px; }
.tz-card .login-note { margin: 0 0 0 auto; }

/* tournament picker: chips in a row instead of a list in a side panel */
.t-list { flex-direction: row; flex-wrap: wrap; max-height: none; overflow: visible; gap: 8px; }
.t-item { min-width: 190px; max-width: 300px; }

/* admin: create panel (collapsible) */
.admin-zone.create-panel { padding: 0; margin-bottom: 0; }
.cp-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: none; border: 0; padding: 14px 16px; cursor: pointer; color: inherit; text-align: left; }
.cp-head .admin-tag { margin-bottom: 0; }
.cp-chev { font: 800 10px 'Inter', sans-serif; letter-spacing: 1.2px; color: var(--purple-soft); border: 1px solid rgba(160,68,255,0.4); border-radius: 999px; padding: 5px 11px; transition: 0.2s; white-space: nowrap; }
.cp-head:hover .cp-chev { color: #fff; border-color: var(--purple); }
.cp-body { padding: 4px 16px 16px; border-top: 1px dashed rgba(160,68,255,0.25); }
.cp-body[hidden] { display: none; }
.cp-grid { display: grid; grid-template-columns: minmax(210px, 1fr) minmax(260px, 1.2fr) minmax(220px, 1fr); gap: 24px; padding-top: 16px; align-items: start; }
.cp-col .control-group { margin-bottom: 16px; }
.cp-col .roster { max-height: 300px; }
.cp-col .action-stack { margin-bottom: 0; }
.create-panel.shake { animation: shakeX 0.5s ease; }

/* bar above the bracket + predictions panel under it */
.t-bar, .pred-panel { max-width: 1280px; width: calc(100% - 48px); margin: 0 auto 16px; }
.pred-panel { background: var(--card); border: 1px solid var(--panel-border); border-radius: var(--radius-lg); padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; margin-top: 4px; margin-bottom: 22px; }
.pred-panel[hidden] { display: none; }
.pred-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pred-title { font: 800 10px 'Inter', sans-serif; letter-spacing: 1.8px; color: var(--ink-3); }
.pred-panel .t-bar-help { border-top: 1px solid var(--panel-border); padding-top: 10px; }

/* rounds legend: one row under the title area */
.round-legend { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 0 24px 4px; }
.round-legend:empty { display: none; }

/* bracket: JS scales it down to the available width so it is always fully visible */
.bracket-scroll { overflow-x: auto; overflow-y: hidden; padding: 6px 24px 22px; }
.bracket-fit { margin: 0 auto; position: relative; overflow: hidden; }
.bracket-container { width: max-content; min-width: 0; margin: 0 auto; padding: 20px 10px; }
.bracket-container .empty-state { width: min(640px, 86vw); }

/* past tournaments: cards under the predictions */
.past-zone { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.past-zone .label-row { justify-content: flex-start; gap: 12px; }
.past-zone .history-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; max-height: none; overflow: visible; }

@media (max-width: 900px) {
    .main-layout { display: block; height: auto; overflow: visible; }
    .content-area, .scroll-wrapper { height: auto; overflow: visible; }
    .tourney-header { padding: 18px 14px 10px; }
    .top-zone, .past-zone { padding: 0 12px; }
    .t-bar, .pred-panel { width: calc(100% - 24px); }
    .bracket-scroll { padding: 6px 12px 18px; }
    .cp-grid { grid-template-columns: 1fr; gap: 6px; }
    .t-item { min-width: 0; flex: 1 1 100%; max-width: none; }
    .tz-card .login-note { margin-left: 0; flex-basis: 100%; }
}
