/* ===== Interface téléphone (30/11/2026, demande de l'utilisateur) =====
   Tout est sous html.tel (classe posée par js/mobile.js) : sur ordinateur, aucune de ces règles ne s'applique.
   Voir docs/notes_detaillees.md, « Interface téléphone ». */
.tel-nav, .tel-menu, .tel-purse { display: none; }

/* ---------- Socle ---------- */
html.tel {
  --nav-h: 60px;                                   /* barre du bas, hors zone sûre */
  --sb: env(safe-area-inset-bottom, 0px); --st: env(safe-area-inset-top, 0px);
  --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px);
  --nav-all: calc(var(--nav-h) + var(--sb));
  --sticky-h: 0px !important; --topbar-h: 0px !important;
  scroll-padding: calc(var(--st) + var(--sp)) 0 calc(var(--nav-all) + 8px);
  --sp: 8px;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  overscroll-behavior-y: none;
}
html.tel body {
  padding: var(--st) var(--sr) calc(var(--nav-all) + 8px) var(--sl); min-height: 100dvh; overflow-x: clip;
  background-attachment: scroll; background-image: none; background-color: #26231a; /* fond fixe = défilement saccadé sur téléphone */
  -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; touch-action: manipulation;
}
html.tel button, html.tel [data-action] { touch-action: manipulation; } /* pas de zoom au double toucher */
html.tel button, html.tel [data-action], html.tel img { user-select: none; -webkit-user-select: none; }
html.tel input, html.tel textarea, html.tel select { font-size: 16px; } /* pas de zoom automatique sur iOS */
html.tel .topbar, html.tel .tabs, html.tel #exp-rail .exp-rail-col, html.tel .fold-btn, html.tel #racks-toggle, html.tel #stock-toggle { display: none !important; }
html.tel .grid { padding: 8px; max-width: none; }
html.tel .panel { padding: 10px; border: 0; border-radius: 14px; box-shadow: none; }
html.tel .panel > .hint, html.tel #dungeons-body > .hint, html.tel #heroes-body > .hint, html.tel #city-body > .hint, html.tel #racks-body .hint { display: none; } /* textes d'aide : repris par le « ? » et les tutoriels */
html.tel .drag-handle { cursor: default; touch-action: auto; }

/* Échoppe : une vue (un panneau) à la fois */
html.tel main[data-tab="echoppe"] { display: block !important; }
html.tel main[data-tab="echoppe"] .ech-col { display: contents; }
html.tel main[data-tab="echoppe"] .ech-col > .panel { display: none; }
html.tel main[data-mv="boutique"] .panel.counter,
html.tel main[data-mv="fabriquer"] .recipes-panel,
html.tel main[data-mv="chaudron"] .panel.cauldron:not([hidden]),
html.tel main[data-mv="quetes"] .panel.quests-panel:not([hidden]),
html.tel main[data-mv="stock"] .panel.stock,
html.tel main[data-mv="maitrise"] .panel.mastery:not([hidden]),
html.tel main[data-mv="ressources"] .panel.racks { display: block !important; }
html.tel .ech-col > .panel + .panel { margin-top: 8px; }

/* Hauteur des rubans collants de chaque écran : défilements automatiques et tutoriels s'arrêtent dessous (lue par stickyBars, game.js) */
html.tel:has(main[data-mv="fabriquer"]) { --sp: 192px; }
html.tel:has(main[data-mv="donjons"]) { --sp: 112px; }
html.tel:has(.tel-purse:not([hidden])) { --sp: 44px; }

/* ---------- Barre du bas ---------- */
html.tel .tel-nav:not([hidden]) {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: repeat(var(--nav-n, 5), minmax(0, 1fr)); gap: 0;
  height: var(--nav-all); padding: 0 calc(4px + var(--sr)) var(--sb) calc(4px + var(--sl)); box-sizing: border-box;
  background: #1f1812; border-top: 2px solid #4a3a2b; contain: layout style;
}
html.tel .tn-b { position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; padding: 0; border: 0; background: none; color: var(--text); cursor: pointer; }
html.tel .tn-b > img { width: 34px; height: 34px; object-fit: contain; opacity: .72; transition: transform .15s, opacity .15s; }
html.tel .tn-b.main > img { width: 42px; height: 42px; opacity: .9; }
html.tel .tn-b.sel > img { opacity: 1; transform: translateY(-2px) scale(1.12); }
html.tel .tn-b.sel::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 3px; height: 4px; border-radius: 2px; background: var(--gold); }
html.tel .tn-b:active > img { transform: scale(.92); }
html.tel .tn-n {
  position: absolute; left: calc(50% + 7px); top: 4px; min-width: 20px; height: 20px; box-sizing: border-box; padding: 0 5px; border-radius: 10px;
  font: 13px/20px var(--font-title); text-align: center; color: #1d1209; background: var(--gold); pointer-events: none;
}
html.tel .tn-n.soft { background: #7a6a55; color: #fff; }
html.tel .tn-n.dot { min-width: 12px; width: 12px; height: 12px; padding: 0; top: 10px; background: #e2463a; }
/* Six icônes (chaudron construit) : pastilles calées à droite de leur case, sans toucher l'icône voisine */
html.tel .tel-nav.n6 { --nav-n: 6; }
html.tel .tel-nav.n6 .tn-b > img { width: 32px; height: 32px; }
html.tel .tel-nav.n6 .tn-b.main > img { width: 38px; height: 38px; }
html.tel .tel-nav.n6 .tn-n:not(.dot) { left: auto; right: 2px; padding: 0 4px; }
html.tel .tn-lock { position: absolute; left: calc(50% + 6px); top: 6px; line-height: 0; }
html.tel .tn-lock img { width: 18px; height: 18px; object-fit: contain; }
html.tel .tn-menu { display: flex; flex-direction: column; gap: 5px; }
html.tel .tn-menu i { width: 26px; height: 4px; border-radius: 2px; background: #f1e6d4; opacity: .8; }
html.tel .tn-b.sel .tn-menu i { opacity: 1; background: var(--gold); }

/* ---------- Menu ---------- */
html.tel .tel-menu:not([hidden]) {
  position: fixed; inset: 0 0 var(--nav-all) 0; z-index: 59; display: block; overflow: hidden auto; overscroll-behavior: contain;
  padding: calc(12px + var(--st)) calc(12px + var(--sr)) 16px calc(12px + var(--sl)); background: #26201a; animation: telUp .16s ease-out;
}
@keyframes telUp { from { transform: translateY(24px); } }
html.tel-menu-open, html.tel-menu-open body { overflow: hidden; }
html.tel .tm-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 14px; }
html.tel .tm-lv { display: flex; align-items: center; gap: 8px; flex: 1 1 150px; min-width: 0; font: 20px var(--font-title); color: var(--gold); }
html.tel .tm-lv img { width: 28px; height: 28px; object-fit: contain; }
html.tel .tm-lv .bar { flex: 1; min-width: 60px; margin: 0; height: 12px; }
html.tel .tm-purse { display: flex; gap: 14px; }
html.tel .tm-purse span, html.tel .tel-purse span { display: inline-flex; align-items: center; gap: 6px; font: 17px var(--font-title); color: var(--gold); white-space: nowrap; }
html.tel .tm-purse img, html.tel .tel-purse img { width: 22px; height: 22px; object-fit: contain; }
html.tel .tm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
html.tel .tm-sys { margin-top: 16px; padding-top: 16px; border-top: 1px solid #4a3a2b; }
html.tel .tm-t {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 84px; padding: 6px 2px;
  border: 0; border-radius: 14px; background: #3a2d22; color: var(--text); font: 14px/1.1 var(--font-title); text-align: center; cursor: pointer;
}
html.tel .tm-t[aria-current] { background: #5a432b; }
html.tel .tm-t:active { transform: scale(.96); }
html.tel .tm-t > img { width: 42px; height: 42px; object-fit: contain; }
html.tel .tm-t.gd-locked { opacity: .55; }
html.tel .tm-q { height: 42px; font-size: 34px; line-height: 42px; }
html.tel .tm-t .tn-n { left: auto; right: 6px; top: 6px; }
html.tel .tm-t .tn-lock { left: auto; right: 8px; }

/* ---------- Bourse ---------- */
html.tel .tel-purse:not([hidden]) {
  position: sticky; top: 0; z-index: 8; display: flex; justify-content: flex-end; gap: 18px; padding: 6px 14px; background: #26231a;
}

/* ---------- Infobulle à l'appui long ---------- */
.tel-tip {
  position: fixed; inset: auto; z-index: 100000; margin: 0; padding: 10px 12px; max-width: min(320px, calc(100vw - 16px)); box-sizing: border-box; border: 0; border-radius: 10px;
  font: 16px/1.3 var(--font-text); white-space: pre-line; color: #fff; background: #15100c; box-shadow: 0 6px 18px rgba(0, 0, 0, .6); pointer-events: none;
}

/* ---------- Boutons, messages ---------- */
html.tel .btn { min-height: 44px; }
html.tel .toasts { bottom: calc(var(--nav-all) + 10px); z-index: 100001; }
html.tel .toast { font-size: 16px; white-space: normal; }
html.tel .update-banner { bottom: calc(var(--nav-all) + 8px); width: calc(100vw - 16px); box-sizing: border-box; }

/* Bouton désactivé : l'appui passe à son parent, qui affiche la raison (js/mobile.js) */
html.tel button:disabled { pointer-events: none; }

/* ---------- Fabriquer ---------- */
html.tel #work-rail { position: sticky; top: var(--st); z-index: 7; background: #26231a; display: none; }
html.tel:has(main[data-mv="fabriquer"]) #work-rail { display: block; }
html.tel #work-rail .slots.rail, html.tel #work-rail .slots.rail.row.flow {
  position: static; display: flex; flex-flow: row nowrap; justify-content: flex-start; gap: 8px; width: auto; max-width: none; max-height: none; margin: 0; padding: 8px;
  overflow: auto hidden; scrollbar-width: none; overscroll-behavior-x: contain; background: none;
}
html.tel #work-rail .slots::-webkit-scrollbar, html.tel #cat-tabs::-webkit-scrollbar { display: none; }
html.tel #work-rail .slot { flex: none; width: 60px !important; height: 60px !important; aspect-ratio: auto; border-width: 2px; border-radius: 12px; overflow: visible; }
html.tel #work-rail .slot-icon { padding-bottom: 14px; }
html.tel #work-rail .slot-time { font-size: 15px; bottom: 6px; }
html.tel #work-rail .slot-cancel { top: -5px; right: -5px; width: 22px; height: 22px; }
html.tel #work-rail .slot-cancel::after { content: ""; position: absolute; inset: -11px -5px -11px -11px; }
html.tel .recipes-panel { padding: 0 0 8px; background: none; }
html.tel .recipes-panel > .rec-head { display: none; }
html.tel .recipes-panel { container-type: normal; } /* sinon les icônes collantes sont mesurées sur le panneau */
html.tel .recipes-panel > .cat-tabs.cat-seq {
  position: sticky; top: calc(76px + var(--st)); z-index: 6; display: grid; grid-template-rows: repeat(2, 44px); grid-auto-flow: column; grid-auto-columns: 44px; gap: 8px; container-type: normal;
  margin: 0 -8px 8px; padding: 4px 8px 10px; border: 0; background: #26231a; overflow: auto hidden; scrollbar-width: none; overscroll-behavior-x: contain;
}
html.tel #cat-tabs .cat-main, html.tel #cat-tabs .cat-row, html.tel #cat-tabs .family, html.tel #cat-tabs .want-group { display: contents !important; }
html.tel #cat-tabs .want-tab { order: -1; }
html.tel #cat-tabs .fav-tab { order: -1; }
html.tel #cat-tabs .cat-tab.has-img { position: relative; width: 44px !important; height: 44px !important; margin: 0; }
html.tel #cat-tabs .cat-tab.has-img.sel { box-shadow: 0 0 0 3px var(--gold); border-radius: 12px; }
html.tel #cat-tabs .cat-tab .tile-img { width: 100%; height: 100%; box-sizing: border-box; }
html.tel #cat-tabs .want-n { top: -2px; right: -4px; }
html.tel .recipes-panel > .cat-title { display: flex !important; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; flex-wrap: wrap; }
html.tel .ct-name { display: none; }
html.tel .ct-slot { justify-content: flex-start; flex-wrap: nowrap; }
html.tel .ct-slot .btn { display: inline-flex; align-items: center; gap: 4px; max-width: none; white-space: nowrap; padding: 0 6px; }
html.tel .ct-slot .btn img { width: 22px; height: 22px; object-fit: contain; }
html.tel .ct-slot .btn span { display: inline-flex; align-items: center; gap: 4px; }
html.tel .ct-toggles { gap: 8px; }
html.tel .mastered-toggle { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; }
html.tel .mastered-toggle img { max-width: 36px; max-height: 36px; }
/* Carte de recette : image | nom, coûts en icônes | gros bouton Fabriquer */
html.tel .recipes { gap: 8px; align-content: start; }
html.tel:has(main[data-mv="fabriquer"]) { overflow-anchor: none; } /* ancrage fait par recAnchor (game.js) */
html.tel .recipe { grid-template-columns: 60px minmax(0, 1fr) 60px; column-gap: 10px; padding: 8px; border-radius: 12px; background: #2f261d; contain: layout style; } /* pas de content-visibility : hauteur estimée (92 px) à chaque rendu, l'écran sautait */
html.tel .recipe.locked { grid-template-columns: 60px minmax(0, 1fr); }
html.tel .recipe > .tile { width: 60px; height: 60px; }
html.tel .recipe > .tile .fav-btn { top: -6px; left: -6px; }
html.tel .recipe > .tile .fav-btn::after { inset: -9px; }
html.tel .recipe .r-body { gap: 4px; }
html.tel .recipe .r-name { grid-template-columns: minmax(0, 1fr) auto 28px; column-gap: 6px; font-size: 17px; }
html.tel .recipe .r-name .rn-l { grid-column: 1; }
html.tel .recipe .r-name .r-lv { grid-column: 2; border: 0; padding: 0; font-size: 14px; }
html.tel .recipe .r-name img.info-ico { grid-column: 3; box-sizing: content-box; width: 26px; height: 26px; padding: 9px; margin: -9px; }
html.tel .recipe .r-meta { display: none; }
html.tel .recipe .r-cost { flex-flow: row wrap; gap: 4px 12px; font-size: 16px; }
html.tel .recipe .r-cost .r-res { display: contents; }
html.tel .recipe .r-cost .cost { display: inline-flex; align-items: center; gap: 4px; min-height: 26px; padding: 0; border: 0; }
html.tel .recipe .r-cost .cost img { width: 22px; height: 22px; object-fit: contain; }
html.tel .recipe .r-line .cl-name { display: none; }
html.tel .recipe .r-line { position: relative; }
html.tel .recipe .r-line[data-action="goRecipe"]::after { content: ""; position: absolute; inset: -9px -6px; }
html.tel .recipe .prog { height: 14px; margin: 0; }
html.tel .recipe .prog-empty { display: none; }
html.tel .recipe .r-act { align-self: center; display: block; padding: 0; border: 0; min-width: 0; min-height: 0; height: auto; }
html.tel .recipe .r-act .r-top, html.tel .recipe .r-act .r-slot { display: none; }
html.tel .recipe .r-act .btn { width: 60px; min-height: 60px; padding: 0; display: flex; align-items: center; justify-content: center; }
html.tel .recipe .r-act .btn img { width: 36px; height: 36px; object-fit: contain; }

/* ---------- Donjons ---------- */
html.tel .dungeons-panel { container-type: normal; padding: 0; background: none; } /* sans conteneur : les fenêtres fixes se calent sur l'écran */
html.tel .xb-head { display: none; }
html.tel .dungeons-panel > .panel-head { height: 0; min-height: 0; margin: 0; padding: 0; border: 0; overflow: hidden; } /* garde une boîte : cible du conseil "Les Donjons" */
html.tel #expeditions { display: contents; }
/* Expéditions : ruban collant, terminées en tête (un appui = récupérer) */
html.tel .xb { position: sticky; top: var(--st); z-index: 7; margin: -8px -8px 0; padding: 10px 8px; border: 0; border-radius: 0; background: #26231a; }
html.tel .xb-tiles { display: flex; gap: 8px; overflow: auto hidden; scrollbar-width: none; overscroll-behavior-x: contain; padding: 3px; margin: -3px; }
html.tel .xb-tiles::-webkit-scrollbar { display: none; }
html.tel .xt { flex: none; width: 92px; min-height: 84px; padding: 4px; border-width: 2px; align-items: center; justify-content: center; gap: 4px; }
html.tel .xt.claimall { order: -2; } html.tel .xt.done { order: -1; }
html.tel .xt-slot { flex: none; width: 104px; gap: 4px; } html.tel .xt-slot:has(> .xt.done) { order: -1; }
html.tel .xt-slot > .xt { width: auto; }
html.tel .xt-up { flex-wrap: nowrap; justify-content: center; gap: 4px; min-height: 0; font-size: 13px; }
html.tel .xt-up-lv { display: none; } /* place comptée : le niveau reste dans l'infobulle du bouton */
html.tel .xt .xt-run { font-size: 13px; justify-content: center; }
html.tel .xt-up-buy { height: 26px; padding: 0 5px; gap: 2px; }
html.tel .xt-up-cost { margin-left: 0; }
html.tel .xt-up-plus { margin-left: 2px; padding-left: 4px; } /* « +1 » après le prix : sans l'icône de relance, faute de place (tuile de 104 px) */
html.tel .xt-up-plus img.ui-ico { display: none; }
html.tel .xt .xt-name, html.tel .xt .xt-sub:not(.xt-cost), html.tel .xt .slot-heroes { display: none; }
html.tel .xt .xt-top { justify-content: center; }
html.tel .xt .xt-img { width: 60px; height: 42px; }
html.tel .xt .xt-mid { justify-content: center; width: 100%; }
html.tel .xt .xt-time { font-size: 15px; }
html.tel .xt.done { animation: none; }
html.tel .xt.done .xt-time { display: none; }
html.tel .xt.done .xt-mid { height: 26px; background: url("../img/ui/coffre.png") center / contain no-repeat; }
html.tel .xt .xt-bar { width: 100%; }
html.tel .xt.free, html.tel .xt.claimall, html.tel .xt.buy { flex-direction: column; justify-content: center; gap: 4px; }
html.tel .xt.free { width: 64px; background: #2a5f8d; border-color: #5f9cc9; }
html.tel .xt.buy { width: 92px; }
html.tel .xt-cost { font-size: 15px; white-space: nowrap; }
html.tel .xt-lock img { height: 30px; }
html.tel .xt .slot-cancel { top: -3px; right: -3px; width: 22px; height: 22px; }
html.tel .xt .slot-cancel::after { content: ""; position: absolute; inset: -11px -4px -11px -11px; }
/* Liste : une carte par donjon, un appui = préparer le groupe */
html.tel .dg-layout { display: block; }
html.tel .dg-list { container-type: normal; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; background: none; border: 0; border-radius: 0; overflow: visible; }
html.tel .dgr-head { display: none; }
html.tel .dgr.tel-dg { display: grid; grid-template: auto / 68px minmax(0, 1fr) 56px; grid-template-areas: none; column-gap: 10px; align-items: center; min-height: 84px; padding: 8px; border: 0; border-radius: 14px; background: #2f261d; content-visibility: auto; contain-intrinsic-size: auto 84px; }
html.tel .dgr.tel-dg:active:not(:disabled) { transform: scale(.985); }
html.tel .td-im { position: relative; display: flex; align-items: center; justify-content: center; width: 68px; height: 64px; }
html.tel .td-im > img { max-width: 100%; max-height: 100%; object-fit: contain; }
html.tel .td-tier { position: absolute; left: 0; bottom: 0; min-width: 24px; height: 22px; box-sizing: border-box; padding: 0 5px; border-radius: 11px; background: #15100c; color: var(--gold); font: 14px/22px var(--font-title); text-align: center; }
html.tel .td-tier img { height: 16px; width: auto; vertical-align: -3px; }
html.tel .td-bd { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
html.tel .td-nm { font: 400 18px/1.15 var(--font-title); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.tel .td-hd { display: flex; align-items: center; gap: 8px; min-width: 0; } html.tel .td-hd .mat-max { padding: 1px 8px 2px; margin: -2px 0; }
html.tel .td-in { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 16px; font-variant-numeric: tabular-nums; }
html.tel .td-in > span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
html.tel .td-in img { height: 20px; width: auto; max-width: 24px; object-fit: contain; margin: 0; }
html.tel .td-in .zero { color: #e07060; }
html.tel .td-pr { font-size: 15px; line-height: 1.2; }
html.tel .td-pr .dg-prog { flex-direction: row; align-items: center; gap: 8px; min-width: 0; }
html.tel .td-pr .dg-prog b { order: 2; font-weight: 400; white-space: nowrap; }
html.tel .td-pr .dg-prog .bar { flex: 1; }
html.tel .td-pr .dg-req { display: inline; } html.tel .td-pr .dg-req img { height: 18px; vertical-align: -4px; }
html.tel .td-go { display: flex; align-items: center; justify-content: center; width: 56px; height: 60px; border-radius: 14px; background: linear-gradient(#35a9e8, #1a69b8); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); }
html.tel .td-go img { width: 40px; height: 40px; object-fit: contain; filter: none; margin: 0; }
html.tel .tel-dg.boss .td-go { background: linear-gradient(#d6503f, #8e241a); }
html.tel .tel-dg.locked { opacity: .7; }
html.tel .tel-dg.locked .td-go { background: none; box-shadow: none; }
html.tel .tel-dg.locked .td-im img { filter: grayscale(1); }
html.tel .td-pr .dg-req.lock > span { display: inline; }
html.tel .dg-list { grid-auto-flow: row dense; }
html.tel .dg-more { min-height: 56px; border: 0; border-radius: 14px; background: #2f261d; }
html.tel .dgw-tel { grid-column: 1 / -1; padding: 12px; border-radius: 14px; background: #2f261d; }
html.tel .dgr.dgr-raid { display: grid; grid-template: auto auto / minmax(0, 1fr) auto; grid-template-areas: "name dur" "boss boss"; gap: 4px 10px; min-height: 72px; padding: 8px 12px; border: 0; border-radius: 14px; }
html.tel .dgr-raid .dgr-mat { display: none; }
html.tel .dgr-raid .dgr-boss { justify-self: start; text-align: left; }

/* ---------- Choisir les héros : plein écran, seule la zone du milieu défile ---------- */
html.tel .party {
  inset: 0; width: 100%; height: 100dvh; max-height: none; border-radius: 0; box-shadow: none; gap: 8px; container-type: normal;
  padding: calc(8px + var(--st)) calc(8px + var(--sr)) calc(8px + var(--sb)) calc(8px + var(--sl)); overflow: hidden; transform: none; left: 0; top: 0;
}
html.tel .party-back { display: none; }
html.tel .pty-head { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 8px; }
html.tel .pty-ban { height: 50px; gap: 8px; padding: 4px 10px; }
html.tel .pty-ban > img { width: 46px; height: 42px; }
html.tel .pty-ban > i { display: none; }
html.tel .pty-ban h2 { font-size: 20px; }
html.tel .pty-ban small { font-size: 14px; }
html.tel .pty-head .hs-close { width: 44px; height: 44px; align-self: center; grid-column: 2; grid-row: 1; }
html.tel .pty-head .pg2-bar { grid-column: 1 / -1; grid-row: 2; width: 100%; height: 26px; box-sizing: border-box; }
html.tel .pty-tm-head { justify-content: flex-start; gap: 8px; flex-wrap: nowrap; }
html.tel .pty-tm-head > h3 { display: none; }
html.tel .pty-tm-head .pty-title small:not(.pty-count) { display: none; }
html.tel .pty-sets { gap: 8px; }
html.tel .pty-set { height: 44px; min-width: 76px; padding: 0 10px; }
html.tel .pty-tm-head .pty-title { margin-left: auto; }
html.tel .party .pty-teams { display: flex; grid-template-columns: none !important; gap: 8px; overflow: auto hidden; scrollbar-width: none; overscroll-behavior-x: contain; }
html.tel .party .pty-teams::-webkit-scrollbar { display: none; }
html.tel .party .pty-teams .pty-team { flex: none; width: 128px; height: 76px !important; display: flex !important; flex-direction: column; justify-content: center; align-items: center; gap: 4px; padding: 6px !important; }
html.tel .party .pty-team > b { display: none; }
html.tel .party .pty-team .pty-faces { justify-content: center !important; height: 38px !important; }
html.tel .party .pty-team .pty-face { height: 38px !important; }
html.tel .party .pty-team .pty-meta { font-size: 15px; height: 20px; }
html.tel .party .pty-team .pty-meta .warn { display: none; }
html.tel .party .pty-team.vide { width: 64px; }
html.tel .party .pty-team.vide > b { display: block; }
html.tel .party .pty-team.vide > span { display: none; }
html.tel .party .pty-bar { height: 48px; padding: 0 4px; gap: 8px; background: none; }
html.tel .pty-msg { font-size: 15px; line-height: 18px; max-height: 54px; }
html.tel .party .btn.act { min-height: 44px; padding: 3px 12px 6px; font-size: 16px; }
html.tel .party .btn.act img { height: 24px; width: auto; }
html.tel .pty-bar input { height: 44px; min-width: 0; flex: 1 1 auto; }
html.tel .pty-bar:has(input) .pty-msg { display: none; }
html.tel .pty-body { display: block; scrollbar-width: none; overflow: hidden auto; overscroll-behavior: contain; min-height: 0; -webkit-overflow-scrolling: touch; }
html.tel .pty-list > .pty-title { display: none; }
html.tel .pty-grid { overflow: visible; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); grid-auto-rows: 112px; gap: 8px; padding: 0; }
html.tel .pty-card { grid-template: 60px 18px 18px / minmax(0, 1fr); gap: 2px; padding: 4px; }
html.tel .pty-av { height: 60px; } html.tel .pty-av img.av { width: 58px; height: 58px; }
html.tel .pty-card .pty-name { font-size: 15px; line-height: 18px; }
html.tel .pty-stats { font-size: 14px; } html.tel .pty-stats > span:first-child { display: none; }
html.tel .pty-stats img.ui-ico { height: 15px; }
html.tel .pty-skill { position: absolute; left: 4px; top: 4px; } html.tel .pty-skill > span { display: none; }
html.tel .pty-gone { position: absolute; left: 2px; right: 2px; top: 40px; background: rgba(253, 238, 204, .9); border-radius: 8px; font-size: 14px; }
html.tel .pty-badge { top: 2px; right: 2px; padding: 0 6px 1px; font-size: 13px; }
/* Sexe et classe : sous la couronne de compétence, portrait réduit pour leur laisser la marge gauche */
html.tel .pty-av img.av { width: 52px; height: 52px; }
html.tel .pty-marks { top: 24px; left: 2px; grid-template-rows: 14px 14px; gap: 2px; }
html.tel .pty-marks img.ui-ico { width: 14px; height: 14px; }
html.tel .pty-tip { display: none !important; }
html.tel .pty-sum { margin-top: 12px; }
html.tel .pty-panes { overflow: visible; }
html.tel .pty-tabs .hs-tab { min-height: 44px; }
html.tel .pty-foot { min-height: 60px; gap: 8px; padding: 6px 8px 6px 12px; display: grid; grid-template-columns: auto minmax(0, 1fr) 132px; }
html.tel .pty-foot > .hs-pow:first-child, html.tel .pty-foot .hs-sep, html.tel .pty-foot .hs-pow small { display: none; }
html.tel .pty-foot .hs-pow { gap: 4px; } html.tel .pty-foot .hs-pow > img { height: 24px; } html.tel .pty-foot .hs-pow b { font-size: 20px; margin: 0; }
html.tel .pty-foot > .pty-max { grid-column: 1 / -1; order: -1; text-align: center; }
html.tel .pty-why { font-size: 14px; line-height: 1.15; text-align: left; }
html.tel .pty-why.ok { font-size: 0; } html.tel .pty-why small { font-size: 14px; }
/* Pastilles du pied : valeurs seules (libellés dans l'infobulle), sous le message */
html.tel .pty-why { justify-content: flex-start; }
html.tel .pty-txt { flex-basis: 100%; } html.tel .pty-why.ok .pty-txt { display: none; }
html.tel .pty-chip { height: 30px; padding: 0 10px 0 6px; font-size: 14px; } html.tel .pty-chip > img { width: 22px; height: 22px; }
html.tel .pty-chip .pty-lbl { display: none; }
html.tel .pty-sure b { justify-content: flex-start; }
html.tel .party .btn.pty-go { width: 132px; min-height: 50px; font-size: 21px; padding: 0 8px; }

/* ---------- Chaudron ---------- */
html.tel .panel.cauldron { background: none; padding: 0; }
html.tel .cauldron .panel-head { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; padding: 0 2px; }
html.tel .cauldron .panel-head h2 { display: none; }
html.tel #fusion-cap { flex: 1; min-width: 0; font-size: 15px; }
html.tel .fu-cauldron { height: 112px; display: flex; align-items: center; justify-content: center; }
html.tel .fu-cauldron img { max-height: 112px; width: auto; }
html.tel .fu-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
html.tel .fu-tile { width: auto; min-height: 104px; }
html.tel .fu-tile > img { width: 56px; height: 56px; object-fit: contain; }
html.tel .fu-tile.idle b { display: none; }
html.tel .fu-tile.busy > img { animation: none; }
html.tel .fu-tile .fu-res img { width: 60px; height: 60px; object-fit: contain; }
html.tel .fu-tile .slot-cancel { top: -4px; right: -4px; width: 24px; height: 24px; }
html.tel .fu-tile .slot-cancel::after { content: ""; position: absolute; inset: -10px -4px -10px -10px; }
html.tel .fu-acts .btn { flex: 1 1 auto; }
/* Fusion : plein écran ; objets choisis, résultats, objets du stock (seule zone qui défile), pied fixe */
html.tel .fusion-dialog { width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: calc(6px + var(--st)) calc(8px + var(--sr)) calc(8px + var(--sb)) calc(8px + var(--sl)); border: 0; border-radius: 0; }
html.tel .fu-body { position: relative; overflow: hidden; margin: 0; padding: 0; gap: 8px; }
html.tel .fu-body > .small-text, html.tel .fu-rt { display: none; }
html.tel .fu-main { order: 1; margin: 0; gap: 8px; }
html.tel .fu-pick { order: 2; }
html.tel .fu-filters { order: 3; }
html.tel .fu-foot { order: 4; }
html.tel .fu-sels { display: grid; grid-template-columns: repeat(auto-fit, minmax(54px, 1fr)); gap: 8px; }
html.tel .fu-sl { min-width: 0; max-width: 90px; min-height: 62px; height: 62px; padding: 2px; }
html.tel .fu-sl small { font-size: 12px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
html.tel .fu-sl .fu-ico, html.tel .fu-sl .fu-ico img { width: 38px; height: 38px; object-fit: contain; }
html.tel .fu-results { display: flex; flex-direction: row; gap: 8px; min-height: 58px; align-items: stretch; overflow: auto hidden; scrollbar-width: none; overscroll-behavior-x: contain; }
html.tel .fu-results > small { align-self: center; font-size: 15px; }
html.tel .fu-out { flex: none; grid-template-columns: 36px auto; gap: 0 8px; padding: 4px 10px 4px 6px; }
html.tel .fu-out .fu-ico { grid-row: 1 / 3; }
html.tel .fu-out .fu-on > span { display: none; }
html.tel .fu-out .fu-on small { font-size: 14px; }
html.tel .fu-out b { font-size: 18px; text-align: left; }
html.tel .fu-out.best { order: -1; }
html.tel .fusion-dialog .fu-box .fu-pick { flex: 1 1 0; min-height: 0; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; padding: 8px 6px 4px 2px; overscroll-behavior: contain; scrollbar-width: none; }
html.tel .fu-card { min-height: 84px; padding: 6px 2px 4px; gap: 2px; }
html.tel .fu-card .fu-n { top: -5px; right: -5px; }
html.tel .fu-tal { top: -5px; left: -2px; } /* 2 px de marge à gauche de la liste : pastille non coupée */
html.tel .fu-card .fu-cn { display: none; }
html.tel .fu-card small { font-size: 14px; }
html.tel .fu-card .fu-ico, html.tel .fu-card .fu-ico img { width: 50px; height: 50px; object-fit: contain; }
html.tel .fu-foot { display: grid; grid-template-columns: auto minmax(0, 1fr) 132px; grid-template-areas: "filt dur go" "clear chance go"; align-items: center; gap: 4px 10px; margin: 0; padding-top: 8px; border-top: 1px solid #4a3a2b; }
html.tel .fu-foot .tel-filt { grid-area: filt; } html.tel .fu-foot [data-action="fusionClear"] { grid-area: clear; }
html.tel .fu-foot .fu-dur { grid-area: dur; } html.tel .fu-foot .fu-chance { grid-area: chance; font-size: 15px; margin: 0; }
html.tel .fu-foot .fu-dur .lbl, html.tel .fu-foot .fu-chance .lbl { display: none; }
html.tel .fu-foot .btn.primary { grid-area: go; width: 132px; min-height: 72px; font-size: 19px; padding: 0 6px; }
html.tel .fu-foot .btn.primary .go-ico { display: block; width: 34px; height: 34px; margin: 0 auto 2px; }
html.tel .fu-foot .btn.small { min-height: 44px; padding: 0 12px; }
/* Filtres : volet au-dessus du pied */
html.tel .fu-box:not(.f-open) .fu-filters { display: none; }
html.tel .fu-filters { position: absolute; left: 0; right: 0; bottom: 110px; z-index: 5; display: flex; flex-flow: column nowrap; /* nowrap : sinon les sections partent dans une 2e colonne hors écran */ align-items: stretch; gap: 14px; max-height: calc(100% - 130px); overflow: hidden auto; margin: 0; padding: 10px 10px 0; border: 0; border-radius: 14px; background: #1f1812; box-shadow: 0 -6px 20px rgba(0, 0, 0, .5); overscroll-behavior: contain; }
html.tel .fu-filters > .fu-flbl { display: none; }
html.tel .fu-filters > * { flex: none !important; min-width: 0; max-width: 100%; }
html.tel .fu-filters > .fu-quals { order: 1; } html.tel .fu-filters > .fu-cats { order: 2; } html.tel .fu-filters > .fu-ranks { order: 3; display: block; } html.tel .fu-filters > .fu-fbar { order: 4; position: sticky; bottom: 0; z-index: 3; margin: 0 -10px; max-width: none; padding: 8px 10px; background: #1f1812; } /* Réinitialiser et compteur toujours visibles */
html.tel .fu-filters .rk-more { margin-top: 8px; }
html.tel .fu-rk-row { grid-template-columns: repeat(auto-fill, 44px); gap: 8px; }
html.tel .fu-rk-row + .fu-rk-row { margin-top: 4px; }
html.tel .rk-badge { width: 44px !important; max-height: 44px; height: 44px; }
html.tel .rk-badge.none { display: none; }
html.tel .rk-more { width: 44px; height: 44px; }
html.tel .cat-filter.fu-cats { display: flex; flex-wrap: wrap; gap: 8px; container-type: normal; }
html.tel .cat-filter.fu-cats .cat-main, html.tel .cat-filter.fu-cats .cat-row, html.tel .cat-filter.fu-cats .family { display: contents !important; }
html.tel .cat-filter.fu-cats .cat-tab.has-img { width: 44px; height: 44px; }
html.tel .cat-filter.fu-cats .cat-tab:disabled { display: none; }
html.tel .fq-btn { height: 44px; }

/* ---------- Comptoir ---------- */
/* Acheteurs seulement (voulu par l'utilisateur, 01/12/2026) : niveau et amélioration du Comptoir en tête des Ressources (#counter-up-tel) */
html.tel:has(#counter-up-tel) .counter .panel-head, html.tel .customers > .hint { display: none; }
html.tel .ctr-up { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 8px 10px; margin-bottom: 12px; padding: 10px; border-radius: 12px; background: #2f261d; }
html.tel .ctr-up > img { width: 40px; height: 40px; object-fit: contain; }
html.tel .ctr-n { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 18px; }
html.tel .ctr-n small { font-size: 16px; }
html.tel .ctr-up .rack { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; min-height: 48px; margin: 0; padding: 0; border: 0; }
html.tel .ctr-up .ch-lv { font: 17px/1.2 var(--font-title); }
html.tel .ctr-up .btn { width: 100%; min-height: 48px; font-size: 16px; }
html.tel .ctr-up .rack-up { width: 100%; min-width: 0; margin: 0; }
html.tel .ctr-up .rack > .muted { text-align: right; }
html.tel .counter-stats, html.tel .cust-pat { display: none; } /* réputation, patience et série masquées (voulu par l'utilisateur, 30/11/2026) */
html.tel .customers { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
html.tel .customer { grid-template-columns: 56px minmax(0, 1fr); gap: 4px 10px; padding: 8px; margin: 0; animation: none; }
html.tel .cust-side { gap: 2px; } html.tel .cust-side img.av { width: 56px; height: 56px; }
html.tel .cust-badges { min-height: 0; }
html.tel .cust-more { height: 36px; position: relative; } html.tel .cust-more::after { content: ""; position: absolute; inset: -6px -4px; }
html.tel .customer .wish { min-height: 40px; }
html.tel .cust-actions { grid-template-columns: minmax(0, 1fr) 52px; }
html.tel .cust-actions .ca-main { grid-column: auto; }
html.tel .cust-actions.only-main .sug-wrap.ca-main { grid-column: 1 / -1; }
/* Marchandeur : « Accepter l'offre » sur toute la ligne, puis « Refuser l'offre » | Proposer */
html.tel .customer.k-marchand .cust-actions > .btn.ca-main { grid-column: 1 / -1; }
html.tel .cust-actions > .btn.ca-mod { column-gap: 6px; padding-left: 4px; padding-right: 4px; }
html.tel .cust-actions .btn { min-height: 46px; font-size: 16px; white-space: nowrap; flex-wrap: nowrap; }
html.tel .cust-actions .btn img.ui-ico { height: 20px; width: auto; margin: 0; }
html.tel .cust-actions .btn small img.ui-ico { height: 16px; margin-left: 4px; vertical-align: -3px; }
html.tel .sug-wrap > .btn[data-action="toggleSuggest"] { font-size: 0 !important; gap: 0; padding: 0 !important; justify-content: center; }
html.tel .sug-wrap > .btn[data-action="toggleSuggest"] > * { display: none; }
html.tel .sug-wrap > .btn[data-action="toggleSuggest"]::after { content: ""; width: 30px; height: 30px; background: url("../img/ui/synchro.png") center / contain no-repeat; }
/* Proposer : feuille en bas de l'écran */
html.tel .sug-pop { position: fixed !important; inset: auto 0 var(--nav-all) 0 !important; z-index: 900; width: 100%; max-width: none; max-height: 72dvh; margin: 0 !important; border-radius: 18px 18px 0 0; padding: 10px calc(10px + var(--sr)) 10px calc(10px + var(--sl)); display: flex; flex-direction: column; }
html.tel .sug-pop::before { display: none; }
html.tel .sug-list { flex: 1; min-height: 0; max-height: none; overflow: hidden auto; overscroll-behavior: contain; }
html.tel .sug-list .btn.alt { min-height: 52px; font-size: 16px; }
html.tel .cm-item { min-height: 48px; }
html.tel .gd-bubble { padding: 10px 14px; } html.tel .gd-bubble .ch-bust { display: none; }
html.tel .gd-body p { margin: 4px 0; }

/* ---------- Quêtes ---------- */
html.tel .dl-row { grid-template-columns: 28px minmax(0, 1fr) auto 52px !important; min-height: 52px; gap: 8px; }
html.tel .dl-txt { font-size: 16px; } html.tel .dl-n { font-size: 15px; white-space: nowrap; }
html.tel .dl-rw { display: none; }
html.tel .dl-act { grid-column: auto !important; justify-content: center; }
html.tel .dl-act > img.ui-ico { margin: 0; }
html.tel .dl-act .btn { width: 52px; min-height: 44px; padding: 0; font-size: 0; }
html.tel .dl-act .btn::after { content: ""; display: inline-block; width: 28px; height: 28px; vertical-align: middle; background: url("../img/ui/coffre.png") center / contain no-repeat; }
html.tel .dl-act .btn:disabled::after { filter: grayscale(1); opacity: .6; }

/* ---------- Bâtiments de maîtrise ---------- */
html.tel .mst-go:not([hidden]) { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; margin-top: 12px; font-size: 17px; }
html.tel .mst-go .ui-ico { width: 32px; height: 32px; object-fit: contain; }
html.tel .mst-card .btn.small { min-height: 48px; font-size: 17px; }

/* ---------- Stock ---------- */
html.tel .stock .panel-head h2, html.tel .racks .panel-head h2 { font-size: 0; margin: 0; }
html.tel .stock .panel-head h2 img, html.tel .racks .panel-head h2 img { height: 30px; width: auto; margin: 0; }
html.tel #stock-filter { display: grid; grid-template-rows: repeat(2, 44px); grid-auto-flow: column; grid-auto-columns: 44px; gap: 8px; container-type: normal; margin: 0 -10px 8px; padding: 6px 10px; overflow: auto hidden; scrollbar-width: none; overscroll-behavior-x: contain; }
html.tel #stock-filter[hidden] { display: none; }
html.tel #stock-filter::-webkit-scrollbar { display: none; }
html.tel #stock-filter .cat-main, html.tel #stock-filter .cat-row, html.tel #stock-filter .family { display: contents !important; }
html.tel #stock-filter .cat-tab.has-img { width: 44px; height: 44px; }
html.tel #stock-filter .cf-all { order: -1; } html.tel #stock-filter .cat-tab:disabled { order: 1; }
html.tel .inventory { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 10px; }
html.tel #stock-del-bar { bottom: var(--nav-all); }
html.tel .sq-list { position: fixed !important; inset: auto 8px calc(var(--nav-all) + 8px) 8px !important; max-height: 60dvh !important; z-index: 70; }
html.tel .sq-item { min-height: 46px; }

/* ---------- Ressources, ville, héros, commandes, arène, marché ---------- */
html.tel .rk-acts .btn img { height: 26px; width: auto; }
html.tel .rs-tg { min-width: 44px; min-height: 44px; }
html.tel .rs-slot { min-height: 86px; } /* boutons de 44 px : même hauteur à payer ou en chantier */
html.tel .panel.city > .panel-head, html.tel #city-raid { display: none; } /* doublons de la liste et de la pastille ; raid : Menu (voulu par l'utilisateur, 01/12/2026) */
html.tel .city-filters { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 8px; }
html.tel .city-filters .btn, html.tel .city-filters button { font-size: 0; min-height: 48px; padding: 0; justify-content: center; }
html.tel .city-filters button img { width: 34px; height: 34px; object-fit: contain; margin: 0; }
html.tel .hero-sets > small { display: none; }
html.tel .hero-sets .hero-set-fill { width: auto; flex: 1 1 100%; }
html.tel .hero-all { flex: 1 1 100%; }
html.tel .hero-all > b { flex: 1 1 100%; }
html.tel .hero-all .btn { flex: 1 1 0; }
html.tel .hero-all .hero-strip { flex: 1 1 100%; margin-left: 0; }
html.tel .hrow { padding-left: 10px !important; }
html.tel .hr-grip { display: none; }
html.tel .hrow .hr-eq .hcard { min-width: 0; }
html.tel .ar-row1 .ar-head { grid-template-columns: auto minmax(0, 1fr); }
html.tel .ar-row1 .ar-head > * { min-width: 0; }
html.tel .ar-row1 .ar-head > :nth-child(3) { grid-column: 1 / -1; }
html.tel .ar-card { padding: 10px; border: 0; }
html.tel .mk-top, html.tel .mk-main { grid-template-columns: minmax(0, 1fr) !important; }

/* ---------- Fenêtres : plein écran, fermeture toujours visible ---------- */
html.tel dialog { overscroll-behavior: contain; }
html.tel .save-dialog:not(.tuto-dialog):not(.fusion-dialog) {
  width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0; box-sizing: border-box;
  padding: 0 calc(12px + var(--sr)) calc(14px + var(--sb)) calc(12px + var(--sl));
}
html.tel .save-dialog:not(.fusion-dialog) .save-head { position: sticky; top: 0; z-index: 20; min-height: 52px; margin: 0 -12px 8px; padding: calc(4px + var(--st)) 12px 4px; background: var(--panel); }
html.tel .tuto-dialog, html.tel .guide-dialog { width: calc(100vw - 16px); max-width: 520px; max-height: calc(100dvh - 16px); }
html.tel .btn.close, html.tel .hs-close { min-width: 44px; min-height: 44px; flex: none; }
html.tel .cl-box { max-height: none; }
html.tel .changelog-dialog .cl-list { overflow: visible; padding: 0; }
html.tel .dp {
  inset: 0 !important; width: 100% !important; max-width: none !important; height: 100dvh; max-height: none; margin: 0 !important; transform: none; box-sizing: border-box; border: 0 !important; border-radius: 0 !important; filter: none !important;
  padding: calc(8px + var(--st)) calc(10px + var(--sr)) calc(12px + var(--sb)) calc(10px + var(--sl)) !important; overflow: hidden auto; overscroll-behavior: contain;
}
html.tel .dp-back { display: none; }
html.tel .dp.pg, html.tel .dp.ep, html.tel .dp.hs, html.tel .dp.rw { border-image: none !important; }
html.tel .dp .hs-head, html.tel .dp.pg2 .pg2-head, html.tel .dp > .dp-title { position: sticky; top: calc(-8px - var(--st)); z-index: 12; margin: 0 -10px; padding: calc(8px + var(--st)) 10px 8px; background: inherit; }
html.tel .dp .hs-head, html.tel .dp.pg2 .pg2-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
html.tel .pg2-ban, html.tel .hs-ban { flex: 1 1 0; min-height: 54px; }
html.tel .dp.pg2 .pg2-bar { order: 3; flex: 1 1 100%; }
html.tel .dp .hs-close { width: 44px; height: 44px; }
html.tel .dp.ep .ep-close { position: fixed; top: calc(8px + var(--st)); right: calc(8px + var(--sr)); z-index: 20; }
/* Progrès : paliers en ruban, chances à la ligne */
html.tel .dp .dp-row { justify-content: flex-start; }
html.tel .dp.ep .dp-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; padding: 54px 0 0; overflow: visible; }
/* Filtres : barre collée en haut, types à gauche de la croix, qualités en pastilles dessous */
html.tel .dp.ep .ep-bar { position: sticky; top: calc(-8px - var(--st)); z-index: 12; flex-flow: column nowrap; gap: 8px; margin: calc(-8px - var(--st)) -10px 0; padding: calc(8px + var(--st)) 10px 8px; background: inherit; }
html.tel .dp.ep .ep-bar:not(:has(.ep-ft)) { padding-top: calc(60px + var(--st)); }
html.tel .ep-ft { margin-right: 56px; }
html.tel .ep-f { flex: 1 1 0; min-width: 0; padding: 0; font-size: 16px; }
html.tel .ep-f[data-v=""] { flex: 0 0 60px; }
html.tel .ep-ft .ep-f:not([data-v=""]) { max-width: 64px; }
html.tel .ep-card .fu-tal { top: 3px; left: 3px; }
html.tel .ep-fn { display: none; }
html.tel .ep-f .q-dot { width: 20px; height: 20px; }
html.tel .dp.ep .ep-bar + .dp-row { padding-top: 8px; }
html.tel .dp.ep .ep-card { width: auto; min-width: 0; padding: 4px 4px 6px; gap: 2px; border-width: 2px; border-radius: 14px; box-shadow: none; }
html.tel .ep-img { position: static; transform: none; width: 72px; height: 60px; margin: 0 auto; filter: none; }
html.tel .ep-name { min-height: 34px; font-size: 15px; line-height: 1.1; -webkit-text-stroke-width: 3px; }
html.tel .ep-opt { font-size: 14px; -webkit-text-stroke-width: 3px; } html.tel .ep-opt img { height: 18px; width: auto; }
html.tel .ep-pow { font-size: 19px; gap: 4px; margin-top: 2px; -webkit-text-stroke-width: 4px; }
html.tel .ep-break { margin-top: 2px; } html.tel .ep-break small { display: none; } html.tel .ep-break span { font-size: 17px; }
html.tel .ep-break img { height: 20px; width: auto; }
html.tel .ep-foot { margin-top: 4px; padding: 2px 4px; font-size: 16px; gap: 6px; } html.tel .ep-foot img { height: 20px; width: auto; }
html.tel .ep-empty { grid-column: 1 / -1; color: inherit; text-shadow: none; }
/* Plans, packs, classement */
html.tel #plans-dialog { width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; border-radius: 0; padding: calc(8px + var(--st)) 10px calc(8px + var(--sb)); }
html.tel .plan-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html.tel .plan-row.own { grid-template-columns: 40px minmax(0, 1fr) 62px 76px 44px; }
html.tel .plan-row .po-name { min-height: 44px; }
html.tel .plan-tabs .btn { font-size: 15px !important; padding: 0 4px; white-space: normal; line-height: 1.05; }
html.tel .plan-tabs .btn img { display: none; }
html.tel .plan-row { grid-template-columns: 40px minmax(0, 1fr) auto auto 44px; grid-template-areas: "ico name lvl cost info" "ico act act act act"; gap: 2px 8px; padding: 6px 8px; }
html.tel .plan-row .pr-ico { grid-area: ico; } html.tel .plan-row .pr-name { grid-area: name; } html.tel .plan-row .pr-cost { grid-area: cost; } html.tel .plan-row .pr-info { grid-area: info; }
html.tel .plan-row .pr-lvl { grid-area: lvl; } html.tel .plan-row .pr-act { grid-area: act; }
html.tel #packs-dialog .plans-list, html.tel .board-list { max-height: none; overflow: visible; }
html.tel .pk-row { grid-template-columns: 2rem 1fr 3.6rem 44px; min-height: 44px; }
html.tel .info-ico { box-sizing: content-box; }
html.tel #raid-dialog, html.tel .dp.hs.rw { width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; }
html.tel .bags-dialog { width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0; }
html.tel .pg2-foot { display: block; } html.tel .pg2-pills { display: flex; justify-content: center; gap: 8px; } html.tel .pg2-pill { white-space: nowrap; }
html.tel .ar-row1 .ar-head { grid-template-columns: minmax(0, 1fr) !important; }
html.tel .ar-row1 .ar-head > * { grid-column: 1 !important; }
html.tel .pg2-pills { flex-wrap: wrap; }
html.tel .pg2-pills .pg2-pill { flex: 1 1 auto; min-width: max-content; padding: 6px; gap: 6px; } /* montants longs : à la ligne plutôt que hors de la fenêtre */
/* Fenêtres en <dialog> sans cadre */
html.tel #prog-modal, html.tel #hero-modal, html.tel #raid-dialog, html.tel #stock-dialog { max-width: none; max-height: none; }
html.tel .tc { inset: 0 0 auto 0 !important; top: 0; right: 0; width: 100%; height: calc(100dvh - var(--nav-all)); min-height: 0; border-radius: 0; box-sizing: border-box; padding: calc(8px + var(--st)) 8px 8px; }

/* ---------- Fin d'expédition : plein écran, héros sur 3 colonnes, boutons toujours visibles ---------- */
html.tel .fete-dialog { width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0; overflow: hidden; box-shadow: none; }
html.tel .fete-dialog::after { display: none; } /* plein écran : pas de cadre */
html.tel .fete { width: 100%; height: 100%; min-height: 0; max-height: none; box-sizing: border-box; overflow: hidden auto; border: 0; border-radius: 0; padding-bottom: 0; }
html.tel .fe-team { zoom: .72; gap: 12px; }
html.tel .fe-actions { position: sticky; bottom: 0; z-index: 5; margin-top: auto; padding: 8px 8px calc(10px + var(--sb)); background: #120d16; }
html.tel .fe-actions .btn { min-height: 48px; }

/* ---------- Cibles au doigt élargies sans bouger la mise en page ---------- */
html.tel .oc-link, html.tel .hqc-name, html.tel .away-toggle, html.tel .w-ico, html.tel .w-item, html.tel .lvl-cap { position: relative; }
html.tel .oc-link::after, html.tel .hqc-name::after, html.tel .away-toggle::after, html.tel .w-item::after { content: ""; position: absolute; inset: -10px -4px; }
html.tel .lvl-cap::after { content: ""; position: absolute; inset: -6px 0; }
html.tel .hqc-chev { width: 44px; height: 44px; }
html.tel .hqc-sum { grid-template-columns: 48px minmax(0, 1fr) 44px; }
html.tel .qreward.gift { min-height: 44px; }

/* ---------- Mouvements allégés ---------- */
html.tel .slot-tile, html.tel .xt, html.tel .fu-tile, html.tel .cl-dot, html.tel .slot { animation: none !important; }
html.tel .fe-rays, html.tel .fe-coins, html.tel .ch-stars { display: none; }
html.tel .fe-bg { filter: brightness(.35); }
html.tel .panel img, html.tel .tn-b img { filter: none; }
html.tel .locked img, html.tel button:disabled img { filter: grayscale(1); }

/* ---------- Paysage (peu de hauteur) : barre de navigation à gauche, rubans sur une ligne ---------- */
@media (orientation: landscape) and (max-height: 520px) {
  html.tel { --nav-w: 64px; scroll-padding-bottom: 8px; }
  html.tel body { padding-left: calc(var(--nav-w) + var(--sl)); padding-bottom: calc(8px + var(--sb)); }
  html.tel .tel-nav:not([hidden]) { inset: 0 auto 0 0; width: calc(var(--nav-w) + var(--sl)); height: auto; grid-template: repeat(var(--nav-n, 5), minmax(0, 1fr)) / minmax(0, 1fr); padding: var(--st) 0 var(--sb) var(--sl); border-top: 0; border-right: 2px solid #4a3a2b; }
  html.tel .tn-b.sel::after { left: 0; right: auto; top: 22%; bottom: 22%; width: 4px; height: auto; }
  html.tel .tel-menu:not([hidden]) { inset: 0 0 0 calc(var(--nav-w) + var(--sl)); padding-bottom: 12px; }
  html.tel .toasts { bottom: 10px; }
  html.tel .tc { inset: 0 0 0 calc(var(--nav-w) + var(--sl)) !important; width: auto; height: 100dvh; }
  html.tel .sug-pop { inset: auto 0 0 calc(var(--nav-w) + var(--sl)) !important; width: auto; }
  html.tel .sq-list { inset: auto 8px 8px calc(var(--nav-w) + 8px) !important; }
  html.tel #stock-del-bar { bottom: 0; }
  html.tel .recipes-panel > .cat-tabs.cat-seq, html.tel #stock-filter { grid-template-rows: 44px; }
  html.tel #work-rail { position: static; }
  html.tel .recipes-panel > .cat-tabs.cat-seq { top: var(--st); }
  html.tel:has(main[data-mv="fabriquer"]) { --sp: 64px; }
  html.tel .recipes { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
  html.tel .xt { min-height: 68px; }
  html.tel .xt .xt-img { height: 30px; }
  /* Choisir les héros : équipes à gauche, héros à droite */
  html.tel .party { display: grid; grid-template: auto auto minmax(0, 1fr) auto / 300px minmax(0, 1fr); grid-template-areas: "head body" "set body" "teams body" "foot body"; column-gap: 12px; }
  html.tel .pty-head { grid-area: head; } html.tel .pty-tm-head { grid-area: set; } html.tel .pty-body { grid-area: body; } html.tel .pty-foot { grid-area: foot; grid-template-columns: auto minmax(0, 1fr); } html.tel .party .btn.pty-go { grid-column: 1 / -1; width: 100%; min-height: 48px; }
  html.tel .party .pty-teams { grid-area: teams; align-content: start; flex-wrap: wrap; overflow: hidden auto; }
  html.tel .party .pty-teams .pty-team { width: calc(50% - 4px); } html.tel .party .pty-team.vide { width: 64px; }
  html.tel .party .pty-bar { grid-area: body; align-self: end; z-index: 3; background: #f3dcae; border-radius: 12px; padding: 0 6px; }
  html.tel .pty-body { padding-bottom: 56px; }
  /* Fusion : choix et résultats à gauche, stock à droite */
  html.tel .fu-body { display: grid; grid-template: minmax(0, 1fr) auto / 300px minmax(0, 1fr); column-gap: 12px; }
  html.tel .fu-main { grid-column: 1; grid-row: 1; overflow: hidden auto; align-content: start; }
  html.tel .fusion-dialog .fu-box .fu-pick { grid-column: 2; grid-row: 1 / 3; max-height: none; height: 100%; }
  html.tel .fu-foot { grid-column: 1; grid-row: 2; }
  html.tel .fu-results { flex-wrap: wrap; overflow: visible; }
  html.tel .fu-filters { left: 312px; bottom: 0; max-height: 100%; }
}

/* Options : interrupteurs assez grands au doigt */
html.tel .op-sw { position: relative; } html.tel .op-sw::after { content: ""; position: absolute; inset: -10px -8px; }

/* ---------- Installer le jeu (js/installer.js) ---------- */
html.tel .tm-inst > img { border-radius: 10px; }
html.tel .save-dialog.tuto-dialog:not(.fusion-dialog) .save-head { padding-top: 4px; } /* fenêtres centrées : pas de zone sûre en haut */
html.tel .ins-dialog { box-sizing: border-box; border: 0; }
html.tel .ins-dialog .tuto-body { font-size: 16px; }
html.tel .ins-dialog h2 { text-transform: none; }
html.tel .ins-dialog .btn { min-height: 44px; }
html.tel .ins-dialog .btn.close { width: 44px; height: 44px; }
html.tel .ins-steps { margin: 12px 0; padding-left: 24px; display: flex; flex-direction: column; gap: 8px; line-height: 1.4; }
html.tel .ins-dialog .tuto-foot { flex-wrap: wrap; gap: 8px; }
html.tel .ins-dialog .tuto-foot .btn { flex: 1 1 130px; }

/* ---------- Chronique de la veille (#recap-dialog, renderRecap) : parchemin presque pleine largeur ; en largeur étroite, cartes du haut empilées et tuiles par deux ---------- */
html.tel dialog#recap-dialog { padding: calc(16px + var(--st)) calc(22px + var(--sr)) calc(16px + var(--sb)) calc(22px + var(--sl)); }
html.tel #recap-dialog .rj-rod { margin: 0 -8px; }
html.tel #recap-dialog .rj-rod::before { left: -12px; } html.tel #recap-dialog .rj-rod::after { right: -12px; }
@media (max-width: 600px) {
  html.tel #recap-dialog .rj-sheet { padding: 26px 14px 24px; }
  html.tel #recap-dialog .rj-banner { aspect-ratio: 512 / 116; }
  html.tel #recap-dialog .rj-banner h2 { font-size: 20px; line-height: 1.05; margin-top: -9px; max-width: 66%; text-wrap: balance; }
  html.tel #recap-dialog .rj-hero { grid-template-columns: minmax(0, 1fr); }
  html.tel #recap-dialog .rj-big { gap: 12px; padding: 10px 12px; }
  html.tel #recap-dialog .rj-big .rj-ico { width: 64px; height: 64px; }
  html.tel #recap-dialog .rj-big .rj-ico img { max-width: 50px; max-height: 50px; }
  html.tel #recap-dialog .rj-big b { font-size: 30px; }
  html.tel #recap-dialog .rj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html.tel #recap-dialog .rj-tile { padding: 12px 6px 14px; }
  html.tel #recap-dialog .rj-tile b { font-size: 24px; }
  html.tel #recap-dialog .rj-tile:not(.wide) { align-content: start; } /* montants d'une même ligne à la même hauteur */
  html.tel #recap-dialog .rj-tile > span { max-width: 100%; overflow-wrap: break-word; }
  /* Objet le plus fabriqué en tête ; la quantité passe sous le nom si elle ne tient pas à côté */
  html.tel #recap-dialog .rj-tile.wide { order: -1; }
  html.tel #recap-dialog .rj-tile.wide, html.tel #recap-dialog .rj-top { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 10px 14px 10px 10px; }
  html.tel #recap-dialog .rj-tile.wide .rj-ico, html.tel #recap-dialog .rj-top .rj-ico { width: 70px; height: 70px; }
  html.tel #recap-dialog .rj-tile.wide .rj-ico, html.tel #recap-dialog .rj-top .rj-ico { align-items: center; justify-content: center; }
  html.tel #recap-dialog .rj-tile.wide .rj-ico img { max-width: 60px; max-height: 60px; }
  html.tel #recap-dialog .rj-tile.wide div:not(.rj-ico), html.tel #recap-dialog .rj-top div:not(.rj-ico) { flex: 1 1 118px; }
  html.tel #recap-dialog .rj-tile.wide b.rj-x, html.tel #recap-dialog .rj-top b.rj-x { font-size: 28px; margin-left: auto; }
  html.tel #recap-dialog .rj-tile.wide b.rj-x:empty { display: none; }
  /* Le sceau reste à droite du bouton, sans le recouvrir */
  html.tel #recap-dialog .rj-foot .btn { min-width: 160px; font-size: 22px; }
  html.tel #recap-dialog .rj-seal { right: 6px; bottom: 20px; width: 62px; height: 62px; }
}

/* Onglet Héros, vue « Arène » : boutons des sets retirés (au lieu d'une place vide) ; les boutons Set 1 / Set 2 / Arène ne bougent pas */
html.tel .hero-sets.ar-view .hero-all, html.tel .hero-sets.ar-view .hero-set-fill { display: none; }

/* Recherche dans les recettes : pleine largeur au-dessus des icônes de catégories */
html.tel .rec-search { display: flex; width: 100%; height: 36px; margin: 0 0 8px; }
