:root {
  --bg: #0b1f17;
  --bg2: #102a1f;
  --card: #153326;
  --card2: #1b402f;
  --line: #2a5a43;
  --text: #f2efe4;
  --muted: #9db8a9;
  --gold: #e2b13c;
  --gold-ink: #2a1d00;
  --ok: #4ade80;
  --ok-bg: #11452a;
  --bad: #f87171;
  --bad-bg: #4a1d1d;
  --warn: #fbbf24;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: radial-gradient(1200px 600px at 50% -10%, #17402e 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text); font: 16px/1.5 var(--font); min-height: 100vh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 .8em; }
.boot { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: .85rem; } .right { margin-left: auto; }
.hidden { display: none !important; }

/* Mise en page */
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(11, 31, 23, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 980px; margin: 0 auto; display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; color: var(--text); display: flex; align-items: center; gap: .5rem; }
.brand:hover { text-decoration: none; }
.brand .chip { width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: var(--bg); display: grid; place-items: center; font-size: 15px; }
.nav { display: flex; gap: .25rem; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.nav a { color: var(--muted); padding: .35rem .6rem; border-radius: 8px; font-size: .92rem; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--card); text-decoration: none; }
.badge { background: var(--gold); color: var(--gold-ink); border-radius: 999px; font-size: .72rem; padding: 0 .45rem; margin-left: .25rem; font-weight: 700; }
main { max-width: 980px; margin: 0 auto; padding: 1.25rem 1rem 4rem; }
.narrow { max-width: 680px; margin: 0 auto; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; margin-bottom: 1rem; }
.grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.tile { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; color: var(--text); transition: transform .12s, border-color .12s; }
.tile:hover { border-color: var(--gold); transform: translateY(-2px); text-decoration: none; }
.tile .ico { font-size: 1.8rem; display: block; margin-bottom: .3rem; }
.tile b { font-family: var(--serif); font-size: 1.1rem; display: block; }
.tile span.d { color: var(--muted); font-size: .9rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: .8rem; }
.stats { display: flex; gap: .6rem; flex-wrap: wrap; }
.stat { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: .6rem .9rem; min-width: 110px; flex: 1; }
.stat b { display: block; font-size: 1.5rem; font-family: var(--serif); color: var(--gold); }
.stat span { color: var(--muted); font-size: .8rem; }

/* Boutons & formulaires */
button, .btn { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--card2); color: var(--text); padding: .6rem 1rem; border-radius: 10px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
button:hover, .btn:hover { border-color: var(--gold); text-decoration: none; }
button:disabled { opacity: .5; cursor: not-allowed; }
.primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); font-weight: 700; }
.primary:hover { filter: brightness(1.08); }
.danger { border-color: #7a2d2d; color: var(--bad); background: transparent; }
.okbtn { border-color: #1f7a45; color: var(--ok); background: transparent; }
.big { width: 100%; min-height: 52px; font-size: 1.05rem; }
.linkbtn { background: none; border: none; color: var(--gold); padding: 0; min-height: 0; }
label { display: block; font-size: .88rem; color: var(--muted); margin-bottom: .25rem; }
input[type=text], input[type=number], input[type=search], input[type=email], select, textarea {
  width: 100%; font: inherit; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; min-height: 44px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.field { margin-bottom: .9rem; }
.checks { display: flex; flex-wrap: wrap; gap: .4rem; }
.check { display: inline-flex; align-items: center; gap: .4rem; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .8rem; font-size: .9rem; color: var(--text); margin: 0; cursor: pointer; min-height: 36px; }
.check input { accent-color: var(--gold); }
.err { background: var(--bad-bg); border: 1px solid #7a2d2d; color: #ffd0d0; border-radius: 10px; padding: .6rem .9rem; margin-bottom: .9rem; }
.info { background: var(--ok-bg); border: 1px solid #1f7a45; color: #c8f7da; border-radius: 10px; padding: .6rem .9rem; margin-bottom: .9rem; }
.tag { display: inline-block; font-size: .72rem; padding: .05rem .5rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); margin-right: .3rem; }
.tag.PENDING { color: var(--warn); border-color: #7a5d12; } .tag.VALIDATED { color: var(--ok); border-color: #1f7a45; } .tag.REFUSED { color: var(--bad); border-color: #7a2d2d; }
.tag.POKER { color: var(--gold); border-color: #7a5d12; }

/* Login */
.login { max-width: 420px; margin: 8vh auto 0; text-align: center; }
.login .logo { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 1rem; display: block; }
.gbtn { background: #fff; color: #222; border-color: #fff; font-weight: 600; }
.gbtn:hover { text-decoration: none; filter: brightness(.95); }

/* Quiz */
.qhead { display: flex; align-items: center; gap: .75rem; margin-bottom: .6rem; color: var(--muted); font-size: .92rem; }
.bar { height: 6px; background: var(--bg2); border-radius: 99px; overflow: hidden; margin-bottom: 1rem; }
.bar > i { display: block; height: 100%; background: var(--gold); transition: width .3s; }
.timer { font-variant-numeric: tabular-nums; margin-left: auto; }
.statement { font-family: var(--serif); font-size: 1.2rem; margin: .4rem 0 1rem; white-space: pre-wrap; }
.history { background: var(--bg2); border-left: 3px solid var(--gold); border-radius: 8px; padding: .6rem .8rem; margin: .8rem 0 1rem; font-size: .95rem; white-space: pre-wrap; }
.history b { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .2rem; }
.hint { color: var(--muted); font-size: .85rem; margin: 0 0 .5rem; }
.choices { display: grid; gap: .55rem; }
.choice { display: flex; justify-content: flex-start; gap: .7rem; align-items: center; text-align: left; width: 100%; background: var(--bg2); border: 2px solid var(--line); border-radius: 12px; padding: .7rem .9rem; min-height: 54px; color: var(--text); }
.choice .letter { width: 30px; height: 30px; flex: none; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 700; }
.choice.sel { border-color: var(--gold); background: #2a3a1d; }
.choice.sel .letter { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.choice.good { border-color: var(--ok); background: var(--ok-bg); }
.choice.good .letter { background: var(--ok); color: #05260f; border-color: var(--ok); }
.choice.miss { border-color: var(--bad); background: var(--bad-bg); }
.choice.miss .letter { background: var(--bad); color: #2b0606; border-color: var(--bad); }
.choice[disabled] { cursor: default; opacity: 1; }
.verdict { border-radius: 12px; padding: .8rem 1rem; margin: 1rem 0; font-weight: 600; }
.verdict.ok { background: var(--ok-bg); border: 1px solid #1f7a45; color: var(--ok); }
.verdict.ko { background: var(--bad-bg); border: 1px solid #7a2d2d; color: var(--bad); }
.explain { background: var(--bg2); border-radius: 10px; padding: .8rem 1rem; margin-bottom: 1rem; white-space: pre-wrap; }
.explain b { display: block; color: var(--gold); margin-bottom: .2rem; }
.bigscore { font-family: var(--serif); font-size: 3.2rem; color: var(--gold); line-height: 1; }

/* Table de poker */
.ptable { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto; }
.ptable text { font-family: var(--font); }

/* Tableaux */
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
table.list tr.me td { background: rgba(226, 177, 60, .12); }
table.list td.num, table.list th.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; }

/* Formulaire de situation */
.split { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 860px) { .split.two { grid-template-columns: 1fr 1fr; align-items: start; } .sticky { position: sticky; top: 70px; } }
.seatrow { display: grid; grid-template-columns: 62px 1fr 1fr 44px 44px; gap: .4rem; align-items: center; margin-bottom: .4rem; }
.seatrow .pos { font-weight: 700; } .seatrow .pos.hero { color: var(--gold); }
.seatrow input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--gold); justify-self: center; }
.seathead { display: grid; grid-template-columns: 62px 1fr 1fr 44px 44px; gap: .4rem; font-size: .75rem; color: var(--muted); margin-bottom: .2rem; }
.cardpick { display: flex; gap: .3rem; }
.cardpick select { min-width: 0; padding: .4rem; }
.pickrow { display: flex; gap: .6rem; flex-wrap: wrap; }
@media (max-width: 520px) {
  .nav a { padding: .35rem .45rem; font-size: .85rem; }
  .brand span.t { display: none; }
  h1 { font-size: 1.45rem; }
  .qwrap .statement { font-size: 1.1rem; }
}
