.tournament-page{min-height:calc(100vh - 160px);padding:38px 16px 60px;background:linear-gradient(180deg,#f4f8ff 0%,#eef4fb 100%);font-family:Tahoma,Arial,sans-serif;color:#172b4d}
.tournament-shell{max-width:1040px;margin:0 auto}
.tournament-hero{text-align:center;padding:18px 15px 28px}
.tournament-cup{font-size:70px;line-height:1;margin-bottom:8px;filter:drop-shadow(0 7px 8px rgba(37,99,235,.15))}
.tournament-hero h1{margin:0;color:#17418f;font-size:42px;font-weight:900}
.tournament-hero p{margin:12px auto 0;color:#64748b;font-size:18px;line-height:1.8}
.tournament-intro,.tournament-card{background:#fff;border:1px solid #dce6f3;border-radius:24px;box-shadow:0 12px 38px rgba(29,61,104,.08);padding:28px;margin-bottom:18px}
.tournament-intro{text-align:center}
.intro-badge{display:inline-block;padding:8px 16px;border-radius:999px;background:#eef4ff;color:#1d4ed8;font-weight:800;border:1px solid #cfe0ff}
.tournament-intro h2,.tournament-card h2{margin:12px 0 8px;color:#173b8f;font-size:28px}
.intro-text{max-width:760px;margin:0 auto 26px;color:#52657d;line-height:1.9;font-size:16px}
.tournament-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;text-align:right}
.tournament-option{border:1px solid #dbe5f1;border-radius:18px;padding:22px;background:#f9fbff;display:flex;flex-direction:column;align-items:flex-start}
.option-icon{font-size:40px;margin-bottom:5px}.tournament-option h3{margin:0;color:#173b8f;font-size:22px}.tournament-option p{color:#5b6d84;line-height:1.8;min-height:76px;margin:8px 0}.availability,.option-meta{font-size:14px;color:#64748b;margin:4px 0 15px;font-weight:700}.availability.ok{color:#15803d}.availability.warn{color:#b45309}
.tournament-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:0;border-radius:12px;padding:12px 18px;text-decoration:none;font-weight:800;font-size:15px;cursor:pointer;transition:.18s transform,.18s opacity,.18s box-shadow;box-sizing:border-box}.tournament-btn:hover{transform:translateY(-1px);box-shadow:0 7px 16px rgba(15,23,42,.1)}.tournament-btn:disabled{opacity:.48;cursor:not-allowed;transform:none;box-shadow:none}.tournament-btn.primary{background:#2563eb;color:#fff}.tournament-btn.blue{background:#1d4ed8;color:#fff}.tournament-btn.gold{background:#eab308;color:#422006}.tournament-btn.secondary{background:#e8eef8;color:#24446e}.tournament-btn.danger{background:#fff1f2;color:#be123c;border:1px solid #fecdd3}.tournament-btn.large{min-height:50px;font-size:17px;padding:13px 25px}
.tournament-option .tournament-btn{width:100%;margin-top:auto}.join-divider{display:flex;align-items:center;gap:15px;margin:28px 0 20px;color:#64748b;font-weight:800}.join-divider:before,.join-divider:after{content:"";height:1px;background:#e2e8f0;flex:1}.join-divider span{border:1px solid #e2e8f0;background:#fff;border-radius:50%;width:34px;height:34px;display:grid;place-items:center}
.join-form{max-width:760px;margin:auto;text-align:right}.join-form label{display:block;font-weight:800;color:#243b63;margin-bottom:8px}.join-row{display:grid;grid-template-columns:1fr auto;gap:10px}.join-row input{min-width:0;border:1px solid #cbd5e1;border-radius:12px;padding:13px 15px;font-size:16px;text-transform:uppercase;outline:none}.join-row input:focus{border-color:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,.1)}
.tournament-alert{padding:14px 18px;border-radius:14px;margin-bottom:18px;font-weight:700}.tournament-alert-error{background:#fff1f2;border:1px solid #fecdd3;color:#9f1239}
.overview-top{display:flex;justify-content:space-between;gap:20px;align-items:flex-start}.mode-label{color:#64748b;font-size:14px;font-weight:800}.overview-top h2{font-size:31px;margin:6px 0 12px}.status-pill{padding:9px 15px;border-radius:999px;white-space:nowrap;font-weight:800;font-size:14px}.status-pill.waiting{background:#fff7ed;color:#c2410c}.status-pill.playing{background:#ecfdf5;color:#15803d}.status-pill.finished{background:#eff6ff;color:#1d4ed8}.status-pill.cancelled{background:#f1f5f9;color:#64748b}.tournament-code-box{display:inline-flex;align-items:center;gap:9px;border:1px dashed #b9c8dc;background:#f8fbff;border-radius:12px;padding:8px 11px}.tournament-code-box span{color:#64748b;font-size:12px}.tournament-code-box strong{font-size:18px;letter-spacing:2px;color:#173b8f}.copy-btn{border:0;background:#e7efff;color:#1d4ed8;border-radius:8px;padding:6px 9px;font-weight:800;cursor:pointer}.progress-wrap{margin-top:24px}.progress-head{display:flex;justify-content:space-between;color:#64748b;margin-bottom:7px}.progress-head strong{color:#173b8f}.progress-track{height:10px;background:#e8eef7;border-radius:99px;overflow:hidden}.progress-track span{display:block;height:100%;background:linear-gradient(90deg,#2563eb,#60a5fa);border-radius:inherit;transition:width .3s}
.section-heading{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:20px}.section-heading.centered{justify-content:center;text-align:center}.section-kicker{color:#64748b;font-size:13px;font-weight:800}.section-heading h2{margin:5px 0 0;font-size:25px}.mini-count{background:#eef4ff;color:#1d4ed8;padding:7px 12px;border-radius:10px;font-weight:900}.player-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px}.player-slot{position:relative;min-height:112px;border-radius:15px;border:1px solid #dce5f0;background:#f9fbfe;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:10px}.player-slot.empty{border-style:dashed;color:#94a3b8}.slot-number{position:absolute;top:7px;right:9px;font-size:11px;color:#94a3b8}.player-avatar{font-size:27px}.player-avatar.muted{font-size:25px;color:#94a3b8}.player-name{font-weight:800;color:#203e70;margin-top:4px}.player-name.muted{font-size:13px;color:#94a3b8;font-weight:600}.player-country{font-size:15px;margin-top:2px}.host-tag{margin-top:4px;color:#b45309;font-size:11px;font-weight:800}.host-actions{margin-top:22px;display:grid;grid-template-columns:minmax(190px,.65fr) minmax(0,1.35fr);gap:16px;align-items:start}.invite-panel{border:1px solid #e2e8f0;background:#f8fafc;border-radius:16px;padding:15px}.invite-panel-title{font-weight:900;color:#173b8f;margin-bottom:10px}.invite-list{display:flex;flex-wrap:wrap;gap:8px;min-height:44px;margin-bottom:12px}.invite-item{display:flex;align-items:center;gap:6px;padding:8px 10px;border:1px solid #d6e0ed;background:#fff;border-radius:10px;font-size:13px;cursor:pointer}.invite-item input{accent-color:#2563eb}.waiting-note{padding:14px 16px;border-radius:13px;background:#f8fafc;border:1px solid #e2e8f0;color:#64748b;text-align:center;font-weight:700;margin-top:18px}

.round-break-card{text-align:center;background:linear-gradient(135deg,#ffffff 0%,#f6f9ff 100%);border-color:#cfe0ff}.round-break-icon{font-size:42px;margin-bottom:6px}.round-break-card h2{margin:7px 0;color:#173b8f}.round-break-card p{color:#64748b;line-height:1.8;margin:6px auto 15px;max-width:650px}.break-countdown{font-size:46px;line-height:1;font-weight:900;letter-spacing:3px;color:#2563eb;font-variant-numeric:tabular-nums}.break-caption{margin-top:10px;color:#94a3b8;font-size:13px;font-weight:700}
.current-match-card{text-align:center}.live-dot{color:#15803d;font-weight:900}.match-versus{display:grid;grid-template-columns:1fr 70px 1fr;align-items:center;gap:10px;margin:18px 0}.match-player{border:1px solid #dbe5f0;background:#f8fafc;border-radius:15px;padding:17px;display:flex;align-items:center;justify-content:center;gap:8px;min-height:65px}.match-player.me{border-color:#93c5fd;background:#eff6ff}.match-player span{font-size:25px}.versus{font-weight:900;color:#94a3b8}
.match-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.match-group{border:1px solid #e2e8f0;border-radius:15px;overflow:hidden}.match-group h3{margin:0;padding:11px 14px;background:#f8fafc;color:#24446e;font-size:15px}.match-list{padding:8px}.match-item{display:grid;grid-template-columns:38px 1fr auto;gap:8px;align-items:center;padding:10px;border-bottom:1px solid #edf2f7}.match-item:last-child{border-bottom:0}.match-number{font-size:11px;color:#94a3b8}.match-names{display:flex;align-items:center;justify-content:center;gap:8px;text-align:center;font-size:13px;font-weight:800}.match-names b{color:#94a3b8}.match-status{font-size:11px;border-radius:999px;padding:5px 8px;background:#f1f5f9;color:#64748b;white-space:nowrap}.match-status.playing{background:#dcfce7;color:#166534}.match-status.finished{background:#dbeafe;color:#1d4ed8}.match-status.ready{background:#fef3c7;color:#92400e}
.ranking-list{max-width:720px;margin:auto;border:1px solid #e2e8f0;border-radius:15px;overflow:hidden}.ranking-row{display:grid;grid-template-columns:60px 1fr auto;gap:12px;align-items:center;padding:13px 15px;border-bottom:1px solid #edf2f7}.ranking-row:last-child{border-bottom:0}.rank-medal{font-size:20px;text-align:center}.rank-name{font-weight:900}.rank-score{color:#1d4ed8;font-weight:900}.tournament-bottom-actions{display:flex;justify-content:center;flex-wrap:wrap;gap:10px;margin-top:18px}
@media(max-width:800px){.tournament-options,.host-actions,.match-groups{grid-template-columns:1fr}.player-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.overview-top{flex-direction:column}.status-pill{align-self:flex-start}.match-versus{grid-template-columns:1fr}.versus{padding:3px}.join-row{grid-template-columns:1fr}}
@media(max-width:480px){.tournament-page{padding:20px 10px 45px}.tournament-intro,.tournament-card{padding:19px;border-radius:18px}.tournament-hero h1{font-size:34px}.tournament-cup{font-size:58px}.player-grid{gap:7px}.player-slot{min-height:105px}.tournament-bottom-actions .tournament-btn{width:100%}.tournament-code-box{flex-wrap:wrap}.match-item{grid-template-columns:28px 1fr}.match-status{grid-column:2;justify-self:center}.ranking-row{grid-template-columns:45px 1fr auto;font-size:13px}}


/* V124.79 — files automatiques 4 / 8 / 16 */
.automatic-queue-options{
    grid-template-columns:repeat(3,minmax(0,1fr));
    text-align:right;
}
.queue-option{
    min-height:300px;
    align-items:stretch;
    background:linear-gradient(180deg,#ffffff 0%,#f7fbff 100%);
}
.queue-option .option-icon{
    font-size:46px;
}
.queue-option h3{
    font-size:24px;
}
.queue-option p{
    min-height:62px;
}
.queue-count{
    margin:10px 0 14px;
    padding:10px 12px;
    border-radius:12px;
    background:#eef5ff;
    color:#17418f;
    text-align:center;
    font-weight:900;
}
.queue-option .join-queue-btn{
    margin-top:auto;
}
.queue-note{
    margin:18px 0 4px;
    padding:13px 16px;
    border-radius:14px;
    background:#f0fdf4;
    border:1px solid #bbf7d0;
    color:#166534;
    font-weight:800;
    line-height:1.8;
}
.invitation-link{
    width:100%;
    box-sizing:border-box;
}
.tournament-start-countdown{
    margin:22px auto 8px;
    max-width:560px;
    padding:24px;
    text-align:center;
    border-radius:22px;
    background:linear-gradient(180deg,#eff6ff 0%,#f8fbff 100%);
    border:2px solid #bfdbfe;
    box-shadow:0 10px 30px rgba(37,99,235,.10);
}
.countdown-icon{
    font-size:38px;
}
.countdown-title{
    margin-top:5px;
    color:#17418f;
    font-size:25px;
    font-weight:900;
}
.countdown-message{
    margin-top:7px;
    color:#64748b;
    font-weight:700;
}
.countdown-number{
    margin:10px auto;
    color:#17418f;
    font-size:58px;
    line-height:1;
    font-weight:900;
    font-variant-numeric:tabular-nums;
}
.countdown-caption{
    color:#475569;
    font-size:14px;
    line-height:1.7;
}
@media(max-width:900px){
    .automatic-queue-options{grid-template-columns:1fr;}
    .queue-option{min-height:0;}
}


.round-results-list{display:grid;gap:10px;margin:18px 0}.round-result-item{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:10px;padding:12px 14px;border-radius:14px;background:rgba(255,255,255,.72);border:1px solid rgba(15,23,42,.08)}.round-result-item>div:first-child{text-align:right}.round-result-item>div:last-child{text-align:left}.round-result-score{font-weight:800;white-space:nowrap}.match-status.finished{font-weight:700}


/* V124.92 : résultats de ronde visibles par tous, sans détails des réponses. */
.tournament-round-summary{grid-template-columns:1fr auto 1fr;min-height:86px}
.round-result-player{display:grid;grid-template-columns:auto auto;gap:3px 8px;align-items:center}
.round-result-player small{grid-column:1 / -1;color:#64748b;font-weight:700;font-size:13px}
.round-result-player.winner{color:#166534}
.round-result-player:last-child{text-align:left;justify-content:end}
.round-result-player:last-child small{grid-column:1 / -1}
.round-result-vs{text-align:center;font-size:13px;color:#64748b;font-weight:900;white-space:nowrap}
.automatic-match-entry{margin-top:18px;padding:14px 18px;border-radius:14px;background:#eff6ff;border:1px solid #bfdbfe;color:#17418f;text-align:center;font-weight:900}
@media(max-width:650px){.tournament-round-summary{grid-template-columns:1fr;gap:8px}.round-result-vs{order:-1}.round-result-player:last-child{text-align:right;justify-content:start}}


/* V1.2.78 : indicateur discret de synchronisation du groupe en temps réel. */
.live-group-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    margin: .35rem 0 1rem;
    padding: .35rem .75rem;
    border-radius: 999px;
    background: #f0fdf4;
    color: #166534;
    font-size: .82rem;
    font-weight: 700;
    transition: transform .18s ease, opacity .18s ease;
}
.live-group-status-update {
    animation: tournamentLiveGroupPulse .28s ease;
}
@keyframes tournamentLiveGroupPulse {
    0% { transform: scale(1); opacity: .75; }
    50% { transform: scale(1.035); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .live-group-status-update { animation: none; }
}

/* V1.3.20 — Tournament Live Experience */
.tournament-live-toast{position:fixed;top:84px;right:20px;z-index:99990;display:flex;align-items:center;gap:10px;max-width:min(380px,calc(100vw - 32px));padding:13px 16px;border:1px solid #bfdbfe;border-radius:16px;background:rgba(255,255,255,.96);box-shadow:0 18px 45px rgba(15,23,42,.16);color:#173f8f;font-weight:800;backdrop-filter:blur(10px);transform:translateY(-16px);opacity:0;transition:opacity .24s ease,transform .24s ease}
.tournament-live-toast.show{transform:translateY(0);opacity:1}
.tournament-live-toast .toast-icon{font-size:22px;flex:0 0 auto}
.player-slot.live-joined{animation:tournamentSlotIn .48s ease}
.player-slot.live-left{animation:tournamentSlotOut .42s ease}
@keyframes tournamentSlotIn{0%{transform:scale(.94);opacity:.35}60%{transform:scale(1.04)}100%{transform:scale(1);opacity:1}}
@keyframes tournamentSlotOut{0%{opacity:1;transform:scale(1)}100%{opacity:.55;transform:scale(.97)}}
.progress-track.live-pulse span{animation:tournamentProgressPulse .7s ease}
@keyframes tournamentProgressPulse{0%{filter:brightness(1);box-shadow:0 0 0 rgba(37,99,235,0)}50%{filter:brightness(1.16);box-shadow:0 0 18px rgba(37,99,235,.28)}100%{filter:brightness(1);box-shadow:0 0 0 rgba(37,99,235,0)}}
.tournament-round-live{display:inline-flex;align-items:center;gap:7px;margin:8px 0 0;padding:7px 11px;border-radius:999px;background:#eef6ff;border:1px solid #cfe0ff;color:#17418f;font-size:12px;font-weight:900}
.tournament-round-live .dot{width:7px;height:7px;border-radius:50%;background:#2563eb;box-shadow:0 0 0 4px rgba(37,99,235,.12)}
.current-match-card.live-focus{border-color:#93c5fd;box-shadow:0 18px 45px rgba(37,99,235,.12)}
@media(max-width:650px){.tournament-live-toast{top:72px;right:10px;left:10px;max-width:none}.tournament-round-live{font-size:11px}}
@media(prefers-reduced-motion:reduce){.tournament-live-toast,.player-slot.live-joined,.player-slot.live-left,.progress-track.live-pulse span{animation:none;transition:none}}

/* V1.3.21 — Tournament Bracket Experience */
.tournament-bracket-card{overflow:hidden}
.bracket-subtitle{margin:.35rem 0 0;color:#64748b;font-size:.9rem;line-height:1.7}
.bracket-live-key{display:flex;align-items:center;gap:7px;white-space:nowrap;font-size:12px;font-weight:900;color:#64748b}
.key-dot{width:9px;height:9px;border-radius:50%;display:inline-block}.key-dot.playing{background:#2563eb;box-shadow:0 0 0 4px rgba(37,99,235,.1)}.key-dot.finished{background:#16a34a}
.tournament-bracket{display:flex;gap:14px;overflow-x:auto;padding:8px 4px 14px;scrollbar-width:thin;align-items:stretch}
.bracket-round{flex:0 0 250px;min-width:250px;padding:10px;border-radius:20px;background:linear-gradient(180deg,#f8fbff,#f1f5f9);border:1px solid #dbe5f0;position:relative}
.bracket-round.is-current{border-color:#93c5fd;box-shadow:0 14px 34px rgba(37,99,235,.10)}
.bracket-round.is-current:before{content:'الدور الحالي';position:absolute;top:-10px;right:16px;padding:4px 9px;border-radius:999px;background:#2563eb;color:#fff;font-size:10px;font-weight:900}
.bracket-round-head{display:flex;justify-content:space-between;align-items:center;padding:2px 5px 10px;color:#173f8f;font-weight:950}
.bracket-round-head small{color:#64748b;font-size:11px}
.bracket-round-matches{display:grid;gap:10px}
.bracket-match{padding:10px;border-radius:15px;background:#fff;border:1px solid #e2e8f0;box-shadow:0 6px 18px rgba(15,23,42,.05);transition:transform .2s ease,border-color .2s ease,box-shadow .2s ease}
.bracket-match.is-me{border-color:#60a5fa;box-shadow:0 8px 22px rgba(37,99,235,.10)}
.bracket-match.is-playing{border-color:#93c5fd;animation:bracketLivePulse 1.7s ease-in-out infinite}
.bracket-match-top{display:flex;justify-content:space-between;gap:8px;margin-bottom:7px;color:#64748b;font-size:10px;font-weight:900}
.bracket-player{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:7px 8px;border-radius:9px;background:#f8fafc;font-weight:800;font-size:13px}
.bracket-player+.bracket-player{margin-top:4px}.bracket-player.winner{background:#ecfdf5;color:#166534;border-color:#bbf7d0}.bracket-player b{min-width:20px;text-align:center;font-variant-numeric:tabular-nums}
.bracket-winner{margin-top:7px;padding-top:7px;border-top:1px dashed #dbe5f0;color:#166534;font-size:11px;font-weight:950}
.bracket-live-label{display:flex;align-items:center;gap:6px;margin-top:7px;color:#1d4ed8;font-size:11px;font-weight:950}.bracket-live-label span{width:7px;height:7px;border-radius:50%;background:#2563eb;box-shadow:0 0 0 4px rgba(37,99,235,.1)}
@keyframes bracketLivePulse{0%,100%{box-shadow:0 8px 22px rgba(37,99,235,.08)}50%{box-shadow:0 10px 28px rgba(37,99,235,.19)}}
@media(max-width:700px){.bracket-live-key{display:none}.bracket-subtitle{font-size:.82rem}.bracket-round{flex-basis:220px;min-width:220px}}
@media(prefers-reduced-motion:reduce){.bracket-match.is-playing{animation:none;transition:none}}


/* V1.4.13 — Navigation entre résultats du tour et détails du tournoi */
.tournament-view-switch{display:flex;flex-wrap:wrap;justify-content:center;gap:12px;margin:18px auto 4px}
.tournament-view-switch .tournament-btn{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 18px;text-decoration:none;cursor:pointer}
#roundBreakCard,#tournamentMatchesDetail{scroll-margin-top:90px}
@media(max-width:600px){.tournament-view-switch{display:grid;grid-template-columns:1fr;width:100%}.tournament-view-switch .tournament-btn{width:100%;box-sizing:border-box}}
