/* Phone used as the Critter Party host display.
   Only host UI is affected. Laptop/TV composition and actual phone-player
   controllers are unchanged. Portrait may scroll rather than crop results. */

/* Fullscreen board controls: while a mini-game owns the presentation,
   its Host Controls contains fullscreen. Do not leave the board-only exit
   button visible on top of a mini-game (or duplicate that action). */
body.tv.ccc-tv-mini-active #tvBoardModeBtn{display:none!important}

/* Board overlay: replace the desktop, oversized left-hand scoreboard
   with short, legible rows. Preserve both names and coin/card counts. */
body.tv.ccc-mobile-host.board-only #app{
 width:100dvw!important;max-width:100dvw!important;
 height:100dvh!important;max-height:100dvh!important;
 overflow:hidden!important;
}
body.tv.ccc-mobile-host.board-only #raceShowcaseScore{
 box-sizing:border-box!important;z-index:28!important;
 margin:0!important;padding:6px!important;
 background:linear-gradient(140deg,#122e49f5,#213353f5)!important;
 border:1px solid #8ebbc7!important;border-radius:13px!important;
 overflow-x:hidden!important;overflow-y:auto!important;
 backdrop-filter:blur(5px);
}
body.tv.ccc-mobile-host.board-only #raceShowcaseScore .scoreTitle{
 display:flex!important;align-items:center!important;justify-content:space-between!important;
 gap:4px!important;margin:0 0 3px!important;
 font:850 11px/1.15 system-ui!important;letter-spacing:.035em!important;
}
body.tv.ccc-mobile-host.board-only #raceShowcaseScore .scoreTitle em{
 font:900 10px/1.1 system-ui!important;white-space:nowrap!important;
}
body.tv.ccc-mobile-host.board-only #raceShowcaseScore .scoreColumnLabels,
body.tv.ccc-mobile-host.board-only #raceShowcaseScore .scoreFooter{display:none!important}
body.tv.ccc-mobile-host.board-only #raceShowcaseScore .scoreRows{
 display:grid!important;gap:4px!important;
 margin:0!important;min-width:0!important;
}
body.tv.ccc-mobile-host.board-only #raceShowcaseScore .scoreRow{
 box-sizing:border-box!important;display:flex!important;
 flex-direction:row!important;align-items:center!important;
 width:100%!important;max-width:100%!important;min-width:0!important;
 min-height:34px!important;height:auto!important;
 margin:0!important;padding:4px 5px!important;gap:5px!important;
 background:#24445bdc!important;border-radius:8px!important;
 overflow:hidden!important;
}
body.tv.ccc-mobile-host.board-only #raceShowcaseScore .scoreIdentity{
 display:flex!important;flex:1 1 auto!important;
 min-width:0!important;max-width:100%!important;align-items:center!important;
 gap:4px!important;
}
body.tv.ccc-mobile-host.board-only #raceShowcaseScore .scoreAvatar{
 display:grid!important;place-items:center!important;flex:0 0 21px!important;
 width:21px!important;height:22px!important;font-size:19px!important;
 line-height:1!important;
}
body.tv.ccc-mobile-host.board-only #raceShowcaseScore .scoreName{
 display:block!important;flex:1 1 auto!important;min-width:0!important;
 font:850 11px/1.15 system-ui!important;
 color:#fff8e7!important;white-space:nowrap!important;
 text-overflow:ellipsis!important;overflow:hidden!important;
}
body.tv.ccc-mobile-host.board-only #raceShowcaseScore .scoreStats{
 display:flex!important;flex:0 0 auto!important;align-items:center!important;
 justify-content:flex-end!important;gap:5px!important;
 white-space:nowrap!important;
}
body.tv.ccc-mobile-host.board-only #raceShowcaseScore :is(.scoreCoins,.scoreCards){
 display:inline-flex!important;align-items:center!important;gap:2px!important;
 flex:0 0 auto!important;margin:0!important;font:900 11px/1 system-ui!important;
 white-space:nowrap!important;
}
body.tv.ccc-mobile-host.board-only #raceShowcaseScore :is(.scoreGoldCoin,.scoreCardGlyph){
 display:inline-flex!important;align-items:center!important;justify-content:center!important;
 flex:0 0 16px!important;width:16px!important;height:16px!important;
 font-size:11px!important;
}
body.tv.ccc-mobile-host.board-only #raceShowcaseScore .scoreChaseBadge,
body.tv.ccc-mobile-host.board-only #raceShowcaseScore .scoreChaseDistance{
 font-size:9px!important;white-space:normal!important;
}

/* Landscape host: reserve most of the scene for the board, compact HUD left. */
@media(orientation:landscape){
 body.tv.ccc-mobile-host.board-only #raceShowcaseScore{
  left:calc(7px + env(safe-area-inset-left,0px))!important;
  right:auto!important;top:auto!important;
  bottom:calc(7px + env(safe-area-inset-bottom,0px))!important;
  width:min(280px,37dvw)!important;max-width:37dvw!important;
  max-height:min(65dvh,280px)!important;
  grid-template-columns:none!important;
 }
 body.tv.ccc-mobile-host.board-only #raceShowcaseScore .scoreRows{
  grid-template-columns:minmax(0,1fr)!important;
 }
 body.tv.ccc-mobile-host.board-only #tvBoardModeBtn{
  top:calc(8px + env(safe-area-inset-top,0px))!important;
  left:calc(8px + env(safe-area-inset-left,0px))!important;
  padding:7px 10px!important;min-height:36px!important;
  font-size:11px!important;
 }
 body.tv.ccc-mobile-host.board-only #cccHostControls{
  top:calc(8px + env(safe-area-inset-top,0px))!important;
  right:calc(8px + env(safe-area-inset-right,0px))!important;
 }
}
/* Portrait host: two short columns across the bottom, leaving the board
   visible above rather than a huge vertical player panel blocking it. */
@media(orientation:portrait){
 body.tv.ccc-mobile-host.board-only #raceShowcaseScore{
  left:calc(7px + env(safe-area-inset-left,0px))!important;
  right:calc(7px + env(safe-area-inset-right,0px))!important;
  bottom:calc(7px + env(safe-area-inset-bottom,0px))!important;
  top:auto!important;width:auto!important;max-width:none!important;
  max-height:min(31dvh,275px)!important;
  grid-template-columns:none!important;
 }
 body.tv.ccc-mobile-host.board-only #raceShowcaseScore .scoreRows{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
 }
 body.tv.ccc-mobile-host.board-only #raceShowcaseScore .scoreName{
  font-size:10px!important;
 }
 body.tv.ccc-mobile-host.board-only #raceShowcaseScore .scoreRow{
  padding:3px!important;gap:3px!important;min-height:32px!important;
 }
 body.tv.ccc-mobile-host.board-only #raceShowcaseScore .scoreAvatar{
  flex-basis:17px!important;width:17px!important;height:18px!important;font-size:16px!important;
 }
 body.tv.ccc-mobile-host.board-only #raceShowcaseScore .scoreStats{
  gap:3px!important;
 }
 body.tv.ccc-mobile-host.board-only #raceShowcaseScore :is(.scoreCoins,.scoreCards){
  font-size:10px!important;
 }
 body.tv.ccc-mobile-host.board-only #raceShowcaseScore :is(.scoreGoldCoin,.scoreCardGlyph){
  flex-basis:12px!important;width:12px!important;height:13px!important;font-size:10px!important;
 }
 body.tv.ccc-mobile-host.board-only #tvBoardModeBtn{
  left:calc(7px + env(safe-area-inset-left,0px))!important;
  top:calc(8px + env(safe-area-inset-top,0px))!important;
  min-height:36px!important;font-size:10px!important;
  max-width:47vw!important;white-space:normal!important;
 }
 body.tv.ccc-mobile-host.board-only #cccHostControls{
  top:calc(8px + env(safe-area-inset-top,0px))!important;
  right:calc(7px + env(safe-area-inset-right,0px))!important;
  width:min(160px,44vw)!important;max-width:44vw!important;
 }
 body.tv.ccc-mobile-host.board-only #cccHostControls[open]{
  width:min(300px,calc(100dvw - 14px))!important;max-width:calc(100dvw - 14px)!important;
 }
 body.tv.ccc-mobile-host.board-only .r20-quality-controls:not(.r20-quality-lobby):not(.r20-quality-inline){
  top:calc(57px + env(safe-area-inset-top,0px))!important;left:7px!important;
 }
}

/* Fullscreen mini-game: restore natural height for phone hosts. Older fixed
   TV fitting and desktop headline rules caused clipping and empty areas. */
body.tv.ccc-mobile-host #r20MiniGame.r20-mg-tv:not([hidden]){
 display:block!important;position:fixed!important;
 inset:0!important;width:100dvw!important;max-width:100dvw!important;
 height:100dvh!important;max-height:100dvh!important;
 overflow-x:hidden!important;overflow-y:auto!important;
 overscroll-behavior-y:contain!important;
 -webkit-overflow-scrolling:touch;
}
body.tv.ccc-mobile-host #r20MiniGame.r20-mg-tv .r20-mg-layout{
 box-sizing:border-box!important;
 display:flex!important;flex-direction:column!important;align-items:stretch!important;
 justify-content:flex-start!important;gap:9px!important;
 width:100%!important;max-width:100%!important;min-width:0!important;
 height:auto!important;min-height:100dvh!important;max-height:none!important;
 padding:118px 10px calc(22px + env(safe-area-inset-bottom,0px))!important;
 margin:0 auto!important;overflow:visible!important;
 transform:none!important;zoom:1!important;
}
body.tv.ccc-mobile-host #r20MiniGame.r20-mg-tv .r20-mg-head{
 display:flex!important;flex-direction:column!important;
 align-items:center!important;justify-content:flex-start!important;
 position:relative!important;inset:auto!important;transform:none!important;
 width:100%!important;max-width:100%!important;min-width:0!important;
 min-height:0!important;height:auto!important;
 padding:0 5px!important;margin:0!important;
 gap:4px!important;overflow:visible!important;
}
body.tv.ccc-mobile-host #r20MiniGame.r20-mg-tv .r20-mg-title{
 width:100%!important;max-width:100%!important;
 margin:0!important;padding:0!important;
 font-size:clamp(20px,5.5vw,30px)!important;line-height:1.1!important;
 overflow-wrap:anywhere!important;text-wrap:balance;
}
body.tv.ccc-mobile-host #r20MiniGame.r20-mg-tv .r20-mg-subtitle:not(:empty){
 font-size:clamp(12px,3vw,16px)!important;
 line-height:1.25!important;
}
body.tv.ccc-mobile-host #r20MiniGame.r20-mg-tv :is(
 .r20-mg-center,.r20-mg-stage-main,.r20-mg-scores,.r20-mg-footer){
 min-width:0!important;max-width:100%!important;
 max-height:none!important;overflow:visible!important;
 transform:none!important;
}
body.tv.ccc-mobile-host #r20MiniGame.r20-mg-tv .r20-mg-center{
 flex:0 0 auto!important;height:auto!important;min-height:0!important;
}
body.tv.ccc-mobile-host #r20MiniGame.r20-mg-tv :is(
 .r20-party-podium,.r20-party-leaderboard,.r20-mg-score-row,
 .ccc-round-results,.ccc-party-results,.ccc-picture-tv-results){
 max-width:100%!important;min-width:0!important;
 overflow-wrap:anywhere!important;
}
body.tv.ccc-mobile-host #r20MiniGame.r20-mg-tv .r20-mg-status-row{
 width:100%!important;max-width:100%!important;
 gap:3px 8px!important;flex-wrap:wrap!important;
}
body.tv.ccc-mobile-host #r20MiniGame.r20-mg-tv .r20-mg-timer{
 min-width:0!important;max-width:100%!important;
 font-size:clamp(12px,3.2vw,16px)!important;
}
body.tv.ccc-mobile-host #r20MiniGame.r20-mg-tv .r20-mg-practice-bar:not([hidden]),
body.tv.ccc-mobile-host #r20MiniGame.r20-mg-tv .r20-mg-champ-bar:not([hidden]){
 position:fixed!important;inset:auto!important;
 top:calc(60px + env(safe-area-inset-top,0px))!important;
 right:calc(8px + env(safe-area-inset-right,0px))!important;
 left:auto!important;bottom:auto!important;
 width:min(165px,44vw)!important;max-width:44vw!important;min-width:0!important;
 transform:none!important;z-index:10131!important;
}
body.tv.ccc-mobile-host #r20MiniGame.r20-mg-tv :is(
 .r20-mg-practice-bar .r20-mg-practice-back,
 .r20-mg-champ-bar .r20-mg-champ-exit){
 display:block!important;width:100%!important;min-width:0!important;
 max-width:100%!important;min-height:39px!important;
 white-space:normal!important;
 padding:7px 8px!important;font:850 11px/1.2 system-ui!important;
}
body.tv.ccc-mobile-host #r20MiniGame.r20-mg-tv #cccHostControls{
 position:fixed!important;
 top:calc(8px + env(safe-area-inset-top,0px))!important;
 right:calc(8px + env(safe-area-inset-right,0px))!important;
 left:auto!important;width:min(160px,44vw)!important;
 max-width:44vw!important;height:auto!important;
}
body.tv.ccc-mobile-host #r20MiniGame.r20-mg-tv #cccHostControls[open]{
 width:min(312px,calc(100dvw - 16px))!important;
 max-width:calc(100dvw - 16px)!important;
 max-height:84dvh!important;overflow-y:auto!important;
}
body.tv.ccc-mobile-host #r20MiniGame.r20-mg-tv #cccHostControls > .ccc-host-summary{
 padding:9px!important;font:850 11px/1.15 system-ui!important;
 white-space:nowrap!important;letter-spacing:.025em!important;
}
body.tv.ccc-mobile-host #r20MiniGame.r20-mg-tv .r20-quality-mini-header{
 position:fixed!important;inset:auto!important;
 left:calc(8px + env(safe-area-inset-left,0px))!important;
 top:calc(8px + env(safe-area-inset-top,0px))!important;
 right:auto!important;bottom:auto!important;
 max-width:min(125px,39vw)!important;
 z-index:10135!important;
}
body.tv.ccc-mobile-host #r20MiniGame.r20-mg-tv .r20-mg-practice-finished .r20-mg-center,
body.tv.ccc-mobile-host #r20MiniGame.r20-mg-tv.r20-mg-practice-finished .r20-mg-center{
 max-height:none!important;
}
/* Party final leaderboard should be readable at mobile width, not shrunk to
   an impossibly small desktop two-column grid. */
@media(orientation:portrait){
 body.tv.ccc-mobile-host #r20MiniGame.r20-mg-tv :is(
 .r20-party-podium,.r20-party-leaderboard,.ccc-round-players,
 .ccc-champ-standings,.ccc-picture-final-scores){
  grid-template-columns:minmax(0,1fr)!important;
 }
 body.tv.ccc-mobile-host #r20MiniGame.r20-mg-tv .r20-mg-scores{
  width:100%!important;
 }
}
@media(orientation:landscape){
 body.tv.ccc-mobile-host #r20MiniGame.r20-mg-tv .r20-mg-layout{
  padding-top:80px!important;
  gap:7px!important;
 }
 body.tv.ccc-mobile-host #r20MiniGame.r20-mg-tv .r20-mg-title{
  font-size:clamp(19px,3.6dvh,30px)!important;
 }
 body.tv.ccc-mobile-host #r20MiniGame.r20-mg-tv .r20-mg-practice-bar:not([hidden]),
 body.tv.ccc-mobile-host #r20MiniGame.r20-mg-tv .r20-mg-champ-bar:not([hidden]){
  top:calc(8px + env(safe-area-inset-top,0px))!important;
  left:clamp(150px,23vw,265px)!important;
  right:auto!important;
  width:clamp(110px,20vw,165px)!important;
  max-width:28vw!important;
 }
 body.tv.ccc-mobile-host #r20MiniGame.r20-mg-tv .r20-mg-head{
  padding:0!important;
 }
}
@media(max-width:380px){
 body.tv.ccc-mobile-host #r20MiniGame.r20-mg-tv .r20-mg-layout{
  padding-inline:6px!important;
 }
 body.tv.ccc-mobile-host.board-only #raceShowcaseScore{
  padding:5px!important;
 }
}
