/* =========================================================================
   AkarisuMD — style pixel art 2.5D, forêt chaleureuse 🍄
   ========================================================================= */

@font-face {
  font-family: "Londrina";
  src: url("../Fonts/Londrina_Solid/LondrinaSolid-Black.ttf") format("truetype");
  font-weight: 900;
  font-display: swap;
}

/* ---------- couleurs ---------- */
:root {
  --px: 4px;

  --bg: #f6e7c8;
  --bg-dot: #f0dcb6;
  --panel: #fdf3de;
  --panel-2: #f8e6c2;
  --ink: #3a2618;
  --ink-soft: #6b4f3a;
  --line: #4a2e1c;
  --depth: #c99a6a;

  --moss: #3f6b3a;
  --moss-2: #5b8a4a;
  --leaf: #9cc56b;
  --forest: #1f3a2b;
  --orange: #e8873a;
  --orange-2: #f2b05e;
  --orange-dk: #b85e2a;
  --cap: #8a5a3b;
  --berry: #c8553d;

  --btn: var(--orange);
  --btn-ink: #2b1709;
  --btn-depth: var(--orange-dk);
  --btn-alt: var(--leaf);
  --btn-alt-depth: var(--moss);

  --focus: #2f7f7a;
  --header-bg: rgba(253, 243, 222, 0.92);
  --footer-bg: #2c4f2e;
  --footer-ink: #f6e7c8;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #13211b;
  --bg-dot: #172820;
  --panel: #1d3328;
  --panel-2: #24402f;
  --ink: #f3e6cc;
  --ink-soft: #c4b394;
  --line: #0a140f;
  --depth: #0c1913;

  --moss: #6e9d5a;
  --moss-2: #86b56c;
  --leaf: #9cc56b;
  --forest: #0e1a14;
  --orange: #f09347;
  --orange-2: #ffb15e;
  --orange-dk: #a3501f;
  --cap: #b07a4f;

  --btn: var(--orange);
  --btn-ink: #1e1007;
  --btn-depth: #7a3a16;
  --btn-alt: #6e9d5a;
  --btn-alt-depth: #2f4f2a;

  --focus: #9cc56b;
  --header-bg: rgba(19, 33, 27, 0.92);
  --footer-bg: #0b1711;
  --footer-ink: #f3e6cc;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(45deg, var(--bg-dot) 25%, transparent 25%, transparent 75%, var(--bg-dot) 75%),
    linear-gradient(45deg, var(--bg-dot) 25%, transparent 25%, transparent 75%, var(--bg-dot) 75%);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
  color: var(--ink);
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .3s, color .3s;
}

h1, h2, h3, .pixel {
  font-family: "Nunito", system-ui, sans-serif;
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: .01em;
}
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
a { color: inherit; }
img, canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
canvas { image-rendering: pixelated; }

:focus-visible { outline: 3px dashed var(--focus); outline-offset: 4px; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--panel); padding: 8px 14px; border: 3px solid var(--line);
}
.skip-link:focus { top: 12px; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 32px; }
.section-head h2 { margin: 0; }
.kicker {
  display: inline-block; font-family: "Nunito", system-ui, sans-serif; font-size: .95rem;
  color: var(--orange-dk); text-transform: uppercase; letter-spacing: .12em; margin-bottom: 8px;
}
:root[data-theme="dark"] .kicker { color: var(--orange-2); }
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 60ch; }

/* ---------- blocs pixel 2.5D ---------- */
.panel {
  background: var(--panel);
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--line),
    0 var(--px) 0 0 var(--line),
    calc(var(--px) * -1) 0 0 0 var(--line),
    var(--px) 0 0 0 var(--line),
    0 calc(var(--px) * 3) 0 0 var(--depth),
    calc(var(--px) * -1) calc(var(--px) * 2) 0 0 var(--depth),
    var(--px) calc(var(--px) * 2) 0 0 var(--depth);
  margin: var(--px) var(--px) calc(var(--px) * 4);
}

/* ---------- boutons ---------- */
.btn {
  --b: var(--btn); --bd: var(--btn-depth);
  display: inline-flex; align-items: center; gap: .5em;
  font-family: "Nunito", system-ui, sans-serif; font-weight: 700; font-size: 1.05rem;
  color: var(--btn-ink); background: var(--b);
  border: 0; cursor: pointer; text-decoration: none;
  padding: 12px 22px;
  margin: var(--px) var(--px) calc(var(--px) * 2);
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--line),
    0 var(--px) 0 0 var(--line),
    calc(var(--px) * -1) 0 0 0 var(--line),
    var(--px) 0 0 0 var(--line),
    0 calc(var(--px) * 2) 0 0 var(--bd),
    inset 0 var(--px) 0 0 rgba(255, 255, 255, .35);
  transform: translateY(0);
  transition: transform .06s steps(1), box-shadow .06s steps(1), filter .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active, .btn.pressed {
  transform: translateY(var(--px));
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--line),
    0 var(--px) 0 0 var(--line),
    calc(var(--px) * -1) 0 0 0 var(--line),
    var(--px) 0 0 0 var(--line),
    0 var(--px) 0 0 var(--bd);
}
.btn-alt { --b: var(--btn-alt); --bd: var(--btn-alt-depth); }
.btn-ghost { --b: var(--panel); --bd: var(--depth); color: var(--ink); }
.btn-small { font-size: .95rem; padding: 8px 14px; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; }

/* ---------- en-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(6px);
  border-bottom: var(--px) solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand img { width: 36px; height: 38px; }
.brand-name { font-family: "Londrina", "Nunito", sans-serif; font-weight: 900; font-size: 1.6rem; letter-spacing: .02em; line-height: 1; }
.brand-name span { color: var(--orange); }

#site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
#site-nav a {
  display: block; padding: 8px 12px; text-decoration: none;
  font-family: "Nunito", system-ui, sans-serif; font-size: 1.05rem;
  border-radius: 0;
}
#site-nav a:hover { background: var(--panel-2); }
#site-nav a[aria-current="page"] {
  background: var(--orange); color: var(--btn-ink);
  box-shadow: 0 var(--px) 0 0 var(--orange-dk);
}

.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--panel); border: 0; cursor: pointer; color: var(--ink);
  box-shadow:
    0 -3px 0 0 var(--line), 0 3px 0 0 var(--line), -3px 0 0 0 var(--line), 3px 0 0 0 var(--line),
    0 6px 0 0 var(--depth);
  margin: 3px 3px 6px;
}
.icon-btn:active { transform: translateY(3px); box-shadow: 0 -3px 0 0 var(--line), 0 3px 0 0 var(--line), -3px 0 0 0 var(--line), 3px 0 0 0 var(--line); }
.icon-btn svg { width: 24px; height: 24px; shape-rendering: crispEdges; }
[data-theme-toggle] .moon { display: none; }
[data-theme-toggle][data-state="night"] .moon { display: block; }
[data-theme-toggle][data-state="night"] .sun { display: none; }
.nav-toggle { display: none; }
@media (min-width: 761px) and (max-width: 1180px) {
  #site-nav ul { gap: 0; }
  #site-nav a { padding: 8px 7px; font-size: .95rem; }
}
@media (min-width: 761px) and (max-width: 940px) {
  .brand-name { display: none; }
  #site-nav a { padding: 6px 4px; font-size: .84rem; }
}

@media (max-width: 760px) {
  .nav-toggle { display: grid; }
  #site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--panel); border-bottom: var(--px) solid var(--line);
    display: none;
  }
  #site-nav.open { display: block; }
  #site-nav ul { flex-direction: column; padding: 8px 16px 16px; }
  #site-nav a { padding: 12px; font-size: 1.2rem; }
  .brand-name { font-size: 1.35rem; }
}

/* ---------- héro avec la scène ---------- */
.hero { position: relative; overflow: hidden; border-bottom: var(--px) solid var(--line); background: var(--forest); }
.pixel-scene { display: block; width: 100%; height: 100%; cursor: crosshair; }
.hero .pixel-scene { height: clamp(460px, 78vh, 760px); }
.hero-content {
  position: absolute; inset: auto 0 clamp(28px, 7vh, 72px) 0;
  pointer-events: none;
}
.hero-card { pointer-events: auto; max-width: 560px; padding: 28px 28px 20px; }
.hero-card h1 { margin-bottom: .2em; }
.hero-card .hello { font-family: "Nunito", system-ui, sans-serif; color: var(--moss); font-size: 1.1rem; margin-bottom: .4em; }
:root[data-theme="dark"] .hero-card .hello { color: var(--leaf); }
.wordmark { font-family: "Londrina", "Nunito", sans-serif; font-weight: 900; font-size: clamp(2.6rem, 7vw, 4.4rem); line-height: .95; letter-spacing: .01em; }
.wordmark span { color: var(--orange); }
.hero-hint {
  position: absolute; right: 16px; bottom: 14px; margin: 0;
  font-family: "Nunito", system-ui, sans-serif; font-size: .85rem; color: #fdf3de;
  background: rgba(20, 30, 22, .55); padding: 4px 10px; pointer-events: none;
}
@media (max-width: 640px) {
  .hero .pixel-scene { height: 420px; }
  .hero-content { position: relative; inset: auto; margin-top: -90px; padding-bottom: 28px; }
  .hero-card { padding: 22px 20px 14px; }
  .hero-hint { display: none; }
}

/* bannière des pages internes */
.page-banner { position: relative; border-bottom: var(--px) solid var(--line); background: var(--forest); }
.page-banner .pixel-scene { height: clamp(180px, 28vh, 260px); }
.page-banner .banner-title {
  position: absolute; left: 0; right: 0; bottom: 18px; pointer-events: none;
}
.page-banner .banner-title .panel { display: inline-block; padding: 10px 22px 6px; pointer-events: auto; }
.page-banner h1 { margin: 0; }

/* ---------- jeu à la une ---------- */
.featured { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 40px; align-items: center; }
@media (max-width: 900px) { .featured { grid-template-columns: 1fr; } }

.cabinet {
  background: linear-gradient(#7a4a2c, #6b4430);
  padding: 18px 18px 14px;
  box-shadow:
    0 -4px 0 0 var(--line), 0 4px 0 0 var(--line), -4px 0 0 0 var(--line), 4px 0 0 0 var(--line),
    0 16px 0 0 #3e2718, -4px 12px 0 0 #3e2718, 4px 12px 0 0 #3e2718;
  margin: 4px 4px 20px;
  position: relative;
}
.cabinet::before { /* veinure du bois */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .18;
  background: repeating-linear-gradient(0deg, transparent 0 10px, #2b170c 10px 12px, transparent 12px 26px);
}
.cabinet-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; color: #fdf3de; }
.cabinet-top .pixel { margin: 0; font-size: 1rem; letter-spacing: .08em; text-transform: uppercase; }
.leds { display: flex; gap: 6px; }
.leds i { width: 10px; height: 10px; background: #9cc56b; box-shadow: 0 0 0 2px #2b170c; }
.leds i:nth-child(2) { background: var(--orange-2); }
.leds i:nth-child(3) { background: var(--berry); animation: blink 1.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .leds i { animation: none !important; } }

.screen {
  position: relative; width: 100%; aspect-ratio: 16 / 10; background: #0d1410; overflow: hidden;
  box-shadow: 0 0 0 4px #2b170c, inset 0 0 0 4px rgba(0,0,0,.4);
}
.screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.screen-cover { position: absolute; inset: 0; display: grid; place-items: end center; padding-bottom: 8%; }
.screen-cover canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.screen-cover::after { /* scanlines */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.14) 0 2px, transparent 2px 4px);
}
.screen-cover .btn { position: relative; z-index: 2; font-size: 1.2rem; }
.cabinet-bottom { position: relative; display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 10px; }
.cabinet-bottom .btn { margin: 4px 4px 8px; }
.dpad { display: flex; gap: 10px; }
.dpad i { width: 22px; height: 22px; background: #2b170c; display: block; }
.dpad i:nth-child(1) { background: var(--berry); box-shadow: inset 0 -4px 0 #7d2e20; border-radius: 50%; }
.dpad i:nth-child(2) { background: var(--orange-2); box-shadow: inset 0 -4px 0 var(--orange-dk); border-radius: 50%; }

.featured-note { font-size: .9rem; color: var(--ink-soft); border-left: 4px solid var(--orange); padding-left: 12px; }

/* ---------- ce que je fais ---------- */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px; }
.skill { padding: 26px 24px 18px; }
.skill .glyph { width: 48px; height: 48px; margin-bottom: 14px; display: block; }
.skill h3 { margin-bottom: .35em; }
.skill p { color: var(--ink-soft); margin-bottom: .5em; }

/* ---------- cartes projets ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 32px 28px; }
.card {
  display: flex; flex-direction: column;
  background: var(--panel);
  box-shadow:
    0 -4px 0 0 var(--line), 0 4px 0 0 var(--line), -4px 0 0 0 var(--line), 4px 0 0 0 var(--line),
    0 12px 0 0 var(--depth), -4px 8px 0 0 var(--depth), 4px 8px 0 0 var(--depth);
  margin: 4px 4px 16px;
  transition: transform .12s steps(2);
}
.card:hover { transform: translateY(-4px); }
@media (prefers-reduced-motion: reduce) { .card, .card:hover { transition: none; transform: none; } }
.card-media { position: relative; aspect-ratio: 315 / 250; background: var(--panel-2); border-bottom: 4px solid var(--line); overflow: hidden; }
.card-media canvas, .card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge {
  position: absolute; top: 10px; left: 10px;
  font-family: "Nunito", system-ui, sans-serif; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
  padding: 3px 8px; background: var(--panel); color: var(--ink); box-shadow: 0 0 0 3px var(--line);
}
.badge-plugin { background: #7fd1c7; color: #11302d; }
.card-body { padding: 18px 18px 12px; display: flex; flex-direction: column; flex: 1; }
.card-title { margin-bottom: .15em; font-size: 1.4rem; }
.card-meta { font-size: .9rem; color: var(--ink-soft); margin-bottom: .6em; }
.card-text { flex: 1; }
.tags { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: .82rem; padding: 2px 8px; background: var(--panel-2); color: var(--ink-soft); }
.card .btn { align-self: flex-start; }
.soon {
  align-self: flex-start; font-weight: 800; font-size: .9rem; padding: 6px 12px;
  color: var(--ink-soft); border: 3px dashed var(--depth); margin: 4px 0 8px;
}

/* ---------- bibliothèque ---------- */
.library-tools { display: grid; gap: 16px; margin-bottom: 36px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font: inherit; font-family: "Nunito", system-ui, sans-serif; font-size: 1rem; cursor: pointer;
  padding: 6px 14px; background: var(--panel); color: var(--ink); border: 0;
  box-shadow: 0 0 0 3px var(--line), 0 6px 0 0 var(--depth);
  margin: 3px 3px 8px;
}
.chip[aria-pressed="true"] { background: var(--orange); color: var(--btn-ink); box-shadow: 0 0 0 3px var(--line), 0 3px 0 0 var(--orange-dk); transform: translateY(3px); }
.chip-tag { font-size: .9rem; padding: 4px 10px; }
.chip-tag[aria-pressed="true"] { background: var(--leaf); box-shadow: 0 0 0 3px var(--line), 0 3px 0 0 var(--moss); color: #15260f; }
.chip-n { opacity: .65; font-size: .85em; }
.search-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.search {
  flex: 1 1 260px; max-width: 420px;
  font: inherit; padding: 10px 14px; color: var(--ink); background: var(--panel);
  border: 0; box-shadow: 0 0 0 3px var(--line), inset 0 4px 0 rgba(0,0,0,.08);
  margin: 3px;
}
.count { font-family: "Nunito", system-ui, sans-serif; color: var(--ink-soft); }
.empty { grid-column: 1 / -1; text-align: center; padding: 40px 16px; }
.empty img { margin: 0 auto 12px; display: block; }

/* ---------- bio ---------- */
.bio { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; align-items: start; }
@media (max-width: 760px) { .bio { grid-template-columns: 1fr; gap: 28px; } }
.avatar { padding: 20px; text-align: center; }
.avatar img { width: 144px; height: auto; display: block; margin: 8px auto 12px; }
.avatar .pixel { font-size: 1.3rem; margin: 0; }
.avatar p { color: var(--ink-soft); font-size: .95rem; margin: 0; }
.bio-text { max-width: 66ch; }
.facts { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 10px; }
.facts li { display: flex; gap: 12px; align-items: baseline; }
.facts li::before { content: ""; width: 10px; height: 10px; background: var(--orange); flex: none; transform: translateY(-1px); box-shadow: 3px 3px 0 var(--orange-dk); }
.tools { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 24px; }
.tools li { font-family: "Nunito", system-ui, sans-serif; padding: 4px 12px; background: var(--panel); box-shadow: 0 0 0 3px var(--line), 0 6px 0 var(--depth); margin: 3px 3px 8px; }

/* ---------- contact ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; align-items: start; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }
.form { padding: 28px 26px 20px; }
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field label { font-family: "Nunito", system-ui, sans-serif; font-size: 1.05rem; }
.field input, .field textarea, .field select {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 0; padding: 12px 14px; width: 100%;
  box-shadow: 0 0 0 3px var(--line), inset 0 4px 0 rgba(0,0,0,.08);
  margin: 3px 0;
}
.field textarea { min-height: 160px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.hp { position: absolute !important; left: -9999px !important; }
.form-status { min-height: 1.6em; margin: 8px 0 0; font-weight: 700; }
.form-status[data-kind="ok"] { color: var(--moss); }
.form-status[data-kind="err"] { color: var(--berry); }
:root[data-theme="dark"] .form-status[data-kind="ok"] { color: var(--leaf); }
:root[data-theme="dark"] .form-status[data-kind="err"] { color: #ff9a7a; }
.side { padding: 26px 24px 18px; }
.links { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 10px; }
.link-chip {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  font-family: "Nunito", system-ui, sans-serif; font-size: 1.05rem; padding: 6px 4px;
  word-break: break-all;
}
.link-chip:hover { color: var(--orange-dk); }
:root[data-theme="dark"] .link-chip:hover { color: var(--orange-2); }
.link-dot { width: 12px; height: 12px; background: var(--orange); box-shadow: 3px 3px 0 var(--line); flex: none; }
.link-itch .link-dot { background: #fa5c5c; }
.link-github .link-dot { background: var(--ink); }
.link-linkedin .link-dot { background: #3a8fd6; }
.link-mail .link-dot { background: var(--leaf); }

/* ---------- bandeau contact (accueil) ---------- */
.cta { padding: 34px 30px 26px; display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; justify-content: space-between; }
.cta h2 { margin-bottom: .2em; }
.cta p { margin: 0; color: var(--ink-soft); }

/* ---------- pied de page ---------- */
.site-footer { position: relative; margin-top: 40px; background: var(--footer-bg); color: var(--footer-ink); padding: 44px 0 28px; }
.site-footer::before { /* herbe pixel */
  content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px;
  background:
    linear-gradient(90deg, var(--footer-bg) 0 4px, transparent 4px 8px, var(--footer-bg) 8px 16px, transparent 16px 20px, var(--footer-bg) 20px 24px, transparent 24px 32px) 0 4px / 32px 8px repeat-x,
    linear-gradient(90deg, transparent 0 8px, var(--footer-bg) 8px 12px, transparent 12px 32px) 0 0 / 32px 4px repeat-x;
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; align-items: center; }
.site-footer a { color: var(--footer-ink); }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; }
.site-footer .link-dot { box-shadow: 3px 3px 0 rgba(0,0,0,.35); }
.footer-small { font-size: .9rem; opacity: .8; margin: 0; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand img { width: 36px; height: 38px; }

/* ---------- divers ---------- */
.mushroom-divider { display: flex; justify-content: center; gap: 18px; padding: 8px 0; opacity: .9; }
.mushroom-divider svg { width: 28px; height: 28px; shape-rendering: crispEdges; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- lecteur de jeu (fenêtre) ---------- */
.player {
  --ratio: 1.6;
  border: 0; padding: 0; background: transparent; color: inherit;
  width: min(1100px, calc(100vw - 32px), calc((100vh - 200px) * var(--ratio)));
  max-width: none; max-height: none; overflow: visible;
}
.player::backdrop { background: rgba(10, 20, 14, .82); }
.player .cabinet { margin: 0; }
.player .screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player .cabinet-top .pixel { font-size: 1.15rem; text-transform: none; letter-spacing: 0; }
.player-close { width: 38px; height: 38px; margin: 3px 3px 6px; }
.player-close svg { width: 18px; height: 18px; }
.player [hidden] { display: none; }

.badge-play { left: auto; right: 10px; background: var(--leaf); color: #15260f; }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.text-link { font-weight: 700; font-size: .95rem; }
.card-role { color: var(--moss); font-weight: 700; }
:root[data-theme="dark"] .card-role { color: var(--leaf); }

/* jaquettes réelles : rendu lissé (ce sont des illustrations) */
.card-media img, .screen-img { image-rendering: auto; }
.screen-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.75); }

.cabinet-help { color: #fdf3de; font-weight: 700; font-size: .92rem; margin-right: auto; padding: 0 12px; }
.cabinet-help:hover { color: var(--orange-2); }
.cabinet-help[hidden] { display: none; }

/* ---------- classement ---------- */
.leaderboard {
  background: var(--panel); padding: 16px 18px 10px; margin: 20px 4px 24px;
  box-shadow: 0 -4px 0 0 var(--line), 0 4px 0 0 var(--line), -4px 0 0 0 var(--line), 4px 0 0 0 var(--line), 0 10px 0 0 var(--depth);
}
.leaderboard[hidden] { display: none; }
.lb-title { font-size: 1.1rem; margin: 0 0 10px; }
.lb-state { color: var(--ink-soft); margin: 0 0 8px; font-size: .95rem; }
.lb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.lb-row { display: grid; grid-template-columns: 2.2em 1fr auto; gap: 10px; align-items: center; padding: 6px 8px; background: var(--panel-2); }
.lb-rank { font-weight: 900; text-align: center; }
.lb-player { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-weight: 800; font-variant-numeric: tabular-nums; }
.lb-top1 .lb-rank { color: #c99a00; }
.lb-top2 .lb-rank { color: #8a8f98; }
.lb-top3 .lb-rank { color: #b0673a; }
:root[data-theme="dark"] .lb-top1 .lb-rank { color: #ffd36b; }
:root[data-theme="dark"] .lb-top2 .lb-rank { color: #c9ced6; }

/* ---------- fiche projet ---------- */
.project-page { padding-top: 32px; }
.crumbs { margin: 0 0 20px; font-weight: 700; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.card-title a { text-decoration: none; }
.card-title a:hover { text-decoration: underline; }

.project-head { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 40px; align-items: center; margin-bottom: 48px; }
@media (max-width: 820px) { .project-head { grid-template-columns: 1fr; gap: 24px; } }
.project-cover { padding: 0; overflow: hidden; aspect-ratio: 315 / 250; }
.project-cover img, .project-cover canvas { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.project-cover canvas { image-rendering: pixelated; }
.project-intro h1 { margin: .1em 0 .3em; }
.project-intro .lead { margin-bottom: .8em; }
.project-credit { margin: 0 0 6px; color: var(--ink-soft); font-size: .98rem; }
.project-intro .tags { margin: 14px 0 18px; }

.section-title { font-size: 1.35rem; margin: 0 0 16px; }
.project-gallery, .project-videos { margin-bottom: 44px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.shot {
  display: block; padding: 0; border: 0; cursor: zoom-in; background: var(--panel-2); aspect-ratio: 16 / 10; overflow: hidden;
  box-shadow: 0 0 0 4px var(--line), 0 8px 0 0 var(--depth); margin: 4px 4px 12px;
}
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; image-rendering: auto; transition: transform .2s; }
.shot:hover img { transform: scale(1.04); }
@media (prefers-reduced-motion: reduce) { .shot img { transition: none; } .shot:hover img { transform: none; } }

.videos { display: grid; gap: 20px; }
.video { position: relative; aspect-ratio: 16 / 9; background: #000; box-shadow: 0 0 0 4px var(--line), 0 8px 0 0 var(--depth); margin: 4px 4px 12px; max-width: 900px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-play { position: absolute; inset: 0; border: 0; padding: 0; cursor: pointer; background: #000; }
.video-play img { width: 100%; height: 100%; object-fit: cover; opacity: .85; image-rendering: auto; }
.video-play span {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 76px; height: 54px; display: grid; place-items: center; font-size: 1.6rem; color: #fff;
  background: var(--orange-dk); box-shadow: 0 0 0 4px var(--line), 0 6px 0 0 #000;
}
.video-play:hover span { background: var(--orange); }

.project-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 36px; align-items: start; margin-bottom: 48px; }
@media (max-width: 900px) { .project-body { grid-template-columns: 1fr; } }
.project-desc { padding: 26px 28px 18px; }
.project-side { display: grid; gap: 8px; }
.side-block { padding: 22px 22px 14px; }
.side-note { font-size: .88rem; color: var(--ink-soft); margin: 8px 0 0; }
.project-side .leaderboard { margin-top: 4px; }

.rich { overflow-wrap: anywhere; }
.rich h1, .rich h2, .rich h3, .rich h4, .rich h5, .rich h6 { font-size: 1.15rem; margin: 1.2em 0 .5em; }
.rich h1, .rich h2 { font-size: 1.3rem; }
.rich > :first-child { margin-top: 0; }
.rich img { max-width: 100%; height: auto; display: block; margin: 12px 0; image-rendering: auto; }
.rich ul, .rich ol { padding-left: 1.4em; }
.rich a { color: var(--orange-dk); font-weight: 700; }
:root[data-theme="dark"] .rich a { color: var(--orange-2); }
.rich blockquote { margin: 1em 0; padding: 8px 16px; border-left: 4px solid var(--orange); background: var(--panel-2); }
.rich hr { border: 0; border-top: 3px dashed var(--depth); margin: 1.5em 0; }
.rich table { border-collapse: collapse; }
.rich td, .rich th { border: 2px solid var(--depth); padding: 4px 8px; }
.rich .video { margin: 16px 4px; }

.info { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; font-size: .95rem; }
.info dt { font-weight: 800; color: var(--ink-soft); }
.info dd { margin: 0; overflow-wrap: anywhere; }
.files { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.files li { display: grid; gap: 2px; padding: 8px 10px; background: var(--panel-2); }
.file-name { font-weight: 700; overflow-wrap: anywhere; }
.file-meta { font-size: .85rem; color: var(--ink-soft); }

.project-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.project-nav a {
  display: grid; gap: 2px; text-decoration: none; padding: 16px 20px; background: var(--panel);
  box-shadow: 0 0 0 4px var(--line), 0 10px 0 0 var(--depth); margin: 4px 4px 14px;
}
.project-nav a:hover strong { text-decoration: underline; }
.project-nav span { font-size: .9rem; color: var(--ink-soft); font-weight: 700; }
.project-nav strong { font-size: 1.15rem; }
.nav-next { text-align: right; }
@media (max-width: 560px) { .project-nav { grid-template-columns: 1fr; } .nav-next { text-align: left; } }

.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; overflow: hidden; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(10, 20, 14, .9); }
.lightbox img { max-width: calc(100vw - 140px); max-height: calc(100vh - 100px); object-fit: contain; image-rendering: auto; box-shadow: 0 0 0 4px var(--line); }
.lightbox .icon-btn { position: fixed; font-size: 1.6rem; font-weight: 900; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox .icon-btn[hidden] { display: none; }
.lb-count { position: fixed; bottom: 12px; left: 0; right: 0; text-align: center; color: #fdf3de; font-weight: 700; margin: 0; }
@media (max-width: 640px) { .lightbox img { max-width: calc(100vw - 24px); } .lb-prev, .lb-next { top: auto; bottom: 12px; transform: none; } }
@media (max-width: 560px) { .gallery { grid-template-columns: 1fr 1fr; gap: 10px; } .shot { margin: 3px 3px 8px; } }

/* ---------- mini jeu : Écureuil Survivor ---------- */
.game-section { padding-top: clamp(24px, 4vw, 48px); }
.game-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
.game-head h1 { margin: 0; }
.game-head .btn { white-space: nowrap; }
@media (hover: none) and (pointer: coarse) { .ctrl-desk { display: none; } }
.game-stage {
  position: relative; overflow: hidden;
  height: min(72vh, 640px); min-height: 380px;
  background: #1f3a2b;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--line), 0 var(--px) 0 0 var(--line),
    calc(var(--px) * -1) 0 0 0 var(--line), var(--px) 0 0 0 var(--line),
    0 calc(var(--px) * 3) 0 0 var(--depth);
  margin: var(--px) var(--px) calc(var(--px) * 4);
}
.game-stage:fullscreen, .game-stage.is-max { height: 100%; min-height: 0; margin: 0; box-shadow: none; }
.game-stage.is-max { position: fixed; inset: 0; z-index: 200; height: 100dvh; }
.game-canvas { position: absolute; left: 0; top: 0; display: block; outline: none; cursor: crosshair; }


.game-hud { position: absolute; inset: 0 0 auto; padding: 8px 10px; pointer-events: none; color: #fdf3de; font-weight: 800; text-shadow: 0 2px 0 #2b1709; }
.game-hud[hidden] { display: none; }
.game-stage:fullscreen .game-hud .hud-exit, .game-stage.is-max .game-hud .hud-exit { display: grid; }
.hud-xp { position: relative; height: 16px; background: #2b1709; border: 2px solid #2b1709; margin-bottom: 6px; }
.hud-xp i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(#f6d36b, #e0a82a); transition: width .15s; }
.hud-xp span { position: absolute; inset: 0; display: grid; place-items: center; font-size: .8rem; line-height: 1; }
.hud-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hud-pill { background: rgba(43, 23, 9, .7); padding: 2px 8px; font-size: .9rem; font-variant-numeric: tabular-nums; }
.hud-build { display: flex; flex-wrap: wrap; gap: 4px; margin-right: auto; }
.hud-build span { display: inline-flex; align-items: center; gap: 2px; background: rgba(43, 23, 9, .55); padding: 1px 5px 1px 3px; font-size: .75rem; }
.hud-build img { width: 18px; height: 18px; object-fit: contain; }
.hud-build i { font-style: normal; font-size: .85rem; }
.hud-btn {
  pointer-events: auto; width: 34px; height: 34px; display: grid; place-items: center; font-size: 1rem;
  background: rgba(43, 23, 9, .7); color: #fdf3de; border: 2px solid #2b1709; cursor: pointer;
}
.hud-btn:hover { background: rgba(43, 23, 9, .9); }
.game-hud .hud-exit { display: none; }
.hud-boss { margin: 8px auto 0; max-width: 360px; text-align: center; font-size: .85rem; }
.hud-boss[hidden] { display: none; }
.hud-boss div { height: 10px; background: #2b1709; border: 2px solid #2b1709; }
.hud-boss i { display: block; height: 100%; width: 100%; background: #c8553d; transition: width .1s; }

.game-banner {
  position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%); margin: 0;
  font-family: "Londrina", "Nunito", sans-serif; font-size: clamp(1.6rem, 4vw, 2.6rem); color: #f6d36b;
  text-shadow: 0 3px 0 #2b1709, 3px 0 0 #2b1709, -3px 0 0 #2b1709, 0 -3px 0 #2b1709;
  pointer-events: none; white-space: nowrap;
}
.game-banner[hidden] { display: none; }
.game-banner.show { animation: banner-pop 2.6s steps(12) forwards; }
@keyframes banner-pop { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.8); } 10%, 80% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; } }

.game-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(20, 30, 20, .45); overflow-y: auto; }
.game-overlay[hidden] { display: none; }
.game-card { width: min(460px, 100%); padding: 22px 22px 18px; text-align: center; }
.game-card-wide { width: min(720px, 100%); }
.game-card h2 { margin-bottom: .4em; }
.game-card p { color: var(--ink-soft); }
.game-small { font-size: .9rem; color: var(--ink-soft); margin: 8px 0 0; }
.game-controls { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; font-size: .95rem; }
kbd {
  display: inline-block; min-width: 1.6em; padding: 0 5px; margin: 0 1px;
  font: 800 .85rem/1.6 "Nunito", sans-serif; text-align: center;
  background: var(--panel-2); border: 2px solid var(--line); box-shadow: 0 2px 0 var(--line);
}

.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.choice {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 14px 10px 12px; background: var(--panel-2); color: var(--ink); cursor: pointer;
  border: var(--px) solid var(--line); box-shadow: 0 var(--px) 0 var(--depth); font: inherit;
  transition: transform .08s steps(2);
}
.choice:hover, .choice:focus-visible { transform: translateY(-3px); background: var(--panel); border-color: var(--orange-dk); }
.choice-key { position: absolute; top: 4px; left: 8px; font-weight: 900; font-size: .8rem; color: var(--ink-soft); }
.choice-icon { width: 56px; height: 56px; display: grid; place-items: center; background: #1f3a2b; border: 3px solid var(--line); }
.choice-icon img { width: 44px; height: 44px; object-fit: contain; }
.choice-icon .emoji { font-size: 1.8rem; }
.choice-text { display: grid; gap: 2px; font-size: .92rem; line-height: 1.3; }
.choice-text strong { font-size: 1.02rem; }
.choice-text em { font-style: normal; font-weight: 800; color: var(--orange-dk); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
:root[data-theme="dark"] .choice-text em { color: var(--orange-2); }
.choice-text span { color: var(--ink-soft); }

.over-stats { list-style: none; padding: 0; margin: 8px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.over-stats li { background: var(--panel-2); padding: 6px; display: grid; }
.over-stats span { font-size: .8rem; color: var(--ink-soft); }
.over-stats strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.over-stats .total { grid-column: 1 / -1; background: var(--orange); color: var(--btn-ink); }
.over-stats .total span { color: inherit; }
.submit-score { margin: 12px 0; text-align: left; }
.submit-score[hidden] { display: none; }
.submit-score label { font-weight: 700; font-size: .9rem; }
.submit-row { display: flex; gap: 8px; align-items: center; }
.submit-row input { flex: 1; min-width: 0; font: inherit; padding: 8px 10px; background: var(--panel); color: var(--ink); border: 3px solid var(--line); }

.game-info { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; margin-top: 24px; align-items: start; }
.game-help, .game-lb { padding: 20px 22px; }
.game-help ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.game-lb .leaderboard { margin: 0; padding: 0; background: none; box-shadow: none; }

@media (max-width: 760px) {
  .game-stage { height: calc(100svh - 110px); min-height: 360px; margin-inline: 0; }
  .game-head { flex-wrap: nowrap; align-items: center; margin-bottom: 10px; }
  .game-head h1 { font-size: 1.6rem; }
  .game-head .btn { font-size: .85rem; padding: 6px 10px; }
  .game-head .kicker { display: none; }
  .game-info { grid-template-columns: 1fr; }
  .choices { grid-template-columns: 1fr; gap: 8px; }
  .choice { flex-direction: row; text-align: left; padding: 10px 12px; }
  .choice-key { display: none; }
  .choice-icon { width: 46px; height: 46px; flex: none; }
  .choice-icon img { width: 36px; height: 36px; }
  .game-card { padding: 16px 14px 12px; }
  .game-controls { font-size: .88rem; }
}

/* --- Écureuil Survivor : menus, boutique, succès --- */
.game-overlay { align-items: start; }
.game-overlay > .game-card { margin: auto; }
.game-card-chars, .game-card-shop, .game-card-succes, .game-card-levelup, .game-card-pause, .game-card-help, .game-card-over { width: min(760px, 100%); }
.game-card-help { text-align: left; }
.btn-row.center { justify-content: center; margin-top: 12px; }
.gold-ic { width: 1em; height: 1em; vertical-align: -.12em; image-rendering: pixelated; }
.hud-pill .gold-ic { width: 14px; height: 14px; }
.gold-badge { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 4px 12px; background: var(--panel-2); font-weight: 800; color: var(--ink) !important; }
.gold-badge .gold-ic { width: 18px; height: 18px; }

.menu-title { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 8px; text-align: left; }
.menu-title img { width: 64px; height: auto; image-rendering: pixelated; }
.menu-title h2 { margin: 0; }
.menu-title .kicker { margin-bottom: 2px; }
.menu-buttons { display: grid; gap: 4px; margin: 14px auto 6px; max-width: 320px; }
.menu-buttons > .btn { justify-content: center; font-size: 1.15rem; }
.menu-buttons small { font-size: .8rem; opacity: .75; }
.menu-row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }

.screen-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 10px; }
.screen-head h2 { margin: 0; flex: 1; text-align: center; }

.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; text-align: left; }
.char-card { position: relative; padding: 10px; background: var(--panel-2); border: var(--px) solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.char-card.is-selected { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange); }
.char-card.is-locked { opacity: .85; }
.char-card.is-locked .char-portrait img { filter: brightness(0) opacity(.45); }
.char-pick { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.char-pick[disabled] { cursor: default; }
.char-portrait { position: relative; flex: none; width: 60px; height: 52px; display: grid; place-items: center; background: #1f3a2b; border: 3px solid var(--line); }
.char-portrait img { width: 48px; height: auto; image-rendering: pixelated; }
.char-portrait i { position: absolute; font-style: normal; font-size: 1.3rem; }
.char-name { display: grid; line-height: 1.2; }
.char-name strong { font-size: 1.1rem; }
.char-name small { color: var(--ink-soft); }
.char-desc, .char-tags, .char-weapon, .char-lock { margin: 0; font-size: .86rem; line-height: 1.35; color: var(--ink-soft) !important; }
.char-weapon { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink) !important; }
.char-weapon img { width: 18px; height: 18px; image-rendering: pixelated; }
.char-tags { font-weight: 700; }
.char-lock { color: var(--orange-dk) !important; font-weight: 700; }
:root[data-theme="dark"] .char-lock { color: var(--orange-2) !important; }
.char-card .btn { align-self: flex-start; margin-top: 4px; }
.diff-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 14px 0 0; font-weight: 700; }
.chip { font: inherit; font-weight: 800; font-size: .9rem; padding: 4px 12px; cursor: pointer; background: var(--panel-2); color: var(--ink); border: 3px solid var(--line); }
.chip.is-on { background: var(--orange); color: var(--btn-ink); }
.chip[disabled] { opacity: .6; cursor: not-allowed; }

.shop-list, .ach-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; text-align: left; margin-top: 8px; }
.shop-item, .ach { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--panel-2); border: 3px solid var(--line); }
.shop-item.is-locked, .ach:not(.is-done) { opacity: .75; }
.shop-ic, .ach-ic { flex: none; width: 40px; height: 40px; display: grid; place-items: center; font-size: 1.4rem; background: #1f3a2b; border: 3px solid var(--line); }
.shop-text, .ach > div { flex: 1; min-width: 0; display: grid; line-height: 1.3; font-size: .88rem; }
.shop-text strong, .ach strong { font-size: .98rem; }
.shop-text span, .ach span { color: var(--ink-soft); }
.pips { display: flex; gap: 3px; margin-top: 3px; }
.pips i { width: 12px; height: 6px; background: var(--line); opacity: .35; }
.pips i.on { background: var(--orange); opacity: 1; }
.shop-max { font-weight: 900; color: var(--moss); padding: 0 8px; }
.shop-item .btn { margin: 4px 4px 8px; white-space: nowrap; }
.ach.is-done { border-color: #c99a00; }
.ach-unlock { color: var(--orange-dk) !important; font-weight: 700; }
:root[data-theme="dark"] .ach-unlock { color: var(--orange-2) !important; }
.ach-gold { flex: none; font-weight: 800; font-size: .85rem; white-space: nowrap; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-soft); text-decoration: underline; cursor: pointer; }
.link-btn.danger { color: var(--berry); }

.opt-list { display: grid; gap: 8px; max-width: 360px; margin: 8px auto; }
.toggle { display: flex; justify-content: space-between; align-items: center; gap: 10px; font: inherit; font-weight: 700; padding: 10px 14px; cursor: pointer; background: var(--panel-2); color: var(--ink); border: 3px solid var(--line); }
.toggle b { min-width: 3.2em; padding: 2px 8px; background: var(--line); color: var(--panel); text-align: center; }
.toggle.is-on b { background: var(--moss-2); color: #fff; }
.help-list { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; }

.choices .choice-icon img { width: 44px; height: 44px; object-fit: contain; image-rendering: pixelated; }
.choices:has(> :nth-child(4)) { grid-template-columns: repeat(4, 1fr); }

.pause-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; text-align: left; }
.pause-grid h3 { font-size: 1rem; margin-bottom: 6px; }
.build-list, .stat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .9rem; }
.build-list li, .stat-list li { display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: var(--panel-2); }
.build-list img { width: 18px; height: 18px; image-rendering: pixelated; }
.build-list i { font-style: normal; }
.build-list b, .stat-list b { margin-left: auto; }

.over-stats .gold { grid-column: 1 / -1; background: #f6d36b; color: #2b1709; }
.over-stats .gold span { color: inherit; }
.over-ach { text-align: left; margin: 10px 0; }
.over-ach h3 { font-size: 1rem; margin-bottom: 6px; }
.over-ach ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.over-ach li { padding: 6px 10px; background: var(--panel-2); font-size: .92rem; }
.over-ach li span { display: block; font-size: .82rem; color: var(--orange-dk); font-weight: 700; }
pre.err { white-space: pre-wrap; word-break: break-word; text-align: left; font-size: .8rem; background: var(--panel-2); padding: 10px; border: 3px solid var(--line); }

.game-toasts { position: absolute; left: 50%; top: 72px; transform: translateX(-50%); display: grid; gap: 6px; width: min(420px, calc(100% - 24px)); pointer-events: none; z-index: 3; }
.game-toast { display: grid; gap: 2px; padding: 8px 12px; background: #2b1709; color: #fdf3de; border: 3px solid #f6d36b; box-shadow: 0 4px 0 rgba(0,0,0,.3); animation: toast-in .25s steps(4); font-size: .9rem; }
.game-toast strong { color: #f6d36b; }
.game-toast.out { opacity: 0; transition: opacity .5s; }
@keyframes toast-in { from { transform: translateY(-10px); opacity: 0; } }

@media (max-width: 760px) {
  .menu-title img { width: 48px; }
  .char-grid { grid-template-columns: 1fr; }
  .shop-list, .ach-list { grid-template-columns: 1fr; }
  .pause-grid { grid-template-columns: 1fr; }
  .choices:has(> :nth-child(4)) { grid-template-columns: 1fr; }
  .screen-head h2 { font-size: 1.4rem; }
}

/* --- Écureuil Survivor v3 : le HUD est dessiné dans le canvas, il ne reste que les boutons --- */
.game-stage .game-hud {
  position: absolute; inset: auto; right: 6px; top: calc(var(--px-game, 3px) * 14);
  display: flex; gap: 6px; padding: 0; text-shadow: none;
}
.game-stage .game-hud[hidden] { display: none; }
.game-toasts { top: calc(var(--px-game, 3px) * 50); }
.game-version { margin: 6px 0 0; font-size: .75rem; color: var(--ink-soft); opacity: .7; }
.build-list img { width: 18px; height: 18px; object-fit: contain; }

/* --- Écureuil Survivor v4 : écran « Nouvelle partie », fusions --- */
.game-stage .game-hud { top: auto; bottom: 8px; right: 8px; }
.game-card-play, .game-card-codex { width: min(760px, 100%); padding-bottom: 0; }
.pick-title { font-size: 1rem; text-align: left; margin: 12px 0 6px; }
.tile-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tile {
  position: relative; width: 64px; height: 64px; padding: 0; display: grid; place-items: center; cursor: pointer;
  background: #1f3a2b; border: 3px solid var(--line); box-shadow: 0 3px 0 var(--depth);
}
.tile img { width: 44px; height: auto; image-rendering: pixelated; }
.tile.is-locked img { filter: brightness(0) opacity(.5); }
.tile i { position: absolute; right: 2px; top: 0; font-style: normal; font-size: .9rem; }
.tile.is-inspected { outline: 3px dashed var(--focus); outline-offset: 2px; }
.tile.is-selected { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange), 0 3px 0 var(--depth); }
.tile-map { width: 92px; height: auto; padding: 4px 4px 2px; gap: 2px; background: var(--panel-2); }
.tile-map small { font-size: .72rem; font-weight: 800; line-height: 1.1; color: var(--ink); text-align: center; }
.map-swatch { display: grid; place-items: center; width: 100%; height: 40px; border: 2px solid var(--line); }
.map-swatch img { width: 28px; height: auto; image-rendering: pixelated; }
.map-swatch.big { width: 72px; height: 56px; flex: none; }
.tile-map.is-locked .map-swatch { filter: grayscale(1) brightness(.6); }
.pick-info { display: flex; gap: 12px; align-items: flex-start; text-align: left; margin-top: 10px; padding: 10px 12px; background: var(--panel-2); border: 3px solid var(--line); }
.pick-big { width: 72px; height: auto; flex: none; image-rendering: pixelated; background: #1f3a2b; border: 3px solid var(--line); padding: 6px; }
.pick-info strong { font-size: 1.1rem; }
.pick-info small { color: var(--ink-soft); }
.pick-info p { margin: 4px 0 0; font-size: .88rem; line-height: 1.35; color: var(--ink-soft) !important; }
.pick-weapon { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink) !important; }
.pick-weapon img { width: 18px; height: 18px; object-fit: contain; image-rendering: pixelated; }
.pick-tags { font-weight: 700; }
.pick-lock { color: var(--orange-dk) !important; font-weight: 700; }
:root[data-theme="dark"] .pick-lock { color: var(--orange-2) !important; }
.pick-info .btn { margin-top: 6px; }
.play-bar { position: sticky; bottom: 0; margin: 12px -22px 0; padding: 10px 12px 12px; background: var(--panel); border-top: 3px solid var(--line); display: flex; justify-content: center; z-index: 2; }
.play-bar .btn { width: min(420px, 100%); justify-content: center; font-size: 1.1rem; }
.choice.is-fusion { border-color: #c99a00; background: linear-gradient(var(--panel-2), #f6d36b33); }
.choice.is-fusion em { color: #a8741a !important; }
.choice-icon img { width: 44px; height: 44px; object-fit: contain; image-rendering: pixelated; }
.build-list li.is-fusion { outline: 2px solid #c99a00; }
.pause-grid h3 + .build-list { margin-bottom: 10px; }
.fusion-recipe { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 3px; font-weight: 700; color: var(--ink) !important; }
.fusion-recipe img, .fusion-row .shop-ic img { width: 18px; height: 18px; object-fit: contain; image-rendering: pixelated; }
.fusion-row .shop-ic img { width: 28px; height: 28px; }
@media (max-width: 760px) {
  .play-bar { margin: 12px -14px 0; }
  .tile { width: 54px; height: 54px; }
  .tile img { width: 38px; }
  .tile-map { width: calc(50% - 4px); }
  .pick-big { width: 56px; }
}
.game-card-play .play-bar { bottom: -16px; padding-bottom: 26px; }

/* --- Écureuil Survivor v5 : synergies, recettes, légendaires, biomes --- */
.syn { display: grid; gap: 2px; margin-top: 4px; }
.syn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; font-size: .78rem; line-height: 1.25; color: var(--ink-soft); font-weight: 700; }
.syn-row.have { color: #7a5a00; }
:root[data-theme="dark"] .syn-row.have { color: #f6d36b; }
.syn-row img, .recipe img { width: 16px; height: 16px; object-fit: contain; image-rendering: pixelated; }
.syn-row b { color: inherit; }
.recipe { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 4px; font-weight: 900; }
.recipe img { width: 22px; height: 22px; background: #1f3a2b; border: 2px solid var(--line); padding: 1px; }
.replace { display: block; margin-top: 2px; font-size: .8rem; color: var(--berry) !important; font-weight: 700; }
.choice.is-legend { border-color: #8a5ad8; background: linear-gradient(var(--panel-2), #c9b3ff55); }
.choice.is-legend em { color: #6a3ab8 !important; }
.fusion-row.is-legend { border-color: #8a5ad8; }
.legend-tag { font-style: normal; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: #fff; background: #8a5ad8; padding: 1px 6px; margin-left: 4px; }
.build-list li { flex-wrap: wrap; }
.build-list .syn { flex-basis: 100%; margin: 0 0 0 24px; }
.map-swatch { position: relative; display: flex; overflow: hidden; }
.map-swatch i { flex: 1; display: block; }
.map-swatch img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.tile-map .lock { position: absolute; right: 2px; top: 0; font-style: normal; }

/* --- Écureuil Survivor v6 : coop en ligne --- */
.game-card-coop, .game-card-lobby { width: min(620px, 100%); padding-bottom: 0; }
.game-card-coop { padding-bottom: 18px; }
.coop-form { display: grid; gap: 8px; text-align: left; max-width: 380px; margin: 12px auto 0; }
.coop-form label { font-weight: 800; font-size: .9rem; }
.coop-form input, .coop-join input { font: inherit; font-weight: 800; padding: 10px 12px; background: var(--panel); color: var(--ink); border: 3px solid var(--line); min-width: 0; }
.coop-join { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.coop-join input { flex: 1; text-transform: uppercase; letter-spacing: .3em; text-align: center; font-size: 1.2rem; }
.net-err { color: var(--berry) !important; font-weight: 800; }
.room-code { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 12px; padding: 8px; background: var(--panel-2); border: 3px solid var(--line); }
.room-code span { font-size: .85rem; color: var(--ink-soft); }
.room-code b { font-family: "Londrina", "Nunito", sans-serif; font-size: 2rem; letter-spacing: .25em; line-height: 1; }
.room-players { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; text-align: left; }
.room-players li { display: flex; align-items: center; gap: 8px; padding: 4px 8px; background: var(--panel-2); }
.room-players img { width: 28px; height: auto; image-rendering: pixelated; }
.play-bar .waiting { font-weight: 800; color: var(--ink-soft); padding: 10px; text-align: center; }
.game-card-lobby .play-bar { bottom: -16px; padding-bottom: 26px; }

/* --- Écureuil Survivor v7 : plein écran, coop mobile --- */
.game-overlay > .game-card { min-width: 0; max-width: 100%; }
.coop-form { width: 100%; }
.coop-form input { width: 100%; }
.coop-join input { width: 0; flex: 1 1 auto; }
.coop-join .btn { flex: none; margin: 4px 4px 8px; }
.coop-form > .btn { justify-content: center; margin: 4px 4px 8px; }
@media (max-width: 480px) {
  .game-card-coop .screen-head h2 { font-size: 1.35rem; }
  .coop-join { flex-direction: column; align-items: stretch; }
  .coop-join input { width: 100%; }
  .coop-join .btn { justify-content: center; }
  .room-code b { font-size: 1.6rem; }
}

/* plein écran : API Fullscreen ou repli CSS (iPhone) */
.fs-exit {
  display: none; position: absolute; z-index: 6;
  top: calc(env(safe-area-inset-top, 0px) + 6px); right: calc(env(safe-area-inset-right, 0px) + 6px);
  width: 36px; height: 36px; place-items: center; font-size: 1rem; font-weight: 900; cursor: pointer;
  background: rgba(43, 23, 9, .75); color: #fdf3de; border: 2px solid #2b1709;
}
.game-stage.is-full .fs-exit { display: grid; }
.game-stage.is-full .game-hud .hud-exit { display: grid; }
.game-stage.is-full:has(.game-hud:not([hidden])) .fs-exit { display: none; }
html.es-max, html.es-max body { overflow: hidden; overscroll-behavior: none; }
.game-stage.is-max { position: fixed; inset: 0; z-index: 300; width: 100vw; height: 100vh; height: 100dvh; min-height: 0; margin: 0; box-shadow: none; }
.game-stage:fullscreen { width: 100vw; height: 100vh; }
.game-stage.is-full .game-hud { bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); right: calc(env(safe-area-inset-right, 0px) + 8px); }
.game-stage.is-full .game-overlay { padding: calc(env(safe-area-inset-top, 0px) + 48px) calc(env(safe-area-inset-right, 0px) + 12px) calc(env(safe-area-inset-bottom, 0px) + 12px) calc(env(safe-area-inset-left, 0px) + 12px); }
.game-stage:has(.game-overlay:not([hidden])) .game-toasts { display: none; }

/* --- Écureuil Survivor 0.9 : rang, compétences, prestige --- */
.rank-badge { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 10px; max-width: 360px; margin: 8px auto 0; font-size: .9rem; text-align: left; }
.rank-bar { display: block; height: 8px; background: var(--line); border: 2px solid var(--line); }
.rank-bar i { display: block; height: 100%; background: linear-gradient(90deg, #7fd1c7, #9cc56b); }
.rank-badge small { color: var(--ink-soft); font-size: .78rem; }
.stars { color: #e0a82a; letter-spacing: .05em; text-shadow: 0 1px 0 #2b1709; }
.stars.big { font-size: 2rem; }
.pill { display: inline-block; min-width: 1.4em; padding: 0 5px; margin-left: 2px; font-size: .75rem; font-weight: 900; line-height: 1.5; background: var(--berry); color: #fff; border-radius: 99px; }
.menu-row .btn-alt { flex: 1; justify-content: center; }
.branch-title { text-align: left; font-size: 1rem; margin: 14px 0 6px; padding-left: 8px; border-left: 6px solid var(--br); }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; text-align: left; }
.skill { display: flex; align-items: center; gap: 8px; padding: 8px; background: var(--panel-2); border: 3px solid var(--line); }
.skill.is-on { border-color: var(--br); }
.skill.is-max { box-shadow: inset 0 0 0 2px var(--br); }
.skill.is-locked { opacity: .6; }
.skill-ic { flex: none; width: 38px; height: 38px; display: grid; place-items: center; font-size: 1.3rem; background: #1f3a2b; border: 3px solid var(--line); }
.skill-text { flex: 1; min-width: 0; display: grid; font-size: .82rem; line-height: 1.3; }
.skill-text strong { font-size: .95rem; }
.skill-text span { color: var(--ink-soft); }
.skill .pips i.on { background: var(--br); }
.skill-lock { color: var(--orange-dk) !important; font-weight: 700; font-size: .75rem; }
.skill .btn { margin: 4px 4px 8px; white-space: nowrap; }
.prestige-head { display: grid; justify-items: center; gap: 2px; margin: 6px 0; }
.prestige-bonus { max-width: 360px; margin: 8px auto; text-align: left; }
.prestige-progress { display: grid; gap: 4px; max-width: 380px; margin: 10px auto; font-size: .85rem; text-align: left; }
.prestige-progress .rank-bar i { background: linear-gradient(90deg, #f6d36b, #e0a82a); }
.prestige-rules { text-align: left; font-size: .88rem; padding: 8px 12px; background: var(--panel-2); border: 3px solid var(--line); }
.prestige-rules p { margin: 2px 0; color: var(--ink) !important; }
.rank-line { margin: 8px 0 0; font-size: .95rem; }
.rank-up { display: block; color: #2f7f7a; font-weight: 900; }
.game-card-tree, .game-card-prestige { width: min(760px, 100%); }
.menu-row .btn { white-space: nowrap; }
@media (max-width: 480px) { .menu-row .btn-alt { font-size: .85rem; padding: 8px 10px; } }
.prestige-progress.is-ok .rank-bar i { background: linear-gradient(90deg, #9cc56b, #5b8a4a); }
.prestige-progress .link-btn { font-size: inherit; }

/* --- 0.9.3 : arbre de compétences en tentacules --- */
.tentacles-wrap { margin: 6px auto 0; max-width: 560px; background: radial-gradient(circle at 50% 50%, #2a4a36 0%, #1f3a2b 55%, #16291e 100%); border: 3px solid var(--line); }
:root[data-theme="dark"] .tentacles-wrap { background: radial-gradient(circle at 50% 50%, #22402f 0%, #13211b 70%); }
.tentacles { display: block; width: 100%; height: auto; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.tentacle { transform-box: view-box; transform-origin: 0 0; animation: tentacle-sway 6s ease-in-out infinite alternate; }
.tentacle:nth-child(2) { animation-delay: -2s; }
.tentacle:nth-child(3) { animation-delay: -4s; }
@keyframes tentacle-sway { from { transform: rotate(-2.2deg); } to { transform: rotate(2.2deg); } }
@media (prefers-reduced-motion: reduce) { .tentacle { animation: none; } }
.tent { fill: none; stroke-linecap: round; }
.tent.on { stroke: var(--br); filter: drop-shadow(0 0 3px var(--br)); }
.tent.open { stroke: var(--br); opacity: .45; }
.tent.off { stroke: #6a6460; opacity: .35; stroke-dasharray: 3 4; }
.cup { fill: #fdf3de; opacity: .55; }
.cup.off { opacity: .15; }
.troot circle { fill: #2b1709; stroke: #e0a82a; stroke-width: 3; }
.br-label { font: 900 9px "Nunito", sans-serif; text-anchor: middle; letter-spacing: .08em; paint-order: stroke; stroke: #16291e; stroke-width: 3px; }
.tnode { cursor: pointer; }
.tnode .halo { fill: none; stroke: transparent; stroke-width: 3; }
.tnode .disc { fill: #2b1709; stroke: var(--br); stroke-width: 2.5; opacity: .75; }
.tnode.on .disc { fill: #3a2618; opacity: 1; }
.tnode.max .disc { stroke: #f6d36b; stroke-width: 3; }
.tnode.off .disc { stroke: #6a6460; opacity: .7; }
.tnode.off .ic { opacity: .6; }
.tnode.can .halo { stroke: var(--br); stroke-dasharray: 3 3; animation: halo-spin 3s linear infinite; transform-box: fill-box; transform-origin: center; }
.tnode.sel .halo { stroke: #fdf3de; stroke-dasharray: none; animation: none; }
@keyframes halo-spin { to { transform: rotate(360deg); } }
.tnode .ic { font-size: 14px; text-anchor: middle; }
.tnode .pip { fill: #4a3a30; stroke: #2b1709; stroke-width: 1; }
.tnode .pip.on { fill: #f6d36b; }
.tnode:hover .disc { opacity: 1; }
.skill-panel { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px; text-align: left; background: var(--panel-2); border: 3px solid var(--br); }
.skill-panel .skill-text small { font-weight: 900; text-transform: uppercase; letter-spacing: .08em; font-size: .7rem; }
.skill-panel .pips i.on { background: var(--br); }
.skill-panel .btn { margin: 4px 4px 8px; white-space: nowrap; }
@media (max-width: 480px) { .skill-panel { flex-wrap: wrap; } .skill-panel .btn { width: 100%; justify-content: center; } }
.tnode .hit { fill: transparent; }
.tentacle { animation-name: tentacle-sway; }
.req-bar { position: relative; }
.req-bar::after { content: ""; position: absolute; top: -4px; bottom: -4px; left: var(--req); width: 2px; background: var(--berry); }
.prestige-gain { margin: 10px 0; padding: 8px 12px; background: #f6d36b33; border: 3px solid #c99a00; font-size: .95rem; }
.prestige-gain small { display: block; color: var(--ink-soft); }
.pshop-item .btn { min-width: 84px; justify-content: center; }
.link-tag { font-size: .72rem; font-weight: 800; padding: 1px 6px; border: 2px solid var(--line); background: var(--panel); white-space: nowrap; }
.link-tag.direct { background: #9cc56b; color: #1f3a2b; }
.link-tag.relay { background: #f6d36b; color: #2b1709; }

/* --- 0.12 : mode Arène --- */
.coins-line { margin: 4px 0 8px; font-size: 1.1rem; }
.coins-line small { display: block; font-size: .78rem; color: var(--ink-soft); }
.choices.ashop { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.choice.offer { padding-bottom: 8px; }
.choice.offer .price { font-weight: 900; font-size: .95rem; padding: 2px 10px; background: #f6d36b; color: #2b1709; border: 2px solid var(--line); }
.choice.offer[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.choice.offer.is-sold { opacity: .35; }
.next-round { margin: 10px 0 0; font-size: .88rem; color: var(--berry) !important; }
.btn-row .waiting { font-weight: 800; color: var(--ink-soft); }
.mode-desc { margin: 2px 0 0; }
.game-lb .leaderboard + .leaderboard { margin-top: 16px; }
@media (max-width: 760px) {
  .choices.ashop { grid-template-columns: 1fr; gap: 6px; }
  .choices.ashop .choice { flex-direction: row; text-align: left; align-items: center; padding: 8px 10px; }
  .choices.ashop .choice-text { flex: 1; min-width: 0; }
  .choices.ashop .choice-text > span:not(.syn) { font-size: .8rem; }
  .choices.ashop .price { flex: none; }
}
/* ---------- mini jeu : Merger ---------- */
.merger-stage { background: #1f3a2b; height: min(80vh, 720px); min-height: 460px; }
.merger-stage .game-canvas { cursor: pointer; }
.merger-stage .game-overlay { background: rgba(20, 30, 20, .45); }
.merger-stage.is-full .fs-exit { display: grid; }
.mg-picker { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 10px 0 6px; }
.mg-pick { aspect-ratio: 1; padding: 2px; display: grid; place-items: center; cursor: pointer; background: #1f3a2b; border: 3px solid var(--line); box-shadow: 0 3px 0 var(--depth); }
.mg-pick img { width: 100%; max-width: 52px; height: auto; }
.mg-pick[aria-pressed="false"] { background: transparent; box-shadow: none; }
.mg-pick[aria-pressed="false"] img { opacity: .3; filter: grayscale(1); }
.mg-pick:focus-visible { outline: 3px solid #f6d36b; outline-offset: 2px; }
.mg-diff { margin: 6px 0; }
.mg-quick { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.merger-stage .hud-swap { font-size: 1.2rem; }
@media (max-width: 420px) { .mg-picker { grid-template-columns: repeat(4, 1fr); } }
/* --- Écureuil Dice --- */
.rd-hud { display: flex; justify-content: flex-end; gap: 6px; inset: 0 0 auto auto; }
.hud-btn[hidden] { display: none; }
.rd-card { width: min(520px, 100%); }
.rd-card.rd-online, .rd-card.rd-lobby, .rd-card.rd-help, .rd-card.rd-succes { width: min(620px, 100%); }
.rd-card.rd-deck { width: min(820px, 100%); }
.rd-strip { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.rd-die {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  background: linear-gradient(var(--c) 85%, var(--d) 85%); border: 3px solid #2b1709;
}
.rd-die img { width: 32px; height: auto; image-rendering: pixelated; }
.rd-die .rd-ic { position: absolute; left: 1px; top: 1px; width: 12px; }
.rd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; text-align: left; margin-top: 8px; }
.rd-type { padding: 10px; background: var(--panel-2); border: var(--px) solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.rd-type.is-selected { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange); }
.rd-type.is-locked .rd-die img:not(.rd-ic) { filter: brightness(0) opacity(.5); }
.rd-type-head { display: flex; align-items: center; gap: 10px; }
.rd-type-head div { display: grid; line-height: 1.2; }
.rd-type-head small { color: var(--ink-soft); }
.rd-desc { margin: 0; font-size: .86rem; line-height: 1.35; color: var(--ink-soft) !important; flex: 1; }
.rd-type-btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rd-type-btns .btn { margin: 0 0 4px; }
.rd-max { font-weight: 800; font-size: .85rem; color: var(--moss-2); }
.rd-bot-lvl .btn.is-on { --b: var(--orange); color: var(--btn-ink); }
.rd-field { display: grid; gap: 4px; text-align: left; font-weight: 700; font-size: .9rem; margin: 10px 0; }
.rd-field input { font: inherit; font-weight: 800; padding: 10px 12px; background: var(--panel); color: var(--ink); border: 3px solid var(--line); }
.rd-rules, .rd-ach { text-align: left; margin: 0; padding-left: 1.2em; display: grid; gap: 6px; font-size: .95rem; }
.rd-ach { list-style: none; padding: 0; }
.rd-ach li { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 8px 10px; background: var(--panel-2); border: 3px solid var(--line); }
.rd-ach li span { grid-column: 1; font-size: .86rem; color: var(--ink-soft); }
.rd-ach li em { grid-row: 1 / 3; grid-column: 2; align-self: center; font-style: normal; font-weight: 800; }
.rd-ach li.is-done { border-color: var(--moss-2); }
.room-players .rd-strip { justify-content: flex-start; margin: 4px 0; }
.room-players .rd-die { width: 30px; height: 30px; border-width: 2px; }
.room-players .rd-die img { width: 22px; }
.room-players .rd-die .rd-ic { width: 9px; }
.rd-over, .rd-pause { width: min(520px, 100%); }
.game-stage .game-hud.rd-hud { top: 4px; bottom: auto; right: 6px; }

/* --- Écureuil Dice : deck en grille, raretés, coffres --- */
.rd-card.rd-chests, .rd-card.rd-opened { width: min(640px, 100%); }
.rd-slots { display: grid; grid-template-columns: repeat(5, minmax(0, 64px)); justify-content: center; gap: 8px; margin: 10px 0 4px; }
.rd-slot { aspect-ratio: 1; padding: 0; display: grid; place-items: center; background: none; border: 0; cursor: pointer; }
.rd-slot .rd-die { width: 100%; height: 100%; }
.rd-slot .rd-die img { width: 72%; }
.rd-slot .rd-die .rd-ic { width: 26%; }
.rd-slot.is-empty { border: 3px dashed var(--line); background: var(--panel-2); color: var(--ink-soft); font-size: 1.6rem; font-weight: 900; opacity: .7; }
.rd-slots.is-swap .rd-slot { animation: rd-pulse .6s steps(2) infinite alternate; }
@keyframes rd-pulse { to { transform: translateY(-3px); filter: brightness(1.15); } }
.rd-hint { margin: 2px 0 8px; }
.rd-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 800; color: var(--orange-dk); text-decoration: underline; cursor: pointer; }
.rd-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px 6px; }
.rd-tile { position: relative; padding: 3px 3px 0; display: grid; justify-items: center; gap: 3px; background: var(--panel-2); border: 3px solid var(--rc, #a8a59e); cursor: pointer; font: inherit; color: inherit; }
.rd-tile .rd-die { width: 100%; height: auto; aspect-ratio: 1; border-width: 2px; }
.rd-tile .rd-die img { width: 74%; }
.rd-tile .rd-die .rd-ic { width: 28%; }
.rd-tile.is-sel { box-shadow: 0 0 0 3px var(--ink); transform: translateY(-2px); }
.rd-tile.in-deck::after { content: "✔"; position: absolute; top: -8px; left: -6px; width: 18px; height: 18px; display: grid; place-items: center; font-size: .7rem; font-weight: 900; background: var(--moss-2); color: #fff; border: 2px solid var(--line); }
.rd-tile.is-locked .rd-die { background: #3a3a3a; }
.rd-tile.is-locked .rd-die img { filter: brightness(0) opacity(.45); }
.rd-lv { position: absolute; top: 0; right: 0; min-width: 18px; padding: 0 3px; font-style: normal; font-size: .7rem; font-weight: 900; background: var(--line); color: #fdf3de; }
.rd-q { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 1.6rem; font-weight: 900; color: #fdf3de; text-shadow: 0 2px 0 #2b1709; }
.r-commun { --rc: #a8a59e; } .r-rare { --rc: #5fa3c9; } .r-epique { --rc: #a06ad8; } .r-legendaire { --rc: #f2c230; }
.rd-tile.r-legendaire, .rd-card-got.r-legendaire { box-shadow: 0 0 10px #f2c23099; }
.rd-tile.r-legendaire.is-sel { box-shadow: 0 0 0 3px var(--ink), 0 0 10px #f2c230; }
.rd-bar { position: relative; display: block; width: 100%; height: 12px; background: #2b1709; overflow: hidden; }
.rd-bar b { position: absolute; inset: 0 auto 0 0; background: #5fa3c9; }
.rd-bar.is-ready b { background: #9cc56b; }
.rd-bar em { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: .62rem; font-weight: 900; color: #fdf3de; line-height: 1; }
.rd-detail { margin-top: 12px; padding: 12px; text-align: left; background: var(--panel-2); border: 3px solid var(--rc); display: grid; gap: 8px; }
.rd-detail-head { display: flex; align-items: center; gap: 12px; }
.rd-detail-head .rd-die { width: 64px; height: 64px; }
.rd-detail-head .rd-die img { width: 46px; }
.rd-detail-head .rd-die .rd-ic { width: 16px; }
.rd-detail-head div { display: grid; line-height: 1.25; }
.rd-detail-head strong { font-size: 1.2rem; }
.rd-rar { font-weight: 900; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--rc); text-shadow: 0 1px 0 #2b170966; }
.rd-detail-head small { color: var(--ink-soft); }
.rd-stats { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; font-size: .88rem; }
.rd-stats dt { font-weight: 800; }
.rd-stats dd { margin: 0; color: var(--ink-soft); }
.rd-copies { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; font-weight: 800; font-size: .88rem; }
.rd-copies .rd-bar { height: 16px; }
.rd-copies .rd-bar em { font-size: .75rem; }
.rd-chest-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 10px 0; }
.rd-chest { display: grid; justify-items: center; gap: 6px; padding: 12px 8px; background: var(--panel-2); border: 3px solid var(--line); box-shadow: inset 0 -6px 0 var(--cc); }
.rd-chest > img { width: 64px; image-rendering: pixelated; }
.rd-chest span { font-size: .82rem; color: var(--ink-soft); }
.rd-open-chest { display: grid; place-items: center; height: 90px; }
.rd-open-chest img { width: 84px; image-rendering: pixelated; animation: rd-shake .6s steps(6) forwards; }
@keyframes rd-shake { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-8deg) scale(1.05); } 40% { transform: rotate(8deg) scale(1.1); } 60% { transform: rotate(-8deg) scale(1.15); } 80% { transform: rotate(6deg) scale(1.2); } }
.rd-reveal { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin: 8px 0; }
.rd-card-got { position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 4px; background: var(--panel-2); border: 3px solid var(--rc); opacity: 0; animation: rd-pop .35s steps(4) forwards; }
.rd-card-got .rd-die { width: 52px; height: 52px; }
.rd-card-got b { font-size: .85rem; }
.rd-card-got small { font-weight: 900; }
.rd-new { position: absolute; top: -9px; right: -4px; font-style: normal; font-size: .62rem; font-weight: 900; padding: 1px 5px; background: #c8553d; color: #fff; border: 2px solid var(--line); }
@keyframes rd-pop { 0% { opacity: 0; transform: translateY(10px) scale(.6); } 100% { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .rd-card-got { animation: none; opacity: 1; } .rd-open-chest img, .rd-slots.is-swap .rd-slot { animation: none; } }
.rd-pick { align-items: start; }
.rd-tile .rd-die { min-width: 0; }
.rd-tile { min-width: 0; }
.rd-bar.is-void { visibility: hidden; }

/* ---------- Écureuil Survivor : ouverture de coffre ---------- */
.game-card.game-card-chest { width: min(560px, 100%); background: radial-gradient(circle at 50% 38%, #3a2618, #140d08 72%); color: #fdf3de; overflow: hidden; padding: 14px 14px 16px; }
.game-card-chest.cshake { animation: cshake .38s; }
@keyframes cshake { 15% { transform: translate(-7px, 3px); } 35% { transform: translate(6px, -4px); } 55% { transform: translate(-4px, 2px); } 75% { transform: translate(3px, -1px); } }
.chest-stage { --tc: #4aa3df; --tg: 74, 163, 223; position: relative; height: 340px; display: flex; flex-direction: column; align-items: center; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.chest-stage.t1 { --tc: #b07cf0; --tg: 176, 124, 240; }
.chest-stage.t2 { --tc: #f6c445; --tg: 246, 196, 69; }
.chest-rays { position: absolute; left: 50%; top: 128px; width: 560px; height: 560px; margin: -280px 0 0 -280px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(rgba(var(--tg), .34) 0deg 9deg, transparent 9deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 12%, transparent 62%); mask: radial-gradient(circle, #000 12%, transparent 62%);
  opacity: 0; scale: .3; transition: opacity .4s, scale .7s cubic-bezier(.3, 1.5, .5, 1); animation: crays 8s linear infinite; }
.rays-on .chest-rays { opacity: .7; scale: .65; }
.chest-stage.open .chest-rays { opacity: 1; scale: 1.1; animation-duration: 5s; }
@keyframes crays { to { rotate: 360deg; } }
.chest-flash { position: absolute; inset: -40px; background: #fff; opacity: 0; pointer-events: none; z-index: 5; }
.chest-stage.flash .chest-flash { animation: cflash .5s ease-out; }
@keyframes cflash { 0% { opacity: .9; } 100% { opacity: 0; } }
.chest-title { position: relative; z-index: 3; min-height: 1.6em; font-size: 1.55rem; font-weight: 900; letter-spacing: .04em; color: var(--tc); text-shadow: 0 3px 0 #000, 0 0 14px rgba(var(--tg), .9); animation: cq 1s ease-in-out infinite; transition: color .3s; }
.chest-title.show { animation: ctitle .55s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes cq { 50% { opacity: .45; transform: scale(.94); } }
@keyframes ctitle { 0% { transform: scale(2.2); opacity: 0; } 100% { transform: none; opacity: 1; } }
.chest-box { position: relative; z-index: 2; margin-top: 10px; height: 108px; display: flex; align-items: flex-end; justify-content: center; transition: margin .4s, height .4s; }
.chest-box img { width: 132px; image-rendering: pixelated; filter: drop-shadow(0 0 6px rgba(var(--tg), .95)) drop-shadow(0 0 20px rgba(var(--tg), .6)); transition: filter .3s, width .4s; }
.chest-box.drop img { animation: cdrop .55s cubic-bezier(.3, 1.6, .5, 1); }
.chest-box.shake1 img { animation: cshk1 .2s infinite; }
.chest-box.shake2 img { animation: cshk2 .09s infinite; filter: drop-shadow(0 0 10px rgba(var(--tg), 1)) drop-shadow(0 0 32px rgba(var(--tg), .8)) brightness(1.15); }
.chest-box.open { height: 84px; margin-top: 4px; }
.chest-box.open img { width: 104px; animation: copen .55s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes cdrop { 0% { transform: translateY(-170px) scale(.6); opacity: 0; } 60% { transform: translateY(0) scale(1.18, .78); opacity: 1; } 100% { transform: none; } }
@keyframes cshk1 { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-4deg) translateX(-2px); } 75% { transform: rotate(4deg) translateX(2px); } }
@keyframes cshk2 { 0%, 100% { transform: scale(1.06); } 25% { transform: rotate(-9deg) translate(-4px, -3px) scale(1.1); } 75% { transform: rotate(9deg) translate(4px, -1px) scale(1.1); } }
@keyframes copen { 0% { transform: scale(1.35, .65); } 50% { transform: scale(.9, 1.25) translateY(-12px); } 100% { transform: none; } }
.chest-parts { position: absolute; left: 50%; top: 120px; width: 0; height: 0; z-index: 4; pointer-events: none; }
.chest-parts i { position: absolute; left: 0; top: 0; width: var(--s); height: var(--s); background: var(--c); box-shadow: 0 0 6px var(--c); opacity: 0; animation: cpart 1s ease-out forwards; }
@keyframes cpart { 0% { transform: translate(0, 0); opacity: 1; } 60% { opacity: 1; } 100% { transform: translate(var(--dx), calc(var(--dy) + 60px)) rotate(var(--r)); opacity: 0; } }
.chest-items { position: relative; z-index: 3; display: flex; gap: 8px; justify-content: center; margin-top: 12px; min-height: 104px; }
.chest-items.n5 .cslot:nth-child(1), .chest-items.n5 .cslot:nth-child(5) { margin-top: 16px; }
.chest-items.n5 .cslot:nth-child(2), .chest-items.n5 .cslot:nth-child(4) { margin-top: 6px; }
.chest-items.n3 .cslot:nth-child(1), .chest-items.n3 .cslot:nth-child(3) { margin-top: 10px; }
.cslot { width: 74px; display: flex; flex-direction: column; align-items: center; text-align: center; opacity: 0; transform: translateY(24px) scale(.5); transition: opacity .25s, transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.cslot.spin, .cslot.landed { opacity: 1; transform: none; }
.cslot-box { width: 58px; height: 58px; display: grid; place-items: center; background: #24180f; border: 3px solid var(--tc); box-shadow: 0 0 0 2px #000, 0 0 14px rgba(var(--tg), .55); }
.cslot img { width: 40px; height: 40px; image-rendering: pixelated; }
.cslot.spin img { animation: cspin .1s infinite; filter: brightness(1.25); }
@keyframes cspin { 0% { transform: translateY(-6px); opacity: .5; } 50% { transform: none; opacity: 1; } 100% { transform: translateY(6px); opacity: .5; } }
.cslot.landed .cslot-box { animation: cland .5s cubic-bezier(.2, 1.8, .4, 1); }
.cslot.fx .cslot-box { border-color: #f6d36b; animation: cland .5s cubic-bezier(.2, 1.8, .4, 1), cfx .7s ease-in-out .5s infinite alternate; }
@keyframes cland { 0% { transform: scale(1.6); box-shadow: 0 0 0 2px #000, 0 0 44px rgba(var(--tg), 1); background: #fff; } 100% { transform: none; } }
@keyframes cfx { to { box-shadow: 0 0 0 2px #000, 0 0 26px #f6d36b; } }
.cslot b { margin-top: 6px; font-size: .74rem; line-height: 1.1; color: #fdf3de; min-height: 1.1em; }
.cslot em { font-style: normal; font-size: .68rem; font-weight: 800; color: var(--tc); }
.chest-gold { margin-top: auto; position: relative; z-index: 3; font-weight: 900; font-size: 1.15rem; color: #f6d36b; text-shadow: 0 2px 0 #000; font-variant-numeric: tabular-nums; }
.chest-gold img { width: 16px; vertical-align: -2px; image-rendering: pixelated; }
.chest-gold.bump { animation: cbump .25s; }
@keyframes cbump { 50% { transform: scale(1.35); } }
.game-card-chest .btn-row { margin-top: 10px; }
@media (max-width: 460px) {
  .chest-stage { height: 320px; }
  .chest-items { gap: 4px; }
  .cslot { width: 60px; }
  .cslot-box { width: 50px; height: 50px; }
  .cslot img { width: 34px; height: 34px; }
  .cslot b { font-size: .66rem; }
}
@media (prefers-reduced-motion: reduce) {
  .chest-rays { animation: none; }
  .game-card-chest.cshake, .chest-box.shake1 img, .chest-box.shake2 img { animation: none; }
}

/* Coffre en multijoueur : bandeau en haut, le jeu continue */
.chest-mini { position: absolute; z-index: 6; top: 9%; left: 0; right: 0; margin: 0 auto; width: min(420px, 94%); pointer-events: none; overflow: hidden;
  background: radial-gradient(circle at 18% 50%, #3a2618, rgba(20, 13, 8, .9) 70%); color: #fdf3de; box-shadow: 0 0 0 2px #000, 0 4px 0 rgba(0, 0, 0, .35); animation: cmin .35s cubic-bezier(.3, 1.6, .5, 1); }
.chest-mini.out { animation: cmout .25s ease-in forwards; }
@keyframes cmin { from { transform: translateY(-30px) scale(.8); opacity: 0; } }
@keyframes cmout { to { transform: translateY(-24px); opacity: 0; } }
.chest-mini.cshake { animation: cshake .38s; }
.chest-mini .chest-stage { height: 78px; flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; padding: 16px 10px 4px; cursor: default; }
.chest-mini .chest-stage::after { content: ""; position: absolute; inset: 0; border: 2px solid var(--tc); pointer-events: none; transition: border-color .3s; }
.chest-mini .chest-rays { left: 38px; top: 46px; width: 220px; height: 220px; margin: -110px 0 0 -110px; }
.chest-mini .chest-flash { inset: 0; }
.chest-mini .chest-title { position: absolute; top: 2px; left: 0; right: 0; min-height: 0; font-size: .78rem; text-align: center; }
.chest-mini .chest-box, .chest-mini .chest-box.open { flex: none; width: 56px; height: 48px; margin: 0; }
.chest-mini .chest-box img { width: 50px; }
.chest-mini .chest-box.open img { width: 46px; }
.chest-mini .chest-parts { left: 38px; top: 46px; }
.chest-mini .chest-parts i { width: 3px; height: 3px; }
.chest-mini .chest-items { flex: 1; margin: 0; min-height: 0; gap: 4px; justify-content: center; }
.chest-mini .chest-items .cslot { width: 40px; margin-top: 0 !important; }
.chest-mini .cslot-box { width: 36px; height: 36px; border-width: 2px; }
.chest-mini .cslot img { width: 24px; height: 24px; }
.chest-mini .cslot b { display: none; }
.chest-mini .cslot em { font-size: .58rem; line-height: 1.1; margin-top: 2px; white-space: nowrap; }
.chest-mini .chest-gold { flex: none; margin: 0; font-size: .85rem; }
.chest-mini .chest-gold img { width: 12px; }
@media (max-width: 460px) {
  .chest-mini .chest-items .cslot { width: 34px; }
  .chest-mini .cslot-box { width: 30px; height: 30px; }
  .chest-mini .cslot img { width: 20px; height: 20px; }
  .chest-mini .cslot em { font-size: .5rem; }
}
.chest-mini .cslot em { max-width: 48px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 460px) { .chest-mini { top: 13%; } }

/* --- Compte du site (connexion Google) et confidentialité --- */
.narrow { max-width: 760px; }
.account-btn { text-decoration: none; color: var(--ink); }
.account-btn.is-on { background: var(--orange); color: var(--btn-ink, #2b1709); }
.account-initial { font-weight: 900; font-size: 1.15rem; line-height: 1; }
.account-panel, .legal-panel { padding: 22px; display: grid; gap: 12px; }
.account-panel h2, .legal-panel h2 { margin: 10px 0 0; font-size: 1.25rem; }
.account-panel p, .legal-panel p, .legal-panel ul { margin: 0; }
.legal-panel ul { padding-left: 1.2em; display: grid; gap: 6px; }
.account-head { display: flex; align-items: center; gap: 12px; }
.account-head div { display: grid; line-height: 1.25; }
.account-head strong { font-size: 1.2rem; }
.account-head small { color: var(--ink-soft); }
.account-avatar { width: 48px; height: 48px; display: grid; place-items: center; font-weight: 900; font-size: 1.5rem; background: var(--orange); color: #2b1709; border: 3px solid var(--line); }
.account-form { display: grid; gap: 4px; font-weight: 700; font-size: .9rem; }
.account-form input { flex: 1; min-width: 0; font: inherit; padding: 8px 10px; background: var(--panel); color: var(--ink); border: 3px solid var(--line); }
.account-msg { font-weight: 800; color: var(--orange-dk); }
.account-games { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.account-games li { display: grid; padding: 8px 10px; background: var(--panel-2); border: 3px solid var(--line); }
.account-games span { font-size: .88rem; color: var(--ink-soft); }
.account-danger summary { cursor: pointer; font-weight: 800; color: var(--berry); }
.account-danger p { margin: 8px 0; }
.account-delete { --b: var(--berry); --bd: #7a2a1a; color: #fff; }
.footer-small a { color: inherit; }
/* bouton Connexion de l'en-tête (texte + icône) */
.account-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 10px; text-decoration: none;
  font-weight: 800; color: var(--ink); background: var(--panel); white-space: nowrap;
  box-shadow: 0 -3px 0 0 var(--line), 0 3px 0 0 var(--line), -3px 0 0 0 var(--line), 3px 0 0 0 var(--line), 0 6px 0 0 var(--depth);
}
.account-btn svg { width: 20px; height: 20px; shape-rendering: crispEdges; }
.account-btn:hover { filter: brightness(1.05); }
.account-btn.is-on { background: var(--orange); color: #2b1709; }
.account-btn .account-initial { width: 22px; height: 22px; display: grid; place-items: center; background: #2b1709; color: #fdf3de; font-size: .85rem; }
.account-label { font-size: .95rem; max-width: 12ch; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) { .account-btn { padding: 0 10px; } .account-btn.is-on .account-label { display: none; } }
.account-admin { display: inline-block; margin-left: 6px; padding: 1px 6px; font-size: .7rem; font-weight: 900; letter-spacing: .08em; background: #2b1709; color: #f6d36b; vertical-align: 3px; }
.account-google { font-size: 1.05rem; }
.rd-admin { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: 8px 0; padding: 8px; border: 3px dashed var(--line); font-size: .9rem; }
.rd-admin .btn { margin: 0 0 4px; }
@media (max-width: 460px) {
  .header-inner { gap: 8px; }
  .brand .brand-name { display: none; }
  .account-btn { height: 40px; padding: 0 10px 0 8px; gap: 6px; }
  .account-label { font-size: .85rem; }
}

/* Survivor : objets à rareté (toast) */
.game-toast.item-toast { border-left: 4px solid var(--rc, #e8e0d0); }
.game-toast.item-toast strong { color: var(--rc, inherit); }
.game-toast.item-toast em { font-style: normal; font-weight: 800; color: var(--rc, inherit); }
.game-toast.item-toast.r3 { box-shadow: 0 0 0 2px #000, 0 0 18px var(--rc); }
/* message de la sauvegarde en ligne (js/cloudsave.js) */
.cs-toast {
  position: fixed; left: 50%; bottom: 18px; z-index: 400; transform: translateX(-50%); max-width: min(560px, calc(100vw - 32px));
  padding: 10px 14px; background: #2b1709; color: #fdf3de; font-weight: 700; font-size: .95rem; line-height: 1.35;
  box-shadow: 0 0 0 3px #f6d36b; transition: opacity .6s;
}
.cs-toast.out { opacity: 0; }

/* --- Écureuil Dice : ouverture de coffre (game feel) --- */
.rd-cfx {
  --glow: #f6d36b; --charge: 0;
  position: absolute; inset: 0; z-index: 30; overflow: hidden; overflow: clip; cursor: pointer; user-select: none;
  display: grid; grid-template-rows: auto 1fr auto auto; justify-items: center; align-items: center; padding: 18px 12px;
  background: radial-gradient(circle at 50% 55%, rgba(60, 40, 20, .55), rgba(10, 8, 6, .92) 70%);
  animation: rd-cfx-in .25s ease-out;
}
.rd-cfx [hidden] { display: none !important; }
.rd-cfx.is-out { animation: rd-cfx-outa .25s ease-in forwards; }
@keyframes rd-cfx-in { from { opacity: 0; } }
@keyframes rd-cfx-outa { to { opacity: 0; } }
.rd-cfx-title { font: 900 clamp(1.2rem, 4vw, 1.8rem) "Nunito", sans-serif; color: #fdf3de; text-shadow: 0 3px 0 #2b1709; letter-spacing: .02em; }
.rd-cfx-rays {
  position: absolute; left: 50%; top: 55%; width: 160vmax; height: 160vmax; margin: -80vmax 0 0 -80vmax; pointer-events: none; opacity: 0;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--glow) 40%, transparent) 0deg 9deg, transparent 9deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 0, #000 12%, transparent 45%); mask: radial-gradient(circle, #000 0, #000 12%, transparent 45%);
  transition: opacity .4s; animation: rd-spin 14s linear infinite;
}
.rd-cfx.is-open .rd-cfx-rays { opacity: 1; }
.rd-cfx.b-legendaire .rd-cfx-rays { animation-duration: 6s; }
@keyframes rd-spin { to { transform: rotate(360deg); } }

/* coffre */
.rd-cfx-chest { position: relative; grid-row: 2; width: clamp(150px, 34vmin, 230px); aspect-ratio: 14 / 11; transform-origin: 50% 100%; }
.rd-cfx-chest img { position: absolute; left: 0; width: 100%; image-rendering: pixelated; }
.rd-cfx-base { bottom: 0; }
.rd-cfx-lid { bottom: 42%; transform-origin: 15% 100%; }
.rd-cfx-glow {
  position: absolute; left: 10%; right: 10%; bottom: 40%; height: 18%; border-radius: 50%; pointer-events: none;
  background: var(--glow); filter: blur(10px); opacity: calc(var(--charge) * .9); transition: opacity .2s;
}
.rd-cfx-chest.is-drop { animation: rd-drop .7s cubic-bezier(.3, 0, .4, 1) both; }
@keyframes rd-drop {
  0% { transform: translateY(-120vh) scale(.9, 1.15); }
  55% { transform: translateY(0) scale(1.25, .7); }
  72% { transform: translateY(-6%) scale(.92, 1.1); }
  86% { transform: translateY(0) scale(1.06, .95); }
  100% { transform: none; }
}
.rd-cfx-chest.hit1 { animation: rd-hit .25s ease-out; }
.rd-cfx-chest.hit2 { animation: rd-hit .25s ease-out; --amp: 1.6; }
.rd-cfx-chest.hit3, .rd-cfx-chest.is-wait { animation: rd-hit .2s ease-out infinite; --amp: 2.3; }
@keyframes rd-hit {
  0% { transform: scale(1, 1); }
  30% { transform: scale(calc(1 + .08 * var(--amp, 1)), calc(1 - .1 * var(--amp, 1))) rotate(calc(-3deg * var(--amp, 1))); }
  60% { transform: scale(calc(1 - .04 * var(--amp, 1)), calc(1 + .06 * var(--amp, 1))) rotate(calc(3deg * var(--amp, 1))); }
  100% { transform: none; }
}
.rd-cfx.is-open .rd-cfx-lid { animation: rd-lid .7s cubic-bezier(.2, .8, .3, 1) forwards; }
@keyframes rd-lid { to { transform: translate(-30%, -170%) rotate(-38deg); opacity: 0; } }
.rd-cfx.is-open .rd-cfx-glow { opacity: 1; height: 40%; bottom: 35%; filter: blur(16px); }
.rd-cfx.is-open .rd-cfx-chest { animation: rd-pop-chest .5s ease-out; }
@keyframes rd-pop-chest { 0% { transform: scale(1.3, .75); } 40% { transform: scale(.9, 1.12); } 100% { transform: none; } }
.rd-cfx.is-open:has(.rd-cfx-card:not([hidden])) .rd-cfx-chest { opacity: .35; transform: translateY(18%) scale(.8); transition: all .4s; }
.rd-cfx::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.rd-cfx.is-open::after { animation: rd-flash .45s ease-out; }
@keyframes rd-flash { 0% { opacity: .85; } 100% { opacity: 0; } }
.rd-cfx-hint { grid-row: 3; color: #fdf3de; font-weight: 800; font-size: 1.05rem; animation: rd-blink 1s steps(2) infinite; margin-top: 8px; }
@keyframes rd-blink { 50% { opacity: .45; } }
.rd-cfx-count { grid-row: 3; color: #c9b8a0; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 6px; }
.rd-cfx-skip { grid-row: 4; margin-top: 8px; }

/* particules */
.rd-cfx-p { position: absolute; width: 6px; height: 6px; pointer-events: none; animation: rd-p .8s cubic-bezier(.2, .7, .4, 1) forwards; }
.rd-cfx-p.star { width: 9px; height: 9px; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
@keyframes rd-p { 0% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 40px)) scale(.3); opacity: 0; } }

/* carte révélée */
.rd-cfx-card { grid-row: 2; position: absolute; top: 50%; left: 50%; width: clamp(150px, 38vmin, 210px); transform: translate(-50%, -50%); perspective: 600px; z-index: 2; }
.rd-cfx-card > div { width: 100%; padding: 16px 10px 14px; display: grid; justify-items: center; gap: 4px; background: var(--panel); border: 4px solid var(--rc, #a8a59e); box-shadow: 0 0 0 3px #2b1709, 0 0 30px color-mix(in srgb, var(--rc, #fff) 70%, transparent); backface-visibility: hidden; }
.rd-cfx-back { position: absolute; inset: 0; place-items: center !important; font: 900 3.5rem "Nunito", sans-serif; color: #fdf3de;
  background: repeating-linear-gradient(45deg, #6b4430 0 10px, #8a5a3b 10px 20px) !important; border-color: #2b1709 !important; transform: rotateY(180deg); }
.rd-cfx-card.is-back { animation: rd-card-in .2s ease-out; }
.rd-cfx-card.is-back .rd-cfx-face { transform: rotateY(180deg); }
.rd-cfx-card.is-back .rd-cfx-back { transform: rotateY(0); }
.rd-cfx-card.is-tease { animation: rd-card-in .2s ease-out, rd-tease .12s linear .2s infinite; }
.rd-cfx-card.is-tease .rd-cfx-back { box-shadow: 0 0 0 3px #2b1709, 0 0 50px var(--rc); }
@keyframes rd-tease { 0%, 100% { transform: translate(-50%, -50%) rotate(-2deg); } 50% { transform: translate(-50%, -50%) rotate(2deg) scale(1.03); } }
@keyframes rd-card-in { from { transform: translate(-50%, 40%) scale(.3); opacity: 0; } }
.rd-cfx-face, .rd-cfx-back { transition: transform .32s cubic-bezier(.3, 1.6, .5, 1); }
.rd-cfx-card.is-flip { animation: rd-punch .45s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes rd-punch { 0% { transform: translate(-50%, -50%) scale(.85); } 40% { transform: translate(-50%, -50%) scale(1.18); } 100% { transform: translate(-50%, -50%) scale(1); } }
.rd-cfx-face .rd-die { width: 84px; height: 84px; border-width: 4px; }
.rd-cfx-face .rd-die img { width: 62px; }
.rd-cfx-face .rd-die .rd-ic { width: 22px; }
.rd-cfx-face b { font-size: 1.25rem; }
.rd-cfx-face small { font-weight: 900; font-size: 1.1rem; }
.rd-cfx-rar { font-weight: 900; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--rc); text-shadow: 0 1px 0 #2b1709; }
.rd-cfx-card.r-legendaire .rd-cfx-rar { font-size: 1rem; animation: rd-blink .5s steps(2) 3; }
.rd-cfx-new { position: absolute; top: -14px; right: -14px; padding: 3px 8px; font-style: normal; font-weight: 900; font-size: .8rem; color: #fff; background: #c8553d; border: 3px solid #2b1709; transform: rotate(12deg); }
.rd-cfx-card.is-flip .rd-cfx-new { animation: rd-stamp .35s cubic-bezier(.3, 1.6, .5, 1) .25s both; }
@keyframes rd-stamp { 0% { transform: rotate(12deg) scale(3); opacity: 0; } 100% { transform: rotate(12deg) scale(1); opacity: 1; } }

/* secousse de l'écran */
.game-stage.rd-shake-s { animation: rd-shake .25s linear; }
.game-stage.rd-shake-l { animation: rd-shake .45s linear; --sh: 7px; }
@keyframes rd-shake {
  0%, 100% { translate: 0 0; } 15% { translate: calc(var(--sh, 3px) * -1) calc(var(--sh, 3px) * .6); } 30% { translate: var(--sh, 3px) calc(var(--sh, 3px) * -.6); }
  45% { translate: calc(var(--sh, 3px) * -.7) calc(var(--sh, 3px) * -.4); } 60% { translate: calc(var(--sh, 3px) * .6) calc(var(--sh, 3px) * .5); } 80% { translate: calc(var(--sh, 3px) * -.3) 0; }
}
@media (prefers-reduced-motion: reduce) {
  .rd-cfx-rays, .rd-cfx-chest, .rd-cfx-card, .rd-cfx-p, .rd-cfx::after { animation: none !important; }
}
/* coffres : ×10 et rouvrir */
.rd-chest .btn { margin: 0 0 4px; }
.rd-x10 { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.1; }
.rd-x10 small { font-size: .7rem; font-weight: 800; opacity: .85; }
.rd-cfx-x { display: inline-block; margin-left: 6px; padding: 0 8px; background: #c8553d; border: 3px solid #2b1709; color: #fff; transform: rotate(-4deg); animation: rd-stamp .35s cubic-bezier(.3, 1.6, .5, 1) .5s both; }
.rd-again { margin-top: 6px; }
.rd-gold-left { margin: 4px 0 0; }

/* Survivor : quêtes */
.ach.quest { border-left: 4px solid var(--rc, #e8e0d0); }
.ach.quest .q-item { color: var(--rc); filter: brightness(.75); }
.ach.quest:not(.is-done) .ach-ic { filter: grayscale(1); opacity: .7; }
.quest-toast img { width: 14px; vertical-align: -2px; image-rendering: pixelated; }
.ach.quest .ach-ic img { width: 24px; image-rendering: pixelated; }

/* ---------- Écureuil Survivor : écran d'accueil ---------- */
.game-card-menu { width: min(560px, 100%); padding: 18px 18px 12px; }
.mm { display: grid; gap: 14px; text-align: left; }
.mm-head { display: flex; align-items: center; justify-content: center; gap: 12px; }
.mm-head img { width: 56px; height: auto; image-rendering: pixelated; flex: none; }
.mm-head h2 { margin: 0; line-height: 1.05; }
.mm-head .kicker { display: block; margin: 0 0 2px; }
.mm-stats { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--panel-2); box-shadow: 0 0 0 2px var(--line); }
.mm-gold { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; white-space: nowrap; }
.mm-gold .gold-ic { width: 18px; height: 18px; }
.mm-rank { flex: 1; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; font-size: .9rem; min-width: 0; }
.mm-rank small { color: var(--ink-soft); font-size: .75rem; white-space: nowrap; }
.mm-rank .rank-bar { min-width: 40px; }
.mm-main { display: grid; grid-template-columns: 1.6fr 1fr; gap: 10px; }
.mm-main .btn { margin: 4px 4px 8px; justify-content: center; }
.mm-play { flex-direction: column; gap: 0; padding: 10px 14px; font-size: 1.3rem; font-weight: 900; }
.mm-play small { font-size: .72rem; font-weight: 700; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mm-coop { flex-direction: column; gap: 0; font-size: 1.1rem; font-weight: 900; padding: 10px 12px; text-align: center; }
.mm-coop small { font-size: .72rem; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.mm-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.mm-tile { position: relative; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 10px; text-align: left;
  font: inherit; color: var(--ink); background: var(--panel-2); border: 0; cursor: pointer;
  box-shadow: 0 0 0 2px var(--line), 0 4px 0 2px var(--line); margin-bottom: 4px; transition: transform .06s steps(1), filter .15s; }
.mm-tile:hover { filter: brightness(1.06); }
.mm-tile:active { transform: translateY(3px); box-shadow: 0 0 0 2px var(--line), 0 1px 0 2px var(--line); }
.mm-tile:focus-visible { outline: 3px solid var(--orange, #e8873a); outline-offset: 3px; }
.mm-ic { flex: none; width: 34px; height: 34px; display: grid; place-items: center; font-size: 1.35rem; background: var(--panel); box-shadow: 0 0 0 2px var(--line); }
.mm-lb { display: grid; min-width: 0; line-height: 1.15; }
.mm-lb b { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-lb small { font-size: .74rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-tile .pill { position: absolute; top: -6px; right: -4px; }
.mm-tile.is-hot .mm-ic { background: var(--berry); }
.mm-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px 12px; flex-wrap: wrap; font-size: .78rem; color: var(--ink-soft); border-top: 2px dashed color-mix(in srgb, var(--ink-soft) 40%, transparent); padding-top: 8px; }
.mm-link { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
@media (min-width: 620px) { .mm-grid { grid-template-columns: repeat(4, 1fr); } .mm-tile { flex-direction: column; text-align: center; gap: 6px; padding: 10px 6px; } .mm-lb small { white-space: normal; } }
@media (max-width: 420px) {
  .game-card-menu { padding: 14px 12px 10px; }
  .mm { gap: 10px; }
  .mm-head { gap: 8px; }
  .mm-head img { width: 42px; }
  .mm-head h2 { font-size: 1.35rem; white-space: nowrap; }
  .mm-head .kicker { font-size: .62rem; letter-spacing: .08em; white-space: nowrap; }
  .mm-stats { padding: 6px 10px; gap: 8px; }
  .mm-rank small { display: none; }
  .mm-main { grid-template-columns: 1.5fr 1fr; gap: 6px; }
  .mm-play { font-size: 1.15rem; padding: 8px 10px; }
  .mm-coop { font-size: 1rem; padding: 8px 8px; }
  .mm-grid { gap: 7px; }
  .mm-tile { gap: 8px; padding: 6px 8px; min-height: 46px; }
  .mm-ic { width: 28px; height: 28px; font-size: 1.05rem; }
  .mm-lb b { font-size: .84rem; }
  .mm-lb small { font-size: .68rem; }
}

/* ---------- Écureuil Survivor : écran « Nouvelle partie » ---------- */
.game-card-play { width: min(620px, 100%); }
.np { display: grid; gap: 16px; text-align: left; }
.np-sec h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 1.05rem; }
.np-sec h3 small { margin-left: auto; font-size: .78rem; font-weight: 700; color: var(--ink-soft); }
.np-n { display: inline-grid; place-items: center; width: 22px; height: 22px; font-size: .8rem; font-weight: 900; background: var(--orange); color: var(--btn-ink); box-shadow: 0 0 0 2px var(--line); }
.np-hint { margin: 8px 0 0; font-size: .82rem; line-height: 1.35; color: var(--ink-soft); }
.np-hint b { color: var(--ink); }
.np-lock { color: var(--orange-dk); font-weight: 800; }
:root[data-theme="dark"] .np-lock { color: var(--orange-2); }
.np-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.np-opt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 48px; padding: 6px 4px; font: inherit; font-weight: 800; font-size: .92rem; color: var(--ink); background: var(--panel-2); border: 0; cursor: pointer;
  box-shadow: 0 0 0 2px var(--line), 0 4px 0 2px var(--line); margin-bottom: 4px; }
.np-opt small { font-size: .7rem; font-weight: 700; color: var(--ink-soft); }
.np-oi { font-size: 1.2rem; line-height: 1; }
.np-opt.is-on { background: var(--orange); color: var(--btn-ink); transform: translateY(3px); box-shadow: 0 0 0 2px var(--line), 0 1px 0 2px var(--line); }
.np-opt.is-on small { color: var(--btn-ink); opacity: .75; }
.np-opt[disabled] { opacity: .55; cursor: not-allowed; }
.np-chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 8px; }
.np-char { position: relative; aspect-ratio: 1; display: grid; place-items: center; padding: 0; cursor: pointer; background: #1f3a2b; border: 0; box-shadow: 0 0 0 2px var(--line); }
.np-char img { width: 70%; height: auto; image-rendering: pixelated; }
.np-char.is-locked img { filter: brightness(0) opacity(.45); }
.np-char i { position: absolute; right: 1px; top: -1px; font-style: normal; font-size: .75rem; }
.np-char.is-selected { box-shadow: 0 0 0 2px var(--line), 0 0 0 5px var(--orange); }
.np-char.is-inspected:not(.is-selected) { outline: 2px dashed var(--focus); outline-offset: 3px; }
.np-card { display: flex; gap: 12px; margin-top: 10px; padding: 10px; background: var(--panel-2); box-shadow: 0 0 0 2px var(--line); }
.np-big { width: 64px; height: 64px; flex: none; padding: 6px; object-fit: contain; image-rendering: pixelated; background: #1f3a2b; box-shadow: 0 0 0 2px var(--line); }
.np-body { display: grid; gap: 5px; min-width: 0; }
.np-name strong { font-size: 1.05rem; }
.np-name small { color: var(--ink-soft); font-size: .8rem; }
.np-weapon { display: flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 800; }
.np-weapon img { width: 16px; height: 16px; object-fit: contain; image-rendering: pixelated; }
.np-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.np-tag { font-size: .72rem; font-weight: 800; padding: 1px 6px; background: var(--panel); box-shadow: 0 0 0 1px var(--line); color: var(--ink); }
.np-tag.up { color: #3a7a2a; }
.np-tag.down { color: #b0402a; }
:root[data-theme="dark"] .np-tag.up { color: #9cd06a; }
:root[data-theme="dark"] .np-tag.down { color: #ff9a7a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .np-tag.up { color: #9cd06a; } :root:not([data-theme="light"]) .np-tag.down { color: #ff9a7a; } :root:not([data-theme="light"]) .np-lock { color: var(--orange-2); } }
.np-desc { margin: 0; font-size: .8rem; line-height: 1.35; color: var(--ink-soft); }
.np-card .btn { justify-self: start; margin-top: 2px; }
.np-maps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.np-map { display: grid; gap: 0; padding: 0; text-align: left; font: inherit; color: var(--ink); background: var(--panel-2); border: 0; cursor: pointer; box-shadow: 0 0 0 2px var(--line), 0 4px 0 2px var(--line); margin-bottom: 4px; overflow: hidden; }
.np-mapart { position: relative; display: grid; place-items: center; height: 42px; border-bottom: 2px solid var(--line); }
.np-mapart img { width: 26px; height: auto; image-rendering: pixelated; filter: drop-shadow(0 2px 0 rgba(0,0,0,.35)); }
.np-mapart i { position: absolute; right: 4px; top: 2px; font-style: normal; font-size: .8rem; }
.np-mapname { padding: 5px 8px 0; font-weight: 900; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-mapmeta { padding: 0 8px 6px; font-size: .7rem; font-weight: 700; color: var(--ink-soft); }
.np-map.is-locked .np-mapart { filter: grayscale(1) brightness(.6); }
.np-map.is-locked .np-mapname { opacity: .6; }
.np-map.is-selected { box-shadow: 0 0 0 2px var(--line), 0 0 0 5px var(--orange), 0 7px 0 5px var(--orange-dk); }
.np-map.is-inspected:not(.is-selected) { outline: 2px dashed var(--focus); outline-offset: 4px; }
.np-go { flex-direction: column; gap: 0; }
.np-go small { font-size: .74rem; font-weight: 700; opacity: .8; }
@media (min-width: 560px) { .np-maps { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 380px) { .np-opt { font-size: .82rem; } .np-big { width: 52px; height: 52px; } }
.game-card-play .screen-head h2 { white-space: nowrap; }
@media (max-width: 480px) {
  .game-card-play .screen-head { flex-wrap: nowrap; }
  .game-card-play .screen-head h2 { font-size: 1.2rem; }
  .game-card-play .screen-head .btn-small { padding: 6px 10px; font-size: .85rem; }
  .game-card-play .gold-badge { padding: 3px 8px; font-size: .9rem; }
}
.np-card .np-lock { margin: 0; font-size: .82rem; line-height: 1.35; }
@media (max-width: 420px) { .btn-back .bk-tx { display: none; } .btn-back { padding: 6px 12px !important; } }
/* carrousel horizontal (cartes / types de donjon) */
.np-slider { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 6px 12px; margin: 0 -6px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.np-slider > .np-map { flex: 0 0 66%; scroll-snap-align: center; }
.np-slider .np-mapart { height: 64px; }
.np-slider .np-mapart img { width: 34px; }
.np-slider .np-mapart img.np-boss { width: 44px; }
.np-mapdesc { padding: 0 8px 8px; font-size: .72rem; line-height: 1.3; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.np-slider .np-mapmeta { padding-bottom: 2px; }
@media (min-width: 560px) { .np-slider > .np-map { flex-basis: calc(36% - 8px); } }
/* bandeau « nouvelle version » */
.update-bar { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 9999; display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 14px; max-width: calc(100% - 24px);
  background: #2b1709; color: #fdf3de; font-size: .9rem; box-shadow: 0 0 0 3px #f6d36b, 0 6px 0 3px rgba(0,0,0,.35); animation: toast-in .25s steps(4); }
.update-bar .btn { margin: 0; }

/* ---------- Écureuil Dice : menus (même style que l'accueil du Survivor) ---------- */
.rd-card.rd-menu { width: min(560px, 100%); padding: 18px 18px 12px; text-align: left; }
.rd-card.rd-bot, .rd-card.rd-account, .rd-card.rd-pause { width: min(480px, 100%); }
.rd-center { text-align: center; margin: 0; }
.rd-stats-row { justify-content: space-between; flex-wrap: wrap; font-size: .92rem; }
.rd-stats-row b { font-variant-numeric: tabular-nums; }
.rd-keys, .rd-best { white-space: nowrap; }
.rd-best { color: var(--ink-soft); }
.rd-best b { color: var(--ink); }
.rd-deckbar {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; font: inherit; color: var(--ink); text-align: left; cursor: pointer;
  background: var(--panel-2); border: 0; box-shadow: 0 0 0 2px var(--line), 0 4px 0 2px var(--line); margin-bottom: 4px;
}
.rd-deckbar:hover { filter: brightness(1.05); }
.rd-deckbar:active { transform: translateY(3px); box-shadow: 0 0 0 2px var(--line), 0 1px 0 2px var(--line); }
.rd-deckbar-dice { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; flex: 1; min-width: 0; max-width: 300px; }
.rd-deckbar-dice .rd-die { width: 100%; height: auto; aspect-ratio: 1; border-width: 2px; }
.rd-deckbar-dice .rd-die img { width: 74%; }
.rd-deckbar-dice .rd-die .rd-ic { width: 28%; }
.rd-die-empty { background: var(--panel) !important; border-style: dashed !important; color: var(--ink-soft); font-weight: 900; font-size: 1.3rem; }
.rd-deckbar-tx { display: grid; font-weight: 900; line-height: 1.15; margin-left: auto; text-align: right; }
.rd-deckbar-tx small { font-weight: 700; font-size: .75rem; color: var(--ink-soft); text-decoration: underline; }
.mm-tile[disabled] { opacity: .5; cursor: not-allowed; }
.mm-tile .pill { min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; font-size: .8rem; font-weight: 900; color: #fff; background: var(--berry); box-shadow: 0 0 0 2px var(--line); }
.rd-menu .mm-foot { margin-top: 2px; }
/* choix de l'IA */
.rd-opts { display: grid; gap: 10px; margin-top: 10px; }
.rd-opt {
  display: flex; align-items: center; gap: 12px; padding: 12px; font: inherit; color: var(--ink); text-align: left; cursor: pointer;
  background: var(--panel-2); border: 0; box-shadow: 0 0 0 2px var(--line), 0 4px 0 2px var(--line); margin-bottom: 4px;
}
.rd-opt.is-on { box-shadow: 0 0 0 3px var(--orange), 0 4px 0 3px var(--line); }
.rd-opt:active { transform: translateY(3px); }
.rd-opt > span:nth-child(2) { display: grid; flex: 1; line-height: 1.25; }
.rd-opt small { color: var(--ink-soft); font-size: .82rem; }
.rd-opt-ic { width: 44px; height: 44px; display: grid; place-items: center; font-size: 1.6rem; background: var(--panel); box-shadow: 0 0 0 2px var(--line); flex: none; }
.rd-opt-go { font-size: 1.2rem; font-weight: 900; color: var(--orange-dk); }
/* en-têtes d'écran compacts */
.rd-head { flex-wrap: nowrap; }
.rd-head h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-head > :last-child:not(h2) { min-width: 44px; }
.rd-mini-gold { margin: 0 auto 4px; }
@media (max-width: 420px) {
  .rd-card.rd-menu { padding: 14px 12px 10px; }
  .rd-card { padding: 14px 12px 12px; }
  .rd-head h2 { font-size: 1.3rem; }
  .rd-deckbar { gap: 8px; padding: 6px 8px; }
  .rd-menu .mm-coop span { font-size: .95rem; white-space: nowrap; }
  .rd-deckbar-tx { font-size: .85rem; }
  .rd-stats-row { font-size: .85rem; gap: 6px 10px; }
  .rd-slots { gap: 6px; }
  .rd-pick { grid-template-columns: repeat(4, 1fr); gap: 7px 5px; }
  .rd-chest-list { grid-template-columns: 1fr; }
  .rd-chest { grid-template-columns: 56px 1fr 1fr; grid-template-areas: "img name name" "img info info" "b1 b1 b2"; justify-items: start; text-align: left; column-gap: 10px; }
  .rd-chest > img { grid-area: img; width: 56px; align-self: center; }
  .rd-chest > strong { grid-area: name; }
  .rd-chest > span { grid-area: info; }
  .rd-chest > .btn:not(.rd-x10) { grid-area: b1; justify-self: stretch; justify-content: center; }
  .rd-chest > .rd-x10 { grid-area: b2; justify-self: stretch; }
  .rd-reveal { grid-template-columns: repeat(3, 1fr); }
  .over-stats { grid-template-columns: repeat(3, 1fr); }
}
/* deck : double toucher (pas de zoom au double toucher sur mobile) */
.rd-slot, .rd-tile, .rd-pick, .rd-slots { touch-action: manipulation; }
.rd-slot.is-sel { outline: 3px solid var(--ink); outline-offset: 3px; }
.rd-warn { color: var(--berry); }
/* dés-écureuils : une seule image (oreilles, frimousse, emblème du rôle) */
.rd-die.rd-face { background: none !important; border: 0 !important; aspect-ratio: 24 / 26; height: auto; }
.rd-die.rd-face img { width: 100% !important; height: auto; image-rendering: pixelated; }
.rd-tile .rd-die.rd-face, .rd-slot .rd-die.rd-face, .rd-deckbar-dice .rd-die.rd-face, .rd-cfx-face .rd-die.rd-face, .rd-card-got .rd-die.rd-face { aspect-ratio: 24 / 26; height: auto; }
.rd-cfx-face .rd-die.rd-face { width: 92px; }
.rd-card-got .rd-die.rd-face { width: 56px; }
.rd-detail-head .rd-die.rd-face { width: 64px; }
.room-players .rd-die.rd-face { width: 30px; }
.rd-role { font-size: .62rem; font-weight: 800; color: var(--ink-soft); line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rd-tile.is-locked .rd-role { opacity: .6; }
.rd-tile.is-locked .rd-die.rd-face img { filter: brightness(0) opacity(.5); }

/* ---------- Écureuil Dice : cartes ---------- */
.rd-mapbar {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 10px 6px 6px; font: inherit; color: var(--ink); text-align: left; cursor: pointer;
  background: var(--panel-2); border: 0; box-shadow: 0 0 0 2px var(--line), 0 4px 0 2px var(--line); margin-bottom: 4px;
}
.rd-mapbar:active { transform: translateY(3px); box-shadow: 0 0 0 2px var(--line), 0 1px 0 2px var(--line); }
.rd-mapbar img { width: 64px; height: 44px; object-fit: cover; image-rendering: pixelated; box-shadow: 0 0 0 2px var(--line); flex: none; }
.rd-mapbar-tx { display: grid; min-width: 0; line-height: 1.2; flex: 1; }
.rd-mapbar-tx small { font-size: .75rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-mapbar-go { font-weight: 900; font-size: .8rem; color: var(--orange-dk); white-space: nowrap; }
.rd-card.rd-maps { width: min(760px, 100%); }
.rd-map-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-top: 10px; text-align: left; }
.rd-map {
  display: grid; grid-template-rows: auto 1fr; padding: 0; font: inherit; color: var(--ink); text-align: left; cursor: pointer; overflow: hidden;
  background: var(--panel-2); border: 0; box-shadow: 0 0 0 2px var(--line), 0 4px 0 2px var(--line); margin-bottom: 4px;
}
.rd-map.is-on { box-shadow: 0 0 0 4px var(--orange), 0 5px 0 4px var(--line); }
.rd-map:active { transform: translateY(3px); }
.rd-map img { width: 100%; aspect-ratio: 182 / 130; object-fit: cover; object-position: top; image-rendering: pixelated; display: block; }
.rd-map-tx { display: grid; gap: 3px; padding: 8px 10px 10px; line-height: 1.25; }
.rd-map-tx small { font-size: .8rem; color: var(--ink-soft); }
.rd-map-tx .rd-map-n { font-weight: 800; color: var(--orange-dk); }
@media (max-width: 420px) { .rd-map-list { grid-template-columns: 1fr 1fr; gap: 8px; } .rd-map-tx { padding: 6px 7px 8px; } .rd-map-tx small:not(.rd-map-n) { font-size: .72rem; } }
.rd-sec { margin: 14px 0 0; font-size: 1.05rem; text-align: left; }
.rd-sec small { font-size: .78rem; font-weight: 700; color: var(--ink-soft); }

/* Dice · deck : la fiche du dé reste toujours visible, collée en bas */
.rd-card.rd-deck .rd-detail { position: sticky; bottom: -16px; z-index: 3; max-height: 44vh; overflow-y: auto; margin-top: 12px; box-shadow: 0 -8px 16px rgba(30, 20, 10, .3); }
@media (max-width: 560px) {
  .rd-card.rd-deck .rd-detail { max-height: 40vh; padding: 10px; gap: 6px; }
  .rd-card.rd-deck .rd-detail-head .rd-die { width: 48px; height: 48px; }
  .rd-card.rd-deck .rd-detail .rd-stats { font-size: .85rem; }
}

/* ---------- Écureuil Défense (tower defense) ---------- */
.td-stage { height: min(80vh, 760px); --td-shop-w: 216px; }
.td-stage *, .td-stage *::before, .td-stage *::after { box-sizing: border-box; }
.td-stage .game-canvas { cursor: pointer; }
.td-stage .game-overlay { z-index: 8; }
.td-stage .game-banner { top: 24%; left: calc(var(--td-field-w, 100%) / 2); }
/* barre du haut */
.td-top { position: absolute; z-index: 4; top: 0; left: 0; width: var(--td-field-w, 100%); height: 40px; display: flex; align-items: center; gap: 6px; padding: 4px 6px; pointer-events: none; }
.td-top[hidden] { display: none; }
.td-pill { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; font-weight: 900; font-size: 1.05rem; color: #fdf3de; background: rgba(43, 23, 9, .78); border: 2px solid #2b1709; box-shadow: 0 3px 0 rgba(0,0,0,.35); font-variant-numeric: tabular-nums; white-space: nowrap; text-shadow: 0 2px 0 #2b1709; }
.td-lives b { color: #f29a85; } .td-cash b { color: #ffd34a; }
.td-round { margin-left: auto; font-size: .95rem; }
.td-topbtns { display: flex; gap: 4px; pointer-events: auto; }
.td-topbtns .hud-btn { width: 30px; height: 30px; }
.td-top .hud-exit { display: none; }
.td-stage.is-full .td-top .hud-exit { display: grid; }
.td-stage.is-full .fs-exit { display: none; }
/* boutique */
.td-shop { position: absolute; z-index: 5; display: flex; flex-direction: column; gap: 6px; padding: 8px; background: #6b4430; border: 0 solid #2b1709;
  background-image: repeating-linear-gradient(0deg, rgba(0,0,0,.07) 0 2px, transparent 2px 14px); color: #fdf3de; }
.td-shop[hidden] { display: none; }
.td-wide .td-shop { top: 0; right: 0; bottom: 0; width: var(--td-shop-w); border-left-width: 4px; }
.td-tall .td-shop { left: 0; right: 0; bottom: 0; height: var(--td-bottom, 40%); border-top-width: 4px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr; gap: 6px; }
.td-shopgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; align-content: start; }
.td-tall .td-shopgrid { grid-template-columns: repeat(4, 1fr); grid-row: 1; }
.td-tall .td-shopinfo { grid-row: 2; grid-column: 1; align-self: start; }
.td-buy { position: relative; display: grid; justify-items: center; align-content: end; gap: 0; padding: 2px 2px 3px; font: inherit; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  color: #2b1709; background: linear-gradient(#fdf3de, #f2dcae); border: 3px solid #2b1709; box-shadow: inset 0 -3px 0 #d9b87a, 0 3px 0 #2b1709; }
.td-buy:hover { background: linear-gradient(#fffaf0, #f8e6c2); }
.td-buy.on { background: linear-gradient(#fff3b0, #f6d36b); box-shadow: inset 0 -3px 0 #e0a82a, 0 0 0 3px #f6d36b; }
.td-buy img { width: 52px; height: auto; image-rendering: pixelated; pointer-events: none; margin-top: -4px; }
.td-tall .td-buy img { width: 46px; }
.td-buy span { font-weight: 900; font-size: .8rem; line-height: 1.05; }
.td-buy b { font-size: .78rem; font-weight: 900; color: #3f6b3a; font-variant-numeric: tabular-nums; }
.td-buy kbd { position: absolute; top: 2px; left: 2px; min-width: 0; padding: 0 3px; font-size: .6rem; line-height: 1.3; box-shadow: none; border-width: 1px; }
.td-tall .td-buy kbd { display: none; }
.td-buy.poor { filter: grayscale(.55); }
.td-buy.poor b { color: #c8453d; }
.td-shopinfo { margin: 0; flex: 1; min-height: 0; overflow: auto; font-size: .78rem; line-height: 1.35; padding: 6px 8px; background: rgba(43,23,9,.55); border: 2px solid #2b1709; }
.td-shopinfo em { font-style: normal; font-weight: 800; color: #f6d36b; }
.td-play { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.td-tall .td-play { flex-direction: column-reverse; justify-content: center; grid-column: 2; grid-row: 1 / 3; }
.td-go { position: relative; width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; font: 900 1.9rem/1 "Nunito", sans-serif; cursor: pointer; color: #fff;
  background: radial-gradient(circle at 35% 30%, #b8e07a, #5b8a4a 70%); border: 4px solid #2b1709; box-shadow: 0 4px 0 #2b1709, inset 0 -4px 0 rgba(0,0,0,.2); text-shadow: 0 2px 0 #2b1709; }
.td-go:active { transform: translateY(3px); box-shadow: 0 1px 0 #2b1709; }
.td-go[data-state="run1"] { background: radial-gradient(circle at 35% 30%, #d6d1ca, #6f6a64 70%); font-size: 1.3rem; letter-spacing: -.12em; }
.td-go[data-state="run2"], .td-go[data-state="run3"] { background: radial-gradient(circle at 35% 30%, #fff3b0, #e0a82a 70%); font-size: 1.3rem; letter-spacing: -.12em; }
.td-go small { position: absolute; bottom: 6px; font-size: .7rem; letter-spacing: 0; }
.td-go[data-state="won"] { background: radial-gradient(circle at 35% 30%, #fff3b0, #e0a82a 70%); }
.td-auto { padding: 4px 8px; font: 800 .8rem "Nunito", sans-serif; cursor: pointer; color: #fdf3de; background: rgba(43,23,9,.6); border: 2px solid #2b1709; }
.td-auto[aria-pressed="true"] { background: #5b8a4a; color: #fff; }
/* panneau d'améliorations */
.td-upg { position: absolute; z-index: 6; display: flex; flex-direction: column; gap: 6px; padding: 8px; overflow-y: auto; overscroll-behavior: contain;
  color: #2b1709; background: #fdf3de; border: 4px solid #2b1709; box-shadow: 0 5px 0 rgba(0,0,0,.35); }
.td-upg[hidden] { display: none; }
.td-wide .td-upg { top: 46px; width: 250px; max-height: calc(100% - 54px); }
.td-wide .td-upg.td-left { left: 8px; }
.td-wide .td-upg.td-right { left: calc(var(--td-field-w) - 258px); }
.td-tall .td-upg { left: 0; right: 0; bottom: 0; height: var(--td-bottom, 40%); border-width: 4px 0 0; box-shadow: none; }
.tu-head { display: flex; align-items: center; gap: 8px; }
.tu-head img { width: 56px; image-rendering: pixelated; background: radial-gradient(#5b8a4a, #2f4f2a); border: 3px solid #2b1709; }
.tu-head div { flex: 1; display: grid; line-height: 1.15; }
.tu-head strong { font-size: 1.15rem; }
.tu-head span { font-size: .72rem; color: var(--ink-soft, #6b4f3a); }
.tu-x { width: 30px; height: 30px; font: inherit; font-weight: 900; cursor: pointer; background: #f2dcae; color: #2b1709; border: 2px solid #2b1709; align-self: start; }
.tu-target { display: flex; align-items: center; gap: 4px; }
.tu-target span { flex: 1; text-align: center; font-weight: 900; font-size: .85rem; padding: 4px; background: #2b1709; color: #fdf3de; }
.tu-target button { width: 30px; height: 28px; font: inherit; font-weight: 900; cursor: pointer; color: #2b1709; background: #f2dcae; border: 2px solid #2b1709; }
.tu-path { display: grid; grid-template-columns: 74px 1fr; gap: 4px; padding-left: 6px; border-left: 6px solid var(--pc); }
.tu-cur { display: grid; align-content: center; gap: 2px; line-height: 1.1; }
.tu-cur small { font-size: .62rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; color: #6b4f3a; }
.tu-cur strong { font-size: .72rem; }
.tu-pips { display: flex; gap: 2px; }
.tu-pips i { width: 10px; height: 10px; background: #f2dcae; border: 2px solid #2b1709; }
.tu-pips i.on { background: var(--pc); }
.tu-pips i.lock { background: repeating-linear-gradient(45deg, #c99a6a 0 2px, transparent 2px 4px); }
.tu-next { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: 1fr auto; column-gap: 4px; align-items: center; padding: 3px 5px 3px 3px; text-align: left; font: inherit; color: #fff; min-height: 52px;
  background: #5b8a4a; border: 3px solid #2b1709; box-shadow: inset 0 -3px 0 rgba(0,0,0,.2); }
button.tu-next { cursor: pointer; }
button.tu-next:hover { filter: brightness(1.08); }
button.tu-next:active { transform: translateY(2px); }
.tu-next img { grid-row: 1 / 3; width: 34px; image-rendering: pixelated; background: rgba(0,0,0,.18); }
.tu-txt { display: grid; line-height: 1.1; min-width: 0; }
.tu-txt strong { font-size: .78rem; text-shadow: 0 1px 0 #2b1709; }
.tu-txt small { font-size: .62rem; opacity: .95; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tu-next b { justify-self: end; font-size: .78rem; font-weight: 900; text-shadow: 0 1px 0 #2b1709; }
.tu-next.poor { background: #a8453a; }
.tu-next.lock, .tu-next.max { display: grid; grid-template-columns: 1fr; align-content: center; text-align: center; color: #6b4f3a; background: #e8d6b0; box-shadow: none; border-style: dashed; font-size: .72rem; }
.tu-next.max { color: #8a5a10; background: #fff3b0; border-style: solid; }
.tu-foot { display: flex; align-items: center; gap: 6px; margin-top: auto; }
.tu-foot span { flex: 1; font-size: .72rem; font-weight: 800; color: #3f6b3a; }
.tu-sell { padding: 6px 10px; font: 900 .85rem "Nunito", sans-serif; cursor: pointer; color: #2b1709; background: linear-gradient(#ffe27a, #e0a82a); border: 3px solid #2b1709; box-shadow: 0 3px 0 #2b1709; }
.td-tall .tu-path { grid-template-columns: 96px 1fr; }
/* pouvoirs */
.td-abil { position: absolute; z-index: 4; left: 8px; bottom: calc(var(--td-shop-h, 0px) + 8px); display: flex; gap: 6px; flex-wrap: wrap; max-width: calc(var(--td-field-w, 100%) - 16px); }
.td-abil[hidden] { display: none; }
.td-ab { position: relative; width: 52px; height: 52px; border-radius: 50%; padding: 0; overflow: hidden; cursor: pointer; background: #2b1709; border: 3px solid #2b1709; box-shadow: 0 3px 0 rgba(0,0,0,.4); }
.td-ab img { width: 100%; image-rendering: pixelated; }
.td-ab::after { content: ""; position: absolute; inset: 0; background: conic-gradient(rgba(20,12,6,.72) var(--cd, 0%), transparent 0); }
.td-ab span { position: absolute; left: 0; right: 0; bottom: 2px; font: 900 .5rem "Nunito", sans-serif; color: #fdf3de; text-shadow: 0 1px 0 #2b1709; z-index: 1; }
.td-ab.ready { border-color: #f6d36b; animation: td-pulse 1s steps(2) infinite; }
@keyframes td-pulse { 50% { box-shadow: 0 0 0 3px #f6d36b; } }
/* menus */
.td-maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.td-map { display: grid; gap: 4px; padding: 6px; text-align: left; font: inherit; cursor: pointer; color: var(--ink); background: var(--panel-2); border: 3px solid var(--line); box-shadow: 0 3px 0 var(--depth); }
.td-map img { width: 100%; aspect-ratio: 3 / 2; image-rendering: pixelated; border: 2px solid var(--line); }
.td-map span { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
.td-map em { font-style: normal; font-size: .72rem; font-weight: 800; color: var(--orange-dk); text-transform: uppercase; }
.td-map small { font-size: .72rem; color: var(--ink-soft); }
.td-map.on, .td-mode.on { border-color: var(--orange-dk); background: #fff6dc; outline: 3px solid #f6d36b; outline-offset: -7px; }
.td-medals { justify-content: flex-start !important; }
.td-medal { width: 12px; height: 12px; border: 2px solid var(--line); background: var(--panel); opacity: .4; }
.td-medal.on { opacity: 1; }
.td-m-facile.on { background: #c98d4a; } .td-m-normal.on { background: #d6d1ca; } .td-m-difficile.on { background: #f6d36b; } .td-m-survie.on { background: #c9b3ff; }
.td-modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.td-mode { display: grid; gap: 2px; padding: 8px 6px; font: inherit; cursor: pointer; color: var(--ink); background: var(--panel-2); border: 3px solid var(--line); box-shadow: 0 3px 0 var(--depth); }
.td-mode span { font-size: .75rem; color: var(--ink-soft); }
.td-codex { display: grid; gap: 6px; text-align: left; }
.td-cx { background: var(--panel-2); border: 3px solid var(--line); padding: 6px 8px; }
.td-cx summary { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.td-cx summary img { width: 34px; image-rendering: pixelated; background: #1f3a2b; padding: 2px; border: 2px solid var(--line); }
.td-cx small { color: var(--ink-soft); }
.td-cxpath { margin-top: 6px; font-size: .85rem; }
.td-cxpath ol { margin: 2px 0 0; padding-left: 1.4em; display: grid; gap: 2px; }
.td-cxpath b { text-transform: uppercase; font-size: .78rem; letter-spacing: .05em; padding: 0 4px; border-left: 6px solid; }
.td-cxpath.td-p0 b { border-color: #f2b05e; } .td-cxpath.td-p1 b { border-color: #9cd06a; } .td-cxpath.td-p2 b { border-color: #9fd8ff; }
.td-gain { font-weight: 900; color: var(--orange-dk); }
@media (max-width: 760px) {
  .td-stage { height: calc(100svh - 100px); }
  .td-modes { grid-template-columns: repeat(2, 1fr); }
  .td-maps { grid-template-columns: repeat(2, 1fr); }
  .td-pill { font-size: .9rem; padding: 0 7px; }
  .td-go { width: 58px; height: 58px; }
}

/* ---------- Merger : choix Solo / Coop ---------- */
.game-stage[hidden] { display: none !important; }
.game-help[hidden] { display: none; }
.mg-modes { display: inline-flex; gap: 4px; padding: 4px; background: var(--panel-2); border: 3px solid var(--line); box-shadow: 0 3px 0 var(--depth); margin-left: auto; }
.mg-modes button {
  font: inherit; font-weight: 800; font-size: .95rem; padding: 6px 14px; border: 0; cursor: pointer;
  background: transparent; color: var(--ink-soft); transition: background .18s, color .18s, transform .18s;
}
.mg-modes button:hover { color: var(--ink); transform: translateY(-1px); }
.mg-modes button.is-on { background: var(--orange); color: #2b1709; box-shadow: inset 0 -3px 0 var(--orange-dk); }
.mg-modes button[data-mode="coop"].is-on { background: #3fb6c6; box-shadow: inset 0 -3px 0 #1d6f7a; }
@media (max-width: 640px) { .mg-modes { order: 3; width: 100%; } .mg-modes button { flex: 1; } }

/* ---------- Merger Coop ---------- */
.mc-stage { background: #27465f; height: min(82vh, 760px); }
.mc-stage .game-canvas { cursor: crosshair; }
.mc-stage .game-overlay { background: radial-gradient(ellipse at center, rgba(20, 35, 40, .35), rgba(10, 20, 25, .7)); }
.mc-stage .mc-hud { top: auto; bottom: 8px; right: 50%; transform: translateX(50%); }
.mc-card { width: min(640px, 100%); border-radius: 0; }
.mc-card.mc-in { animation: mc-pop .38s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes mc-pop { from { transform: scale(.86) translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.mc-title { font-size: clamp(1.6rem, 4vw, 2.3rem); margin-bottom: .2em; }
.mc-title span { color: #2b9fb0; }
.mc-sub { max-width: 46ch; margin: 0 auto 10px; }
.mc-cast { display: flex; justify-content: center; flex-wrap: wrap; gap: 2px; margin: 4px 0 10px; }
.mc-who img { display: block; animation: mc-bob 2.4s ease-in-out infinite; }
.mc-who:nth-child(2n) img { animation-delay: -.6s; }
.mc-who:nth-child(3n) img { animation-delay: -1.2s; }
.mc-who img:hover { animation: mc-jump .5s ease; }
@keyframes mc-bob { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-5px) scale(.97, 1.03); } }
@keyframes mc-jump { 0% { transform: scale(1); } 30% { transform: scale(1.15, .85); } 60% { transform: translateY(-12px) scale(.9, 1.1); } 100% { transform: none; } }
.mc-players { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; margin: 6px 0; }
.mc-p { padding: 10px 12px; border: 3px solid var(--line); display: grid; gap: 4px; font-size: .9rem; background: var(--panel-2); }
.mc-p strong { font-size: 1rem; }
.mc-p small { color: var(--ink-soft); font-size: .75rem; }
.mc-p1 { box-shadow: inset 6px 0 0 #f08a3c; }
.mc-p2 { box-shadow: inset -6px 0 0 #3fb6c6; }
.mc-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0 6px; }
.mc-card .btn { transition: transform .15s cubic-bezier(.2, 1.6, .4, 1), filter .15s; }
.mc-card .btn:hover { transform: translateY(-2px) scale(1.04); }
.mc-card .btn:active { transform: translateY(1px) scale(.97); }
.mc-go { font-size: 1.15rem; padding: 12px 26px; animation: mc-breathe 2.2s ease-in-out infinite; }
.mc-go small { font-size: .75rem; opacity: .8; }
@keyframes mc-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.mc-more { text-align: left; margin: 6px 0; }
.mc-more summary { cursor: pointer; font-weight: 800; }
.mc-settings { display: grid; gap: 8px; margin: 10px 0; text-align: left; }
.mc-settings label { display: grid; grid-template-columns: 7.5em 1fr; align-items: center; gap: 10px; font-weight: 700; font-size: .92rem; }
.mc-settings label.mc-check { grid-template-columns: auto 1fr; }
.mc-settings input[type="range"] { width: 100%; accent-color: var(--orange); }
.mc-score { font-size: clamp(2.2rem, 7vw, 3.4rem); font-weight: 900; margin: 0; color: var(--orange) !important; animation: mc-pop .5s .15s cubic-bezier(.2, 1.6, .4, 1) both; }
.mc-stats { list-style: none; padding: 0; margin: 10px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mc-stats li { padding: 8px 4px; background: var(--panel-2); border: 3px solid var(--line); display: grid; gap: 2px; }
.mc-stats b { font-size: 1.4rem; }
.mc-stats span { font-size: .72rem; color: var(--ink-soft); line-height: 1.2; }
@media (max-width: 560px) { .mc-players { grid-template-columns: 1fr; } .mc-stats { grid-template-columns: repeat(2, 1fr); } }
@media (prefers-reduced-motion: reduce) { .mc-who img, .mc-go, .mc-card.mc-in { animation: none; } }
/* ---------- mini jeu : King Dice ---------- */
.game-info:has(> .game-help:only-child) { grid-template-columns: 1fr; }
.kd-stage { background: #3a3266; height: min(86vh, 800px); min-height: 480px; }
.kd-stage .game-canvas { cursor: default; }
.kd-stage .game-overlay { background: radial-gradient(ellipse at center, rgba(40, 25, 70, .35), rgba(20, 10, 40, .72)); }
.kd-stage.is-full .fs-exit { display: grid; }
.game-stage .game-hud.kd-hud { inset: 8px 8px auto auto; display: flex; gap: 6px; padding: 0; }
.kd-hud .hud-btn { border-radius: 10px; background: rgba(36, 26, 58, .85); border-color: #1c1430; transition: transform .15s cubic-bezier(.2, 1.6, .4, 1), background .15s; }
.kd-hud .hud-btn:hover { transform: scale(1.1); background: #4a3a72; }
.kd-hud .hud-btn:active { transform: scale(.94); }

.kd-launch {
  position: absolute; z-index: 2; transform: translate(-50%, -50%) scale(var(--kd-s, 1));
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; white-space: nowrap;
  font: 900 1.15rem/1 Nunito, sans-serif; color: #4a2a00; letter-spacing: .02em; text-transform: uppercase;
  background: linear-gradient(#ffe680, #ffc93c); border: 3px solid #3a2c4c; border-radius: 999px; cursor: pointer;
  box-shadow: 0 5px 0 #3a2c4c, 0 0 0 0 rgba(255, 214, 90, .6);
  animation: kd-launch 1.8s ease-in-out infinite;
  transition: filter .15s;
}
.kd-launch[hidden] { display: none; }
.kd-launch b { font-size: 1.35rem; }
.kd-launch small { font-size: .7rem; padding: 2px 6px; border-radius: 6px; background: rgba(58, 44, 76, .18); }
.kd-launch:hover { filter: brightness(1.08); animation-play-state: paused; }
.kd-launch:active { transform: translate(-50%, -46%) scale(calc(var(--kd-s, 1) * .96)); box-shadow: 0 2px 0 #3a2c4c; }
.kd-launch:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
@keyframes kd-launch {
  0%, 100% { transform: translate(-50%, -50%) scale(var(--kd-s, 1)); box-shadow: 0 5px 0 #3a2c4c, 0 0 0 0 rgba(255, 214, 90, .55); }
  50% { transform: translate(-50%, -54%) scale(calc(var(--kd-s, 1) * 1.04)); box-shadow: 0 7px 0 #3a2c4c, 0 0 0 12px rgba(255, 214, 90, 0); }
}

.kd-tip {
  position: absolute; z-index: 3; left: 50%; bottom: 8px; transform: translateX(-50%);
  width: min(560px, calc(100% - 24px)); padding: 10px 14px 10px; text-align: left;
  background: #fffaf0; color: #3a2c4c; border: 3px solid #3a2c4c; border-radius: 16px; box-shadow: 0 5px 0 rgba(30, 20, 50, .6);
}
.kd-tip[hidden] { display: none; }
.kd-tip.kd-in { animation: kd-pop .4s cubic-bezier(.2, 1.5, .4, 1) both; }
.kd-tip strong { display: block; font-size: 1.05rem; margin-right: 3.5em; }
.kd-tip p { margin: 4px 0 8px; font-size: .88rem; color: #5a4a6c; line-height: 1.35; }
.kd-tip-n { position: absolute; right: 12px; top: 10px; font-weight: 900; font-size: .8rem; color: #fff; background: #78aef7; padding: 2px 8px; border-radius: 999px; }
.kd-tip-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.kd-tip .btn { margin: 0; }
@keyframes kd-pop { from { transform: translateX(-50%) scale(.85) translateY(10px); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }

.kd-card { width: min(660px, 100%); border-radius: 20px; }
.kd-card.kd-in { animation: kd-card .4s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes kd-card { from { transform: scale(.86) translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.kd-card .btn { border-radius: 12px; transition: transform .15s cubic-bezier(.2, 1.6, .4, 1), filter .15s; }
.kd-card .btn:hover { transform: translateY(-2px) scale(1.04); }
.kd-card .btn:active { transform: translateY(1px) scale(.96); }
.kd-logo { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 2px; }
.kd-logo img { animation: kd-bob 2.6s ease-in-out infinite; filter: drop-shadow(0 4px 0 rgba(58, 44, 76, .25)); }
.kd-title { margin: 0; font-family: "Londrina", "Nunito", sans-serif; font-size: clamp(2.6rem, 8vw, 4.2rem); line-height: .9; letter-spacing: .02em; }
.kd-title .kd-k { color: #4f86d8; text-shadow: 0 4px 0 #1f3f78; }
.kd-title .kd-d { color: #f08a3c; text-shadow: 0 4px 0 #7c370c; display: inline-block; animation: kd-tilt 3s ease-in-out infinite; }
@keyframes kd-tilt { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(4deg) translateY(-3px); } }
.kd-sub { max-width: 48ch; margin: 6px auto 8px; }
.kd-cast { display: flex; justify-content: center; flex-wrap: wrap; gap: 2px; margin: 4px 0 6px; }
.kd-who img { display: block; animation: kd-bob 2.4s ease-in-out infinite; }
.kd-who:nth-child(2n) img { animation-delay: -.8s; }
.kd-who:nth-child(3n) img { animation-delay: -1.6s; }
.kd-who img:hover { animation: kd-jump .5s ease; }
@keyframes kd-bob { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-5px) scale(.97, 1.03); } }
@keyframes kd-jump { 0% { transform: scale(1); } 30% { transform: scale(1.18, .82); } 60% { transform: translateY(-14px) scale(.9, 1.12); } 100% { transform: none; } }
.kd-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0 6px; }
.kd-actions.kd-col { flex-direction: column; align-items: center; }
.kd-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.kd-go { font-size: 1.2rem; padding: 13px 30px; animation: kd-breathe 2.2s ease-in-out infinite; }
.kd-go small { font-size: .75rem; opacity: .8; }
@keyframes kd-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.kd-h { font-size: clamp(1.5rem, 4vw, 2rem); margin-bottom: .3em; }
.kd-steps { text-align: left; margin: 0 0 10px; padding-left: 1.3em; display: grid; gap: 4px; font-size: .95rem; }
.kd-pieces { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.kd-pieces > div { display: grid; justify-items: center; gap: 4px; padding: 8px 6px; background: var(--panel-2); border: 3px solid var(--line); border-radius: 14px; }
.kd-pieces > div > img:first-child { margin-bottom: -6px; }
.kd-pieces span { font-size: .8rem; color: var(--ink-soft); line-height: 1.3; }
.kd-pat { border-radius: 6px; }
.kd-enemies { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; margin: 6px 0; font-size: .82rem; font-weight: 700; }
.kd-enemies span { display: inline-flex; align-items: center; gap: 2px; }
.kd-players { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; margin: 8px 0; }
.kd-p { padding: 10px 12px; border: 3px solid var(--line); border-radius: 12px; display: grid; gap: 4px; font-size: .88rem; background: var(--panel-2); }
.kd-p strong { font-size: 1rem; }
.kd-p small { color: var(--ink-soft); font-size: .75rem; }
.kd-p1 { box-shadow: inset 6px 0 0 #78aef7; }
.kd-p2 { box-shadow: inset -6px 0 0 #ffa257; }
.kd-settings { display: grid; gap: 10px; margin: 10px 0; text-align: left; }
.kd-settings label { display: grid; grid-template-columns: 7.5em 1fr; align-items: center; gap: 10px; font-weight: 700; font-size: .92rem; }
.kd-settings label.kd-check { grid-template-columns: auto 1fr; cursor: pointer; }
.kd-settings input[type="range"] { width: 100%; accent-color: #f08a3c; }
.kd-settings input[type="checkbox"] { width: 18px; height: 18px; accent-color: #f08a3c; }
.kd-set-row { margin: 0; }
.kd-big { font-size: 1.3rem; margin: 0; }
.kd-big b { font-size: 2rem; color: #4f86d8; }
.kd-score { font-size: clamp(2.2rem, 7vw, 3.2rem); font-weight: 900; margin: 0; color: var(--orange) !important; animation: kd-card .5s .15s cubic-bezier(.2, 1.6, .4, 1) both; }
.kd-score small { font-size: 1rem; color: var(--ink-soft); }
.kd-stats { list-style: none; padding: 0; margin: 10px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kd-stats li { padding: 8px 4px; background: var(--panel-2); border: 3px solid var(--line); border-radius: 12px; display: grid; gap: 2px; }
.kd-stats b { font-size: 1.4rem; }
.kd-stats span { font-size: .72rem; color: var(--ink-soft); line-height: 1.2; }
.kd-split { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 4px 0; }
.kd-tag { font-weight: 800; font-size: .85rem; padding: 4px 10px; border-radius: 999px; color: #fff; }
.kd-t1 { background: #4f86d8; }
.kd-t2 { background: #e57a2e; }
@media (max-width: 560px) { .kd-players, .kd-pieces { grid-template-columns: 1fr; } .kd-stats { grid-template-columns: repeat(2, 1fr); } }
@media (prefers-reduced-motion: reduce) { .kd-who img, .kd-go, .kd-card.kd-in, .kd-launch, .kd-logo img, .kd-title .kd-d, .kd-tip.kd-in { animation: none; } }

/* ---------- page Jeux (jeux web regroupés) ---------- */
.kicker a { color: inherit; text-decoration: none; }
.kicker a:hover { text-decoration: underline; }
.card-media a { display: block; height: 100%; }
.games-intro { margin: 0 0 32px; }
.room-players .ver-bad { color: var(--berry); font-weight: 800; margin-left: 4px; }
.net-err .btn { margin-left: 6px; vertical-align: middle; }
/* Merger Coop 2.1 : choix du mode, salon en ligne, pouvoirs */
.mc-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.mc-mode {
  display: grid; gap: 4px; padding: 14px 12px; text-align: center; cursor: pointer; font: inherit; color: var(--ink);
  background: var(--panel-2); border: 3px solid var(--line); box-shadow: 0 4px 0 var(--depth);
  transition: transform .15s cubic-bezier(.2, 1.6, .4, 1), box-shadow .15s;
}
.mc-mode b { font-size: 1.15rem; }
.mc-mode span { font-size: .85rem; color: var(--ink-soft); }
button.mc-mode:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 7px 0 var(--depth); }
button.mc-mode:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--depth); }
.mc-mode:first-child { background: #fbd9b8; }
.mc-mode-net { background: #c8eef2; }
[data-theme="dark"] .mc-mode:first-child { background: #4a3322; }
[data-theme="dark"] .mc-mode-net { background: #1f4a50; }
.mc-join { cursor: default; }
.mc-join span { display: flex; gap: 6px; justify-content: center; align-items: center; }
.mc-join input, .mc-name input { font: inherit; font-weight: 800; padding: 6px 10px; border: 3px solid var(--line); background: var(--panel); color: var(--ink); }
.mc-join input { width: 6.5em; text-align: center; letter-spacing: .2em; text-transform: uppercase; }
.mc-name { display: flex; gap: 8px; align-items: center; justify-content: center; }
.mc-name label { font-weight: 800; }
.mc-code { font-size: 2.6rem; font-weight: 900; letter-spacing: .25em; margin: 0 0 4px; color: #2b9fb0 !important; }
.mc-roster { list-style: none; padding: 0; margin: 10px auto; display: grid; gap: 6px; max-width: 360px; text-align: left; }
.mc-roster li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 3px dashed var(--depth); color: var(--ink-soft); }
.mc-roster li.on { border-style: solid; border-color: var(--line); color: var(--ink); font-weight: 800; background: var(--panel-2); }
.mc-roster small { font-weight: 600; }
.mc-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.mc-dot1 { background: #f08a3c; } .mc-dot2 { background: #3fb6c6; }
.mc-err { color: var(--berry) !important; font-weight: 800; }
.mc-powers { display: grid; gap: 4px; margin: 8px 0; text-align: left; font-size: .88rem; }
.mc-powers span { display: flex; align-items: center; gap: 6px; }
.mc-powers img { width: 30px; height: 30px; flex: none; }
.mc-powers b { white-space: nowrap; }
.mc-go[disabled] { opacity: .5; animation: none; cursor: not-allowed; }
@media (max-width: 560px) { .mc-modes { grid-template-columns: 1fr; } .mc-powers b { white-space: normal; } }

/* ---------- cartes compactes sur mobile (jeux, bibliothèque, accueil) ---------- */
@media (max-width: 600px) {
  .grid { gap: 14px; }
  .card { flex-direction: row; margin: 4px 4px 10px; }
  .card-media { flex: 0 0 104px; aspect-ratio: auto; border-bottom: 0; border-right: 4px solid var(--line); }
  .card-body { padding: 10px 12px; min-width: 0; }
  .card-title { font-size: 1.1rem; }
  .card-meta { font-size: .8rem; margin-bottom: .3em; }
  .card-text {
    font-size: .9rem; margin-bottom: 8px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .card .tags, .card .badge:not(.badge-play) { display: none; }
  .card .badge-play { top: auto; bottom: 6px; left: 6px; right: auto; font-size: .6rem; padding: 2px 5px; }
  .card .btn-small { padding: 6px 12px; font-size: .9rem; }
  /* bibliothèque : étiquettes sur une seule ligne qui défile sur le côté */
  .library-tools { gap: 8px; margin-bottom: 20px; grid-template-columns: minmax(0, 1fr); }
  .tags-row { flex-wrap: nowrap; overflow-x: auto; gap: 8px; padding: 0 4px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tags-row::-webkit-scrollbar { display: none; }
  .tags-row .chip { flex: none; }
}

/* ---------- Échecs (echecs.html) ---------- */
.chess {
  --sq-lt: #f3e2bf; --sq-dk: #7a9a5a; --sq-ink-lt: #5b7a43; --sq-ink-dk: #f3e2bf;
  --sq-last: rgba(246, 211, 107, .55); --sq-sel: rgba(232, 135, 58, .55); --sq-dot: rgba(43, 23, 9, .28);
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; min-height: 520px;
}
.chess[data-board-theme="bois"] { --sq-lt: #f0d9b5; --sq-dk: #b58863; --sq-ink-lt: #b58863; --sq-ink-dk: #f0d9b5; }
.chess[data-board-theme="ardoise"] { --sq-lt: #dee3e6; --sq-dk: #7d8c9a; --sq-ink-lt: #6d7c8a; --sq-ink-dk: #eef1f3; --sq-last: rgba(155, 199, 0, .45); }
.chess[data-board-theme="rose"] { --sq-lt: #fbe7e4; --sq-dk: #d98e94; --sq-ink-lt: #c27077; --sq-ink-dk: #fbe7e4; }
.chess-main { width: 100%; max-width: min(640px, calc(100svh - 300px)); min-width: 260px; justify-self: center; }
.chess-board-wrap {
  position: relative; aspect-ratio: 1 / 1; width: 100%;
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--line), 0 var(--px) 0 0 var(--line),
    calc(var(--px) * -1) 0 0 0 var(--line), var(--px) 0 0 0 var(--line),
    0 calc(var(--px) * 3) 0 0 var(--depth);
  margin: var(--px) var(--px) calc(var(--px) * 4);
}
.chess-board { position: absolute; inset: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: pointer; }
.chess-board .sq { position: absolute; width: 12.5%; height: 12.5%; }
.chess-board .sq.lt { background: var(--sq-lt); }
.chess-board .sq.dk { background: var(--sq-dk); }
.chess-board .sq.last::before, .chess-board .sq.sel::before, .chess-board .sq.over::before { content: ""; position: absolute; inset: 0; background: var(--sq-last); }
.chess-board .sq.sel::before { background: var(--sq-sel); }
.chess-board .sq.over::before { background: transparent; box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .75); }
.chess-board .sq.chk { background-image: radial-gradient(circle, rgba(230, 40, 20, .95) 0%, rgba(230, 40, 20, .6) 35%, rgba(230, 40, 20, 0) 72%); }
.chess-board .sq.dot::after { content: ""; position: absolute; left: 50%; top: 50%; width: 30%; height: 30%; transform: translate(-50%, -50%); border-radius: 50%; background: var(--sq-dot); z-index: 3; pointer-events: none; }
.chess-board .sq.ring::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, transparent 0 62%, var(--sq-dot) 63% 72%, transparent 73%); z-index: 3; pointer-events: none; }
.chess-board .co { position: absolute; font: 800 clamp(.55rem, 1.6vw, .78rem)/1 "Nunito", sans-serif; pointer-events: none; z-index: 1; }
.chess-board .co-r { left: 3px; top: 3px; }
.chess-board .co-f { right: 4px; bottom: 3px; }
.chess-board .sq.lt .co { color: var(--sq-ink-lt); }
.chess-board .sq.dk .co { color: var(--sq-ink-dk); }
.cp-layer { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.cp { position: absolute; left: 0; top: 0; width: 12.5%; height: 12.5%; background: no-repeat center / 92%; will-change: transform; }
.cp.drag { z-index: 10; background-size: 108%; filter: drop-shadow(0 6px 4px rgba(0, 0, 0, .35)); }
.chess-arrows { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; }
.chess-arrows .hint { fill: rgba(47, 127, 122, .82); }
.cpi { display: inline-block; width: 1.2em; height: 1.2em; background: no-repeat center / contain; vertical-align: -.25em; }
.cpi.cap { width: 18px; height: 18px; margin-right: -7px; }

.chess-promo { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; background: rgba(20, 30, 20, .45); }
.chess-promo[hidden] { display: none; }
.chess-promo-box { background: var(--panel); border: var(--px) solid var(--line); box-shadow: 0 var(--px) 0 var(--depth); padding: 10px 12px; text-align: center; }
.chess-promo-box p { margin: 0 0 6px; font-weight: 800; }
.chess-promo-box div { display: flex; gap: 6px; }
.chess-promo-box [data-promo-t] { width: clamp(52px, 11vw, 72px); height: clamp(52px, 11vw, 72px); padding: 4px; background: var(--panel-2); border: 3px solid var(--line); cursor: pointer; }
.chess-promo-box [data-promo-t]:hover, .chess-promo-box [data-promo-t]:focus-visible { background: var(--orange-2); }
.chess-promo-box .cpi { width: 100%; height: 100%; }
.chess-promo-x { margin-top: 8px; background: none; border: 0; font: inherit; color: var(--ink-soft); text-decoration: underline; cursor: pointer; }

.chess-bar { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 6px; font-weight: 800; }
.chess-bar.turn .cb-name { color: var(--orange-dk); }
:root[data-theme="dark"] .chess-bar.turn .cb-name { color: var(--orange-2); }
.cb-swatch { flex: none; width: 16px; height: 16px; border: 3px solid var(--line); }
.cb-swatch.w { background: #fbf1dc; }
.cb-swatch.b { background: #3b2a1f; }
.cb-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.cb-think { font-style: normal; font-weight: 700; color: var(--ink-soft); font-size: .85rem; }
.cb-think b { animation: chess-dots 1.2s infinite steps(1); opacity: 0; }
.cb-think b:nth-child(2) { animation-delay: .3s; }
.cb-think b:nth-child(3) { animation-delay: .6s; }
@keyframes chess-dots { 0%, 100% { opacity: 0; } 30%, 90% { opacity: 1; } }
.cb-dot { width: 9px; height: 9px; border-radius: 50%; background: #9a8f80; flex: none; }
.cb-dot.on { background: #4caf50; }
.cb-caps { flex: 1; display: flex; align-items: center; flex-wrap: wrap; min-width: 0; padding-left: 4px; }
.cb-diff { margin-left: 12px; font-size: .85rem; color: var(--ink-soft); }
.cb-clock { flex: none; margin-left: auto; min-width: 78px; text-align: right; padding: 4px 10px; font: 900 1.15rem/1.2 "Nunito", sans-serif; font-variant-numeric: tabular-nums; background: var(--panel-2); color: var(--ink-soft); border: 3px solid var(--line); }
.cb-clock.run { background: var(--panel); color: var(--ink); box-shadow: 0 3px 0 var(--depth); }
.cb-clock.low.run { background: var(--berry); color: #fff; }

.chess-side { padding: 16px; display: grid; gap: 12px; position: sticky; top: 90px; }
.chess-room { margin: 0; font-size: .9rem; color: var(--ink-soft); }
.chess-room[hidden] { display: none; }
.chess-code-sm { letter-spacing: .12em; color: var(--ink); }
.chess-status { margin: 0; font-weight: 700; min-height: 2.6em; }
.chess-status .win { color: var(--moss); }
.chess-status .lose { color: var(--berry); }
.chess-status .warn { color: var(--berry); font-size: .9rem; }
.chess-status .muted { color: var(--ink-soft); font-size: .88rem; font-weight: 600; }
.chess-offer { background: var(--panel-2); padding: 10px; border: 3px solid var(--line); }
.chess-offer[hidden] { display: none; }
.chess-offer p { margin: 0 0 8px; }
.chess-offer .btn-row { gap: 8px; }
.chess-moves { list-style: none; margin: 0; padding: 4px; height: min(300px, 34vh); overflow-y: auto; background: var(--panel-2); border: 3px solid var(--line); font-variant-numeric: tabular-nums; }
.chess-moves li { display: grid; grid-template-columns: 2.4em 1fr 1fr; align-items: center; }
.chess-moves li:nth-child(even) { background: rgba(0, 0, 0, .04); }
.chess-moves .mn { color: var(--ink-soft); font-size: .85rem; padding-left: 4px; }
.chess-moves button { font: 700 .95rem/1.6 "Nunito", sans-serif; text-align: left; padding: 0 6px; background: none; border: 0; color: var(--ink); cursor: pointer; }
.chess-moves button:hover { background: var(--panel); }
.chess-moves button.cur { background: var(--orange-2); color: #2b1709; }
.chess-moves .empty, .chess-moves .res { display: block; padding: 6px; color: var(--ink-soft); text-align: center; font-weight: 800; }
.chess-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.chess-actions .btn-small { padding: 6px 10px; font-size: .88rem; }
.chess-actions .btn.confirm { --b: var(--berry); color: #fff; }
.chess-nav { display: flex; gap: 6px; width: 100%; }
.chess-nav .btn { flex: 1; display: inline-flex; justify-content: center; text-align: center; padding: 2px 0 6px; font-size: 1.3rem; line-height: 1; }

.chess-overlay { z-index: 20; align-items: start; }
.chess-card { width: min(560px, 100%); margin: auto; }
.chess-card-bot { width: min(640px, 100%); }
.chess-card-online { width: min(680px, 100%); }
.chess-modes { display: grid; gap: 10px; margin: 14px 0; }
.chess-mode {
  display: flex; align-items: center; gap: 14px; text-align: left; padding: 12px 14px; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--panel-2); border: var(--px) solid var(--line); box-shadow: 0 var(--px) 0 var(--depth); transition: transform .08s steps(2);
}
.chess-mode:hover, .chess-mode:focus-visible { transform: translateY(-2px); border-color: var(--orange-dk); background: var(--panel); }
.chess-mode.resume { background: var(--orange-2); color: #2b1709; }
.chess-mode .cm-ic { font-size: 1.7rem; width: 44px; text-align: center; flex: none; }
.chess-mode strong { display: block; font-size: 1.08rem; }
.chess-mode small { color: var(--ink-soft); font-size: .9rem; }
.chess-mode.resume small { color: #4a2e1c; }
.chess-prefs { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: center; font-size: .92rem; color: var(--ink-soft); }
.chess-prefs select { font: inherit; margin-left: 6px; padding: 3px 6px; background: var(--panel); color: var(--ink); border: 3px solid var(--line); }
.chess-levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.chess-level {
  display: grid; gap: 1px; justify-items: center; padding: 10px 6px; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--panel-2); border: var(--px) solid var(--line); box-shadow: 0 var(--px) 0 var(--depth);
}
.chess-level:hover { border-color: var(--orange-dk); }
.chess-level.on { background: var(--orange-2); color: #2b1709; border-color: var(--orange-dk); }
.chess-level .lv-ic { font-size: 1.8rem; line-height: 1.2; }
.chess-level em { font-style: normal; font-weight: 800; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--orange-dk); }
.chess-level.on em { color: #6b2f0e; }
.chess-level small { font-size: .8rem; color: var(--ink-soft); }
.chess-level.on small { color: #4a2e1c; }
.chess-level .lv-rec { font-weight: 800; }
.chess-label { margin: 10px 0 6px; font-weight: 800; font-size: .9rem; color: var(--ink-soft); text-align: left; }
.chess-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.chess-seg button { flex: 1 1 auto; font: 700 .92rem/1.2 "Nunito", sans-serif; padding: 8px 10px; background: var(--panel-2); color: var(--ink); border: 3px solid var(--line); cursor: pointer; }
.chess-seg button.on { background: var(--leaf); color: #1f3a2b; box-shadow: inset 0 -3px 0 var(--moss); }
.chess-field { display: grid; gap: 4px; text-align: left; font-weight: 800; font-size: .9rem; margin: 6px 0 12px; }
.chess-field input, .chess-box input { font: inherit; padding: 8px 10px; background: var(--panel); color: var(--ink); border: 3px solid var(--line); min-width: 0; }
.chess-online { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; text-align: left; }
.chess-box { background: var(--panel-2); padding: 12px; border: 3px solid var(--line); display: grid; gap: 4px; align-content: start; }
.chess-box h3 { margin: 0 0 2px; font-size: 1.05rem; }
.chess-box .btn { margin-top: 10px; }
.chess-box [data-join-code] { text-transform: uppercase; letter-spacing: .2em; font-weight: 900; width: 100%; }
.chess-code { font: 900 clamp(2.6rem, 9vw, 3.6rem)/1 "Londrina", "Nunito", sans-serif; letter-spacing: .18em; margin: 6px 0 14px; color: var(--ink); }
.chess-link { word-break: break-all; }
.chess-wait { font-weight: 800; }
.chess-err { color: var(--berry); font-weight: 800; }
.chess-end { font-size: 2rem; }
.chess-end.win { color: var(--moss); }
.chess-end.lose { color: var(--berry); }

@media (max-width: 900px) {
  .chess { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .chess-main { max-width: min(640px, 100%); }
  .chess-side { position: static; }
  .chess-moves { height: auto; max-height: 180px; }
}
@media (max-width: 560px) {
  .chess-levels { grid-template-columns: repeat(2, 1fr); }
  .chess-online { grid-template-columns: 1fr; }
  .chess-board-wrap { margin-inline: 0; }
  .cpi.cap { width: 14px; height: 14px; margin-right: -5px; }
  .cb-clock { min-width: 64px; font-size: 1rem; padding: 3px 6px; }
}

/* ==================================================================   Arcane Tactics (arcane.html)
   ========================================================================= */
.at-stage { background: #241a44; height: min(86vh, 820px); min-height: 500px; }
.at-stage .game-canvas { cursor: default; }
.at-stage .game-overlay { background: radial-gradient(ellipse at center, rgba(40, 25, 80, .35), rgba(14, 8, 34, .78)); z-index: 5; }
.at-stage.is-full .fs-exit { display: grid; }
.at-hud { position: absolute; inset: 0; pointer-events: none; color: #f4f1ff; font-weight: 700; z-index: 3; }
.at-hud[hidden] { display: none; }
.at-hud button { pointer-events: auto; font: inherit; }
.at-card { width: min(720px, 100%); border-radius: 18px; background: #f6f1ff; color: #241a44; }
.at-card.at-in { animation: at-card .35s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes at-card { from { transform: scale(.9) translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.at-card p { color: #4b3f6e; }
.at-card .btn { border-radius: 12px; }
.at-card .game-small { color: #6d6390; }
:root[data-theme="dark"] .at-card { background: #1e1738; color: #f4f1ff; }
:root[data-theme="dark"] .at-card p, :root[data-theme="dark"] .at-card .game-small { color: #c9c0e8; }

/* portraits du groupe */
.at-party { position: absolute; left: 8px; top: 8px; display: grid; gap: 6px; }
.at-pf { display: flex; gap: 8px; align-items: center; padding: 5px 10px 5px 5px; background: rgba(20, 14, 44, .78); border: 2px solid rgba(255, 255, 255, .14); border-radius: 14px; color: inherit; cursor: pointer; text-align: left; min-width: 210px; }
.at-pf img { border-radius: 10px; flex: none; }
.at-pf.me { border-color: #9fd8ff; }
.at-pf.act { border-color: #ffd257; box-shadow: 0 0 0 3px rgba(255, 210, 87, .25); }
.at-pf.ko { opacity: .5; filter: grayscale(.8); }
.at-pf-b { display: grid; gap: 3px; flex: 1; }
.at-pf-n { font-size: .86rem; white-space: nowrap; }
.at-pf-n em { font-style: normal; color: #ffd257; font-size: .78rem; }
.at-pf-hp { position: relative; height: 15px; background: #3a1c2c; border-radius: 6px; overflow: hidden; }
.at-pf-hp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#7dffb0, #2fbf6a); border-radius: 6px; transition: width .25s; }
.at-pf-hp u { position: absolute; inset: 0 auto auto 0; height: 4px; background: #9fd8ff; }
.at-pf-hp b { position: relative; display: block; text-align: center; font-size: .72rem; line-height: 15px; text-shadow: 0 1px 0 #000; }
.at-pf-xp { height: 5px; background: rgba(255, 255, 255, .12); border-radius: 3px; overflow: hidden; }
.at-pf-xp i { display: block; height: 100%; background: #c77dff; transition: width .3s; }
.at-pf-g { font-size: .74rem; color: #ffd257; }

/* haut : zone / frise des tours */
.at-top { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); max-width: calc(100% - 520px); }
.at-zone { display: grid; text-align: center; padding: 6px 18px; background: rgba(20, 14, 44, .7); border-radius: 14px; }
.at-zone b { font-size: 1rem; }
.at-zone span { font-size: .75rem; color: #c9b2ff; }
.at-tl { display: flex; align-items: center; gap: 4px; padding: 5px 8px; background: rgba(20, 14, 44, .78); border-radius: 14px; overflow: hidden; }
.at-round { font-size: .72rem; color: #c9b2ff; margin-right: 4px; white-space: nowrap; }
.at-tl-u { position: relative; pointer-events: auto; border-radius: 10px; overflow: hidden; border: 2px solid #5aa9ff; flex: none; line-height: 0; }
.at-tl-u.mob { border-color: #ff5a6a; }
.at-tl-u.elite { border-color: #ffd257; }
.at-tl-u.now { transform: scale(1.18); margin: 0 6px; box-shadow: 0 0 0 3px #ffd257; }
.at-tl-u i { position: absolute; left: 0; bottom: 0; height: 4px; background: #7dffb0; }
.at-tl-u.mob i { background: #ff5a6a; }

/* droite : quêtes */
.at-side { position: absolute; right: 8px; top: 58px; width: 220px; }
.at-qt { padding: 8px 10px; background: rgba(20, 14, 44, .66); border-radius: 12px; font-size: .78rem; }
.at-qt > b { color: #ffd257; font-size: .82rem; }
.at-qt p { margin: 6px 0 0; display: grid; gap: 2px; color: inherit; }
.at-qt small { color: #c9c0e8; font-weight: 600; line-height: 1.25; }
.at-qt i { height: 5px; background: rgba(255, 255, 255, .15); border-radius: 3px; overflow: hidden; }
.at-qt u { display: block; height: 100%; background: #ffd257; text-decoration: none; }
.at-qt em { font-style: normal; font-size: .7rem; color: #ffd257; justify-self: end; }
.at-btns { position: absolute; right: 8px; top: 8px; display: flex; gap: 6px; }
.at-hbtn { position: relative; width: 40px; height: 40px; display: grid; place-items: center; font-size: 1.1rem; background: rgba(20, 14, 44, .8); border: 2px solid rgba(255, 255, 255, .16); border-radius: 12px; color: #fff; cursor: pointer; transition: transform .15s cubic-bezier(.2, 1.6, .4, 1); }
.at-hbtn:hover { transform: scale(1.08); background: #3a2c6e; }
.at-hbtn b { position: absolute; right: -6px; top: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #ff5a6a; font-size: .7rem; line-height: 18px; }
.at-hbtn b[hidden] { display: none; }

/* bas : barre de sorts */
.at-bar { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: calc(100% - 16px); }
.at-hud kbd { min-width: 0; padding: 0 5px; font-size: .72rem; line-height: 1.5; background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .3); box-shadow: none; border-radius: 5px; }
.at-bar.hint span { padding: 6px 14px; background: rgba(20, 14, 44, .6); border-radius: 12px; font-size: .8rem; font-weight: 600; text-align: center; }
.at-bar.fight, .at-bar.place { padding: 8px 10px; background: rgba(20, 14, 44, .84); border: 2px solid rgba(255, 255, 255, .12); border-radius: 18px; }
.at-bar.fight.mine { border-color: rgba(255, 210, 87, .6); }
.at-bar-t { font-size: .85rem; }
.at-hint { flex-basis: 100%; text-align: center; font-size: .78rem; color: #ffd257; }
.at-papm { display: flex; gap: 6px; }
.at-papm span { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; font-size: .68rem; line-height: 1; }
.at-papm b { font-size: 1.35rem; }
.at-papm .pa { background: radial-gradient(circle at 35% 30%, #7fb8ff, #2c5bc7); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25); }
.at-papm .pm { background: radial-gradient(circle at 35% 30%, #7dffb0, #1e9a5c); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25); }
.at-spells { display: flex; gap: 6px; }
.at-sp { position: relative; width: 54px; height: 54px; padding: 0; border: 3px solid #4b3f7e; border-radius: 12px; overflow: hidden; background: #140e2c; cursor: pointer; transition: transform .12s cubic-bezier(.2, 1.6, .4, 1), border-color .12s; line-height: 0; }
.at-sp img { width: 100%; height: 100%; }
.at-sp:hover { transform: translateY(-3px); border-color: #c9b2ff; }
.at-sp.on { border-color: #ffd257; transform: translateY(-5px); box-shadow: 0 0 14px rgba(255, 210, 87, .7); }
.at-sp.ult { border-color: #ff9a3c; }
.at-sp.off { filter: grayscale(.85) brightness(.6); }
.at-sp.off:hover { transform: none; }
.at-sp kbd { position: absolute; left: 2px; top: 2px; min-width: 0; padding: 0 3px; font-size: .6rem; line-height: 1.3; background: rgba(0, 0, 0, .55); border: 0; box-shadow: none; color: #fff; border-radius: 4px; }
.at-sp em { position: absolute; right: 2px; bottom: 2px; font-style: normal; font-size: .72rem; line-height: 1.3; padding: 0 4px; border-radius: 6px; background: #2c5bc7; color: #fff; }
.at-sp > b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.3rem; background: rgba(0, 0, 0, .45); color: #fff; }
.at-spells { flex-wrap: wrap; max-width: 330px; }
.at-sp > b small { display: block; font-size: .55rem; line-height: 1; }
.at-sl b em.lvl { background: #8a5cc7; color: #fff; }
.at-hero-sp { flex-wrap: wrap; justify-content: center; max-width: 130px; }
.at-hero-sp img.lock { opacity: .3; filter: grayscale(1); }
.at-skins { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 8px 0; }
.at-skin { display: grid; justify-items: center; gap: 3px; padding: 10px 8px; border: 3px solid #d9cff2; border-radius: 14px; background: #fff; color: #241a44; font: inherit; cursor: pointer; text-align: center; }
:root[data-theme="dark"] .at-skin { background: #2a2150; color: #f4f1ff; border-color: #43387a; }
.at-skin img { border-radius: 12px; }
.at-skin b { font-size: .92rem; }
.at-skin span { font-size: .72rem; opacity: .8; line-height: 1.25; }
.at-skin small { padding: 2px 10px; border-radius: 8px; background: #fff1c2; color: #7a5410; font-weight: 900; }
.at-skin.owned small { background: #ece4ff; color: #5b2d8e; }
.at-skin.on { border-color: #ffd257; box-shadow: 0 0 0 3px rgba(255, 210, 87, .35); }
.at-skin.on small { background: #ffd257; color: #2b1d08; }
.at-skin[disabled] { opacity: .55; cursor: not-allowed; }
.at-card-shop { width: min(900px, 100%); }
.at-sh4 { margin: 10px 0 4px; font-size: 1rem; }
.at-sp-help { display: grid; place-items: center; font: 900 1.3rem/1 Nunito, sans-serif; color: #c9b2ff; background: #2a2150; border-color: #43387a; }
.at-sp-help:hover { color: #fff; }
.at-slist { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.at-sl { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; background: #ece4ff; }
:root[data-theme="dark"] .at-sl { background: #2a2150; }
.at-sl img { border-radius: 9px; flex: none; }
.at-sl b { display: block; }
.at-sl b em { font-style: normal; font-size: .72rem; padding: 0 6px; border-radius: 6px; background: #ff9a3c; color: #2b1d08; }
.at-sl p { margin: 3px 0 0; font-size: .82rem; }
.at-sl .at-tip-m span { background: rgba(0, 0, 0, .08); }
.at-sl.lock { opacity: .55; }
.at-end, .at-ready { background: #ffd257; --b: #ffd257; --bd: #b8861a; color: #2b1d08; white-space: nowrap; }
.at-end small, .at-ready small, .at-go small { font-size: .65rem; opacity: .7; margin-left: 4px; }
.at-wait { font-size: .85rem; color: #c9c0e8; min-width: 120px; text-align: center; }

.at-toasts { position: absolute; left: 50%; top: 70px; transform: translateX(-50%); display: grid; gap: 6px; justify-items: center; width: min(520px, calc(100% - 20px)); }
.at-toast { padding: 7px 14px; border-radius: 12px; background: rgba(20, 14, 44, .9); font-size: .85rem; text-align: center; animation: at-toast .35s cubic-bezier(.2, 1.4, .4, 1); transition: opacity .4s, transform .4s; }
.at-toast.warn { background: rgba(110, 24, 44, .92); }
.at-toast.gold { background: rgba(110, 74, 10, .94); }
.at-toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes at-toast { from { transform: translateY(-10px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.at-banner { position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%); display: grid; text-align: center; pointer-events: none; }
.at-banner[hidden] { display: none; }
.at-banner strong { font-family: "Londrina", "Nunito", sans-serif; font-size: clamp(1.8rem, 5vw, 3.2rem); line-height: 1; color: #fff; text-shadow: 0 4px 0 #241a44, 0 0 24px rgba(201, 178, 255, .8); white-space: nowrap; }
.at-banner span { font-size: .95rem; color: #e9dcff; text-shadow: 0 2px 0 #241a44; }
.at-banner.in { animation: at-banner 1.9s cubic-bezier(.2, 1.3, .4, 1) forwards; }
.at-banner.win strong, .at-banner.level strong { color: #ffd257; }
.at-banner.lose strong { color: #ff8a9a; }
.at-banner.turn strong { color: #9fd8ff; font-size: clamp(1.4rem, 3.6vw, 2.2rem); }
@keyframes at-banner { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.7); } 14% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); } 22% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%); } }
.at-tip { position: absolute; max-width: 280px; padding: 8px 11px; background: rgba(16, 10, 36, .96); border: 2px solid #5b4a9e; border-radius: 12px; font-size: .8rem; font-weight: 600; pointer-events: none; z-index: 6; }
.at-tip[hidden] { display: none; }
.at-tip strong { display: block; font-size: .92rem; color: #fff; }
.at-tip strong em { font-style: normal; color: #ffd257; font-size: .78rem; }
.at-tip p { margin: 4px 0 0; color: #d9d0f5; line-height: 1.3; }
.at-tip-m { display: flex; flex-wrap: wrap; gap: 4px; }
.at-tip-m span { padding: 1px 6px; background: rgba(255, 255, 255, .1); border-radius: 6px; font-size: .72rem; }
.at-tip-warn { color: #ff8a9a !important; }
.at-tip-gold { color: #ffd257 !important; }
.at-tip-dim { color: #9a90c0 !important; font-size: .72rem; }

/* menu */
.at-sumtag { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: #7df0c2; }
.at-sumtag img { border-radius: 8px; }
.at-logo span { display: block; font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: #8a5cc7; font-weight: 900; }
.at-logo h2 { font-family: "Londrina", "Nunito", sans-serif; font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 10px; background: linear-gradient(90deg, #5b2d8e, #3fb8d0, #ff6f59); -webkit-background-clip: text; background-clip: text; color: transparent; }
.at-heroes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 6px 0 12px; }
.at-hero { padding: 8px 6px 8px; gap: 2px; }
.at-hero b { font-size: 1rem; }
.at-hero-art img { width: 80px; height: 80px; }
.at-hero-d { font-size: .72rem; }
.at-card-menu { width: min(1040px, 100%); }
.at-pts { margin: 8px 0 2px; padding: 4px 10px; border-radius: 10px; background: #fff1c2; color: #7a5410; font-weight: 900; font-size: .85rem; }
.at-stats.at-main { grid-template-columns: 1fr; }
.at-stats.at-main li { align-items: center; gap: 4px; }
.at-stats.at-main li b { min-width: 2.2em; text-align: right; }
.at-stats.at-main li span { flex: 1; }
.at-stats.at-main li.main span { font-weight: 900; }
.at-plus { padding: 0 6px; border: 2px solid #8a5cc7; border-radius: 7px; background: #ece4ff; color: #5b2d8e; font: 800 .7rem/1.5 Nunito, sans-serif; cursor: pointer; }
.at-plus:hover { background: #8a5cc7; color: #fff; }
html.at-lock, html.at-lock body { overflow: hidden; height: 100%; overscroll-behavior: none; }
.at-stage.is-full .fs-exit { display: none; }
.at-stage.is-max .at-btns { top: calc(env(safe-area-inset-top, 0px) + 8px); right: calc(env(safe-area-inset-right, 0px) + 8px); }
.at-stage.is-max .at-party { top: calc(env(safe-area-inset-top, 0px) + 8px); left: calc(env(safe-area-inset-left, 0px) + 8px); }
.at-hero { display: grid; justify-items: center; gap: 3px; padding: 10px 8px 10px; border: 3px solid #d9cff2; border-radius: 16px; background: #fff; color: #241a44; cursor: pointer; font: inherit; transition: transform .15s cubic-bezier(.2, 1.6, .4, 1), border-color .15s; }
:root[data-theme="dark"] .at-hero { background: #2a2150; color: #f4f1ff; border-color: #43387a; }
.at-hero:hover { transform: translateY(-3px); }
.at-hero.on { border-color: #8a5cc7; box-shadow: 0 0 0 4px rgba(138, 92, 199, .25); transform: translateY(-4px); }
.at-hero.taken { opacity: .35; cursor: not-allowed; }
.at-hero-art { display: block; border-radius: 14px; overflow: hidden; line-height: 0; box-shadow: 0 4px 0 rgba(0, 0, 0, .15); }
.at-hero b { font-size: 1.1rem; }
.at-hero em { font-style: normal; font-size: .76rem; color: #8a5cc7; font-weight: 800; }
.at-hero small { font-size: .74rem; opacity: .8; }
.at-hero-sp { display: flex; gap: 3px; }
.at-hero-sp img { border-radius: 6px; }
.at-hero-d { font-size: .76rem; line-height: 1.3; opacity: .85; font-weight: 600; }
.at-name { display: flex; gap: 8px; align-items: center; justify-content: center; font-weight: 800; margin-bottom: 12px; }
.at-name input, .at-join input, .at-link { font: inherit; padding: 7px 10px; border: 2px solid #c9b2ff; border-radius: 10px; background: #fff; color: #241a44; }
.at-join { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.at-join input { width: 7em; text-transform: uppercase; text-align: center; letter-spacing: .2em; font-weight: 900; }
.at-link { width: min(320px, 100%); font-size: .8rem; }
.at-code b { font-size: 2rem; letter-spacing: .2em; color: #8a5cc7; }
.at-roster { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 4px; }
.at-roster li { display: flex; align-items: center; gap: 6px; justify-content: center; }
.at-roster img { border-radius: 6px; }
.at-roster em { font-style: normal; font-size: .72rem; padding: 0 6px; border-radius: 6px; background: #ece4ff; color: #5b2d8e; }
.at-err { color: #c8303f !important; font-weight: 800; }

/* panneaux */
.at-inv-h { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.at-inv-h h2 { margin: 0; }
.at-gold { padding: 3px 10px; border-radius: 10px; background: #fff1c2; color: #7a5410; font-weight: 900; }
.at-x { margin-left: auto; width: 34px; height: 34px; border: 0; border-radius: 10px; background: #ece4ff; color: #241a44; font-weight: 900; cursor: pointer; }
.at-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.at-tabs button { display: flex; gap: 6px; align-items: center; padding: 4px 10px; border: 2px solid #d9cff2; border-radius: 10px; background: transparent; color: inherit; font: inherit; font-weight: 800; cursor: pointer; }
.at-tabs button.on { border-color: #8a5cc7; background: #ece4ff; color: #241a44; }
.at-tabs img { border-radius: 5px; }
.at-card-inv { width: min(900px, 100%); text-align: left; }
.at-inv { display: grid; grid-template-columns: 270px 1fr; gap: 14px; }
.at-inv-h h2 small { font-size: .78rem; font-weight: 700; color: var(--atcyan); margin-left: 6px; }
.at-inv-tabs { margin-bottom: 10px; }
.at-doll2 { display: grid; grid-template-columns: 44px 1fr 44px; gap: 8px; align-items: center; justify-items: center; padding: 8px; border-radius: 14px; background: radial-gradient(ellipse at 50% 70%, rgba(95, 224, 255, .14), transparent 70%); }
.at-doll2 > img { border-radius: 14px; width: 120px; height: 120px; }
.at-doll-col { display: grid; gap: 6px; }
.at-doll-col .at-slot { width: 44px; height: 44px; aspect-ratio: auto; border-width: 2px; }
.at-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 0; }
.at-chips span { display: grid; place-items: center; min-width: 46px; padding: 3px 6px; border-radius: 9px; background: rgba(18, 24, 50, .8); border: 1px solid #3b4a80; font-size: .6rem; color: #b7c2ea; line-height: 1.1; flex: 1; }
.at-chips b { font-size: .92rem; color: #f6f3ff; }
.at-pts-btn { display: block; width: 100%; border: 0; font: inherit; cursor: pointer; text-align: center; }
.at-stats.at-main2 { grid-template-columns: 1fr; gap: 6px; margin-top: 8px; }
.at-stats.at-main2 li { padding: 8px 10px; border-radius: 10px; background: #243058; border-bottom: 0; font-size: .9rem; }
.at-stats.at-main2 li span { display: grid; }
.at-stats.at-main2 li span small { font-size: .68rem; color: #b7c2ea; font-weight: 600; }
.at-stats.at-main2 li b { font-size: 1.1rem; min-width: 2.6em; }
.at-stats.at-main2 .at-plus { font-size: .8rem; padding: 2px 8px; }
.at-bag-h { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: .82rem; }
.at-bag-h b { font-size: 1rem; }
.at-bag-h span { color: #b7c2ea; margin-right: auto; }
.at-bag-h .text-link { font: inherit; font-size: .78rem; background: none; border: 0; padding: 0; cursor: pointer; color: var(--atcyan, #5fe0ff); text-decoration: underline; }
.at-it.compact { padding: 8px 10px; }
.at-it.compact ul { margin-top: 5px; font-size: .8rem; }
.at-it.compact .at-it-a { margin-top: 6px; }
.at-doll { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.at-doll img { border-radius: 12px; width: 110px; height: 110px; }
.at-doll b { display: block; }
.at-doll small { color: #8a5cc7; font-weight: 800; }
.at-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.at-slot, .at-bagc { position: relative; aspect-ratio: 1; display: grid; place-items: center; padding: 0; border: 3px solid #d9cff2; border-radius: 10px; background: #2a2150; cursor: pointer; line-height: 0; }
.at-slot[style], .at-bagc[style] { border-color: var(--rc); }
.at-slot.on, .at-bagc.on { box-shadow: 0 0 0 3px #241a44, 0 0 0 5px var(--rc); }
.at-slot img, .at-bagc img { width: 78%; height: 78%; border-radius: 5px; }
.at-slot-e { font-size: .68rem; line-height: 1.1; color: #9a90c0; font-weight: 800; }
.at-bagc.at-bage { cursor: default; background: rgba(42, 33, 80, .25); border-style: dashed; }
.at-bagc b { position: absolute; left: -4px; top: -6px; font-size: .55rem; line-height: 1.4; padding: 0 4px; border-radius: 5px; background: #ff5a6a; color: #fff; }
.at-bagc i { position: absolute; right: 1px; bottom: 1px; font-style: normal; font-size: .7rem; line-height: 1.2; color: #5dff9a; text-shadow: 0 1px 0 #000; }
.at-bagc u { position: absolute; left: 1px; bottom: 1px; font-size: .6rem; line-height: 1; text-decoration: none; }
.at-bag { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin-bottom: 8px; }
.at-bag .at-bagc { border-width: 2px; border-radius: 8px; max-width: 46px; }
.at-bag-n { font-size: .8rem; margin: 6px 0; }
.at-bag-n .text-link { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; color: #8a5cc7; text-decoration: underline; }
.at-stats { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; font-size: .82rem; }
.at-stats li { display: flex; justify-content: space-between; border-bottom: 1px dashed rgba(138, 92, 199, .3); }
.at-pows { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 0; }
.at-pows span { padding: 1px 7px; border-radius: 8px; background: #fff1c2; color: #7a5410; font-size: .74rem; font-weight: 800; }
.at-detail { min-height: 120px; }
.at-it { position: relative; padding: 10px 12px; border-radius: 14px; background: linear-gradient(160deg, #2a2150, #160f30); color: #f4f1ff; border: 3px solid var(--rc); text-align: left; box-shadow: 0 0 18px color-mix(in srgb, var(--rc) 40%, transparent); }
.at-it-h { display: flex; gap: 8px; align-items: center; }
.at-it-h img { border-radius: 8px; flex: none; }
.at-it-h b { display: block; color: var(--rc); font-size: .95rem; line-height: 1.15; }
.at-it-h small { color: #c9c0e8; font-size: .72rem; }
.at-it ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; font-size: .84rem; }
.at-it li.sp { color: #ffd257; font-weight: 900; font-size: .95rem; }
.at-it li.sp::before { content: "✦ "; }
.at-it-pw { margin: 6px 0 0; font-size: .78rem; color: #ffcf9a !important; }
.at-it-pw b { color: #ff9a3c; }
.at-it-cmp { margin: 6px 0 0; font-size: .74rem; color: #c9c0e8 !important; display: flex; flex-wrap: wrap; gap: 4px; }
.at-it-cmp .up { color: #5dff9a; }
.at-it-cmp .down { color: #ff8a9a; }
.at-it-a { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.at-it-a .btn { margin: 0; }
.at-it-ok { margin: 8px 0 0; font-size: .8rem; color: #5dff9a !important; font-weight: 800; }

/* butin */
.at-card-loot { width: min(980px, 100%); }
.at-loot-head h2 { font-family: "Londrina", "Nunito", sans-serif; font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0; }
.at-loot-head.win h2 { color: #c78a10; text-shadow: 0 3px 0 rgba(0, 0, 0, .1); }
.at-loot-head.lose h2 { color: #c8303f; }
.at-loot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; text-align: left; margin: 6px 0 10px; }
.at-loot-p h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; }
.at-loot-p h3 img { border-radius: 6px; }
.at-gains { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.at-gains span { padding: 3px 10px; border-radius: 10px; font-weight: 900; font-size: .9rem; animation: at-pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.at-gains .xp { background: #ece4ff; color: #5b2d8e; }
.at-gains .gold { background: #fff1c2; color: #7a5410; animation-delay: .1s; }
.at-gains .lvl { background: #ffd257; color: #2b1d08; animation-delay: .2s; }
@keyframes at-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.at-xpbar { position: relative; height: 16px; border-radius: 8px; background: #2a2150; overflow: hidden; }
.at-xpbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #8a5cc7, #c77dff); animation: at-xp 1s .2s ease-out both; }
.at-xpbar span { position: relative; display: block; text-align: center; font-size: .72rem; line-height: 16px; color: #fff; font-weight: 800; }
@keyframes at-xp { from { width: 0; } }
.at-cstats, .at-qdone { font-size: .8rem; margin: 6px 0 0; }
.at-qdone { color: #c78a10 !important; font-weight: 800; }
.at-loot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 10px; }
.at-loot-i { position: relative; animation: at-drop .6s var(--d, .3s) cubic-bezier(.2, 1.5, .4, 1) both; }
.at-card-loot.no-anim .at-loot-i, .at-card-loot.no-anim .at-gains span, .at-card-loot.no-anim .at-xpbar i { animation: none; }
@keyframes at-drop { 0% { transform: translateY(-30px) rotateX(70deg) scale(.7); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; opacity: 1; } }
.at-rays { position: absolute; left: 50%; top: 50%; width: 150%; aspect-ratio: 1; margin: -75% 0 0 -75%; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(255, 210, 87, .3) 0 8deg, transparent 8deg 24deg); -webkit-mask: radial-gradient(circle, #000 30%, transparent 68%); mask: radial-gradient(circle, #000 30%, transparent 68%); animation: at-spin 8s linear infinite; z-index: 0; pointer-events: none; }
.at-loot-i .at-it { z-index: 1; }
@keyframes at-spin { to { transform: rotate(360deg); } }
.at-it.r4 { animation: at-glow 1.6s ease-in-out infinite alternate; }
@keyframes at-glow { to { box-shadow: 0 0 30px var(--rc), inset 0 0 18px color-mix(in srgb, var(--rc) 30%, transparent); } }

/* quêtes, boutique, aide */
.at-card-q, .at-card-shop, .at-card-pause { width: min(640px, 100%); text-align: left; }
.at-qlist { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.at-q { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 12px; background: #ece4ff; }
:root[data-theme="dark"] .at-q { background: #2a2150; }
.at-q b { display: block; }
.at-q p { margin: 2px 0 4px; font-size: .82rem; }
.at-q i { display: block; height: 6px; border-radius: 3px; background: rgba(0, 0, 0, .1); overflow: hidden; }
.at-q i u { display: block; height: 100%; background: #8a5cc7; }
.at-q.lock { opacity: .55; }
.at-q.done { opacity: .6; }
.at-q-r { font-size: .74rem; text-align: right; flex: none; max-width: 45%; }
.at-q-r em { font-style: normal; font-weight: 900; }
.at-shop { display: grid; justify-items: center; gap: 10px; margin: 10px 0; }
.at-chest { width: 90px; height: 70px; position: relative; }
.at-chest::before { content: ""; position: absolute; inset: 22px 0 0; border-radius: 8px; background: linear-gradient(#a8743f, #6b4a2a); border: 3px solid #3a2618; }
.at-chest::after { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 24px; border-radius: 12px 12px 4px 4px; background: linear-gradient(#c98f5c, #8a5a3b); border: 3px solid #3a2618; transform-origin: 50% 100%; transition: transform .4s cubic-bezier(.2, 1.6, .4, 1); }
.at-chest span { position: absolute; left: 50%; top: 22px; width: 14px; height: 14px; margin-left: -7px; border-radius: 3px; background: #ffd257; border: 2px solid #3a2618; z-index: 1; }
.at-chest.open::after { transform: translateY(-10px) rotate(-18deg); }
.at-chest.open { filter: drop-shadow(0 0 16px #ffd257); }
.at-help { padding-left: 1.2em; display: grid; gap: 5px; font-size: .86rem; margin: 10px 0; }
.at-set { display: grid; gap: 8px; margin: 6px 0 10px; }
.at-set label { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: .9rem; }
.at-set input[type=range] { flex: 1; }
.at-card-s { width: min(400px, 100%); }

@media (max-width: 860px) {
  .at-heroes { grid-template-columns: repeat(2, 1fr); }
  .at-card-menu .at-hero-d { display: none; }
  .at-top { max-width: calc(100% - 16px); top: 104px; }
  .at-toasts { top: 160px; }
  .at-side { display: none; }
  .at-pf { min-width: 0; }
  .at-pf-n em, .at-pf-g { display: none; }
  .at-pf-b { width: 110px; }
  .at-inv { grid-template-columns: 1fr; }
  .at-bag { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 640px) {
  .at-stage { height: calc(100svh - 100px); min-height: 460px; }
  .at-bar { left: 0; right: 0; bottom: 0; transform: none; max-width: none; border-radius: 16px 16px 0 0; gap: 6px 8px; padding: 8px 8px calc(env(safe-area-inset-bottom, 0px) + 8px); }
  .at-bar.fight, .at-bar.place { border-width: 2px 0 0; }
  .at-bar.hint { padding: 0 8px 8px; background: none; }
  .at-end, .at-ready { flex: 1; padding: 10px 12px; }
  .at-end small, .at-ready small { display: none; }
  .at-go { flex: 1; }
  .at-hint { font-size: .74rem; }
  .at-sumtag { flex-basis: 100%; justify-content: center; }
  .at-sp kbd { display: none; }
  .at-top { top: auto; bottom: 150px; left: 8px; right: auto; transform: none; max-width: calc(100% - 16px); }
  .at-tl { padding: 4px 6px; }
  .at-round { display: none; }
  .at-toasts { top: 120px; }
  .at-btns { gap: 3px; }
  .at-hbtn { width: 34px; height: 34px; font-size: .9rem; border-radius: 9px; }
  .at-pf img { width: 36px; height: 36px; }
  .at-pf-b { width: 76px; }
  .at-pf-n { font-size: .78rem; }
  .at-pf-hp { height: 13px; }
  .at-pf-hp b { font-size: .66rem; line-height: 13px; }
  .at-top { bottom: 196px; }
  .at-pf { padding: 4px 8px 4px 4px; }
  .at-card-loot, .at-card-inv { padding: 12px 10px; }
  .at-loot-grid { grid-template-columns: 1fr; }
  .at-bag { grid-template-columns: repeat(6, 1fr); }
  .at-bag .at-bagc { max-width: none; }
  .at-slots { grid-template-columns: repeat(6, 1fr); }
  .at-stats { grid-template-columns: 1fr 1fr 1fr; font-size: .76rem; }
  .at-doll2 > img { width: 96px; height: 96px; }
  .at-chips { gap: 3px; }
  .at-chips span { min-width: 0; flex: 1 1 18%; padding: 3px 2px; font-size: .56rem; white-space: nowrap; }
  .at-chips b { font-size: .8rem; }
  .at-bag { grid-template-columns: repeat(8, 1fr); gap: 3px; }
  .at-bag .at-bagc { border-radius: 6px; }
  .at-bagc b { font-size: .5rem; padding: 0 3px; }
  .at-doll { margin-bottom: 4px; }
  .at-tip { max-width: 240px; font-size: .74rem; }
  .at-heroes { grid-template-columns: 1fr; gap: 6px; }
  .at-hero { grid-template-columns: 64px 1fr; justify-items: start; text-align: left; }
  .at-hero-art { grid-row: span 4; align-self: start; width: 64px; height: 64px; }
  .at-hero-art img { width: 64px; height: 64px; }
  .at-hero { padding: 8px; }
  .at-zone { padding: 4px 10px; }
  .at-zone b { font-size: .85rem; }
  .at-hero-d { display: none; }
  .at-sp { width: 50px; height: 50px; border-width: 2px; }
  .at-spells { max-width: 100%; justify-content: center; }
  .at-sp em { font-size: .78rem; }
  .at-spells { gap: 5px; }
  .at-papm span { width: 46px; height: 46px; }
  .at-papm b { font-size: 1.2rem; }
  .at-end, .at-ready { font-size: 1.05rem; padding: 12px; }
  .at-bar.fight { gap: 8px 6px; }
  .at-tl-u img { width: 30px; height: 30px; }
  .at-pf img { width: 34px; height: 34px; }
  .at-party { gap: 4px; }
  .at-bar.hint span { font-size: .7rem; }
}
/* ---------- King Dice 2 : modes, salon en ligne, versus, mobile ---------- */
.game-stage .game-hud.kd-hud { inset: 7px 8px auto auto; gap: 6px; }
.kd-hud .hud-btn { width: 36px; height: 36px; }
.kd-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 6px; }
.kd-mode {
  display: grid; gap: 2px; padding: 12px 10px; text-align: center; cursor: pointer; color: inherit; font: inherit;
  background: var(--panel-2); border: 3px solid var(--line); border-radius: 16px; box-shadow: 0 4px 0 var(--depth);
  transition: transform .15s cubic-bezier(.2, 1.6, .4, 1), box-shadow .15s, filter .15s;
}
.kd-mode b { font-size: 1.1rem; }
.kd-mode span { font-size: .8rem; color: var(--ink-soft); }
.kd-mode:hover { transform: translateY(-3px) scale(1.03); filter: brightness(1.04); }
.kd-mode:active { transform: translateY(2px) scale(.97); box-shadow: 0 1px 0 var(--depth); }
.kd-mode:focus-visible { outline: 3px solid #f08a3c; outline-offset: 2px; }
.kd-m-coop { background: linear-gradient(135deg, #dce9ff, #ffe6d0); }
.kd-m-vs { background: linear-gradient(135deg, #ffd9d0, #ffeab8); }
.kd-m-on { background: linear-gradient(135deg, #e0f4ee, #e7e0ff); }
.kd-h3 { margin: 10px 0 2px; font-size: 1.1rem; text-align: left; }
.kd-note { margin: 0 0 8px; padding: 8px 12px; border-radius: 12px; background: #ffe3dc; color: #8a2d1a !important; border: 2px solid #e57a6a; font-weight: 700; font-size: .9rem; }
.kd-kind { display: flex; gap: 8px; justify-content: center; margin: 8px 0; }
.kd-k-btn { font: inherit; font-weight: 800; padding: 9px 16px; border-radius: 999px; cursor: pointer; color: var(--ink); background: var(--panel-2); border: 3px solid var(--line); transition: transform .15s cubic-bezier(.2, 1.6, .4, 1), background .15s; }
.kd-k-btn:hover:not(:disabled) { transform: scale(1.05); }
.kd-k-btn.is-on { background: #f08a3c; color: #fff; border-color: #7c370c; box-shadow: 0 3px 0 #7c370c; }
.kd-k-btn:disabled { opacity: .55; cursor: default; }
.kd-join { display: flex; gap: 8px; justify-content: center; align-items: center; margin: 10px 0 4px; }
.kd-join input { width: 8em; font: 900 1.4rem/1 Nunito, system-ui, sans-serif; letter-spacing: .25em; text-align: center; text-transform: uppercase; padding: 10px 8px; border: 3px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); }
.kd-code { font: 900 clamp(2.4rem, 9vw, 3.6rem)/1 Nunito, system-ui, sans-serif; letter-spacing: .2em; margin: 0 0 4px; padding-left: .2em; color: #f08a3c !important; text-shadow: 0 3px 0 #7c370c; animation: kd-card .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.kd-roster { list-style: none; padding: 0; margin: 8px auto; display: grid; gap: 6px; max-width: 18em; }
.kd-roster li { padding: 8px 12px; border-radius: 12px; background: var(--panel-2); border: 3px solid var(--line); font-weight: 800; }
.kd-roster li.kd-me { border-color: #f08a3c; }
.kd-roster li.kd-wait, .kd-wait { color: var(--ink-soft); font-weight: 700; border-style: dashed; animation: kd-blink 1.4s ease-in-out infinite; }
@keyframes kd-blink { 50% { opacity: .5; } }
.kd-vs-res { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.kd-vs-p { padding: 10px 8px; border-radius: 14px; border: 3px solid var(--line); background: var(--panel-2); display: grid; gap: 2px; box-shadow: inset 0 6px 0 var(--c); padding-top: 14px; }
.kd-vs-p b { font-size: 1.8rem; color: var(--ink); }
.kd-vs-p span { font-size: .8rem; color: var(--ink-soft); }
.kd-vs-p.is-win { border-color: #e0a82a; background: #fff3c9; }
.kd-powers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 6px 0; text-align: left; }
.kd-powers > div { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 6px 8px; background: var(--panel-2); border: 3px solid var(--line); border-radius: 12px; }
.kd-powers img { grid-row: 1 / 3; }
.kd-powers b { font-size: .92rem; }
.kd-powers span { font-size: .75rem; color: var(--ink-soft); line-height: 1.25; }
.kd-pieces { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important; }
.kd-p span { display: block; }
.kd-help, .kd-online { width: min(700px, 100%); }
.kd-card kbd { white-space: nowrap; }
.kd-card { max-width: 100%; }

/* petits écrans : le jeu prend tout l'écran, les cartes se resserrent */
@media (max-width: 880px) {
  .kd-stage { height: calc(100svh - 150px); min-height: 460px; }
  .kd-stage.is-max { position: fixed; inset: 0; width: 100vw; height: 100dvh; min-height: 0; z-index: 300; }
  .kd-card { padding: 14px 12px 12px; border-radius: 16px; }
  .kd-modes { gap: 8px; }
  .kd-mode { padding: 10px 6px; }
  .kd-mode b { font-size: 1rem; }
  .kd-title { font-size: 2.3rem; }
  .kd-logo img { width: 64px; height: 64px; }
  .kd-who img { width: 40px; height: 40px; }
  .kd-sub { font-size: .92rem; }
  .kd-powers { grid-template-columns: 1fr; }
  .kd-vs-res { gap: 6px; }
  .kd-vs-p b { font-size: 1.4rem; }
  .kd-tip { width: calc(100% - 16px); padding: 8px 10px; }
  .kd-tip p { font-size: .82rem; }
}
.game-stage.is-max .game-overlay { padding-top: calc(env(safe-area-inset-top, 0px) + 12px); padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); }
@media (max-height: 520px) and (orientation: landscape) {
  .kd-stage { height: calc(100svh - 24px); min-height: 300px; }
  .kd-logo img { width: 46px; height: 46px; }
  .kd-cast, .kd-sub { display: none; }
  .kd-modes { grid-template-columns: repeat(4, 1fr); }
}
.kd-stage.is-max .game-hud .hud-exit { display: grid; }
.kd-stage:not(.is-full) .game-hud .hud-exit { display: none; }
.kd-stage.is-full:has(.game-hud:not([hidden])) .fs-exit { display: none; }
/* Merger Coop 2.2 : difficulté */
.mc-label { margin: 8px 0 2px; font-weight: 800; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft) !important; }
.mc-diffs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 4px 0; }
.mc-diff {
  display: grid; gap: 1px; padding: 8px 4px; font: inherit; color: var(--ink); cursor: pointer; text-align: center;
  background: var(--panel-2); border: 3px solid var(--line); box-shadow: 0 3px 0 var(--depth);
  transition: transform .15s cubic-bezier(.2, 1.6, .4, 1), background .15s, box-shadow .15s;
}
.mc-diff b { font-size: .92rem; white-space: nowrap; }
.mc-diff span { font-size: .75rem; color: var(--ink-soft); font-weight: 800; }
.mc-diff:hover { transform: translateY(-2px); }
.mc-diff:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--depth); }
.mc-diff.is-on { background: #f6d36b; box-shadow: 0 3px 0 #b8891a, inset 0 0 0 2px #fff3c4; transform: translateY(-1px); }
.mc-diff.is-on span { color: #5a3a08; }
.mc-diff[data-diff="hard"].is-on { background: #f2a35e; }
.mc-diff[data-diff="expert"].is-on { background: #e36b6b; }
.mc-diff-desc { margin: 4px 0 8px; font-size: .9rem; min-height: 2.6em; }
@media (max-width: 560px) { .mc-diffs { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Jeux : encart Versus ---------- */
.vs-teaser { display: flex; align-items: center; gap: 16px; padding: 16px 20px; margin-bottom: 28px; text-decoration: none; color: inherit; flex-wrap: wrap; }
.vs-teaser:hover { filter: brightness(1.04); }
.vs-teaser-ico { font-size: 40px; }
.vs-teaser > span:nth-child(2) { flex: 1 1 260px; }

/* ---------- page Jeux sur mobile : grille de 3 par ligne ---------- */
@media (max-width: 600px) {
  .games-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 8px; }
  .games-grid .card { flex-direction: column; position: relative; margin: 3px 3px 8px; }
  .games-grid .card-media { flex: none; aspect-ratio: 1; border-right: 0; border-bottom: 3px solid var(--line); }
  .games-grid .card-body { padding: 6px 4px 8px; text-align: center; }
  .games-grid .card-title { font-size: .8rem; line-height: 1.15; margin: 0; }
  .games-grid .card-title a::after { content: ""; position: absolute; inset: 0; }
  .games-grid .card-meta, .games-grid .card-text, .games-grid .card-body .btn { display: none; }
}

/* =========================================================================
   Arcane Tactics 2.0 — DA bleu nuit (panneaux sombres, accents or / cyan)
   ========================================================================= */
.at-card, :root[data-theme="dark"] .at-card {
  --atbg: #1b2443; --atbg2: #243058; --atbg3: #2e3c6c; --atink: #f6f3ff; --atsoft: #b7c2ea; --atline: #3b4a80; --atacc: #ffd257; --atcyan: #5fe0ff;
  background: radial-gradient(ellipse at 50% 0%, #2d3a6b, #182040 60%, #121832); color: var(--atink); border-radius: 18px;
  box-shadow: 0 0 0 2px #3b4a80, 0 18px 50px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.at-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .025) 0 18px, transparent 18px 70px); }
.at-card > * { position: relative; }
.at-card p, .at-card .game-small, :root[data-theme="dark"] .at-card p, :root[data-theme="dark"] .at-card .game-small { color: var(--atsoft); }
.at-card h2, .at-card h3, .at-card h4 { color: var(--atink); }
.at-card kbd { background: var(--atbg3); border-color: var(--atline); color: var(--atink); box-shadow: 0 2px 0 var(--atline); }
.at-x { background: var(--atbg3); color: var(--atink); }
.at-gold { background: #3b2f12; color: var(--atacc); border: 1px solid #7a5f1a; }
.at-pts { background: #3b2f12; color: var(--atacc); }
.at-plus { background: var(--atbg3); border-color: var(--atcyan); color: var(--atcyan); }
.at-plus:hover { background: var(--atcyan); color: #0f1630; }
.at-tabs button { border-color: var(--atline); color: var(--atsoft); }
.at-tabs button.on { background: var(--atbg3); border-color: var(--atcyan); color: var(--atink); }
.at-stats li { border-bottom-color: rgba(183, 194, 234, .18); }
.at-stats b { color: var(--atacc); }
.at-stats.at-main li.main span { color: var(--atcyan); }
.at-doll small, .at-hero em, .at-logo span { color: var(--atcyan); }
.at-slot, .at-bagc { background: #121832; border-color: var(--atline); }
.at-bagc.at-bage { background: rgba(18, 24, 50, .5); border-color: #2b3660; }
.at-slot.on, .at-bagc.on { box-shadow: 0 0 0 3px #121832, 0 0 0 5px var(--rc); }
.at-bag-n .text-link { color: var(--atcyan); }
.at-q, :root[data-theme="dark"] .at-q, .at-sl, :root[data-theme="dark"] .at-sl { background: var(--atbg2); }
.at-q i { background: rgba(0, 0, 0, .35); }
.at-q i u { background: var(--atcyan); }
.at-sl .at-tip-m span { background: rgba(255, 255, 255, .1); }
.at-sl.lock { opacity: .5; }
.at-skin, :root[data-theme="dark"] .at-skin { background: var(--atbg2); color: var(--atink); border-color: var(--atline); }
.at-skin.on { border-color: var(--atacc); }
.at-skin small { background: #3b2f12; color: var(--atacc); }
.at-skin.owned small { background: var(--atbg3); color: var(--atcyan); }
.at-skin.on small { background: var(--atacc); color: #2b1d08; }
.at-name input, .at-join input, .at-link { background: #121832; color: var(--atink); border-color: var(--atline); }
.at-roster em { background: var(--atbg3); color: var(--atcyan); }
.at-code b { color: var(--atacc); }
.at-err { color: #ff8a9a !important; }
.at-loot-head.win h2 { color: var(--atacc); text-shadow: 0 0 24px rgba(255, 210, 87, .5); }
.at-loot-head.lose h2 { color: #ff8a9a; }
.at-gains .xp { background: var(--atbg3); color: var(--atcyan); }
.at-gains .gold { background: #3b2f12; color: var(--atacc); }
.at-xpbar { background: #121832; }
.at-qdone { color: var(--atacc) !important; }
.at-it { border-width: 2px; }
.at-help { color: var(--atsoft); }
.at-help b { color: var(--atink); }
.at-set label { color: var(--atink); }
.at-logo h2 { background: linear-gradient(90deg, #ffd257, #5fe0ff); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .35)); }
.at-pows span { background: #3b2f12; color: var(--atacc); }
.at-card-loot .at-loot-cols { color: var(--atink); }
.at-cstats { color: var(--atsoft) !important; }
.at-card .btn-ghost { --b: var(--atbg3); --bd: #121832; color: var(--atink); }

/* --- sélection de personnage façon vitrine --- */
.at-card-cs { width: min(1120px, 100%); padding: 14px 16px 12px; text-align: left; }
.at-cs { display: grid; grid-template-columns: 230px 1fr 300px; gap: 14px; align-items: stretch; }
.at-cs-list { display: grid; gap: 6px; align-content: start; }
.at-cs-list .at-logo { text-align: left; display: block; margin-bottom: 6px; }
.at-cs-list .at-logo h2 { font-size: 1.7rem; margin: 0; }
.at-cs-h { display: flex; align-items: center; gap: 8px; padding: 5px 8px 5px 5px; border: 2px solid var(--atline); border-radius: 12px; background: var(--atbg2); color: var(--atink); font: inherit; text-align: left; cursor: pointer; transition: transform .12s cubic-bezier(.2, 1.6, .4, 1), border-color .12s, background .12s; }
.at-cs-h img { border-radius: 9px; flex: none; box-shadow: 0 0 0 2px var(--hc); }
.at-cs-h span { display: grid; flex: 1; line-height: 1.15; }
.at-cs-h b { font-size: .95rem; }
.at-cs-h small { font-size: .68rem; color: var(--atsoft); }
.at-cs-h em { font-style: normal; font-size: .72rem; font-weight: 900; padding: 2px 7px; border-radius: 8px; background: #121832; color: var(--atacc); }
.at-cs-h:hover { transform: translateX(4px); border-color: var(--hc); }
.at-cs-h.on { background: var(--atbg3); border-color: var(--atacc); transform: translateX(6px); box-shadow: 0 0 18px rgba(255, 210, 87, .25); }
.at-cs-h.taken { opacity: .35; cursor: not-allowed; }
.at-cs-center { position: relative; display: grid; justify-items: center; align-content: start; gap: 6px; min-height: 520px; border-radius: 16px; background: radial-gradient(ellipse at 50% 70%, rgba(95, 224, 255, .12), transparent 60%); }
.at-cs-canvas { width: 100%; max-width: 420px; height: auto; aspect-ratio: 420 / 520; display: block; }
.at-cs-name { position: absolute; left: 8px; top: 6px; max-width: 240px; }
.at-cs-piece { font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--atcyan); font-weight: 900; }
.at-cs-name h3 { margin: 0; font-family: "Londrina", "Nunito", sans-serif; font-size: 2.4rem; line-height: 1; color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.at-cs-name em { font-style: normal; color: var(--atacc); font-weight: 800; font-size: .85rem; }
.at-cs-name p { margin: 4px 0 0; font-size: .74rem; line-height: 1.3; }
.at-cs-stats { position: absolute; left: 8px; right: 8px; bottom: 76px; display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; }
.at-cs-stats span { display: grid; place-items: center; min-width: 54px; padding: 4px 6px; border-radius: 10px; background: rgba(18, 24, 50, .8); border: 1px solid var(--atline); font-size: .62rem; color: var(--atsoft); line-height: 1.1; }
.at-cs-stats b { font-size: 1rem; color: var(--atink); }
.at-cs-equip { position: absolute; left: 8px; right: 8px; bottom: 34px; display: flex; justify-content: center; gap: 5px; }
.at-cs-eq { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: #121832; border: 2px solid var(--atline); }
.at-cs-eq[style*="--rc"] { border-color: var(--rc); box-shadow: 0 0 10px color-mix(in srgb, var(--rc) 50%, transparent); }
.at-cs-eq img { border-radius: 6px; }
.at-cs-eq i { font-style: normal; font-weight: 900; color: #3b4a80; }
.at-cs-center .at-pows { position: absolute; left: 8px; right: 8px; bottom: 122px; justify-content: center; }
.at-cs-lvl { position: absolute; left: 8px; right: 8px; bottom: 4px; display: flex; align-items: center; gap: 8px; font-size: .78rem; }
.at-cs-lvl b { color: var(--atacc); }
.at-cs-lvl i { flex: 1; height: 7px; border-radius: 4px; background: #121832; overflow: hidden; }
.at-cs-lvl u { display: block; height: 100%; background: linear-gradient(90deg, #5fe0ff, #8a5cc7); }
.at-cs-lvl small { color: var(--atsoft); }
.at-cs-right h4 { margin: 0 0 6px; font-size: 1rem; }
.at-cs-right h4 small { font-weight: 600; color: var(--atsoft); font-size: .72rem; margin-left: 6px; }
.at-cs-spells { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.at-cs-sp { position: relative; display: grid; justify-items: center; gap: 2px; padding: 3px 2px 4px; border: 2px solid var(--atline); border-radius: 12px; background: var(--atbg2); color: var(--atink); font: inherit; cursor: pointer; transition: transform .12s cubic-bezier(.2, 1.6, .4, 1), border-color .12s; }
.at-cs-sp img { border-radius: 9px; width: 100%; height: auto; aspect-ratio: 1; }
.at-cs-sp b { position: absolute; left: 4px; top: 4px; font-size: .7rem; line-height: 1.3; padding: 0 5px; border-radius: 6px; background: #2c5bc7; color: #fff; }
.at-cs-sp small { font-size: .6rem; line-height: 1.1; text-align: center; color: var(--atsoft); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.at-cs-sp:hover { transform: translateY(-3px); border-color: var(--atcyan); }
.at-cs-sp.ult { border-color: #ff9a3c; }
.at-cs-sp.lock img { filter: grayscale(1) brightness(.4); }
.at-cs-sp.lock small { color: var(--atacc); }
.at-cs-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 14px; margin-top: 12px; }
.at-cs-foot .at-name { margin: 0; }
.at-cs-foot .game-small { flex-basis: 100%; text-align: center; margin: 0; }
.at-cs-foot .at-err { flex-basis: 100%; text-align: center; margin: 0; }
@media (max-width: 980px) {
  .at-cs { grid-template-columns: 1fr 1fr; }
  .at-cs-list { grid-column: 1 / -1; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .at-cs-list .at-logo { grid-column: 1 / -1; }
  .at-cs-h:hover, .at-cs-h.on { transform: none; }
}
@media (max-width: 640px) {
  .at-cs { grid-template-columns: 1fr; gap: 8px; }
  .at-cs-list { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; scroll-snap-type: x mandatory; }
  .at-cs-list .at-logo { flex: none; min-width: 120px; }
  .at-cs-h { flex: none; width: 118px; flex-direction: column; text-align: center; padding: 6px; scroll-snap-align: start; }
  .at-cs-h small { display: none; }
  .at-cs-center { min-height: 0; gap: 4px; }
  .at-cs-canvas { max-width: 230px; }
  .at-cs-name { position: static; max-width: none; text-align: center; }
  .at-cs-name h3 { font-size: 1.7rem; }
  .at-cs-name p { display: none; }
  .at-cs-stats, .at-cs-equip, .at-cs-lvl, .at-cs-center .at-pows { position: static; width: 100%; }
  .at-cs-stats span { min-width: 46px; }
  .at-cs-spells { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .at-cs-sp small { display: none; }
  .at-card-cs { padding: 10px 8px; }
}

/* --- fiche détaillée d'un sort --- */
.at-sd-h { display: flex; gap: 12px; align-items: center; }
.at-sd-h img { border-radius: 16px; flex: none; box-shadow: 0 0 24px rgba(95, 224, 255, .35); }
.at-sd-k { font-size: .7rem; letter-spacing: .15em; text-transform: uppercase; color: var(--atcyan); font-weight: 900; }
.at-sd-h h2 { margin: 0 0 4px; font-family: "Londrina", "Nunito", sans-serif; font-size: 1.9rem; }
.at-sd-h .at-tip-m span { background: rgba(255, 255, 255, .1); font-size: .8rem; }
.at-sd-h .at-tip-m .pa { background: #2c5bc7; color: #fff; }
.at-sd-h .at-tip-m .lock { background: #3b2f12; color: var(--atacc); }
.at-sd-d { margin: 10px 0 6px; font-size: .95rem; line-height: 1.4; }
.at-sd-fx { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 5px; }
.at-sd-fx li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 10px; border-radius: 10px; background: var(--atbg2); font-size: .86rem; }
.at-sd-fx i { font-style: normal; width: 1.4em; text-align: center; flex: none; }
.at-sd-fx b { color: var(--atacc); }

/* ---------- mini jeu : Suika ---------- */
.suika-stage { background: #1f3a2b; height: min(80vh, 720px); min-height: 460px; }
.suika-stage .game-canvas { cursor: pointer; touch-action: none; }
.suika-stage .game-overlay { background: rgba(20, 30, 20, .45); }
.suika-stage.is-full .fs-exit { display: grid; }
.sk-evo { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; margin: 8px 0; }
.sk-evo img { width: 34px; height: 34px; }
/* ---------- Survivor 2.0 (bêta) ---------- */
.beta-tag { cursor: pointer; font-size: .45em; vertical-align: middle; padding: 2px 8px; background: var(--berry); color: #fff; box-shadow: 0 0 0 2px var(--line); }
.v2-states { display: grid; gap: 4px; margin: 8px 0 2px; }
.v2-states p { margin: 0; padding: 6px 8px; background: var(--panel-2); box-shadow: 0 0 0 2px var(--line); font-size: .9rem; }
.v2-states b { display: inline-block; min-width: 110px; }
.v2-bar { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; margin: 6px 0; font-size: .9rem; }
.v2-bar .rank-bar { height: 8px; }
.v2-run { margin: 8px 0; padding: 8px 10px; background: var(--panel-2); box-shadow: 0 0 0 2px var(--line); text-align: left; }
.v2-gear { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.v2-slot { display: grid; gap: 2px; text-align: left; padding: 8px; font: inherit; color: var(--ink); background: var(--panel-2); border: 0; box-shadow: 0 0 0 2px var(--line), 0 3px 0 2px var(--line); cursor: pointer; }
.v2-slot.is-full { background: var(--panel); }
.v2-slot-h { font-weight: 900; font-size: .8rem; text-transform: uppercase; color: var(--ink-soft); }
.v2-slot small { font-size: .78rem; color: var(--ink-soft); }
.v2-tal { display: grid; gap: 6px; }
.v2-tal-row { display: grid; grid-template-columns: 44px 1fr 1fr; gap: 6px; align-items: stretch; }
.v2-tal-row.is-locked { opacity: .5; }
.v2-tal-n { display: grid; place-items: center; font-weight: 900; background: var(--panel-2); box-shadow: 0 0 0 2px var(--line); }
.v2-tal-n small { font-size: .65rem; font-weight: 700; }
.v2-node { display: grid; gap: 2px; text-align: left; padding: 6px 8px; font: inherit; color: var(--ink); background: var(--panel-2); border: 0; box-shadow: 0 0 0 2px var(--line); cursor: pointer; }
.v2-node small { font-size: .76rem; color: var(--ink-soft); }
.v2-node.is-on { background: var(--sun, #f6d36b); box-shadow: 0 0 0 2px var(--line), 0 3px 0 2px var(--line); }
@media (max-width: 480px) { .v2-tal-row { grid-template-columns: 34px 1fr 1fr; } .v2-node small { font-size: .7rem; } }
.camp-bar { position: absolute; left: 0; right: 0; margin: 0 auto; width: fit-content; bottom: 6px; max-width: calc(100% - 12px); z-index: 5; display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 5px; pointer-events: auto; padding: 5px; background: rgba(43,23,9,.55); border-radius: 6px; scrollbar-width: none; }
.camp-bar::-webkit-scrollbar { display: none; }
.camp-bar button { flex: 0 0 auto; white-space: nowrap; }
.camp-bar[hidden] { display: none; }
.camp-bar button { font: inherit; font-weight: 800; font-size: .78rem; padding: 5px 8px; color: var(--ink); background: var(--panel); border: 0; box-shadow: 0 0 0 2px var(--line), 0 3px 0 2px var(--line); cursor: pointer; }
.camp-bar .camp-go { background: var(--accent, #e8873a); color: #fff; font-size: .9rem; }
.shop-item.is-locked { opacity: .6; }
.set-tag { color: var(--berry); }
@media (max-width: 480px) { .camp-bar button { font-size: .7rem; padding: 4px 6px; } }
.choice-emoji { font-size: 26px; line-height: 1; display: inline-block; }
.np { grid-template-columns: minmax(0, 1fr); }
.np-seg { grid-auto-columns: minmax(0, 1fr); }
.np-seg .np-opt { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .np-seg { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* --- Survivor 2.2 cleanup : notifications en bas, compactes --- */
.game-toasts { top: auto; bottom: calc(var(--px-game, 3px) * 26); width: min(340px, calc(100% - 24px)); gap: 4px; }
.game-toast { padding: 5px 10px; font-size: .8rem; border-width: 2px; }
.game-toasts .game-toast:nth-last-child(n+3) { display: none; }

/* Survivor 2.3 : icônes pixel des objets à la place des emojis */
.px-ic { display: inline-block; width: 1.45em; height: 1.45em; image-rendering: pixelated; image-rendering: crisp-edges; vertical-align: -0.38em; }
.choice-emoji .px-ic { width: 42px; height: 42px; vertical-align: middle; }
.shop-ic .px-ic, .ach-ic .px-ic { width: 28px; height: 28px; vertical-align: middle; }

/* Survivor 2.5.2 : pause (objets à effets, réglages rapides), volume */
.item-grid { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.item-grid li { position: relative; width: 34px; height: 34px; display: grid; place-items: center; background: rgba(20,14,10,.55); box-shadow: inset 0 -2px 0 var(--rc, #9a8f7a); border-radius: 3px; cursor: help; }
.item-grid li .px-ic { width: 28px; height: 28px; vertical-align: middle; }
.item-grid li > b { position: absolute; right: 1px; bottom: 1px; font-size: 10px; line-height: 1; color: #fdf3de; text-shadow: 0 1px 0 #2b1709, 1px 0 0 #2b1709, -1px 0 0 #2b1709, 0 -1px 0 #2b1709; }
.ig-more { margin: 0 0 8px; font-size: 12px; }
.ig-more summary { cursor: pointer; font-weight: 700; }
.ig-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; max-height: 180px; overflow-y: auto; }
.ig-list li { line-height: 1.35; padding-left: 6px; box-shadow: inset 3px 0 0 var(--rc, #9a8f7a); }
.ig-list .px-ic { width: 18px; height: 18px; vertical-align: -4px; }
.quick-opts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.qopt { font: inherit; font-size: 12px; padding: 4px 8px; border: 0; border-radius: 3px; cursor: pointer; color: var(--ink); background: var(--panel-2, #efe2c4); box-shadow: 0 0 0 2px var(--line, #2b1709); opacity: .6; }
.qopt.is-on { opacity: 1; }
.qopt:focus-visible { outline: 2px solid #f2b05e; outline-offset: 2px; }
.vol-row { cursor: default; }
.vol-ctl { display: inline-flex; align-items: center; gap: 6px; }
.vol-ctl b { min-width: 3.2em; text-align: center; }
.ach.is-soon { opacity: .55; }

/* Survivor 2.8 : barre du camp */
.camp-bar button { box-shadow: 0 0 0 2px #2b1709, 0 2px 0 2px #2b1709; background: #e8cfa0; color: #2b1709; border-radius: 2px; }
.camp-bar button:hover { background: #f6d36b; }
.camp-bar .camp-go { background: #e8873a; color: #fff; }
.camp-bar .camp-coop { background: #7fd1c7; }

/* Survivor 2.10 : armes trouvées */
.wcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 10px 0; }
.wcard { display: grid; justify-items: center; gap: 2px; padding: 10px 8px; text-align: center; background: var(--panel-2, #efe2c4); box-shadow: 0 0 0 2px var(--line, #2b1709), inset 0 -4px 0 var(--rc); min-width: 0; }
.wcard small { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.wcard .wcard-ic img { width: 40px; height: 40px; image-rendering: pixelated; }
.wcard strong { font-size: 1rem; }
.wcard em { font-style: normal; font-weight: 800; color: var(--rc); text-shadow: 0 1px 0 #2b1709; }
.wcard span { font-size: 12px; opacity: .8; }
.wcard b { font-size: 12px; }
.wcard.is-cur { opacity: .8; }
.pause-weapon { margin: 0 0 8px; padding: 6px 8px; background: var(--panel-2, #efe2c4); box-shadow: inset 4px 0 0 var(--rc); font-size: 13px; }
.pause-weapon img { width: 18px; height: 18px; vertical-align: -4px; image-rendering: pixelated; }
.pause-weapon em { font-style: normal; font-weight: 800; color: var(--rc); text-shadow: 0 1px 0 #2b1709; }
.pause-weapon small { display: block; opacity: .85; }

/* Survivor 2.11 : terrier et atelier façon Dofus */
.dof-tabs, .dof-itabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.dof-tab, .dof-itab { font: inherit; font-weight: 800; font-size: 13px; padding: 5px 10px; border: 0; cursor: pointer; color: #e8dcc0; background: #3a2f23; box-shadow: 0 0 0 2px #1e1812, inset 0 -2px 0 #2a2219; border-radius: 3px 3px 0 0; }
.dof-itab { font-size: 12px; padding: 4px 8px; border-radius: 3px; }
.dof-tab small, .dof-itab small { opacity: .6; font-weight: 600; }
.dof-tab.is-on, .dof-itab.is-on { background: #c8a060; color: #2b1709; }
.dof { display: grid; grid-template-columns: minmax(0, 250px) minmax(0, 1fr); gap: 10px; align-items: start; }
.dof-left, .dof-right { background: #2a2219; color: #e8dcc0; box-shadow: 0 0 0 2px #1e1812, inset 0 0 0 1px #6b5a42; padding: 8px; border-radius: 4px; min-width: 0; }
.dof-right.wide { grid-column: 1 / -1; }
.dof-doll { display: grid; grid-template-columns: 52px 1fr 52px; grid-template-rows: repeat(3, 52px); gap: 6px; grid-template-areas: "coiffe face amulette" "cape face anneau1" "bottes face anneau2"; }
.dof-slot { width: 52px; height: 52px; display: grid; place-items: center; padding: 0; border: 0; cursor: pointer; background: radial-gradient(#3a2f23, #241c14); box-shadow: 0 0 0 2px #1e1812, inset 0 0 0 2px var(--rc); border-radius: 4px; color: #8a7a62; }
.dof-slot small { font-size: 10px; font-weight: 700; }
.dof-slot .px-ic { width: 34px; height: 34px; }
.dof-slot:hover, .dof-tile:hover { filter: brightness(1.15); }
.dof-coiffe { grid-area: coiffe; } .dof-cape { grid-area: cape; } .dof-bottes { grid-area: bottes; } .dof-amulette { grid-area: amulette; } .dof-anneau1 { grid-area: anneau1; } .dof-anneau2 { grid-area: anneau2; }
.dof-face { grid-area: face; display: grid; place-items: center; align-content: center; gap: 4px; background: radial-gradient(circle at 50% 45%, #4a3c2c, #241c14 70%); border-radius: 6px; box-shadow: inset 0 0 0 1px #6b5a42; }
.dof-face img { width: 72px; height: auto; image-rendering: pixelated; }
.dof-face small { font-weight: 800; color: #c8a060; }
.dof-stats { margin-top: 8px; }
.dof-sec { margin: 8px 0 4px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #c8a060; border-bottom: 1px solid #4a3c2c; padding-bottom: 2px; }
.dof-el { display: grid; grid-template-columns: 52px 1fr 20px; gap: 6px; align-items: center; font-size: 12px; font-weight: 700; margin: 2px 0; }
.dof-el i { height: 6px; background: #1e1812; border-radius: 3px; position: relative; overflow: hidden; }
.dof-el i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--c); }
.dof-el b { text-align: right; }
.dof-fx { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.dof-fx li { color: #8ac6ff; font-size: 13px; line-height: 1.35; }
.dof-fx.small li { font-size: 11px; }
.dof-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 5px; max-height: 236px; overflow-y: auto; padding: 2px; }
.dof-tile { position: relative; aspect-ratio: 1; display: grid; place-items: center; padding: 0; border: 0; cursor: pointer; background: #3a2f23; box-shadow: 0 0 0 1px #1e1812, inset 0 0 0 2px var(--rc); border-radius: 3px; }
.dof-tile .px-ic { width: 30px; height: 30px; }
.dof-tile.is-sel { box-shadow: 0 0 0 2px #f6d36b, inset 0 0 0 2px var(--rc); background: #4a3c2c; }
.dof-tile.is-locked { opacity: .45; }
.dof-tile.is-ok { background: #33402a; }
.dof-worn { position: absolute; right: 1px; top: 0; font-style: normal; font-size: 10px; color: #9cdc7a; text-shadow: 0 1px 0 #000; }
.dof-cap { font-size: 11px; opacity: .7; margin: 4px 0 0; }
.dof-tip { margin-top: 8px; padding: 8px; background: #1e1812; box-shadow: inset 0 0 0 1px #6b5a42, inset 4px 0 0 var(--rc, #6b5a42); border-radius: 4px; }
.dof-tip.is-empty { color: #8a7a62; font-size: 12px; }
.dof-tip-h { display: grid; grid-template-columns: 46px 1fr; gap: 8px; align-items: center; }
.dof-tip-ic { width: 46px; height: 46px; display: grid; place-items: center; background: #3a2f23; box-shadow: inset 0 0 0 2px var(--rc); border-radius: 4px; }
.dof-tip-ic .px-ic { width: 34px; height: 34px; }
.dof-tip-h strong { display: block; color: var(--rc); font-size: 15px; text-shadow: 0 1px 0 #000; }
.dof-tip-h small { display: block; font-size: 11px; color: #b8a888; }
.dof-tip-h em { display: block; font-style: normal; font-size: 11px; font-weight: 800; color: var(--rc); }
.dof-roll { margin: 4px 0 0; font-size: 11px; color: #b8a888; }
.dof-set { margin: 0; font-size: 12px; color: #9cdc7a; line-height: 1.35; }
.dof-cond { margin: 4px 0 0; font-size: 12px; color: #ff8a7a; }
.dof-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dof-setline b { color: #3f7a3a; }
.dof-spells { display: grid; gap: 6px; }
.dof-spell-row { display: grid; grid-template-columns: 44px repeat(2, minmax(0, 1fr)); gap: 6px; align-items: stretch; background: #2a2219; padding: 6px; border-radius: 4px; box-shadow: 0 0 0 2px #1e1812, inset 0 0 0 1px #6b5a42; }
.dof-spell-row.is-locked { opacity: .5; }
.dof-lvl { display: grid; place-items: center; align-content: center; background: radial-gradient(#4a3c2c, #241c14); border-radius: 50%; width: 44px; height: 44px; color: #c8a060; box-shadow: inset 0 0 0 2px #c8a060; align-self: center; }
.dof-lvl b { font-size: 15px; line-height: 1; } .dof-lvl small { font-size: 9px; }
.dof-spell { display: grid; gap: 2px; text-align: left; font: inherit; padding: 6px 8px; border: 0; cursor: pointer; color: #e8dcc0; background: #3a2f23; border-radius: 3px; box-shadow: inset 0 0 0 1px #6b5a42; min-width: 0; }
.dof-spell strong { font-size: 13px; color: #f3e6c8; }
.dof-spell span { font-size: 12px; color: #8ac6ff; line-height: 1.3; }
.dof-spell.is-on { background: #4a3c2c; box-shadow: inset 0 0 0 2px #f6d36b; }
.dof-spell.is-on strong { color: #f6d36b; }
.dof-spell:disabled { cursor: default; }
.dof-res { display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 6px 8px; background: #2a2219; color: #e8dcc0; border-radius: 4px; box-shadow: 0 0 0 2px #1e1812; }
.dof-res span { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; }
.dof-res .px-ic { width: 20px; height: 20px; }
.dof-filters { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 8px; }
.dof-filters .dof-itab { background: #4a3c2c; font-size: 11px; padding: 3px 7px; }
.dof-filters .dof-itab.is-on { background: #c8a060; }
.game-card-terrier, .game-card-atelier { width: min(760px, 100%); }
.dof-res { max-height: 64px; overflow-y: auto; margin-bottom: 4px; }
.dof-cost { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 12px; }
.dof-cost li.ok { color: #9cdc7a; } .dof-cost li.ko { color: #ff8a7a; }
.dof-cost .px-ic { width: 18px; height: 18px; vertical-align: -4px; }
@media (max-width: 640px) { .dof { grid-template-columns: minmax(0, 1fr); } .dof-left { justify-self: stretch; } .dof-doll { grid-template-columns: 52px 1fr 52px; } }
.dof, .dof-spells { text-align: left; }
.dof-fx li.dof-neg { color: #ff8a7a; }
.dof-forge-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 3px 0; }
.dof-fx li.dof-forge-row { color: #8ac6ff; } .dof-fx li.dof-forge-row.dof-neg { color: #ff8a7a; }
.dof-forge-row .btn { padding: 2px 8px; }
/* bouton de sortie du plein écran : un libellé, pour ne pas le prendre pour la fermeture d'une fenêtre */
.fs-exit.fs-exit-txt { width: auto; height: auto; padding: 4px 9px; font-size: .72rem; font-weight: 800; letter-spacing: .02em; border-radius: 6px; background: rgba(43, 23, 9, .6); border-color: rgba(43, 23, 9, .85); opacity: .85; }
.fs-exit.fs-exit-txt:hover { opacity: 1; background: rgba(43, 23, 9, .9); }
.dof-spell-row.x3 { grid-template-columns: 44px repeat(3, minmax(0, 1fr)); }
.dof-spell-row.x3 .dof-spell span { color: #8ac6ff; }
@media (max-width: 520px) { .dof-spell-row.x3 { grid-template-columns: 38px repeat(3, minmax(0, 1fr)); gap: 4px; } .dof-spell-row.x3 .dof-spell { padding: 4px 5px; } .dof-spell-row.x3 .dof-spell strong { font-size: 11px; } .dof-spell-row.x3 .dof-spell span { font-size: 10px; } }
.camp-emotes { position: absolute; z-index: 7; left: 50%; bottom: 58px; transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 94%; padding: 6px; background: rgba(43, 23, 9, .88); border: 2px solid #2b1709; }
.camp-emotes[hidden] { display: none; }
.camp-emotes button { font: inherit; font-weight: 800; font-size: .75rem; padding: 4px 8px; border: 0; cursor: pointer; background: #fdf3de; color: #2b1709; box-shadow: 0 0 0 2px #2b1709; }

/* Survivor 2.28.2 : barre du hub en bas, plus propre (dock) */
.camp-dock { left: 0; right: 0; bottom: 0; margin: 0; width: auto; max-width: none; display: grid; gap: 6px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)); overflow: visible; background: linear-gradient(to top, rgba(28, 15, 6, .92) 65%, rgba(28, 15, 6, 0)); border-radius: 0; }
.camp-dock .cb-util { display: flex; justify-content: flex-end; gap: 6px; }
.camp-dock .cb-util button { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; font-size: 1rem; line-height: 1; border-radius: 50%; background: rgba(43, 23, 9, .85); color: #fdf3de; box-shadow: 0 0 0 2px #6b4430; }
.camp-dock .cb-util button:hover { background: #6b4430; }
.camp-dock .cb-util .camp-coop { width: auto; padding: 0 12px; grid-auto-flow: column; gap: 6px; border-radius: 17px; background: #2e7a6e; box-shadow: 0 0 0 2px #7fd1c7; font-size: .85rem; }
.camp-dock .cb-util .camp-coop span { font-size: .72rem; font-weight: 800; letter-spacing: .04em; }
.camp-dock .cb-main { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.camp-dock .camp-go { grid-column: 1 / -1; padding: 11px 10px; font-size: 1.05rem; letter-spacing: .04em; border-radius: 8px; background: linear-gradient(#f29a4a, #e0782a); color: #fff; box-shadow: 0 0 0 2px #2b1709, 0 4px 0 2px #8a3f10; text-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.camp-dock .camp-go b { margin-right: 6px; }
.camp-dock .camp-go:hover { background: linear-gradient(#ffb26a, #f08838); }
.camp-dock .cb-place { display: grid; justify-items: center; gap: 2px; padding: 7px 2px 6px; border-radius: 8px; background: rgba(43, 23, 9, .88); color: #fdf3de; box-shadow: 0 0 0 2px #6b4430; }
.camp-dock .cb-place i { font-style: normal; font-size: 1.25rem; line-height: 1; }
.camp-dock .cb-place span { font-size: .62rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.camp-dock .cb-place:hover { background: #6b4430; box-shadow: 0 0 0 2px #f6d36b; }
@media (min-width: 720px) {
  .camp-dock { left: 50%; right: auto; transform: translateX(-50%); width: min(640px, 100%); border-radius: 12px 12px 0 0; }
  .camp-dock .cb-main { grid-template-columns: 1.6fr repeat(6, minmax(0, 1fr)); }
  .camp-dock .camp-go { grid-column: auto; }
}
.camp-emotes { bottom: 150px; }
/* jet à la Dofus : couleur selon la qualité du jet */
.dof-fx li.dof-q-hi, .dof-q-hi { color: #9cdc7a; } .dof-fx li.dof-q-lo, .dof-q-lo { color: #c8a08a; } .dof-fx li.dof-q-top, .dof-q-top { color: #f6d36b; font-weight: 800; }

.dof-tag { display: block; font-style: normal; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #c9a45e; opacity: .85; }
.dof-tree { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.dof-spell.is-lock { opacity: .5; }

.ct-scroll { overflow: auto; max-height: 440px; border-radius: 6px; box-shadow: 0 0 0 2px #1e1812, inset 0 0 0 1px #6b5a42; background: #14100d; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; }
.ct-svg { display: block; max-width: none; }
.ct-node { cursor: pointer; outline: none; }
.ct-node.is-can circle:first-of-type { animation: ctpulse 1.4s ease-in-out infinite; }
.ct-node:hover circle { filter: brightness(1.25); }
@keyframes ctpulse { 50% { stroke-width: 5; } }
.ct-panel { display: grid; gap: 4px; margin-top: 8px; padding: 8px 10px; background: #2a2219; border-left: 4px solid var(--rc, #c9a45e); color: #e8dcc0; border-radius: 3px; }
.ct-panel strong { color: #f3e6c8; } .ct-panel small { opacity: .7; } .ct-panel span { color: #8fc1ff; } .ct-panel em { font-style: normal; color: #c9a45e; }
.ct-hint { margin-top: 6px; }

.dof-presets { margin-top: 10px; padding: 8px; background: #241c15; border-radius: 4px; box-shadow: inset 0 0 0 1px #6b5a42; }
.dof-prs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.dof-pr { display: inline-flex; align-items: stretch; }
.dof-pr.is-on .btn { box-shadow: 0 0 0 2px #ffe9a8; }
.dof-prx { border: 0; background: #4a2a22; color: #f3d5cb; padding: 0 8px; cursor: pointer; font: inherit; border-radius: 0 3px 3px 0; }
.dof-note { color: #e8b86b; }

.np-lock { position: absolute; right: 2px; bottom: 0; font-style: normal; font-size: 14px; }

.camp-amis { position: relative; }
.fr-badge { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; background: #d8483a; color: #fff; font: 700 11px/16px system-ui, sans-serif; text-align: center; font-style: normal; box-shadow: 0 0 0 2px #2b1709; }
.fr-badge[hidden] { display: none; }
.fr-add { display: flex; gap: 6px; margin: 8px 0; }
.fr-add input { flex: 1; min-width: 0; padding: 8px 10px; font: inherit; background: #fdf3de; color: #2b1709; border: 0; box-shadow: 0 0 0 2px var(--line); }
.fr-btns { display: flex; gap: 6px; }
.fr-code { letter-spacing: .12em; font-size: 1.1em; }
.fr-msg { color: #8a5a1a; }

.game-head-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.game-head-btns [hidden] { display: none; }
.install-help { margin: 0 0 12px; padding: 10px 12px; background: var(--card, #fdf3de); color: var(--ink, #2b1709); box-shadow: 0 0 0 2px var(--line); font-size: .95em; line-height: 1.45; }
.install-help[hidden] { display: none; }

html.is-app .fs-exit, html.is-app .game-hud .hud-exit, html.is-app [data-exit-max] { display: none !important; }
html.is-app, html.is-app body { overflow: hidden; overscroll-behavior: none; }

.camp-ver { position: absolute; z-index: 5; left: calc(env(safe-area-inset-left, 0px) + 6px); top: calc(env(safe-area-inset-top, 0px) + 6px); padding: 3px 8px; font: 700 12px/1.2 system-ui, sans-serif; color: #fdf3de; background: rgba(43, 23, 9, .7); border: 0; box-shadow: 0 0 0 2px #2b1709; cursor: pointer; }
.camp-ver[hidden] { display: none; }

.over-death { margin: 10px 0; padding: 8px 10px; background: rgba(43, 23, 9, .08); box-shadow: inset 0 0 0 2px rgba(43, 23, 9, .25); text-align: left; font-size: .92em; }
.over-death h3 { margin: 0 0 4px; font-size: 1em; }
.over-death p { margin: 4px 0; }
.over-bars { display: flex; align-items: flex-end; gap: 2px; height: 44px; margin: 4px 0 6px; }
.over-bars i { flex: 1; min-width: 2px; max-width: 14px; background: #c8553d; display: block; }

.fr-row { cursor: pointer; }
.fr-row.is-sel { box-shadow: 0 0 0 3px #f6d36b; }
.fr-panel { margin: 8px 0; padding: 10px; background: rgba(43, 23, 9, .08); box-shadow: inset 0 0 0 2px rgba(43, 23, 9, .25); }
.fr-card { display: flex; gap: 10px; align-items: center; margin: 6px 0; font-size: .92em; }
.fr-card img { width: 56px; height: 56px; image-rendering: pixelated; background: #1f3a2b; padding: 4px; }
.fr-emotes { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.fr-toast { display: flex; gap: 8px; align-items: center; }

/* ---------- page Jeux fusionnée : Steam → Unity/itch.io → navigateur → Versus ---------- */
.games-hub { padding: 28px 0 24px; }
.hub-nav { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 0 0 8px; }
.hub-nav .chip { text-decoration: none; }
.hub-nav [hidden] { display: none; }
.hub-section { padding: 40px 0 32px; scroll-margin-top: 80px; }
.hub-section + .hub-section { border-top: 4px dashed var(--depth); }
.hub-section[hidden] { display: none; }
.hub-section .section-head { margin-bottom: 20px; }
.hub-section.vs-section { padding-top: 40px; }
.btn-steam { --b: #1b2838; --bd: #0e141c; color: #e8f1fa; }

/* ---------- barre de filtres compacte (page Jeux) ---------- */
.lib-toolbar { display: grid; gap: 12px; margin: 0 0 28px; }
.seg {
  display: inline-flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; justify-self: start;
  background: var(--panel); box-shadow: 0 0 0 3px var(--line), 0 6px 0 0 var(--depth); margin: 3px 3px 6px;
}
.seg::-webkit-scrollbar { display: none; }
.seg-btn {
  font: inherit; font-weight: 800; font-size: .95rem; white-space: nowrap; cursor: pointer;
  padding: 8px 14px; border: 0; background: transparent; color: var(--ink);
}
.seg-btn + .seg-btn { box-shadow: inset 3px 0 0 0 var(--line); }
.seg-btn:hover { background: var(--panel-2); }
.seg-btn[aria-pressed="true"] { background: var(--orange); color: var(--btn-ink); }
.seg-n { font-size: .8em; opacity: .65; margin-left: 2px; }
.lib-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 240px); gap: 12px; max-width: 640px; }
.lib-field input, .lib-field select {
  width: 100%; font: inherit; font-weight: 700; color: var(--ink); background: var(--panel);
  border: 0; padding: 9px 12px; box-shadow: 0 0 0 3px var(--line); margin: 3px 0;
}
.lib-search input { padding-left: 34px; background: var(--panel) no-repeat 10px 50% / 16px 16px
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Cpath fill='%236b4f3a' d='M2 0h3v1H2zM1 1h1v1H1zM5 1h1v1H5zM0 2h1v3H0zM6 2h1v3H6zM1 5h1v1H1zM5 5h1v1H5zM2 6h3v1H2zM6 6h1v1H6zM7 7h1v1H7z'/%3E%3C/svg%3E"); }
.lib-field select { cursor: pointer; }
.lib-field select.is-on { background: var(--leaf); color: #15260f; }
.lib-status { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; color: var(--ink-soft); font-weight: 700; font-size: .95rem; }
.lib-reset { font: inherit; font-weight: 800; background: none; border: 0; padding: 0; cursor: pointer; color: var(--orange-dk); text-decoration: underline; }
:root[data-theme="dark"] .lib-reset { color: var(--orange-2); }
.lib-reset[hidden] { display: none; }
@media (max-width: 560px) {
  .seg { justify-self: stretch; }
  .seg-btn { flex: 1 0 auto; padding: 8px 10px; font-size: .9rem; }
  .lib-row { grid-template-columns: 1fr 1fr; max-width: none; }
}

/* raccourcis de section en haut de la page Jeux : une seule ligne, plus discrets */
.hub-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 8px; padding: 4px 3px 8px; margin: 0; }
.hub-nav::-webkit-scrollbar { display: none; }
.hub-nav .chip { flex: none; font-size: .88rem; padding: 4px 12px; }

/* barre de filtres unique en haut de la page Jeux */
.hub-toolbar { margin: 4px 0 8px; }
.card[hidden], .games-grid .card[hidden] { display: none !important; }
.seg-btn:disabled { opacity: .5; cursor: not-allowed; background: transparent; }
.seg-btn:disabled .seg-n { font-style: italic; }
.lib-jump { margin-left: auto; font-weight: 800; text-decoration: none; }
.lib-jump:hover { text-decoration: underline; }
.hub-empty { text-align: center; padding: 28px 16px; margin: 16px 4px 24px; }
.hub-empty[hidden] { display: none; }
.badge-asset { background: #f2b05e; color: #2b1709; }
@media (max-width: 560px) {
  /* sur téléphone, toutes les catégories visibles d'un coup (pastilles qui passent à la ligne) */
  .hub-toolbar .seg { display: flex; flex-wrap: wrap; gap: 8px; background: none; box-shadow: none; overflow: visible; margin: 3px; }
  .hub-toolbar .seg-btn, .hub-toolbar .seg-btn + .seg-btn { flex: 1 1 auto; background: var(--panel); box-shadow: 0 0 0 3px var(--line); padding: 6px 10px; }
  .hub-toolbar .seg-btn[aria-pressed="true"] { background: var(--orange); }
}

/* Accueil, « Ce que je fais » : la règle .skill d'un des jeux (arbre de compétences) ne doit pas s'appliquer ici */
.skills > .skill { display: block; gap: 0; align-items: initial; padding: 26px 24px 18px; background: var(--panel); border: 0; }
.skills { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.skills .btn { max-width: 100%; white-space: normal; }

/* titres longs (ex. Golfaventure) dans les petites cartes de jeux sur mobile */
.games-grid .card-title { overflow-wrap: anywhere; hyphens: auto; }

/* ---------- page Stats ---------- */
.st-section { margin-bottom: 40px; }
.st-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 16px; }
.st-tile { display: grid; gap: 2px; padding: 18px; text-align: center; }
.st-tile .st-ico { font-size: 2rem; }
.st-tile strong { font-size: 2rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.st-tile span { font-weight: 700; color: var(--ink-soft); }
.st-tile small { color: var(--ink-soft); font-size: .8rem; }
.st-clan-intro { margin-bottom: 14px; }
.st-clans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 20px; }
.st-clan { padding: 20px 18px 16px; text-align: center; border-top: 8px solid var(--cc); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.st-clan.is-mine { outline: 4px solid var(--cc); outline-offset: 4px; }
.st-emblem { font-size: 3rem; margin: 0; line-height: 1; }
.st-clan h3 { margin: 0; }
.st-motto { margin: 0; color: var(--ink-soft); font-style: italic; }
.st-clan-stats { display: flex; gap: 24px; margin: 6px 0; }
.st-clan-stats div { display: grid; }
.st-clan-stats dt { font-size: .8rem; color: var(--ink-soft); font-weight: 700; }
.st-clan-stats dd { margin: 0; font-size: 1.3rem; font-weight: 900; }
.st-bar { width: 100%; height: 10px; background: var(--panel-2); box-shadow: 0 0 0 2px var(--line); margin: 4px 0 8px; }
.st-bar span { display: block; height: 100%; background: var(--cc); }
.st-mine { font-weight: 900; color: var(--cc); }
.st-note { font-weight: 700; color: var(--ink-soft); }
.st-err { color: var(--berry); }
.st-updated { color: var(--ink-soft); font-size: .85rem; }
.st-admin { text-align: right; margin: 0 0 8px; }

/* ---------- page Admin ---------- */
.admin { display: grid; gap: 22px; }
.ad-box { padding: 20px 20px 16px; min-width: 0; }
.ad-box h2 { margin: 0 0 12px; font-size: 1.35rem; }
.ad-box h3 { font-size: 1.05rem; margin: 10px 0 8px; }
.ad-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ad-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: 10px; }
.ad-tile { display: grid; gap: 1px; padding: 10px 12px; background: var(--panel-2); border: 3px solid var(--line); }
.ad-tile strong { font-size: 1.4rem; font-weight: 900; }
.ad-tile span { font-weight: 700; font-size: .9rem; }
.ad-tile small { color: var(--ink-soft); font-size: .78rem; }
.ad-note { color: var(--ink-soft); font-size: .92rem; }
.ad-status { position: sticky; top: 76px; z-index: 5; margin: 0; min-height: 0; font-weight: 800; }
.ad-status:empty { display: none; }
.ad-status[data-kind="ok"] { color: var(--moss); }
.ad-status[data-kind="err"] { color: var(--berry); }
.ad-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.ad-row input, .ad-row select, .ad-grid-form input, .ad-grid-form select, .ad-table input {
  font: inherit; padding: 6px 8px; border: 2px solid var(--line); background: var(--panel-2); color: var(--ink); min-width: 0;
}
.ad-row input[type="search"] { flex: 1 1 260px; }
.ad-row input[name="reason"] { flex: 1 1 160px; }
.ad-row input[name="amount"] { width: 130px; }
.ad-table-wrap { overflow-x: auto; }
.ad-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.ad-table th, .ad-table td { text-align: left; padding: 6px 8px; border-bottom: 2px dashed var(--depth); vertical-align: middle; }
.ad-table input[type="number"] { width: 90px; }
.ad-grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: 10px; align-items: end; margin-top: 14px; }
.ad-grid-form h3 { grid-column: 1 / -1; margin: 0; }
.ad-grid-form label { display: grid; gap: 4px; font-weight: 700; font-size: .9rem; }
.ad-grid-form .ad-check { display: flex; align-items: center; gap: 8px; }
.ad-user { border: 3px solid var(--line); background: var(--panel-2); padding: 10px 12px; margin: 10px 0; }
.ad-user header { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.ad-user code { font-size: .75rem; }
.ad-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.ad-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; font-size: .9rem; }
.ad-list small { color: var(--ink-soft); }
.ad-plus { color: var(--moss); }
.ad-minus { color: var(--berry); }
.ad-danger { --b: #f3c1b5; --bd: #b3533d; }
.ad-x, .ad-link { font: inherit; background: none; border: 0; cursor: pointer; color: var(--berry); font-weight: 900; padding: 0 4px; }
.ad-link { color: var(--orange-dk); text-decoration: underline; padding: 0; }
a.account-admin { text-decoration: none; }
.ad-status:not(:empty) { background: var(--panel); padding: 6px 12px; box-shadow: 0 0 0 3px var(--line); width: max-content; max-width: 100%; }

/* borne : l'image carrée d'un jeu maison reste centrée */
.screen-img { object-position: 50% 40%; }
[data-fullscreen][hidden] { display: none; }
.screen-img.is-pixel { object-fit: contain; image-rendering: pixelated; background: #1f3a2b; filter: none; }

/* bouton « Recharger sans cache » de l'en-tête */
.reload-btn.is-busy svg { animation: reload-spin .7s steps(8) infinite; }
@keyframes reload-spin { to { transform: rotate(360deg); } }

/* ===== Arcane Tactics : échanges, défis, arène ===== */
.at-ctx { position: absolute; z-index: 40; min-width: 168px; padding: 6px; border-radius: 12px; background: linear-gradient(180deg, #2a1f45, #1a1230); border: 2px solid #c98a3a; box-shadow: 0 10px 28px rgba(0, 0, 0, .55); display: flex; flex-direction: column; gap: 4px; }
.at-ctx[hidden] { display: none; }
.at-ctx header { padding: 2px 8px 6px; border-bottom: 1px solid rgba(201, 138, 58, .4); color: #f4ecd8; display: flex; flex-direction: column; line-height: 1.2; }
.at-ctx header small { color: #8fe9ff; font-weight: 700; }
.at-ctx button { text-align: left; padding: 8px 10px; border-radius: 8px; border: 0; background: rgba(255, 255, 255, .06); color: #f4ecd8; font: 700 .85rem Nunito, sans-serif; cursor: pointer; }
.at-ctx button:hover:not(:disabled) { background: rgba(201, 138, 58, .35); }
.at-ctx button:disabled { opacity: .4; cursor: not-allowed; }
.at-card-trade { width: min(860px, 100%); }
.at-trade { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.at-trade section, .at-arena section, .at-dr { padding: 10px 12px; border-radius: 12px; background: rgba(42, 33, 80, .12); border: 1px solid rgba(201, 138, 58, .35); }
.at-trade h3, .at-arena h3, .at-dr h3 { margin: 0 0 6px; font-size: .95rem; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.at-trade h4 { margin: 8px 0 4px; font-size: .75rem; opacity: .7; text-transform: uppercase; letter-spacing: .06em; }
.at-offer { display: flex; flex-wrap: wrap; gap: 4px; min-height: 36px; padding: 4px; border-radius: 8px; background: rgba(0, 0, 0, .18); border: 1px dashed rgba(201, 138, 58, .5); align-items: center; }
.at-bag-s { max-height: 150px; overflow: auto; display: flex; flex-wrap: wrap; gap: 4px; }
.at-bag-s .at-bagc.on { outline: 2px solid #ffd257; box-shadow: 0 0 10px rgba(255, 210, 87, .6); }
.at-mat { display: flex; gap: 6px; align-items: center; margin-top: 6px; font-weight: 700; font-size: .85rem; }
.at-mat input[type=number] { width: 72px; padding: 3px 6px; border-radius: 6px; border: 1px solid #c98a3a; background: #1a1230; color: #f4ecd8; }
.at-mat select { padding: 4px 6px; border-radius: 6px; border: 1px solid #c98a3a; background: #1a1230; color: #f4ecd8; }
.at-ok { color: #3fa56a; font-size: .75rem; } .at-wait { color: #d98a1f; font-size: .75rem; }
.at-arena { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0; }
.at-diffs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0; }
.at-diffs .btn small { display: block; font-size: .65rem; opacity: .8; }
.at-hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: .85rem; }
.at-hist li.w { color: #2f8a57; } .at-hist li.l { color: #c0485a; }
.at-hist small { opacity: .7; }
.at-tuto { margin: 6px 0; font-size: .85rem; }
.at-duelres { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.at-dr.win { border-color: #d9a21f; box-shadow: 0 0 14px rgba(255, 210, 87, .35) inset; }
.at-prof { display: flex; gap: 12px; align-items: center; }
@media (max-width: 640px) { .at-trade, .at-arena, .at-duelres { grid-template-columns: 1fr; } }

/* ===== Arcane Tactics : boutiques par zone, familles d'équipement, objets plus compacts ===== */
.at-it-h img { width: 26px; height: 26px; }
.at-bagc img { width: 22px; height: 22px; }
.at-slot img, .at-cs-eq img { width: 28px; height: 28px; }
.at-it { padding: 8px 10px; border-radius: 12px; }
.at-it ul { font-size: .8rem; }
.at-loot-grid { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 8px; }
.at-fam { margin: 6px 0 0; padding: 5px 7px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--fc) 70%, transparent); background: color-mix(in srgb, var(--fc) 14%, transparent); font-size: .72rem; display: flex; flex-direction: column; gap: 1px; }
.at-fam b { color: var(--fc); }
.at-fam small { opacity: .7; font-weight: 700; }
.at-fam span { opacity: .55; }
.at-fam span.on { opacity: 1; color: #5dff9a; font-weight: 800; }
.at-merch { display: grid; grid-template-columns: 1fr 120px; gap: 10px; align-items: stretch; margin: 6px 0; }
.at-merch-h { padding: 8px 12px; border-radius: 12px; border: 2px solid var(--fc); background: linear-gradient(160deg, color-mix(in srgb, var(--fc) 22%, #1a1230), #120c26); color: #f4ecd8; display: flex; flex-direction: column; gap: 3px; }
.at-merch-h b { color: var(--fc); font-size: 1rem; }
.at-merch-h span { font-style: italic; font-size: .85rem; }
.at-merch-h small { opacity: .75; font-size: .72rem; }
.at-prev { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 6px; border-radius: 12px; background: radial-gradient(circle at 50% 40%, rgba(176, 125, 255, .3), rgba(20, 12, 40, .6)); border: 1px solid rgba(201, 138, 58, .45); color: #f4ecd8; }
.at-prev small { font-size: .65rem; line-height: 1.2; margin-top: 2px; }
.at-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.at-chips button { padding: 3px 9px; border-radius: 999px; border: 1px solid rgba(201, 138, 58, .6); background: rgba(42, 33, 80, .12); font: 800 .72rem Nunito, sans-serif; cursor: pointer; color: inherit; }
.at-chips button.on { background: #c98a3a; color: #fff; border-color: #c98a3a; }
.at-chips.r button { border-color: var(--rc, #c98a3a); }
.at-chips.r button.on { background: var(--rc, #c98a3a); color: #1a1230; }
.at-mats { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0; }
.at-loot-i.sel .at-it { outline: 3px solid #ffd257; }
.at-loot-i.mine { position: relative; }
.at-mine { position: absolute; top: -7px; right: 8px; z-index: 2; padding: 1px 8px; border-radius: 999px; background: #2f8a57; color: #fff; font: 800 .62rem Nunito, sans-serif; }
@media (max-width: 640px) { .at-merch { grid-template-columns: 1fr; } .at-prev { flex-direction: row; gap: 8px; } }

/* =========================================================================
   Arcane Tactics 3.0 — DA « fantasy sombre » (référence : image Direction Artistique)
   Palette : encre #120a1d · aubergine #20142f / #2c1c40 · prune #3b2656 · bronze #8a5f2e · or #e8b857
             crème #f4ecd8 · sarcelle #6fe0e8 · cramoisi #d3405a · violet #b07dff
   Panneaux sombres, cadre bronze double filet, titres à losange, barres de HP/PA/PM en pastilles.
   ========================================================================= */
.at-card, :root[data-theme="dark"] .at-card {
  --atbg: #20142f; --atbg2: #2c1c40; --atbg3: #3b2656; --atink: #f4ecd8; --atsoft: #cdbfdc; --atline: #6b4a2a; --atacc: #e8b857; --atcyan: #6fe0e8;
  background: radial-gradient(ellipse at 50% -10%, #3d2860 0%, #24163a 45%, #160d26 100%);
  border-radius: 14px;
  box-shadow: 0 0 0 2px #120a1d, 0 0 0 4px #8a5f2e, 0 0 0 5px #120a1d, 0 20px 56px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 236, 200, .1);
}
.at-card::before { background: repeating-linear-gradient(115deg, rgba(255, 220, 160, .02) 0 18px, transparent 18px 70px); }
.at-card h2, .at-card .at-inv-h h2 { font-family: "Fredoka", "Nunito", sans-serif; color: #f4ecd8; letter-spacing: .01em; text-shadow: 0 2px 0 rgba(0, 0, 0, .45); }
.at-card h2::before { content: "◆"; color: #e8b857; font-size: .55em; margin-right: 9px; vertical-align: .22em; text-shadow: 0 0 8px rgba(232, 184, 87, .6); }
.at-card h3::before { content: "◇"; color: #8a5f2e; font-size: .8em; margin-right: 6px; }
.at-inv-h { border-bottom: 1px solid rgba(138, 95, 46, .55); padding-bottom: 8px; }
.at-gold, .at-pts { background: linear-gradient(180deg, #4a3414, #2f2009); color: #f6d36b; border: 1px solid #a67a2c; box-shadow: inset 0 1px 0 rgba(255, 230, 160, .25); }
.at-x { background: #3b2656; border: 1px solid #8a5f2e; }
.at-x:hover { background: #d3405a; }
.at-tabs button.on { background: #3b2656; border-color: #e8b857; color: #f4ecd8; box-shadow: 0 0 10px rgba(232, 184, 87, .25); }
.at-slot, .at-bagc { background: #150d22; border-color: #6b4a2a; }
.at-bagc.at-bage { background: rgba(21, 13, 34, .55); border-color: #3a2a4e; }
.at-it { background: linear-gradient(160deg, #2c1c40, #150d22); }
.at-chips button { border-color: #8a5f2e; }
.at-chips button.on { background: #e8b857; color: #20142f; border-color: #e8b857; }
.at-mat input[type=number], .at-mat select { border-color: #8a5f2e; background: #150d22; }
.at-trade section, .at-arena section, .at-dr { background: rgba(21, 13, 34, .55); border-color: rgba(138, 95, 46, .6); }
.at-ctx { background: linear-gradient(180deg, #2c1c40, #150d22); border-color: #8a5f2e; }
.at-ctx button:hover:not(:disabled) { background: rgba(232, 184, 87, .28); }
/* HUD */
.at-pf { background: linear-gradient(180deg, rgba(44, 28, 64, .92), rgba(21, 13, 34, .92)); border: 2px solid #8a5f2e; box-shadow: 0 0 0 1px #120a1d, 0 6px 16px rgba(0, 0, 0, .4); }
.at-pf img { border: 1px solid #e8b857; }
.at-toast { background: linear-gradient(180deg, rgba(44, 28, 64, .95), rgba(21, 13, 34, .95)); border: 1px solid #8a5f2e; }
.at-tip { background: linear-gradient(180deg, rgba(44, 28, 64, .98), rgba(18, 10, 29, .98)); border: 2px solid #8a5f2e; box-shadow: 0 8px 22px rgba(0, 0, 0, .5); }
.at-tip strong { color: #f6d36b; }
.at-tip-gold { color: #f6d36b; }
.at-tip-sp b { font-weight: 800; }
.at-tip-sp { margin: 3px 0; }
.at-bar { padding: 10px 14px 12px; border-radius: 16px; background: linear-gradient(180deg, rgba(44, 28, 64, .94), rgba(18, 10, 29, .96)); border: 2px solid #8a5f2e; box-shadow: 0 0 0 1px #120a1d, 0 -4px 24px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 236, 200, .12); }
.at-hbtn { border-color: #8a5f2e; background: linear-gradient(180deg, #3b2656, #20142f); }
.at-hbtn:hover { border-color: #e8b857; }


/* ---------- bio : bloc CV (aperçu + téléchargement) ---------- */
.cv { margin-top: clamp(32px, 6vw, 56px); }
.cv-card { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: clamp(20px, 4vw, 40px); align-items: start; padding: clamp(18px, 3vw, 32px); }
.cv-preview {
  display: block; position: relative; background: #fff; line-height: 0;
  box-shadow: 0 0 0 3px var(--line), 0 8px 0 3px var(--depth); transition: transform .2s steps(3);
}
.cv-preview img { width: 100%; height: auto; display: block; image-rendering: auto; }
.cv-preview:hover { transform: translateY(-3px); }
.cv-preview:focus-visible { outline: 3px solid var(--orange); outline-offset: 6px; }
.cv-info h2 { margin: 0 0 .4em; }
.cv-info .facts { margin: 1em 0 1.2em; }
.cv-meta { margin: 14px 0 0; font-size: .85rem; color: var(--ink-soft); }
@media (max-width: 720px) {
  .cv-card { grid-template-columns: 1fr; }
  .cv-preview { max-width: 340px; width: 100%; margin: 0 auto 6px; }
}
@media (prefers-reduced-motion: reduce) { .cv-preview, .cv-preview:hover { transition: none; transform: none; } }
