/* Flannery's — Tournoi de fléchettes · reprend la DA « Carnet » du site */
:root {
  --cream: #EEE7D7; --paper: #E6DECB; --card: #FBF9F4;
  --ink: #242020; --ink-soft: #4A4440;
  --green: #204A2D; --green-deep: #183323;
  --gold: #D3BA44; --gold-ink: #85701F;
  --error: #9B2C1F; --rule: rgba(133,112,31,.45);
  --f-display: "Alegreya", Georgia, serif;
  --f-body: "Alegreya Sans", "Gill Sans", system-ui, sans-serif;
  --f-sc: "Alegreya Sans SC", "Alegreya Sans", system-ui, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--f-body); font-size: 1.0625rem; line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 500; line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: 3px; }
.on-dark :focus-visible { outline-color: var(--gold); }
.wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: max(18px, env(safe-area-inset-left)); }
@media (min-width: 900px) { .wrap { padding-inline: 40px; } }

/* en-tête */
.top { background: var(--ink); color: var(--cream); box-shadow: 0 1px 0 rgba(211,186,68,.35); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; }
.brand img { height: 48px; width: auto; }
.brand span { font-family: var(--f-sc); font-weight: 700; letter-spacing: .14em; text-transform: lowercase; color: var(--gold); font-size: .95rem; }
.top nav { display: flex; gap: 18px; align-items: center; font-family: var(--f-sc); letter-spacing: .08em; text-transform: lowercase; font-size: 1rem; }
.top nav a { text-decoration: none; color: rgba(238,231,215,.85); }
.top nav a:hover { color: var(--gold); }

/* hero */
.hero { background: var(--green-deep); color: var(--cream); padding-block: clamp(48px, 8vw, 96px); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -120px; top: 50%; width: 420px; height: 420px; transform: translateY(-50%); border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 34px, rgba(211,186,68,.13) 34px 36px); pointer-events: none; }
.hero .wrap { position: relative; z-index: 1; display: grid; gap: 18px; }
.eyebrow { font-family: var(--f-sc); font-weight: 700; letter-spacing: .14em; text-transform: lowercase; font-size: .95rem; color: var(--gold-ink); }
.on-dark .eyebrow { color: var(--gold); }
.hero h1 { font-style: italic; font-weight: 400; font-size: clamp(2.3rem, 6vw, 4.2rem); max-width: 18ch; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 10px 28px; font-family: var(--f-sc); letter-spacing: .08em; text-transform: lowercase; color: rgba(238,231,215,.85); }
.hero .meta b { color: var(--gold); font-weight: 700; }
.hero .infos { max-width: 60ch; color: rgba(238,231,215,.84); }

.h2 { font-style: italic; font-size: clamp(1.9rem, 4vw, 2.8rem); }
.section { padding-block: clamp(48px, 7vw, 88px); }
.section + .section { border-top: 1px solid var(--rule); }
.lead { color: var(--ink-soft); max-width: 60ch; }

/* boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .6em; min-height: 50px; padding: 12px 24px; border: 1px solid transparent; border-radius: 0;
  font-family: var(--f-sc); font-size: 1rem; font-weight: 700; letter-spacing: .1em; text-transform: lowercase; text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s, transform .2s; }
.btn:hover { transform: translateY(-2px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn--gold { background: var(--gold); color: var(--ink); } .btn--gold:hover { background: #E4CC5A; }
.btn--ink { background: var(--ink); color: var(--cream); } .btn--ink:hover { background: var(--green); }
.btn--green { background: var(--green); color: var(--cream); } .btn--green:hover { background: var(--green-deep); }
.btn--line { border-color: var(--ink); color: var(--ink); background: transparent; } .btn--line:hover { background: var(--ink); color: var(--cream); }
.btn--sm { min-height: 38px; padding: 6px 14px; font-size: .9rem; }
.linkbtn { background: none; border: 0; padding: 4px; font: inherit; font-family: var(--f-sc); letter-spacing: .06em; text-transform: lowercase; color: var(--gold-ink); text-decoration: underline; text-underline-offset: .25em; cursor: pointer; }
.linkbtn.danger { color: var(--error); }

/* formulaires */
.form { display: grid; gap: 18px; max-width: 640px; }
.grid2 { display: grid; gap: 18px; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; }
.field label { font-family: var(--f-sc); letter-spacing: .07em; text-transform: lowercase; font-size: 1rem; font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; font: inherit; color: var(--ink); background: var(--card); border: 1px solid rgba(36,32,32,.35); border-radius: 0; padding: 11px 14px; min-height: 50px; }
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: 1px; border-color: var(--ink); }
.hint { font-size: .92rem; color: var(--ink-soft); }
.check { display: grid; grid-template-columns: 24px 1fr; gap: 12px; font-size: .97rem; color: var(--ink-soft); }
.check input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--green); }
.status { font-size: 1rem; padding: 12px 16px; border-left: 3px solid var(--ink-soft); background: var(--card); }
.status:empty { display: none; }
.status.ok { border-color: var(--green); color: var(--green); font-weight: 700; }
.status.err { border-color: var(--error); color: var(--error); }

/* cartes / pastilles */
.card { background: var(--card); border: 1px solid var(--rule); padding: clamp(18px, 3vw, 28px); }
.pill { display: inline-block; font-family: var(--f-sc); font-weight: 700; letter-spacing: .1em; text-transform: lowercase; font-size: .85rem; padding: 3px 10px; border: 1px solid currentColor; }
.pill--open { color: var(--green); } .pill--closed { color: var(--gold-ink); } .pill--live { color: var(--error); } .pill--done { color: var(--ink-soft); }

.teams { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 0; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); border-top: 1px solid var(--rule); }
.teams li { padding: 12px 4px; border-bottom: 1px solid var(--rule); font-family: var(--f-display); font-style: italic; font-size: 1.2rem; display: flex; gap: 12px; align-items: baseline; }
.teams li small { font-family: var(--f-sc); font-style: normal; font-size: .85rem; color: var(--gold-ink); min-width: 2ch; }

/* places restantes */
.gauge { height: 6px; background: rgba(238,231,215,.18); max-width: 360px; }
.gauge i { display: block; height: 100%; background: var(--gold); transition: width .6s; }

/* ===== tableau (arbre) ===== */
.bracket-scroll { overflow-x: auto; padding-bottom: 12px; margin-top: 28px; -webkit-overflow-scrolling: touch; }
.bracket { display: flex; gap: 0; min-width: max-content; }
.round { display: flex; flex-direction: column; width: 250px; }
.round + .round { margin-left: 34px; }
.round-title { font-family: var(--f-sc); font-weight: 700; letter-spacing: .12em; text-transform: lowercase; color: var(--gold-ink); font-size: .9rem; padding-bottom: 10px; border-bottom: 1px solid var(--rule); margin-bottom: 8px; }
.round-body { flex: 1; display: flex; flex-direction: column; justify-content: space-around; }
.mwrap { position: relative; padding-block: 8px; }
.match { background: var(--card); border: 1px solid rgba(36,32,32,.25); position: relative; }
.round:not(:last-child) .mwrap::after { content: ""; position: absolute; right: -18px; top: 50%; width: 18px; border-top: 1px solid var(--rule); }
.round:not(:first-child) .mwrap::before { content: ""; position: absolute; left: -16px; top: 50%; width: 16px; border-top: 1px solid var(--rule); }
.slot { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 6px 10px; font-size: 1rem; }
.slot + .slot { border-top: 1px solid rgba(36,32,32,.12); }
.slot .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot .sc { font-family: var(--f-sc); font-weight: 700; min-width: 2ch; text-align: right; }
.slot.empty .nm { color: rgba(36,32,32,.4); font-style: italic; }
.slot.win { background: var(--green); color: var(--cream); }
.slot.win .nm { font-weight: 700; }
.slot.lose { color: rgba(36,32,32,.45); text-decoration: line-through; text-decoration-color: rgba(36,32,32,.3); }
.match.ready { border-color: var(--gold-ink); box-shadow: 0 0 0 1px var(--gold-ink); }
.champion { margin-top: 28px; display: flex; align-items: center; gap: 18px; padding: 22px 26px; background: var(--ink); color: var(--cream); max-width: 640px; }
.champion .cup { font-size: 2.4rem; line-height: 1; }
.champion h3 { font-style: italic; font-size: clamp(1.6rem, 3vw, 2.2rem); color: var(--gold); }

/* admin : boutons de victoire dans les matchs */
.slot button.pick { all: unset; flex: 1; min-width: 0; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot button.pick:hover, .slot button.pick:focus-visible { text-decoration: underline; text-decoration-color: var(--gold-ink); text-underline-offset: .25em; }
.slot input.sc-in { width: 3.2em; min-height: 30px; padding: 2px 6px; font: inherit; font-size: .95rem; border: 1px solid rgba(36,32,32,.3); background: #fff; text-align: center; }
.mactions { display: flex; justify-content: flex-end; padding: 2px 6px; border-top: 1px dashed rgba(36,32,32,.15); }

/* pied */
.foot { background: var(--ink); color: rgba(238,231,215,.75); padding-block: 36px; font-size: .95rem; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; align-items: center; }
.foot img { height: 56px; width: auto; }

@media (prefers-reduced-motion: reduce) { .btn, .gauge i { transition: none; } .btn:hover { transform: none; } }
