/* =====================================================================
   Dés100 Solo — APPARENCE
   ---------------------------------------------------------------------
   PERSONNALISER : changez les « jetons » ci-dessous (couleurs, polices).
   Thème sombre par défaut (« Nuit de campagne »), thème clair
   (« Carte d'état-major ») via le bouton ☀/☾ ou le réglage du système.
   La couleur --accent est remplacée par celle de l'univers choisi
   (voir js/data/universes.js, propriété accent).
   Mise en page : barre latérale de navigation + zone de jeu ; sur
   téléphone, menu tiroir + barre d'actions rapides en bas.
   ===================================================================== */
:root {
  --bg: #11141b;
  --bg2: #161a23;
  --surface: #1c212c;
  --surface2: #242a37;
  --line: #2f3645;
  --fg: #ebe5d7;
  --muted: #9ba2b2;
  --accent: #d8a542;
  --accent-text: color-mix(in oklab, var(--accent) 78%, white);
  --accent-soft: color-mix(in oklab, var(--accent) 16%, transparent);
  --on-accent: #16120a;
  --ok: #72c093;
  --bad: #e07564;
  --maybe: #d3ae55;
  --change: #a88ae8;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .55);
  --grid: rgba(255, 255, 255, .025);
  --f-display: 'IM Fell English SC', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --f-body: 'Alegreya Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --f-brand: 'Libre Baskerville', Baskerville, Georgia, 'Times New Roman', serif;
  --fz: 1.08; /* taille du texte : 1.08 = +1 pt par défaut, réglable avec A− / A+ */
  --r: 10px;
  --r-sm: 6px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #eceff3; --bg2: #e2e6ed; --surface: #ffffff; --surface2: #f4f6f9; --line: #d3d9e3;
    --fg: #1a1e28; --muted: #596173;
    --accent-text: color-mix(in oklab, var(--accent) 58%, black);
    --accent-soft: color-mix(in oklab, var(--accent) 14%, transparent);
    --ok: #2c8654; --bad: #b3432f; --maybe: #946d10; --change: #6a4cc0;
    --shadow: 0 10px 26px -14px rgba(30, 40, 60, .35); --grid: rgba(20, 40, 80, .045);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #eceff3; --bg2: #e2e6ed; --surface: #ffffff; --surface2: #f4f6f9; --line: #d3d9e3;
  --fg: #1a1e28; --muted: #596173;
  --accent-text: color-mix(in oklab, var(--accent) 58%, black);
  --accent-soft: color-mix(in oklab, var(--accent) 14%, transparent);
  --ok: #2c8654; --bad: #b3432f; --maybe: #946d10; --change: #6a4cc0;
  --shadow: 0 10px 26px -14px rgba(30, 40, 60, .35); --grid: rgba(20, 40, 80, .045);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: calc(17px * var(--fz))/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 400; text-wrap: balance; line-height: 1.15; margin: 0; }
p { margin: 0; }
a { color: var(--accent-text); }

/* ---------------------------------------------------------------- SHELL */
.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100%; }
.side {
  background: var(--bg2); border-right: 1px solid var(--line);
  position: sticky; top: env(safe-area-inset-top, 0px); height: 100vh; height: 100dvh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px; padding: 18px 14px;
}
.side > * { flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 4px; text-decoration: none; color: var(--fg); }
.brand-logo { flex: none; width: 50px; height: 50px; display: grid; place-items: center; }
.brand-logo .logo-mark, .brand-logo img { width: 50px; height: 50px; object-fit: contain; }
.brand-txt { display: grid; gap: 1px; min-width: 0; }
.brand b { font-family: var(--f-brand); font-weight: 700; font-size: calc(23px * var(--fz)); letter-spacing: .01em; line-height: 1.05; }
.brand b span { color: var(--accent-text); }
.brand small { font-size: calc(10.5px * var(--fz)); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); line-height: 1.3; }
.gchip { display: grid; gap: 0; text-align: left; width: 100%; border: 1px dashed var(--line); background: transparent; border-radius: var(--r-sm); padding: 6px 10px; font-size: calc(15px * var(--fz)); font-weight: 600; }
.gchip:hover { border-color: var(--accent); }
.gchip-k { font-size: calc(10.5px * var(--fz)); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.uchip {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; overflow: hidden;
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 0; font-size: calc(15px * var(--fz)); font-weight: 600;
}
.uchip:hover { border-color: var(--accent); }
.uchip-art { flex: none; width: 64px; height: 40px; display: block; overflow: hidden; }
.uchip-art .uart { width: 100%; height: 100%; display: block; object-fit: cover; }
.nav { display: grid; gap: 1px; }
.nav h4 { margin: 12px 8px 4px; font-size: calc(11px * var(--fz)); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--r-sm);
  color: var(--fg); text-decoration: none; font-size: calc(15.5px * var(--fz));
}
.nav a:hover { background: var(--surface); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); }
.nav a .i { width: 19px; height: 19px; flex: none; opacity: .85; }
.nav a.hot { color: var(--bad); font-weight: 600; }
.side-foot { margin-top: auto; font-size: calc(12.5px * var(--fz)); color: var(--muted); padding: 10px 6px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px clamp(16px, 3vw, 32px);
  background: color-mix(in oklab, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.top .burger, .scrim { display: none !important; }
.top-logo { display: none; }
.top-logo .logo-mark, .top-logo img { width: 34px; height: 34px; display: block; }
.top h1 { font-size: calc(22px * var(--fz)); margin-right: auto; }
.top .tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.content {
  container-type: inline-size;
  width: 100%; max-width: 1100px; margin: 0 auto;
  padding-inline: clamp(16px, 3vw, 32px); padding-block: 24px 110px;
  display: grid; gap: 22px; align-content: start;
}
.page-bg {
  background-image:
    radial-gradient(900px 380px at 70% -120px, var(--accent-soft), transparent 70%),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: auto, 44px 44px, 44px 44px;
  flex: 1;
}

/* ---------------------------------------------------------------- BOUTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg);
  border-radius: var(--r-sm); padding: 9px 14px; font-size: calc(15.5px * var(--fz)); line-height: 1.2; text-decoration: none;
  transition: background .15s, border-color .15s, transform .08s;
}
.btn:hover { border-color: color-mix(in oklab, var(--accent) 55%, var(--line)); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn.primary:hover { background: color-mix(in oklab, var(--accent) 88%, white); }
.btn.big { padding: 14px 20px; font-size: calc(17px * var(--fz)); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 10px; font-size: calc(14px * var(--fz)); }
.btn.danger { color: var(--bad); }
.btn.stuck { background: color-mix(in oklab, var(--bad) 82%, black); border-color: transparent; color: #fff; font-weight: 700; }
.btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 8px 12px; font-size: calc(14.5px * var(--fz)); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); font-weight: 700; }

/* ---------------------------------------------------------------- PANNEAUX */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: grid; gap: 14px; box-shadow: var(--shadow); min-width: 0; }
.panel h2 { font-size: calc(24px * var(--fz)); }
.panel h3 { font-size: calc(19px * var(--fz)); }
.lead { color: var(--muted); max-width: 65ch; }
.eyebrow { font-size: calc(12px * var(--fz)); letter-spacing: .16em; text-transform: uppercase; color: var(--accent-text); font-weight: 700; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
label.f { display: grid; gap: 4px; font-size: calc(14px * var(--fz)); color: var(--muted); }
input[type=text], input[type=number], textarea, select {
  width: 100%; background: var(--surface2); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 9px 11px; color: var(--fg); font-size: calc(16px * var(--fz));
}
textarea { min-height: 84px; resize: vertical; }
.hint { font-size: calc(13.5px * var(--fz)); color: var(--muted); }

/* ---------------------------------------------------------------- ACCUEIL */
.hero { display: grid; gap: 16px; padding: clamp(18px, 4vw, 40px) 0 6px; }
.hero .kicker { font-family: var(--f-mono); font-size: calc(13px * var(--fz)); letter-spacing: .12em; color: var(--accent-text); text-transform: uppercase; }
.hero h1 { font-size: calc(clamp(40px, 7vw, 76px) * var(--fz)); letter-spacing: -.005em; }
.hero-brand { display: flex; align-items: center; gap: clamp(12px, 2.5vw, 24px); }
.hero-brand .logo-mark { width: clamp(72px, 11vw, 120px); height: clamp(72px, 11vw, 120px); flex: none; filter: drop-shadow(0 10px 18px rgba(0,0,0,.35)); }
.hero h1 span { color: var(--accent-text); }
.hero .sub2 { font-family: var(--f-display); font-size: calc(clamp(20px, 2.6vw, 28px) * var(--fz)); color: var(--muted); }
.hero blockquote { margin: 0; font-size: calc(19px * var(--fz)); font-style: italic; max-width: 60ch; border-left: 3px solid var(--accent); padding-left: 14px; }
.hero .cta { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 10px; margin-top: 6px; }
.hero .cta .btn { justify-content: flex-start; padding: 16px 18px; font-size: calc(16px * var(--fz)); font-weight: 700; letter-spacing: .03em; }
.credit { font-size: calc(14px * var(--fz)); color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.credit .mail { font-family: var(--f-mono); color: var(--fg); user-select: all; }

.ugrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 10px; }
.ucard {
  text-align: left; display: grid; gap: 0; padding: 0; border-radius: var(--r); overflow: hidden; align-content: start;
  background: var(--surface); border: 1px solid var(--line); position: relative; transition: transform .15s, border-color .15s;
}
.ucard:hover { transform: translateY(-2px); border-color: var(--u); }
.uimg { display: block; aspect-ratio: 16 / 9; max-width: 100%; overflow: hidden; background: var(--surface2); }
.uimg .uart { width: 100%; height: 100%; display: block; object-fit: cover; }
.utxt { display: grid; gap: 3px; padding: 10px 12px 12px; border-top: 3px solid var(--u); }
.ucard b { font-size: calc(16.5px * var(--fz)); }
.utxt span { font-size: calc(13.5px * var(--fz)); color: var(--muted); line-height: 1.35; }
.ucard[aria-pressed="true"] { border-color: var(--u); box-shadow: 0 0 0 2px var(--u); }
.ugrid.compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.ugrid.compact .utxt { padding: 8px 10px; }

/* ---------------------------------------------------------------- TABLEAU DE BORD */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.tile {
  display: grid; gap: 4px; justify-items: start; padding: 14px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--fg);
}
.tile:hover { border-color: var(--accent); }
.tile .tile-ic { width: 28px; height: 28px; color: var(--accent-text); }
.tile b { font-size: calc(16px * var(--fz)); }
.tile small { color: var(--muted); font-size: calc(12.5px * var(--fz)); line-height: 1.3; }

/* ---------------------------------------------------------------- CARTES DE RÉSULTAT */
.results { display: grid; gap: 14px; }
.results:empty::before {
  content: attr(data-empty); display: block; padding: 22px; border: 1px dashed var(--line); border-radius: var(--r);
  color: var(--muted); text-align: center; font-size: calc(15px * var(--fz));
}
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px;
  display: grid; gap: 10px; box-shadow: var(--shadow); min-width: 0; animation: rise .25s ease-out;
}
@keyframes rise { from { transform: translateY(6px); } to { transform: none; } }
.card-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: calc(12.5px * var(--fz)); color: var(--muted); }
.tag { display: inline-flex; gap: 5px; align-items: center; padding: 2px 8px; border-radius: 99px; background: var(--surface2); border: 1px solid var(--line); font-weight: 600; letter-spacing: .03em; }
.tag.acc { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.card-head time { margin-left: auto; font-family: var(--f-mono); }
.card h3 { font-size: calc(clamp(21px, 2.6vw, 27px) * var(--fz)); }
.card .sub { color: var(--accent-text); font-weight: 600; }
.card .txt { font-size: calc(17px * var(--fz)); }
.card .lines { display: grid; gap: 2px; font-size: calc(19px * var(--fz)); font-weight: 600; }
.card[data-tone="yes"] { border-left: 5px solid var(--ok); }
.card[data-tone="no"] { border-left: 5px solid var(--bad); }
.card[data-tone="maybe"] { border-left: 5px solid var(--maybe); }
.card[data-tone="change"] { border-left: 5px solid var(--change); }
.card[data-tone="yes"] h3 { color: var(--ok); }
.card[data-tone="no"] h3 { color: var(--bad); }
.card[data-tone="maybe"] h3 { color: var(--maybe); }
.card[data-tone="change"] h3 { color: var(--change); }
.card[data-tone="r3"], .card[data-tone="r4"] { border-color: var(--accent); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 6px 18px; margin: 0; }
.fields div { display: grid; gap: 0; padding: 6px 0; border-top: 1px dashed var(--line); min-width: 0; }
.fields dt { font-size: calc(11.5px * var(--fz)); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.fields dd { margin: 0; overflow-wrap: anywhere; }
.acts { display: flex; flex-wrap: wrap; gap: 6px; }
.acts .btn { padding: 6px 11px; font-size: calc(14.5px * var(--fz)); }
.acts .btn.dev { border-color: var(--accent); color: var(--accent-text); font-weight: 700; }
.acts .btn.fav[aria-pressed="true"] { color: var(--maybe); border-color: var(--maybe); background: transparent; }
.qs { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; background: var(--surface2); border-radius: var(--r-sm); }
.qs .btn { font-size: calc(14px * var(--fz)); padding: 6px 10px; background: var(--surface); }
.qs .btn.rnd { border-style: dashed; }
.thread { display: grid; gap: 10px; border-left: 2px solid var(--accent-soft); margin-left: 6px; padding-left: 14px; }
.child { display: grid; gap: 8px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface2); border: 1px solid var(--line); min-width: 0; }
.child .q { font-size: calc(13.5px * var(--fz)); color: var(--muted); font-weight: 600; }
.child .a { font-size: calc(18px * var(--fz)); font-weight: 600; }
.child .card-head { font-size: calc(12px * var(--fz)); }

/* ---------------------------------------------------------------- ORACLE */
.oracle-form { display: grid; gap: 12px; }
.oracle-ask { display: flex; gap: 8px; flex-wrap: wrap; }
.oracle-ask input { flex: 1 1 260px; font-size: calc(18px * var(--fz)); padding: 12px 14px; }

/* ---------------------------------------------------------------- DÉS */
.dice-quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.dice-quick button {
  aspect-ratio: 1; max-width: 100%; border-radius: 14px; border: 1px solid var(--line); background: var(--surface2);
  font-family: var(--f-mono); font-weight: 700; font-size: calc(18px * var(--fz)); display: grid; place-items: center; position: relative;
}
.dice-quick button:hover { border-color: var(--accent); color: var(--accent-text); }
.dice-stage { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; min-height: 86px; }
.die {
  width: 64px; height: 64px; border-radius: 14px; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font: 700 calc(24px * var(--fz))/1 var(--f-mono);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .25), var(--shadow);
}
.die small { font-size: calc(10px * var(--fz)); position: absolute; }
.die.rolling { animation: tumble .55s cubic-bezier(.3, .7, .4, 1); }
@keyframes tumble { 0% { transform: rotate(-200deg) scale(.6); } 60% { transform: rotate(20deg) scale(1.08); } 100% { transform: none; } }
.dice-total { font: 700 calc(44px * var(--fz))/1 var(--f-mono); color: var(--accent-text); }
.dice-detail { font-family: var(--f-mono); color: var(--muted); }
.counter { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.counter button { border: 0; background: var(--surface2); width: 38px; height: 38px; font-size: calc(18px * var(--fz)); }
.counter input { width: 56px; text-align: center; border: 0; border-radius: 0; background: var(--surface); }

/* ---------------------------------------------------------------- LISTES (historique, tables) */
.list { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.list > * { display: flex; gap: 12px; align-items: baseline; padding: 10px 14px; border-top: 1px solid var(--line); min-width: 0; }
.list > *:first-child { border-top: 0; }
.list button.item { background: none; border: 0; border-top: 1px solid var(--line); text-align: left; width: 100%; }
.list button.item:first-child { border-top: 0; }
.list button.item:hover { background: var(--surface2); }
.list time { font-family: var(--f-mono); color: var(--muted); font-size: calc(14px * var(--fz)); flex: none; }
.list .s { min-width: 0; overflow-wrap: anywhere; }
details.tbl { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
details.tbl summary { padding: 10px 14px; cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
details.tbl summary b { margin-right: auto; }
details.tbl ol { margin: 0; padding: 4px 18px 14px 50px; columns: 2 260px; column-gap: 28px; font-size: calc(14.5px * var(--fz)); }
details.tbl li { break-inside: avoid; padding: 1px 0; }
details.tbl li::marker { font-family: var(--f-mono); color: var(--muted); font-size: calc(12px * var(--fz)); }
.express { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.express .panel { gap: 10px; }
.express ul { margin: 0; padding-left: 18px; font-size: calc(14px * var(--fz)); color: var(--muted); columns: 2 120px; }

/* ---------------------------------------------------------------- BLOQUÉ */
.stuck-hero { display: grid; justify-items: center; text-align: center; gap: 14px; padding: 18px 0; }
.stuck-hero .btn { font-size: calc(clamp(22px, 4vw, 32px) * var(--fz)); padding: 20px 34px; border-radius: 16px; font-family: var(--f-display); }

/* ---------------------------------------------------------------- MODALE / FEUILLE RAPIDE */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(5, 8, 14, .6); display: grid; place-items: end center; padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
.sheet {
  width: min(760px, 100%); max-height: min(86vh, 900px); overflow: auto; background: var(--bg); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px; display: grid; gap: 12px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7);
  animation: rise .2s ease-out;
}
.sheet-head { display: flex; align-items: center; gap: 10px; }
.sheet-head h2 { font-size: calc(22px * var(--fz)); margin-right: auto; }
@media (min-width: 760px) { .overlay { place-items: center; } }
.manual-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 10px; }
.manual-grid label { display: grid; gap: 2px; font-size: calc(13.5px * var(--fz)); color: var(--muted); }
.manual-grid label b { color: var(--fg); font-family: var(--f-mono); font-size: calc(12px * var(--fz)); }

.toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; background: var(--fg); color: var(--bg); padding: 9px 16px; border-radius: 99px; font-weight: 600; font-size: calc(14.5px * var(--fz)); box-shadow: var(--shadow); max-width: calc(100% - 32px); }

/* ---------------------------------------------------------------- BARRE MOBILE */
.dock { display: none; }
.scrim { display: none; }

/* Le panneau latéral reste TOUJOURS visible.
   - Ordinateur (> 1100 px) : panneau complet de 250 px.
   - Tablette (721 à 1100 px) : panneau complet plus étroit.
   - Smartphone (≤ 720 px) : panneau compact (icône + nom court), la zone de jeu garde la place. */
.nav a .short { display: none; }
@media (max-width: 1100px) {
  .app { grid-template-columns: 212px minmax(0, 1fr); }
  .side { padding: 14px 10px; gap: 12px; }
  .brand-logo, .brand-logo .logo-mark, .brand-logo img { width: 42px; height: 42px; }
  .brand b { font-size: calc(20px * var(--fz)); }
  .brand small { font-size: calc(9.5px * var(--fz)); }
  .nav a { padding: 7px 8px; gap: 8px; font-size: calc(14.5px * var(--fz)); }
  .top .tools .hide-md { display: none; }
  #tool-mode .lbl { display: none; }
  .content { padding-block: 20px 60px; }
}
@media (max-width: 720px) {
  .app { grid-template-columns: 74px minmax(0, 1fr); }
  .side { padding: calc(10px + env(safe-area-inset-top, 0px)) 5px calc(80px + env(safe-area-inset-bottom, 0px)); gap: 8px; align-items: stretch; scrollbar-width: none; }
  .side::-webkit-scrollbar { display: none; }
  .brand { justify-content: center; padding: 0; }
  .brand-txt, .gchip, .side-foot, .nav h4, .uchip #uchip-label { display: none; }
  .brand-logo, .brand-logo .logo-mark, .brand-logo img { width: 44px; height: 44px; }
  .uchip { justify-content: center; }
  .uchip-art { width: 100%; height: 34px; }
  .nav { gap: 2px; }
  .nav h4 + a { margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 var(--r-sm) var(--r-sm); padding-top: 9px; }
  .nav a { flex-direction: column; justify-content: center; gap: 3px; padding: 7px 2px; min-height: 52px; text-align: center; font-size: 10.5px; line-height: 1.1; }
  .nav a .label { display: none; }
  .nav a .short { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav a .i { width: 22px; height: 22px; }
  .top { padding: 8px 10px; gap: 6px; }
  .top h1 { font-size: calc(18px * var(--fz)); flex: 1 1 100%; order: -1; margin: 0; }
  .top .tools { width: 100%; gap: 5px; justify-content: space-between; }
  .top .tools .hide-sm { display: none; }
  .top .tools .btn.small { padding: 7px 9px; }
  .top .tools .lbl { display: none; }
  .tools .size-switch button, .tools .lang-switch button { padding: 7px 8px; min-width: 34px; }
  .content { padding-inline: 12px; padding-block: 16px calc(96px + env(safe-area-inset-bottom, 0px)); gap: 16px; }
  .panel { padding: 14px; }
  .card { padding: 14px; }
  .hero-brand .logo-mark { width: 64px; height: 64px; }
  .hero .cta { grid-template-columns: 1fr; }
  .dock {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 74px; right: 0; bottom: 0; z-index: 30;
    background: var(--bg2); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .dock button { background: none; border: 0; padding: 8px 2px 9px; min-height: 54px; display: grid; justify-items: center; align-content: center; gap: 2px; font-size: 11.5px; color: var(--muted); }
  .dock { grid-template-columns: repeat(4, 1fr); }
  .dock button .ico { width: 22px; height: 22px; }
  .dock button.stuckd { color: var(--bad); font-weight: 700; }
  .dock [data-tool="menu"] { display: none; }
  .overlay { padding: 10px; padding-left: 84px; }
  .toast { left: calc(50% + 37px); bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
  .acts .btn { padding: 8px 11px; }
  .qs .btn { padding: 8px 10px; }
}
@media (max-width: 380px) {
  .app { grid-template-columns: 64px minmax(0, 1fr); }
  .dock { left: 64px; }
  .overlay { padding-left: 72px; }
  .nav a { font-size: 9.5px; }
}
/* Écrans tactiles : cibles plus grandes, pas d'effet de survol collant */
@media (hover: none) and (pointer: coarse) {
  .btn { min-height: 40px; }
  .btn.small { min-height: 36px; }
  .ucard:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------- ICÔNES */
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.18em; }
.btn .ico { width: 1.1em; height: 1.1em; }
.tag .ico { width: 1em; height: 1em; }
.h-ic { display: flex; align-items: center; gap: 10px; }
.h-ic .ico { width: .95em; height: .95em; color: var(--accent-text); }
.card .child .q .ico { width: 1em; height: 1em; color: var(--accent-text); }
.list .s .ico { width: 1em; height: 1em; color: var(--muted); }

/* ---------------------------------------------------------------- PARTIES */
.games { display: grid; gap: 12px; }
.game { display: grid; grid-template-columns: 180px minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.game.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.gimg { display: block; min-height: 100%; }
.gimg .uart { width: 100%; height: 100%; min-height: 120px; display: block; object-fit: cover; }
.gbody { padding: 14px 16px; display: grid; gap: 8px; min-width: 0; align-content: start; }
.gbody h3 { font-size: calc(22px * var(--fz)); }
.backups summary { cursor: pointer; font-size: calc(14px * var(--fz)); color: var(--muted); }
.backups .list { margin-top: 8px; }
.backups .list > div { flex-wrap: wrap; }
@container (max-width: 600px) { .game { grid-template-columns: minmax(0, 1fr); } .gimg .uart { aspect-ratio: 16 / 6; min-height: 0; height: auto; } }

/* ---------------------------------------------------------------- TABLEAU DE BORD */
.dash-head { grid-template-columns: 220px minmax(0, 1fr); padding: 0; overflow: hidden; gap: 0; }
.dash-art { display: block; }
.dash-art .uart { width: 100%; height: 100%; display: block; object-fit: cover; min-height: 150px; }
.dash-body { padding: 18px; display: grid; gap: 14px; min-width: 0; }
@container (max-width: 700px) { .dash-head { grid-template-columns: minmax(0, 1fr); } .dash-art .uart { aspect-ratio: 16 / 5; min-height: 0; height: auto; } }
.fav-item { display: grid; gap: 6px; }

.logo-img { object-fit: contain; border-radius: 8px; }
.hero-brand .logo-img { filter: none; }
.credit-link { color: inherit; text-decoration: none; border-bottom: 1px dotted currentColor; }
.credit-link:hover { color: var(--accent-text); }
.credit .mail, .side-foot .mail { font-family: var(--f-mono); color: var(--accent-text); text-decoration: none; overflow-wrap: anywhere; }
.credit .mail:hover, .side-foot .mail:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- NOM, LANGUE, TAILLE */
.brand-word { font-family: var(--f-brand); font-weight: 700; letter-spacing: 0; color: var(--fg); }
.hero h1.brand-word { font-family: var(--f-brand); font-weight: 700; font-size: calc(clamp(30px, 6.4vw, 70px) * var(--fz)); letter-spacing: -.01em; overflow-wrap: anywhere; min-width: 0; }
.hero-brand > div { min-width: 0; }
.lang-switch button, .size-switch button { padding: 6px 10px; font-size: calc(14px * var(--fz)); font-weight: 700; min-width: 38px; }
.lang-switch, .size-switch { vertical-align: middle; }


/* ---------------------------------------------------------------- À PROPOS / COUP DE POUCE */
.about p { max-width: 70ch; }
.about h3 { margin-top: 6px; }
.partners { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 10px; }
.partner {
  position: relative; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; gap: 8px 14px; align-items: center;
  padding: 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface2);
  color: var(--fg); text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.partner::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--pc); }
.partner:hover, .partner:focus-visible { transform: translateY(-3px); border-color: var(--pc); box-shadow: 0 14px 30px -14px color-mix(in oklab, var(--pc) 70%, transparent); }
.p-logo { grid-row: 1 / span 2; width: 58px; height: 58px; display: grid; place-items: center; }
.p-logo img { max-width: 58px; max-height: 58px; object-fit: contain; border-radius: 10px; background: #fff; padding: 4px; }
.p-badge {
  width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center;
  background: var(--pc); color: #fff; font: 700 calc(28px * var(--fz)) / 1 var(--f-brand);
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.18); transition: transform .25s ease;
}
.partner:hover .p-badge { transform: rotate(-8deg) scale(1.06); }
.p-txt { display: grid; gap: 2px; min-width: 0; }
.p-txt b { font-family: var(--f-brand); font-size: calc(20px * var(--fz)); }
.p-txt span { font-size: calc(14px * var(--fz)); color: var(--muted); }
.p-go { grid-column: 2; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: calc(14px * var(--fz)); color: color-mix(in oklab, var(--pc) 72%, var(--fg)); }
.p-go .ico { transition: transform .18s ease; }
.partner:hover .p-go .ico { transform: translateX(4px); }


/* ---------------------------------------------------------------- RÉSEAUX SOCIAUX */
.socials { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 10px; }
.social {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 64px;
  border-radius: var(--r); border: 1px solid var(--line); background: var(--surface2); color: var(--fg); text-decoration: none; min-width: 0;
}
.social:hover { border-color: var(--brand); }
.social-logo { flex: none; width: 40px; height: 40px; display: grid; place-items: center; }
.social-logo svg { width: 40px; height: 40px; display: block; }
.mail-logo { border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.mail-logo .ico { width: 22px; height: 22px; }
.social-txt { display: grid; min-width: 0; }
.social-txt b { font-size: calc(16px * var(--fz)); }
.social-txt span { font-size: calc(14px * var(--fz)); color: var(--muted); overflow-wrap: break-word; }

/* ---------------------------------------------------------------- TÉLÉCHARGEMENTS */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.dl-card { display: grid; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface2); }
.dl-card:hover { border-color: var(--u); }
.dl-art { display: block; aspect-ratio: 16 / 7; overflow: hidden; border-bottom: 3px solid var(--u); }
.dl-art .uart { width: 100%; height: 100%; display: block; object-fit: cover; }
.dl-body { padding: 14px; display: grid; gap: 8px; justify-items: start; }
.dl-body h3 { font-size: calc(21px * var(--fz)); }
