/* ─── Brawl Stars Tournament Manager — Chronos Dark Theme (or/noir) ─── */

:root {
    --bg-primary: #131109;      /* noir chaud Chronos */
    --bg-secondary: #1b1811;    /* cartes / navbar */
    --bg-card: #1b1811;
    --bg-input: #232019;
    --bg-hover: #232019;
    --accent: #f5c220;          /* or Chronos */
    --accent-hover: #e7b012;
    --accent-light: rgba(245, 194, 32, 0.12);
    --accent-soft: rgba(245, 194, 32, 0.32);
    --danger: #f2597f;
    --danger-hover: #e5486f;
    --danger-light: rgba(242, 89, 127, 0.14);
    --success: #41cf90;
    --success-light: rgba(46, 178, 120, 0.15);
    --info: #6fb0f2;
    --info-light: rgba(47, 125, 209, 0.15);
    --warning: #f0a75f;
    --warning-light: rgba(226, 132, 54, 0.15);
    --text-primary: #f2ecdd;
    --text-secondary: #a89e8b;
    --text-muted: #7c7360;
    --border: #2c2820;
    --border-light: #232019;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.55);
    --transition: 0.2s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ─── Navbar ─── */

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 60px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.nav-links a:hover {
    color: var(--accent);
    background: var(--accent-light);
}

.nav-user {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.35rem 0.75rem;
    background: var(--accent-light);
    border-radius: 20px;
    color: var(--accent);
}

/* ─── Container ─── */

.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
}

/* ─── Flash messages ─── */

.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.flash-success { background: var(--success-light); color: #065f46; }
.flash-danger  { background: var(--danger-light); color: #991b1b; }
.flash-warning { background: var(--warning-light); color: #92400e; }
.flash-info    { background: var(--info-light); color: #1e40af; }

/* ─── Cards ─── */

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

/* ─── Page titles ─── */

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ─── Forms ─── */

.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
    background: var(--bg-secondary);
}

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

.form-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    line-height: 1.4;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ─── Buttons ─── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    font-family: inherit;
    line-height: 1.4;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent-soft);
    color: var(--accent);
    background: var(--accent-light);
}

.btn-small {
    padding: 0.35rem 0.7rem;
    font-size: 0.78rem;
    border-radius: 6px;
}

/* ─── Tables ─── */

.table-wrap {
    overflow-x: auto;
}

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

table th,
table td {
    padding: 0.65rem 0.85rem;
    text-align: left;
}

table th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 2px solid var(--border);
}

table td {
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-light);
}

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

table tr:hover td {
    background: var(--bg-hover);
}

/* ─── Status badges ─── */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-setup        { background: #f1f5f9; color: var(--text-muted); }
.badge-registration { background: var(--info-light); color: #2563eb; }
.badge-active       { background: var(--success-light); color: #059669; }
.badge-completed    { background: #faf5ff; color: #7c3aed; }

/* ─── Invite code display ─── */

.invite-code {
    display: inline-block;
    background: var(--bg-input);
    border: 1.5px dashed var(--accent-soft);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 1rem;
    color: var(--accent);
    letter-spacing: 0.08em;
    font-weight: 600;
    user-select: all;
}

/* ─── Empty state ─── */

.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}

.empty-state p {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* ─── Footer ─── */

.footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* ─── Auth pages ─── */

.auth-wrapper {
    max-width: 400px;
    margin: 3rem auto;
}

.auth-wrapper .card {
    box-shadow: var(--shadow);
}

/* ─── Global ban list ─── */

.ban-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.ban-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--danger-light);
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.ban-tag form {
    display: inline;
}

.ban-tag button {
    background: none;
    border: none;
    color: #b91c1c;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
    padding: 0;
    margin-left: 0.1rem;
    opacity: 0.6;
    transition: opacity var(--transition);
}

.ban-tag button:hover {
    opacity: 1;
}

/* ─── Seed input ─── */

.seed-input {
    width: 56px;
    text-align: center;
    padding: 0.3rem;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    transition: all var(--transition);
}

.seed-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

/* ─── Section dividers ─── */

h3.card-title {
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}

h3.card-title:first-child {
    border-top: none;
    padding-top: 0;
}

/* ─── Responsive ─── */

@media (max-width: 640px) {
    .navbar {
        padding: 0 1rem;
        height: 56px;
    }

    .nav-brand {
        font-size: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 1.25rem 1rem;
    }

    .page-title {
        font-size: 1.3rem;
    }

    .match-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── Bracket Match Cards ─── */

.match-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
}

.match-card {
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    transition: all var(--transition);
}

.match-card.match-done {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.match-card.match-ready {
    border-color: var(--accent-soft);
    background: var(--accent-light);
}

.match-card.match-waiting {
    opacity: 0.55;
}

.match-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.match-id {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
}

.match-format {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.match-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: auto;
}

.dot-done { background: var(--success); }
.dot-ready { background: var(--accent); }
.dot-waiting { background: var(--border); }

.match-players {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.match-player {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.35rem 0.5rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    text-align: center;
    border: 1.5px solid transparent;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-winner {
    border-color: var(--success);
    color: #065f46;
    background: #ecfdf5;
}

.match-vs {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    flex-shrink: 0;
}

.tbd {
    color: var(--text-muted);
    font-style: italic;
    font-weight: 400;
}

.match-result {
    font-size: 0.8rem;
    color: #065f46;
    padding-top: 0.3rem;
    border-top: 1px solid var(--border-light);
}

.match-actions {
    padding-top: 0.4rem;
    border-top: 1px solid var(--border-light);
}

/* ─── Scoreboard ─── */

.scoreboard {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.sb-player {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.sb-player:last-child {
    flex-direction: row-reverse;
    text-align: right;
}

.sb-name {
    font-size: 1rem;
    font-weight: 700;
}

.sb-score {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-muted);
    min-width: 2rem;
    text-align: center;
}

.sb-winner .sb-score {
    color: var(--success);
}

.sb-winner .sb-name {
    color: var(--success);
}

.sb-vs {
    flex-shrink: 0;
}

/* ─── Brawler Grid (ban/pick selection) ─── */

.brawler-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.brawler-option {
    cursor: pointer;
}

.brawler-option input[type="checkbox"] {
    display: none;
}

.brawler-label {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    transition: all var(--transition);
    user-select: none;
}

.brawler-option input:checked + .brawler-label {
    background: var(--danger-light);
    border-color: var(--danger);
    color: #991b1b;
    font-weight: 600;
}

.brawler-label:hover {
    border-color: var(--accent-soft);
    color: var(--text-primary);
}

/* ─── Rounds ─── */

.round-row {
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    border: 1.5px solid var(--border);
    background: var(--bg-secondary);
}

.round-row.round-done {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.round-row.round-active {
    background: var(--accent-light);
    border-color: var(--accent-soft);
}

.round-row.round-waiting {
    opacity: 0.45;
}

.round-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.round-num {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
}

.round-map {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-light);
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
}

.round-picks {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.4rem;
}

.pick-tag {
    font-size: 0.82rem;
    padding: 0.25rem 0.6rem;
    background: var(--bg-input);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.pick-tag.pick-winner {
    background: #ecfdf5;
    border-color: #86efac;
    color: #065f46;
}

.round-winner {
    font-size: 0.82rem;
    font-weight: 600;
    color: #059669;
    margin-top: 0.3rem;
}

/* ─── Proof images ─── */

.proof-img {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    cursor: pointer;
}

.proof-img:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow);
}

/* ─── File input styling ─── */

input[type="file"] {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

@media (max-width: 640px) {
    .scoreboard {
        gap: 0.75rem;
    }
    .sb-name {
        font-size: 0.85rem;
    }
    .sb-score {
        font-size: 1.4rem;
    }
}

/* ─── My match highlight ─── */

.match-mine {
    box-shadow: 0 0 0 2px var(--accent-soft);
}

a:hover .match-mine,
.match-mine:hover {
    box-shadow: 0 0 0 2px var(--accent);
}

/* ─── Validation Queue ─── */

.queue-item {
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.6rem;
    border: 1.5px solid var(--border);
    background: var(--bg-secondary);
}

.queue-item.queue-dispute {
    border-color: #fca5a5;
    background: #fef2f2;
}

.queue-item.queue-timeout {
    border-color: #fbbf24;
    background: #fffbeb;
}

.queue-item.queue-pending {
    border-color: var(--accent-soft);
    background: var(--accent-light);
}

.queue-item.queue-confirmed {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.queue-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.submission-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    margin-top: 0.3rem;
    background: var(--bg-input);
    flex-wrap: wrap;
}

.submission-row.sub-disputed {
    background: #fef2f2;
}

/* ─── Check-in status dots ─── */

.ci-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 0.3rem;
    vertical-align: middle;
}

.ci-yes { background: var(--success); }
.ci-no { background: var(--danger); }

.player-checked {
    border-color: #bbf7d0 !important;
}

/* ─── Notification badge ─── */

.notif-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    margin-left: 0.3rem;
    padding: 0 4px;
}

.btn-alert {
    border-color: var(--danger) !important;
    color: var(--danger) !important;
}

.btn-alert:hover {
    background: var(--danger-light) !important;
}

/* ─── Deadline info ─── */

.deadline-info {
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 0.3rem 0.6rem;
    background: var(--bg-input);
    border-radius: 6px;
    display: inline-block;
}

.deadline-info.expired {
    color: #991b1b;
    background: #fef2f2;
}

/* ─── Bracket header, legend, live indicator ─── */

.bracket-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--success);
    background: var(--success-light);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    vertical-align: middle;
}
.live-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--success);
    animation: livePulse 1.6s ease-in-out infinite;
}
@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.7); }
}
.live-indicator.pulse {
    animation: liveFlash 0.7s ease;
}
@keyframes liveFlash {
    0% { background: var(--success); color: #fff; }
    100% { background: var(--success-light); color: var(--success); }
}

/* Brief, non-jumpy cue when a live region swaps in fresh server-rendered HTML. */
.region-updated { animation: regionFlash 0.6s ease; }
@keyframes regionFlash {
    0% { opacity: 0.55; }
    100% { opacity: 1; }
}

/* ─── Match countdown timer ─── */
.match-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin: 0 0 1rem;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--accent-light);
    border: 1.5px solid var(--accent-soft);
}
.match-timer-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-hover);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.match-timer-clock {
    font-size: 1.35rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--accent-hover);
    min-width: 3.2rem;
    text-align: center;
}
.match-timer.match-timer-urgent {
    background: var(--danger-light);
    border-color: #fca5a5;
    animation: timerPulse 1s ease-in-out infinite;
}
.match-timer.match-timer-urgent .match-timer-label,
.match-timer.match-timer-urgent .match-timer-clock { color: var(--danger-hover); }
@keyframes timerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.015); }
}

.bracket-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}
.bracket-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.legend-swatch {
    width: 12px; height: 12px; border-radius: 3px; display: inline-block;
    border: 1.5px solid transparent;
}
.sw-active  { background: #eff6ff; border-color: #93c5fd; }
.sw-ready   { background: var(--accent-light); border-color: var(--accent-soft); }
.sw-done    { background: #f0fdf4; border-color: #bbf7d0; }
.sw-waiting { background: #f8fafc; border-color: var(--border); }
.sw-mine    { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent-soft); }

/* ─── Bracket Tree (player-facing) ─── */

.bracket-tree {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.5rem 0.25rem 0.75rem;
    align-items: flex-start;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 210px;
    gap: 0.9rem;
    position: relative;
}

.bracket-round-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    text-align: center;
    letter-spacing: 0.05em;
    margin: 0 0 0.15rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid var(--border-light);
    flex-shrink: 0;
}

.bracket-match-link { text-decoration: none; color: inherit; display: block; }

.bracket-match {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-secondary);
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.bracket-match.bm-done    { border-color: #bbf7d0; }
.bracket-match.bm-ready   { border-color: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent-soft); }
.bracket-match.bm-active  { border-color: #93c5fd; box-shadow: 0 0 0 1px #bfdbfe; }
.bracket-match.bm-waiting { opacity: 0.6; }
.bracket-match.bm-mine    { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

a:hover .bracket-match {
    box-shadow: 0 4px 14px rgba(0,0,0,0.10);
    transform: translateY(-1px);
}

.bm-caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    padding: 0.3rem 0.55rem;
    background: var(--border-light);
    border-bottom: 1px solid var(--border);
}
.bm-label {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bm-status {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}
.bm-status.bm-done    { background: #dcfce7; color: #166534; }
.bm-status.bm-ready   { background: var(--accent-soft); color: #3730a3; }
.bm-status.bm-active  { background: #dbeafe; color: #1e40af; }
.bm-status.bm-waiting { background: #f1f5f9; color: var(--text-muted); }

.bm-player {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.82rem;
    font-weight: 500;
    border-bottom: 1px solid var(--border-light);
}
.bm-player:last-of-type { border-bottom: none; }

.bm-seed {
    font-size: 0.64rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--border-light);
    border-radius: 4px;
    padding: 0.05rem 0.28rem;
    flex-shrink: 0;
}
.bm-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bm-score {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-secondary);
    min-width: 1.1rem;
    text-align: center;
    flex-shrink: 0;
}
.bm-player.bm-winner { background: #ecfdf5; }
.bm-player.bm-winner .bm-name { font-weight: 800; color: #065f46; }
.bm-player.bm-winner .bm-score { color: #059669; }
.bm-player.bm-me .bm-name { color: var(--accent-hover); }

.bm-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    padding: 0.25rem 0.55rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
}
.bm-format { font-size: 0.64rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.03em; }
.bm-cta { font-size: 0.68rem; font-weight: 700; color: var(--accent); }

/* ─── Champion card ─── */

.champion-card {
    text-align: center;
    border: 1.5px solid #fbbf24;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    padding: 1.25rem 1rem;
    margin-bottom: 1.25rem;
}
.champion-label {
    font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: #92400e; font-weight: 700; margin-bottom: 0.25rem;
}
.champion-name-line { font-size: 1.5rem; font-weight: 800; color: #78350f; }

/* ─── Admin bracket ─── */

.admin-round { margin-bottom: 1.35rem; }
.admin-round-label {
    font-size: 0.74rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--text-secondary);
    margin-bottom: 0.6rem; padding-bottom: 0.3rem;
    border-bottom: 2px solid var(--border-light);
}

.admin-match {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    padding: 0.65rem 0.75rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.admin-match.bm-done    { border-color: #bbf7d0; background: #f6fef9; }
.admin-match.bm-ready   { border-color: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent-soft); }
.admin-match.bm-active  { border-color: #93c5fd; box-shadow: 0 0 0 1px #bfdbfe; }
.admin-match.bm-waiting { opacity: 0.7; }

.admin-match-top {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.4rem; margin-bottom: 0.15rem;
}
.admin-match-label {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.03em; color: var(--text-secondary);
}
.admin-match-meta { font-size: 0.66rem; color: var(--text-muted); margin-bottom: 0.5rem; }

.admin-player {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.5rem; padding: 0.3rem 0.4rem; border-radius: 5px;
    font-size: 0.85rem;
}
.admin-player + .admin-player { margin-top: 0.15rem; }
.admin-player-name { display: flex; align-items: center; gap: 0.4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-player-score { font-weight: 800; color: var(--text-secondary); }
.admin-player.player-winner { background: #ecfdf5; }
.admin-player.player-winner .admin-player-name { font-weight: 800; color: #065f46; }

.admin-match-result {
    margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--border-light);
    font-size: 0.78rem; font-weight: 700; color: #059669;
}
.admin-match-actions {
    margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px dashed var(--border);
}
.admin-actions-hint { display: block; font-size: 0.68rem; color: var(--text-muted); margin-bottom: 0.35rem; text-transform: uppercase; letter-spacing: 0.03em; }
.admin-win-form { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.admin-win-form .btn { flex: 1; min-width: 0; }
.admin-match-waiting { margin-top: 0.5rem; font-size: 0.72rem; color: var(--text-muted); font-style: italic; }

/* ─── Nav user as link ─── */

a.nav-user { text-decoration: none; transition: all var(--transition); }
a.nav-user:hover { background: var(--accent); color: #fff; }

@media (max-width: 640px) {
    .bracket-round { min-width: 180px; }
    .bracket-tree { gap: 0.75rem; }
}

/* ══════════════════════════════════════════════════════════════════════
   CHRONOS DARK THEME — overrides des teintes claires codées en dur.
   Recolore les états (done/ready/winner/dispute…) pour le fond noir + or.
   ══════════════════════════════════════════════════════════════════════ */

body { font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

/* Flash — texte lisible sur fond sombre teinté */
.flash-success { color: #7ee0b0; }
.flash-danger  { color: #f7a3b9; }
.flash-warning { color: #f0c088; }
.flash-info    { color: #a9cdf5; }

/* Boutons */
.btn-primary { color: #131109; box-shadow: 0 1px 3px rgba(245, 194, 32, 0.35); }
.btn-primary:hover { box-shadow: 0 4px 12px rgba(245, 194, 32, 0.4); }

/* Badges */
.badge-setup        { background: var(--bg-input); color: var(--text-muted); }
.badge-registration { color: var(--info); }
.badge-active       { color: var(--success); }
.badge-completed    { background: rgba(167, 139, 250, 0.15); color: #c4b5fd; }

/* Cartes de match / rounds — états */
.match-card.match-done { border-color: rgba(46, 178, 120, 0.35); background: rgba(46, 178, 120, 0.10); }
.match-result { color: var(--success); }
.player-winner { border-color: var(--success); color: var(--success); background: rgba(46, 178, 120, 0.14); }
.round-row.round-done { background: rgba(46, 178, 120, 0.10); border-color: rgba(46, 178, 120, 0.35); }
.pick-tag.pick-winner { background: rgba(46, 178, 120, 0.14); border-color: rgba(46, 178, 120, 0.4); color: var(--success); }
.round-winner { color: var(--success); }
.brawler-option input:checked + .brawler-label { color: #f7a3b9; }

/* File de validation */
.queue-item.queue-dispute   { border-color: rgba(242, 89, 127, 0.5); background: rgba(242, 89, 127, 0.10); }
.queue-item.queue-timeout   { border-color: rgba(240, 167, 95, 0.5); background: rgba(240, 167, 95, 0.10); }
.queue-item.queue-confirmed { border-color: rgba(46, 178, 120, 0.4); background: rgba(46, 178, 120, 0.10); }
.submission-row.sub-disputed { background: rgba(242, 89, 127, 0.10); }
.player-checked { border-color: rgba(46, 178, 120, 0.5) !important; }

/* Timer urgent */
.match-timer.match-timer-urgent { border-color: rgba(242, 89, 127, 0.5); }

/* Champion */
.champion-card { background: linear-gradient(135deg, rgba(245,194,32,0.16) 0%, rgba(245,194,32,0.05) 100%); border-color: var(--accent); }
.champion-label { color: var(--accent); }
.champion-name-line { color: var(--text-primary); }

/* Légende du bracket */
.sw-active  { background: rgba(47, 125, 209, 0.15); border-color: rgba(47, 125, 209, 0.5); }
.sw-ready   { background: var(--accent-light); border-color: var(--accent-soft); }
.sw-done    { background: rgba(46, 178, 120, 0.12); border-color: rgba(46, 178, 120, 0.4); }
.sw-waiting { background: var(--bg-input); border-color: var(--border); }
.sw-mine    { background: var(--bg-secondary); border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent-soft); }

/* Arbre du bracket (public) */
.bracket-match.bm-done   { border-color: rgba(46, 178, 120, 0.4); }
.bracket-match.bm-active { border-color: rgba(47, 125, 209, 0.5); box-shadow: 0 0 0 1px rgba(47, 125, 209, 0.4); }
.bm-caption { background: var(--bg-input); border-bottom-color: var(--border); }
.bm-seed { background: var(--bg-input); color: var(--text-muted); }
.bm-status.bm-done    { background: rgba(46, 178, 120, 0.18); color: var(--success); }
.bm-status.bm-ready   { background: var(--accent-soft); color: var(--accent); }
.bm-status.bm-active  { background: rgba(47, 125, 209, 0.2); color: var(--info); }
.bm-status.bm-waiting { background: var(--bg-input); color: var(--text-muted); }
.bm-player.bm-winner { background: rgba(46, 178, 120, 0.12); }
.bm-player.bm-winner .bm-name { color: var(--success); }
.bm-player.bm-winner .bm-score { color: var(--success); }
.bm-player.bm-me .bm-name { color: var(--accent); }
.bm-cta { color: var(--accent); }
a:hover .bracket-match { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); }

/* Bracket admin */
.admin-match.bm-done   { border-color: rgba(46, 178, 120, 0.4); background: rgba(46, 178, 120, 0.06); }
.admin-match.bm-active { border-color: rgba(47, 125, 209, 0.5); box-shadow: 0 0 0 1px rgba(47, 125, 209, 0.4); }
.admin-player.player-winner { background: rgba(46, 178, 120, 0.12); }
.admin-player.player-winner .admin-player-name { color: var(--success); }
.admin-match-result { color: var(--success); }

/* Nav user hover : texte sombre sur or */
a.nav-user:hover { background: var(--accent); color: #131109; }

/* Marque de la navbar : le logo Chronos */
.nav-brand { display: inline-flex; align-items: center; gap: 0.55rem; }
.nav-logo { height: 30px; width: auto; display: block; }

/* ══════════════════════════════════════════════════════════════════════
   ANIMATIONS D'ENTRÉE (façon Chronos) — apparition en cascade au chargement.
   Respecte prefers-reduced-motion.
   ══════════════════════════════════════════════════════════════════════ */
@keyframes chFadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes chFadeIn   { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: no-preference) {
    .navbar { animation: chFadeIn 0.5s ease-out both; }

    /* Cascade : chaque élément de premier niveau du contenu monte en fondu.
       Exclu des pages en auto-refresh pour éviter le clignotement au rechargement. */
    body:not([data-autorefresh]) main.container > * { animation: chFadeInUp 0.45s ease-out both; }
    body:not([data-autorefresh]) main.container > *:nth-child(1) { animation-delay: 0.03s; }
    body:not([data-autorefresh]) main.container > *:nth-child(2) { animation-delay: 0.10s; }
    body:not([data-autorefresh]) main.container > *:nth-child(3) { animation-delay: 0.17s; }
    body:not([data-autorefresh]) main.container > *:nth-child(4) { animation-delay: 0.24s; }
    body:not([data-autorefresh]) main.container > *:nth-child(5) { animation-delay: 0.31s; }
    body:not([data-autorefresh]) main.container > *:nth-child(n+6) { animation-delay: 0.38s; }

    /* Pages en direct (auto-refresh) : un fondu global doux, non répétitif à l'œil. */
    body[data-autorefresh] main.container { animation: chFadeIn 0.4s ease-out both; }

    /* Classes utilitaires réutilisables si besoin ponctuel. */
    .animate-fade-in-up { animation: chFadeInUp 0.45s ease-out both; }
    .animate-fade-in    { animation: chFadeIn 0.4s ease-out both; }
    .animate-delay-100  { animation-delay: 0.10s; }
    .animate-delay-200  { animation-delay: 0.20s; }
    .animate-delay-300  { animation-delay: 0.30s; }
}
