/* AKDIM TOURNAMENT MANAGER — design system noir & or (sidebar dashboard) */

:root {
    --app-bg: #07070b;
    --sidebar-bg: #0a0a10;
    --header-bg: #0a0a10;
    --card-bg: #12121a;
    --card-bg-alt: #171720;
    --border: rgba(212, 175, 55, 0.14);
    --border-strong: rgba(212, 175, 55, 0.4);
    --gold: #d4af37;
    --gold-light: #f0d878;
    --gold-dark: #a3821f;
    --ink: #f2f2f5;
    --ink-muted: #8f8f9c;
    --success: #4ade80;
    --success-bg: #14251b;
    --warning: #f0b429;
    --warning-bg: #2c220c;
    --danger: #ef4444;
    --danger-bg: #2a1414;
    --info: #4c8ef0;
    --sidebar-width: 240px;
}

body {
    background-color: var(--app-bg);
    background-image: url('/images/app-background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* ---------- Blazor Server error banner ---------- */
/* Not scoped CSS (no .razor.css files exist in this project, so the default
   Blazor template's #blazor-error-ui { display: none; } rule, which used to
   live in the generated styles bundle, has to live here instead). */

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0.9rem 3.5rem 0.9rem 1.25rem;
    background: var(--danger-bg);
    color: var(--ink);
    border-top: 1px solid var(--danger);
}

#blazor-error-ui .reload {
    color: var(--gold-light);
    text-decoration: underline;
    margin-left: 0.5rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.9rem;
}

/* ---------- Shell layout ---------- */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
}

.app-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

.app-content {
    flex: 1;
    padding: 1.75rem 2rem 3rem;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
}

.sidebar-toggle-checkbox { display: none; }

.sidebar-toggle-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--ink);
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
}

.sidebar-backdrop { display: none; }

/* En dessous de 900px la sidebar fixe ne peut plus rester en permanence à côté du contenu (elle mangerait
   tout l'écran) — elle devient un tiroir qui glisse depuis la gauche, ouvert/fermé par la case à cocher
   #sidebar-toggle (voir MainLayout.razor) plutôt qu'un simple "display:none" qui la rendait totalement
   inaccessible sur mobile : Pesée/Athlètes/Clubs/Tirage etc. n'avaient alors plus AUCUN moyen d'y accéder. */
@media (max-width: 900px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 1500;
    }

    .sidebar-toggle-checkbox:checked ~ .app-shell .app-sidebar {
        transform: translateX(0);
    }

    .app-main { margin-left: 0; }

    .sidebar-toggle-btn { display: inline-flex; }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        z-index: 1400;
    }

    .sidebar-toggle-checkbox:checked ~ .app-shell .sidebar-backdrop {
        display: block;
    }

    .app-header { padding: 0 1rem; gap: 0.6rem; }
    .app-header .header-title { display: none; }
    .app-content { padding: 1.25rem 1rem 2rem; }
    .competition-context { margin-right: 0; }
    .competition-context-pill small { display: none; }
}

@media (max-width: 900px) {
    /* html[dir="rtl"] .app-sidebar { right: 0; ... } (position fixe) vient déjà de la section RTL plus
       bas dans ce fichier — ici on ne fait que retourner le sens du tiroir (sort par la droite). */
    html[dir="rtl"] .app-sidebar {
        transform: translateX(100%);
    }

    html[dir="rtl"] .sidebar-toggle-checkbox:checked ~ .app-shell .app-sidebar {
        transform: translateX(0);
    }
}

/* ---------- Sidebar ---------- */

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 1.25rem 1.1rem;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
}

.sidebar-brand .logo-mark {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    padding: 2px;
}

.sidebar-brand .brand-text {
    line-height: 1.15;
}

.sidebar-brand .brand-text .l1 {
    color: var(--gold);
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
}

.sidebar-brand .brand-text .l2 {
    color: var(--ink-muted);
    font-size: 0.68rem;
    letter-spacing: 0.18em;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    color: var(--ink-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.sidebar-nav a svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sidebar-nav a:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.03);
}

.sidebar-nav a.active {
    color: var(--gold-light);
    background: rgba(212, 175, 55, 0.1);
    border-left-color: var(--gold);
    font-weight: 700;
}

.sidebar-user {
    padding: 1rem 1.1rem;
    border-top: 1px solid var(--border);
}

.sidebar-user-name {
    color: var(--ink);
    font-weight: 700;
    font-size: 0.85rem;
}

.sidebar-user-role {
    color: var(--gold);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.6rem;
}

.sidebar-logout-form button {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--ink-muted);
    padding: 0.45rem 0.7rem;
    font-size: 0.82rem;
    cursor: pointer;
}

.sidebar-logout-form button svg {
    width: 16px;
    height: 16px;
}

.sidebar-logout-form button:hover {
    border-color: var(--danger);
    color: #ff8a8a;
}

.sidebar-footer {
    padding: 1rem 1.1rem;
    border-top: 1px solid var(--border);
    color: var(--ink-muted);
    font-size: 0.72rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar-footer .social-links {
    display: flex;
    gap: 0.75rem;
}

.sidebar-footer .social-links a {
    color: var(--gold);
    text-decoration: none;
    font-weight: 600;
}

/* ---------- Header ---------- */

.app-header {
    height: 64px;
    flex-shrink: 0;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    gap: 1rem;
}

.app-header .header-title {
    color: var(--ink);
    font-weight: 700;
    font-size: 1rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.lang-selector {
    display: flex;
    gap: 0.35rem;
}

.lang-selector button {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--ink-muted);
    border-radius: 5px;
    padding: 0.2rem 0.55rem;
    font-size: 0.78rem;
    cursor: pointer;
}

.lang-selector button.active {
    border-color: var(--gold);
    color: var(--gold);
}

.competition-context {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    justify-content: flex-end;
    margin-right: 1rem;
}

.competition-context-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 0.4rem 0.9rem;
}

.competition-context-pill strong {
    display: block;
    color: var(--ink);
    font-size: 0.82rem;
}

.competition-context-pill small {
    color: var(--ink-muted);
    font-size: 0.68rem;
}

.competition-context-form select {
    background: var(--card-bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.45rem 0.7rem;
    color: var(--gold-light);
    font-size: 0.78rem;
    cursor: pointer;
}

/* ---------- Buttons ---------- */

.btn-primary {
    color: #0a0a0a !important;
    background-color: var(--gold) !important;
    border-color: var(--gold) !important;
    font-weight: 700;
}

.btn-primary:hover {
    background-color: var(--gold-light) !important;
    border-color: var(--gold-light) !important;
}

.btn-outline-gold {
    color: var(--gold);
    background-color: transparent;
    border: 1px solid var(--gold);
    border-radius: 6px;
    padding: 0.3rem 0.85rem;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-outline-gold:hover {
    background-color: var(--gold);
    color: #0a0a0a;
}

.btn-outline-gold.btn-active,
.btn-toggle.active {
    background-color: var(--gold);
    color: #0a0a0a;
}

/* ---------- Live banner ---------- */

.live-banner {
    background: linear-gradient(120deg, #14141c, #221c0e);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
}

.live-banner .live-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--danger);
    margin-right: 0.5rem;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.35; }
    100% { opacity: 1; }
}

/* ---------- Page /live ---------- */

.live-tatami-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.live-tatami-card h3 {
    color: var(--gold);
}

.live-current-match {
    background: var(--card-bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.1rem;
}

.live-match-meta {
    color: var(--ink-muted);
    font-size: 0.8rem;
    margin-bottom: 0.6rem;
}

.live-match-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.live-athlete {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    flex: 1;
    min-width: 0;
}

.live-athlete-red { justify-content: flex-start; }
.live-athlete-blue { justify-content: flex-end; text-align: right; }

.live-color-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.live-color-dot.red { background: var(--danger); }
.live-color-dot.blue { background: var(--info); }

.live-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
    flex-shrink: 0;
    padding: 0 0.5rem;
}

.live-upnext-title {
    color: var(--ink-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 0 0 0.5rem;
}

.live-upnext-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.live-upnext-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
}

.live-upnext-time {
    color: var(--gold);
    font-weight: 600;
    flex-shrink: 0;
}

.live-autorefresh-note {
    text-align: center;
    margin-top: 1.5rem;
}

/* ---------- Sections & headings ---------- */

.page-section {
    margin-bottom: 2.25rem;
}

.page-section h2 {
    color: var(--gold);
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 1rem;
}

.empty-state {
    color: var(--ink-muted);
    font-style: italic;
}

/* ---------- KPI stat tiles ---------- */

.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.kpi-tile {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.1rem;
}

.kpi-tile .kpi-label {
    color: var(--ink-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.kpi-tile .kpi-value {
    color: var(--ink);
    font-size: 1.7rem;
    font-weight: 800;
    margin-top: 0.2rem;
}

.kpi-tile .kpi-value.gold { color: var(--gold); }

.kpi-tatami-select {
    margin-top: 0.35rem;
    width: 100%;
}

/* ---------- Cards ---------- */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.1rem;
}

.competition-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left: 3px solid var(--gold-dark);
    border-radius: 10px;
    padding: 1.15rem 1.25rem;
    text-decoration: none;
    color: var(--ink);
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    transition: border-color 0.15s, transform 0.15s;
}

.competition-card:hover {
    border-left-color: var(--gold);
    border-color: var(--border-strong);
    transform: translateY(-2px);
    color: var(--ink);
}

.competition-card.selected {
    border-left-color: var(--gold);
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold);
}

.competition-card {
    cursor: pointer;
}

.competition-card .badge-statut {
    align-self: flex-start;
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-ouvert { background: var(--success-bg); color: var(--success); }
.badge-encours { background: var(--warning-bg); color: var(--gold-light); }
.badge-termine { background: var(--card-bg-alt); color: var(--ink-muted); }
.badge-ferme { background: var(--danger-bg); color: #ff8a8a; }

.competition-card h3 {
    margin: 0;
    font-size: 1.05rem;
}

.competition-card .meta {
    color: var(--ink-muted);
    font-size: 0.85rem;
}

.competition-card-image {
    width: calc(100% + 2.5rem);
    height: 150px;
    object-fit: contain;
    background: #000;
    margin: -1.15rem -1.25rem 0.3rem;
    border-radius: 9px 9px 0 0;
    display: block;
}

/* ---------- Sponsors / contact ---------- */

.sponsor-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.sponsor-strip a {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left: 3px solid var(--gold-dark);
    border-radius: 10px;
    padding: 1.15rem 1.25rem;
    color: var(--gold-light);
    font-weight: 600;
    text-decoration: none;
}

.sponsor-strip a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    min-height: 130px;
}

.sponsor-logo {
    max-height: 90px;
    max-width: 180px;
    object-fit: contain;
}

.sponsor-strip a:hover {
    border-color: var(--gold);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.contact-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.15rem;
}

.contact-card h4 {
    color: var(--gold);
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

/* ---------- Tables ---------- */

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.ranking-table th, .ranking-table td {
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.ranking-table th {
    color: var(--gold);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--card-bg-alt);
}

.ranking-table tr:first-child td {
    color: var(--gold-light);
    font-weight: 700;
}

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

/* ---------- Login page ---------- */

.login-shell {
    display: flex;
    min-height: 100vh;
    position: relative;
    background-color: var(--app-bg);
    background-image: url('/images/app-background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.login-lang-pill,
.login-shell > .lang-selector {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    z-index: 2;
    background: var(--card-bg);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
    color: var(--ink);
}

.login-left {
    flex: 1.3;
    background: transparent;
    border-right: 1px solid var(--border);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.login-brand img {
    width: 84px;
    height: 84px;
    object-fit: contain;
}

.login-brand-title {
    color: #fff;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.login-brand-title span {
    color: var(--gold);
    display: block;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.login-brand-subtitle {
    color: var(--ink-muted);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    margin-top: 0.35rem;
}

.login-hero-logo {
    text-align: center;
    margin: 0 auto;
}

.login-hero-logo img {
    width: 200px;
    height: 200px;
    object-fit: contain;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.45));
}

.login-hero-title {
    color: var(--gold);
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    margin-top: 0.75rem;
}

.login-hero-subtitle {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.login-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.login-features li {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 0.5rem;
    font-size: 0.72rem;
    color: var(--ink);
    background: var(--card-bg);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.login-features li svg {
    width: 20px;
    height: 20px;
    color: var(--gold);
}

.login-wt-badge {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--ink-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.login-wt-badge svg {
    width: 22px;
    height: 22px;
    color: var(--gold);
}

.login-wt-badge small {
    font-weight: 400;
    color: var(--ink-muted);
    letter-spacing: normal;
}

.login-tagline {
    color: var(--gold);
    font-weight: 700;
    letter-spacing: 0.2em;
    font-size: 0.85rem;
}

.login-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 1.25rem;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.75rem;
}

.login-error {
    background: var(--danger-bg);
    color: #ff8a8a;
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.login-success {
    background: var(--success-bg);
    color: var(--success);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.login-tab-input {
    display: none;
}

.login-tabs {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.login-tabs label {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink-muted);
    cursor: pointer;
}

#tab-coach:checked ~ .login-tabs label[for="tab-coach"],
#tab-email:checked ~ .login-tabs label[for="tab-email"] {
    background: var(--gold);
    color: #0a0a0a;
}

.login-panel {
    display: none;
}

#tab-coach:checked ~ .login-panel-coach,
#tab-email:checked ~ .login-panel-email {
    display: block;
}

.login-panel form {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.login-panel label {
    color: var(--ink-muted);
    font-size: 0.78rem;
    margin-top: 0.5rem;
}

.login-panel input {
    background: var(--card-bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    color: var(--ink);
    font-size: 0.9rem;
}

.login-panel input:focus {
    outline: none;
    border-color: var(--gold);
}

.login-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-group svg {
    position: absolute;
    left: 0.7rem;
    width: 16px;
    height: 16px;
    color: var(--gold);
    pointer-events: none;
}

.login-input-group input {
    width: 100%;
    padding-left: 2.2rem !important;
}

.pwd-field {
    position: relative;
    display: flex;
    align-items: center;
}

.pwd-field input {
    width: 100%;
    padding-right: 2.2rem !important;
}

.pwd-toggle-btn {
    position: absolute;
    right: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0.2rem;
    margin: 0;
    cursor: pointer;
    color: var(--ink-muted);
    line-height: 0;
}

.pwd-toggle-btn:hover {
    color: var(--gold);
}

.pwd-toggle-btn svg {
    position: static;
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.pwd-toggle-btn .icon-closed {
    display: none;
}

.pwd-toggle-btn.is-visible .icon-open {
    display: none;
}

.pwd-toggle-btn.is-visible .icon-closed {
    display: inline-flex;
}

.login-row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.85rem;
    font-size: 0.75rem;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--ink-muted);
    margin-top: 0 !important;
    cursor: pointer;
}

.login-remember input {
    accent-color: var(--gold);
}

.login-forgot {
    color: var(--gold-light);
    cursor: pointer;
    text-decoration: none;
}

.login-forgot:hover {
    text-decoration: underline;
}

.login-submit {
    margin-top: 1.1rem;
    width: 100%;
    border: none;
    border-radius: 8px;
    padding: 0.65rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.login-divider {
    text-align: center;
    color: var(--ink-muted);
    font-size: 0.75rem;
    margin: 1.25rem 0 0.75rem;
}

.login-guest {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-align: left;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    color: var(--ink-muted);
    text-decoration: none;
    font-size: 0.85rem;
}

.login-guest svg {
    width: 22px;
    height: 22px;
    color: var(--gold);
    flex-shrink: 0;
}

.login-guest small {
    display: block;
    color: var(--ink-muted);
    font-size: 0.7rem;
    font-weight: 400;
}

.login-guest:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.login-feature-tiles {
    width: 100%;
    max-width: 440px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.login-feature-tile {
    text-align: center;
    padding: 0.5rem;
}

.login-feature-tile svg {
    width: 22px;
    height: 22px;
    color: var(--gold);
}

.login-feature-tile .title {
    color: var(--ink);
    font-weight: 700;
    font-size: 0.78rem;
    margin-top: 0.35rem;
}

.login-feature-tile .meta {
    color: var(--ink-muted);
    font-size: 0.65rem;
    margin-top: 0.15rem;
}

.login-footer {
    color: var(--ink-muted);
    font-size: 0.75rem;
}

@media (max-width: 900px) {
    .login-shell { flex-direction: column; }
    .login-left { border-right: none; border-bottom: 1px solid var(--border); padding: 2rem; }
    .login-feature-tiles { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Admin forms ---------- */

.user-create-form {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

/* ---------- Confirmation modal ---------- */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-card {
    background: var(--card-bg);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    padding: 1.75rem;
    max-width: 420px;
    width: 90%;
}

.modal-card h3 {
    margin-top: 0;
    color: var(--gold);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.9rem;
}

.form-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--gold);
}

.form-grid label {
    display: block;
    color: var(--ink-muted);
    font-size: 0.78rem;
    margin-bottom: 0.3rem;
}

.form-grid input, .form-grid select {
    width: 100%;
    background: var(--card-bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    color: var(--ink);
    font-size: 0.88rem;
}

.form-grid input:focus, .form-grid select:focus {
    outline: none;
    border-color: var(--gold);
}

.form-readonly-value {
    width: 100%;
    background: var(--card-bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    color: var(--ink);
    font-size: 0.88rem;
    box-sizing: border-box;
}

.register-choice-group {
    display: inline-flex;
    gap: 0.4rem;
}

.user-actions {
    display: flex;
    gap: 0.5rem;
}

.user-actions .btn-outline-gold {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
}

.bracket-winner {
    color: var(--gold-light);
    font-weight: 700;
}

.breadcrumb-link {
    color: var(--ink-muted);
    text-decoration: none;
    font-size: 0.85rem;
}

.breadcrumb-link:hover {
    color: var(--gold);
}

/* ---------- Bracket tree (World Taekwondo style, mirrored wings converging on the final) ---------- */

.bracket-tree-wrapper {
    overflow-x: auto;
    padding-bottom: 1rem;
}

.bracket-tree {
    position: relative;
}

.bracket-round-header {
    position: absolute;
    top: 0;
    text-align: center;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gold);
    font-weight: 700;
}

.bracket-lines {
    position: absolute;
    left: 0;
    pointer-events: none;
}

.bracket-lines line {
    stroke: var(--border-strong);
    stroke-width: 1.5;
}

.bracket-match-box {
    position: absolute;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    box-sizing: border-box;
    cursor: pointer;
}

.bracket-match-number {
    position: absolute;
    top: -9px;
    right: 6px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--danger);
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0 4px;
    border-radius: 4px;
    line-height: 1.3;
}

.bracket-match-box:hover {
    border-color: var(--gold-dark);
}

.bracket-match-selected {
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold);
}

.bracket-slot-row {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.bracket-draw-number {
    flex: 0 0 auto;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gold);
    min-width: 1.3em;
    text-align: center;
}

.bracket-slot-text {
    min-width: 0;
    flex: 1 1 auto;
}

.bracket-slot {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bracket-slot-club {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ink-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bracket-slot-masked {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--border-strong);
    letter-spacing: 0.15em;
}

.bracket-winner {
    color: var(--gold-light);
    font-weight: 700;
}

.bracket-match-id {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 0.55rem;
    color: var(--ink-muted);
}

.bracket-bye-tag {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 0.55rem;
    font-style: italic;
    color: var(--ink-muted);
}

.bracket-swap-btn {
    position: absolute;
    bottom: -9px;
    right: 6px;
    width: 18px;
    height: 18px;
    line-height: 16px;
    text-align: center;
    padding: 0;
    font-size: 0.7rem;
    color: var(--gold);
    background: var(--app-bg);
    border: 1px solid var(--gold);
    border-radius: 50%;
    cursor: pointer;
}

.bracket-swap-btn:hover {
    background: var(--gold);
    color: #0a0a0a;
}

/* ---------- Tirage au sort — dashboard ---------- */

.match-detail-panel dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.4rem 0.75rem;
    margin: 0;
}

.match-detail-panel dt {
    color: var(--ink-muted);
    font-size: 0.78rem;
}

.match-detail-panel dd {
    margin: 0;
    font-size: 0.85rem;
    text-align: right;
}

.bracket-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--ink-muted);
}

.bracket-legend li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
}

.bracket-legend .legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
    flex-shrink: 0;
}

/* ---------- Admin dashboard v2 (hero / quick actions / two-column) ---------- */

.dash-hero {
    background: linear-gradient(120deg, var(--card-bg-alt) 0%, var(--card-bg) 60%, var(--app-bg) 100%);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.75rem 2rem;
    margin-bottom: 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.dash-hero h2 {
    margin: 0 0 0.35rem 0;
    font-size: 1.6rem;
}

.dash-hero .meta {
    margin: 0;
}

.dash-hero-clock {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.dash-hero-clock span {
    background: var(--app-bg);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
    color: var(--gold-light);
    font-weight: 600;
}

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

.action-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.1rem 1rem;
    text-align: center;
    text-decoration: none;
    color: var(--ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: border-color 0.15s, transform 0.15s;
}

.action-card:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
    color: var(--ink);
}

.action-card svg {
    width: 28px;
    height: 28px;
    color: var(--gold);
}

.action-card .title {
    font-weight: 700;
    font-size: 0.9rem;
}

.action-card .meta {
    font-size: 0.75rem;
}

.dash-columns {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .dash-columns {
        grid-template-columns: 1fr;
    }
}

.quick-stats-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quick-stats-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.6rem;
    font-size: 0.85rem;
    color: var(--ink-muted);
}

.quick-stats-list li strong {
    color: var(--gold);
    font-size: 1.1rem;
}

.countdown {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.countdown div {
    background: var(--app-bg);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 0.6rem 0.3rem;
    text-align: center;
}

.countdown strong {
    display: block;
    font-size: 1.3rem;
    color: var(--gold);
}

.countdown span {
    font-size: 0.65rem;
    color: var(--ink-muted);
    text-transform: uppercase;
}

.dash-table-row {
    cursor: pointer;
}

.dash-table-row:hover {
    background: var(--card-bg-alt);
}

.dash-table-row.selected {
    background: var(--card-bg-alt);
    outline: 1px solid var(--gold);
}

/* ---------- Admin compétitions v2 (cards + detail panel) ---------- */

.badge-archive { background: var(--card-bg-alt); color: var(--ink-muted); }

.comp-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.comp-toolbar button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.comp-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.comp-search {
    flex: 1;
    min-width: 220px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.55rem 0.8rem;
    color: var(--ink);
    font-size: 0.9rem;
}

.comp-status-filter {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.55rem 0.8rem;
    color: var(--ink);
    font-size: 0.85rem;
}

.comp-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .comp-layout { grid-template-columns: 1fr; }
}

.comp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.1rem;
}

.comp-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}

.comp-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.comp-card.selected {
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold);
}

.comp-card-image {
    position: relative;
    height: 130px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: #000;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0.6rem 0.75rem;
}

.comp-card-image .badge-statut {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    font-size: 0.62rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-weight: 700;
    text-transform: uppercase;
}

.comp-pin {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    font-size: 1rem;
}

.comp-card-title {
    background: linear-gradient(0deg, rgba(0,0,0,0.75), transparent);
    padding: 0.5rem 0.25rem 0.1rem;
    display: flex;
    flex-direction: column;
}

.comp-card-title strong {
    color: #fff;
    font-size: 0.95rem;
}

.comp-card-title span {
    color: var(--gold-light);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.comp-card-body {
    padding: 0.75rem 0.9rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.comp-card-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--ink-muted);
}

.comp-detail {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    position: sticky;
    top: 1rem;
}

.comp-detail-image {
    position: relative;
    height: 150px;
    border-radius: 10px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: #000;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0.6rem 0.75rem;
    margin-bottom: 1rem;
}

.comp-detail-image .badge-statut {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    font-size: 0.62rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-weight: 700;
    text-transform: uppercase;
}

.comp-detail-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.4rem 0.75rem;
    margin: 0 0 1.25rem;
}

.comp-detail-list dt {
    color: var(--ink-muted);
    font-size: 0.75rem;
}

.comp-detail-list dd {
    margin: 0;
    color: var(--ink);
    font-size: 0.8rem;
    text-align: right;
}

.comp-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.icon-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--ink-muted);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    line-height: 1;
    font-size: 0.85rem;
    cursor: pointer;
}

.icon-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.icon-btn-danger:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* ---------- Pesée (operator console) ---------- */

.pesee-search-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1.25rem 0;
}

.pesee-search-results {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.pesee-search-results li {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.pesee-search-results li:last-child { border-bottom: none; }
.pesee-search-results li:hover { background: var(--card-bg-alt); color: var(--gold); }

.pesee-scan-stub {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px dashed var(--border-strong);
    border-radius: 10px;
    color: var(--ink-muted);
    font-size: 0.8rem;
    margin-top: 0.5rem;
    cursor: pointer;
}

.pesee-scan-stub:hover { border-color: var(--gold); color: var(--gold); }

.pesee-scan-modal-card { max-width: 480px; text-align: center; }

.pesee-scan-video {
    width: 100%;
    max-height: 340px;
    background: #000;
    border-radius: 10px;
    margin-top: 0.75rem;
    object-fit: cover;
}

.pesee-profile { margin-bottom: 1.25rem; }

.pesee-profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.pesee-photo {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid var(--gold);
}

.pesee-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg-alt);
    font-size: 2rem;
}

.pesee-id-badge {
    display: inline-block;
    background: var(--card-bg-alt);
    border: 1px solid var(--border-strong);
    color: var(--gold-light);
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.68rem;
    font-weight: 700;
    vertical-align: middle;
    margin-left: 0.5rem;
}

.pesee-info-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    background: var(--card-bg-alt);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
}

.pesee-info-row div { display: flex; flex-direction: column; gap: 0.15rem; }
.pesee-info-row strong { font-size: 0.85rem; }

.pesee-metric-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.pesee-metric-card {
    background: var(--card-bg-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
}

.pesee-metric-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--ink);
    margin: 0.3rem 0;
}

.pesee-metric-value.gold { color: var(--gold); }
.pesee-metric-value.danger { color: var(--danger); }

.pesee-result-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: stretch;
    margin-top: 1.25rem;
}

.pesee-result-banner {
    flex: 1;
    min-width: 260px;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
}

.pesee-result-banner.ok { background: var(--success-bg); color: var(--success); border: 1px solid var(--success); }
.pesee-result-banner.ko { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }
.pesee-result-banner strong { font-size: 1.15rem; }

.pesee-result-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: center;
    min-width: 220px;
}

.pesee-nav-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.pesee-side-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 1.25rem;
    margin-top: 1.5rem;
    align-items: start;
}

@media (max-width: 1100px) {
    .pesee-side-grid { grid-template-columns: 1fr; }
}

.pesee-ticket-qr {
    width: 120px;
    height: 120px;
    background: #fff;
    border-radius: 6px;
    margin: 0 auto 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}

.pesee-ticket-qr img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- Gestion des utilisateurs ---------- */

.users-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
    margin: 1.25rem 0;
    padding-bottom: 0.75rem;
}

.users-tab {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--ink-muted);
    border-radius: 999px;
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    cursor: pointer;
}

.users-tab.active {
    background: var(--card-bg-alt);
    border-color: var(--gold);
    color: var(--gold);
}

.presence-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.35rem;
}

.presence-dot.online { background: var(--success); }
.presence-dot.away { background: var(--warning); }
.presence-dot.offline { background: var(--ink-muted); }

.donut-legend {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.donut-legend li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--ink-muted);
}

.donut-legend li span {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.quick-actions-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

@media (max-width: 1000px) {
    .pesee-side-grid[style] { grid-template-columns: 1fr !important; }
}

@media print {
    .app-sidebar, .app-header, .pesee-search-row, .kpi-row, .pesee-profile, .pesee-side-grid > *:not(.pesee-ticket) {
        display: none !important;
    }
    .comp-toolbar, .users-tabs, .breadcrumb-link, .pesee-scan-modal-overlay {
        display: none !important;
    }
}

/* ---------- Classements — podium & top performers ---------- */

.podium-visual {
    position: relative;
    max-width: 480px;
    margin: 0 auto 1.5rem;
}

.podium-bg {
    width: 100%;
    display: block;
}

.podium-slot {
    position: absolute;
    width: 30%;
    text-align: center;
}

.podium-slot-1 { left: 35%; top: 0%; }
.podium-slot-2 { left: 2%; top: 16%; }
.podium-slot-3 { left: 68%; top: 20%; }

.podium-club-name {
    font-weight: 700;
    font-size: 0.92rem;
    margin-top: 0.3rem;
    color: var(--ink);
    line-height: 1.15;
}

.podium-club-points {
    font-size: 0.8rem;
    color: var(--gold-light);
    font-weight: 700;
}

.podium-badge, .award-badge, .performer-badge, .ranking-badge {
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    display: inline-block;
}

.podium-badge { width: 56px; height: 56px; margin: 0 auto; border: 2px solid var(--gold); }
.award-badge { width: 64px; height: 64px; border: 2px solid var(--gold); }
.performer-badge { width: 56px; height: 56px; border: 2px solid var(--border); }
.ranking-badge { width: 26px; height: 26px; border: 1px solid var(--border); flex-shrink: 0; }

.badge-fallback {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: var(--card-bg-alt);
    color: var(--gold);
    font-weight: 700;
    font-size: 0.75rem;
}

.performer-card {
    text-align: center;
}

.performer-name {
    font-weight: 700;
    margin-top: 0.5rem;
}

@media (max-width: 700px) {
    .podium-visual { max-width: 320px; }
    .podium-club-name { font-size: 0.78rem; }
}

/* ---------- Classement 2ème écran — podium à droite, tableau qui défile à gauche ----------
   "à droite"/"à gauche" ici sont des positions PHYSIQUES voulues telles quelles, pas des positions
   logiques "début/fin" qui suivraient le sens de lecture — d'où l'override RTL explicite ci-dessous
   plutôt que de laisser flex-direction/order se retourner tout seuls avec dir="rtl" (même logique que
   l'inversion rouge/bleu déjà faite ailleurs pour .live-athlete-blue). */

.live-classement-layout {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.live-podium-visual {
    order: 2;
    flex: 0 0 auto;
    width: min(38vw, 420px);
    margin: 4.5rem 0 0;
}

html[dir="rtl"] .live-podium-visual {
    order: 1;
}

/* Sur le 2ème écran, le nom/logo/points de chaque club et l'image du podium ne se superposent plus
   (contrairement à .podium-slot ailleurs, positionné en absolute PAR-DESSUS .podium-bg) : trois colonnes
   distinctes (nom en haut, logo, points) rangées côte à côte, PUIS l'image du podium séparément en
   dessous — demandé explicitement par l'organisateur, qui trouvait le texte "mélangé" à l'image. */
.live-podium-columns {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.live-podium-visual .podium-slot {
    position: static;
    width: auto;
    flex: 1 1 0;
    min-width: 0;
}

.live-podium-visual .podium-slot-1 { order: 2; }
.live-podium-visual .podium-slot-2 { order: 1; }
.live-podium-visual .podium-slot-3 { order: 3; }

.live-podium-visual .podium-badge {
    width: 84px;
    height: 84px;
    border-width: 3px;
}

.live-podium-visual .podium-club-name {
    font-size: 1.3rem;
    margin: 0 0 0.5rem;
}

.live-podium-visual .podium-club-points {
    font-size: 1.05rem;
    margin-top: 0.4rem;
}

.live-ranking-scroll {
    order: 1;
    position: relative;
    flex: 1 1 320px;
    min-width: 0;
    max-height: min(70vh, calc(100vh - 220px));
    overflow-y: hidden;
}

html[dir="rtl"] .live-ranking-scroll {
    order: 2;
}

.live-ranking-scroll .ranking-table {
    width: 100%;
}

@media (max-width: 900px) {
    /* Sous cette largeur, deux colonnes côte à côte deviennent trop étroites pour rester lisibles —
       on repasse en pile verticale (podium d'abord, tableau en dessous) plutôt que de forcer le
       côte-à-côte sur un petit écran/portrait. */
    .live-classement-layout {
        flex-direction: column;
    }

    .live-podium-visual {
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
        order: 1;
    }

    .live-ranking-scroll {
        width: 100%;
        order: 2;
    }

    html[dir="rtl"] .live-podium-visual,
    html[dir="rtl"] .live-ranking-scroll {
        order: initial;
    }
}

/* ---------- Résultats 2ème écran — flux de combats terminés ---------- */

.results-feed {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 1rem;
}

.result-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem 1.1rem;
}

.result-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--ink-muted);
    margin-bottom: 0.6rem;
}

.result-card-round {
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.03em;
}

.result-card-body {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
}

.result-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.result-club-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    border: 2px solid var(--border);
}

.result-winner .result-club-badge {
    border-color: var(--gold);
}

.result-name {
    font-weight: 700;
    font-size: 0.92rem;
}

.result-loser .result-name {
    color: var(--ink-muted);
    font-weight: 600;
}

.result-medal {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--gold-light);
    margin-top: 0.15rem;
}

.result-vs {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--ink-muted);
    font-variant-numeric: tabular-nums;
}

/* ---------- Résultats 2ème écran — classement vertical par catégorie (piloté depuis
   /admin/résultats) : 1er/2e/3e/3e empilés avec photo d'athlète, une ligne = un médaillé. ---------- */

.medal-podium-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 1rem;
    max-width: 640px;
}

.medal-podium-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
}

.medal-podium-row:first-child {
    border-color: var(--gold);
}

.medal-podium-rank {
    flex: 0 0 auto;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold-light);
    min-width: 6.5rem;
}

.medal-podium-photo {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    border: 2px solid var(--gold);
}

/* Repli "icône générique" (aucune photo d'athlète NI logo de club) : un simple symbole ♂/♀ plutôt que
   des initiales — trop petit avec la taille de police par défaut de .badge-fallback pour un cercle de
   64px, d'où l'agrandissement ici. */
.medal-podium-photo.badge-fallback {
    font-size: 1.8rem;
}

.medal-podium-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.medal-podium-name {
    font-weight: 700;
    font-size: 1.15rem;
}

/* ---------- Matchs — raccourci "victoire rapide" ---------- */

.quick-win-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-quick-win {
    flex: 1;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    border: none;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    color: #fff;
}

.btn-quick-win-red {
    background-color: var(--danger);
}

.btn-quick-win-red:hover {
    background-color: #d63838;
}

.btn-quick-win-blue {
    background-color: var(--info);
}

.btn-quick-win-blue:hover {
    background-color: #3a76d8;
}

/* ---------- Combats en cours — Live Arena ---------- */

.live-arena-layout {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 1.25rem;
    margin-top: 1.25rem;
    align-items: start;
}

.live-tatami-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.live-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.live-match-card {
    padding: 1rem;
}

.live-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--ink-muted);
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}

.live-tatami-label {
    font-weight: 800;
    color: var(--gold);
    letter-spacing: 0.04em;
}

.live-fighters {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.live-fighter-name {
    font-size: 0.78rem;
    font-weight: 600;
    min-height: 2.2em;
}

.live-score {
    font-size: 2rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.live-fighter.red .live-score { color: var(--danger); }
.live-fighter.blue .live-score { color: var(--info); }

.live-timer {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold-light);
    font-variant-numeric: tabular-nums;
}

.gamjeom-row {
    display: flex;
    gap: 3px;
    justify-content: center;
    min-height: 10px;
    margin-top: 0.2rem;
}

.gamjeom-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    display: inline-block;
}

.live-score-controls {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.live-score-buttons {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.live-score-buttons button {
    padding: 0.3rem 0.5rem;
    font-size: 0.72rem;
}

.live-round-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
    flex-wrap: wrap;
}

.live-queue {
    margin-top: 0.85rem;
    padding-top: 0.6rem;
    border-top: 1px dashed var(--border);
}

.live-queue-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    color: var(--ink-muted);
    margin-bottom: 0.4rem;
}

.live-queue-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.76rem;
    padding: 0.25rem 0;
}

.live-queue-item + .live-queue-item {
    border-top: 1px solid var(--border);
}

.live-queue-number {
    color: var(--gold);
    font-weight: 700;
    flex: 0 0 auto;
}

.live-queue-fighters {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .live-arena-layout { grid-template-columns: 1fr; }
}

/* ---------- Match dashboard (tableau de bord "Matchs" + 2ème écran) ---------- */
/* Classes partagées entre OrganisateurMatchs.razor (garde .live-arena-layout/.live-tatami-grid/.live-
   sidebar/.live-score-controls/.live-round-controls/.live-queue* pour la grille et les contrôles
   d'arbitrage) et Live.razor en mode kiosque (structure 2 colonnes complète, lecture seule). */

.match-dashboard-columns {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1100px) {
    .match-dashboard-columns { grid-template-columns: 1fr; }
}

.match-col-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.match-col-header {
    padding: 0.85rem 1.25rem;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-align: center;
}

.match-col-header.en-cours { background: var(--danger); color: #fff; }
.match-col-header.a-suivre { background: var(--gold); color: #1a1400; }

.match-col-body { padding: 1rem; display: flex; flex-direction: column; gap: 1rem; }

.match-tatami-card {
    display: flex;
    background: var(--card-bg-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.match-tatami-badge {
    flex-shrink: 0;
    width: 62px;
    background: var(--danger-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.75rem 0.4rem;
    color: var(--danger);
    text-align: center;
}

.match-tatami-badge .num { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.match-tatami-badge .label { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted); }

.match-tatami-content { flex: 1; padding: 0.85rem 1rem; min-width: 0; }

.match-tatami-content-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.65rem;
    font-size: 0.78rem;
    color: var(--ink-muted);
}

.match-tatami-content-head .match-no { font-weight: 700; color: var(--ink); }

.match-fighters-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
}

.match-fighter { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.match-fighter.blue { align-items: flex-start; }
.match-fighter.red { align-items: flex-end; text-align: right; }

.match-fighter-name {
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.match-fighter.blue .match-fighter-name { color: var(--info); }
.match-fighter.red .match-fighter-name { color: var(--danger); flex-direction: row-reverse; }

.match-fighter-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.match-fighter-club { font-size: 0.72rem; color: var(--ink-muted); }

.match-fighter-score {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
    margin-top: 0.15rem;
    font-variant-numeric: tabular-nums;
}

.match-fighter.blue .match-fighter-score { color: var(--info); }
.match-fighter.red .match-fighter-score { color: var(--danger); }

.match-round-timer { text-align: center; flex-shrink: 0; }
.match-round-timer .round-label { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-muted); }
.match-round-timer .time {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--gold-light);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 0.2rem 0.6rem;
    margin-top: 0.15rem;
    font-variant-numeric: tabular-nums;
}

.match-club-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    border-radius: 4px;
    background: #fff;
    padding: 1px;
    flex-shrink: 0;
}

.match-round-results { margin-top: 0.7rem; display: flex; flex-direction: column; gap: 0.4rem; }

.match-round-result-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
    gap: 0.5rem;
}

.match-round-result-label { color: var(--ink-muted); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; }
.match-round-result-winner { display: flex; align-items: center; gap: 0.3rem; font-weight: 700; justify-content: center; text-align: center; }
.match-round-result-score { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

.match-upcoming-group { margin-bottom: 1.1rem; }
.match-upcoming-group:last-child { margin-bottom: 0; }

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

.match-upcoming-tapis-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.match-upcoming-tapis-label { font-weight: 700; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.03em; color: var(--gold-light); }

.match-upcoming-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }

.match-upcoming-table th {
    text-align: left;
    color: var(--ink-muted);
    font-weight: 600;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid var(--border);
}

.match-upcoming-table td { padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.match-upcoming-table tr:last-child td { border-bottom: none; }

.match-upcoming-vs-row { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.match-upcoming-vs-row .blue { color: var(--info); font-weight: 600; display: inline-flex; align-items: center; gap: 0.3rem; }
.match-upcoming-vs-row .red { color: var(--danger); font-weight: 600; display: inline-flex; align-items: center; gap: 0.3rem; }
.match-upcoming-vs-row .vs { color: var(--ink-muted); font-size: 0.7rem; }

.match-legend-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.74rem;
    color: var(--ink-muted);
}

.match-legend-item { display: flex; align-items: center; gap: 0.4rem; }
.match-legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.match-legend-dot.blue { background: var(--info); }
.match-legend-dot.red { background: var(--danger); }
.match-legend-motto { color: var(--gold); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------- Galerie ---------- */

.gallery-grid, .gallery-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.gallery-photo-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
}

.gallery-photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-delete-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--danger);
    background: var(--app-bg);
    color: var(--danger);
    cursor: pointer;
    line-height: 1;
}

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

.gallery-photo-grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: border-color 0.15s;
}

.gallery-photo-grid img:hover {
    border-color: var(--gold);
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
    padding: 2rem;
}

.gallery-lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}

.gallery-folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.gallery-folder-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: var(--ink);
    transition: border-color 0.15s, transform 0.15s;
    display: block;
}

.gallery-folder-card:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
    color: var(--ink);
}

.gallery-folder-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.gallery-folder-placeholder {
    width: 100%;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg-alt);
    color: var(--gold-dark);
}

.gallery-folder-placeholder svg {
    width: 48px;
    height: 48px;
}

.gallery-folder-info {
    padding: 0.9rem 1rem;
}

.gallery-folder-info h4 {
    margin: 0 0 0.3rem;
    font-size: 0.95rem;
}

.statut-quick-select {
    margin-top: 0.5rem;
    border: none;
    border-radius: 999px;
    padding: 0.25rem 1.6rem 0.25rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
}

.comp-pagination {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* ---------- Assistant de création de compétition (wizard) ---------- */

.wizard-body {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1.5rem;
    align-items: start;
    margin-top: 1.5rem;
}

@media (max-width: 900px) {
    .wizard-body { grid-template-columns: 1fr; }
}

.wizard-stepper {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
}

.wizard-stepper li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.6rem;
    border-radius: 8px;
    font-size: 0.82rem;
    color: var(--ink-muted);
}

.wizard-stepper li.active {
    background: var(--card-bg-alt);
    color: var(--gold);
    font-weight: 700;
}

.wizard-stepper li.done {
    color: var(--success);
}

.wizard-step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    flex-shrink: 0;
}

.wizard-stepper li.active .wizard-step-num {
    border-color: var(--gold);
    color: var(--gold);
}

.wizard-stepper li.done .wizard-step-num {
    border-color: var(--success);
    color: var(--success);
}

.wizard-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.wizard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 700px) {
    .wizard-grid { grid-template-columns: 1fr; }
}

.wizard-grid label {
    display: block;
    color: var(--ink-muted);
    font-size: 0.78rem;
    margin: 0.75rem 0 0.3rem;
}

.wizard-input {
    width: 100%;
    background: var(--card-bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    color: var(--ink);
    font-size: 0.9rem;
}

.wizard-input:focus {
    outline: none;
    border-color: var(--gold);
}

.wizard-poster-preview {
    display: block;
    max-width: 100%;
    max-height: 480px;
    width: auto;
    height: auto;
    border-radius: 10px;
    border: 1px solid var(--border);
    margin: 0 auto;
}

.wizard-poster-empty {
    height: 260px;
    background-color: var(--card-bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wizard-poster-placeholder {
    text-align: center;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.wizard-poster-placeholder strong {
    color: var(--ink);
    font-size: 1.2rem;
}

.wizard-poster-placeholder span {
    color: var(--gold-light);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.wizard-code-preview {
    background: var(--card-bg-alt);
    border: 1px dashed var(--border-strong);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    color: var(--ink-muted);
    font-size: 0.82rem;
}

.wizard-map {
    width: 100%;
    height: 200px;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.wizard-map-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-muted);
    font-size: 0.8rem;
    background: var(--card-bg-alt);
    text-align: center;
    padding: 1rem;
}

.wizard-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wizard-checkbox-list label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: var(--ink);
    font-size: 0.85rem;
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.wizard-success {
    text-align: center;
    max-width: 720px;
    margin: 2rem auto;
}

.wizard-success-icon {
    font-size: 3rem;
}

.wizard-code {
    display: inline-block;
    margin-top: 0.75rem;
    background: var(--card-bg-alt);
    border: 1px solid var(--gold);
    color: var(--gold);
    border-radius: 999px;
    padding: 0.4rem 1.1rem;
    font-weight: 700;
    font-size: 0.85rem;
}

.wizard-success-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

@media (max-width: 700px) {
    .wizard-success-actions { grid-template-columns: repeat(2, 1fr); }
}

.wizard-success-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1rem;
    text-align: center;
    text-decoration: none;
    color: var(--ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    transition: border-color 0.15s, transform 0.15s;
}

.wizard-success-card:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
    color: var(--ink);
}

.wizard-success-card svg {
    width: 26px;
    height: 26px;
    color: var(--gold);
}

.wizard-success-card .title {
    font-weight: 700;
    font-size: 0.85rem;
}

.wizard-success-card .meta {
    font-size: 0.72rem;
}

/* ---------- RTL (arabe) ---------- */
/* La direction "row" de flexbox est déjà consciente de dir="rtl" nativement (justify-content,
   header flex, etc. se retournent tout seuls) — seuls les éléments à positionnement structurel FIXE
   (sidebar collée à un bord précis, marge du contenu principal) ont besoin d'un override explicite. */

html[dir="rtl"] .app-sidebar {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid var(--border);
}

html[dir="rtl"] .app-main {
    margin-left: 0;
    margin-right: var(--sidebar-width);
}

@media (max-width: 900px) {
    html[dir="rtl"] .app-main { margin-right: 0; }
}

html[dir="rtl"] .login-shell > .lang-selector {
    right: auto;
    left: 1.5rem;
}

html[dir="rtl"] .breadcrumb-link {
    direction: rtl;
}

html[dir="rtl"] .live-athlete-blue {
    text-align: left;
}

/* ---------- Live public display shell (page /live, écran public / vidéoprojecteur) ---------- */
/* Layout dédié sans sidebar/header admin : plein écran, typographie plus grande pour être
   lisible à distance depuis les gradins, pensé pour tourner sans supervision sur un 2ème écran. */

.live-shell {
    min-height: 100vh;
    background: var(--app-bg);
    display: flex;
    flex-direction: column;
}

.live-shell-header {
    height: 64px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    border-bottom: 1px solid var(--border);
}

.live-shell-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--gold);
    font-weight: 800;
    letter-spacing: 0.05em;
    font-size: 0.95rem;
}

.live-shell-brand img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
    padding: 2px;
}

.live-shell-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.live-shell-content {
    flex: 1;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem 2rem 3rem;
}

.live-shell-content .live-tatami-grid {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.live-shell-content .live-tatami-card h3 {
    font-size: 1.25rem;
}

.live-shell-content .live-athlete {
    font-size: 1.15rem;
}

.live-shell-content .live-score {
    font-size: 2.1rem;
}

.live-shell-content .live-match-meta {
    font-size: 0.9rem;
}

html[dir="rtl"] .live-shell-content .live-athlete-blue {
    text-align: left;
}

/* Mode kiosque (2ème écran ouvert automatiquement, en-tête/nav masqués) : on récupère tout l'espace
   que l'en-tête aurait pris, et on resserre les marges pour que le contenu tienne sur un seul écran
   sans avoir besoin de défiler pour les cas courants (quelques tatamis, tirage de taille normale). */
.live-shell-kiosk .live-shell-content {
    max-width: 100%;
    padding: 1rem 1.5rem;
}

/* Bandeau de marque du mode kiosque : présent sur TOUTES les fenêtres du 2ème écran (Live/Tirage/
   Athlètes/Clubs), pas seulement l'écran d'accueil du Tirage — logo marque + nom compétition + logo
   compétition. flexbox (pas position:absolute comme .tirage-idle-logo-*) : l'ordre naturel des enfants
   se retourne déjà tout seul en RTL, pas besoin d'overrides left/right séparés ici. */
.live-kiosk-brand-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--card-bg);
}

.live-kiosk-brand-logo {
    height: 44px;
    max-width: 140px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
    padding: 2px;
    flex-shrink: 0;
}

.live-kiosk-brand-title {
    flex: 1;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: 0.03em;
}

.live-kiosk-brand-time {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
    font-size: 0.85rem;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.live-kiosk-brand-time #akdim-kiosk-date {
    color: var(--ink-muted);
    font-size: 0.75rem;
}

.live-shell-kiosk .tirage-reveal-shell {
    height: calc(100vh - 2rem);
}

/* ---------- Public display nav (Live / Tirage / Athlètes / Clubs switcher) ---------- */

.live-public-nav {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0 0.5rem;
    flex-wrap: wrap;
}

.live-public-nav a {
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--ink-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.live-public-nav a.active {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(212, 175, 55, 0.08);
}

/* ---------- Tirage "reveal" en direct (écran public, /live/tirage synchronisé) ---------- */

.tirage-reveal-shell {
    display: flex;
    flex-direction: column;
    /* height fixe (pas min-height) : c'est ce qui force le calcul JS d'auto-fit (akdimAutoFitBracket)
       à mesurer un espace disponible réellement borné par la fenêtre — avec min-height, le conteneur
       grandissait pour englober un grand tirage au lieu de le contraindre, et la mise à l'échelle
       automatique se retrouvait sans effet (le "disponible" mesuré grandissait avec le contenu). */
    height: calc(100vh - 64px - 3rem);
}

.tirage-reveal-header {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--ink);
    padding: 0.75rem 0 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.25rem;
    flex-shrink: 0;
}

.tirage-reveal-header .sep {
    color: var(--ink-muted);
    font-weight: 400;
}

.tirage-reveal-header .gold {
    color: var(--gold);
}

.tirage-reveal-roster {
    max-width: 640px;
}

.tirage-reveal-bracket {
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Le zoom réel est calculé et posé en JS (akdimAutoFitBracket, appelé depuis BracketTree quand
   AutoFit="true") pour s'adapter à la taille réelle du tirage — un zoom fixe déborde dès qu'il y a
   beaucoup de tours/combats, obligeant à défiler, ce qui est exactement ce qu'on veut éviter ici. */

/* ---------- Écran d'accueil Tirage (kiosque, avant sélection d'une catégorie) ---------- */

.tirage-idle-shell {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.tirage-idle-logo {
    position: absolute;
    top: 0;
    max-height: 110px;
    max-width: 220px;
    object-fit: contain;
}

.tirage-idle-logo-left {
    left: 0;
}

.tirage-idle-logo-right {
    right: 0;
}

.tirage-idle-center {
    text-align: center;
}

.tirage-idle-title {
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tirage-idle-competition {
    margin-top: 0.75rem;
    font-size: 1.4rem;
    color: var(--ink);
}

html[dir="rtl"] .tirage-idle-logo-left {
    left: auto;
    right: 0;
}

html[dir="rtl"] .tirage-idle-logo-right {
    right: auto;
    left: 0;
}
