/* V0.17.0 layout authority. Four reported insets + ergonomic fallback edges.
   No phone model, OS name or cutout dimension is encoded here. */
:root{
  --safe-top:0px;--safe-right:0px;--safe-bottom:0px;--safe-left:0px;
  --viewport-height:100vh;--viewport-width:100vw;--viewport-top:0px;--viewport-left:0px;
}
@supports(padding:env(safe-area-inset-top)){
  :root{--safe-top:env(safe-area-inset-top,0px);--safe-right:env(safe-area-inset-right,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px);}
}
@supports(height:100dvh){:root{--viewport-height:100dvh}}
body{padding:calc(var(--safe-top) + 8px) calc(var(--safe-right) + 12px) calc(var(--safe-bottom) + 12px) calc(var(--safe-left) + 12px);overflow-x:hidden;}
body:not(.game-active) .shell{width:100%;max-width:1200px;}
button,input,select{min-height:44px;}
button:focus-visible,input:focus-visible,select:focus-visible,[role=button]:focus-visible{outline:3px solid #f0d487;outline-offset:3px;}
.topbar{flex-wrap:wrap;gap:8px;top:calc(var(--safe-top) + 8px);}
.topActions{max-width:100%;flex-wrap:wrap;gap:6px;}
.iconBtn,.miniBtn{min-width:44px;min-height:44px;}
.heroCopy,.heroCopy .actions,.roomTools,.fieldRow,.playerIdentity,.roomHeader{min-width:0;}
.heroCopy .actions{flex-wrap:wrap;}
select,input{max-width:100%;font-size:16px!important;}
.fieldRow{display:flex;flex-wrap:wrap;gap:8px;align-items:center;}
.fieldRow input{flex:1 1 150px;width:auto;min-width:0;}
.playerIdentity strong{overflow-wrap:anywhere;}
.seatMeta{display:flex;flex-wrap:wrap;justify-content:end;gap:6px;}
.seatEditBtn,.seatColorEdit{min-width:44px;min-height:44px;}
.seatColorEdit{background:#30251c;color:#f0d6a2;padding:6px 10px;border:1px solid #b28a4850;border-radius:10px;font-size:12px;}
body.game-active .shell{
  position:fixed;top:var(--viewport-top);left:var(--viewport-left);right:auto;bottom:auto;
  width:var(--viewport-width);height:var(--viewport-height);max-width:none;margin:0;
  padding:calc(var(--safe-top) + 8px) calc(var(--safe-right) + 10px) calc(var(--safe-bottom) + 10px) calc(var(--safe-left) + 10px);
  display:grid;grid-template-rows:auto minmax(0,1fr);gap:6px;overflow:hidden;
}
body.game-active .topbar{
  position:static;inset:auto;height:auto;min-height:44px;padding:0;margin:0;
  display:flex;flex-wrap:nowrap;gap:8px;background:transparent;border:0;z-index:50;
}
body.game-active .brand{position:static;inset:auto;transform:none;width:auto;max-width:none;flex:1;min-width:0;justify-content:start;}
body.game-active .brandMark{display:none;}
body.game-active .brand>div{min-width:0;max-width:100%;}
body.game-active .brand strong{font-size:clamp(.8rem,3.6vw,1.1rem);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;}
body.game-active .brand small{font-size:8px;white-space:nowrap;letter-spacing:.06em;}
body.game-active .topActions{position:static;inset:auto;transform:none;max-width:none;display:flex;flex-wrap:nowrap;gap:6px;}
body.game-active .topActions .iconBtn{width:44px;height:44px;padding:0;border-radius:13px;font-size:17px;}
body.game-active .topActions .netBadge{display:none;}
body.game-active .gameShell{
  position:relative;inset:auto;width:100%;height:100%;min-height:0;min-width:0;margin:0;padding:0;
  display:grid;grid-template-areas:"players" "board" "feedback" "action";
  grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) 30px auto;gap:6px;
}
body.game-active .gameTop,body.game-active .boardMeta{display:none;}
body.game-active .gameGrid{display:contents!important;height:auto!important;padding:0!important;}
body.game-active .gamePlayersStrip{
  grid-area:players;position:static;inset:auto;transform:none;display:grid;
  grid-template-columns:repeat(var(--hud-columns,4),minmax(0,1fr));gap:5px;
  width:100%;height:auto;max-height:none;margin:0;padding:0;background:none;
  overflow:visible;scroll-snap-type:none;min-width:0;align-content:start;
}
body.game-active .gameStripPlayer{
  position:relative;display:grid;grid-template-columns:20px minmax(0,1fr);align-items:center;gap:5px;
  width:100%;min-width:0;height:48px;min-height:48px;margin:0;padding:5px 6px;
  flex:none;text-align:start;border:1px solid #b9975745;border-inline-start:3px solid var(--pc);
  border-radius:12px;background:#30261f;color:#efdfc3;box-shadow:inset 0 1px #fff2d20a;
  overflow:hidden;transition:background .16s,border-color .16s;scroll-snap-align:none;font:inherit;
}
body.game-active .gameStripPlayer .stripHorse{width:20px;height:30px;background:none;box-shadow:none;border:0;border-radius:0;}
body.game-active .gameStripPlayer .stripHorse img{width:22px;height:30px;object-fit:contain;filter:none;}
.stripIdentity{min-width:0;overflow:hidden;}
body.game-active .gameStripPlayer strong{display:block;font-size:12px;font-weight:700;line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0;}
body.game-active .gameStripPlayer small{display:flex;align-items:center;justify-content:space-between;gap:3px;font-size:11px;line-height:1.4;color:#c2b499;white-space:nowrap;min-width:0;}
.stripStatus{overflow:hidden;text-overflow:ellipsis;min-width:0;}
.stripProgress{direction:ltr;font-variant-numeric:tabular-nums;flex:none;}
body.game-active .gameStripPlayer.active{background:#4c3923;border-color:#e1bf6d;box-shadow:inset 0 0 0 1px #e1bf6d55;animation:turnArrival .25s ease-out;}
body.game-active .gameStripPlayer.active .stripStatus{color:#f4d783;font-weight:800;}
body.game-active .gameStripPlayer.finished{background:#2c241e;border-color:#b295615c;border-inline-start-color:var(--pc);}
.stripRank{background:#d4b062;color:#332516;border-radius:50%;width:20px;height:20px;display:grid;place-items:center;font:800 12px system-ui;}
@keyframes turnArrival{from{box-shadow:inset 0 0 0 2px #f4d783;}to{box-shadow:inset 0 0 0 1px #e1bf6d55;}}
body.game-active .boardViewport{grid-area:board;min-height:0;min-width:0;display:grid;place-items:center;position:relative;}
body.game-active .boardStage{
  position:relative;inset:auto;transform:none;margin:0;padding:0;grid-column:auto;grid-row:auto;
  width:var(--board-size,100%)!important;height:var(--board-size,100%)!important;min-height:0;min-width:0;
  max-width:100%;max-height:100%;aspect-ratio:1;border:0;border-radius:20px;overflow:visible;
}
body.game-active .boardStage{container-type:inline-size;}
body.game-active #board{display:block;width:100%!important;height:100%!important;max-width:none;max-height:none;aspect-ratio:1;border-radius:inherit;touch-action:manipulation;}
body.game-active .boardHalo{inset:0;transform:none;width:100%;height:100%;filter:none!important;pointer-events:none;}
body.game-active .turnPill{display:none!important;}
.homeRanks{position:absolute;inset:0;pointer-events:none;z-index:12;}
.homeRank{
  position:absolute;transform:translate(-50%,-50%);width:15%;aspect-ratio:1;border-radius:50%;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  color:#eee0c6;background:radial-gradient(circle at 35% 25%,#5c4930,#2e241a 75%);
  border:2px solid var(--pc);box-shadow:0 2px 10px #21140c88,inset 0 0 0 3px #c6a56660;
}
.homeRank strong{font:800 clamp(20px,5vw,42px)/1 system-ui;color:#e2c578;}
.homeRank small{font:600 clamp(8px,2vw,12px)/1.3 system-ui;}
.rankLaurel{font-size:14px;line-height:1;color:#d8b667;}
.homeRank.firstRank{border-color:#e4c46e;box-shadow:0 3px 15px #21140c88,inset 0 0 0 3px var(--pc);}
.radialRanks .homeRank{width:11%;border-width:1px;}
.radialRanks .homeRank strong{font-size:clamp(16px,4vw,30px);}
.radialRanks .rankLaurel{font-size:10px;}.radialRanks .homeRank small{display:none;}
@container(max-width:260px){.homeRank small,.radialRanks .rankLaurel{display:none;}.homeRank strong{font-size:20px;}.radialRanks .homeRank strong{font-size:12px;}}
body.game-active .gameFeedback{grid-area:feedback;position:relative;min-width:0;display:grid;place-items:center;height:30px;pointer-events:none;}
body.game-active .fxMessage{
  position:static;inset:auto;transform:none!important;animation:none!important;
  display:block;margin:0;padding:2px 7px;max-width:100%;max-height:30px;width:auto;border:0;background:transparent;
  box-shadow:none;backdrop-filter:none;font-size:12px!important;line-height:1.25;text-align:center;overflow:hidden;
  color:#f1d9a4;opacity:0;transition:opacity .18s;
}
body.game-active .fxMessage.show{opacity:1;}
body.game-active .hud{
  grid-area:action;position:static;inset:auto;transform:none;width:100%;height:auto;min-height:0;margin:0;padding:0;
  display:grid;grid-template-columns:minmax(0,1fr) 96px!important;
  grid-template-areas:"turn dice" "roll dice" "finished finished"!important;grid-template-rows:auto auto auto;gap:3px 10px;
  background:none;border:0;box-shadow:none;align-self:stretch;align-items:center;min-width:0;z-index:20;
}
body.game-active .hud>.turnPanel{grid-area:turn;display:block!important;min-height:0!important;margin:0;padding:0 4px;border:0;border-radius:0;background:none;box-shadow:none;min-width:0;}
body.game-active .turnPanel .eyebrow{display:none;}
body.game-active .currentPlayer{display:block;font-size:13px;line-height:1.4;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;}
body.game-active .turnPanel p{font-size:11.5px;line-height:1.45;margin:3px 0 0;color:#d0bea2;overflow-wrap:anywhere;}
body.game-active #chooseHorse:not(.hidden){display:inline-block;min-height:44px;margin:3px 0 0;padding:6px 12px;font-size:12px;border-radius:10px;}
body.game-active .turnPanel:has(#chooseHorse:not(.hidden)) p{display:none;}
body.game-active .directDicePanel{display:contents!important;min-height:0!important;}
body.game-active .directDiceControl,body.game-active .directDiceControl .diceCanvas{
  grid-area:dice;width:96px!important;height:96px!important;transform:none!important;justify-self:center;align-self:center;
}
body.game-active .diceDirectHelp{
  grid-area:roll;display:grid;grid-template-columns:minmax(0,1fr) 44px;grid-template-rows:auto auto;
  min-height:44px;margin:0;padding:0 4px;gap:0 6px;align-content:center;align-items:center;justify-items:start;
  border:0;border-radius:0;background:none;box-shadow:none;pointer-events:auto;min-width:0;
}
body.game-active .diceDirectHelp strong{font-size:11px;line-height:1.4;grid-column:1;grid-row:1;}
body.game-active .diceDirectHelp .rollHint{display:block;grid-column:1;grid-row:2;font-size:10px!important;line-height:1.35;margin:0;text-align:start;max-width:100%;white-space:normal;}
.reactionOpen{grid-column:2;grid-row:1/span 2;width:44px;height:44px;min-width:44px;border:1px solid #b18e4f55;background:#34291f;color:#ddc38f;border-radius:12px;font-size:22px;box-shadow:none;padding:0;}
body.game-active .finishedActions{
  grid-area:finished;position:static;inset:auto;display:flex;flex-wrap:wrap;width:100%;gap:6px;pointer-events:auto;justify-content:center;z-index:auto;
}
body.game-active .finishedActions:has(>button:not(.hidden)){padding-top:6px;}
body.game-active .finishedActions>button:not(.hidden),body.game-active #rematch:not(.hidden){position:static;display:block!important;min-height:44px;font-size:11.5px;padding:8px 10px;flex:1 1 130px;}
body.game-active[data-game-status="finished"] .hud{grid-template-areas:"finished dice"!important;grid-template-rows:auto;}
body.game-active[data-game-status="finished"] .turnPanel,body.game-active[data-game-status="finished"] .diceDirectHelp{display:none!important;}
.setupSheet,.computerSheet,.settingsSheet,.resultRevealOverlay{
  position:fixed;inset:auto!important;top:var(--viewport-top)!important;left:var(--viewport-left)!important;
  width:var(--viewport-width);height:var(--viewport-height);box-sizing:border-box;display:grid;place-items:center;
  padding:calc(var(--safe-top) + 12px) calc(var(--safe-right) + 12px) calc(var(--safe-bottom) + 12px) calc(var(--safe-left) + 12px)!important;
  background:#160f0ccf;z-index:180;overscroll-behavior:contain;
}
.setupSheet.hidden,.settingsSheet.hidden,.computerSheet.hidden,.resultRevealOverlay.hidden{display:none!important;}
.setupCard,.computerCard,.settingsCard,.resultRevealCard{
  max-height:100%!important;max-width:100%!important;width:min(680px,100%);min-width:0;
  overflow:auto!important;overscroll-behavior:contain;scroll-padding:65px 8px 70px;
  background:linear-gradient(145deg,#493529,#261d17);color:#efdfc4;border:1px solid #bc965754;
  border-radius:22px;padding:16px;box-sizing:border-box;
}
.setupCard .panelHeader,.computerCard .panelHeader,.settingsCard .panelHeader{
  position:sticky;top:-16px;z-index:3;background:#382a21;padding:8px 0;margin:0 0 10px;min-height:44px;gap:8px;
}
.panelHeader>div,.panelHeader>strong{min-width:0;overflow-wrap:anywhere;}
.setupCard label,.computerCard label{display:flex;flex-direction:column;gap:6px;margin:10px 0;font-size:13px;}
.setupCount{display:flex!important;flex-direction:row!important;align-items:center;gap:12px;}
.setupCount select{width:75px;}
.setupHint{font-size:12px;color:#cbbb9f;margin:10px 0;}
.setupPlayer,.humanColors{border:1px solid #b48a4d4d;border-radius:14px;margin:10px 0;padding:10px;min-width:0;}
.setupPlayer legend,.humanColors legend{font-size:13px;color:#e0c28a;padding:0 5px;}
.setupPlayer input{width:100%;box-sizing:border-box;border:1px solid #a9885355;background:#211a15;color:#efdfc4;border-radius:10px;padding:8px 12px;}
.colorChoices{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;margin-top:10px;min-width:0;}
.colorChoice{
  min-width:0;min-height:62px;padding:5px 2px;border:1px solid #9d825445;border-radius:12px;background:#2b221a;
  display:flex;align-items:center;justify-content:center;flex-direction:column;gap:4px;color:#e6d7ba;box-shadow:none;cursor:pointer;
}
.colorChoice>span{display:grid;place-items:center;width:25px;height:25px;flex:none;background:var(--choice);border:1px solid #fff3;border-radius:50%;color:white;font-weight:800;font-size:17px;}
.colorChoice small{font-size:10px;line-height:1.2;white-space:nowrap;}
.colorChoice.selected{border:2px solid #e3c071;background:#574129;}
.colorChoice:disabled{opacity:.32;cursor:not-allowed;filter:grayscale(.5);transform:none;}
.setupFooter{position:sticky;bottom:-16px;background:#34261d;padding:12px 0 4px;margin-top:12px;z-index:3;}
.setupFooter button,.computerStart{width:100%;min-height:48px;}
.colorCard{width:min(480px,100%);}
#colorPlayerName,#playerDetailsName{overflow-wrap:anywhere;}
#playerDetailsStatus{line-height:1.8;color:#d5c29f;}
#horseChoices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
#horseChoices button{display:grid;grid-template-columns:34px minmax(0,1fr);gap:3px 6px;align-items:center;min-height:64px;padding:8px;background:#33261c;color:#edd8b2;border:1px solid #b6914f55;font-size:13px;box-shadow:none;}
#horseChoices img{width:34px;height:42px;object-fit:contain;grid-row:1/span 2;}
#horseChoices small{font-size:11px;}
#reactionsSheet .reactionsPanel{display:block!important;margin-top:8px;border:0;padding:0;background:none;}
#reactionsSheet .reactionsPanel .panelHeader{display:none;}
#reactionsSheet .reactionBar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-width:100%;overflow:visible;}
#reactionsSheet .reactionBar button{min-height:44px;white-space:normal;font-size:13px;padding:8px;}
.resultRevealCard{width:min(850px,100%);min-height:0!important;}
.resultRevealOverlay.stage-enter .resultRevealCard{animation:resultSafeIn .34s ease-out both;}
@keyframes resultSafeIn{from{opacity:0;}to{opacity:1;}}
.resultRevealCopy{min-width:0;}.resultRevealName{overflow-wrap:anywhere;font-size:clamp(20px,5vw,44px);}
.resultRevealCopy #resultRevealNext{min-width:110px;min-height:52px;position:sticky;bottom:0;}
.reconnectOverlay{inset:auto!important;top:calc(var(--viewport-top) + var(--safe-top) + 10px)!important;left:calc(var(--viewport-left) + var(--safe-left) + 12px)!important;right:auto!important;bottom:auto!important;width:calc(var(--viewport-width) - var(--safe-left) - var(--safe-right) - 24px);height:auto;padding:0;background:none;}
.reconnectCard{max-width:100%;margin:auto;}.reconnectCard>div{min-width:0;overflow-wrap:anywhere;}
body .toast,body.game-active .toast{
  left:calc(var(--viewport-left) + var(--safe-left) + 12px);right:auto;bottom:auto;
  top:calc(var(--viewport-top) + var(--safe-top) + 64px);transform:none;
  max-width:calc(var(--viewport-width) - var(--safe-left) - var(--safe-right) - 24px);font-size:12px;pointer-events:none;
}
body.game-active .gameFeedback>.toast{position:absolute;inset:0;transform:none;max-width:100%;width:100%;min-height:0;margin:0;padding:2px 6px;border:0;border-radius:0;background:transparent;color:#f1d9a4;box-shadow:none;font-size:12px;line-height:1.25;text-align:center;}
body.game-active .gameFeedback:has(.fxMessage.show)>.toast{display:none;}
body.game-active .diceDirectHelp{position:relative;}
body.game-active .diceDirectHelp:has(.toast.show)>strong,body.game-active .diceDirectHelp:has(.toast.show)>.rollHint{visibility:hidden;}
body.game-active .diceDirectHelp>.toast.inHelp{position:absolute;inset-block:0;inset-inline:4px auto;max-width:none;width:calc(100% - 54px);padding:0;display:grid;place-content:center;transform:none;background:none;box-shadow:none;border:0;font-size:11px;line-height:1.3;text-align:start;overflow:hidden;}
.toast.inDialog{position:sticky!important;inset:auto!important;top:52px!important;left:auto!important;transform:none!important;width:100%;max-width:100%!important;background:#4e3623;color:#f2d5a0;box-shadow:none;font-size:12px;line-height:1.5;padding:8px;border-radius:10px;z-index:2;}
.resultRevealCopy>.toast.inDialog{top:0!important;}
.toast.inDialog:not(.show){display:none;}
@media(max-width:500px){
  .colorChoices{grid-template-columns:repeat(4,minmax(0,1fr));}
  .heroMascot{max-width:100%;}.heroCopy h1{font-size:clamp(28px,8vw,46px);}
  .heroBadges{flex-wrap:wrap;}
  .audioTestGrid{grid-template-columns:1fr;}
  body.game-active .gameStripPlayer{height:46px;min-height:46px;}
}
@media(orientation:landscape) and (max-height:650px){
  body.game-active .gameShell{
    grid-template-areas:"board players" "board feedback" "board action";
    grid-template-columns:minmax(0,1fr) clamp(250px,40vw,340px);grid-template-rows:minmax(0,1fr) 26px auto;gap:5px 10px;
  }
  body.game-active .gamePlayersStrip{align-self:start;gap:4px;}
  body.game-active .gameStripPlayer{height:44px;min-height:44px;display:block;padding:4px 5px;}
  body.game-active .gameStripPlayer .stripHorse{display:none;}
  body.game-active .gameStripPlayer .stripStatus{font-size:10px;}
  body.game-active .gameStripPlayer strong{line-height:1.35;}
  body.game-active .hud{grid-template-columns:minmax(0,1fr) 84px!important;gap:2px 6px;}
  body.game-active .directDiceControl,body.game-active .directDiceControl .diceCanvas{width:84px!important;height:84px!important;}
  body.game-active .currentPlayer{display:none;}
  body.game-active .turnPanel p{font-size:11px;line-height:1.35;margin:0;}
  body.game-active .diceDirectHelp .rollHint{display:none;}
  body.game-active .diceDirectHelp strong{font-size:10px;}
  body.game-active .gameFeedback{height:26px;}
  .resultRevealCard{display:grid;grid-template-columns:35% minmax(0,1fr);align-items:center;gap:12px;}
  .resultMascotZone{max-height:180px;min-height:0;}
  .resultRevealCopy p{font-size:13px;line-height:1.4;}
}
@media(min-width:800px) and (min-height:651px){
  body.game-active .gamePlayersStrip{width:min(1120px,100%);justify-self:center;}
  body.game-active .hud{width:min(720px,100%);justify-self:center;}
}
@media(prefers-reduced-motion:reduce){
  body.game-active .gameStripPlayer.active{animation:none!important;}
  .gameStripPlayer,.fxMessage{transition:none!important;}
}
/* V0.17 ergonomic action dock. Logical centre avoids RTL or handedness bias.
   The 112px target surrounds a 100px die; adjacent actions have their own lane. */
body.game-active .hud{
  grid-template-columns:minmax(0,1fr) 112px minmax(0,1fr)!important;
  grid-template-areas:"turn dice roll" "finished finished finished"!important;
  grid-template-rows:auto auto;gap:4px 10px;
}
body.game-active .directDiceControl{width:112px!important;height:112px!important;display:grid;place-items:center;}
/* V0.17.4: the charge/ready ring is drawn 7px outside the die target. The HUD is
   the last row of an overflow:hidden shell, so reserve that ring below the die
   or the bottom of the charge progress arc is cut off on every device. */
body.game-active .hud{padding-bottom:8px!important;}
body.game-active .directDiceControl .diceCanvas{width:100px!important;height:100px!important;transform:translateX(var(--dice-drift,0%))!important;grid-area:auto;}
body.game-active .diceDirectHelp{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:5px;text-align:center;padding:0;}
body.game-active .diceDirectHelp strong{display:none;}
body.game-active .diceDirectHelp .rollHint{font-size:10px!important;text-align:center;line-height:1.35;}
body.game-active .diceDirectHelp:has(.toast.show)>.rollHint{display:none!important;}
body.game-active .diceDirectHelp>.toast.inHelp{position:static!important;inset:auto!important;width:100%;max-width:100%;display:block;padding:0;font-size:10.5px;line-height:1.35;text-align:center;overflow:visible;}
body.game-active .diceDirectHelp>.toast.inHelp:not(.show){display:none;}
body.game-active .turnPanel p{font-size:11px;}
body.game-active .finishedActions{min-width:0;}
.tableDiceWell{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:18%;aspect-ratio:1;display:none;place-items:center;z-index:18;pointer-events:none;}
/* Canonical centre/finish lanes take priority. Shared local tablets use the
   same centred 112px edge dock, outside every board cell and arrival point. */
body.game-active[data-dice-placement="shared-dock"] .hud{width:min(720px,100%);justify-self:center;}
body.game-active[data-dice-placement="tabletop"] .tableDiceWell{display:grid;}
body.game-active[data-dice-placement="tabletop"] .tableDiceWell>.directDiceControl{pointer-events:auto;width:100%!important;height:100%!important;grid-area:auto;}
body.game-active[data-dice-placement="tabletop"] .tableDiceWell .diceCanvas{width:94%!important;height:94%!important;}
body.game-active[data-dice-placement="tabletop"] .hud{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;grid-template-areas:"turn roll" "finished finished"!important;}
body.game-active[data-dice-placement="tabletop"] .diceDirectHelp{flex-direction:row;gap:12px;min-height:48px;}
body.game-active[data-game-status="finished"] .hud{grid-template-columns:minmax(0,1fr) 112px!important;grid-template-areas:"finished dice"!important;}
body.game-active[data-game-status="finished"][data-dice-placement="tabletop"] .hud{grid-template-areas:"finished finished"!important;}
@media(orientation:landscape) and (max-height:650px){
  body.game-active .hud{grid-template-columns:minmax(0,1fr) 88px minmax(0,1fr)!important;gap:3px 6px;}
  body.game-active .directDiceControl{width:88px!important;height:88px!important;}
  body.game-active .directDiceControl .diceCanvas{width:80px!important;height:80px!important;}
  body.game-active .diceDirectHelp .rollHint{display:none;}
}
/* Short portrait space is a board budget, not a device-name exception. Keep
   seven players in two readable rows; the existing 88px die target is ample. */
@media(orientation:portrait) and (max-height:650px){
  body.game-active .hud{grid-template-columns:minmax(0,1fr) 88px minmax(0,1fr)!important;}
  body.game-active .directDiceControl{width:88px!important;height:88px!important;}
  body.game-active .directDiceControl .diceCanvas{width:80px!important;height:80px!important;}
  body.game-active #gamePlayersStrip[data-player-count="7"]{grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;}
  body.game-active #gamePlayersStrip[data-player-count="7"] .gameStripPlayer{height:44px;min-height:44px;padding:4px 5px;}
  body.game-active #gamePlayersStrip[data-player-count="7"] .gameStripPlayer:not(.finished){display:block;}
  body.game-active #gamePlayersStrip[data-player-count="7"] .gameStripPlayer:not(.finished) .stripHorse{display:none;}
  body.game-active #gamePlayersStrip[data-player-count="7"] strong{line-height:1.35;}
}
