/* Les contrôleurs sont des écrans de jeu : la place est répartie entre le
 * contenu et les commandes, sans colonne qui s'allonge sous le téléphone. */
.lp-html:has(.lp-stage > [class*="-phone"]),
.lp-body:has(.lp-stage > [class*="-phone"]) { height:100%; overflow:hidden; overscroll-behavior:none; }
.lp-phone:has(.lp-stage > [class*="-phone"]) {
  position:fixed; inset:var(--lp-viewport-top,0px) 0 auto;
  width:100%; max-width:none; height:var(--lp-viewport-height,100dvh); min-height:0;
  padding:max(4px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
  gap:6px;
}
.lp-phone:has(.lp-stage > [class*="-phone"]) .lp-me { flex:none; height:44px; padding:0; margin:0; border:0; gap:8px; }
.lp-phone:has(.lp-stage > [class*="-phone"]) .lp-me > .lp-avatar { font-size:.7rem; }
.lp-phone:has(.lp-stage > [class*="-phone"]) .lp-me__id { font-size:12px; line-height:1.2; }
.lp-phone:has(.lp-stage > [class*="-phone"]) .lp-stage { min-height:0; height:100%; container-type:size; }
.lp-phone .lp-stage > [class*="-phone"] { min-height:0; height:100%; padding:0; gap:8px; }
.lp-phone .lp-stage :is(.lp-btn,.fm-choice,.rg-card,.bd-pick,.tt-choice) { min-width:0; overflow-wrap:anywhere; }
.lp-phone .lp-stage .lp-btn { min-height:42px; padding:7px 10px; font-size:14px; }
.lp-phone .lp-stage :is(.fm-main,.rg-main,.gb-main,.tt-side) { min-height:0; gap:8px; }
.lp-phone .lp-stage :is(.fm-title,.rg-title,.gb-title,.tt-title) { margin:0; font-size:18px; line-height:1.15; }
.lp-phone .lp-stage :is(.fm-hint,.rg-hint,.gb-hint,.tt-hint,.bd-foot) { margin:0; font-size:12px; line-height:1.25; }
.lp-phone .lp-stage :is(.fm-crown,.rg-croc,.gb-big,.bd-msg__emoji,.dm-msg__emoji) { font-size:40px; }
.lp-phone .lp-stage :is(.bd-sticky,.gb-sticky,.rg-sticky) { position:static; margin:0; padding:0; background:none; gap:3px; }
.lp-phone .lp-stage :is(.bd-msg,.dm-msg) { gap:6px; min-height:0; }
.lp-phone .lp-stage :is(.bd-msg,.dm-msg) h1 { font-size:22px; }
.lp-phone .lp-stage :is(.bd-msg,.dm-msg) p { font-size:14px; }

/* Dés : la main, l'annonce et toutes les réponses dans la même vue. */
.lp-phone .dm-phone .dm-hand { padding:8px; }
.lp-phone .dm-phone .dm-hand__label { margin:0 0 6px; font-size:12px; }
.lp-phone .dm-phone .dm-hand__label span { font-size:11px; }
.lp-phone .dm-phone .dm-hand__dice .dm-die { --s:clamp(32px,8cqh,52px); }
.lp-phone .dm-phone .dm-now { padding:6px; gap:2px; }
.lp-phone .dm-phone .dm-bidline--lg { font-size:30px; }
.lp-phone .dm-phone .dm-now__by { font-size:12px; }
.lp-phone .dm-phone .dm-pick { gap:6px; margin-top:auto; }
.lp-phone .dm-phone .dm-pick__title { font-size:16px; }
.lp-phone .dm-phone .dm-step { grid-template-columns:48px 1fr 48px; }
.lp-phone .dm-phone .dm-step__btn { height:44px; font-size:28px; }
.lp-phone .dm-phone .dm-step__val b { font-size:32px; }
.lp-phone .dm-phone .dm-face { padding:4px 0; min-height:44px; }
.lp-phone .dm-phone .dm-face .dm-die { --s:32px; }
.lp-phone .dm-phone .dm-calls { margin:0; gap:6px; }
.lp-phone .dm-phone .dm-pick__hint { font-size:12px; }

/* Bac : les huit catégories et les votes sont de véritables grilles. */
.lp-phone .bd-phone .bd-sheet__head { position:static; margin:0; padding:4px 8px; gap:8px; }
.lp-phone .bd-phone :is(.bd-sheet__head,.bd-turn) .bd-die { --s:36px; }
.lp-phone .bd-phone .bd-sheet__clock { font-size:24px; }
.lp-phone .bd-phone .bd-sheet__meta { font-size:12px; }
.lp-phone .bd-phone .bd-sheet { flex:1; min-height:0; gap:6px; grid-auto-rows:minmax(0,1fr); }
.lp-phone .bd-phone .bd-field { min-height:0; gap:2px; grid-template-columns:minmax(0,1fr) minmax(90px,40%); align-content:center; align-items:center; }
.lp-phone .bd-phone .bd-field__cat { font-size:12px; gap:4px; line-height:1.2; }
.lp-phone .bd-phone .bd-field__input { height:38px; padding:5px 7px; font-size:16px; border-radius:8px; }
.lp-phone .bd-phone .bd-field__hint { grid-column:1 / -1; font-size:11px; }
.lp-phone .bd-phone .bd-sheet__status { font-size:12px; }
.lp-phone .bd-phone .bd-turn { gap:8px; }
.lp-phone .bd-phone .bd-turn b { font-size:16px; }
.lp-phone .bd-phone .bd-own { padding:5px 7px; font-size:12px; }
.lp-phone .bd-phone .bd-votes { flex:1; min-height:0; gap:5px; align-content:start; }
.lp-phone .bd-phone .bd-vote { grid-template-columns:minmax(0,1fr) auto; align-items:center; padding:5px 6px; gap:3px 6px; border-radius:8px; }
.lp-phone .bd-phone .bd-vote__text b { font-size:13px; line-height:1.15; }
.lp-phone .bd-phone .bd-vote__text span { font-size:11px; }
.lp-phone .bd-phone .bd-vote__hint { grid-column:1; font-size:10px; }
.lp-phone .bd-phone .bd-vote__seg { grid-column:2; grid-row:1 / span 2; gap:4px; }
.lp-phone .bd-phone .bd-vote__btn { min-width:40px; min-height:42px; padding:4px; font-size:0; }
.lp-phone .bd-phone .bd-vote__btn--yes::after { content:'✓'; font-size:20px; }
.lp-phone .bd-phone .bd-vote__btn--no::after { content:'✕'; font-size:20px; }
.lp-phone .bd-phone .bd-vote__verdict { font-size:12px; }
.lp-phone .bd-phone .bd-picks { grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; }
.lp-phone .bd-phone .bd-pick { padding:5px; font-size:13px; gap:5px; }

/* Réputations : 22 personnes tiennent dans une grille ; les ornements sont discrets. */
.lp-phone .fm-phone .fm-reader { font-size:11px; gap:5px; }
.lp-phone .fm-phone .fm-person { gap:4px; min-width:0; }
.lp-phone .fm-phone .lp-avatar { font-size:.5rem; }
.lp-phone .fm-phone .fm-question { padding:8px; box-shadow:none; }
.lp-phone .fm-phone .fm-question__text { font-size:17px; margin:6px 0 0; line-height:1.2; }
.lp-phone .fm-phone .fm-question__foot { display:none; }
.lp-phone .fm-phone .fm-choices { grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; }
.lp-phone .fm-phone .fm-choice { min-height:42px; padding:4px; gap:3px; flex-wrap:nowrap; font-size:11px; line-height:1.1; }
.lp-phone .fm-phone .fm-choice .lp-avatar { display:none; }
.lp-phone .fm-phone .fm-choice__check { margin-left:auto; }
.lp-phone .fm-phone .fm-confirm { gap:3px; }
.lp-phone .fm-phone .fm-progress { padding:4px; border:0; background:transparent; }
.lp-phone .fm-phone .fm-progress__count { font-size:11px; margin:0; }
.lp-phone .fm-phone .fm-voters { gap:3px; margin-top:4px; }
.lp-phone .fm-phone .fm-voter { padding:2px 4px; gap:3px; font-size:10px; }
.lp-phone .fm-phone:has(.fm-choices) .fm-voters { display:none; }
.lp-phone .fm-phone .fm-skip { padding:0; margin:0; gap:2px; border:0; }
.lp-phone .fm-phone .fm-skip .lp-btn { min-height:32px; font-size:12px; }
.lp-phone .fm-phone .fm-skip .fm-hint { display:none; }
.lp-phone .fm-phone .fm-main { flex-shrink:0; }
.lp-phone .fm-phone :is(.fm-confirm,.fm-skip) .fm-hint { font-size:10px; }
.lp-phone .fm-phone .fm-order { gap:5px 16px; margin:0; font-size:11px; }
.lp-phone .fm-phone .fm-status { padding:10px; gap:5px; }
.lp-phone .fm-phone .fm-results { grid-template-columns:repeat(2,minmax(0,1fr)); gap:3px; }
.lp-phone .fm-phone .fm-resultrow { grid-template-columns:minmax(0,1fr) auto; padding:4px; gap:2px; font-size:10px; }
.lp-phone .fm-phone .fm-resultrow__bar { display:none; }
.lp-phone .fm-phone .fm-verdict { gap:3px; }
.lp-phone .fm-phone .fm-scores { padding:6px; }
.lp-phone .fm-phone .fm-scores__heading { margin-bottom:4px; font-size:10px; }
.lp-phone .fm-phone .fm-scores__heading h2 { font-size:13px; }
.lp-phone .fm-phone .fm-scores ol { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:3px; }
.lp-phone .fm-phone .fm-scores li { padding:3px; font-size:10px; gap:3px; }
.lp-phone .fm-phone .fm-scores .lp-avatar { display:none; }
.lp-phone .fm-phone .fm-scores .fm-person { font-size:10px; line-height:1.1; }
.lp-phone .fm-phone .fm-scores__count { font-size:10px; }
.lp-phone .fm-phone.fm--over .fm-crown { display:none; }
.lp-phone .fm-phone.fm--over .fm-scores ol { grid-template-columns:repeat(3,minmax(0,1fr)); }
.lp-phone .fm-phone .fm-pips { display:none; }
.lp-phone .fm-phone .fm-collection { margin:0; padding:0; border:0; font-size:11px; }
.lp-phone .fm-phone .fm-collection summary { min-height:24px; }
.lp-phone .fm-phone .fm-collection ol { margin:0; padding-left:18px; }
.lp-phone .fm-phone .fm-collection li { margin:2px 0; }
.lp-phone .fm-phone:has(.fm-collection[open]) .fm-main { display:none; }
.lp-phone .fm-phone .fm-collection[open] { padding:12px; border:1px solid var(--lp-line); border-radius:12px; background:white; }
.lp-phone .fm-phone .fm-collection[open] summary { min-height:42px; font-size:14px; font-weight:800; }
.lp-phone .fm-phone .fm-collection[open] summary::after { content:' · Revenir au jeu'; font-size:11px; }
.lp-phone .fm-phone .fm-collection[open] li { margin:10px 0; font-size:14px; line-height:1.3; }
.lp-phone .fm-phone .fm-trophies { grid-template-columns:1fr; gap:3px; }
.lp-phone .fm-phone .fm-trophies p { padding:3px 5px; font-size:11px; line-height:1.2; }
.lp-phone .fm-phone .fm-person--winner { padding:4px 8px; font-size:14px; }

/* Croco : les onze cartes restent visibles, avec leur texte complet. */
.lp-phone .rg-phone .rg-judge { font-size:12px; }
.lp-phone .rg-phone .rg-question { position:static; padding:8px; box-shadow:none; }
.lp-phone .rg-phone .rg-question__text { font-size:16px; line-height:1.2; margin:5px 0 0; }
.lp-phone .rg-phone .rg-question__foot { display:none; }
.lp-phone .rg-phone .rg-hand { width:100%; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; }
.lp-phone .rg-phone .rg-card { min-height:44px; padding:6px; font-size:12px; line-height:1.15; border-radius:8px; box-shadow:none; }
.lp-phone .rg-phone .rg-pile { grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; }
.lp-phone .rg-phone :is(.rg-answer,.rg-proposal) { padding:6px; min-height:0; gap:4px; font-size:12px; box-shadow:none; }
.lp-phone .rg-phone .rg-answer p { margin:3px 0; font-size:12px; line-height:1.15; }
.lp-phone .rg-phone .rg-progress { padding:5px; }
.lp-phone .rg-phone .rg-progress__count { margin:0; font-size:12px; }
.lp-phone .rg-phone .rg-progress__list { gap:3px; }
.lp-phone .rg-phone .rg-progress__who { padding:2px 4px; font-size:11px; }
.lp-phone .rg-phone .rg-status { padding:10px; gap:5px; }
.lp-phone .rg-phone .rg-scores { padding:6px; }
.lp-phone .rg-phone .rg-scores ol { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:3px; }
.lp-phone .rg-phone .rg-scores li { padding:4px; font-size:11px; }
.lp-phone .rg-phone .rg-scores__heading { margin-bottom:4px; font-size:11px; }
.lp-phone .rg-phone .rg-scores__heading h2 { font-size:13px; }
.lp-phone .rg-phone .rg-pips { display:none; }

/* Dessin : la feuille cède de la place aux outils, jamais l'inverse. */
.lp-phone .gb-phone .gb-main { flex:1; }
.lp-phone .gb-phone .gb-main:has(.gb-pad) { display:grid; grid-template-rows:auto minmax(0,1fr) auto auto auto; justify-items:stretch; }
.lp-phone .gb-phone .gb-word { padding:4px 8px; gap:6px; font-size:12px; }
.lp-phone .gb-phone .gb-word b { font-size:18px; }
.lp-phone .gb-phone .gb-clock--small { font-size:18px; }
.lp-phone .gb-phone .gb-pad { align-self:stretch; justify-self:center; width:auto; height:100%; min-height:0; max-width:100%; aspect-ratio:1; }
.lp-phone .gb-phone .gb-tools { gap:4px; }
.lp-phone .gb-phone .gb-tools__row { gap:4px; flex-wrap:nowrap; }
.lp-phone .gb-phone :is(.gb-swatch,.gb-size,.gb-tool) { min-width:0; min-height:38px; }
.lp-phone .gb-phone .gb-swatch { width:38px; height:38px; }
.lp-phone .gb-phone .gb-size { width:30px; height:38px; }
.lp-phone .gb-phone .gb-tool { padding:4px 6px; font-size:12px; }
.lp-phone .gb-phone .gb-stage { gap:5px; min-height:0; width:100%; }
.lp-phone .gb-phone .gb-board { width:min(100%,32cqh); height:auto; }
.lp-phone .gb-phone .gb-info { gap:5px; }
.lp-phone .gb-phone .gb-roles { font-size:12px; line-height:1.2; }
.lp-phone .gb-phone .gb-info__head { gap:5px; }
.lp-phone .gb-phone .gb-guess { min-width:0; height:40px; padding:5px; font-size:16px; }
.lp-phone .gb-phone .gb-attempts { gap:4px; }
.lp-phone .gb-phone .gb-attempts li { font-size:12px; padding:3px 6px; }
.lp-phone .gb-phone .gb-result { padding:6px; font-size:13px; gap:2px; }
.lp-phone .gb-phone .gb-result strong { font-size:18px; }
.lp-phone .gb-phone .gb-scores { padding:5px; }
.lp-phone .gb-phone .gb-scores ol { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:3px; }
.lp-phone .gb-phone :is(.gb-scores li,.gb-rank li) { padding:4px; font-size:11px; }
.lp-phone .gb-phone .gb-scores__heading { font-size:12px; margin-bottom:3px; }

/* Tour : scène souple, tableau de score compact sous la scène. */
.lp-phone .pp-phone .pp-scene { flex:1; min-height:0; }
.lp-phone .pp-phone .pp-side { flex:none; gap:4px; }
.lp-phone .pp-phone .pp-stats span { padding:4px; font-size:10px; }
.lp-phone .pp-phone .pp-stats b { font-size:16px; }
.lp-phone .pp-phone .pp-piece { padding:3px 6px; font-size:11px; }
.lp-phone .pp-phone .pp-shape-preview { width:42px; }
.lp-phone .pp-phone .pp-scores { grid-template-columns:repeat(3,minmax(0,1fr)); gap:3px; }
.lp-phone .pp-phone .pp-scores li { padding:3px; font-size:10px; gap:3px; }
.lp-phone .pp-phone .pp-scores .lp-avatar { display:none; }
.lp-phone .pp-phone .pp-rank li { padding:5px; font-size:12px; }
.lp-phone .pp-phone .pp-final__icon { font-size:36px; }
.lp-phone .pp-phone .pp-final h2 { font-size:22px; }

/* Quiz à plateau : toutes les destinations et quatre réponses. */
.lp-phone .tt-phone .tt-side { gap:6px; }
.lp-phone .tt-phone .tt-captain-boat { width:90px; height:85px; margin:0 auto; }
.lp-phone .tt-phone .tt-mine { padding:4px 0; font-size:11px; }
.lp-phone .tt-phone .tt-board { width:min(100%,36cqh); margin:auto; }
.lp-phone .tt-phone .tt-dests { grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; }
.lp-phone .tt-phone .tt-dest { padding:5px; min-height:42px; font-size:11px; }
.lp-phone .tt-phone .tt-q { padding:8px; }
.lp-phone .tt-phone .tt-q__text { font-size:17px; line-height:1.2; margin:6px 0; }
.lp-phone .tt-phone .tt-choices { grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; }
.lp-phone .tt-phone .tt-choice { min-height:48px; padding:8px; font-size:13px; }
.lp-phone .tt-phone .tt-result { padding:8px; font-size:13px; }

/* Les sélections de Traverse sont compactes ; la course reste bord à bord. */
.lp-phone .tq-phone:not(.tq--race) .tq-main { gap:8px; }
.lp-phone .tq-phone:not(.tq--race) .tq-title { font-size:22px; }
.lp-phone .tq-phone:not(.tq--race) .tq-animals { grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; }
.lp-phone .tq-phone:not(.tq--race) .tq-animal { padding:5px; font-size:11px; }
.lp-phone .tq-phone:not(.tq--race) .tq-animal__face { height:44px; }
.lp-phone .tq-phone:not(.tq--race) .tq-animal__face img { width:44px; height:44px; }
.lp-phone .tq-phone:not(.tq--race) :is(.tq-hint,.tq-eyebrow,.tq-award) { margin:0; font-size:12px; line-height:1.2; }
.lp-phone .tq-phone:not(.tq--race) .tq-big { font-size:36px; }
.lp-phone .tq-phone:not(.tq--race) .tq-big img { width:44px; height:44px; }
.lp-phone .tq-phone .tq-results { gap:6px; }
.lp-phone .tq-phone .tq-results li { min-height:36px; gap:5px; padding:5px; font-size:12px; }
.lp-phone .tq-phone .tq-results .tq-face { display:none; }
.lp-phone .tq-phone .tq-results__rank { width:24px; }
.lp-phone .tq-phone .tq-results__detail { font-size:10px; }
.lp-phone .tq-phone .tq-results__gain { padding:2px 4px; font-size:11px; }
.lp-phone .tq-phone .tq-results b { min-width:30px; font-size:12px; }

@media (max-height:720px) {
 .lp-phone .lp-stage > [class*="-phone"], .lp-phone .lp-stage :is(.fm-main,.rg-main,.gb-main,.tt-side) { gap:5px; }
 .lp-phone .fm-phone .fm-reader .lp-avatar { display:none; }
 .lp-phone .fm-phone .fm-question__text { font-size:15px; }
 .lp-phone .fm-phone .fm-choice { min-height:38px; }
 .lp-phone .fm-phone .fm-title { font-size:16px; }
 .lp-phone .rg-phone .rg-card { padding:4px; font-size:11px; }
 .lp-phone .rg-phone .rg-question__text { font-size:14px; }
 .lp-phone .bd-phone .bd-vote__btn { min-height:38px; }
}

@media (orientation:landscape) and (max-height:600px) {
 .lp-phone .dm-phone { display:grid; grid-template-columns:1fr 1fr; grid-template-rows:auto minmax(0,1fr); }
 .lp-phone .dm-phone .dm-pick { grid-column:2; grid-row:1 / span 2; margin:0; align-content:center; }
 .lp-phone .dm-phone :is(.dm-msg,.dm-waiting) { grid-column:2; grid-row:1 / span 2; }
 .lp-phone .bd-phone .bd-sheet { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .lp-phone .bd-phone .bd-votes { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .lp-phone .fm-phone .fm-choices { grid-template-columns:repeat(6,minmax(0,1fr)); }
 .lp-phone .fm-phone .fm-results, .lp-phone .fm-phone .fm-scores ol { grid-template-columns:repeat(4,minmax(0,1fr)); }
 .lp-phone .fm-phone .fm-reader { display:none; }
 .lp-phone .fm-phone .fm-question { padding:4px 8px; }
 .lp-phone .fm-phone .fm-question__top { float:right; margin-left:8px; }
 .lp-phone .fm-phone .fm-question__text { margin:0; }
 .lp-phone .fm-phone .fm-skip { position:absolute; bottom:0; right:0; width:35%; }
 .lp-phone .fm-phone .fm-confirm { padding-right:36%; }
 .lp-phone .rg-phone .rg-hand { grid-template-columns:repeat(4,minmax(0,1fr)); }
 .lp-phone .rg-phone .rg-pile { grid-template-columns:repeat(3,minmax(0,1fr)); }
 .lp-phone .gb-phone .gb-main:has(.gb-pad) { grid-template-columns:minmax(0,1fr) minmax(260px,1fr); grid-template-rows:auto auto auto auto; }
 .lp-phone .gb-phone .gb-pad { grid-column:1; grid-row:1 / span 4; max-height:100cqh; }
 .lp-phone .gb-phone .gb-main:has(.gb-pad) > :not(.gb-pad) { grid-column:2; }
 .lp-phone .gb-phone .gb-stage { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
 .lp-phone .gb-phone .gb-board { width:min(100%,65cqh); }
 .lp-phone .pp-phone:has(.pp-scene:not([hidden])) { display:grid; grid-template-columns:1.2fr 1fr; }
 .lp-phone .tt-phone .tt-captain-boat { width:60px; height:55px; }
 .lp-phone .tt-phone .tt-side:has(.tt-board) { display:grid; grid-template-columns:1fr 1fr; align-items:start; }
 .lp-phone .tt-phone .tt-side .tt-board { grid-column:1; grid-row:1 / span 6; width:min(100%,80cqh); }
 .lp-phone .tt-phone .tt-side:has(.tt-board) > :not(.tt-board) { grid-column:2; }
 .lp-phone .tq-phone:not(.tq--race) .tq-animals { grid-template-columns:repeat(6,minmax(0,1fr)); }
}

.lp-keyboard .lp-phone:has(.lp-stage) .lp-me { height:30px; }
.lp-keyboard .lp-phone .lp-me .lp-iconbtn { min-height:30px; height:30px; }
.lp-keyboard .lp-phone .bd-sheet { grid-template-columns:repeat(2,minmax(0,1fr)); }
.lp-keyboard .lp-phone .bd-field { grid-template-columns:minmax(0,1fr) minmax(52px,42%); gap:3px; }
.lp-keyboard .lp-phone .bd-field__cat { font-size:10px; line-height:1.08; }
.lp-keyboard .lp-phone .bd-field__cat > b { display:none; }
.lp-keyboard .lp-phone .bd-field__input { height:30px; }
.lp-keyboard .lp-phone .bd-sticky .lp-btn { min-height:32px; padding:4px; }
.lp-keyboard .lp-phone .bd-sheet__head { padding:0 4px; }
.lp-keyboard .lp-phone .bd-sheet__head .bd-die { --s:28px; }
.lp-keyboard .lp-phone .gb-stage { grid-template-columns:minmax(0,1fr) minmax(0,1.4fr); }
.lp-keyboard .lp-phone .gb-board { width:100%; }
.lp-keyboard .lp-phone .gb-main { flex:none; }
.lp-keyboard .lp-phone .gb-info { gap:3px; }
.lp-keyboard .lp-phone .gb-info__head { gap:3px; }
.lp-keyboard .lp-phone .gb-tag { padding:2px 5px; font-size:10px; }
.lp-keyboard .lp-phone .gb-roles { font-size:10px; }
.lp-keyboard .lp-phone .gb-roles .lp-avatar { display:none; }
.lp-keyboard .lp-phone .gb-hint { font-size:10px; }
.lp-keyboard .lp-phone .gb-timer { height:4px; }
.lp-keyboard .lp-phone :is(.gb-guess,.gb-form .lp-btn) { height:32px; min-height:32px; padding:3px; }
.lp-keyboard .lp-phone .gb-form .lp-btn { font-size:11px; }
.lp-keyboard .lp-phone .gb-scores { flex:none; padding:3px; }
.lp-keyboard .lp-phone .gb-scores h2 { font-size:10px; margin:0 0 3px; }
.lp-keyboard .lp-phone .gb-scores li { padding:2px; gap:3px; font-size:9px; line-height:1.1; }
.lp-keyboard .lp-phone .gb-scores__id { width:16px; height:20px; border-radius:4px; }
.lp-keyboard .lp-phone .gb-scores b { font-size:12px; }
.lp-keyboard .lp-phone .gb-attempts li { font-size:10px; padding:1px 3px; }

/* La course immersive garde son écran bord à bord, sans le bandeau commun. */
.lp-phone:has(.lp-stage > .tq--race) { padding:0; gap:0; }
.lp-phone:has(.lp-stage > .tq--race) .lp-stage { height:100%; }

/* Densité des listes longues, sans tronquer leurs libellés. */
.lp-phone .bd-phone .bd-vote { padding:2px 4px; gap:0 5px; }
.lp-phone .bd-phone .bd-vote__text { gap:0; }
.lp-phone .bd-phone .bd-vote__text b { font-size:12px; line-height:1.1; }
.lp-phone .bd-phone .bd-vote__text span { font-size:10px; line-height:1.1; }
.lp-phone .bd-phone .bd-vote__seg { grid-row:1; }
.lp-phone .fm-phone .fm-resultrow .lp-avatar { display:none; }
.lp-phone .fm-phone .fm-resultrow__cards { grid-column:1 / -1; font-size:10px; line-height:1; }
.lp-phone .fm-phone .fm-resultrow { padding:3px 5px; }
.lp-phone .fm-phone .fm-results { grid-template-columns:repeat(3,minmax(0,1fr)); }
.lp-phone .fm-phone .fm-resultrow .fm-person { grid-column:1 / -1; }
.lp-phone .fm-phone .fm-resultrow .fm-person b { white-space:normal; overflow:visible; }
.lp-phone .fm-phone .fm-resultrow__cards { grid-column:2; white-space:nowrap; }
.lp-phone .gb-phone .gb-main:has(.gb-pad) { grid-template-columns:minmax(0,1fr); }
.lp-phone .gb-phone .gb-tools { min-width:0; }
.lp-phone .gb-phone .gb-swatch { flex:1; width:0; max-width:38px; height:36px; min-height:36px; }
.lp-phone .rg-phone .rg-pile { grid-template-columns:repeat(3,minmax(0,1fr)); }
.lp-phone .rg-phone .rg-pile .rg-card { padding:4px; gap:3px; font-size:11px; }
.lp-phone .rg--choose .rg-question { padding:4px; }
.lp-phone .pp-phone .pp-rank { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; width:100%; }
.lp-phone .pp-phone .pp-rank li { gap:4px; font-size:11px; }
.lp-phone .pp-phone .pp-rank .lp-avatar { display:none; }
.lp-phone .pp-phone .pp-rank b { font-size:14px; }
.lp-phone .pp-phone .pp-final { gap:8px; }
.lp-phone .pp-phone .pp-final { padding:4px 0; width:100%; }
.lp-phone .pp-phone .pp-rank { margin:0; }
.lp-phone .fm--decide .fm-choices { grid-template-columns:repeat(4,minmax(0,1fr)); }
.lp-phone .pp-phone .pp-hint { margin:0; font-size:12px; }
.lp-phone .rg-phone .rg-pile .rg-order { font-size:9px; width:15px; height:15px; margin-right:3px; }
@media(max-height:720px) {
 .lp-phone .fm-phone .fm-main { gap:2px; }
 .lp-phone .fm-phone .fm-reader .lp-avatar { display:none; }
 .lp-phone .fm-phone .fm-choice { min-height:32px; }
 .lp-phone .fm-phone .fm-choices { grid-template-columns:repeat(4,minmax(0,1fr)); }
 .lp-phone .fm-phone .fm-resultrow { padding:2px 4px; }
 .lp-phone .fm-phone .fm-resultrow .fm-person b { font-size:10px; line-height:1.1; }
 .lp-phone .fm-phone .fm-question { padding:6px; }
}
@media(orientation:landscape) and (max-height:600px) {
 .lp-phone .gb-phone .gb-main:has(.gb-pad) { grid-template-columns:minmax(0,1fr) minmax(260px,1fr); }
 .lp-phone .fm-phone .fm-results,.lp-phone .fm-phone .fm-choices { grid-template-columns:repeat(6,minmax(0,1fr)); }
 .lp-phone .pp-phone .pp-rank { grid-template-columns:repeat(5,minmax(0,1fr)); }
 .lp-phone .tq-phone .tq-results { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .lp-phone .fm-phone.fm--over .fm-scores ol { grid-template-columns:repeat(6,minmax(0,1fr)); }
 .lp-phone .fm-phone.fm--over .fm-trophies { grid-template-columns:repeat(3,minmax(0,1fr)); }
 .lp-phone .gb-phone .gb-rank { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .lp-phone .tt-phone .tt-rank { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; }
 .lp-phone .tt-phone .tt-rank li { padding:4px; gap:5px; font-size:11px; }
 .lp-phone .tt-phone .tt-rank .lp-avatar { display:none; }
 .lp-phone .rg-phone.rg--choose .rg-pile .rg-card { font-size:10px; line-height:1.1; padding:3px; }
}

/* Code Couleur : chaque plaque indique aussi son rang et son orientation.
 * La palette sert donc également de sélection dans la pile sur petit écran. */
.cc-tile.is-used { opacity:1; background:#e3f0e9; }
.cc-tile.is-selected { outline:2px solid var(--cc-purple); outline-offset:1px; }
@media(max-width:900px), (max-height:700px) {
 html:has(#cc-app),body:has(#cc-app) { height:100%; overflow:hidden; }
 .cc-shell { position:fixed; top:var(--lp-viewport-top,0px); left:0; display:grid; grid-template-rows:30px minmax(0,1fr); gap:4px; width:100%; height:var(--lp-viewport-height,100dvh); padding:max(4px,env(safe-area-inset-top)) max(7px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(7px,env(safe-area-inset-left)); }
 .cc-shell .cc-nav { height:30px; min-height:0; border:0; }
 .cc-shell .cc-brand { font-size:0; letter-spacing:0; gap:0; }
 .cc-shell .cc-brand::after { content:'Code Couleur'; font-size:16px; }
 .cc-shell .cc-brandmark,.cc-shell .cc-brand>span:last-child { display:none; }
 .cc-shell .cc-back { font-size:11px; padding:4px 0; }
 #cc-app { min-height:0; display:grid; grid-template-rows:40px minmax(0,1fr); gap:4px; }
 .cc-shell .cc-intro { position:absolute; top:10px; left:45%; padding:0; }
 .cc-shell .cc-intro>div:first-child { display:none; }
 .cc-shell .cc-progress { position:static; display:block; padding:0; background:none; transform:none; }
 .cc-shell .cc-progress strong { font-size:11px; }
 .cc-shell .cc-progress>span { display:none; }
 .cc-shell .cc-challengebar { display:flex; flex-wrap:nowrap; gap:3px; margin:0; }
 .cc-shell .cc-challenge-nav { gap:3px; min-width:0; flex:1; }
 .cc-shell .cc-arrow { width:28px; min-width:28px; min-height:36px; padding:2px; }
 .cc-shell .cc-current { display:grid; gap:0; padding:0; text-align:center; }
 .cc-shell .cc-current>strong { font-size:13px; }
 .cc-shell .cc-level { font-size:9px; padding:0 4px; }
 .cc-shell .cc-challenge-links { width:auto; gap:2px; }
 .cc-shell .cc-challenge-links .cc-button { min-height:36px; font-size:10px; padding:3px; max-width:66px; white-space:normal; }
 .cc-shell .cc-layout { min-height:0; grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr) auto auto; grid-template-areas:'work' 'palette' 'side'; align-items:stretch; gap:5px; }
 .cc-shell .cc-workspace { min-height:0; display:grid; grid-template-rows:minmax(0,1fr) auto auto; gap:4px; }
 .cc-shell .cc-comparison { min-height:0; gap:7px; }
 .cc-shell .cc-board { min-height:0; display:grid; grid-template-rows:16px minmax(0,1fr) 14px; gap:2px; padding:5px; border-radius:10px; }
 .cc-shell .cc-board h2 { font-size:11px; margin:0; }
 .cc-shell .cc-tray { width:auto; height:100%; max-width:100%; max-height:100%; min-height:0; margin:0 auto; box-shadow:none; }
 .cc-shell .cc-board-note { font-size:8px; margin:0; white-space:nowrap; }
 .cc-shell .cc-empty-board { font-size:10px; }
 .cc-shell .cc-controls { display:grid; grid-template-columns:1fr; gap:3px; min-height:0; padding:3px; margin:0; border:0; }
 .cc-shell .cc-selected { min-height:18px; font-size:11px; gap:4px; }
 .cc-shell .cc-selected .cc-mini { width:18px; height:18px; }
 .cc-shell .cc-actions { width:100%; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:4px; }
 .cc-shell .cc-actions .cc-button { padding:3px 1px; min-height:38px; font-size:10px; }
 .cc-shell .cc-result { min-height:0; padding:0; margin:0; font-size:11px; line-height:1.2; }
 .cc-shell .cc-result.is-won { flex-direction:row; padding:3px 5px; gap:5px; text-align:left; }
 .cc-shell .cc-result.is-won strong { font-size:12px; }
 .cc-shell .cc-result.is-won p { display:none; }
 .cc-shell .cc-result .cc-button { min-height:36px; font-size:10px; padding:4px; }
 .cc-shell .cc-palette { padding:4px; border-radius:10px; }
 .cc-shell .cc-panel-head h2 { font-size:12px; }
 .cc-shell .cc-count { font-size:9px; }
 .cc-shell .cc-palette>.cc-muted { display:block; font-size:9px; line-height:1.1; margin:1px 0; }
 .cc-shell .cc-bank { grid-template-columns:repeat(6,minmax(0,1fr)); gap:4px; margin:4px 0 0; }
 .cc-shell .cc-tile { height:48px; min-height:0; padding:3px 3px 13px; }
 .cc-shell .cc-tile .cc-mini { width:29px; height:29px; }
 .cc-shell .cc-tile-letter { left:3px; bottom:0; font-size:9px; line-height:12px; }
 .cc-shell .cc-tile-state { right:3px; bottom:0; font-size:8px; line-height:12px; }
 .cc-shell .cc-sidebar { display:flex; align-items:stretch; gap:3px; }
 .cc-shell .cc-stack-panel { display:contents; }
 .cc-shell .cc-stack-panel>:not(.cc-history) { display:none; }
 .cc-shell .cc-history { flex:1; min-width:0; margin:0; padding:0; border:0; gap:2px; }
 .cc-shell .cc-help { flex:1; min-width:0; display:flex; gap:2px; padding:0; background:none; overflow:visible; }
 .cc-shell .cc-help>:not(button) { display:none; }
 .cc-shell :is(.cc-history,.cc-help) .cc-button { flex:1; width:auto; min-width:0; min-height:36px; margin:0; padding:3px; font-size:10px; white-space:normal; }
 .cc-shell :is(.cc-save-note,.cc-footer) { display:none; }
 .cc-shell .cc-save-note.is-error { display:block; padding:0; margin:0; font-size:10px; }
 .cc-dialog { max-height:calc(var(--lp-viewport-height,100dvh) - 16px); padding:12px; }
 .cc-dialog-head { margin-bottom:8px; }
 .cc-dialog h2 { font-size:18px; }
 .cc-dialog .cc-challenges { grid-template-columns:repeat(5,minmax(0,1fr)); gap:5px; margin-top:8px; }
 .cc-dialog .cc-challenge { min-height:38px; padding:3px; font-size:14px; }
 .cc-dialog .cc-solution-list { gap:5px; margin:8px 0; }
 .cc-dialog .cc-solution-list li { padding:4px; gap:5px; }
 .cc-dialog .cc-solution-list .cc-mini { width:32px; height:32px; }
 .cc-dialog .cc-solution-list span,.cc-dialog .cc-muted { font-size:11px; }
 .cc-dialog .cc-tip { padding:8px; margin-top:8px; font-size:11px; }
}
@media(min-width:600px) and (max-height:600px) {
 .cc-shell .cc-layout { grid-template-columns:1fr 1fr; grid-template-rows:minmax(0,1fr) auto; grid-template-areas:'work palette' 'work side'; }
 .cc-shell .cc-bank { grid-template-columns:repeat(6,minmax(0,1fr)); height:calc(100% - 22px); }
 .cc-shell .cc-tile { height:auto; max-height:80px; }
 .cc-shell .cc-tile .cc-mini { width:auto; height:calc(100% - 3px); max-height:60px; }
 .cc-dialog .cc-solution-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

/* Pile Poil solo : le décor utilise l'espace restant après les compteurs. */
@media(max-width:900px), (max-height:700px) {
 .lp-html:has(.pps-game),.lp-body:has(.pps-game) { height:100%; overflow:hidden; }
 .pps { position:fixed; top:var(--lp-viewport-top,0px); inset-inline:0; width:100%; height:var(--lp-viewport-height,100dvh); min-height:0; padding:4px 8px max(6px,env(safe-area-inset-bottom)); gap:4px; }
 .pps .pps-nav { flex:none; height:30px; margin:0; border:0; }
 .pps .pps-brand { font-size:18px; }
 .pps .pps-back { font-size:11px; padding:4px; }
 .pps .pps-game { min-height:0; grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr) auto; gap:6px; align-items:stretch; }
 .pps .pps-game .pp-scene { height:100%; min-height:0; max-height:none; }
 .pps .pps-game .pp-side { grid-template-columns:1fr 1fr; gap:4px; padding:0; }
 .pps .pps-head { display:none; }
 .pps .pps-game .pp-stats { grid-row:auto; }
 .pps .pps-game .pp-stats span { padding:3px; font-size:10px; }
 .pps .pps-game .pp-stats b { font-size:17px; padding:0; }
 .pps .pps-game .pp-stats span:last-child b { font-size:12px; line-height:1.3; }
 .pps .pp-gauge { padding:4px 6px; }
 .pps .pp-gauge__label { font-size:10px; }
 .pps .pp-gauge small { font-size:10px; }
 .pps .pps-next,.pps .pps-journey { padding:4px 6px; }
 .pps .pps-next { display:grid; grid-template-columns:38px 1fr; gap:2px 4px; }
 .pps .pps-next .pps-small-label { grid-column:1 / -1; }
 .pps .pps-next p { grid-column:1 / -1; }
 .pps .pp-shape-preview { width:36px; margin:0; }
 .pps .pps-small-label { font-size:8px; }
 .pps .pps-next>b,.pps .pps-journey strong { font-size:11px; }
 .pps .pps-next p,.pps .pps-journey p,.pps .pps-next-stop { margin:0; font-size:10px; line-height:1.2; }
 .pps .pps-forms { padding:0; }
 .pps .pps-forms__tray { gap:3px; }
 .pps .pps-forms__tray>div { padding:2px; }
 .pps .pps-forms__tray .pp-shape-preview { width:27px; margin:auto; }
 .pps .pps-forms__tray span { font-size:8px; }
 .pps .pps-forms p { margin:0; font-size:10px; }
 .pps .pps-keys { margin:0; font-size:10px; line-height:1.2; }
 .pps .pp-last { margin:0; font-size:11px; padding:3px; }
 .pps .pp-banner { top:15%; padding:8px; }
 .pps .pp-banner strong { font-size:20px; }
 .pps .pp-banner span { font-size:12px; }
}
@media(min-width:600px) and (max-height:600px) {
 .pps .pps-game { grid-template-columns:1fr 1fr; grid-template-rows:minmax(0,1fr); }
}
