@import url('fonts.css');

/* =============================================================================
   YuiTCG — feuille de style
   La page est un salon. On voit le bot tourner au lieu de lire ce qu'il promet.
   Palette de regie : encre bleutee, rouge d'antenne, tungstene, menthe.
   ========================================================================== */

:root {
  --ink: #12131a;
  --ink-deep: #0c0d12;
  --panel: #181a23;
  --panel-hi: #1f222d;

  --edge: rgba(237, 234, 228, 0.09);
  --edge-strong: rgba(237, 234, 228, 0.18);

  --paper: #edeae4;
  --muted: #8b90a1;
  --dim: #6a6f7e;

  --tally: #ff3b3b;
  --tungsten: #ffc978;
  --signal: #7de2d1;

  --display: 'Archivo', system-ui, sans-serif;
  --body: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  --rail-w: 246px;
  --top-h: 58px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--top-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Lien d'evitement : hors ecran, ramene au premier coup de Tab. */
.skip {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  transform: translateY(calc(-100% - 20px));
  padding: 11px 18px;
  border-radius: 7px;
  background: var(--tally);
  color: #fff;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.18s var(--ease);
}

.skip:focus-visible {
  transform: none;
}

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------- Barre superieure ---------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--top-h);
  display: flex;
  align-items: center;
  background: rgba(12, 13, 18, 0.9);
  backdrop-filter: blur(12px) saturate(1.3);
  border-bottom: 1px solid var(--edge);
}

.topbar-in {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding-inline: clamp(14px, 3vw, 22px);
}

.wordmark {
  font-family: var(--display);
  font-variation-settings: 'wdth' 112;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--paper);
  text-decoration: none;
  white-space: nowrap;
}

.wordmark span {
  color: var(--tally);
}

.topbar-cta {
  margin-left: auto;
}

.rail-toggle {
  display: none;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--edge);
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  place-items: center;
}

.rail-toggle-bars,
.rail-toggle-bars::before,
.rail-toggle-bars::after {
  display: block;
  width: 15px;
  height: 1.5px;
  background: var(--paper);
  border-radius: 2px;
}

.rail-toggle-bars {
  position: relative;
}

.rail-toggle-bars::before,
.rail-toggle-bars::after {
  content: '';
  position: absolute;
  left: 0;
}

.rail-toggle-bars::before {
  top: -5px;
}

.rail-toggle-bars::after {
  top: 5px;
}

/* ---------- Ossature ------------------------------------------------------- */

.shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  align-items: start;
}

/* ---------- Liste des salons ---------------------------------------------- */

.rail {
  position: sticky;
  top: var(--top-h);
  height: calc(100vh - var(--top-h));
  overflow-y: auto;
  padding: 20px 12px 24px;
  border-right: 1px solid var(--edge);
  background: var(--ink-deep);
}

.rail-server {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  padding-inline: 10px;
  font-family: var(--display);
  font-variation-settings: 'wdth' 110;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Pastille de presence : etat reel des services, dans le langage du chat. */
.rail-server-mark {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  flex: none;
  background: linear-gradient(150deg, var(--tungsten), var(--signal));
}

.rail-server-mark::after {
  content: '';
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dim);
  border: 2px solid var(--ink-deep);
}

.rail-server-mark.is-up::after {
  background: var(--signal);
}

.rail-list {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  gap: 1px;
}

.rail-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14.5px;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.rail-hash {
  color: var(--dim);
  font-weight: 600;
}

.rail-link:hover {
  background: rgba(237, 234, 228, 0.05);
  color: var(--paper);
}

.rail-link.is-current {
  background: rgba(237, 234, 228, 0.08);
  color: var(--paper);
}

.rail-link.is-current .rail-hash {
  color: var(--tungsten);
}

.rail-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--tungsten);
  flex: none;
}

.rail-name {
  margin-right: auto;
}

.rail-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 14px 10px 0;
  border-top: 1px solid var(--edge);
  font-size: 12px;
  line-height: 1.45;
  color: var(--dim);
}

.scrim {
  display: none;
}

/* ---------- Flux ----------------------------------------------------------- */

.stream {
  min-width: 0;
  padding-inline: clamp(16px, 4vw, 40px);
}

.channel {
  max-width: 780px;
  padding-block: clamp(44px, 6vw, 72px);
  border-bottom: 1px solid var(--edge);
}

.channel:last-of-type {
  border-bottom: 0;
}

.channel-head {
  margin-bottom: clamp(26px, 4vw, 40px);
}

.channel-name {
  font-family: var(--display);
  font-variation-settings: 'wdth' 118;
  font-weight: 800;
  text-transform: lowercase;
  letter-spacing: -0.02em;
  font-size: clamp(1.7rem, 5vw, 2.5rem);
  line-height: 1;
  margin: 0 0 10px;
}

.channel-hash {
  color: var(--dim);
  margin-right: 2px;
}

.channel-topic {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.6vw, 1.1rem);
}

.channel-warn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  padding: 6px 12px;
  border: 1px solid rgba(255, 201, 120, 0.28);
  border-radius: 999px;
  background: rgba(255, 201, 120, 0.07);
  color: var(--tungsten);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.4;
}

.log {
  display: grid;
  gap: 22px;
}

/* ---------- Message -------------------------------------------------------- */

.msg {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink-deep);
  background: hsl(var(--hue, 200) 62% 66%);
  flex: none;
}

.avatar-bot {
  background: linear-gradient(150deg, var(--tungsten), var(--signal));
  position: relative;
}

.avatar-bot::after {
  content: '';
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 4px 4px 8px 8px;
  background: var(--ink-deep);
}

.msg-body {
  min-width: 0;
}

.msg-meta {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 0 0 5px;
  flex-wrap: wrap;
}

.msg-author {
  font-weight: 600;
  font-size: 15px;
}

.badge-bot {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(125, 226, 209, 0.16);
  color: var(--signal);
}

.msg-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
}

.msg-text {
  margin: 0;
  color: #d8d5cf;
}

.msg-text b {
  color: var(--paper);
}

.sys {
  margin: 0;
  padding: 10px 0;
  border-top: 1px solid var(--edge);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  text-align: center;
}

.note {
  margin: 12px 0 0;
  padding-left: 12px;
  border-left: 2px solid var(--edge-strong);
  font-size: 13.5px;
  color: var(--dim);
}

/* ---------- Commande tapee ------------------------------------------------- */

.slash {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  padding: 7px 13px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--panel);
  font-family: var(--mono);
  font-size: 13.5px;
  flex-wrap: wrap;
}

.slash-name {
  color: var(--signal);
  font-weight: 600;
}

.slash-args {
  color: var(--dim);
  font-size: 12.5px;
}

/* ---------- Embed ---------------------------------------------------------- */

.embed {
  margin-top: 10px;
  padding: 18px 20px;
  border: 1px solid var(--edge);
  border-left: 3px solid transparent;
  border-image: linear-gradient(180deg, var(--tungsten), var(--signal)) 1;
  border-radius: 0 10px 10px 0;
  background: var(--panel);
  max-width: 620px;
}

.embed-title {
  font-family: var(--display);
  font-variation-settings: 'wdth' 112;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 1.02rem;
  letter-spacing: -0.005em;
  margin: 0 0 8px;
}

.embed-body {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
}

.embed-foot {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--edge);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dim);
}

/* ---------- Carte ---------------------------------------------------------- */

/* ---------- Tirage : la carte et ses stats finales ------------------------- */

.drop {
  display: flex;
  gap: 22px;
  margin-top: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.drop-side {
  flex: 1;
  min-width: 210px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  background: var(--edge);
  border: 1px solid var(--edge);
  border-radius: 9px;
  overflow: hidden;
}

.stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 13px;
  background: var(--ink);
}

.stat-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--dim);
}

.stat-value {
  margin: 0;
  font-family: var(--display);
  font-variation-settings: 'wdth' 110;
  font-weight: 700;
  font-size: 17px;
  line-height: 1;
}

.drop-note {
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--dim);
}

.card {
  width: 176px;
  aspect-ratio: 5 / 7;
  border-radius: 12px;
  padding: 1px;
  background: linear-gradient(150deg, var(--tungsten), rgba(255, 201, 120, 0.12) 45%, var(--signal));
  transform: rotate(-2.4deg);
  box-shadow: 0 26px 44px -22px rgba(0, 0, 0, 0.9);
  transition: transform 0.45s var(--ease);
}

.card:hover {
  transform: rotate(-0.8deg) translateY(-4px);
}

.card-inner {
  height: 100%;
  border-radius: 11px;
  background: linear-gradient(170deg, var(--panel-hi), var(--ink-deep));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-bottom: 1px solid var(--edge);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--dim);
}

/* Les trois coordonnees de l'instance sont lisibles sur le cadre. */
.card-tier {
  font-family: var(--display);
  font-variation-settings: 'wdth' 108;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0;
  color: var(--tungsten);
  line-height: 1;
}

.card-art {
  flex: 1;
  position: relative;
  display: grid;
  place-items: end center;
  overflow: hidden;
  background:
    radial-gradient(70% 60% at 50% 20%, rgba(255, 201, 120, 0.2), transparent 70%),
    radial-gradient(80% 70% at 50% 100%, rgba(125, 226, 209, 0.15), transparent 70%);
}

.card-figure {
  width: 62%;
  height: 74%;
  background: linear-gradient(180deg, rgba(237, 234, 228, 0.45), rgba(237, 234, 228, 0.06));
  clip-path: polygon(
    50% 0%, 70% 8%, 74% 26%, 64% 38%, 92% 54%,
    100% 100%, 0% 100%, 8% 54%, 36% 38%, 26% 26%, 30% 8%
  );
}

.card-scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    rgba(12, 13, 18, 0) 0 3px,
    rgba(12, 13, 18, 0.26) 3px 4px
  );
  mix-blend-mode: overlay;
}

.card-foot {
  padding: 9px 10px 11px;
  border-top: 1px solid var(--edge);
}

.card-name {
  margin: 0;
  font-family: var(--display);
  font-variation-settings: 'wdth' 110;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 13px;
  line-height: 1;
}

.card-arch {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------- Reactions ------------------------------------------------------ */

.reacts {
  display: flex;
  gap: 6px;
  margin: 10px 0 0;
  flex-wrap: wrap;
}

.react {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--panel);
  font-size: 13px;
}

.react.is-mine {
  border-color: rgba(125, 226, 209, 0.45);
  background: rgba(125, 226, 209, 0.1);
}

.react-n {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------- Echange -------------------------------------------------------- */

.trade {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

.trade-side {
  padding: 13px 15px;
  border: 1px solid var(--edge);
  border-radius: 9px;
  background: var(--ink);
  min-width: 0;
}

.trade-verb {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

.trade-card {
  margin: 0;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.trade-code {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(255, 201, 120, 0.14);
  color: var(--tungsten);
}

.trade-swap {
  color: var(--dim);
  font-size: 18px;
}

/* ---------- Les dix raretes ------------------------------------------------ */

/* Le palier se lit a la couleur : commun neutre, rare chaud, SSS a l'antenne. */
.tiers {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 16px;
}

.tier {
  display: grid;
  gap: 2px;
  padding: 10px 8px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--ink);
  text-align: center;
}

.tier-code {
  font-family: var(--display);
  font-variation-settings: 'wdth' 108;
  font-weight: 800;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
}

.tier-rate {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--paper);
}

.tier-mult {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
}

.tier-b .tier-code,
.tier-a .tier-code {
  color: var(--signal);
}

.tier-b,
.tier-a {
  border-color: rgba(125, 226, 209, 0.3);
}

.tier-s .tier-code,
.tier-ss .tier-code {
  color: var(--tungsten);
}

.tier-s,
.tier-ss {
  border-color: rgba(255, 201, 120, 0.35);
}

.tier-sss .tier-code {
  color: var(--tally);
}

.tier-sss {
  border-color: rgba(255, 59, 59, 0.45);
  background: rgba(255, 59, 59, 0.06);
}

/* ---------- Les onze etats ------------------------------------------------- */

.wear {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 5px;
  margin-top: 16px;
  align-items: end;
}

.wear-step {
  display: grid;
  justify-items: center;
  gap: 5px;
}

/* La hauteur remplie figure l'usure : 0 use, 10 intact. */
.wear-bar {
  width: 100%;
  height: 44px;
  border-radius: 3px;
  background: linear-gradient(
    to top,
    var(--signal) var(--fill),
    rgba(237, 234, 228, 0.07) var(--fill)
  );
}

.wear-n {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--paper);
}

.wear-rate {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--dim);
}

/* ---------- Comparaison ---------------------------------------------------- */

.compare {
  display: grid;
  gap: 1px;
  margin-top: 16px;
  background: var(--edge);
  border: 1px solid var(--edge);
  border-radius: 9px;
  overflow: hidden;
}

.compare-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 15px;
  background: var(--ink);
}

.compare-name {
  font-family: var(--display);
  font-variation-settings: 'wdth' 110;
  font-weight: 700;
  font-size: 15px;
}

.compare-mult {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--dim);
}

.compare-row.is-win {
  background: rgba(125, 226, 209, 0.08);
}

.compare-row.is-win .compare-mult {
  color: var(--signal);
}

/* ---------- Archetypes ----------------------------------------------------- */

.archs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.arch {
  padding: 13px 14px;
  border: 1px solid var(--edge);
  border-radius: 9px;
  background: var(--ink);
}

.arch-name {
  margin: 0;
  font-family: var(--display);
  font-variation-settings: 'wdth' 110;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 14px;
}

.arch-stat {
  margin: 3px 0 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--signal);
}

.arch-body {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Tris ----------------------------------------------------------- */

.sorts {
  display: flex;
  gap: 7px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.sort {
  padding: 7px 13px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--ink);
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Liste de commandes --------------------------------------------- */

.cmds {
  margin-top: 16px;
  display: grid;
  gap: 1px;
  background: var(--edge);
  border: 1px solid var(--edge);
  border-radius: 9px;
  overflow: hidden;
}

.cmd {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 10px 14px;
  background: var(--panel);
  flex-wrap: wrap;
}

.cmd-name {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--signal);
  min-width: 106px;
}

.cmd.is-soon .cmd-name {
  color: var(--dim);
}

.cmd-body {
  flex: 1;
  min-width: 180px;
  font-size: 13.5px;
  color: var(--muted);
}

.chip {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 3px;
  margin-left: auto;
  white-space: nowrap;
}

.chip-live {
  background: rgba(125, 226, 209, 0.13);
  color: var(--signal);
}

.chip-soon {
  background: rgba(255, 201, 120, 0.13);
  color: var(--tungsten);
}

/* ---------- Permissions ---------------------------------------------------- */

.rules {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1px;
  background: var(--edge);
  border: 1px solid var(--edge);
  border-radius: 9px;
  overflow: hidden;
}

.rule {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 9px 14px;
  background: var(--ink);
  flex-wrap: wrap;
  font-size: 13.5px;
}

.rule-label {
  min-width: 172px;
  color: var(--paper);
}

.rule-why {
  color: var(--dim);
}

/* ---------- Boutons -------------------------------------------------------- */

.actions {
  display: flex;
  gap: 9px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  padding: 12px 19px;
  border-radius: 7px;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.16s var(--ease), background 0.16s var(--ease),
    border-color 0.16s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--tally);
  color: #fff;
  box-shadow: 0 9px 24px -12px rgba(255, 59, 59, 0.75);
}

.btn-primary:hover {
  background: #ff5252;
}

.btn-ghost {
  background: rgba(237, 234, 228, 0.05);
  border-color: var(--edge-strong);
  color: var(--paper);
}

.btn-ghost:hover {
  background: rgba(237, 234, 228, 0.1);
  border-color: rgba(125, 226, 209, 0.45);
}

.btn-quiet {
  background: transparent;
  border-color: var(--edge);
  color: var(--muted);
}

.btn-sm {
  padding: 9px 15px;
  font-size: 13px;
}

/* Bouton de mise en scene : visible, jamais actionnable. */
.btn.is-mock {
  cursor: default;
  opacity: 0.55;
}

.btn.is-mock:hover {
  transform: none;
}

/* ---------- Pied ----------------------------------------------------------- */

.foot {
  max-width: 780px;
  padding-block: 34px 60px;
  display: flex;
  gap: 16px;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
}

.foot-text {
  margin: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dim);
  max-width: 46ch;
  line-height: 1.5;
}

.foot-links {
  display: flex;
  gap: 18px;
  font-family: var(--mono);
  font-size: 11.5px;
}

.foot-links a {
  color: var(--dim);
  text-decoration: none;
}

.foot-links a:hover {
  color: var(--paper);
}

/* ---------- Page simple (mentions, confidentialite) ------------------------ */

.page {
  max-width: 720px;
  margin-inline: auto;
  padding: clamp(40px, 7vw, 76px) clamp(16px, 4vw, 24px) 80px;
}

.page-title {
  font-family: var(--display);
  font-variation-settings: 'wdth' 118;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1;
  margin: 0 0 26px;
}

.page h2 {
  font-family: var(--display);
  font-variation-settings: 'wdth' 110;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 1.05rem;
  margin: 36px 0 10px;
}

.page p {
  color: var(--muted);
  margin: 0 0 14px;
}

.page code {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--signal);
}

/* ---------- Adaptation ----------------------------------------------------- */

@media (max-width: 940px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail-toggle {
    display: grid;
  }

  .rail {
    position: fixed;
    top: var(--top-h);
    left: 0;
    z-index: 70;
    width: min(78vw, var(--rail-w));
    transform: translateX(-102%);
    transition: transform 0.28s var(--ease);
    border-right: 1px solid var(--edge-strong);
  }

  .rail.is-open {
    transform: none;
  }

  .scrim {
    display: block;
    position: fixed;
    inset: var(--top-h) 0 0;
    z-index: 65;
    background: rgba(6, 7, 10, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s var(--ease);
  }

  .scrim.is-on {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 620px) {
  .topbar-in {
    gap: 10px;
  }

  .state-label {
    display: none;
  }

  .state {
    padding: 4px 8px;
  }

  .msg {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 11px;
  }

  .avatar {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 14px;
  }

  .embed {
    padding: 15px 16px;
  }

  .trade {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }

  .trade-swap {
    justify-self: center;
    transform: rotate(90deg);
  }

  .rung {
    grid-template-columns: 58px minmax(0, 1fr) auto;
    row-gap: 4px;
  }

  .bars {
    grid-column: 2 / -1;
    height: 15px;
  }

  .cmd-name {
    min-width: 0;
  }

  .cmd-body {
    min-width: 0;
    flex-basis: 100%;
  }

  .chip {
    margin-left: 0;
  }

  .perm-label {
    min-width: 0;
    flex-basis: 100%;
  }

  .actions .btn {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
