/* Archipelago Facile — feuille de style.
   Thème « carte marine » : le fond est la mer, chaque jeu est une île.
   Les couleurs d'action reprennent celles des objets dans Archipelago :
   prune = progression (actions principales), ardoise = utile, saumon = piège (danger), cyan = remplissage (succès). */

@font-face { font-family: "Alegreya"; src: url("/static/fonts/alegreya-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("/static/fonts/alegreya-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("/static/fonts/alegreya-latin-600-italic.woff2") format("woff2"); font-weight: 600; font-style: italic; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("/static/fonts/alegreya-latin-700-italic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("/static/fonts/alegreya-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("/static/fonts/alegreya-sans-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("/static/fonts/alegreya-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("/static/fonts/alegreya-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --paper: #eef5f3;
  --chart: #ffffff;
  --sea: #d7e9e5;
  --sea-deep: #b9d6d0;
  --ink: #15344a;
  --ink-soft: #4a6577;
  --line: #c9dcd8;
  --plum: #5b3fc4;
  --plum-hover: #4a30ab;
  --plum-soft: #ece6fb;
  --on-plum: #ffffff;
  --slate: #3757b8;
  --slate-soft: #e3e9fa;
  --salmon: #c2453a;
  --salmon-soft: #fbe7e4;
  --teal: #0b7f86;
  --teal-soft: #ddf1ef;
  --amber: #8a5d00;
  --amber-soft: #fff1cf;
  --focus: #5b3fc4;
  --game: #3757b8;

  --serif: "Alegreya", "Iowan Old Style", Georgia, serif;
  --sans: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;

  --r-panel: 14px;
  --r-control: 7px;
  --measure: 68ch;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f2230;
    --chart: #15303f;
    --sea: #183a4a;
    --sea-deep: #21495b;
    --ink: #e3eef0;
    --ink-soft: #9db4bf;
    --line: #2a4b5c;
    /* Couleurs exactes du client texte d'Archipelago, lisibles sur fond sombre. */
    --plum: #af99ef;
    --plum-hover: #c4b3f5;
    --plum-soft: #2b2650;
    --on-plum: #1a1036;
    --slate: #8ea5ef;
    --slate-soft: #22325a;
    --salmon: #fa8072;
    --salmon-soft: #4a2423;
    --teal: #3fd0c9;
    --teal-soft: #173f42;
    --amber: #f2c46d;
    --amber-soft: #3f3214;
    --focus: #c4b3f5;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--sans);
  font-kerning: normal;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--slate); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--plum-soft); }

h1, h2, h3 { font-family: var(--serif); font-style: italic; font-weight: 600; line-height: 1.12; margin: 0 0 0.5em; letter-spacing: -0.005em; }
h1 { font-size: clamp(2rem, 4.2vw, 2.8rem); font-weight: 700; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; max-width: var(--measure); }
small, .small { font-size: 0.875rem; }
.muted { color: var(--ink-soft); }
.lead { font-size: 1.2rem; line-height: 1.5; color: var(--ink-soft); max-width: 58ch; }
code, pre, .mono { font-family: var(--mono); font-size: 0.85em; }

.skip { position: absolute; left: -999px; top: 0; background: var(--plum); color: var(--on-plum); padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

.icon { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------------ barre du haut */
.topbar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.75rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand svg { width: 34px; height: 34px; }
.brand span { font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 1.3rem; }
.nav { display: flex; align-items: center; gap: 0.35rem 1.1rem; flex-wrap: wrap; }
.nav > a:not(.btn) { color: var(--ink); text-decoration: none; padding: 0.3rem 0; border-bottom: 2px solid transparent; }
.nav > a:not(.btn):hover { border-bottom-color: var(--line); }
.nav > a[aria-current="page"] { border-bottom-color: var(--plum); }

.bell { position: relative; display: inline-flex; padding: 0.35rem; color: var(--ink); border-radius: 999px; text-decoration: none; }
.bell:hover { background: var(--sea); }
.bell .icon { width: 1.35rem; height: 1.35rem; }
.bell .count {
  position: absolute; top: -0.1rem; right: -0.25rem; min-width: 1.15rem; height: 1.15rem; padding: 0 0.3rem;
  border-radius: 999px; background: var(--salmon); color: #fff; font-size: 0.72rem; font-weight: 700; line-height: 1.15rem; text-align: center;
}

.account-menu { position: relative; }
.account-menu summary { list-style: none; cursor: pointer; border-radius: 999px; }
.account-menu summary::-webkit-details-marker { display: none; }
.avatar {
  width: 2.1rem; height: 2.1rem; border-radius: 999px; display: grid; place-items: center; overflow: hidden;
  background: var(--plum-soft); color: var(--plum); font-weight: 700; border: 1px solid var(--line);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-menu .menu {
  position: absolute; right: 0; top: calc(100% + 0.5rem); z-index: 5; min-width: 13rem;
  background: var(--chart); border: 1px solid var(--line); border-radius: 10px; padding: 0.4rem;
  box-shadow: 0 10px 30px -12px rgb(10 30 45 / 0.35);
}
.account-menu .menu .who { padding: 0.45rem 0.7rem 0.35rem; color: var(--ink-soft); font-size: 0.9rem; }
.account-menu .menu a, .account-menu .menu button {
  display: block; width: 100%; text-align: left; padding: 0.5rem 0.7rem; border: 0; background: none; color: var(--ink);
  font: inherit; text-decoration: none; border-radius: 7px; cursor: pointer;
}
.account-menu .menu a:hover, .account-menu .menu button:hover { background: var(--sea); }

/* ------------------------------------------------------------------ mise en page */
main { flex: 1; width: 100%; }
.page { max-width: 1100px; margin: 0 auto; padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2.5rem) 4rem; }
.page-narrow { max-width: 560px; margin: 0 auto; padding: clamp(1.5rem, 5vw, 3.5rem) 1.25rem 4rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: 2rem; }
.page-head h1 { margin: 0; }
.page-head p { margin: 0.4rem 0 0; }
.crumb { display: inline-flex; gap: 0.35rem; align-items: center; color: var(--ink-soft); text-decoration: none; font-size: 0.95rem; margin-bottom: 0.6rem; }
.crumb:hover { color: var(--ink); }
.stack > * + * { margin-top: 1rem; }
.section { margin-top: 2.75rem; }
.section > h2 { margin-bottom: 1rem; }
.row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.panel { background: var(--chart); border: 1px solid var(--line); border-radius: var(--r-panel); padding: clamp(1.1rem, 3vw, 1.75rem); }
.panel + .panel { margin-top: 1.25rem; }
.panel h2:first-child, .panel h3:first-child { margin-top: 0; }

.footer {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between;
  padding: 1.5rem clamp(1rem, 4vw, 2.5rem); border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 0.9rem;
}
.footer a { color: var(--ink-soft); }

/* ------------------------------------------------------------------ messages */
.flash {
  max-width: 1100px; margin: 1rem auto 0; padding: 0.8rem 1.1rem; border-radius: 10px; border: 1px solid;
  width: calc(100% - 2 * clamp(1rem, 4vw, 2.5rem));
}
.flash-ok { background: var(--teal-soft); border-color: var(--teal); }
.flash-info { background: var(--slate-soft); border-color: var(--slate); }
.flash-erreur { background: var(--salmon-soft); border-color: var(--salmon); }
.alert { padding: 0.8rem 1rem; border-radius: 10px; border: 1px solid var(--salmon); background: var(--salmon-soft); margin-bottom: 1.25rem; }
.alert ul { margin: 0.25rem 0 0; padding-left: 1.2rem; }
.note { padding: 0.8rem 1rem; border-radius: 10px; background: var(--sea); }
.note-amber { background: var(--amber-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent); }

/* ------------------------------------------------------------------ boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  padding: 0.62rem 1.05rem; border-radius: var(--r-control); border: 1px solid transparent;
  font: 500 1rem/1.2 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.btn-primary { background: var(--plum); color: var(--on-plum); }
.btn-primary:hover { background: var(--plum-hover); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--ink-soft); }
.btn-secondary:hover { background: var(--sea); }
.btn-quiet { background: transparent; color: var(--slate); padding-inline: 0.4rem; }
.btn-quiet:hover { background: var(--slate-soft); }
.btn-danger { background: transparent; color: var(--salmon); border-color: var(--salmon); }
.btn-danger:hover { background: var(--salmon-soft); }
.btn-danger-solid { background: var(--salmon); color: #fff; }
.btn-small { padding: 0.4rem 0.75rem; font-size: 0.92rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.inline-form { display: inline; margin: 0; }

.provider-list { display: grid; gap: 0.6rem; }
.btn-provider { justify-content: flex-start; background: var(--chart); color: var(--ink); border-color: var(--line); padding: 0.7rem 1rem; }
.btn-provider:hover { border-color: var(--ink-soft); background: var(--chart); }
.btn-provider svg { width: 1.25rem; height: 1.25rem; }
.divider { display: flex; align-items: center; gap: 0.75rem; color: var(--ink-soft); font-size: 0.9rem; margin: 1.25rem 0; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }

/* ------------------------------------------------------------------ formulaires */
.field { display: grid; gap: 0.35rem; margin-bottom: 1.15rem; }
.field > label, .label { font-weight: 500; }
.hint { color: var(--ink-soft); font-size: 0.9rem; margin: 0; }
.error-text { color: var(--salmon); font-size: 0.92rem; margin: 0; font-weight: 500; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: var(--r-control);
  background: var(--chart); color: var(--ink); font: inherit; min-height: 2.75rem;
}
select { appearance: none; padding-right: 2.2rem; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 1.15rem) 1.15rem, calc(100% - 0.8rem) 1.15rem; background-size: 0.35rem 0.35rem; background-repeat: no-repeat; }
textarea { min-height: 9rem; resize: vertical; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-soft); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.invalid input, .invalid select, .invalid textarea, input.invalid { border-color: var(--salmon); }
input[type="number"] { font-variant-numeric: tabular-nums lining-nums; }
input[type="color"] { width: 3.2rem; height: 2.5rem; padding: 0.15rem; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--chart); cursor: pointer; }
.counter { justify-self: end; color: var(--ink-soft); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.counter.over { color: var(--salmon); font-weight: 700; }

.check { display: flex; gap: 0.6rem; align-items: flex-start; cursor: pointer; }
.check input { margin: 0.25rem 0 0; width: 1.1rem; height: 1.1rem; accent-color: var(--plum); flex: none; }

/* interrupteur Oui / Non */
.switch { position: relative; display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 2.75rem; height: 1.55rem; border-radius: 999px; background: var(--sea-deep); position: relative; transition: background-color 140ms ease; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 0.2rem; left: 0.2rem; width: 1.15rem; height: 1.15rem; border-radius: 999px; background: var(--chart); transition: transform 140ms ease; box-shadow: 0 1px 2px rgb(0 0 0 / 0.25); }
.switch input:checked + .track { background: var(--plum); }
.switch input:checked + .track::after { transform: translateX(1.2rem); }
.switch input:focus-visible + .track { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch .state { min-width: 2.6rem; color: var(--ink-soft); }

/* boutons radio en segments */
.segments { display: flex; flex-wrap: wrap; gap: 0.4rem; border: 0; padding: 0; margin: 0; }
.segments label { position: relative; cursor: pointer; }
.segments input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segments span { display: inline-block; padding: 0.42rem 0.85rem; border: 1px solid var(--line); border-radius: 999px; background: var(--chart); }
.segments label:hover span { border-color: var(--ink-soft); }
.segments input:checked + span { background: var(--plum-soft); border-color: var(--plum); color: var(--ink); font-weight: 500; }
.segments input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.45rem 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.15rem; }
.chip { border: 1px dashed var(--line); background: transparent; color: var(--ink-soft); border-radius: 999px; padding: 0.2rem 0.6rem; font: inherit; font-size: 0.85rem; cursor: pointer; }
.chip:hover { border-style: solid; color: var(--ink); }
.number-row { display: flex; align-items: center; gap: 0.6rem; }
.number-row input { max-width: 12rem; }
.unit { color: var(--ink-soft); }

.rules { list-style: none; padding: 0; margin: 0.25rem 0 0; display: grid; gap: 0.2rem; font-size: 0.9rem; color: var(--ink-soft); }
.rules li::before { content: "○"; display: inline-block; width: 1.2rem; color: var(--ink-soft); }
.rules li.ok { color: var(--teal); }
.rules li.ok::before { content: "●"; color: var(--teal); }

/* ------------------------------------------------------------------ pastilles de statut */
.status { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.18rem 0.65rem; border-radius: 999px; font-size: 0.85rem; font-weight: 500; white-space: nowrap; }
.status::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 999px; background: currentColor; }
.status-open { color: var(--slate); background: var(--slate-soft); }
.status-generating { color: var(--plum); background: var(--plum-soft); }
.status-generated { color: var(--teal); background: var(--teal-soft); }
.status-failed { color: var(--salmon); background: var(--salmon-soft); }
.status-pending { color: var(--amber); background: var(--amber-soft); }
.status-generating::before { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }

/* ------------------------------------------------------------------ îles (pastille de jeu) */
.isle { width: 1.6rem; height: 1.2rem; flex: none; color: var(--game); }
.isle path { fill: currentColor; }
.isle.isle-none { color: var(--sea-deep); }
.game-tag { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 500; }

/* ------------------------------------------------------------------ accueil */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5.5vw, 3.9rem); line-height: 1.02; margin-bottom: 0.35em; }
.hero .actions { margin-top: 1.75rem; }
.chart { width: 100%; height: auto; border-radius: 22px; background: var(--sea); }
.chart .contour { fill: none; stroke: var(--sea-deep); stroke-width: 1.4; }
.chart .land { stroke: var(--chart); stroke-width: 3; }
.chart .label { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 19px; fill: var(--ink); }
.chart .sub { font-family: var(--sans); font-size: 12.5px; fill: var(--ink-soft); }
.chart .route { fill: none; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 2 9; stroke-linecap: round; opacity: 0.55; animation: drift 2.8s linear infinite; }
.chart .item-progression { fill: var(--plum); }
.chart .item-useful { fill: var(--slate); }
.chart .item-filler { fill: var(--teal); }
.chart .item-trap { fill: var(--salmon); }
.chart .compass { fill: none; stroke: var(--ink-soft); stroke-width: 1.2; }
@keyframes drift { to { stroke-dashoffset: -44; } }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem 2.5rem; counter-reset: step; }
.steps li { counter-increment: step; padding-top: 0.25rem; border-top: 2px solid var(--ink); }
.steps li::before { content: counter(step); display: block; font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 2.4rem; line-height: 1; margin: 0.6rem 0 0.4rem; color: var(--plum); }
.steps h3 { font-style: normal; font-family: var(--sans); font-weight: 700; font-size: 1.1rem; margin-bottom: 0.35rem; }
.steps p { color: var(--ink-soft); margin: 0; }

/* légende des jeux, façon légende de carte */
.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2.5rem; }
.legend li { display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.9rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); align-items: start; }
.legend .isle { width: 2.6rem; height: 2rem; grid-row: span 2; margin-top: 0.15rem; }
.legend strong { font-family: var(--serif); font-style: italic; font-size: 1.3rem; font-weight: 600; }
.legend span { color: var(--ink-soft); }

/* ------------------------------------------------------------------ authentification */
.auth h1 { margin-bottom: 0.4rem; }
.auth .lead { font-size: 1.05rem; margin-bottom: 1.75rem; }
.auth .switch-link { margin-top: 1.5rem; color: var(--ink-soft); }
.auth form .btn-primary { margin-top: 0.4rem; }

/* ------------------------------------------------------------------ parties */
.party-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.party-list > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem 1.5rem; align-items: center; padding: 1.1rem 0.25rem; border-bottom: 1px solid var(--line); }
.party-list a.name { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 1.35rem; color: var(--ink); text-decoration: none; }
.party-list a.name:hover { text-decoration: underline; }
.party-list .meta { display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; color: var(--ink-soft); font-size: 0.95rem; margin-top: 0.25rem; }
.party-list .side { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; justify-content: flex-end; }

.invites-box { border: 1px solid var(--plum); background: var(--plum-soft); border-radius: var(--r-panel); padding: 1rem 1.25rem; margin-bottom: 2rem; }
.invites-box h2 { font-size: 1.25rem; margin-bottom: 0.6rem; }
.invites-box ul { list-style: none; margin: 0; padding: 0; }
.invites-box li { display: flex; gap: 0.5rem 1rem; align-items: center; flex-wrap: wrap; padding: 0.5rem 0; }
.invites-box li + li { border-top: 1px solid color-mix(in srgb, var(--plum) 30%, transparent); }

.empty { text-align: center; padding: 3rem 1rem; border: 1px dashed var(--line); border-radius: var(--r-panel); }
.empty p { margin-inline: auto; }

.party-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: end; margin-bottom: 1.75rem; }
.party-head h1 { margin: 0.2rem 0 0.35rem; }
.party-layout { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; gap: 2rem; align-items: start; }
.manifest { list-style: none; margin: 0; padding: 0; }
.manifest > li { display: grid; grid-template-columns: 2.3rem minmax(0, 1fr) auto; gap: 0.25rem 0.9rem; align-items: center; padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.manifest > li:last-child { border-bottom: 0; }
.manifest .who { font-weight: 700; }
.manifest .who small { font-weight: 400; color: var(--ink-soft); margin-left: 0.35rem; }
.manifest .detail { display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem; color: var(--ink-soft); font-size: 0.93rem; }
.manifest .actions { display: flex; gap: 0.25rem; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.manifest .avatar { width: 2.1rem; height: 2.1rem; font-size: 0.95rem; }
.manifest .avatar.pending { background: var(--amber-soft); color: var(--amber); }
.manifest .avatar.declined { background: var(--salmon-soft); color: var(--salmon); }
.slot { font-family: var(--mono); font-size: 0.85rem; background: var(--sea); padding: 0.05rem 0.4rem; border-radius: 5px; color: var(--ink); }
.ready { color: var(--teal); font-weight: 500; }
.todo { color: var(--amber); font-weight: 500; }

.side-panel h2 { font-size: 1.3rem; }
.side-panel + .side-panel { margin-top: 1.25rem; }
.blockers { margin: 0 0 1rem; padding-left: 1.1rem; color: var(--ink-soft); }
.blockers li + li { margin-top: 0.3rem; }
.progress { display: block; width: 100%; height: 0.55rem; margin: 0.6rem 0 1rem; border: 0; border-radius: 999px; background: var(--sea); overflow: hidden; appearance: none; }
.progress::-webkit-progress-bar { background: var(--sea); border-radius: 999px; }
.progress::-webkit-progress-value { background: var(--teal); border-radius: 999px; }
.progress::-moz-progress-bar { background: var(--teal); border-radius: 999px; }
.progress-label { display: flex; justify-content: space-between; font-size: 0.9rem; color: var(--ink-soft); }
.log { max-height: 22rem; overflow: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 0.75rem; white-space: pre-wrap; word-break: break-word; font-size: 0.78rem; line-height: 1.45; }
.seed { font-family: var(--mono); font-size: 0.85rem; word-break: break-all; }
.spinner { width: 1.1rem; height: 1.1rem; border-radius: 999px; border: 2px solid var(--plum-soft); border-top-color: var(--plum); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

details.danger { margin-top: 1.25rem; }
details.danger summary { cursor: pointer; color: var(--salmon); font-weight: 500; }
details.danger[open] summary { margin-bottom: 0.75rem; }

.invite-fields { display: grid; gap: 0.75rem; margin: 0.5rem 0 1rem; }
.invite-fields .field { margin: 0; grid-template-columns: 2rem minmax(0, 1fr); align-items: center; column-gap: 0.75rem; }
.invite-fields .field .num { font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 1.25rem; color: var(--ink-soft); text-align: right; }
.invite-fields .field .error-text, .invite-fields .field .hint { grid-column: 2; }
.me-row { display: grid; grid-template-columns: 2rem minmax(0, 1fr); column-gap: 0.75rem; align-items: center; color: var(--ink-soft); }
.me-row .num { font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 1.25rem; text-align: right; }
.count-row { display: flex; gap: 1rem 2rem; flex-wrap: wrap; align-items: flex-end; }
.count-row .field { margin: 0; }
.count-row input[type="number"] { width: 7rem; }

/* ------------------------------------------------------------------ questionnaire */
.game-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.25rem 1.1rem; align-items: center; margin-bottom: 2rem; }
.game-head .isle { width: 3.6rem; height: 2.8rem; grid-row: span 2; }
.game-head h1 { margin: 0; }
.game-head p { margin: 0; }

.game-choices { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.game-choices li { border-bottom: 1px solid var(--line); }
.game-choices a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.25rem 1.1rem; align-items: center; padding: 1.15rem 0.5rem; color: var(--ink); text-decoration: none; border-radius: 10px; }
.game-choices a:hover { background: var(--chart); }
.game-choices .isle { width: 3rem; height: 2.3rem; grid-row: span 2; }
.game-choices strong { font-family: var(--serif); font-style: italic; font-size: 1.4rem; font-weight: 600; }
.game-choices .desc { grid-column: 2; color: var(--ink-soft); max-width: 62ch; }
.game-choices .go { grid-row: 1 / span 2; grid-column: 3; color: var(--plum); font-weight: 500; }

.q-layout { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); gap: 2.25rem; align-items: start; }
.q-aside { position: sticky; top: 1rem; display: grid; gap: 1rem; }
.toc { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.3rem 0 0.3rem 0.85rem; margin-left: -2px; border-left: 2px solid transparent; color: var(--ink); text-decoration: none; font-size: 0.95rem; }
.toc a:hover { border-left-color: var(--ink-soft); }
.toc .changed { color: var(--plum); font-size: 0.8rem; font-weight: 700; }
.q-main { min-width: 0; }
.q-identity { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem 1.5rem; }
.q-identity .field { margin: 0; }
.group { background: var(--chart); border: 1px solid var(--line); border-radius: var(--r-panel); margin-top: 1rem; scroll-margin-top: 1rem; }
.group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.25rem; border-radius: var(--r-panel); }
.group > summary::-webkit-details-marker { display: none; }
.group > summary::after { content: ""; width: 0.55rem; height: 0.55rem; border-right: 2px solid var(--ink-soft); border-bottom: 2px solid var(--ink-soft); transform: rotate(45deg); margin-left: auto; transition: transform 140ms ease; }
.group[open] > summary::after { transform: rotate(-135deg); }
.group > summary h2 { margin: 0; font-size: 1.35rem; }
.group > summary .changed-count { color: var(--plum); font-size: 0.85rem; font-weight: 700; font-family: var(--sans); }
.group-body { padding: 0 1.25rem 0.5rem; }
.group-body > .hint { margin: -0.25rem 0 0.75rem; }
.opt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 0.4rem 1.75rem; padding: 1rem 0; border-top: 1px solid var(--line); align-items: start; }
.opt-label { display: grid; gap: 0.2rem; }
.opt-label label, .opt-label .label { font-weight: 700; }
.opt-label .hint { max-width: 52ch; }
.opt-meta { display: flex; gap: 0.6rem; align-items: center; font-size: 0.82rem; color: var(--ink-soft); }
.opt.changed .opt-meta .mark { color: var(--plum); font-weight: 700; }
.opt-control { display: grid; gap: 0.45rem; align-content: start; }
.choice-help { font-size: 0.9rem; color: var(--ink-soft); margin: 0; }
.radio-help { display: block; font-size: 0.85rem; color: var(--ink-soft); }
.opt.invalid .opt-label label { color: var(--salmon); }
.savebar {
  position: sticky; bottom: 0; z-index: 4; margin-top: 1.5rem; padding: 0.9rem 1.1rem; display: flex; gap: 0.75rem 1rem; align-items: center; flex-wrap: wrap;
  background: color-mix(in srgb, var(--chart) 92%, transparent); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: var(--r-panel);
}
.yaml { max-height: 26rem; overflow: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; font-size: 0.8rem; line-height: 1.5; white-space: pre; }
.preset-form { display: grid; gap: 0.5rem; }
.preset-form .row select { flex: 1; min-width: 0; }

/* ------------------------------------------------------------------ notifications */
.notif-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.notif-list li { border-bottom: 1px solid var(--line); }
.notif-list a, .notif-list .static { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) auto; gap: 0.15rem 0.9rem; padding: 0.95rem 0.5rem; color: var(--ink); text-decoration: none; align-items: start; }
.notif-list a:hover { background: var(--chart); }
.notif-list .ico { width: 2.2rem; height: 2.2rem; border-radius: 999px; display: grid; place-items: center; background: var(--sea); color: var(--ink-soft); grid-row: span 2; }
.notif-list .unread .ico { background: var(--plum-soft); color: var(--plum); }
.notif-list .unread .t { font-weight: 700; }
.notif-list .when { color: var(--ink-soft); font-size: 0.88rem; white-space: nowrap; }
.notif-list .b { grid-column: 2 / span 2; color: var(--ink-soft); font-size: 0.95rem; }

/* ------------------------------------------------------------------ administration */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--chart); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 700; color: var(--ink-soft); font-size: 0.88rem; background: var(--paper); }
tr:last-child td { border-bottom: 0; }
td .details { white-space: pre-line; color: var(--ink-soft); max-width: 48ch; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1.25rem; margin: 0; }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; }
.yes { color: var(--teal); font-weight: 500; }
.no { color: var(--salmon); font-weight: 500; }

/* ------------------------------------------------------------------ page d'erreur */
.error-page { text-align: center; padding: 5rem 1.25rem; }
.error-page .code { font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 5rem; line-height: 1; color: var(--sea-deep); }
.error-page p { margin-inline: auto; }

/* ------------------------------------------------------------------ adaptatif */
@media (max-width: 960px) {
  .party-layout, .q-layout { grid-template-columns: minmax(0, 1fr); }
  .q-aside { position: static; }
  .toc { display: none; }
}
@media (max-width: 820px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero .chart { order: -1; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .legend { grid-template-columns: minmax(0, 1fr); }
  .opt { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
  .q-identity { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .party-list > li { grid-template-columns: minmax(0, 1fr); }
  .party-list .side { justify-content: flex-start; }
  .party-head { grid-template-columns: minmax(0, 1fr); }
  .manifest > li { grid-template-columns: 2.3rem minmax(0, 1fr); }
  .manifest .actions { grid-column: 2; justify-content: flex-start; }
  .nav { gap: 0.35rem 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* logo */
.logo .l-sea { fill: var(--sea); stroke: var(--ink); stroke-width: 1.6; }
.logo .l-a { fill: var(--plum); }
.logo .l-b { fill: var(--teal); }
.logo .l-c { fill: var(--slate); }
.logo .l-route { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-dasharray: 1 2.6; stroke-linecap: round; }
.chart .land { fill: var(--game); }
.chart .islet { fill: var(--sea-deep); }
.legend-note { margin-top: 1rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small-title { font-size: 1.3rem; margin: 1.6rem 0 0.4rem; }
.form-actions { margin-top: 1.6rem; }
.preset-notes { list-style: none; margin: 0.35rem 0 0; padding: 0; display: grid; gap: 0.35rem; }
.legend-compact { grid-template-columns: minmax(0, 1fr); }
.legend-compact li { padding: 0.75rem 0; }
.legend-compact strong { font-size: 1.15rem; }
.legend-compact li:last-child { border-bottom: 0; }

.preset-values { max-width: 24rem; min-height: 2.4rem; padding-block: 0.35rem; font-size: 0.92rem; color: var(--ink-soft); }
.account-menu .menu .menu-extra { display: none; }
@media (max-width: 640px) {
  .nav > a.nav-extra { display: none; }
  .account-menu .menu .menu-extra { display: block; }
  .brand span { font-size: 1.15rem; }
}

/* Onglets du profil */
.subtabs { display: flex; gap: 1.25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; }
.subtabs a { padding: 0.5rem 0.1rem; color: var(--ink-soft); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtabs a:hover { color: var(--ink); }
.subtabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--plum); }
