/* Les pages de préparation restent utilisables dans les deux orientations. */
.fullscreen-button { margin:8px 0 0; }
.fullscreen-exit-icon { display:none; width:22px; height:22px; }
.orientation-prompt { display:none; }
.landscape-label { display:none; }
.screen-status {
 position:fixed; top:54px; right:16px; z-index:44;
 width:min(380px,calc(100vw - 32px)); margin:0; padding:12px;
 border:1px solid #b6c1ad; border-radius:6px; background:#fdfbf3;
 color:#203e34; font:13px/1.5 Arial,sans-serif; box-shadow:0 4px 16px #0002;
}
:root:fullscreen { background:#f3f0e7; }
@media(min-width:1000px) and (min-height:500px) {
 .in-game .fullscreen-button { margin:0; min-height:30px; padding:7px 10px; font:11px Arial,sans-serif; }
 .in-game .game-caption { max-width:calc(100% - 850px); }
}
/* L'invitation peut être fermée si l'appareil est fixé ou ne peut pas tourner. */
@media(orientation:portrait) and (pointer:coarse),
       (orientation:portrait) and (max-width:1100px) {
 .in-game .orientation-prompt:not(.portrait-dismissed) {
  display:grid; position:fixed; inset:0; z-index:40;
  place-items:center; padding:24px; background:#f3f0e7f5;
  color:#203e34; text-align:center; overflow:auto;
 }
 .orientation-prompt>div { max-width:420px; }
 .orientation-prompt h2 { font-size:25px; font-weight:400; }
 .orientation-prompt p { font:15px/1.6 Arial,sans-serif; }
 .orientation-prompt button { display:block; min-height:44px; margin:12px auto; }
 .rotate-symbol { display:block; font-size:64px; color:#526b47; }
 .orientation-prompt .portrait-continue { background:transparent; }
 .in-game .screen-status { z-index:41; }
}

/* Petits écrans en paysage : toute la table tient dans la fenêtre.
   Les trois tailles de cadre utilisent ici la place réelle de l'appareil. */
@media(orientation:landscape) and (min-width:560px) and (width < 1000px),
       (orientation:landscape) and (min-width:560px) and (height < 500px) {
 body:has(.app-shell.in-game) { overflow:hidden; }
 .app-shell.in-game {
  position:fixed; inset:0; max-width:none; padding:0 4px;
  padding-left:max(4px,env(safe-area-inset-left));
  padding-right:max(4px,env(safe-area-inset-right));
  --mobile-player:122px; --mobile-north:54px; --mobile-discard:56px; --mobile-own-discard:52px;
 }
 .in-game .topbar { height:44px; min-height:0; padding:0 2px; border:0; }
 .in-game .brand { font-size:18px; gap:5px; letter-spacing:3px; }
 .in-game .brand-mark { font-size:26px; }
 .in-game .brand small,.in-game .session-meta,.in-game .game-caption { display:none; }
 .in-game .ui-language { font:10px Arial,sans-serif; }
 .in-game .ui-language select { min-height:36px; padding:7px 2px; }
 .in-game .view-controls {
  position:fixed; top:2px; right:max(114px,calc(110px + env(safe-area-inset-right)));
  display:flex; align-items:start; gap:4px; z-index:30;
 }
 .in-game .view-controls details,.in-game .fullscreen-button,.in-game .room-back {
  margin:0; min-height:40px; padding:12px 7px; font:10px Arial,sans-serif;
  border:1px solid #c9d0bc; border-radius:5px; background:#fdfbf3; color:#203e34;
 }
 .in-game .view-controls details[open] {
  position:fixed; top:46px; right:8px; width:min(650px,calc(100vw - 16px));
  max-height:calc(100dvh - 54px); overflow:auto; box-shadow:0 8px 28px #102c2740;
 }
 .in-game .view-controls .display-options { padding-top:10px; }
 .in-game>main { position:absolute; inset:46px 4px 4px; }
 .in-game .table-heading,.in-game>footer { display:none; }
 .in-game .access-panel { position:fixed; z-index:45; inset:50px 8px auto; width:auto; max-height:calc(100dvh - 58px); overflow:auto; }
 .in-game main>.notice { position:fixed; top:46px; left:8px; right:8px; z-index:35; }
 .app-shell.in-game .game-surface {
  position:relative; width:100%; height:100%; max-height:none; margin:0; padding:0;
  border-width:4px; border-radius:10px; overflow:hidden; scrollbar-gutter:auto;
 }
 .in-game .table-layout { display:grid; grid-template-rows:minmax(0,1fr) var(--mobile-player); width:100%; height:100%; transform:none; }
 .app-shell.in-game .game-surface .game-table {
  display:grid; min-height:0; height:100%; padding:3px; gap:2px 6px;
  grid-template-columns:minmax(0,1fr) clamp(104px,16vw,160px) minmax(0,1fr);
  grid-template-rows:var(--mobile-north) minmax(0,1fr) var(--mobile-own-discard);
 }
 .in-game .game-table .seat.west { grid-column:1; grid-row:2/4; }
 .in-game .game-table .seat.east { grid-column:3; grid-row:2/4; }
 .in-game .game-table .seat.west,.in-game .game-table .seat.east {
  display:grid; grid-template-columns:minmax(0,1fr) minmax(60px,1fr);
  grid-template-rows:24px 24px var(--mobile-discard); gap:2px;
  align-self:center; width:100%; max-width:none;
 }
 .in-game .seat-title { grid-column:1/3; grid-row:1; padding:2px 5px; min-height:24px; gap:5px; }
 .in-game .seat-title>div { min-width:0; }
 .in-game .seat-title strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; }
 .in-game .seat-title small { font-size:9px; margin-top:0; white-space:nowrap; }
 .in-game .seat-title .portrait { width:20px; height:20px; flex-basis:20px; }
 .in-game .game-table .card-backs { grid-column:1; grid-row:2; height:9px; min-height:9px; margin:0; gap:1px; }
 .in-game .game-table .card-back { height:9px; width:10px; }
 .app-shell.in-game .game-surface .seat-exposed { grid-column:2; grid-row:2; height:24px; min-height:24px; }
 .in-game .seat .discard-label { position:absolute; left:0; top:37px; margin:0; font-size:9px; white-space:nowrap; }
 .in-game .seat .kami-stick-slot { position:absolute; top:25px; left:4px; height:8px; min-height:8px; width:44px; }
 .in-game .seat .kami-stick { height:6px; width:32px; line-height:4px; margin:2px auto; }
 .in-game .seat .kami-stick>span { font-size:5px; line-height:4px; }
 .app-shell.in-game .game-surface .discards {
  --discard-width:25px; --discard-gap:2px; grid-column:1/3; grid-row:3;
  width:176px; height:var(--mobile-discard)!important;
  min-height:var(--mobile-discard)!important; max-height:var(--mobile-discard)!important;
  padding:1px; grid-auto-rows:12px; gap:1px 2px; scrollbar-gutter:stable;
 }
 .in-game.discard-mode-compact .game-surface .discards .card.small { height:12px; }
 .in-game.discard-mode-compact .game-surface .discards .corner { padding:0; font-size:11px; line-height:12px; }
 .in-game.discard-mode-compact .game-surface .discards .corner small { font-size:9px; }
 .in-game.discard-mode-cards .game-surface .discards { grid-auto-rows:12px; row-gap:0; padding-bottom:24px; }
 .in-game.discard-mode-cards .game-surface .discards .card.small { height:26px; }
 .in-game.discard-mode-cards .game-surface .discards .corner { top:1px; left:1px; font-size:10px; }
 .in-game.discard-mode-cards .game-surface .discards .corner small { font-size:9px; }
 .in-game.discard-mode-cards .game-surface .discards .pip { font-size:12px; top:10px; }
 .in-game .game-table .seat.north {
  grid-column:1/4; grid-row:1; width:min(620px,100%); max-width:none;
  display:grid; grid-template-columns:minmax(0,1fr) 176px minmax(0,1fr);
  grid-template-rows:24px 16px; align-content:start; height:100%;
 }
 .in-game .seat.north .seat-title { grid-column:1; grid-row:1; }
 .in-game .seat.north .card-backs { grid-column:1; grid-row:2; }
 .app-shell.in-game .game-surface .seat.north .seat-exposed { position:static; grid-column:3; grid-row:1/3; width:100%; }
 .in-game .seat.north .discard-label { left:50%; top:0; transform:translateX(-50%); }
 .app-shell.in-game .seat.north .discards { position:absolute; grid-area:auto; left:50%; top:12px; transform:translateX(-50%); height:calc(var(--mobile-north) - 12px)!important; min-height:calc(var(--mobile-north) - 12px)!important; max-height:calc(var(--mobile-north) - 12px)!important; }
 .in-game .seat.north .kami-stick-slot { top:37px; left:40px; }
 .in-game .game-table .table-center { grid-column:2; grid-row:2; width:100%; align-self:center; gap:2px; }
 .in-game .game-surface .forest-total { font-size:10px; line-height:18px; gap:4px; }
 .in-game .game-surface .forest-total strong { font-size:16px; line-height:18px; }
 .in-game .game-surface .forest-total small { font-size:9px; }
 .in-game .game-surface .indicator-caption { font-size:9px; line-height:9px; }
 .in-game .game-surface .forest-cross { width:110px; height:52px; grid-template-columns:28px 42px 28px; grid-template-rows:8px 32px 8px; gap:2px; }
 .in-game .game-surface .central-indicator .card.small { width:23px; height:32px; }
 .in-game .game-surface .central-indicator .card.small .corner { font-size:11px; top:2px; left:2px; }
 .in-game .game-surface .central-indicator .card.small .corner small { font-size:10px; }
 .in-game .game-surface .central-indicator .card.small .pip { font-size:14px; top:12px; }
 .in-game .game-surface .forest-pile { gap:3px; font-size:9px; }
 .in-game .game-surface .pile-back { width:12px; height:18px; }
 .in-game .game-surface .pile-north .pile-back,.in-game .game-surface .pile-south .pile-back { width:22px; height:11px; }
 .in-game .game-surface .table-center .pot { font-size:9px; line-height:10px; min-height:10px; }
 .app-shell.in-game .game-surface .player-zone { position:static; min-height:0; margin:0 4px; padding:0; }
 .in-game .player-heading,.in-game .player-heading>div:first-child,.in-game .hand-play-area,.in-game .hand-column { display:contents; }
 .in-game .player-heading .eyebrow { display:none; }
 .in-game .own-name { position:absolute; top:auto; bottom:calc(var(--mobile-player) - 24px); left:4px; width:128px; font-size:13px; line-height:20px; }
 .in-game .own-name .portrait { width:20px; height:20px; flex-basis:20px; }
 .in-game .player-label { display:flex; min-width:0; align-items:baseline; }
 .in-game .player-name { min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
 .in-game .player-capital { flex-shrink:0; white-space:pre; }
 .app-shell.in-game .player-heading .own-discards { position:absolute; left:50%; transform:translateX(-50%); bottom:var(--mobile-player); width:176px; height:var(--mobile-own-discard); }
 .in-game .own-discards>span { position:absolute; left:0; top:100%; width:100%; margin:0!important; font-size:9px!important; line-height:10px; text-align:center; }
 .in-game .own-discards .kami-stick-slot { position:absolute; right:0; top:-12px; width:40px; height:8px; min-height:8px; }
 .in-game .own-discards .kami-stick { width:32px; height:6px; margin:0; }
 .app-shell.in-game .player-heading .own-exposed { position:absolute; left:4px; right:auto; top:auto; bottom:32px; width:128px; height:24px; min-height:24px; }
 .in-game .exposed-groups { height:24px; padding:0; gap:2px; }
 .in-game .exposed-group { padding:1px; }
 .app-shell.in-game .game-surface .exposed-group .card.small,.app-shell.in-game .game-surface .own-exposed .exposed-group .card.small,.in-game .exposed-back { width:16px; height:20px; }
 .app-shell.in-game .game-surface .exposed-group .card.small .corner { font-size:9px; top:0; left:0; }
 .app-shell.in-game .game-surface .exposed-group .card.small .corner small { font-size:8px; }
 .app-shell.in-game .game-surface .exposed-group .card.small .pip { font-size:10px; line-height:1; top:9px; }
 .in-game .position-badge { position:absolute; left:4px; right:auto; top:auto; bottom:calc(var(--mobile-player) - 38px); padding:2px 5px; font-size:8px; }
 .app-shell.in-game .game-surface .hand { position:absolute; left:136px; right:132px; bottom:28px; height:84px; min-height:84px; margin:0; padding:12px 3px 8px; gap:6px; align-items:flex-start; }
 .app-shell.in-game .game-surface .hand .card { --hand-card:44px; }
 .in-game .game-surface .hand-card+.hand-card { margin-left:clamp(-30px,calc(5.8vw - 62.944px),-14px); }
 .in-game .game-surface .hand-card.just-drawn { margin-left:2px!important; }
 .in-game .hand .corner { font-size:14px; top:4px; left:4px; }
 .in-game .hand .corner small { font-size:11px; }
 .in-game .hand .pip { font-size:22px; top:23px; }
 .in-game .hand .card-foot { font-size:10px; right:3px; bottom:3px; }
 .in-game .drawn-label { font-size:8px; top:-10px; bottom:auto; }
 .app-shell.in-game .game-surface .action-rail { position:absolute; right:4px; bottom:30px; width:124px; height:84px; max-height:84px; gap:3px; padding:1px; }
 .in-game .game-surface .action-rail .status { font-size:10px; line-height:1.25; }
 .in-game .game-surface .action-rail .actions { display:flex; flex-direction:row; flex-wrap:wrap; gap:3px; padding:1px; }
 .in-game .game-surface .action-rail button { width:auto; flex:1 1 calc(50% - 3px); min-width:0; max-width:100%; min-height:32px; padding:4px; font-size:11px; line-height:12px; overflow-wrap:anywhere; }
 .in-game .game-surface .action-rail .capture-slot { width:25px; height:35px; right:2px; top:2px; }
 .in-game .capture-offer .card.small { width:24px; height:34px; }
 .in-game .capture-offer .card.small .pip { font-size:15px; top:14px; }
 .in-game .game-surface .action-rail:has(.capture-offer) .status { padding-right:28px; min-height:35px; }
 .in-game .game-surface .extra-indicators { max-height:24px; }
 .in-game .extra-indicators .card.small { width:16px; height:23px; }
 .in-game .player-utilities { position:absolute; left:0; right:0; bottom:0; height:28px; margin:0; display:flex; flex-wrap:nowrap; justify-content:center; gap:4px; overflow-x:auto; }
 .in-game .player-utilities button { flex-shrink:0; min-height:26px; padding:4px 7px; margin:0; font-size:10px; }
 .in-game .player-utilities .table-tools { margin:0; gap:4px; }
 .in-game .landscape-label { display:inline; }
 .in-game .desktop-label { display:none; }
 .in-game .room-resume { display:flex; align-items:center; gap:4px; font-size:9px; }
 .in-game .room-resume p { margin:0; max-width:140px; }
 .in-game .seat .revealed { top:24px; left:auto; right:0; width:100px; max-height:26px; }
}
@media(orientation:landscape) and (min-width:560px) and (max-height:360px) {
 .app-shell.in-game { --mobile-player:108px; --mobile-north:48px; --mobile-discard:44px; --mobile-own-discard:38px; }
 .in-game .game-table .seat.west,.in-game .game-table .seat.east { grid-template-rows:22px 22px var(--mobile-discard); }
 .in-game .seat-title { min-height:22px; }
 .app-shell.in-game .game-surface .hand { height:72px; min-height:72px; padding-top:8px; }
 .app-shell.in-game .game-surface .hand .card { --hand-card:38px; }
 .in-game .game-surface .hand-card+.hand-card { margin-left:-24px; }
 .in-game .hand .pip { font-size:19px; top:18px; }
 .in-game .game-surface .forest-cross { display:grid; width:100px; height:38px; grid-template-columns:28px 42px 28px; grid-template-rows:6px 24px 6px; gap:1px; }
 .in-game .game-surface .central-indicator .card.small { width:20px; height:24px; }
 .in-game .game-surface .central-indicator .card.small .pip { font-size:12px; top:9px; }
 .in-game .game-surface .forest-total strong { font-size:14px; line-height:13px; }
 .in-game .game-surface .indicator-caption { font-size:8px; line-height:8px; }
 .in-game .game-surface .action-rail { height:73px; max-height:73px; }
}

@media(orientation:landscape) and (min-width:560px) and (width < 1000px),
       (orientation:landscape) and (min-width:560px) and (height < 500px) {
 .app-shell.in-game .own-discards .discards { height:var(--mobile-own-discard)!important; min-height:var(--mobile-own-discard)!important; max-height:var(--mobile-own-discard)!important; }
}
@media(orientation:landscape) and (min-width:560px) and (360px < height < 390px) {
 .app-shell.in-game { --mobile-player:114px; --mobile-north:50px; --mobile-own-discard:44px; --mobile-discard:48px; }
 .in-game .game-table .seat.west,.in-game .game-table .seat.east { grid-template-rows:22px 22px var(--mobile-discard); }
 .app-shell.in-game .game-surface .hand { height:76px; min-height:76px; padding-top:9px; }
 .app-shell.in-game .game-surface .hand .card { --hand-card:40px; }
 .in-game .game-surface .forest-cross { height:44px; grid-template-rows:6px 28px 6px; }
 .in-game .game-surface .central-indicator .card.small { width:20px; height:28px; }
 .in-game .game-surface .central-indicator .card.small .pip { font-size:12px; top:10px; }
}
@media(orientation:landscape) and (min-width:560px) and (max-height:360px) {
 .in-game .game-surface .forest-pile .pile-back { display:none; }
 .in-game .game-surface .forest-total { height:13px; align-items:center; line-height:13px; }
 .in-game .game-surface .table-center { gap:0; }
 .in-game .game-surface .indicator-caption { display:none; }
 .in-game .game-surface .forest-pile { font-size:7px; line-height:6px; }
 .in-game .game-surface .table-center .pot { font-size:8px; line-height:9px; min-height:9px; }
}
@media(orientation:landscape) and (560px <= width <= 700px) {
 .in-game .game-surface .seat.west .discards { margin-left:0; margin-right:auto; }
 .in-game .game-surface .seat.east .discards { margin-right:0; margin-left:auto; }
}
@media(orientation:landscape) and (min-width:560px) and (360px < height < 390px) {
 .in-game .game-surface .table-center { gap:1px; }
 .in-game .game-surface .indicator-caption { line-height:8px; }
}
@media(orientation:landscape) and (min-width:560px) and (height < 390px) {
 .in-game.hand-layout-fan .game-surface .hand-card.selected,
 .in-game.hand-layout-fan .game-surface .hand-card:hover { transform:translateY(calc(var(--fan-y,0px) - 6px)) rotate(var(--fan-angle,0deg)); }
 .in-game.hand-layout-overlap .game-surface .hand-card.selected,
 .in-game.hand-layout-overlap .game-surface .hand-card:hover { transform:translateY(-6px); }
}
@media(orientation:landscape) and (min-width:560px) and (width < 1000px) and (min-height:390px),
       (orientation:landscape) and (min-width:560px) and (390px <= height < 500px) {
 .app-shell.in-game .game-surface .action-rail { height:108px; max-height:108px; }
}
/* Tablettes utilisant déjà la disposition de bureau : onze cartes restent
   visibles, y compris avec la dernière pioche séparée. */
@media(orientation:landscape) and (1000px <= width < 1200px) and (min-height:500px) {
 .app-shell.in-game .game-surface .hand .card { --hand-card:52px; }
 .app-shell.in-game .game-surface .hand-card+.hand-card { margin-left:-25px; }
 .app-shell.in-game .game-surface .hand-card.just-drawn { margin-left:12px!important; }
}
@media(orientation:landscape) and (560px <= width <= 700px) {
 .in-game:has(.room-back) .brand { visibility:hidden; pointer-events:none; }
}
/* Barres du navigateur encore visibles sur un téléphone : conserver le plateau
   complet même lorsque la hauteur utile descend sous 320 pixels. */
@media(orientation:landscape) and (min-width:560px) and (height < 320px) {
 .app-shell.in-game { --mobile-player:96px; --mobile-north:42px; --mobile-discard:32px; --mobile-own-discard:30px; }
 .in-game .topbar { height:32px; }
 .in-game .brand { font-size:16px; }
 .in-game .brand-mark { font-size:24px; }
 .in-game .ui-language select { min-height:30px; padding:4px 2px; }
 .in-game .view-controls details,.in-game .fullscreen-button,.in-game .room-back { min-height:30px; padding:8px 7px; }
 .in-game .view-controls details[open] { top:34px; max-height:calc(100dvh - 42px); }
 .in-game>main { top:34px; }
 .in-game .game-table .seat.west,.in-game .game-table .seat.east { grid-template-rows:20px 20px var(--mobile-discard); }
 .in-game .seat-title { min-height:20px; }
 .in-game .seat-title .portrait { width:18px; height:18px; flex-basis:18px; }
 .in-game .seat-title strong { font-size:10px; }
 .in-game .seat .discard-label { top:33px; }
 .in-game .seat.north .discard-label { top:0; }
 .in-game .own-discards>span { display:none!important; }
 .in-game .game-surface .forest-total,.in-game .game-surface .forest-total strong { height:12px; line-height:12px; }
 .in-game .game-surface .forest-cross { height:34px; grid-template-rows:5px 22px 5px; }
 .in-game .game-surface .central-indicator .card.small { width:18px; height:22px; }
 .in-game .game-surface .central-indicator .card.small .corner { font-size:9px; top:1px; left:1px; }
 .in-game .game-surface .central-indicator .card.small .corner small { font-size:8px; }
 .in-game .game-surface .central-indicator .card.small .pip { font-size:10px; top:8px; }
 .in-game .game-surface .table-center .pot { font-size:7px; line-height:8px; min-height:8px; }
 .app-shell.in-game .game-surface .action-rail { height:74px; max-height:74px; bottom:26px; }
 .in-game .screen-status { top:34px; }
}
@media(orientation:landscape) and (min-width:560px) and (height < 500px) {
 .in-game .confirmation { padding:8px; }
 .in-game .confirmation>div { max-height:calc(100dvh - 16px); overflow:auto; padding:16px; }
 .in-game .confirmation h2 { font-size:20px; }
 .in-game .confirmation .actions { margin:12px 0 0; }
}

/* En Partie et en plein écran seulement : la table récupère le bandeau. */
:root:fullscreen .app-shell.in-game>.topbar,
:root:fullscreen .app-shell.in-game .table-heading,
:root:fullscreen .app-shell.in-game>footer,
:root:fullscreen .app-shell.in-game .view-controls>details,
:root:fullscreen .app-shell.in-game .view-controls>.room-back { display:none; }
:root:fullscreen .app-shell.in-game .view-controls { display:contents; }
:root:fullscreen .app-shell.in-game>main { top:max(4px,env(safe-area-inset-top)); }
:root:fullscreen .app-shell.in-game .view-controls>.fullscreen-button {
 position:fixed; top:max(6px,env(safe-area-inset-top)); right:max(6px,env(safe-area-inset-right));
 display:grid; place-items:center; width:44px; height:44px; min-height:44px;
 margin:0; padding:10px; z-index:39; border-radius:7px;
}
:root:fullscreen .app-shell.in-game .fullscreen-label { display:none; }
:root:fullscreen .app-shell.in-game .fullscreen-exit-icon { display:block; width:22px; height:22px; }
/* Le coin de sortie reste libre, même avec les groupes exposés du joueur du haut. */
:root:fullscreen .app-shell.in-game .game-table .seat.north { max-width:calc(100% - 100px); }
@media(min-width:1000px) and (min-height:500px),
      (orientation:landscape) and (min-width:560px) {
 :root:fullscreen .app-shell.in-game .game-surface { height:100%; }
}
