:root {
  --bg: #0a0806; --panel: rgba(20,16,11,.86); --panel2: rgba(38,30,18,.92); --line: #4a3a1c; --text: #f4ecdc; --muted: #b0a389;
  --brand: #f2a91b; --brand2: #ffc24a; --on-brand: #1a1204; --ok: #2ecc71; --warn: #f39c12; --bad: #e74c3c; --info: #5aa9e6;
  --gold-glow: 0 0 18px rgba(242,169,27,.25);
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; color: var(--text);
  background: linear-gradient(180deg, rgba(10,8,6,.6), rgba(10,8,6,.8) 55%, rgba(10,8,6,.93)), url(/static/bg.webp) center top / cover no-repeat fixed, var(--bg); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand2); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 1.7rem; margin: 0 0 1rem; font-style: italic; text-transform: uppercase; letter-spacing: .02em; text-shadow: 0 0 22px rgba(242,169,27,.35); } h2 { font-size: 1.15rem; margin: 0 0 .75rem; } h3 { margin: 0 0 .5rem; }
code { background: var(--panel2); padding: .1rem .35rem; border-radius: 6px; font-size: .85em; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .pre { white-space: pre-wrap; word-break: break-word; }

.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: .5rem 1.25rem; background: rgba(10,8,6,.97); backdrop-filter: blur(8px); border-bottom: 1px solid var(--brand); box-shadow: 0 2px 18px rgba(242,169,27,.18); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; } .brand img { height: 52px; width: 52px; border-radius: 12px; display: block; filter: drop-shadow(0 0 8px rgba(242,169,27,.35)); }
.nav { display: flex; flex-wrap: wrap; gap: .25rem; flex: 1; }
.nav a { color: var(--muted); padding: .4rem .8rem; border-radius: 8px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: .85rem; } .nav a:hover, .nav a.on { background: var(--panel2); color: var(--brand2); text-decoration: none; box-shadow: inset 0 -2px 0 var(--brand); }
.userbox { display: flex; align-items: center; gap: .6rem; margin: 0; } .userbox img { border-radius: 50%; }
.role { padding: .1rem .45rem; border-radius: 99px; font-size: .7rem; background: var(--panel2); color: var(--muted); }
.role-staff { background: #5a3d0a; color: #ffd27a; } .role-captain { background: #1f4a3a; color: #8df0c0; } .role-moderator { background: #2c3a5a; color: #a9c4ff; }

.container { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 1.5rem 1rem 2.5rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1rem; backdrop-filter: blur(4px); box-shadow: 0 6px 22px rgba(0,0,0,.4); }
.center { text-align: center; } .narrow { max-width: 460px; margin: 3rem auto; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; } .row form { margin: 0; } .between { justify-content: space-between; }
.grid2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); } .grid2 .card { margin-bottom: 0; } .grid2 { margin-bottom: 1rem; }
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); } .cards .card { margin: 0; } .cards p { margin: .3rem 0; }

.stats { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 1rem; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: .15rem; color: var(--muted); }
.stat .n { font-size: 2rem; font-weight: 800; color: var(--text); } .small-stats .stat { padding: .6rem; } .small-stats .n { font-size: 1.4rem; }

.btn { display: inline-block; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .95rem; font: inherit; cursor: pointer; }
.btn:hover { border-color: var(--brand); text-decoration: none; } .btn-primary { background: linear-gradient(180deg, var(--brand2), var(--brand)); border-color: var(--brand); color: var(--on-brand); font-weight: 700; } .btn-primary:hover { background: var(--brand2); box-shadow: var(--gold-glow); }
.btn-danger { background: #4a1f27; border-color: #7a2c39; color: #ffb3bd; } .btn-ghost { background: transparent; } .btn-sm { padding: .25rem .6rem; font-size: .85rem; } .btn-lg { padding: .8rem 1.6rem; font-size: 1.05rem; }

input, select, textarea { background: rgba(8,6,4,.85); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .7rem; font: inherit; max-width: 100%; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.form { display: flex; flex-direction: column; gap: .9rem; max-width: 640px; } .form label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; }
label.inline { flex-direction: row; align-items: center; gap: .4rem; font-weight: 600; } label.inline input { width: 5rem; }
.filters { margin-bottom: 1rem; }

table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--brand2); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; } .table-wrap { overflow-x: auto; padding: .4rem; }
.list { list-style: none; margin: 0 0 .75rem; padding: 0; } .list li { padding: .5rem 0; border-bottom: 1px solid var(--line); } .list li:last-child { border: 0; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; } dt { color: var(--muted); } dd { margin: 0; }

.badge { display: inline-block; padding: .1rem .55rem; border-radius: 99px; font-size: .75rem; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge-lg { font-size: .9rem; padding: .25rem .8rem; }
.b-official { background: #173a29; border-color: #1f6b44; color: #7ff0b0; } .b-prov { background: #4a3510; border-color: #7a5a1a; color: #ffcf7a; }
.s-pending { color: var(--info); } .s-accepted { color: #7ff0b0; } .s-in_progress { color: var(--warn); } .s-score_pending { color: #ffcf7a; } .s-finished { color: var(--ok); } .s-cancelled { color: var(--muted); text-decoration: line-through; }
.score-official { color: var(--ok); } .score-prov { color: var(--warn); }

.scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; text-align: center; gap: 1rem; }
.scoreboard .team { display: flex; flex-direction: column; font-size: 1.2rem; font-weight: 700; } .scoreboard .big { font-size: 2.4rem; font-weight: 800; }

.flash { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; }
.flash-ok { background: #173a29; border-color: #1f6b44; color: #b9f7d4; } .flash-error { background: #4a1f27; border-color: #7a2c39; color: #ffc9d0; }

@media (max-width: 640px) {
  .topbar { padding: .6rem .8rem; } .userbox span { display: none; }
  .scoreboard { grid-template-columns: 1fr; } .scoreboard .big { font-size: 2rem; }
  dl { grid-template-columns: 1fr; } h1 { font-size: 1.3rem; }
}

/* Images */
.logo { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; vertical-align: middle; background: var(--panel2); }
.logo-sm { width: 28px; height: 28px; border-radius: 6px; margin-right: .35rem; }
.logo-lg { width: 72px; height: 72px; margin-right: .5rem; }
.post-img { display: block; width: 100%; max-height: 180px; object-fit: cover; border-radius: 8px; margin-bottom: .6rem; background: var(--panel2); }
.proof { max-width: 100%; max-height: 480px; border-radius: 8px; border: 1px solid var(--line); }
.check input { width: auto; }

/* Mercato : réponses */
details.reply { margin: .5rem 0; }
details.reply > summary { cursor: pointer; list-style: none; display: inline-block; }
details.reply > summary::-webkit-details-marker { display: none; }
details.reply[open] > summary { margin-bottom: .5rem; }

/* Page de connexion */
.login-hero { text-align: center; max-width: 560px; margin: 2rem auto; }
.login-hero img.logo-xl { width: min(380px, 80%); height: auto; border-radius: 22px; filter: drop-shadow(0 0 22px rgba(242,169,27,.45)); }
.login-hero .tagline { color: var(--brand2); font-style: italic; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin: .5rem 0 1.2rem; }
.stat .n { color: var(--brand2); }
@media (max-width: 640px) { .brand img { height: 42px; width: 42px; } .topbar { padding: .5rem .75rem; gap: .5rem; } .nav { order: 3; flex: 1 1 100%; flex-wrap: wrap; gap: .15rem; } .nav a { white-space: nowrap; padding: .35rem .5rem; font-size: .75rem; } .userbox { margin-left: auto; } .container { padding-top: 1rem; } }

/* Pages légales */
.legal { max-width: 800px; margin: 0 auto; } .legal h2 { color: var(--brand2); margin-top: 1.6rem; } .legal p, .legal li { line-height: 1.65; }
.legal ul { padding-left: 1.2rem; } .todo { background: #5a3d0a; color: #ffd27a; padding: .05rem .4rem; border-radius: 6px; font-weight: 700; }

/* ===================== Identité FFC : soirée de match ===================== */
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    linear-gradient(115deg, transparent 38%, rgba(242,169,27,.09) 46%, transparent 54%),
    linear-gradient(65deg, transparent 46%, rgba(242,169,27,.07) 54%, transparent 62%); }
body::after { content: ""; position: fixed; inset: -50% 0 0 0; pointer-events: none; z-index: 0; opacity: .5;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(255,200,90,.9), transparent),
    radial-gradient(1px 1px at 60% 70%, rgba(255,200,90,.8), transparent),
    radial-gradient(2px 2px at 80% 20%, rgba(255,215,130,.7), transparent),
    radial-gradient(1px 1px at 35% 85%, rgba(255,200,90,.8), transparent),
    radial-gradient(1.5px 1.5px at 90% 60%, rgba(255,215,130,.8), transparent);
  background-size: 420px 420px; animation: dust 60s linear infinite; }
@keyframes dust { to { background-position: -420px 420px; } }
.topbar, .container, .foot { position: relative; z-index: 1; }
.topbar { position: sticky; z-index: 20; } /* toujours au-dessus du contenu qui défile */

h1::after { content: ""; display: block; width: 130px; height: 5px; margin-top: .45rem; transform: skewX(-30deg);
  background: linear-gradient(90deg, var(--brand), rgba(242,169,27,0)); border-radius: 2px; }
h2 { text-transform: uppercase; letter-spacing: .05em; font-style: italic; font-size: 1.05rem; }
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after { content: ""; position: absolute; inset: 0; transform: translateX(-120%) skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); transition: transform .6s; }
.btn-primary:hover::after { transform: translateX(120%) skewX(-20deg); }
.role-captain::before { content: "♛ "; color: var(--brand2); } .role-staff::before { content: "♛ "; }

/* Blason */
.crest { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; object-fit: cover; flex: none;
  border: 2px solid var(--brand); background: #120d06; box-shadow: 0 0 14px rgba(242,169,27,.3); vertical-align: middle; }
.crest-sm { width: 30px; height: 30px; font-size: .7rem; border-width: 1px; } .crest-md { width: 56px; height: 56px; font-size: 1.1rem; } .crest-lg { width: 92px; height: 92px; font-size: 1.8rem; }
.crest-ini { background: linear-gradient(160deg, var(--brand2), #8a5a06); color: var(--on-brand); font-weight: 900; font-style: italic; }

/* Accueil */
.hero { text-align: center; padding: .5rem 0 1rem; }
.hero-logo { width: min(300px, 70%); height: auto; border-radius: 20px; filter: drop-shadow(0 0 24px rgba(242,169,27,.5)); }
.hero .tagline { margin: .3rem 0 0; color: var(--brand2); font-style: italic; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.ticker { overflow: hidden; border-block: 1px solid var(--line); background: rgba(10,8,6,.7); margin-bottom: 1.25rem; white-space: nowrap; }
.ticker-track { display: inline-flex; gap: 1.4rem; padding: .55rem 0; animation: ticker 45s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker a { color: var(--text); } .ticker strong { color: var(--brand2); } .ticker .sep { color: var(--brand); }
@keyframes ticker { to { transform: translateX(-50%); } }
.affiche { text-align: center; margin-bottom: 1.25rem; padding: 1.4rem 1rem 1.6rem; border: 1px solid var(--brand); border-radius: 16px;
  background: radial-gradient(ellipse at 50% 0%, rgba(242,169,27,.22), transparent 65%), var(--panel); box-shadow: 0 0 30px rgba(242,169,27,.15), 0 8px 26px rgba(0,0,0,.5); }
.eyebrow { margin: 0; color: var(--brand2); text-transform: uppercase; letter-spacing: .25em; font-size: .8rem; font-weight: 700; }
.affiche-teams { display: flex; align-items: center; justify-content: center; gap: clamp(.8rem, 4vw, 3rem); margin: 1rem 0; }
.affiche-teams .side { display: flex; flex-direction: column; align-items: center; gap: .5rem; max-width: 170px; font-size: 1.1rem; }
.vs { font-size: clamp(2rem, 7vw, 3.4rem); font-weight: 900; font-style: italic; color: var(--brand2); text-shadow: 0 0 22px rgba(242,169,27,.6); }
.affiche-date { margin: 0 0 .3rem; color: var(--muted); } .countdown { font-size: 1.4rem; font-weight: 800; color: var(--text); margin: .2rem 0 1rem; min-height: 1.6em; font-variant-numeric: tabular-nums; }

/* Billets de match */
.tickets { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
.ticket { position: relative; display: flex; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-decoration: none; transition: transform .15s, border-color .15s, box-shadow .15s; }
.ticket:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--gold-glow); text-decoration: none; }
.stub { display: flex; flex-direction: column; justify-content: center; gap: .3rem; padding: .8rem; min-width: 92px; max-width: 110px; border-right: 2px dashed var(--line); background: rgba(242,169,27,.06); text-align: center; }
.stub-n { font-weight: 900; font-style: italic; color: var(--brand2); font-size: 1.1rem; } .stub-d { font-size: .72rem; color: var(--muted); }
.ticket::before, .ticket::after { content: ""; position: absolute; left: 92px; width: 18px; height: 18px; border-radius: 50%; background: #0b0907; border: 1px solid var(--line); }
.ticket::before { top: -10px; } .ticket::after { bottom: -10px; }
.ticket-main { flex: 1; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .5rem; padding: .9rem .8rem 2.1rem; min-width: 0; }
.ticket .side { display: flex; flex-direction: column; align-items: center; gap: .35rem; text-align: center; min-width: 0; }
.tname { font-weight: 700; font-size: .9rem; overflow-wrap: anywhere; }
.ticket .mid { display: flex; flex-direction: column; align-items: center; gap: .35rem; }
.tscore { font-size: 1.7rem; font-weight: 900; font-style: italic; white-space: nowrap; } .tvs { font-size: 1.3rem; font-weight: 900; font-style: italic; color: var(--muted); }
.stamp { position: absolute; right: 10px; bottom: 6px; transform: rotate(-6deg); padding: .1rem .5rem; border: 2px solid; border-radius: 6px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; font-size: .68rem; opacity: .95; }
.stamp-official { color: var(--brand2); border-color: var(--brand2); box-shadow: 0 0 10px rgba(242,169,27,.4); background: rgba(242,169,27,.08); }
.stamp-prov { color: #ffcf7a; border-color: #ffcf7a; border-style: dashed; opacity: .75; }

/* Podium */
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 1rem; margin: 0 0 1.5rem; }
.step { position: relative; display: flex; flex-direction: column; align-items: center; gap: .3rem; flex: 0 1 200px; padding: 1rem .6rem; color: var(--text); text-align: center; text-decoration: none;
  border: 1px solid var(--line); border-radius: 14px 14px 0 0; background: linear-gradient(180deg, rgba(242,169,27,.18), var(--panel)); }
.step:hover { text-decoration: none; border-color: var(--brand); }
.step-1 { min-height: 250px; border-color: var(--brand); box-shadow: 0 0 28px rgba(242,169,27,.3); } .step-2 { min-height: 205px; } .step-3 { min-height: 175px; }
.crown { font-size: 2rem; color: var(--brand2); text-shadow: 0 0 16px rgba(242,169,27,.7); line-height: 1; }
.pname { overflow-wrap: anywhere; } .ppts { color: var(--brand2); font-weight: 800; }
.rank { margin-top: auto; font-style: italic; font-weight: 900; font-size: 1.5rem; color: var(--brand); }

/* Cartes Mercato façon carte de joueur */
.cards .fut { position: relative; border-radius: 16px 16px 26px 26px; border: 1px solid var(--brand);
  background: radial-gradient(circle at 30% 0%, rgba(242,169,27,.28), transparent 55%), linear-gradient(180deg, rgba(40,30,12,.95), var(--panel)); }
.fut-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.fut-pos { font-size: 2rem; font-weight: 900; font-style: italic; line-height: 1; color: var(--brand2); text-shadow: 0 0 16px rgba(242,169,27,.45); overflow-wrap: anywhere; max-width: 70%; }
.fut h3 { text-transform: uppercase; letter-spacing: .05em; }
.chip { display: inline-block; padding: .1rem .6rem; border: 1px solid var(--line); border-radius: 99px; background: rgba(242,169,27,.1); font-size: .8rem; }

@media (max-width: 640px) {
  .tickets { grid-template-columns: 1fr; } .stub { min-width: 74px; padding: .5rem; } .ticket::before, .ticket::after { left: 74px; }
  .podium { gap: .4rem; } .step { flex-basis: 33%; padding: .6rem .3rem; font-size: .85rem; } .crest-lg { width: 70px; height: 70px; }
}
@media (prefers-reduced-motion: reduce) {
  body::after, .ticker-track { animation: none; } .ticker { overflow-x: auto; } .btn-primary::after { display: none; }
}

/* Mercato : onglets clubs / joueurs */
.tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.tab { padding: .45rem 1rem; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-weight: 700; background: rgba(10,8,6,.6); }
.tab:hover { text-decoration: none; border-color: var(--brand); color: var(--text); }
.tab.on { background: linear-gradient(180deg, var(--brand2), var(--brand)); color: var(--on-brand); border-color: var(--brand); }
.tab-cta { margin-left: auto; border-style: dashed; color: var(--brand2); }
.cards .fut-player { background: radial-gradient(circle at 70% 0%, rgba(242,169,27,.3), transparent 55%), linear-gradient(180deg, rgba(20,24,34,.95), var(--panel)); }

/* Tournois et palmarès */
.trn { display: block; color: var(--text); } .trn:hover { text-decoration: none; border-color: var(--brand); box-shadow: var(--gold-glow); }
.trn-finished { opacity: .9; } .trn-cancelled { opacity: .55; } .prizes { color: var(--brand2); font-weight: 700; }
.round-title { margin-top: 1.6rem; } .entrants .chip { display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .7rem .2rem .25rem; color: var(--text); }
.hall { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-bottom: 1rem; }
.hall .card { margin: 0; } .trophy { border-color: var(--brand); background: radial-gradient(circle at 50% 0%, rgba(242,169,27,.2), transparent 60%), var(--panel); }
.trophy-1 { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .6rem 0; font-size: 1.1rem; } .trophy-1 .crown { font-size: 1.6rem; }

/* ---- Staff, forme, bannières, jour de match */
.count-badge{display:inline-block;min-width:1.3em;padding:0 .35em;border-radius:999px;background:var(--gold,#f2a91b);color:#0a0806;font-size:.75em;font-weight:700;text-align:center}
.form-chips{display:inline-flex;gap:3px;vertical-align:middle}
.fchip{display:inline-block;width:1.5em;height:1.5em;line-height:1.5em;text-align:center;border-radius:4px;font-size:.75em;font-weight:700;color:#0a0806}
.f-V{background:#3ecf6e}.f-N{background:#9a9a9a}.f-D{background:#e5484d}
.banners{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:1.2rem;margin:1rem 0}
.banner{display:flex;flex-direction:column;align-items:center;text-decoration:none;color:inherit}
.banner-pole{width:100%;height:6px;border-radius:3px;background:linear-gradient(90deg,#6b4a12,#f2a91b,#6b4a12)}
.banner-flag{width:86%;padding:1.2rem .6rem 2rem;display:flex;flex-direction:column;align-items:center;gap:.35rem;text-align:center;background:linear-gradient(180deg,#1a140c,#0f0b07);border:1px solid #3a2c14;border-top:0;clip-path:polygon(0 0,100% 0,100% 90%,50% 100%,0 90%);transform-origin:top center;transition:transform .25s}
.banner:hover .banner-flag{animation:wave 1.2s ease-in-out infinite}
.banner-pts{color:#f2a91b;font-weight:700}
@keyframes wave{0%,100%{transform:rotate(0)}25%{transform:rotate(1.5deg)}75%{transform:rotate(-1.5deg)}}
.matchday{margin:1rem 0;padding:.9rem 1.1rem;border:1px solid #f2a91b;border-radius:12px;background:linear-gradient(90deg,rgba(242,169,27,.18),rgba(242,169,27,.04));animation:mdglow 2.4s ease-in-out infinite}
.matchday-title{margin:0 0 .5rem;font-weight:800;letter-spacing:.12em;color:#f2a91b}
.live-dot{display:inline-block;width:.6em;height:.6em;border-radius:50%;background:#e5484d;margin-right:.4em;animation:blink 1s infinite}
.matchday-list{display:flex;flex-wrap:wrap;gap:.5rem 1.2rem}
.matchday-item{color:inherit;text-decoration:none}
.vs-sm{color:#f2a91b;font-size:.8em;margin:0 .3em}
@keyframes blink{50%{opacity:.25}}
@keyframes mdglow{50%{box-shadow:0 0 18px rgba(242,169,27,.35)}}
@media (prefers-reduced-motion:reduce){.matchday,.live-dot,.banner:hover .banner-flag{animation:none}}

/* ---- v12 : réglages, classements de poule */
.setting{align-items:flex-end;gap:.6rem;margin-bottom:.6rem}
.setting label{flex:1 1 260px;display:flex;flex-direction:column;gap:.25rem}
tr.qualified td{background:rgba(242,169,27,.12)}

/* ---- Double cadre (bordures « écusson ») : deux filets dorés séparés par un jour */
:root { --frame: #8a6a22; --frame-hi: #f2a91b; }
.card, .stat, .ticket, .matchday, .affiche, .banner-flag { border: 4px double var(--frame); }
.trophy, .cards .fut { border: 4px double var(--frame-hi); }
.card:hover, .ticket:hover, a.card:hover { border-color: var(--frame-hi); }
.btn { border: 3px double var(--frame); padding: .4rem .85rem; }
.btn:hover { border-color: var(--frame-hi); }
.btn-primary { border: 3px double #6b4a08; }
.btn-primary:hover { border-color: #6b4a08; }
.btn-danger { border-color: #7a2c39; }
.btn-sm { padding: .2rem .5rem; }
.banner-flag { border-top: 0; }
@media (max-width: 640px) { .card, .stat { border-width: 3px; } }
@media (max-width: 640px) {
  .tname { overflow-wrap: break-word; word-break: normal; hyphens: auto; font-size: .8rem; }
  .stub { min-width: 60px; max-width: 70px; padding: .4rem .3rem; } .stub-d { font-size: .62rem; }
  .ticket::before, .ticket::after { left: 60px; }
  .ticket-main { gap: .3rem; padding: .7rem .4rem 2.1rem; }
}

/* ---- Vrai menu : liens principaux + menus déroulants (<details>, sans script) + burger mobile */
.topbar { flex-wrap: nowrap; }
.menu { display: flex; align-items: center; gap: .75rem; flex: 1; min-width: 0; }
.menu .nav { flex: 1; flex-wrap: nowrap; align-items: center; }
.burger { display: none; margin-left: auto; background: transparent; border: 3px double var(--frame); border-radius: 8px; padding: .45rem .5rem; cursor: pointer; flex-direction: column; gap: 4px; }
.burger span { display: block; width: 20px; height: 2px; background: var(--brand2); border-radius: 2px; }
.dd { position: relative; }
.dd > summary { list-style: none; cursor: pointer; color: var(--muted); padding: .4rem .8rem; border-radius: 8px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: .85rem; display: flex; align-items: center; gap: .4rem; user-select: none; }
.dd > summary::-webkit-details-marker { display: none; }
.dd > summary::after { content: ""; border: 4px solid transparent; border-top-color: currentColor; margin-top: 4px; }
.dd[open] > summary, .dd > summary:hover, .dd > summary.on { background: var(--panel2); color: var(--brand2); box-shadow: inset 0 -2px 0 var(--brand); }
.dd-panel { position: absolute; left: 0; top: calc(100% + 6px); min-width: 180px; background: var(--panel2); border: 3px double var(--frame); border-radius: 10px; padding: .3rem; display: flex; flex-direction: column; box-shadow: 0 10px 30px rgba(0,0,0,.6); z-index: 30; }
.dd-right { left: auto; right: 0; }
.dd-panel a, .dd-btn { display: block; width: 100%; text-align: left; background: transparent; border: 0; color: var(--text, #f3ead7); padding: .5rem .7rem; border-radius: 6px; font: inherit; font-size: .9rem; cursor: pointer; }
.dd-panel a:hover, .dd-btn:hover, .dd-panel a.on { background: rgba(242,169,27,.15); color: var(--brand2); text-decoration: none; }
.dd-panel form { margin: 0; border-top: 1px solid rgba(242,169,27,.25); margin-top: .2rem; padding-top: .2rem; }
.userdd > summary { text-transform: none; letter-spacing: 0; } .userdd > summary img { border-radius: 50%; }
@media (max-width: 1100px) {
  .burger { display: flex; }
  .topbar { flex-wrap: wrap; }
  .menu { display: none; flex: 1 1 100%; flex-direction: column; align-items: stretch; gap: .5rem; padding: .5rem 0 .25rem; }
  .menu.open { display: flex; }
  .menu .nav { order: 0; flex: 0 0 auto; flex-direction: column; align-items: stretch; gap: .15rem; }
  .menu .nav > a, .dd > summary { padding: .65rem .8rem; font-size: .9rem; white-space: normal; }
  .dd-panel, .dd-right { position: static; box-shadow: none; margin: .2rem 0 .3rem .8rem; min-width: 0; }
  .userdd { border-top: 1px solid rgba(242,169,27,.25); padding-top: .4rem; }
  .userdd > summary span { display: inline; }
}

/* ---- Barre de recherche */
.search { display: flex; align-items: center; margin: 0; border: 3px double var(--frame); border-radius: 10px; background: rgba(0,0,0,.35); }
.search:focus-within { border-color: var(--frame-hi); }
.search input { background: transparent; border: 0; color: inherit; padding: .35rem .6rem; width: 11rem; font: inherit; font-size: .9rem; outline: none; min-width: 0; }
.search button { background: transparent; border: 0; cursor: pointer; padding: .3rem .55rem; font-size: .95rem; }
ul.plain { list-style: none; margin: 0; padding: 0; } ul.plain li { padding: .45rem 0; border-bottom: 1px solid rgba(242,169,27,.15); } ul.plain li:last-child { border-bottom: 0; }
@media (max-width: 1100px) { .search { order: -1; } .search input { width: 100%; flex: 1; } }

.bell { position: relative; display: inline-flex; align-items: center; gap: .25rem; padding: .35rem .5rem; border-radius: 8px; color: var(--muted); font-size: 1.05rem; text-decoration: none; } .bell:hover { background: var(--panel2); text-decoration: none; }
@media (max-width: 1100px) { .bell { padding: .65rem .8rem; } }

/* Écrans moyens : barre compacte pour que tout tienne sur une ligne sans débordement */
.menu .nav > a, .dd > summary { white-space: nowrap; }
@media (min-width: 1101px) and (max-width: 1280px) {
  .menu { gap: .4rem; }
  .menu .nav > a, .dd > summary { padding: .4rem .5rem; font-size: .8rem; letter-spacing: .02em; }
  .search input { width: 7rem; }
  .userdd > summary > span { display: none; }
}
@media (min-width: 1281px) { .userdd > summary > span { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }

/* Feuille de match (joueurs) : colonnes compactes, tient sur un téléphone */
table.sheet { width: 100%; table-layout: fixed; }
table.sheet th, table.sheet td { padding: .3rem .25rem; }
table.sheet th:nth-child(2), table.sheet td:nth-child(2), table.sheet th:nth-child(3), table.sheet td:nth-child(3) { width: 3.8rem; }
table.sheet th:nth-child(4), table.sheet td:nth-child(4) { width: 2.6rem; text-align: center; }
table.sheet input { width: 100%; min-width: 0; padding: .4rem .35rem; }
table.sheet input[type=radio] { width: auto; }
.card h3 { margin-top: 1.1rem; }

/* Rôles : Owner > LeadAdmin > Admin > Modérateur ; GM / CO-GM ; Joueur ; F/A */
.role-owner { background: #6b1f2a; color: #ffc2cb; } .role-leadadmin { background: #5a3d0a; color: #ffd27a; } .role-admin { background: #4a3a14; color: #f3d98a; }
.role-gm { background: #1f4a3a; color: #8df0c0; } .role-cogm { background: #1d3f4a; color: #9fe3f5; }
.role-player { background: #2c2c3a; color: #cfd2ff; } .role-freeagent { background: #3a2c2c; color: #ffd0b0; }
.role-owner::before { content: "♚ "; } .role-leadadmin::before, .role-admin::before { content: "♛ "; } .role-gm::before { content: "♛ "; color: var(--brand2); }

/* Calendrier : 7 jours, en grille sur grand écran, en liste sur mobile */
.calendar { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; }
.cal-day h2 { font-size: .95rem; text-transform: capitalize; margin-top: 0; }

/* ---- Tableau de tournoi (arbre) ---- */
.crest-xs { width: 22px; height: 22px; font-size: .55rem; border-width: 1px; }
.bracket-wrap { overflow-x: auto; padding-bottom: .5rem; -webkit-overflow-scrolling: touch; }
.bracket { --gap: 44px; --cardw: 224px; display: grid; grid-auto-flow: column; grid-auto-columns: var(--cardw); column-gap: var(--gap); width: max-content; align-items: stretch; padding: .25rem .1rem; }
.br-col { display: flex; flex-direction: column; min-width: 0; }
.br-head { background: #d9d9d9; color: #141414; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: .35rem .6rem; border-radius: 6px; margin-bottom: .6rem; }
.br-cells { flex: 1; display: flex; flex-direction: column; }
.br-cell { flex: 1; display: flex; align-items: center; padding: .4rem 0; position: relative; min-height: 6.4rem; }
.br-card { position: relative; display: block; width: 100%; background: #1c1c1c; border: 1px solid #2c2c2c; border-radius: 6px; color: var(--text); overflow: visible; }
a.br-card:hover { border-color: var(--brand); text-decoration: none; }
.br-card.is-bye { opacity: .85; }
.br-row { display: flex; align-items: center; gap: .5rem; min-height: 2.6rem; padding: .35rem .6rem; border-left: 3px solid transparent; }
.br-row + .br-row { border-top: 1px solid #2c2c2c; }
.br-row .br-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.br-row .br-score { font-weight: 800; min-width: 1.2rem; text-align: right; }
.br-row.is-win { border-left-color: var(--brand); font-weight: 700; }
.br-row.is-lose { color: #8d8d8d; } .br-row.is-lose .crest { opacity: .55; }
.br-row.is-tbd { color: var(--muted); }
.br-dot { width: 22px; height: 22px; border-radius: 50%; border: 1px solid #444; background: #151515; flex: none; }
.br-crown { color: var(--brand2); }
.br-foot { display: block; padding: .15rem .6rem .3rem; font-size: .72rem; color: var(--muted); border-top: 1px solid #2c2c2c; }
.br-third { margin-top: 1rem; width: var(--cardw, 224px); max-width: 100%; }
/* lignes de liaison : trait vers la droite, trait vertical qui relie les deux matchs d'une paire, trait d'entrée du tour suivant */
.br-col:not(.br-last) .br-cell::after { content: ""; position: absolute; top: 50%; right: calc(var(--gap) / -2); width: calc(var(--gap) / 2); border-top: 2px solid #3a3a3a; }
.br-col:not(.br-last) .br-cell::before { content: ""; position: absolute; right: calc(var(--gap) / -2); border-right: 2px solid #3a3a3a; }
.br-col:not(.br-last) .br-cell.br-up::before { top: 50%; bottom: 0; }
.br-col:not(.br-last) .br-cell.br-down::before { top: 0; bottom: 50%; }
.br-col + .br-col .br-card::before { content: ""; position: absolute; top: 50%; left: calc(var(--gap) / -2); width: calc(var(--gap) / 2); border-top: 2px solid #3a3a3a; }
@media (max-width: 640px) { .bracket { --gap: 32px; --cardw: 196px; } }

.pens-input { width: 4.2rem; }

/* Matchday : sections lisibles */
.md-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.md-chip { padding: .3rem .75rem; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: .85rem; }
.md-chip b { margin-left: .25rem; }
.md-chip-todo { border-color: var(--accent, #4f8cff); }
.md-chip-warn { border-color: #d9822b; }
.md-section { margin: 1.4rem 0; }
.md-section h2, .md-todo h2 { margin: 0 0 .5rem; font-size: 1.1rem; }
.md-count { font-size: .8rem; color: var(--muted); font-weight: normal; }
.md-todo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.md-todo-list a { display: block; padding: .5rem .7rem; border-radius: 8px; background: var(--panel2); color: var(--text); text-decoration: none; }
.md-late .ticket { opacity: .9; border-color: #d9822b; }
.md-finished, .md-legend { margin: 1.4rem 0; }
.md-finished summary, .md-legend summary { cursor: pointer; font-weight: 600; margin-bottom: .6rem; }
.md-empty { text-align: center; }
.ticket .tag { position: absolute; top: .3rem; right: .6rem; font-size: .7rem; color: var(--muted); max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket .hint { position: absolute; bottom: .3rem; left: calc(110px + .8rem); font-size: .72rem; padding: .05rem .5rem; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); }
@media (max-width: 640px) { .ticket .hint { left: calc(74px + .6rem); } .ticket .tag { max-width: 45%; } }
.ticket .ticket-main { padding-top: 1.5rem; }

/* Billets : heure en grand + couleur par compétition (liseré) */
.stub-t { font-weight: 900; font-size: 1.35rem; color: var(--brand2); line-height: 1; }
.stub-d { text-transform: capitalize; }
.ticket { border-left-width: 5px; }
.ticket.tc-f { border-left-color: #6b6b6b; }
.ticket.tc-0 { border-left-color: #e0a526; }
.ticket.tc-1 { border-left-color: #3f8cff; }
.ticket.tc-2 { border-left-color: #2fbf71; }
.ticket.tc-3 { border-left-color: #d45dd0; }
.ticket.tc-4 { border-left-color: #e5654d; }
.ticket.tc-5 { border-left-color: #2ec4c9; }
.ticket.tc-6 { border-left-color: #9b7cf0; }
.ticket.tc-7 { border-left-color: #8fb339; }
.ticket .tag { max-width: 70%; }
@media (max-width: 640px) { .stub-t { font-size: 1.1rem; } .ticket .tag { max-width: 62%; } }
@media (max-width: 640px) { .ticket .tag { white-space: normal; text-align: right; line-height: 1.15; top: .25rem; } }
