/* Menu du camp regroupé (5/11/2026, lot I3, tâches 7 et 15 du rapport « prise en main et beauté », parties 1.6, 3.1 et 3.7).
   Ordinateur : un cadre plus étroit à droite (le village reste visible), un gros bouton « Partir en expédition », 4 raccourcis,
   la rubrique du lieu, puis « Plus… » qui déplie le reste. Téléphone : une grille d'icônes, tout d'un coup d'œil, sans défiler.
   Manette et clavier : le curseur ▶ doré de la ROM devant le bouton choisi, et un cadre doré qui clignote doucement. */

/* ---------- Ordinateur : le cadre à droite ---------- */
body:not(.is-touch) .screen.hubwrap { left: auto; right: 12px; top: 60px; width: 316px; transform-origin: 100% 0;
  max-height: calc((100vh - 72px) / var(--ui, 1)); }
@media (max-width: 760px) { body:not(.is-touch) .screen.hubwrap { width: 280px; } }
/* 6/11 : son Pokémon passe sous le cadre (caméra bornée au bord du Bourg) : le cadre s'efface presque, sauf sous la souris
   ou quand un bouton a le curseur de la manette */
body:not(.is-touch) .screen.hubwrap { transition: opacity .25s; }
body:not(.is-touch) .screen.hubwrap.cm-dessous:not(:hover):not(:focus-within):not(:has(.focus)) { opacity: .28; }
/* Ma maison : on y arrive par la droite (la sortie vers le Bourg), le cadre se met donc à gauche */
body:not(.is-touch) .screen.hubwrap.cm-gauche { left: 12px; right: auto; top: 12px; transform-origin: 0 0; max-height: calc((100vh - 24px) / var(--ui, 1)); }
/* 6/11 soir (Kiko) : le menu suit le côté libre (camp.js, menuCote) ; il glisse d'un côté à l'autre par une animation de
   « translate ». Lieu de Guilde : le menu et les membres présents échangent leur place. Téléphone couché, menu ouvert : à droite. */
body:not(.is-touch) .screen.lobbyduo.cm-inverse .lobby-duo { flex-direction: row-reverse; }
body.is-touch.menu-ouvert .screen.hubwrap.cm-droite, body.is-touch.menu-ouvert .lobby-duo > .hub-mini.cm-droite { left: auto; right: max(8px, env(safe-area-inset-right)); }

.hub-mini .cm { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.hub-mini .cm .menu-t { margin: 6px 0 0 4px; font-size: 16px; color: var(--dim); text-transform: uppercase; letter-spacing: 1px; }

/* Le gros bouton pour partir : cadre doré, un reflet qui passe de temps en temps */
.hub-mini .cm .cm-partir { width: 100%; justify-content: center; gap: 10px; min-height: 58px; padding: 4px 8px 4px 28px; font-size: 24px; color: #ffe27a;
  border: 12px solid transparent; border-image: url('assets/ui/cadres/cadre1_yellow_fin.png') 8 fill / 12px stretch; overflow: hidden; }
.hub-mini .cm .cm-partir::after { content: ''; position: absolute; inset: -12px; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 240, 180, .28) 50%, transparent 60%) no-repeat; background-size: 300% 100%;
  animation: cmReflet 4.5s ease-in-out infinite; }
@keyframes cmReflet { 0%, 70% { background-position: 150% 0; } 100% { background-position: -50% 0; } }
.hub-mini .cm .cm-partir .ico { font-size: 28px; }
.hub-mini .cm .cm-partir:hover, .hub-mini .cm .cm-partir.focus { filter: brightness(1.15); color: #fff3b0; }

/* Les raccourcis : des tuiles bleues de la ROM, deux par ligne */
.hub-mini .cm-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.hub-mini .cm .tuile { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; column-gap: 6px;
  min-height: 44px; margin: 0; padding: 0 2px 0 4px; font-size: 17px; line-height: 1.05; text-align: left;
  border: 8px solid transparent; border-image: url('assets/ui/cadres/cadre1_blue_fin.png') 8 fill / 8px stretch; animation: cmTuile .25s both; }
.hub-mini .cm .tuile::before { display: none; }
.hub-mini .cm .tuile .ico { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; margin: 0; }
.hub-mini .cm .tuile .ico .pxi { --k: 2px; }
.hub-mini .cm .cm-reste .tuile .ico .pxi { --k: 2px; } /* lot I5 : ×2 entier, pas de pixels inégaux */
.hub-mini .cm .tuile .t-txt { display: flex; flex-direction: column; min-width: 0; }
.hub-mini .cm .tuile .t-nom { min-width: 0; }
/* Compteurs du camp : plus petits dans le cadre étroit (4 puces et le Sac sur deux lignes) */
body:not(.is-touch) .hub-mini .wallet { gap: 4px; margin-top: 4px; }
body:not(.is-touch) .hub-mini .wallet .chip { font-size: 15px; padding: 1px 7px; }
body:not(.is-touch) .hub-mini:has(.cm-reste.ouvert) .cm-aide { display: none; }
.hub-mini .cm .tuile:hover, .hub-mini .cm .tuile.focus { color: var(--gold); filter: brightness(1.2); }
.hub-mini .cm .tuile.primary { border-image-source: url('assets/ui/cadres/cadre1_yellow_fin.png'); color: #ffe27a; }
.hub-mini .cm .cm-img { width: 32px; height: 32px; image-rendering: pixelated; }
.hub-mini .cm-grille > .tuile:nth-child(2) { animation-delay: .03s; } .hub-mini .cm-grille > .tuile:nth-child(3) { animation-delay: .06s; }
.hub-mini .cm-grille > .tuile:nth-child(4) { animation-delay: .09s; } .hub-mini .cm-grille > .tuile:nth-child(n+5) { animation-delay: .12s; }
@keyframes cmTuile { from { opacity: 0; transform: translateY(4px); } }

/* « S'ouvre bientôt » : grisé, un petit cadenas, et un refus qui secoue au toucher */
.hub-mini .cm .tuile.bientot { color: #8d97b8; filter: grayscale(.8) brightness(.8); }
.hub-mini .cm .tuile.bientot:hover, .hub-mini .cm .tuile.bientot.focus { color: #c3cae4; filter: grayscale(.6) brightness(.95); }
.hub-mini .cm .tuile .t-bientot { font-size: 14px; color: #aab3d4; letter-spacing: .2px; }
.hub-mini .cm .tuile.bientot .t-bientot::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 3px; vertical-align: -1px;
  background: url('assets/ui/icones/cadenas.png') center / contain no-repeat; image-rendering: pixelated; }
.hub-mini .cm .tuile.refus { animation: cmRefus .32s; }
@keyframes cmRefus { 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

/* Le « ! » doré qui sautille sur ce qui attend le joueur */
.hub-mini .cm .m-alerte { display: inline-block; animation: cmAlerte 1.1s ease-in-out infinite; }
@keyframes cmAlerte { 0%, 60%, 100% { transform: translateY(0); } 75% { transform: translateY(-4px); } }

/* « Plus… » : une ligne qui déplie le reste */
.hub-mini .cm .cm-plus { width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 2px; padding: 4px 6px 4px 24px;
  font-size: 18px; border-top: 1px solid rgba(255, 255, 255, .14); border-radius: 0; }
.hub-mini .cm .cm-plus-l { font-size: 14px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hub-mini .cm .cm-plus[aria-expanded="true"] .cm-plus-l { visibility: hidden; }
.hub-mini .cm .cm-reste { display: none; }
.hub-mini .cm .cm-reste.ouvert { display: grid; animation: cmOuvre .2s ease-out both; }
/* (7/11, Chef) « Plus… » sur 3 colonnes, icône au-dessus du nom : avec le cadeau du jour et le Café Spinda, le menu ouvert
   dépassait d'un écran de 768 px de haut */
body:not(.is-touch) .hub-mini .cm .cm-reste.ouvert { grid-template-columns: repeat(3, 1fr); }
body:not(.is-touch) .hub-mini .cm .cm-reste .tuile { grid-template-columns: 1fr; justify-items: center; text-align: center; row-gap: 1px; padding: 3px 2px; font-size: 14px; line-height: 1.05; }
body:not(.is-touch) .hub-mini .cm .cm-reste .tuile .t-txt { align-items: center; }
.hub-mini .cm .cm-reste .tuile { min-height: 40px; font-size: 16px; }
.hub-mini .cm .cm-reste .tuile .ico { width: 28px; height: 28px; }
@keyframes cmOuvre { from { opacity: 0; transform: translateY(-6px); } }
.hub-mini .cm-aide { line-height: 1.2; }

/* ---------- Téléphone : une grille d'icônes (grosse icône, nom dessous), sans « Plus… » ---------- */
body.is-touch .hub-mini .menu.cm { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 4px; }
body.is-touch .hub-mini .cm .cm-grille { display: contents; }
body.is-touch .hub-mini .cm .cm-partir, body.is-touch .hub-mini .cm .menu-t { grid-column: 1 / -1; }
body.is-touch .hub-mini .cm .cm-partir { min-height: 48px; font-size: 20px; }
body.is-touch .hub-mini .cm .cm-plus { display: none; }
body.is-touch .hub-mini .cm .cm-reste { display: contents; }
body.is-touch .hub-mini .cm .tuile { grid-template-columns: 1fr; justify-items: center; text-align: center; row-gap: 1px; min-height: 60px;
  padding: 2px 2px; font-size: 14px; line-height: 1.05; }
body.is-touch .hub-mini .cm .tuile .ico { width: 32px; height: 32px; font-size: 26px; }
body.is-touch .hub-mini .cm .tuile .ico .pxi { --k: 2px; }
body.is-touch .hub-mini .cm .tuile .t-txt { align-items: center; }
body.is-touch .hub-mini .cm .tuile .t-bientot { font-size: 12px; }
body.is-touch .hub-mini .cm-aide { display: none !important; }
/* Couché : un cadre large et bas (3 rangées de tuiles), les compteurs sur une ligne qui défile */
body.is-touch.menu-ouvert .screen.hubwrap { width: min(620px, calc(100vw - 16px)); }
/* Salon et Guilde : le menu ouvert passe par-dessus le cadre du salon, avec la même place qu'au Bourg */
body.is-touch.menu-ouvert .lobby-duo > .hub-mini { position: fixed; left: max(8px, env(safe-area-inset-left)); top: 56px; z-index: 29;
  width: min(750px, calc(100vw - 16px)); max-height: calc(100vh - 64px); }
body.is-touch.menu-ouvert .hub-mini .wallet { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
body.is-touch.menu-ouvert .hub-mini .wallet::-webkit-scrollbar { display: none; }
body.is-touch.menu-ouvert .hub-mini .wallet > * { flex: none; }
/* (7/11, Chef) Téléphone couché (écran bas) : le cadeau du jour et le Café Spinda ajoutent des tuiles ; 8 par rangée et des
   tuiles un peu moins hautes, pour que tout tienne sans défiler */
@media (orientation: landscape) and (max-height: 500px) {
  body.is-touch .hub-mini .menu.cm { grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 3px; }
  body.is-touch .hub-mini .cm .tuile { min-height: 48px; font-size: 13px; }
  body.is-touch .hub-mini .cm .tuile .ico { width: 26px; height: 26px; font-size: 22px; }
  body.is-touch .hub-mini .cm .tuile .ico .pxi { --k: 1.6px; }
  body.is-touch .hub-mini .cm .cm-partir { min-height: 34px; padding-top: 2px; padding-bottom: 2px; font-size: 18px; }
  body.is-touch.menu-ouvert .hub-mini .wallet .chip, body.is-touch.menu-ouvert .hub-mini .wallet .sac-btn { padding-top: 2px; padding-bottom: 2px; }
  body.is-touch .hub-mini .cm .cm-large { grid-column: auto; }
  body.is-touch.menu-ouvert .screen.hubwrap { width: min(760px, calc(100vw - 16px)); }
  body.is-touch.menu-ouvert .lobby-duo > .hub-mini { top: 48px; max-height: calc(100vh - 54px); }
  body.is-touch.menu-ouvert .hub-mini .portrait { width: 36px !important; height: 36px !important; }
  body.is-touch .hub-mini .cm .tuile .t-bientot { font-size: 11px; white-space: nowrap; }
  body.is-touch.menu-ouvert .lobby-duo > .hub-mini { width: calc(100vw - 16px); }
}
@media (orientation: portrait) {
  body.is-touch.menu-ouvert .screen.hubwrap, body.is-touch.menu-ouvert .lobby-duo > .hub-mini { width: calc(100vw - 16px); max-width: 420px; }
  body.is-touch .hub-mini .menu.cm { grid-template-columns: repeat(3, 1fr); }
  body.is-touch .hub-mini .cm .tuile { min-height: 72px; font-size: 15px; }
}

/* ---------- Curseur de la manette et du clavier (tâche 15) : ▶ doré devant le bouton choisi ---------- */
#pad-curseur { position: fixed; left: 0; top: 0; z-index: 60; width: 18px; height: 33px; pointer-events: none; display: none;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .7)) drop-shadow(0 0 5px rgba(255, 214, 90, .75)); transition: left .09s ease-out, top .09s ease-out; }
#pad-curseur.vu { display: block; }
#pad-curseur i { position: absolute; inset: 0; background: url('assets/ui/curseurs/curseur_dore.svg') center / 100% 100% no-repeat;
  image-rendering: pixelated; animation: padNudge .6s ease-in-out infinite; }
@keyframes padNudge { 50% { transform: translateX(4px); } }
/* (8/11, bug de Louh) Le cadre doré se dessine DANS l'élément choisi : dehors (outline-offset 1px), il était coupé par les
   rangées qui défilent (onglets de la fiche d'un Pokémon : un trait jaune sur un ou deux côtés seulement, à côté du vrai cadre).
   Les boutons à cadre en pixels n'ont pas de trait en plus : c'est leur propre cadre qui passe au doré et clignote. */
body.curseur-pad .focus { outline: 2px solid rgba(255, 214, 90, .95) !important; outline-offset: -2px; animation: padCadre 1.4s ease-in-out infinite; }
body.curseur-pad .btn.focus { outline: none !important; border-image-source: url('assets/ui/cadres/cadre1_yellow_fin.png'); animation: padBtn 1.4s ease-in-out infinite; }
body.curseur-pad .btn.primary.focus { border-image-source: url('assets/ui/cadres/cadre1_or_fin.png'); }
/* boutons sans cadre (lignes de menu, profil) : ils gardent le trait doré, dessiné dedans */
body.curseur-pad .menu .btn.focus, body.curseur-pad .btn.f-prof.focus { outline: 2px solid rgba(255, 214, 90, .95) !important; animation: padCadre 1.4s ease-in-out infinite; }
@keyframes padBtn { 0%, 100% { filter: brightness(1.3); } 50% { filter: brightness(1.02); } }
body.curseur-pad .btn.focus::before { opacity: 0 !important; }
body.curseur-pad .menu .btn.focus, body.curseur-pad .hub-mini .cm .btn.focus { color: var(--gold); }
@keyframes padCadre { 50% { outline-color: rgba(255, 214, 90, .35); } }
body.is-touch .hub-mini .wallet .sac-btn { order: -1; }
/* Téléphone couché (écran bas) : tuiles un peu plus basses pour que tout tienne, même dans le salon */
@media (orientation: landscape) and (max-height: 500px) {
  body.is-touch .hub-mini .cm .cm-partir { min-height: 34px; padding-top: 2px; padding-bottom: 2px; font-size: 18px; }
  body.is-touch.menu-ouvert .hub-mini .wallet .chip, body.is-touch.menu-ouvert .hub-mini .wallet .sac-btn { padding-top: 2px; padding-bottom: 2px; }
  body.is-touch .hub-mini .cm .tuile { min-height: 54px; }
  body.is-touch .hub-mini .cm .tuile .ico { width: 28px; height: 28px; }
}

/* ---------- Curseur libre au stick droit (5/11, demande de Kiko) : une flèche dorée, comme une souris ---------- */
#pad-souris { position: fixed; left: 0; top: 0; z-index: 61; width: 24px; height: 39px; pointer-events: none; display: none; will-change: transform;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .6)) drop-shadow(0 0 4px rgba(255, 214, 90, .6)); }
#pad-souris.vu { display: block; }
#pad-souris i { position: absolute; inset: 0; background: url('assets/ui/curseurs/pointeur_dore.svg') 0 0 / 100% 100% no-repeat; image-rendering: pixelated; transform-origin: 0 0; }
#pad-souris.clic i { animation: sourisClic .18s ease-out; }
@keyframes sourisClic { 40% { transform: scale(.8); filter: brightness(1.6); } }
.survol-pad { filter: brightness(1.25); }
.btn.survol-pad::before { opacity: 1; animation: nudge .6s ease-in-out infinite; }
.menu .btn.survol-pad, .hub-mini .cm .btn.survol-pad { color: var(--gold); }
.dex-cell.survol-pad { border-color: var(--gold); }
/* Avec la flèche, seul le bouton sous elle garde son petit ▶ (pas celui choisi à la croix) */
body.souris-pad .btn.focus:not(.survol-pad)::before { opacity: 0; animation: none; }
/* (13/11) curseurs et cases à cocher choisis à la manette (Réglages, menu Pause en donjon) */
input[type=range].focus, label.focus { outline: 2px solid rgba(255, 214, 90, .95); outline-offset: 3px; border-radius: 2px; }

/* (23/11 soir, Kiko après la bêta) menu du camp repliable : la petite flèche en haut à droite le réduit à son en-tête */
.hub-mini { position: relative; }
.btn.cm-plier { position: absolute; right: 6px; top: 6px; z-index: 3; min-width: 0; height: 24px; padding: 0 6px; display: flex; align-items: center; gap: 5px; }
.hub-mini.cm-replie > :not(.cm-tete):not(.cm-plier) { display: none !important; }
.hub-mini.cm-replie { padding-bottom: 6px; }
/* (29/11, Kiko) dans un salon, LT / la flèche réduisent aussi le panneau du salon (il garde son titre et le code) */
body:not(.is-touch) .lobby-duo:has(> .hub-mini.cm-replie) > .lobby-mini > :not(:first-child) { display: none !important; }
.hub-mini .cm-tete { padding-right: 34px; }
body.is-touch .btn.cm-plier { display: none; }
body.is-touch .hub-mini.cm-replie > :not(.cm-tete):not(.cm-plier) { display: revert !important; }

/* (23/11 nuit) flèche du menu en pixels (plus de caractère), et la gâchette L2 en petite touche de manette à côté */
.cm-fl { display: inline-block; width: 0; height: 0; border-style: solid; border-width: 0 6px 8px 6px; border-color: transparent transparent #ffd35c transparent; }
.cm-fl.bas { border-width: 8px 6px 0 6px; border-color: #ffd35c transparent transparent transparent; }
.cm-l2 { display: none; font-style: normal; font-size: 12px; line-height: 13px; padding: 0 4px 1px; color: #1a1030; background: linear-gradient(#f2f5f9, #c6cfdb); border-radius: 6px 6px 2px 2px;
  box-shadow: 0 0 0 1px #3e4656, 0 2px 0 #636f82, inset 0 1px 0 #fff; }
body.a-la-manette .cm-l2 { display: inline-block; }
.hub-mini .cm-tete { padding-right: 64px; }
