/* PlayLearn · thème « orbite » : verre sombre, profondeur et lumière champagne. */
:root {
  color-scheme: dark;
  --font: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", Inter, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI Variable", "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --bg: #030506;
  --ink: #f3f6f7;
  --muted: #a3b3b8;
  --faint: #7d8f95;
  --line: rgba(196,228,232,.08);
  --line-2: rgba(206,236,240,.15);
  --line-3: rgba(222,244,246,.27);
  --glass-1: rgba(54,78,82,.30);
  --glass-2: rgba(12,20,23,.64);
  --gold: #ecd6a3;
  --gold-glow: rgba(236,214,163,.35);
  --violet: #a994ff;
  --mint: #7fe2c5;
  --amber: #e8c46e;
  --rose: #f08d9d;
  --cyan: #93e0d5;
  --radius: 20px;
  --ease: cubic-bezier(.2,.8,.2,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --shadow: 0 40px 80px -40px rgba(0,0,0,.9), 0 18px 40px -18px rgba(0,0,0,.65);
  --gap: 16px;
  --header-height: 64px;
  --sidebar-width: 228px;
  --px: 0;
  --py: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); isolation: isolate; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea { touch-action: manipulation; }
::selection { background: rgba(236,214,163,.28); }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
main:focus { outline: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* Scène : aurores, sol en perspective et poussière, en couches de profondeur. */
#ambient {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(120% 80% at 72% -12%, #0d2428 0%, transparent 55%),
    radial-gradient(90% 70% at 0% 105%, #0a1519 0%, transparent 60%),
    var(--bg);
}
#ambient .layer { position: absolute; inset: -80px; will-change: transform; }
#ambient .layer::before { content: ""; position: absolute; }
.aurora { transform: translate3d(calc(var(--px) * -34px), calc(var(--py) * -24px), 0); }
.aurora::before {
  inset: 0;
  background:
    radial-gradient(38% 34% at 78% 16%, rgba(72,152,162,.24), transparent 70%),
    radial-gradient(30% 30% at 18% 74%, rgba(140,120,255,.11), transparent 70%),
    radial-gradient(24% 20% at 52% 46%, rgba(236,214,163,.045), transparent 70%);
  animation: drift 42s ease-in-out infinite alternate;
}
.grid { transform: translate3d(calc(var(--px) * 16px), calc(var(--py) * 10px), 0); opacity: .55; }
.grid::before {
  left: -60%; right: -60%; bottom: -20%; height: 75%;
  background-image: linear-gradient(rgba(150,210,215,.075) 1px, transparent 1px), linear-gradient(90deg, rgba(150,210,215,.075) 1px, transparent 1px);
  background-size: 72px 72px;
  transform-origin: 50% 100%;
  transform: perspective(720px) rotateX(74deg);
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 72%);
  mask-image: linear-gradient(to top, #000 0%, transparent 72%);
  animation: floor 16s linear infinite;
}
.dust { transform: translate3d(calc(var(--px) * -52px), calc(var(--py) * -36px), 0); }
.dust::before {
  left: 0; right: 0; top: -360px; bottom: -360px;
  background-image:
    radial-gradient(1.4px 1.4px at 22px 40px, rgba(255,246,222,.55), transparent 2px),
    radial-gradient(1px 1px at 140px 210px, rgba(210,240,240,.45), transparent 2px),
    radial-gradient(1.6px 1.6px at 260px 90px, rgba(190,175,255,.5), transparent 2px),
    radial-gradient(1px 1px at 310px 300px, rgba(255,255,255,.35), transparent 2px),
    radial-gradient(1.2px 1.2px at 80px 330px, rgba(236,214,163,.45), transparent 2px);
  background-size: 360px 360px;
  animation: rise 120s linear infinite;
}
.dust.far { transform: translate3d(calc(var(--px) * -20px), calc(var(--py) * -14px), 0); opacity: .55; }
.dust.far::before { background-size: 220px 220px; animation-duration: 200s; }
#ambient .vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, transparent 50%, rgba(0,0,0,.7) 100%); }

/* Verre : surfaces translucides, bord lumineux et reflet qui suit le pointeur. */
.app-header, .sidebar, .panel, .game-card, .score-panel, .metric, .detail-card, .node, .demo-popover, .client-row, .empty, #feedback, #operation-state, #game-form > .form-actions {
  background: linear-gradient(155deg, var(--glass-1), var(--glass-2) 58%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.05);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
}
.panel, .game-card, .score-panel, .metric, .detail-card, .node, .client-row, .empty { position: relative; isolation: isolate; }
.app-header::before, .sidebar::before, .panel::before, .game-card::before, .score-panel::before, .metric::before, .detail-card::before, .node::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(160deg, rgba(255,255,255,.2), rgba(255,255,255,.02) 38%, rgba(255,255,255,0) 62%, rgba(236,214,163,.12));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.panel::after, .game-card::after, .score-panel::after, .metric::after, .detail-card::after, .node::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -40%), rgba(255,255,255,.07), transparent 45%);
  opacity: 0; transition: opacity .5s var(--ease);
}
.panel:hover::after, .game-card:hover::after, .score-panel:hover::after, .metric:hover::after, .detail-card:hover::after, .node:hover::after { opacity: 1; }

/* Barre supérieure flottante. */
.app-header {
  position: sticky; top: var(--gap); z-index: 20;
  height: var(--header-height);
  margin: var(--gap) var(--gap) 0;
  padding: 0 12px 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-radius: 18px;
  background: linear-gradient(155deg, rgba(40,58,62,.42), rgba(8,14,16,.72) 60%);
}
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -.2px; }
.brand-mark { display: inline-flex; width: 40px; height: 40px; filter: drop-shadow(0 6px 16px rgba(140,120,255,.55)); transition: transform .8s var(--ease-out), filter .6s; }
.brand-mark svg { width: 100%; height: 100%; overflow: visible; }
.brand-satellite { filter: drop-shadow(0 0 3px #ecd6a3); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); filter: drop-shadow(0 8px 22px rgba(160,140,255,.75)); }
.brand-dot { color: var(--gold); margin-left: -11px; }
.header-pill {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(255,255,255,.035);
  font-size: 12px; color: var(--muted); white-space: nowrap;
}
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-actions .active { color: #fff8e6; border-color: rgba(236,214,163,.5); background: linear-gradient(180deg, rgba(236,214,163,.2), rgba(236,214,163,.05)); }
.demo-menu { position: relative; }
.demo-menu > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px 8px 8px; border-radius: 12px;
  border: 1px solid var(--line-2); background: rgba(255,255,255,.035);
  font-size: 13px; color: var(--ink);
  transition: border-color .3s, background .3s;
}
.demo-menu > summary::before {
  content: ""; width: 24px; height: 24px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.45), transparent 50%), linear-gradient(150deg, var(--gold), #7a6334);
  box-shadow: 0 0 14px -2px var(--gold-glow);
}
.demo-menu > summary::after { content: "⌄"; color: var(--muted); margin-top: -5px; }
.demo-menu > summary::-webkit-details-marker { display: none; }
.demo-menu > summary:hover, .demo-menu[open] > summary { border-color: var(--line-3); background: rgba(255,255,255,.06); }
.demo-popover {
  position: absolute; right: 0; top: calc(100% + 12px); z-index: 25;
  width: min(320px, calc(100vw - 32px)); padding: 20px; border-radius: 16px;
  background: linear-gradient(155deg, rgba(40,58,62,.8), rgba(8,14,16,.94) 60%);
  animation: pop .35s var(--ease-out);
}
.profile { display: block; font-size: 12px; color: var(--muted); }
.demo-popover select { margin-top: 10px; }
.demo-popover p { font-size: 11.5px; color: var(--faint); margin: 12px 0 0; line-height: 1.6; }

/* Navigation latérale flottante. */
.sidebar {
  position: fixed; z-index: 10;
  top: calc(var(--header-height) + var(--gap) * 2); left: var(--gap); bottom: var(--gap);
  width: var(--sidebar-width); padding: 18px 12px;
  display: flex; flex-direction: column; overflow: hidden auto; scrollbar-width: none;
}
.sidebar::before { inset: 0; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); padding: 6px 10px; margin: 0 0 18px; border-radius: 9px; transition: color .3s, background .3s; }
.back:hover { color: var(--ink); background: rgba(255,255,255,.05); }
.nav-caption { font-size: 10px; font-weight: 600; letter-spacing: 1.8px; color: var(--faint); padding-left: 12px; margin: 4px 0 10px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin: 3px 0; border-radius: 12px;
  font-size: 13.5px; color: var(--muted);
  transition: color .3s, background .3s, box-shadow .3s;
}
.sidebar nav a::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .35; transition: opacity .3s, background .3s, box-shadow .3s; }
.sidebar nav a:hover { color: var(--ink); background: rgba(255,255,255,.04); }
.sidebar nav a.active { color: #fff9ea; background: linear-gradient(100deg, rgba(236,214,163,.17), rgba(236,214,163,.03)); box-shadow: inset 0 0 0 1px rgba(236,214,163,.28), 0 0 32px -10px var(--gold-glow); }
.sidebar nav a.active::before { opacity: 1; background: var(--gold); box-shadow: 0 0 10px 2px var(--gold-glow); }
.sidebar-note { margin-top: auto; padding: 16px 10px 2px; border-top: 1px solid var(--line); font-size: 12px; color: var(--mint); }
.sidebar-note p { color: var(--faint); font-size: 11px; line-height: 1.6; margin: 6px 0 0; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); margin-right: 6px; animation: beacon 2.6s ease-out infinite; }

/* Mise en page. */
.shell { padding: 0 var(--gap); }
.inside-workspace .shell { margin-left: calc(var(--sidebar-width) + var(--gap)); }
.context-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 34px 28px 4px; }
.context-header .eyebrow { margin-bottom: 8px; }
.context-header strong { display: block; font-family: var(--font-display); font-size: 34px; font-weight: 350; letter-spacing: -.7px; line-height: 1.15; overflow-wrap: anywhere; }
.context-client { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.context-header > .badge { flex-shrink: 0; margin-bottom: 6px; }
main { max-width: 1460px; margin: 0 auto; padding: 28px 28px 48px; min-height: calc(100vh - 210px); }
body:not(.inside-workspace) main { padding-top: 52px; }
footer { display: flex; justify-content: space-between; gap: 16px; margin: 0 28px; padding: 18px 0 22px; border-top: 1px solid var(--line); font-size: 11px; color: var(--faint); }
.skip { position: fixed; top: -80px; left: 20px; z-index: 40; padding: 12px 16px; border-radius: 10px; background: #2a2418; color: var(--gold); }
.skip:focus { top: 12px; }

/* Connexion administrateur. */
.logged-out .shell { min-height: calc(100vh - var(--header-height) - var(--gap) * 2); display: flex; flex-direction: column; }
.logged-out main { width: 100%; flex: 1; display: grid; place-items: center; padding-top: 24px; padding-bottom: 48px; }
.logged-out footer { margin-top: auto; }
.login-layout { position: relative; width: min(100%, 900px); min-height: 560px; display: grid; place-items: center; isolation: isolate; }
.login-orbit { position: absolute; z-index: -1; width: min(68vw, 590px); aspect-ratio: 1; border: 1px solid rgba(147,224,213,.08); border-radius: 50%; box-shadow: 0 0 100px rgba(78,155,163,.09), inset 0 0 90px rgba(78,155,163,.05); animation: float 9s ease-in-out infinite; }
.login-orbit::before, .login-orbit::after { content: ""; position: absolute; inset: 10%; border: 1px solid rgba(236,214,163,.08); border-radius: 50%; transform: rotateX(68deg) rotateZ(-24deg); }
.login-orbit::after { inset: 21%; transform: rotateX(68deg) rotateZ(34deg); }
.login-orbit span { position: absolute; top: 19%; right: 21%; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 24px 7px rgba(236,214,163,.32); }
.login-orbit i { position: absolute; bottom: 23%; left: 19%; width: 5px; height: 5px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 22px 6px rgba(127,226,197,.35); }
.login-card { width: min(100%, 430px); padding: clamp(28px, 5vw, 48px); background: linear-gradient(155deg, rgba(32,54,59,.72), rgba(6,12,14,.88) 72%); }
.login-card h1 { font-size: clamp(29px, 4vw, 38px); margin-bottom: 10px; }
.login-card .intro { margin-bottom: 28px; }
.login-card label { display: grid; gap: 9px; margin: 18px 0; color: var(--muted); font-size: 13px; }
.login-card input { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid var(--line-2); border-radius: 11px; background: rgba(0,0,0,.25); color: var(--ink); }
.login-card input:focus { border-color: rgba(236,214,163,.58); }
.login-submit { width: 100%; min-height: 48px; margin-top: 12px; justify-content: space-between; padding-inline: 16px 18px; }
.login-error { margin: 18px 0 10px; padding: 11px 13px; border: 1px solid rgba(240,141,157,.32); border-radius: 10px; color: #ffdbe2; background: rgba(80,32,42,.38); font-size: 13px; }

/* Typographie. */
h1 { font-family: var(--font-display); font-size: 30px; font-weight: 400; letter-spacing: -.6px; margin: 2px 0 8px; }
h2 { font-size: 17px; font-weight: 600; letter-spacing: -.2px; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 6px; }
p { line-height: 1.6; }
.muted, .intro { color: var(--muted); font-size: 14px; }
.intro { margin: 0; line-height: 1.7; }
.eyebrow { font-size: 10.5px; font-weight: 600; letter-spacing: 2.2px; text-transform: uppercase; color: var(--gold); opacity: .9; margin: 0 0 10px; }
.heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 30px; }
code { font-family: var(--mono); font-size: .92em; color: #d8e5e8; }

/* Commandes. */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.02));
  color: var(--ink); font-size: 13.5px; font-weight: 550; letter-spacing: .1px; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 6px 18px -10px rgba(0,0,0,.8);
  transition: transform .45s var(--ease-out), background .3s, border-color .3s, box-shadow .4s, color .3s;
}
button:hover:not(:disabled), .button:hover { border-color: var(--line-3); background: linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.03)); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 16px 32px -14px rgba(0,0,0,.95); }
button:active:not(:disabled), .button:active { transform: translateY(1px) scale(.98); }
button:disabled { opacity: .45; cursor: not-allowed; }
.primary {
  color: #fff8e6; border-color: rgba(236,214,163,.45);
  background: linear-gradient(180deg, rgba(236,214,163,.26), rgba(201,168,101,.09));
  box-shadow: inset 0 1px 0 rgba(255,246,222,.25), 0 12px 32px -12px rgba(236,214,163,.4);
}
.primary:hover:not(:disabled) { border-color: rgba(244,226,182,.78); background: linear-gradient(180deg, rgba(236,214,163,.34), rgba(201,168,101,.13)); box-shadow: inset 0 1px 0 rgba(255,246,222,.32), 0 16px 44px -10px rgba(236,214,163,.55); }
.ghost { background: transparent; box-shadow: none; }
.small-button { padding: 7px 12px; font-size: 12.5px; border-radius: 10px; }
.is-pending::after { content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 6px; border: 1.5px solid rgba(236,214,163,.25); border-top-color: var(--gold); border-radius: 50%; animation: processing 900ms linear infinite; }

.badge { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 8px; font-size: 11px; font-weight: 600; white-space: nowrap; color: #cfdbdf; background: rgba(255,255,255,.04); border: 1px solid var(--line-2); }
.badge.published { color: #9df0d5; border-color: rgba(127,226,197,.4); background: rgba(127,226,197,.08); }
.badge.draft { color: #f1d896; border-color: rgba(232,196,110,.38); background: rgba(232,196,110,.07); }
.badge.published::before, .badge.draft::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }

/* Champs. */
label { display: block; font-size: 13px; color: #d6e1e4; }
label > input, label > select, label > textarea { margin-top: 8px; }
input, select, textarea {
  display: block; width: 100%; padding: 11px 14px; border-radius: 12px;
  border: 1px solid var(--line-2); background: rgba(0,0,0,.32); color: var(--ink); font-size: 14px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.45);
  transition: border-color .25s, box-shadow .3s, background .3s;
}
input:hover, select:hover, textarea:hover { border-color: var(--line-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(236,214,163,.6); background: rgba(0,0,0,.45); box-shadow: 0 0 0 4px rgba(236,214,163,.1), inset 0 1px 2px rgba(0,0,0,.45); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[readonly] { color: #b9c8cd; background: rgba(255,255,255,.025); }
select option { background: #0e171a; color: var(--ink); }
textarea { resize: vertical; min-height: 100px; }
.help { display: block; color: var(--faint); font-size: 11.5px; line-height: 1.6; margin-top: 7px; }
.full { grid-column: 1 / -1; }
.config-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.config-fieldset input:disabled, .config-fieldset select:disabled { opacity: 1; color: #b9c8cd; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-actions { display: flex; align-items: center; gap: 12px; margin: 20px 0; flex-wrap: wrap; }
#game-form > .form-actions { position: sticky; bottom: var(--gap); z-index: 5; padding: 14px 16px; border-radius: 16px; }
.save-state { font-size: 12px; color: var(--muted); margin-right: auto; line-height: 1.5; }
.save-state.unsaved { color: var(--amber); }
.save-state.unsaved::before { content: "● "; }
.inline-form { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.inline-form label { flex: 1; min-width: 200px; }
.inline-form .save-state { flex-basis: 100%; }
.readonly-note { font-size: 12.5px; color: var(--amber); }

/* Panneaux et blocs. */
.panel { padding: 26px; margin-bottom: 20px; }
.panel p:first-child { margin-top: 0; }
.panel > label + label { margin-top: 18px; }
.two-col { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(300px,1fr); gap: 20px; }
.section-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 26px 0 18px; }
.section-bar h2 { margin: 0; }
.section-bar > .muted { margin: 0; white-space: nowrap; }
.panel .section-bar { margin: 0 0 8px; }
.filters {
  display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end;
  padding: 6px; border-radius: 16px;
  border: 1px solid var(--line-2); background: linear-gradient(155deg, rgba(40,58,62,.35), rgba(8,14,16,.6));
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
.filters input, .filters select { border-color: transparent; background: rgba(0,0,0,.3); padding: 9px 13px; font-size: 13px; border-radius: 11px; }
.filters input { width: 240px; }
.filters select { width: auto; min-width: 150px; }
.empty { padding: 44px 24px; text-align: center; color: var(--muted); line-height: 1.7; border-style: dashed; border-color: var(--line-2); }
.empty .form-actions { justify-content: center; }
.notice { position: relative; margin: 18px 0; padding: 14px 16px 14px 20px; border-radius: 14px; font-size: 12.5px; line-height: 1.7; color: #c4d6db; background: rgba(127,200,200,.05); border: 1px solid rgba(147,224,213,.15); overflow-wrap: anywhere; }
.notice::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 2px; border-radius: 2px; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.notice.warning { color: #eadcb6; background: rgba(232,196,110,.05); border-color: rgba(232,196,110,.18); }
.notice.warning::before { background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.notice button { margin-left: 8px; }

/* Indicateurs. */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin: 0 0 26px; }
.metric { padding: 20px 22px 22px; border-radius: 18px; transform: perspective(900px) rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg)); transition: transform .7s var(--ease-out), border-color .4s; }
.metric .label { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.metric .label::before { content: ""; flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-3); background: radial-gradient(circle, var(--gold) 0 2px, transparent 3px); box-shadow: 0 0 14px -4px var(--gold-glow); }
.metric .number { display: block; margin: 18px 0 6px; font-family: var(--font-display); font-size: 44px; font-weight: 300; letter-spacing: -1.4px; line-height: 1; font-variant-numeric: tabular-nums; }
.metric small { font-size: 11.5px; color: var(--faint); line-height: 1.5; }

/* Cartes de parties. */
.game-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 22px; }
.game-grid > .empty { grid-column: 1 / -1; }
.game-card {
  display: flex; flex-direction: column;
  transform: perspective(1000px) rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg)) translateY(var(--lift, 0px));
  transition: transform .7s var(--ease-out), border-color .4s, box-shadow .6s;
}
.game-card:hover { --lift: -6px; border-color: var(--line-2); box-shadow: 0 50px 90px -40px rgba(0,0,0,.95), 0 30px 70px -36px rgba(236,214,163,.16), inset 0 1px 0 rgba(255,255,255,.06); }
.card-visual {
  position: relative; height: 150px; margin: 10px 10px 0; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line);
  background: radial-gradient(80% 90% at 50% 55%, rgba(169,148,255,.16), transparent 65%), rgba(0,0,0,.3);
}
.card-visual::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(1px 1px at 18% 30%, rgba(255,255,255,.5), transparent 2px), radial-gradient(1px 1px at 76% 22%, rgba(236,214,163,.6), transparent 2px), radial-gradient(1.4px 1.4px at 86% 70%, rgba(200,190,255,.6), transparent 2px), radial-gradient(1px 1px at 30% 78%, rgba(255,255,255,.4), transparent 2px), radial-gradient(1px 1px at 58% 12%, rgba(255,255,255,.35), transparent 2px);
  transform: translate3d(calc(var(--nx, 0) * -8px), calc(var(--ny, 0) * -6px), 0);
  transition: transform .8s var(--ease-out);
}
.card-visual .ring { position: absolute; left: 50%; top: 50%; border-radius: 50%; border: 1px dashed rgba(220,210,255,.45); transform: translate(-50%,-50%) rotateX(70deg); animation: orbit 34s linear infinite; }
.card-visual .ring::after { content: ""; position: absolute; top: 50%; left: -3px; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.card-visual .r1 { width: 150px; height: 150px; }
.card-visual .r2 { width: 250px; height: 250px; border-style: dotted; border-color: rgba(236,214,163,.38); animation-duration: 60s; animation-direction: reverse; }
.card-visual .float { position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px; animation: float 7s ease-in-out infinite; }
.mini-orb {
  display: block; width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff 0%, #e4dcff 7%, #a996ff 26%, #5b47c9 55%, #1d1650 85%);
  box-shadow: 0 0 36px 4px rgba(150,128,255,.38), inset -8px -10px 18px rgba(8,5,30,.65), inset 3px 4px 10px rgba(255,255,255,.25);
  transform: translate3d(calc(var(--nx, 0) * 12px), calc(var(--ny, 0) * 9px), 0);
  transition: transform .8s var(--ease-out);
}
.card-visual.draft { background: radial-gradient(80% 90% at 50% 55%, rgba(232,196,110,.13), transparent 65%), rgba(0,0,0,.3); }
.card-visual.draft .mini-orb { background: radial-gradient(circle at 34% 28%, #fff 0%, #fbefcf 7%, #e2c27c 28%, #8e6c2c 58%, #2c200b 88%); box-shadow: 0 0 36px 4px rgba(232,196,110,.28), inset -8px -10px 18px rgba(30,20,4,.65), inset 3px 4px 10px rgba(255,255,255,.25); }
.card-body { padding: 20px 22px 6px; flex: 1; }
.card-status { margin-bottom: 14px; }
.client-name { font-size: 10.5px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--faint); margin: 0 0 6px; }
.card-body h2 { font-family: var(--font-display); font-size: 21px; font-weight: 400; letter-spacing: -.3px; line-height: 1.3; margin: 0 0 6px; overflow-wrap: anywhere; }
.card-data { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.card-bottom { padding: 12px 22px 22px; }
.card-bottom .button { width: 100%; }

/* Vue d’ensemble : constellation de la partie et fiche de synthèse. */
.overview-stage { display: grid; grid-template-columns: minmax(0,1fr) 350px; gap: 22px; align-items: start; }
.constellation { position: relative; display: grid; grid-template-columns: 190px 180px minmax(0,1fr); column-gap: 52px; align-items: center; min-height: 580px; padding: 24px 0; }
.links { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.link { fill: none; stroke: rgba(206,236,240,.13); stroke-width: 1; }
.link.hot { stroke: url(#lk-hot); stroke-width: 1.4; }
.link.leaf { stroke: url(#lk-leaf); stroke-width: 1.1; }
.spark { fill: #fff6dd; filter: drop-shadow(0 0 4px #ecd6a3); }
.core { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.orb-wrap { position: relative; width: 180px; height: 180px; display: grid; place-items: center; }
.orb-halo { position: absolute; inset: -64px; border-radius: 50%; background: radial-gradient(circle, rgba(64,96,102,.26) 0%, rgba(16,26,29,.32) 48%, transparent 70%); box-shadow: inset 0 0 0 1px rgba(200,230,235,.05); }
.orb-ring { position: absolute; border-radius: 50%; }
.orb-ring.r1 { inset: 16px; border: 1px dashed rgba(196,186,255,.32); animation: spin 28s linear infinite; }
.orb-ring.r2 { inset: 0; border: 1px dotted rgba(236,214,163,.24); animation: spin 46s linear infinite reverse; }
.orb-ring.r3 {
  inset: 30px;
  background: repeating-conic-gradient(rgba(206,196,255,.6) 0 1.2deg, transparent 1.2deg 7deg);
  -webkit-mask: radial-gradient(circle, transparent 60%, #000 62% 72%, transparent 74%);
  mask: radial-gradient(circle, transparent 60%, #000 62% 72%, transparent 74%);
  animation: spin 70s linear infinite;
}
.orb {
  position: relative; display: block; width: 74px; height: 74px; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff 0%, #e6deff 7%, #b3a2ff 24%, #6e58e0 50%, #2a1f78 78%, #120c35 100%);
  box-shadow: 0 0 30px 6px rgba(150,128,255,.45), 0 0 100px 24px rgba(120,100,255,.16), inset -10px -14px 24px rgba(10,6,40,.7), inset 4px 6px 12px rgba(255,255,255,.25);
}
.orb::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(220,210,255,.22); animation: breathe 4.5s ease-in-out infinite; }
.core-name { margin: 0; max-width: 200px; font-family: var(--font-display); font-size: 15px; font-weight: 600; line-height: 1.35; }
.core-meta { margin: 4px 0 0; font-size: 11.5px; color: var(--faint); }
.hubs { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 14px; }
.node.hub { width: 100%; justify-content: flex-start; gap: 14px; padding: 13px 16px; border-radius: 14px; text-align: left; font-weight: 400; }
.node.hub:hover, .node.hub:active { transform: none; border-color: var(--line-3); }
.hub-icon { flex-shrink: 0; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255,255,255,.04); font-size: 12px; color: var(--muted); transition: color .3s, border-color .3s; }
.hub-text strong { display: block; font-family: var(--font-display); font-size: 24px; font-weight: 350; letter-spacing: -.5px; line-height: 1; }
.hub-text small { display: block; margin-top: 5px; font-size: 11.5px; color: var(--muted); }
.node.hub[aria-pressed="true"] { border-color: rgba(236,214,163,.55); background: linear-gradient(155deg, rgba(236,214,163,.17), rgba(26,22,12,.55) 70%); box-shadow: 0 0 0 1px rgba(236,214,163,.14), 0 0 44px -8px rgba(236,214,163,.38), var(--shadow); }
.node.hub[aria-pressed="true"] .hub-icon { color: var(--gold); border-color: rgba(236,214,163,.45); }
.leaves { position: relative; z-index: 1; min-width: 0; align-self: center; }
.leaf-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.leaf { display: flex; align-items: center; gap: 12px; min-width: 0; }
.leaf-dot { position: relative; flex-shrink: 0; width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff7e0, var(--gold) 45%, #7a6334); box-shadow: 0 0 10px rgba(236,214,163,.6); }
.leaf-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.leaf-title { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--ink); }
.leaf-meta { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.leaf-note { overflow: hidden; text-overflow: ellipsis; }
.chip { padding: 1px 7px; border-radius: 6px; border: 1px solid var(--line-2); background: rgba(255,255,255,.06); color: #d8e3e6; font-weight: 600; }
.bars { display: inline-flex; gap: 2px; }
.bars i { width: 8px; height: 4px; border-radius: 1px; background: rgba(255,255,255,.12); }
.tone-ok .bars i { background: var(--mint); box-shadow: 0 0 6px rgba(127,226,197,.5); }
.tone-mid .bars i:nth-child(-n+2), .tone-wait .bars i:first-child { background: var(--amber); }
.leaf.more a { font-size: 12px; color: var(--gold); text-decoration: underline; text-underline-offset: 4px; }
.leaf-empty { margin: 0; font-size: 13px; color: var(--muted); }
.detail-card { position: sticky; top: calc(var(--header-height) + var(--gap) * 3); padding: 26px; border-radius: 24px; transform: perspective(1100px) rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg)); transition: transform .8s var(--ease-out); }
.detail-kicker { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-size: 13px; color: var(--muted); }
.kicker-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-3); color: var(--gold); font-size: 13px; }
.detail-title { margin: 0 0 20px; font-family: var(--font-display); font-size: 27px; font-weight: 350; letter-spacing: -.5px; line-height: 1.25; overflow-wrap: anywhere; }
.detail-status { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px 14px; align-items: center; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0,0,0,.26); }
.detail-status .badge { grid-column: 1 / -1; justify-self: start; }
.detail-status p { margin: 0; font-size: 12px; line-height: 1.55; color: var(--muted); }
.detail-status strong { color: var(--ink); font-weight: 600; }
.pulse-card { margin-top: 16px; padding: 18px 18px 12px; border-radius: 16px; border: 1px solid rgba(169,148,255,.22); background: radial-gradient(120% 140% at 0% 0%, rgba(169,148,255,.24), transparent 55%), rgba(0,0,0,.26); }
.pulse-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: #e4e0f5; }
.pulse-value { display: flex; align-items: flex-end; gap: 14px; margin-top: 12px; }
.pulse-value strong { font-family: var(--font-display); font-size: 46px; font-weight: 300; letter-spacing: -1.5px; line-height: 1; font-variant-numeric: tabular-nums; }
.pulse-value span { padding-bottom: 6px; font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.histogram { display: block; width: 100%; height: 84px; margin-top: 14px; overflow: visible; }
.histogram rect { fill: rgba(200,190,255,.16); }
.histogram rect.on { fill: url(#hist); }
.histogram text { fill: var(--faint); font-size: 8px; font-family: var(--font); }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.mini-stat { padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.025); transition: border-color .3s, background .3s; }
.mini-stat:hover { border-color: var(--line-2); background: rgba(255,255,255,.045); }
.mini-stat strong { display: block; margin-bottom: 8px; font-family: var(--font-display); font-size: 28px; font-weight: 300; letter-spacing: -.6px; line-height: 1; font-variant-numeric: tabular-nums; }
.mini-stat span { font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.detail-links { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; }
.detail-links a { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; border-radius: 12px; border: 1px solid transparent; font-size: 13px; color: #d4e0e3; transition: background .3s, border-color .3s; }
.detail-links a::after { content: "›"; color: var(--gold); transition: transform .4s var(--ease-out); }
.detail-links a:hover { background: rgba(255,255,255,.04); border-color: var(--line); }
.detail-links a:hover::after { transform: translateX(4px); }
.preparation-list { list-style: none; padding: 0; margin: 16px 0 0; counter-reset: steps; }
.preparation-list li { counter-increment: steps; display: grid; grid-template-columns: 32px 1fr auto; gap: 4px 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.preparation-list li::before { content: counter(steps); grid-row: span 2; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(236,214,163,.35); color: var(--gold); font-size: 12px; }
.preparation-list strong { font-size: 13.5px; font-weight: 600; }
.preparation-list span { grid-column: 2; font-size: 12px; line-height: 1.5; color: var(--muted); }
.preparation-list a { grid-column: 3; grid-row: 1 / span 2; font-size: 12px; color: var(--gold); text-decoration: underline; text-underline-offset: 4px; }

/* Configuration. */
.challenge-editor { display: grid; grid-template-columns: 1.4fr .6fr 1.1fr auto; gap: 12px; align-items: end; padding: 16px 0; border-top: 1px solid var(--line); }
.challenge-editor button { width: 44px; height: 44px; padding: 0; font-size: 18px; }

/* Tableaux. */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; text-align: left; font-variant-numeric: tabular-nums; }
th { padding: 12px 14px; border-bottom: 1px solid var(--line-2); font-size: 10.5px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--faint); }
td { padding: 13px 14px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .3s; }
tbody tr:hover { background: rgba(255,255,255,.03); }
.numeric { text-align: right; }
.rank { width: 64px; color: var(--gold); font-weight: 600; }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 12px; vertical-align: middle; border-radius: 50%; font-size: 12px; font-weight: 600; color: #ece7ff; background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.32), transparent 50%), linear-gradient(150deg, #7b68e0, #2c2468); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 4px 14px -4px rgba(140,120,255,.6); }
.self td { background: rgba(236,214,163,.06); }
.self td:first-child { box-shadow: inset 2px 0 var(--gold); }
.table-wrap .badge { margin-left: 8px; }

/* Simulateur. */
.score-panel {
  padding: 28px; margin-bottom: 20px;
  background: radial-gradient(90% 120% at 0% 0%, rgba(169,148,255,.22), transparent 55%), radial-gradient(80% 100% at 100% 100%, rgba(236,214,163,.10), transparent 60%), linear-gradient(155deg, var(--glass-1), var(--glass-2));
  transform: perspective(1000px) rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg));
  transition: transform .8s var(--ease-out);
}
.player-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.score-number { margin: 22px 0 10px; font-family: var(--font-display); font-size: 68px; font-weight: 250; letter-spacing: -2.5px; line-height: 1; font-variant-numeric: tabular-nums; }
.score-number small { font-size: 15px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.progress-label { display: flex; justify-content: space-between; margin: 18px 0 10px; font-size: 12px; color: var(--muted); }
progress { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 6px; border: 0; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.07); }
progress::-webkit-progress-bar { background: rgba(255,255,255,.07); border-radius: 999px; }
progress::-webkit-progress-value { background: linear-gradient(90deg, #7d6af0, #b8a8ff 55%, var(--gold)); border-radius: 999px; }
progress::-moz-progress-bar { background: linear-gradient(90deg, #7d6af0, var(--gold)); border-radius: 999px; }
.challenge-item { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.challenge-item:last-child { border-bottom: 0; }
.challenge-item .step { flex-shrink: 0; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(236,214,163,.35); background: radial-gradient(circle, rgba(236,214,163,.12), transparent 70%); color: var(--gold); font-size: 12px; }
.challenge-item .challenge-text { flex: 1; min-width: 0; }
.challenge-item h3 { font-size: 14px; line-height: 1.4; margin: 0; }
.challenge-item p { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); }
.challenge-item button { padding: 8px 13px; font-size: 12px; }
.updated { font-size: 11.5px; color: var(--faint); }
.code { max-height: 420px; overflow: auto; padding: 20px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0,0,0,.45); color: #cfe0e4; font: 12px/1.75 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.response { margin-top: 20px; }
.response summary, .snippet-details > summary, .technical-details > summary { cursor: pointer; line-height: 1.6; }
.response summary { font-size: 12px; color: var(--muted); }
.snippet-details { margin-top: 24px; }
.snippet-details > summary, .technical-details > summary { padding: 4px 0; font-size: 14px; font-weight: 600; }
.technical-details code { overflow-wrap: anywhere; }

/* Administration. */
.client-list { display: grid; gap: 10px; }
.client-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; border-radius: 14px; box-shadow: none; }
.client-row small { display: block; margin-top: 5px; color: var(--muted); }

/* Retours d’état. */
#feedback {
  position: fixed; z-index: 30;
  top: calc(var(--header-height) + var(--gap) * 2); right: calc(var(--gap) + 8px);
  max-width: min(440px, calc(100vw - 40px));
  padding: 14px 18px 14px 40px; border-radius: 16px;
  font-size: 13px; line-height: 1.6; color: #d9f5ec; border-color: rgba(127,226,197,.3);
  background: linear-gradient(155deg, rgba(30,70,60,.7), rgba(8,16,16,.9));
}
#feedback::before { content: ""; position: absolute; left: 18px; top: 21px; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px var(--mint); }
#feedback.error { color: #ffdbe2; border-color: rgba(240,141,157,.38); background: linear-gradient(155deg, rgba(80,32,42,.72), rgba(16,8,10,.92)); }
#feedback.error::before { background: var(--rose); box-shadow: 0 0 12px var(--rose); }
#operation-state { position: fixed; z-index: 30; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 11px 20px; border-radius: 999px; font-size: 13px; color: #e7ecee; white-space: nowrap; }
#operation-state::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 10px; vertical-align: -2px; border: 1.5px solid rgba(236,214,163,.25); border-top-color: var(--gold); border-radius: 50%; animation: processing 900ms linear infinite; }

@keyframes processing { to { transform: rotate(360deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes orbit { to { transform: translate(-50%,-50%) rotateX(70deg) rotateZ(360deg); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.14); opacity: .35; } }
@keyframes drift { 0% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(-3%,2%,0) scale(1.06); } 100% { transform: translate3d(2%,-2%,0) scale(1.02); } }
@keyframes floor { to { transform: perspective(720px) rotateX(74deg) translateY(72px); } }
@keyframes rise { to { transform: translateY(-360px); } }
@keyframes beacon { 0% { box-shadow: 0 0 0 0 rgba(127,226,197,.55); } 70%, 100% { box-shadow: 0 0 0 7px rgba(127,226,197,0); } }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }

@media (hover: hover) and (pointer: fine) and (min-width: 761px) {
  button:hover:not(:disabled), .button:hover { transform: translateY(-2px); }
  button:active:not(:disabled), .button:active { transform: translateY(1px) scale(.98); }
}
@media (max-width: 1280px) {
  .overview-stage { grid-template-columns: 1fr; }
  .detail-card { position: relative; top: 0; }
}
@media (max-width: 1100px) {
  .constellation { grid-template-columns: 1fr; row-gap: 18px; min-height: 0; padding: 0; }
  .links { display: none; }
  .core { flex-direction: row; justify-content: flex-start; text-align: left; }
  .orb-wrap { width: 84px; height: 84px; }
  .orb-halo { inset: -18px; }
  .orb-ring.r1 { inset: 6px; }
  .orb-ring.r3 { inset: 12px; }
  .orb { width: 40px; height: 40px; }
  .core-meta { margin: 4px 0 0; }
  .hubs { flex-direction: row; gap: 10px; overflow-x: auto; padding: 4px 2px 12px; }
  .node.hub { flex: 0 0 auto; width: auto; }
  .leaf-title { max-width: none; }
  .game-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .two-col { grid-template-columns: 1fr; }
  .challenge-editor { grid-template-columns: 1fr 90px 1fr auto; }
}
@media (min-width: 1101px) {
  .leaf { margin-left: var(--arc, 0px); }
}
@media (max-width: 900px) {
  :root { --gap: 12px; --header-height: 60px; }
  .header-pill { display: none; }
  .sidebar { position: static; width: auto; margin: var(--gap) var(--gap) 0; padding: 12px; }
  .sidebar .back { margin: 0 0 8px; }
  .sidebar .nav-caption, .sidebar-note { display: none; }
  .sidebar nav { display: flex; gap: 6px; overflow-x: auto; }
  .sidebar nav a { white-space: nowrap; padding: 9px 12px; margin: 0; }
  .inside-workspace .shell { margin-left: 0; }
  .context-header { padding: 26px 12px 4px; }
  .context-header strong { font-size: 26px; }
  main, body:not(.inside-workspace) main { padding: 26px 12px 40px; }
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  footer { margin: 0 12px; }
}
@media (max-width: 620px) {
  .app-header { padding: 0 8px 0 12px; }
  .brand { font-size: 17px; gap: 9px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-dot { margin-left: -9px; }
  .header-actions .button { font-size: 11.5px; padding: 7px 10px; }
  .demo-menu > summary { padding: 6px 10px 6px 6px; }
  h1 { font-size: 26px; }
  .heading { flex-wrap: wrap; align-items: flex-start; gap: 16px; }
  .game-grid { grid-template-columns: 1fr; }
  .section-bar { flex-direction: column; align-items: stretch; }
  .filters { justify-content: flex-start; }
  .filters input { width: 100%; }
  .filters select { flex: 1; min-width: 0; }
  .metric .number { font-size: 34px; }
  .panel, .detail-card { padding: 20px; }
  .challenge-editor { grid-template-columns: 1fr 90px; }
  .challenge-editor label:nth-child(3) { grid-column: 1; }
  .challenge-item { flex-wrap: wrap; }
  .challenge-item button { margin-left: 48px; }
  .score-number { font-size: 54px; }
  .preparation-list li { grid-template-columns: 30px 1fr; }
  .preparation-list a { grid-column: 2; grid-row: auto; justify-self: start; }
  footer { flex-direction: column; gap: 6px; }
  #feedback { right: var(--gap); }
  .login-layout { min-height: 520px; }
  .login-orbit { width: 90vw; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .game-card, .metric, .detail-card, .score-panel, .mini-orb, .card-visual::before, #ambient .layer { transform: none !important; }
  button:hover:not(:disabled), .button:hover, button:active:not(:disabled), .button:active { transform: none !important; }
}
