/* ==========================================================================
   FPS TOOL : feuille de style commune
   Interface d'application : barre latérale, zones empilées en couches de gris,
   une couleur de marque (ambre), une pastille de couleur par jeu.
   ========================================================================== */

/* Police Archivo, hébergée sur le site (aucun appel à Google) */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF;
}

/* ===== Couleurs et mesures ===== */
:root {
  --side: #111318;        /* barre latérale */
  --bg: #171a20;          /* fond de la zone principale */
  --surface: #1e2229;     /* blocs */
  --surface-2: #262b33;   /* éléments dans un bloc (champs, boutons secondaires) */
  --surface-3: #2f353f;   /* survol */
  --border: #2a2f38;
  --border-strong: #3a414d;
  --text: #e8eaee;
  --text-2: #a9b0bc;
  --text-3: #727a88;
  --brand: #f5b83d;       /* ambre : couleur de marque et d'action */
  --brand-hover: #ffc75e;
  --brand-ink: #1d1503;
  --success: #4fbf7a;
  --danger: #f06a5d;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  --side-w: 248px;
}

/* ===== Base ===== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px; line-height: 1.5;
}
a { color: var(--brand); text-underline-offset: 3px; }
h1, h2, h3 { font-stretch: 110%; letter-spacing: -0.005em; line-height: 1.2; margin: 0; }
p { margin: 0 0 10px; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.icon { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }
.icon-sm { width: 15px; height: 15px; }
.num { font-variant-numeric: tabular-nums; font-stretch: 112%; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ===== Structure de l'application : barre latérale + contenu ===== */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--side); border-right: 1px solid var(--border); position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 16px 12px; overflow-y: auto;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: var(--text); text-decoration: none; font-weight: 750; font-stretch: 115%; font-size: 17px; }
.logo svg { width: 28px; height: 28px; flex: none; }
.side-label { font-size: 12px; color: var(--text-3); font-weight: 600; padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); text-decoration: none; font-weight: 550;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--surface-2); color: var(--text); }
.nav-item[aria-current="page"] .icon { color: var(--brand); }
.nav-item .meta { margin-left: auto; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.nav-item.disabled { opacity: 0.55; pointer-events: none; }
.side-games { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 10px; }
.side-foot { margin-top: auto; padding: 16px 10px 4px; font-size: 12.5px; color: var(--text-3); display: grid; gap: 4px; }
.side-foot a { color: var(--text-3); text-decoration: none; }
.side-foot a:hover { color: var(--text-2); }

.main { min-width: 0; }
.mobile-bar { display: none; }
.content { max-width: 1120px; margin: 0 auto; padding: 28px 32px 48px; }

/* En-tête de page */
.page-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.page-icon { width: 44px; height: 44px; border-radius: 11px; background: var(--surface-2); display: grid; place-items: center; color: var(--brand); flex: none; }
.page-icon .icon { width: 22px; height: 22px; }
.page-head h1 { font-size: 26px; font-weight: 700; }
.page-head p { color: var(--text-2); margin: 4px 0 0; max-width: 64ch; }
.page-head .head-actions { margin-left: auto; display: flex; gap: 8px; align-self: center; }

/* ===== Blocs ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: 15px; font-weight: 650; }
.section-title { font-size: 16px; font-weight: 650; margin: 0 0 12px; }

/* ===== Boutons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid transparent; font-weight: 650; cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--surface-2); color: var(--text); transition: background 0.12s, border-color 0.12s;
}
.btn:hover { background: var(--surface-3); }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { color: var(--danger); }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 13.5px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: var(--radius-sm); border: 0;
  background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ===== Champs ===== */
.field { display: block; min-width: 0; }
.field + .field { margin-top: 14px; }
.label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 550; margin-bottom: 6px; }
.input, select.input {
  width: 100%; min-height: 40px; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--text); font: inherit; font-size: 15px;
}
.input:hover { border-color: #4a5260; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(245, 184, 61, 0.18); }
.input::placeholder { color: var(--text-3); }
.input-lg { min-height: 52px; font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; font-stretch: 112%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { color: var(--text-3); font-size: 13px; margin-top: 6px; }

/* Bulle d'aide (i) */
.tip { position: relative; display: inline-grid; place-items: center; color: var(--text-3); cursor: help; }
.tip .icon { width: 14px; height: 14px; }
.tip-body {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: 260px; z-index: 40;
  background: #0d0f13; color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: 13px; font-weight: 400; line-height: 1.45; box-shadow: var(--shadow-pop); opacity: 0; pointer-events: none; transition: opacity 0.12s;
}
.tip:hover .tip-body, .tip:focus .tip-body { opacity: 1; }

/* Contrôle segmenté (choix parmi quelques options) */
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--border-strong); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button {
  border: 0; background: transparent; color: var(--text-2); padding: 6px 12px; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 13.5px; min-height: 32px;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }

/* Pastille de jeu (abréviation sur la couleur du jeu) */
.tile {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; flex: none;
  font-size: 10.5px; font-weight: 800; font-stretch: 100%; letter-spacing: 0.01em; color: #111;
}
.tile-lg { width: 36px; height: 36px; border-radius: 9px; font-size: 12.5px; }
.tile-sm { width: 20px; height: 20px; border-radius: 5px; font-size: 8.5px; }
/* Pastilles avec le logo du jeu (blanc) : carré pour les emblèmes, plus large pour les logos en texte */
.tile-logo img { display: block; width: 64%; height: 64%; object-fit: contain; }
.tile-wide { width: auto; padding: 0 5px; }
.tile-wide img { width: auto; height: 44%; max-width: 64px; }
.tile-sm.tile-wide { padding: 0 4px; }
.tile-sm.tile-wide img { max-width: 44px; }
.tile-lg.tile-wide { padding: 0 8px; }

/* Sélecteur de jeu : bouton + liste déroulante avec recherche */
.picker { position: relative; }
.picker-btn {
  width: 100%; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 12px 6px 8px;
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; text-align: left;
}
.picker-btn:hover { border-color: #4a5260; }
.picker-btn .name { font-weight: 650; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-btn .icon { color: var(--text-3); }
.picker-pop {
  position: absolute; z-index: 50; top: calc(100% + 6px); left: 0; right: 0; min-width: 260px; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 6px;
}
.picker-search { display: flex; align-items: center; gap: 8px; padding: 4px 8px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; color: var(--text-3); }
.picker-search input { flex: 1; border: 0; background: transparent; color: var(--text); font: inherit; padding: 6px 0; outline: none; }
.picker-list { max-height: 300px; overflow-y: auto; }
.picker-opt { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 0; background: transparent; border-radius: 7px; cursor: pointer; text-align: left; }
.picker-opt:hover, .picker-opt.active { background: var(--surface-2); }
.picker-opt[aria-selected="true"] .check { visibility: visible; }
.picker-opt .check { margin-left: auto; color: var(--brand); visibility: hidden; }
.picker-opt small { color: var(--text-3); margin-left: 6px; }

/* Notifications (toasts) */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 8px; background: #f2f3f5; color: #15171c; font-weight: 600; font-size: 14px;
  padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-pop); animation: toast-in 0.18s ease-out;
}
.toast .icon { color: #1f8a4c; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Fenêtres (modales) */
dialog.modal {
  border: 1px solid var(--border-strong); border-radius: 16px; background: var(--surface); color: var(--text); padding: 0;
  width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: var(--shadow-pop);
}
dialog.modal-sm { width: min(560px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(5, 6, 9, 0.68); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-head h2 { font-size: 17px; font-weight: 700; flex: 1; }
.modal-body { padding: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--border); background: var(--surface); position: sticky; bottom: 0; }

/* ===== Accueil ===== */
.home-hero { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: center; margin: 8px 0 28px; }
.home-hero h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 750; line-height: 1.1; margin-bottom: 12px; max-width: 18ch; }
.home-hero p { color: var(--text-2); font-size: 16px; max-width: 52ch; }
.home-hero .hero-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.quick { padding: 18px; }
.quick h2 { font-size: 15px; font-weight: 650; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.quick-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: end; }
.quick-out { margin-top: 14px; padding: 14px; border-radius: var(--radius-sm); background: var(--bg); display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.quick-out strong { font-size: 30px; font-weight: 750; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 28px; }
.tool-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; text-decoration: none; color: var(--text); transition: border-color 0.12s, background 0.12s; }
a.tool-card:hover { border-color: var(--border-strong); background: #20252d; }
.tool-card .page-icon { width: 38px; height: 38px; margin-bottom: 6px; }
.tool-card h3 { font-size: 15.5px; font-weight: 650; }
.tool-card p { color: var(--text-2); font-size: 14px; margin: 0; }
.tool-card .badge { align-self: flex-start; margin-top: auto; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.badge-brand { background: rgba(245, 184, 61, 0.14); color: var(--brand); }
.pop-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pop-item { display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: var(--text); text-decoration: none; border-top: 1px solid var(--border); }
.pop-item:nth-child(-n+2) { border-top: 0; }
.pop-item:nth-child(odd) { border-right: 1px solid var(--border); }
.pop-item:hover { background: #20252d; }
.pop-item .pair { display: flex; align-items: center; gap: 4px; min-width: 104px; }
.pop-item .pair .icon { color: var(--text-3); width: 14px; height: 14px; }
.pop-item .label-txt { flex: 1; min-width: 0; font-weight: 550; }
.pop-item .val { color: var(--text-2); font-size: 14px; }

/* ===== Convertisseur de sensi ===== */
.conv { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.sides { display: grid; grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); align-items: stretch; }
.side-card { padding: 18px; }
.side-card h2 { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }
.swap { align-self: center; justify-self: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.swap:hover { color: var(--text); background: var(--surface-3); }
.adv-toggle { display: flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--text-2); cursor: pointer; padding: 0; margin-top: 14px; font-weight: 600; font-size: 13.5px; }
.adv-toggle .icon { transition: transform 0.15s; }
.adv-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.setup { margin-top: 16px; padding: 18px; }
.setup-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; align-items: end; }
.setup-row .field-method { grid-column: 1 / -1; }
.grid-2:has([data-fov][hidden]) { grid-template-columns: 1fr; }
.method-help { color: var(--text-2); font-size: 13.5px; margin: 10px 0 0; min-height: 2.9em; }

.readout { position: sticky; top: 24px; overflow: hidden; }
.readout-top { padding: 18px 18px 14px; }
.readout-label { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13.5px; font-weight: 550; }
.readout-value { display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; }
.readout-value output { font-size: 48px; font-weight: 750; line-height: 1.05; font-stretch: 115%; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.readout-sub { color: var(--text-2); font-size: 13.5px; }
.readout-stats { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--border); }
.stat { padding: 12px 18px; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat span { display: block; font-size: 12px; color: var(--text-3); font-weight: 550; }
.stat strong { font-size: 17px; font-weight: 700; }
.readout-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.readout-table td { padding: 9px 18px; border-top: 1px solid var(--border); }
.readout-table td:last-child { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.readout-table tr.active td { color: var(--brand); }
.readout-table tr { cursor: pointer; }
.readout-table tr:hover td { background: var(--surface-2); }
.readout-note { padding: 12px 18px; border-top: 1px solid var(--border); color: var(--text-2); font-size: 13.5px; }
.readout-note p { margin: 0 0 6px; }
.readout-note .warn { color: #e9c37a; }
.readout-actions { display: flex; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--border); }
.readout-actions .btn { flex: 1; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.preset { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 5px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; font-size: 13px; font-weight: 600; }
.preset:hover { color: var(--text); border-color: var(--border-strong); }
.preset .icon { width: 13px; height: 13px; color: var(--text-3); }

/* Article d'explication (en bas des outils) */
.article { max-width: 72ch; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--border); }
.article h2 { font-size: 19px; font-weight: 700; margin: 22px 0 8px; }
.article p, .article li { color: #c4c9d2; }
.article li { margin-bottom: 6px; }

/* ===== Coffre à viseurs ===== */
.vault-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.vault-bar .search { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.vault-bar .search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 16px; height: 16px; }
.vault-bar .search .input { padding-left: 34px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text-2); cursor: pointer; font-size: 13px; font-weight: 600; min-height: 32px; }
.filter.all { padding-left: 10px; }
.filter:hover { color: var(--text); }
.filter[aria-pressed="true"] { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.filter .count { color: var(--text-3); font-variant-numeric: tabular-nums; }
.xh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.xh-card { overflow: hidden; display: flex; flex-direction: column; transition: border-color 0.12s; }
.xh-card:hover { border-color: var(--border-strong); }
.xh-thumb { position: relative; aspect-ratio: 4 / 3; background: #5b6470; cursor: pointer; border: 0; padding: 0; display: block; width: 100%; }
.xh-thumb canvas { width: 100%; height: 100%; display: block; }
.xh-thumb .tile { position: absolute; top: 8px; left: 8px; }
.xh-meta { padding: 10px 10px 10px 12px; display: flex; align-items: center; gap: 6px; }
.xh-meta .txt { flex: 1; min-width: 0; }
.xh-meta .name { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xh-meta .sub { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 200px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow-pop); padding: 5px; }
.menu-pop button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: transparent; border: 0; border-radius: 6px; cursor: pointer; text-align: left; font-size: 14px; }
.menu-pop button:hover { background: var(--surface-2); }
.menu-pop button.danger { color: var(--danger); }
.menu-pop hr { border: 0; border-top: 1px solid var(--border); margin: 5px 0; }
.empty-state { text-align: center; padding: 48px 20px; }
.empty-state .page-icon { margin: 0 auto 14px; }
.empty-state h3 { font-size: 17px; margin-bottom: 6px; }
.empty-state p { color: var(--text-2); max-width: 44ch; margin: 0 auto 16px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab { background: transparent; border: 0; color: var(--text-2); padding: 10px 14px; cursor: pointer; font-weight: 650; position: relative; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--brand); border-radius: 2px; }
.tab .count { color: var(--text-3); font-weight: 550; font-variant-numeric: tabular-nums; }

/* Éditeur de viseur (dans une fenêtre) */
.editor { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.stage { position: sticky; top: 70px; }
.stage canvas { width: 100%; aspect-ratio: 1; border-radius: var(--radius); display: block; background: #5b6470; }
.stage-tools { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; gap: 8px; }
.swatches { display: flex; gap: 6px; }
.swatch-btn { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border-strong); cursor: pointer; padding: 0; }
.swatch-btn[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 2px var(--surface) inset; }
.status { font-size: 13.5px; margin: 10px 0 0; min-height: 1.4em; overflow-wrap: anywhere; color: var(--text-2); }
.status.ok { color: var(--success); }
.status.err { color: var(--danger); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; margin-top: 14px; }
.ctl { min-width: 0; padding: 6px 0; }
.ctl-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-2); font-weight: 550; margin-bottom: 4px; gap: 8px; }
.ctl-head input[type="number"] { width: 64px; min-height: 28px; padding: 2px 6px; text-align: right; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font: inherit; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.ctl input[type="range"] { width: 100%; accent-color: var(--brand); margin: 2px 0; }
.ctl-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--text); padding: 8px 0; cursor: pointer; }
.switch { appearance: none; width: 36px; height: 20px; border-radius: 999px; background: var(--surface-3); position: relative; cursor: pointer; flex: none; transition: background 0.15s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #cfd3da; transition: transform 0.15s; }
.switch:checked { background: var(--brand); }
.switch:checked::after { transform: translateX(16px); background: #fff; }
input[type="color"].color { width: 100%; height: 34px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg); padding: 3px; cursor: pointer; }
.ctl-group { grid-column: 1 / -1; font-size: 12.5px; color: var(--text-3); font-weight: 650; padding: 12px 0 2px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.code-box { background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13.5px; overflow-wrap: anywhere; color: var(--text); }
textarea.input { resize: vertical; min-height: 70px; font-size: 14px; line-height: 1.4; }

/* Conversion de viseur */
.target-list { display: flex; gap: 6px; flex-wrap: wrap; }
.target { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--bg); cursor: pointer; font-weight: 600; font-size: 14px; }
.target[aria-pressed="true"] { border-color: var(--brand); background: rgba(245, 184, 61, 0.08); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.compare figure { margin: 0; }
.compare canvas { width: 100%; aspect-ratio: 4 / 3; border-radius: var(--radius-sm); display: block; background: #5b6470; }
.compare figcaption { font-size: 13px; color: var(--text-2); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.losses { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; }
.losses li { display: flex; gap: 8px; font-size: 14px; color: #d6dae1; }
.losses li .icon { color: #e9c37a; margin-top: 2px; width: 16px; height: 16px; }
.losses li.ok .icon { color: var(--success); }
.sheet { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 12px; }
.sheet td { padding: 6px 0; border-top: 1px solid var(--border); }
.sheet td:first-child { color: var(--text-2); }
.sheet td:last-child { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.color-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(255, 255, 255, 0.2); }

/* ===== Pages de texte ===== */
.prose { max-width: 72ch; }
.prose h2 { font-size: 18px; margin: 22px 0 8px; }
.prose p { color: #c4c9d2; }

/* Animations réduites si le joueur l'a demandé */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ===== Écrans moyens ===== */
@media (max-width: 1100px) {
  .conv { grid-template-columns: 1fr; }
  .readout { position: static; }
  .home-hero { grid-template-columns: 1fr; }
}

/* ===== Tablettes et téléphones : barre du haut + barre d'onglets en bas ===== */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 60; transform: translateX(-100%); transition: transform 0.2s; box-shadow: var(--shadow-pop); }
  .side.open { transform: none; }
  .side-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 55; }
  .mobile-bar { display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 8px; border-bottom: 1px solid var(--border); background: var(--side); position: sticky; top: 0; z-index: 20; }
  .mobile-bar .logo { padding: 0; font-size: 16px; }
  .mobile-bar .logo svg { width: 24px; height: 24px; }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--side); border-top: 1px solid var(--border); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 0; color: var(--text-3); text-decoration: none; font-size: 11.5px; font-weight: 600; border-radius: 8px; }
  .tabbar a[aria-current="page"] { color: var(--text); }
  .tabbar a[aria-current="page"] .icon { color: var(--brand); }
  .content { padding: 20px 16px calc(88px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .tool-grid { grid-template-columns: 1fr; }
  .pop-list { grid-template-columns: 1fr; }
  .pop-item:nth-child(2) { border-top: 1px solid var(--border); }
  .pop-item:nth-child(odd) { border-right: 0; }
  .editor { grid-template-columns: 1fr; }
  .stage { position: static; max-width: 300px; margin: 0 auto; }
}
@media (min-width: 861px) {
  .tabbar, .side-scrim { display: none !important; }
}
@media (max-width: 640px) {
  .page-head h1 { font-size: 22px; }
  .page-head .head-actions { margin-left: 0; width: 100%; }
  .page-head .head-actions .btn { flex: 1; }
  .sides { grid-template-columns: 1fr; gap: 0; }
  .swap { margin: -8px auto; position: relative; z-index: 2; transform: rotate(90deg); }
  .page-head .page-icon { display: none; }
  .presets { flex-wrap: nowrap; overflow-x: auto; margin-left: -16px; margin-right: -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .preset { flex: none; }
  .field-method .seg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .xh-meta .btn .lbl { display: none; }
  .xh-meta .btn { padding: 0 8px; }
  .xh-meta { padding: 8px; }
  .stage { max-width: 220px; }
  .grid-2, .form-grid { grid-template-columns: 1fr; }
  .quick-row { grid-template-columns: 1fr; }
  .quick-row .swap { transform: rotate(90deg); margin: 0 auto; }
  .xh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .compare { grid-template-columns: 1fr 1fr; }
  dialog.modal { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
}
/* Dans une grille, les champs sont alignés : pas de marge au-dessus */
.grid-2 > .field, .setup-row > .field { margin-top: 0; }

/* Logo : pictogramme (viseur + curseur de réglage) et nom avec les O en réticules */
.logo-mark { width: 28px; height: 28px; flex: none; display: block; }
.logo .wm { display: inline-flex; align-items: center; font-weight: 850; font-stretch: 125%; letter-spacing: -0.01em; line-height: 1; white-space: nowrap; }
.logo .wm .o { width: 0.8em; height: 0.8em; margin: 0 0.02em; }
.mobile-bar .logo-mark { width: 24px; height: 24px; }

/* Choix de la langue (EN / FR) : dans le bas du menu et dans la barre du téléphone */
.lang-switch { display: inline-flex; background: var(--bg); border: 1px solid var(--border-strong); border-radius: 8px; padding: 2px; gap: 2px; width: max-content; margin-bottom: 6px; }
/* La langue actuelle est un <span>, l'autre un lien <a> */
.lang-switch a, .lang-switch span { color: var(--text-2); text-decoration: none; font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 6px; }
.lang-switch a:hover { color: var(--text); }
.lang-switch [aria-current="true"] { background: var(--surface-3); color: var(--text); }
.mobile-bar .lang-switch { margin: 0 4px 0 auto; }

/* Sensi en résolution étirée : schéma de l'écran avant / après */
.ratio-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ratio-compare figure { margin: 0; }
.ratio-compare figcaption { font-size: 13px; color: var(--text-2); margin-top: 8px; }
.screen { width: 100%; background: #050608; border: 3px solid #2c323c; border-radius: 6px; display: flex; justify-content: center; overflow: hidden; }
.screen-image { height: 100%; }
.screen-image svg { width: 100%; height: 100%; display: block; }

/* Bloc "même 360°, pas le même ressenti" (convertisseur de sensi) */
.feel { margin-top: 16px; padding: 18px; }
.feel-head h2 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.feel-head p { color: var(--text-2); font-size: 14px; margin: 0 0 14px; max-width: 70ch; }
.feel-body { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: center; }
.fov-svg { width: 100%; height: auto; display: block; }
.feel-rows { display: grid; gap: 10px; }
.feel-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--border); }
.feel-row strong { font-size: 22px; font-weight: 750; grid-row: span 2; align-self: center; }
.feel-k { font-size: 13.5px; color: var(--text-2); font-weight: 550; }
.feel-effect { font-size: 13px; color: #e9c37a; }
.feel-row.good { border-color: rgba(245, 184, 61, 0.55); }
.feel-row.good .feel-effect { color: var(--success); }
@media (max-width: 640px) {
  .feel-body { grid-template-columns: 1fr; }
  .fov-svg { max-width: 300px; margin: 0 auto; }
}

/* Option "ajuster au ressenti" du convertisseur de sensi */
.dpi-field { max-width: 320px; }
.adjust { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-top: 16px; padding: 14px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--border); cursor: pointer; }
.adjust:has(input:checked) { border-color: rgba(245, 184, 61, 0.55); }
.adjust-txt strong { display: block; font-size: 15px; margin-bottom: 3px; }
.adjust-txt small { display: block; color: var(--text-2); font-size: 13.5px; line-height: 1.45; }
.adjust .switch { margin-top: 2px; }
.adv { margin-top: 14px; }
.feel-row.clickable { cursor: pointer; }
.feel-row.clickable:hover { background: var(--surface-2); }
.picker-opt { padding: 9px 10px; font-weight: 550; }
.picker-opt .opt-name { white-space: nowrap; }
.picker-opt small { white-space: nowrap; }

/* Jeux pris en charge (menu de gauche) : grille de cases identiques */
.side-games { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px 10px; }
.game-chip { height: 30px; border-radius: 7px; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; padding: 0 6px; color: var(--text-2); font-size: 11px; font-weight: 800; letter-spacing: 0.02em; overflow: hidden; }
.game-chip img { max-width: 100%; max-height: 14px; width: auto; height: auto; object-fit: contain; opacity: 0.85; }
.game-chip:hover img { opacity: 1; }

/* Couleur de pastille de chaque jeu (classes g-<jeu>) */
.g-cs2 { background: #c98420; color: #16120a; }
.g-valorant { background: #ff4655; color: #ffffff; }
.g-cod { background: #2b2f26; color: #ffffff; }
.g-fortnite { background: #7b3fe4; color: #ffffff; }
.g-apex { background: #cd3333; color: #ffffff; }
.g-marvelrivals { background: #b8121f; color: #ffffff; }
.g-r6 { background: #2f6bc4; color: #ffffff; }
.g-overwatch2 { background: #f06414; color: #ffffff; }
.g-thefinals { background: #d31f3c; color: #ffffff; }
.g-deadlock { background: #5e5038; color: #ffffff; }
.g-fragpunk { background: #ff7a45; color: #16120a; }
.g-tarkov { background: #a39d7c; color: #16120a; }
.g-pubg { background: #1d1d1b; color: #ffffff; }
.g-other { background: #8a93a3; color: #16120a; }
.g-custom { background: #8a93a3; color: #16120a; }

/* Petites classes de mise en page (remplacent les styles écrits dans les balises, interdits par la politique de sécurité) */
.mt-0 { margin-top: 0; } .mt-10 { margin-top: 10px; } .mt-12 { margin-top: 12px; } .mt-14 { margin-top: 14px; } .mt-16 { margin-top: 16px; } .mt-40 { margin-top: 40px; }
.mb-16 { margin-bottom: 16px; } .minh-48 { min-height: 48px; } .fs-13 { font-size: 13px; } .fs-14 { font-size: 14px; } .fw-500 { font-weight: 500; }
.title-17 { font-weight: 700; font-size: 17px; } .hint-tight { margin: -6px 0 16px; } .grow { flex: 1; min-width: 200px; }
.row-center { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; } .row-center-c { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.shared-canvas { width: 120px; height: 90px; border-radius: 8px; }

/* Conversion jeu par jeu (convertisseur de sensi) */
.game-table { max-width: none; }
.game-sens { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); margin-top: 8px; }
.game-sens summary { cursor: pointer; padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; list-style: none; }
.game-sens summary::-webkit-details-marker { display: none; }
.game-sens summary::before { content: "+"; color: var(--brand); font-weight: 800; width: 12px; }
.game-sens[open] summary::before { content: "-"; }
.gs-name { font-weight: 650; color: var(--text); }
.gs-meta { font-size: 13px; color: var(--text-3); }
.game-sens > p { margin: 0 14px 10px; font-size: 14px; }
.gs-list { list-style: none; margin: 0 14px 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.gs-list li { display: flex; justify-content: space-between; gap: 8px; background: var(--bg); border-radius: 6px; padding: 7px 10px; font-size: 14px; color: var(--text-2); }
.gs-list strong { color: var(--text); }
.game-sens summary h3.gs-name { font-size: 15px; margin: 0; }

/* Grosse tuile qui contient tout le tableau jeu par jeu (repliée par défaut) */
.game-all { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 0; }
.game-all > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; }
.game-all > summary::-webkit-details-marker { display: none; }
.game-all > summary h2 { margin: 0; font-size: 18px; }
.ga-text { display: flex; flex-direction: column; gap: 2px; }
.ga-sub { font-size: 13px; color: var(--text-3); }
.ga-btn { flex-shrink: 0; font-size: 13px; font-weight: 650; color: var(--brand); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; }
.game-all[open] .ga-btn { color: var(--text-3); }
.game-all > p { margin: 0 18px 8px; font-size: 14px; }
.game-all > .game-sens { margin: 8px 18px; background: var(--bg); }
.game-all > .game-sens:last-child { margin-bottom: 18px; }
.game-all .gs-list li { background: var(--surface); }
/* Sur téléphone : on cache les détails techniques (yaw, FOV) dans les titres pour garder des lignes courtes */
@media (max-width: 640px) {
  .game-all > summary { padding: 14px; }
  .game-all > p { margin: 0 14px 8px; }
  .game-all > .game-sens { margin: 8px 10px; }
  .gs-meta { display: none; }
  .game-sens[open] .gs-meta { display: block; width: 100%; }
  .gs-list { grid-template-columns: 1fr 1fr; }
}
/* Le bouton affiche "Afficher" ou "Masquer" selon l'état de la tuile */
.ga-hide { display: none; }
.game-all[open] .ga-show { display: none; }
.game-all[open] .ga-hide { display: inline; }
/* Titre de chaque jeu : le "+" reste toujours à gauche du nom, même si le nom passe sur deux lignes */
.game-sens summary { display: grid; grid-template-columns: 12px 1fr; column-gap: 10px; }
.game-sens summary .gs-name, .game-sens summary .gs-meta { grid-column: 2; }
@media (max-width: 640px) {
  .gs-list { grid-template-columns: 1fr; gap: 4px; }
  .gs-list li { padding: 6px 10px; }
  .game-sens[open] .gs-meta { width: auto; }
}

/* Barre de sauvegarde du coffre (code sans compte) */
.sync-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.sync-icon { width: 36px; height: 36px; flex-shrink: 0; display: grid; place-items: center; border-radius: 9px; background: var(--surface-2); color: var(--text-3); }
.sync-icon .icon { width: 18px; height: 18px; }
.sync-title { font-weight: 650; color: var(--text); font-size: 15px; }
.sync-text { font-size: 13.5px; color: var(--text-3); margin-top: 2px; }
.sync-text strong { color: var(--text-2); font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.sync-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* 3 crosshairs ou plus sans sauvegarde : la barre attire l'oeil */
.sync-bar[data-attention="1"] { border-color: rgba(245, 184, 61, 0.55); background: linear-gradient(0deg, rgba(245, 184, 61, 0.06), rgba(245, 184, 61, 0.06)), var(--surface); }
.sync-bar[data-attention="1"] .sync-icon { color: var(--brand); background: rgba(245, 184, 61, 0.12); }
.sync-bar[data-state="saved"] .sync-icon, .sync-bar[data-state="saving"] .sync-icon { color: var(--success); background: rgba(79, 191, 122, 0.12); }
.sync-bar[data-state="offline"] .sync-icon, .sync-bar[data-state="error"] .sync-icon { color: var(--danger); background: rgba(240, 106, 93, 0.12); }
.backup-code { margin: 14px 0; padding: 14px; text-align: center; font-size: 22px; font-weight: 750; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; color: var(--text); background: var(--bg); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); user-select: all; overflow-wrap: anywhere; }
.warn-note { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); margin: 0; }
.warn-note .icon { flex-shrink: 0; color: var(--brand); margin-top: 2px; }
.code-input { width: 100%; text-transform: uppercase; letter-spacing: 0.06em; font-size: 18px; }
.field-error { color: var(--danger); font-size: 13.5px; margin: 8px 0 0; }
@media (max-width: 640px) {
  .sync-bar { align-items: flex-start; }
  .sync-bar > .grow { flex: 1 1 calc(100% - 50px); }
  .sync-actions { width: 100%; }
  .sync-actions .btn { flex: 1 1 auto; justify-content: center; }
}
/* Compteur du coffre presque plein (270/300 et plus) */
.tab .count.count-full { color: var(--brand); font-weight: 700; }
.toast-error .icon { color: #d0473b; }

/* Colonne du résultat : la carte du résultat puis le pavé de pub, qui restent visibles en faisant défiler */
.result-col { position: sticky; top: 24px; display: grid; gap: 16px; align-content: start; }
.result-col .readout { position: static; }

/* Emplacements de pub (affichés seulement quand AdSense est configuré dans tools/build_pages.py) */
.ad { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 24px auto; }
.ad-label { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.ad ins { display: block; }
.ad-square ins { width: 300px; height: 250px; }
.ad-banner { width: 100%; max-width: 728px; }
.ad-banner ins { width: 100%; height: 90px; }
.result-col .ad { margin: 0 auto; }
.ad-only-mobile { display: none; }
/* Une seule colonne (le pavé est alors juste sous le résultat) : le bandeau descend avant le texte pour ne pas coller au pavé */
@media (max-width: 1100px) {
  .ad-only-desktop { display: none; }
  .ad-only-mobile { display: flex; }
  .result-col { position: static; }
}
/* Téléphone : bandeau mobile 320 x 100 */
@media (max-width: 860px) {
  .ad-banner { max-width: 320px; }
  .ad-banner ins { height: 100px; }
}
