/* Accueil sur un seul écran (home-hub.js, docs/HOME_HUB.md) et écran titre assorti.
   Palette de la maquette : papier crème, encre marine, planche en bois, orange pour l'action principale,
   Corail (rouge) et Azur (bleu) pour les camps. */
:root{--hub-paper:#fdf6e4;--hub-paper-2:#efe3c4;--hub-ink:#22385a;--hub-ink-soft:#4b5a73;--hub-coral:#d9452f;--hub-azure:#2f6fd6;--hub-azure-edge:#163a72;--hub-orange-hi:#f39a4a;--hub-orange-lo:#e0662d;--hub-orange-edge:#7e3420;--hub-wood-hi:#c8945c;--hub-wood-lo:#a8743f}

/* Vues de l'accueil : « hub » (menu principal) ou « operations » (operations.js). Les cartes d'origine restent
   dans la page, masquées : elles portent les textes, les aperçus et les boutons de lancement. */
.home-screen[data-view=hub] .home-shell>:not(#home-hub,#retry-assets){display:none!important}
.home-screen[data-view=operations] .home-shell>:not(#operations,#retry-assets){display:none!important}
.home-screen:not([data-view=operations]) #operations{display:none}

/* Fond ensoleillé de l'écran titre, voile crème côté menu pour la lisibilité. */
body.hub-view{background:linear-gradient(90deg,#0000 28%,#fdf6e488 60%,#fdf6e4ee 76%),url(assets/brand/title-intro-poster-v2.jpg) center 32%/cover fixed}
body:is(.hub-view,.ops-view){min-height:100dvh}
body:is(.hub-view,.ops-view) .home-screen{background:none;min-height:0;padding-bottom:0}
body:is(.hub-view,.ops-view) .topbar{justify-content:flex-end;background:none;border:0;box-shadow:none}
body:is(.hub-view,.ops-view) .topbar :is(.logo,#editor-top){display:none!important}
.topbar>:is(.hub-brand,.ops-head){display:none}

.home-hub{display:grid;grid-template-columns:minmax(0,1fr) minmax(340px,420px);gap:clamp(20px,3vw,40px);align-items:center;min-height:calc(100dvh - 120px);padding:8px clamp(12px,2vw,28px) 24px;box-sizing:border-box;color:var(--hub-ink);font-family:var(--font-ui)}
.hub-board{padding:clamp(10px,1.4vw,18px);border-radius:18px;background:linear-gradient(var(--hub-wood-hi),var(--hub-wood-lo));box-shadow:0 18px 40px #3b271a66,inset 0 2px 0 #e2b47e;transform:rotate(-1.2deg)}
.hub-frame{position:relative;overflow:hidden;border:3px solid #fbf3df;border-radius:8px;box-shadow:0 2px 0 #6b4a2a;background:#5d8f3a}
.hub-frame canvas{display:block;width:100%;height:auto;aspect-ratio:16/9;image-rendering:pixelated}
.hub-badge{position:absolute;top:12px;left:12px;max-width:calc(100% - 24px);padding:7px 14px;border:2px solid var(--hub-ink);border-radius:999px;background:var(--hub-paper);font:800 16px/1 var(--font-heading);letter-spacing:.02em;text-transform:uppercase;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box}
.hub-badge:empty{display:none}

.hub-menu{display:flex;flex-direction:column;gap:14px;min-width:0}
.hub-brand{margin-bottom:6px}
.hub-brand h1{margin:0;font:800 clamp(46px,5vw,68px)/.9 var(--font-heading);letter-spacing:.01em;text-transform:uppercase;color:var(--hub-ink)}
.hub-brand h1 span:first-child{color:var(--hub-ink)}.hub-brand h1 span:last-child{color:var(--hub-coral)}
.hub-brand p{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:8px 0 0;font:700 13px/1 var(--font-ui);letter-spacing:.2em;text-transform:uppercase;color:var(--hub-ink-soft)}

.hub-btn{display:flex;align-items:center;gap:14px;width:100%;min-height:60px;margin:0;padding:0 18px;border:2px solid var(--hub-ink);border-radius:14px;background:var(--hub-paper);box-shadow:0 5px 0 var(--hub-ink);color:var(--hub-ink);text-align:left;cursor:pointer;box-sizing:border-box}
.hub-btn svg{flex:none}
.hub-btn b{font:800 27px/1 var(--font-heading);letter-spacing:.02em;text-transform:uppercase}
.hub-hint{margin-left:auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:700 12px/1 var(--font-ui);font-style:normal;letter-spacing:.06em;text-transform:uppercase;color:#5d667a}
.hub-btn.hub-primary{border-color:var(--hub-azure-edge);background:var(--hub-azure);box-shadow:0 5px 0 var(--hub-azure-edge);color:#fff}
.hub-btn.hub-primary .hub-hint{color:#fff}
.hub-btn:active:not(:disabled){transform:translateY(3px);box-shadow:0 2px 0 var(--hub-ink)}
.hub-btn.hub-primary:active:not(:disabled){box-shadow:0 2px 0 var(--hub-azure-edge)}
.hub-btn:disabled{opacity:.6;cursor:wait}
.hub-btn[hidden]{display:none}
.hub-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:6px}
.hub-tool{display:flex;align-items:center;justify-content:center;min-height:46px;margin:0;padding:6px 10px;border:2px solid var(--hub-ink);border-radius:12px;background:var(--hub-paper);box-shadow:0 3px 0 var(--hub-ink);color:var(--hub-ink);font:700 14px/1.15 var(--font-ui);text-align:center;text-decoration:none;cursor:pointer;box-sizing:border-box}
.hub-tool:active{transform:translateY(2px);box-shadow:0 1px 0 var(--hub-ink)}
.hub-links .hub-tool[data-target=home-battles]{grid-column:1/-1}
.hub-progression{margin-top:0}
.hub-progression .hub-tool{gap:8px;background:var(--hub-paper-2)}
.hub-progress-count{padding:3px 6px;border-radius:999px;background:var(--hub-ink);color:var(--hub-paper);font-size:11px;white-space:nowrap}
.hub-progress-count:empty{display:none}
:is(.hub-btn,.hub-tool):focus-visible{outline:3px solid var(--hub-orange-lo);outline-offset:3px}

/* Entrée brève des menus, sans modifier leurs dimensions ni attendre pour interagir. */
@media(prefers-reduced-motion:no-preference){
 .hub-view :is(.hub-board,.hub-btn,.hub-tools),
 .ops-view .ops-board,
 :is(#challenges-dialog,#achievements-dialog)[open]{animation:hub-arrive 180ms ease-out}
 @keyframes hub-arrive{
  from{opacity:.65;translate:0 4px}
  to{translate:0 0}
 }
}

/* Grand écran : le menu prend une vraie colonne (plus large, titre et boutons plus grands) au lieu d'un petit
   bloc centré ; la carte garde le reste. */
@media(min-width:1280px) and (min-height:700px){
 .home-hub{grid-template-columns:minmax(0,1fr) clamp(440px,31vw,580px);gap:clamp(28px,3.4vw,56px)}
 .hub-menu{gap:16px}
 .hub-brand h1{font-size:clamp(68px,5.6vw,96px)}
 .hub-brand p{font-size:15px}
 .hub-btn{min-height:74px;padding:0 24px;border-radius:16px}.hub-btn b{font-size:34px}.hub-btn svg{width:30px;height:30px}
 .hub-hint{font-size:14px}
 .hub-tools{gap:12px}.hub-tool{min-height:56px;font-size:16px}
}
@media(prefers-reduced-motion:reduce){.hub-btn:active,.hub-tool:active{transform:none}}

/* Ordinateur : une hiérarchie lisible. Titre sur une ligne ; Continuer et Opérations en tête ;
   Défis et Succès juste dessous ; les ressources (atelier, aide, encyclopédie, manuel) regroupées après un filet ;
   Réglages en bouton secondaire, à sa place en fin de menu plutôt qu'à la taille d'Opérations. */
@media(min-width:1101px) and (min-height:521px){
 .hub-brand h1{white-space:nowrap;font-size:clamp(56px,5vw,96px)}
 .hub-menu{max-width:580px}
 .hub-tools:not(.hub-progression){margin-top:6px;padding-top:18px;border-top:2px dashed #22385a33}
 .hub-btn.hub-settings{min-height:56px;padding:0 18px;border-radius:12px;box-shadow:0 3px 0 var(--hub-ink);justify-content:center;gap:10px}
 .hub-btn.hub-settings b{font:700 16px/1 var(--font-ui);letter-spacing:0;text-transform:none}
 .hub-btn.hub-settings svg{width:20px;height:20px}
}

/* Tablette portrait : une colonne centrée (marque, grande carte postale, menu) au lieu de deux colonnes tassées
   à mi-hauteur, avec une carte postale de 250 px et un grand vide au-dessus. */
@media(min-width:761px) and (max-width:1100px) and (orientation:portrait) and (min-height:900px){
 body.hub-view{background:linear-gradient(180deg,#fdf6e4cc 0%,#fdf6e444 24%,#fdf6e4cc 50%,#fdf6e4f2 68%),url(assets/brand/title-intro-poster-v2.jpg) 62% 30%/cover fixed}
 .home-hub{display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:16px;width:min(100%,640px);margin:0 auto;min-height:calc(100dvh - 120px)}
 .hub-menu{display:contents}
 .hub-brand{order:-2;margin:0;text-align:center}.hub-brand p{justify-content:center}
 .hub-board{order:-1;margin:0 8px 8px}
 .hub-btn{min-height:68px}.hub-btn b{font-size:30px}
 .hub-tool{min-height:52px;font-size:15px}
}

/* Téléphone portrait : marque et commandes sur une ligne, sous la zone caméra. */
@media(max-width:760px) and (orientation:portrait){
 /* Android can report a zero safe-area inset in fullscreen despite a central camera hole.
    The body already reserves its inset: top up to 32px, or add 8px for larger camera areas. */
 body.home-mode:is(.hub-view,.ops-view) .topbar{align-items:flex-start;height:auto;min-height:0;padding:max(8px,calc(32px - env(safe-area-inset-top,0px))) max(10px,env(safe-area-inset-right,0px)) 10px max(10px,env(safe-area-inset-left,0px));gap:12px}
 body.hub-view .topbar>.hub-brand{display:block;flex:1;min-width:0;margin:0;container-type:inline-size}
 body.hub-view .topbar>.hub-brand h1{display:flex;align-items:center;gap:.18em;min-height:44px;font-size:clamp(16px,calc((100vw - 192px) / 7.6),34px);font-size:clamp(14px,12.6cqi,34px);line-height:1;white-space:nowrap}
 body.hub-view .topbar>.hub-brand p{font-size:8.5px;letter-spacing:.1em;gap:5px;margin-top:6px;line-height:1.2}
 body.hub-view{background:linear-gradient(180deg,#fdf6e4d0 0%,#fdf6e455 26%,#fdf6e4cc 48%,#fdf6e4f2 66%),url(assets/brand/title-intro-poster-v2.jpg) 62% 30%/cover fixed}
 .home-hub{grid-template-columns:minmax(0,1fr);gap:14px;align-items:start;min-height:0;padding:0 2px 18px}
 .hub-menu{display:contents}
 .hub-brand{order:-2;margin:0}.hub-board{order:-1;margin:2px 4px 6px;padding:8px}
 .hub-brand h1{font-size:40px}
 .hub-btn{min-height:56px}.hub-btn b{font-size:24px}
 /* Le bloc (carte, boutons, outils) est centré sous la barre, avec un vrai
    écart entre la carte et les boutons ; plus de grand vide sous la carte ni de boutons tassés contre le bas. */
 .home-hub{display:flex;flex-direction:column;align-items:stretch;justify-content:center;min-height:calc(100dvh - 128px);padding-bottom:max(18px,env(safe-area-inset-bottom))}
 .hub-board{margin-bottom:clamp(12px,calc(6vh - 20px),44px)}
 .hub-tools{margin-top:4px}
 .hub-frame canvas{aspect-ratio:4/3;object-fit:cover}
}
/* Téléphone paysage : carte à gauche, menu compact à droite, sans les outils (accessibles par la barre du haut). */
@media(max-height:520px) and (orientation:landscape){
 body:is(.hub-view,.ops-view) .topbar{position:fixed;top:0;right:0;left:auto;z-index:5;min-height:0;width:auto;padding:8px 10px}
 body:is(.hub-view,.ops-view) .topbar .nav-label{display:none}
 body:is(.hub-view,.ops-view) .home-screen{padding-top:0;padding-bottom:0}
 /* Exactement la hauteur de l'écran : rien à faire défiler (chaque colonne d'Opérations défile seule). */
 html:has(body.home-mode:is(.hub-view,.ops-view)),body.home-mode:is(.hub-view,.ops-view){overflow:hidden}
 .home-hub{grid-template-columns:minmax(0,1fr) minmax(250px,290px);gap:14px;height:100dvh;min-height:0;padding:8px}
 .hub-menu{padding:52px 4px 8px;align-self:start;max-height:calc(100dvh - 16px);box-sizing:border-box;overflow-y:auto}
 .hub-menu>*{flex-shrink:0}
 .hub-board{justify-self:center;padding:8px}
 .hub-frame canvas{width:auto;max-width:100%;max-height:calc(100dvh - 48px)}
 .hub-menu{gap:8px}.hub-brand{display:none}
 .hub-btn{min-height:46px;box-shadow:0 3px 0 var(--hub-ink)}.hub-btn.hub-primary{box-shadow:0 3px 0 var(--hub-azure-edge)}.hub-btn b{font-size:21px}.hub-btn svg{width:20px;height:20px}
 .hub-tools{gap:6px;margin-top:2px}.hub-tool{min-height:45px;font-size:12px}
}

/* Menu allégé : deux grandes entrées (Continuer, Opérations), une rangée de progression (Défis, Succès, Mes batailles),
   puis les ressources et les réglages en liens discrets, sans cadre ni ombre. Avant : neuf boutons encadrés de même
   poids. */
.hub-progression{grid-template-columns:repeat(3,minmax(0,1fr))}
.hub-progression .hub-tool{padding:6px;grid-column:auto}
.hub-links{gap:2px 12px}
.hub-links .hub-tool,.hub-menu .hub-btn.hub-settings{min-height:46px;padding:4px 8px;border:0;border-radius:10px;background:transparent;box-shadow:none;color:var(--hub-ink);font:700 15px/1.2 var(--font-ui);letter-spacing:0;text-transform:none;text-decoration:none}
@media(hover:hover){.hub-links .hub-tool:hover,.hub-menu .hub-btn.hub-settings:hover{background:#22385a14;text-decoration:underline;text-underline-offset:3px}}
.hub-links .hub-tool:active,.hub-menu .hub-btn.hub-settings:active{transform:none}
.hub-menu .hub-btn.hub-settings{justify-content:center;gap:8px;margin-top:0}
.hub-menu .hub-btn.hub-settings b{font:inherit;letter-spacing:0;text-transform:none}
.hub-menu .hub-btn.hub-settings svg{width:18px;height:18px}
@media(min-width:1101px) and (min-height:521px){
 .hub-tools.hub-links{margin-top:4px;padding-top:12px}
 .hub-links .hub-tool,.hub-menu .hub-btn.hub-settings{min-height:46px;font-size:16px}
}

/* ===== Accueil v2 : « dossier de campagne » ==========================================================
   L'illustration occupe tout l'écran ; le menu devient un panneau encre posé à droite (en bas sur téléphone),
   avec une seule action orange (Continuer, ou Opérations sans partie en cours), Opérations en papier, une rangée
   de trois tuiles à icône (Défis, Succès, Mes batailles), puis les ressources en liens clairs. */
body.hub-view:has(.hub-v2){background:linear-gradient(90deg,#0000 45%,#0e1a2c55 100%),url(assets/brand/title-intro-poster-v2.jpg) 30% 32%/cover fixed}
body.hub-view .hub-v2{--v2-panel:#1f3352;--v2-panel-2:#2b4569;--v2-line:#fdf6e42e;--v2-text:#fdf6e4;--v2-soft:#fdf6e4bf;--v2-gold:#f6d77a}
body.hub-view .hub-v2 .hub-menu{display:flex;flex-direction:column;gap:12px;box-sizing:border-box;padding:28px;border:2px solid #0f1c30;border-radius:24px;background:linear-gradient(160deg,var(--v2-panel-2),var(--v2-panel) 46%);box-shadow:0 6px 0 #0f1c30,0 30px 60px #0b152466;color:var(--v2-text)}
body.hub-view .hub-v2 .hub-brand{margin:0 0 6px}
body.hub-view .hub-v2 .hub-brand h1{color:var(--v2-text);white-space:nowrap}
body.hub-view .hub-v2 .hub-brand h1 span:first-child{color:var(--v2-text)}
body.hub-view .hub-v2 .hub-brand h1 span:last-child{color:#ff8a5c}
body.hub-view .hub-v2 .hub-brand p{color:var(--v2-soft)}
/* Grandes entrées. */
body.hub-view .hub-v2 .hub-btn:not(.hub-settings){min-height:68px;border:2px solid #0f1c30;border-radius:16px;background:var(--hub-paper);box-shadow:0 4px 0 #0f1c30;color:var(--hub-ink)}
body.hub-view .hub-v2 .hub-btn:not(.hub-settings) .hub-hint{color:#4b5a73}
body.hub-view .hub-v2 .hub-btn.hub-primary{border-color:var(--hub-orange-edge);background:linear-gradient(var(--hub-orange-hi),var(--hub-orange-lo));box-shadow:0 5px 0 var(--hub-orange-edge);color:var(--cc-ink)}
body.hub-view .hub-v2 .hub-btn.hub-primary .hub-hint{color:inherit}
body.hub-view .hub-v2 .hub-btn:active:not(:disabled){transform:translateY(3px);box-shadow:0 1px 0 #0f1c30}
/* Tuiles de progression. */
body.hub-view .hub-v2 .hub-progression{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:4px 0 0;padding:0;border:0}
body.hub-view .hub-v2 .hub-tile{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:78px;padding:10px 6px;border:2px solid #3d5a86;border-radius:14px;background:#2a4366;box-shadow:0 3px 0 #0f1c30;color:var(--v2-text);font:700 15px/1.15 var(--font-ui)}
body.hub-view .hub-v2 .hub-tile .hub-tile-icon{color:var(--v2-gold)}
body.hub-view .hub-v2 .hub-tile .hub-progress-count{position:absolute;top:6px;right:6px;padding:2px 6px;border-radius:999px;background:var(--v2-gold);color:#22385a;font:800 11px/1.2 var(--font-ui)}
@media(hover:hover){body.hub-view .hub-v2 .hub-tile:hover{background:#34507a;border-color:#5876a6}}
body.hub-view .hub-v2 .hub-tile:active{transform:translateY(2px);box-shadow:0 1px 0 #0f1c30}
/* Ressources et réglages : liens clairs, alignés à gauche, sous un filet. */
body.hub-view .hub-v2 .hub-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px;margin:6px 0 0;padding:10px 0 0;border:0;border-top:1px solid var(--v2-line)}
body.hub-view .hub-v2 .hub-links .hub-tool,body.hub-view .hub-v2 .hub-btn.hub-settings{justify-content:flex-start;min-height:46px;padding:4px 6px;border:0;border-radius:10px;background:transparent;box-shadow:none;color:var(--v2-text);font:600 15px/1.2 var(--font-ui);text-align:left;text-transform:none;letter-spacing:0}
body.hub-view .hub-v2 .hub-btn.hub-settings{width:auto;align-self:flex-start;gap:8px;margin:-8px 0 0}
body.hub-view .hub-v2 .hub-btn.hub-settings svg{color:var(--v2-gold)}
@media(hover:hover){body.hub-view .hub-v2 .hub-links .hub-tool:hover,body.hub-view .hub-v2 .hub-btn.hub-settings:hover{background:#fdf6e414;text-decoration:underline;text-underline-offset:3px}}
body.hub-view .hub-v2 :is(.hub-btn,.hub-tool):focus-visible{outline:3px solid var(--v2-gold);outline-offset:3px}
/* La carte postale, posée sur l'illustration. */
body.hub-view .hub-v2 .hub-board{transform:rotate(-2deg);box-shadow:0 24px 50px #0b152466,inset 0 2px 0 #e2b47e}

/* Ordinateur. */
@media(min-width:1101px) and (min-height:521px){
 body.hub-view .hub-v2{grid-template-columns:minmax(0,1fr) clamp(420px,32vw,520px);gap:clamp(32px,5vw,96px);padding:0 clamp(24px,4vw,72px) 32px;align-items:center}
 body.hub-view .hub-v2 .hub-board{max-width:720px;justify-self:center;width:100%}
 body.hub-view .hub-v2 .hub-menu{max-width:none;padding:32px 32px 24px}
 body.hub-view .hub-v2 .hub-brand h1{font-size:clamp(52px,4.2vw,76px)}
 body.hub-view .hub-v2 .hub-btn:not(.hub-settings){min-height:72px}
 body.hub-view .hub-v2 .hub-btn:not(.hub-settings) b{font-size:clamp(28px,2.2vw,34px)}
}
/* Tablette portrait et téléphone portrait : la carte postale en haut, le panneau dessous. */
@media(max-width:1100px) and (orientation:portrait){
 body.hub-view:has(.hub-v2){background:linear-gradient(180deg,#0000 30%,#0e1a2c66 100%),url(assets/brand/title-intro-poster-v2.jpg) 62% 30%/cover fixed}
 body.hub-view .hub-v2{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-end;gap:18px;width:min(100%,640px);margin:0 auto}
 body.hub-view .hub-v2 .hub-board{order:0;margin:0 10px}
 body.hub-view .hub-v2 .hub-menu{order:1;display:flex;padding:20px 18px 18px}
}
@media(max-width:760px) and (orientation:portrait){
 body.hub-view .hub-v2{gap:14px;padding:0 0 max(10px,env(safe-area-inset-bottom))}
 body.hub-view .hub-v2 .hub-menu{gap:10px;border-radius:22px;padding:16px 14px 12px}
 body.hub-view .hub-v2 .hub-brand{display:none}
 body.hub-view .hub-v2 .hub-btn:not(.hub-settings){min-height:58px}
 body.hub-view .hub-v2 .hub-btn:not(.hub-settings) b{font-size:24px}
 body.hub-view .hub-v2 .hub-progression{gap:8px}
 body.hub-view .hub-v2 .hub-tile{min-height:68px;font-size:13px}
 body.hub-view .hub-v2 .hub-btn .hub-hint{font-size:10px;letter-spacing:.04em}
 body.hub-view .hub-v2 .hub-links .hub-tool,body.hub-view .hub-v2 .hub-btn.hub-settings{font-size:14px}
 body.hub-view .topbar>.hub-brand h1 span:first-child{color:var(--hub-ink)}
}
/* Paysage bas : panneau à droite, défilant si besoin. */
@media(max-height:520px) and (orientation:landscape){
 body.hub-view .hub-v2 .hub-menu{padding:52px 12px 10px;border-radius:18px;gap:8px}
 body.hub-view .hub-v2 .hub-btn:not(.hub-settings){min-height:48px}
 body.hub-view .hub-v2 .hub-btn:not(.hub-settings) b{font-size:20px}
 body.hub-view .hub-v2 .hub-tile{min-height:52px;gap:2px;font-size:11px}
 body.hub-view .hub-v2 .hub-tile .hub-tile-icon{width:18px;height:18px}
 body.hub-view .hub-v2 .hub-links .hub-tool,body.hub-view .hub-v2 .hub-btn.hub-settings{font-size:12px}
}
@media(prefers-reduced-motion:reduce){body.hub-view .hub-v2 :is(.hub-btn,.hub-tile):active{transform:none}}

/* Commandes du haut sur l'accueil et les Opérations : Réglages (pignon), Son, Plein écran, en papier crème comme
   le reste des menus, icônes orange. Réglages quitte le panneau pour rejoindre ces commandes. */
#hub-settings{display:none}
body.home-mode:is(.hub-view,.ops-view) .topbar .top-right #hub-settings{display:inline-flex;order:-1}
body.home-mode:is(.hub-view,.ops-view) .topbar .top-right :is(#hub-settings,#sound,#fullscreen-toggle){display:inline-flex;align-items:center;justify-content:center;gap:8px;height:46px;min-height:46px;min-width:46px;margin:0;padding:0 14px;border:2px solid var(--hub-ink);border-radius:12px;background:var(--hub-paper);box-shadow:0 3px 0 var(--hub-ink);color:var(--hub-ink);font:700 14px/1 var(--font-ui);cursor:pointer}
body.home-mode:is(.hub-view,.ops-view) .topbar .top-right #fullscreen-toggle[hidden]{display:none}
body.home-mode:is(.hub-view,.ops-view) .topbar .top-right :is(#hub-settings,#sound,#fullscreen-toggle):active{transform:translateY(2px);box-shadow:0 1px 0 var(--hub-ink)}
@media(hover:hover){body.home-mode:is(.hub-view,.ops-view) .topbar .top-right :is(#hub-settings,#sound,#fullscreen-toggle):hover{background:#fffaf0}}
body.home-mode:is(.hub-view,.ops-view) .topbar .top-right #hub-settings .cog-icon{color:#d0562a}
body.home-mode:is(.hub-view,.ops-view) .topbar .top-right .nav-icon{background:#d0562a!important;-webkit-mask:var(--nav-mask) center/contain no-repeat;mask:var(--nav-mask) center/contain no-repeat}
.nav-sound{--nav-mask:url('assets/ui/nav-sound.svg')}.nav-muted{--nav-mask:url('assets/ui/nav-muted.svg')}.nav-fullscreen{--nav-mask:url('assets/ui/nav-fullscreen.svg')}.nav-windowed{--nav-mask:url('assets/ui/nav-windowed.svg')}
@media(max-width:760px) and (orientation:portrait),(max-height:520px) and (orientation:landscape){
 body.home-mode:is(.hub-view,.ops-view) .topbar .top-right :is(#hub-settings,#sound,#fullscreen-toggle){width:44px;height:44px;min-height:44px;min-width:44px;padding:0}
 body.home-mode:is(.hub-view,.ops-view) .topbar .top-right :is(#hub-settings,#sound,#fullscreen-toggle) .nav-label{display:none}
}

/* Panneau : Atelier de cartes, puis une seule entrée « Aide » : Comment jouer, qui mène à l'Encyclopédie et au
   Manuel de terrain (docs/AUDIT_SIMPLICITE_2026-11-21.md, point 4). */
body.hub-view .hub-v2 .hub-links{grid-template-columns:minmax(0,1fr);gap:8px}
body.hub-view .hub-v2 .hub-links .hub-help{justify-content:center;gap:8px;border:1.5px solid #22385a33;border-radius:14px;background:#fdf6e4;font-weight:700}
body.hub-view .hub-v2 .hub-help .hub-tile-icon{flex:none;color:#d0562a}
body.hub-view .hub-v2 .hub-links>a.hub-tool{justify-content:flex-start;gap:8px}

/* Mode sombre forcé (Samsung Internet et d'autres) : la page déclare son propre rendu pour le thème sombre, qui garde
   la palette crème et chaude des menus. Ces navigateurs n'appliquent alors pas leur assombrissement automatique. */
@media(prefers-color-scheme:dark){
 :root{color-scheme:only light;--hub-paper:#fdf6e4;--hub-paper-2:#efe3c4;--hub-ink:#22385a}
 html,body{background-color:#14293a}
}
/* Narrow phones: three icon buttons share the header with the brand. */
/* Cream menu panel, same paper as the rest of the game. */
body.hub-view .hub-v2{--v2-panel:#fdf6e4;--v2-panel-2:#f6ead0;--v2-line:#22385a26;--v2-text:#22385a;--v2-soft:#4b5a73;--v2-gold:#a8611c}
body.hub-view .hub-v2 .hub-menu{border-color:#22385a;box-shadow:0 6px 0 #22385a,0 18px 40px #0b152455}
body.hub-view .hub-v2 .hub-brand h1 span:last-child{color:var(--hub-coral)}
body.hub-view .hub-v2 .hub-tile{border-color:#22385a;background:#efe3c4;box-shadow:0 3px 0 #22385a;color:#22385a}
body.hub-view .hub-v2 .hub-tile .hub-tile-icon{color:#d0562a}
body.hub-view .hub-v2 .hub-tile .hub-progress-count{background:#f6d77a;box-shadow:0 0 0 1.5px #22385a}
@media(hover:hover){body.hub-view .hub-v2 .hub-tile:hover{background:#f6ead0;border-color:#22385a}}
body.hub-view .hub-v2 .hub-tile:active{box-shadow:0 1px 0 #22385a}
@media(hover:hover){body.hub-view .hub-v2 .hub-links .hub-tool:hover{background:#22385a0f}}
body.hub-view .hub-v2 :is(.hub-btn,.hub-tool):focus-visible{outline-color:#d0562a}
/* Map workshop: a drafting sheet with a grid, like a map in progress. */
body.hub-view .hub-v2 .hub-links>a.hub-workshop{position:relative;display:flex;align-items:center;justify-content:flex-start;gap:12px;min-height:60px;padding:8px 14px;border:2px dashed #22385a8c;border-radius:14px;background:linear-gradient(#22385a12 1px,#0000 1px) 0 0/14px 14px,linear-gradient(90deg,#22385a12 1px,#0000 1px) 0 0/14px 14px,#f3e6c8;color:#22385a;text-decoration:none}
body.hub-view .hub-v2 .hub-workshop-icon{flex:none;color:#3f7a3a}
body.hub-view .hub-v2 .hub-workshop-text{display:flex;flex-direction:column;gap:3px;min-width:0}
body.hub-view .hub-v2 .hub-workshop-text b{font:800 17px/1 var(--font-heading);letter-spacing:.02em;text-transform:uppercase}
body.hub-view .hub-v2 .hub-workshop-text small{font:500 12.5px/1.2 var(--font-ui);color:#4b5a73}
body.hub-view .hub-v2 .hub-links>a.hub-workshop::after{content:"";margin-left:auto;flex:none;width:9px;height:9px;border-top:2.5px solid currentColor;border-right:2.5px solid currentColor;transform:rotate(45deg)}
@media(hover:hover){body.hub-view .hub-v2 .hub-links>a.hub-workshop:hover{border-style:solid;background-color:#f6ead0;text-decoration:none}}
@media(max-height:520px) and (orientation:landscape){body.hub-view .hub-v2 .hub-links>a.hub-workshop{min-height:46px;padding:4px 12px}body.hub-view .hub-v2 .hub-workshop-text small{display:none}}
/* Téléphone portrait assez haut : la carte postale et le panneau se répartissent dans la hauteur au lieu de se tasser
   en bas sous un grand ciel vide ; le panneau respire un peu plus. */
@media(max-width:760px) and (orientation:portrait) and (min-height:700px){body.hub-view .hub-v2{justify-content:space-evenly}}
@media(max-width:760px) and (orientation:portrait) and (min-height:820px){
 body.hub-view .hub-v2{gap:22px}
 body.hub-view .hub-v2 .hub-menu{gap:14px;padding:20px 16px 16px}
 body.hub-view .hub-v2 .hub-progression{gap:10px}
 body.hub-view .hub-v2 .hub-links{gap:12px;padding-top:14px}
}

/* Brand title: keep both English words visible instead of clipping on phones. */
.hub-brand h1.odd-title{font-size:clamp(38px,4.6vw,64px);line-height:.95}
.hub-brand h1.odd-title span{display:block}
@media(max-width:480px){.hub-brand h1.odd-title{font-size:clamp(36px,9vw,48px)}}
/* 21 novembre 2026 : titres des boutons principaux sur une seule ligne ; c'est l'indication de droite qui se réduit. */
.hub-btn b{flex:0 0 auto;white-space:nowrap}
.hub-btn .hub-hint{flex:1 1 0;text-align:right}
/* Progression (23 novembre 2026) : une seule tuile sur l'accueil, puis trois cartes dans une petite fenêtre. */
body.hub-view .hub-v2 .hub-progression{grid-template-columns:minmax(0,1fr)}
body.hub-view .hub-v2 .hub-progression .hub-tile{flex-direction:row;min-height:56px}
#progression .progression-grid{display:grid;gap:10px}
#progression .progression-card{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;column-gap:12px;row-gap:2px;min-height:64px;padding:10px 14px;border:2px solid #22385a;border-radius:14px;background:#efe3c4;box-shadow:0 3px 0 #22385a;color:#22385a;font:700 17px/1.1 var(--font-ui);text-align:left;cursor:pointer}
#progression .progression-card>.hub-tile-icon{grid-row:1/3;color:#d0562a}
#progression .progression-card>.progression-hint{grid-column:2;font:500 13px/1.25 var(--font-ui);color:#4b5a73}
#progression .progression-card>.progression-hint:empty{display:none}
@media(hover:hover){#progression .progression-card:hover{background:#f6ead0}}
#progression .progression-card:active{transform:translateY(2px);box-shadow:0 1px 0 #22385a}
#progression .progression-card:focus-visible{outline:3px solid #d0562a;outline-offset:2px}
@media(prefers-reduced-motion:reduce){#progression .progression-card:active{transform:none}}
