/* PRONO 27 — interface joueur (version 0, mobile d'abord).
   Univers : le bulletin de vote. Papier gris froid, encre marine, enveloppe bleue, tampon rouge.
   Polices du système uniquement : aucune requête vers un service tiers de polices. */
:root {
  --papier: #eceef2;
  --carte: #fbfbf9;
  --encre: #12182e;
  --encre-douce: #4a5170;
  --enveloppe: #1c2f6e;
  --tampon: #b3222b;
  --filet: #cfd3de;
  --basique: #6b7185;
  --rare: #1f5fae;
  --ultra: #6a3fa3;
  --or: #a97b12;
  --serif: Charter, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", Roboto, system-ui, sans-serif;
  --r: 14px;
}
@media (prefers-color-scheme: dark) {
  :root { --papier: #0f1424; --carte: #182038; --encre: #eef0f7; --encre-douce: #a4abc6; --enveloppe: #8ea4f0; --filet: #2c3558; --basique: #9aa1ba; --rare: #6fa8ee; --ultra: #b690ef; --or: #e0b448; --tampon: #ef6a72; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--papier); color: var(--encre); font: 16px/1.5 var(--sans); min-height: 100vh; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--tampon); outline-offset: 2px; }
.boot { text-align: center; padding: 4rem 1rem; color: var(--encre-douce); }

/* Structure */
.shell { max-width: 560px; margin: 0 auto; padding: 0 16px 96px; }
.top { position: sticky; top: 0; z-index: 5; background: var(--papier); padding: calc(10px + env(safe-area-inset-top)) 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--filet); }
.logo { font: 800 1.15rem/1 var(--sans); letter-spacing: .02em; }
.logo b { color: var(--tampon); font-weight: 800; }
.who { display: flex; align-items: center; gap: 10px; font-size: .9rem; min-width: 0; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 28vw; color: var(--encre-douce); }
.credits { background: var(--enveloppe); color: #fff; border-radius: 999px; padding: 4px 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .credits { color: #0f1424; } }
h1 { font: 800 1.6rem/1.15 var(--sans); margin: 24px 0 8px; }
h2 { font: 700 1.1rem/1.25 var(--sans); margin: 24px 0 8px; }
.lead { color: var(--encre-douce); margin: 0 0 16px; }
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--carte); border-top: 1px solid var(--filet); display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); }
nav.tabs div { display: flex; width: 100%; max-width: 560px; }
nav.tabs button { flex: 1; background: none; border: 0; padding: 14px 8px; font-weight: 700; color: var(--encre-douce); border-top: 3px solid transparent; }
nav.tabs button[aria-current="page"] { color: var(--encre); border-top-color: var(--tampon); }

/* Boutons et formulaires */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 12px; border: 2px solid var(--encre); background: var(--encre); color: var(--papier); font-weight: 700; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.alt { background: transparent; color: var(--encre); }
.btn.danger { background: var(--tampon); border-color: var(--tampon); color: #fff; }
.btn.block { width: 100%; }
.field { display: grid; gap: 6px; margin: 16px 0; }
.field input[type=text] { min-height: 48px; padding: 0 14px; border-radius: 10px; border: 2px solid var(--filet); background: var(--carte); }
.hint { font-size: .85rem; color: var(--encre-douce); }
.check { display: flex; gap: 12px; align-items: flex-start; margin: 12px 0; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--enveloppe); }
.err { color: var(--tampon); font-weight: 600; min-height: 1.5em; margin: 8px 0; }
.panel { background: var(--carte); border: 1px solid var(--filet); border-radius: var(--r); padding: 18px; margin: 16px 0; }
.auth { padding-top: 24px; display: grid; justify-items: center; }

/* Pack */
.pack { text-align: center; }
.pack .count { font: 800 2.6rem/1 var(--sans); font-variant-numeric: tabular-nums; margin: 4px 0; }
.dots { display: flex; justify-content: center; gap: 8px; margin: 10px 0 16px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--encre); }
.dots i.on { background: var(--encre); }
.reveal { display: grid; gap: 12px; margin-top: 16px; }
.back-card { min-height: 120px; border-radius: var(--r); border: 2px dashed var(--enveloppe); background: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--enveloppe) 10%, transparent) 10px 20px); display: grid; place-items: center; font-weight: 800; color: var(--enveloppe); width: 100%; }
@keyframes flip { from { transform: rotateX(80deg); opacity: 0; } to { transform: none; opacity: 1; } }
.flipped { animation: flip .45s ease-out; }
@media (prefers-reduced-motion: reduce) { .flipped { animation: none; } }

/* Cartes (bulletins) */
.grid { display: grid; gap: 12px; }
.card { position: relative; text-align: left; width: 100%; background: var(--carte); border: 1px solid var(--filet); border-left: 8px solid var(--c, var(--basique)); border-radius: 6px var(--r) var(--r) 6px; padding: 14px 16px 12px; display: grid; gap: 6px; }
.card[data-r="rare"] { --c: var(--rare); }
.card[data-r="ultra_rare"] { --c: var(--ultra); }
.card[data-r="or"] { --c: var(--or); box-shadow: 0 0 0 2px color-mix(in srgb, var(--or) 35%, transparent); }
.card.done { opacity: .6; filter: grayscale(.8); }
button.card { cursor: pointer; }
.meta { display: flex; justify-content: space-between; gap: 8px; font-size: .8rem; font-weight: 700; color: var(--c, var(--basique)); }
.card h3 { margin: 0; font: 700 1rem/1.3 var(--sans); }
.say { margin: 0; font: 1.05rem/1.45 var(--serif); }
.foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .82rem; color: var(--encre-douce); }
.badge { background: var(--tampon); color: #fff; border-radius: 4px; padding: 1px 7px; font-weight: 800; font-size: .75rem; }
.stamp { position: absolute; right: 12px; top: 34px; transform: rotate(-8deg); border: 3px solid var(--tampon); color: var(--tampon); border-radius: 6px; padding: 2px 10px; font: 800 .95rem/1.2 var(--sans); letter-spacing: .06em; background: color-mix(in srgb, var(--carte) 80%, transparent); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.chip { border: 2px solid var(--filet); background: transparent; border-radius: 999px; padding: 6px 14px; font-weight: 700; color: var(--encre-douce); }
.chip[aria-pressed="true"] { border-color: var(--encre); color: var(--encre); }

/* Fiche détaillée */
dialog { width: min(560px, 100%); max-width: 100%; margin: auto auto 0; border: 0; border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); background: var(--papier); color: var(--encre); max-height: 92vh; overflow: auto; }
dialog::backdrop { background: rgba(10, 14, 30, .6); }
.face { display: block; width: 100%; text-align: left; background: var(--carte); border: 2px solid var(--filet); border-radius: 12px; padding: 14px 16px; margin: 10px 0; }
.face[aria-pressed="true"] { border-color: var(--tampon); box-shadow: 0 0 0 2px color-mix(in srgb, var(--tampon) 35%, transparent); }
.face small { display: block; color: var(--encre-douce); font-weight: 700; margin-bottom: 4px; }
.row { display: flex; gap: 10px; margin-top: 16px; }
.row .btn { flex: 1; }
.warn { background: color-mix(in srgb, var(--tampon) 10%, var(--carte)); border: 2px solid var(--tampon); border-radius: 12px; padding: 14px 16px; margin: 12px 0; }
#toasts { position: fixed; left: 0; right: 0; bottom: calc(76px + env(safe-area-inset-bottom)); display: grid; justify-items: center; gap: 8px; z-index: 20; pointer-events: none; padding: 0 16px; }
.toast { background: var(--encre); color: var(--papier); border-radius: 12px; padding: 12px 16px; font-weight: 600; max-width: 520px; }
.toast.bad { background: var(--tampon); color: #fff; }
.legal { color: var(--encre-douce); font-size: .85rem; margin-top: 32px; }
textarea, select { font: inherit; }
.field textarea:focus-visible, .field select:focus-visible, .field input:focus-visible { outline: 3px solid var(--tampon); outline-offset: 2px; }
