/* Critter Party — fullscreen board presentation, Nov 2026.
   Presentation only: never change 3D geometry, scene render size, gameplay,
   touch coordinates, or animation state. */
@media (min-width: 901px) and (min-height: 650px) {
  body.tv.board-only #raceShowcaseScore {
    width: clamp(290px, 23vw, 350px)!important;
    max-width: calc(100vw - 32px)!important;
    left: clamp(10px, 1vw, 18px)!important;
    bottom: clamp(10px, 1.1vh, 18px)!important;
    padding: 10px!important;
    border-radius: 15px!important;
  }
  body.tv.board-only #raceShowcaseScore .scoreRow {
    min-height: 37px!important;
    margin-top: 3px!important;
    padding: 5px 8px!important;
    gap: 6px!important;
    border-radius: 9px!important;
  }
  body.tv.board-only #raceShowcaseScore .scoreName {
    font-size: clamp(14px, 1.1vw, 18px)!important;
    line-height: 1.15!important;
  }
  body.tv.board-only #raceShowcaseScore .scoreAvatar {
    flex-basis: 26px!important;
    width: 26px!important;
    font-size: 23px!important;
  }
  body.tv.board-only #raceShowcaseScore .scoreCoins {
    font-size: clamp(14px, 1.1vw, 18px)!important;
  }
  body.tv.board-only #raceShowcaseScore .scoreTitle {
    margin-bottom: 4px!important;
  }
  body.tv.board-only #raceShowcaseScore .scoreFooter {
    margin-top: 5px!important;
    padding-top: 5px!important;
  }
}
/* Quiet secondary controls, prominent only when hovered or focused. */
body.tv.board-only #partyTools button {
  box-shadow: 0 3px 10px #07132966!important;
  border-radius: 11px!important;
  transition: background-color .15s ease, box-shadow .15s ease;
}
body.tv.board-only #partyTools button:hover,
body.tv.board-only #partyTools button:focus-visible {
  box-shadow: 0 4px 17px #071329aa!important;
}
@media (max-width: 900px), (max-height: 649px) {
  body.tv.board-only #raceShowcaseScore {
    max-height: min(42dvh, 270px);
    overflow: hidden;
  }
}

/* Mobile landscape host board: the desktop four-row HUD clipped its
   bottom entries. Use a compact grid so every critter remains visible. */
@media (pointer:coarse) and (max-width:950px){
 body.tv.board-only #raceShowcaseScore{
  left:clamp(6px,1.5vw,12px)!important;
  bottom:calc(6px + env(safe-area-inset-bottom,0px))!important;
  width:min(59vw,520px)!important;max-width:59vw!important;
  max-height:61dvh!important;overflow-y:auto!important;
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:3px 5px!important;padding:6px!important;
  box-sizing:border-box!important;
 }
 body.tv.board-only #raceShowcaseScore .scoreTitle,
 body.tv.board-only #raceShowcaseScore .scoreFooter{
  grid-column:1/-1!important;margin:0!important;
 }
 body.tv.board-only #raceShowcaseScore .scoreRow{
  min-width:0!important;min-height:32px!important;
  margin:0!important;padding:4px!important;gap:4px!important;
 }
 body.tv.board-only #raceShowcaseScore .scoreAvatar{
  flex:0 0 19px!important;width:19px!important;font-size:18px!important;
 }
 body.tv.board-only #raceShowcaseScore .scoreName{
  font-size:clamp(10px,2.1vw,14px)!important;
  white-space:normal!important;overflow-wrap:anywhere;
 }
 body.tv.board-only #raceShowcaseScore .scoreCoins{
  font-size:clamp(11px,2vw,15px)!important;
 }
 body.tv.board-only #raceShowcaseScore .scoreRow small{
  font-size:clamp(8px,1.5vw,10px)!important;
 }
 body.tv.board-only #raceShowcaseScore .scoreTitle{
  font-size:11px!important;
 }
}

/* Final TV readability: four-player score panel fits the screen without
   cropping portraits, names, cards or coins. No changes to scoring logic. */
body.tv #raceShowcaseScore{
 box-sizing:border-box!important;
 max-width:min(38vw,420px)!important;
 max-height:calc(100dvh - 24px)!important;
 overflow:hidden!important;
}
body.tv #raceShowcaseScore .scoreRow{
 display:flex!important;align-items:center!important;min-width:0!important;
 box-sizing:border-box!important;
}
body.tv #raceShowcaseScore .scoreIdentity{
 display:flex!important;align-items:center!important;flex:1 1 auto!important;
 min-width:0!important;
}
body.tv #raceShowcaseScore .scoreAvatar{
 display:grid!important;place-items:center!important;
 flex-shrink:0!important;aspect-ratio:1!important;
 overflow:hidden!important;border-radius:50%!important;
}
body.tv #raceShowcaseScore .scoreAvatar img.ccc-board-hud-selfie{
 display:block!important;width:100%!important;height:100%!important;
 aspect-ratio:1!important;object-fit:cover!important;object-position:center!important;
 border-radius:50%!important;
}
body.tv #raceShowcaseScore .scoreName{
 display:block!important;flex:1 1 auto!important;min-width:0!important;
 white-space:nowrap!important;overflow:hidden!important;
 text-overflow:ellipsis!important;
}
body.tv #raceShowcaseScore .scoreCoins{
 flex:0 0 auto!important;white-space:nowrap!important;
}
body.tv #raceShowcaseScore .ccc-board-critter-label{
 display:block!important;font-size:clamp(9px,.75vw,12px)!important;
 line-height:1!important;white-space:nowrap!important;overflow:hidden!important;
 text-overflow:ellipsis!important;opacity:.84;
}
@media(max-height:680px){
 body.tv #raceShowcaseScore{padding:6px!important}
 body.tv #raceShowcaseScore .scoreRow{padding:3px 6px!important;min-height:30px!important;margin-top:3px!important}
 body.tv #raceShowcaseScore .scoreTitle{margin:0 0 3px!important}
 body.tv #raceShowcaseScore .scoreFooter{margin:3px 0 0!important}
}
@media(pointer:coarse) and (max-width:950px){
 body.tv.board-only #raceShowcaseScore{
  max-width:59vw!important;max-height:min(61dvh,310px)!important;
  overflow-y:auto!important;
 }
 body.tv.board-only #raceShowcaseScore .scoreIdentity{gap:4px!important}
 body.tv.board-only #raceShowcaseScore .scoreName{
  white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
 }
}


/* Nov 11 board presentation pass — keep the existing Three.js scenery and
   game rules unchanged. Use stable overlay IDs so TV/phone do not regress. */
body.tv.board-only #tvLandingBanner{
  box-sizing:border-box!important;
  width:max-content!important;
  max-width:min(68vw,560px)!important;
  padding:clamp(12px,1.7vmin,19px) clamp(17px,2.3vw,27px)!important;
  top:clamp(72px,10vh,108px)!important;
  border-radius:20px!important;
  border-width:2px!important;
  box-shadow:0 13px 34px #071124b8, inset 0 1px 0 #ffffff70!important;
  font-size:clamp(19px,2.35vw,32px)!important;
  line-height:1.18!important;
  letter-spacing:.005em!important;
  overflow-wrap:anywhere!important;
}
body.tv.board-only #tvLandingBanner[data-tone="bad"]{
  background:linear-gradient(145deg,#6c2851,#91365b 70%,#5a2a69)!important;
  border-color:#ffc9d8!important;
}
body.tv.board-only #tvLandingBanner[data-tone="wheel"]{
  background:linear-gradient(145deg,#55327c,#7b3b90)!important;
  border-color:#f2ce91!important;
}
body.tv.board-only #raceShowcaseScore{
  background:linear-gradient(160deg,#142d39ed,#203f50f2)!important;
  border:1px solid #a5d0c5aa!important;
  box-shadow:0 10px 30px #00131bb2,inset 0 1px #ffffff22!important;
}
body.tv.board-only #raceShowcaseScore .scoreRow{
  border:1px solid #c8e7ff29!important;
  background:linear-gradient(110deg,#1a3a49d9,#28465ccc)!important;
  transition:border-color .18s,background .18s,box-shadow .18s!important;
}
body.tv.board-only #raceShowcaseScore .scoreRow.active,
body.tv.board-only #raceShowcaseScore .scoreRow.current,
body.tv.board-only #raceShowcaseScore .scoreRow[aria-current="true"],
body.tv.board-only #raceShowcaseScore .scoreRow[data-active="true"]{
  background:linear-gradient(110deg,#66582fef,#35505aeb)!important;
  border-color:#ffda76!important;
  box-shadow:inset 0 0 0 1px #ffe3a466,0 0 12px #fbd66c45!important;
}
body.tv.board-only #raceShowcaseScore .scoreCoins{
  color:#ffe3a0!important;
  font-variant-numeric:tabular-nums!important;
  font-weight:950!important;
  text-shadow:0 1px 2px #07151a!important;
}
body.tv.board-only #raceShowcaseScore .scoreName{
  color:#ffffff!important;
  font-weight:900!important;
  text-shadow:0 1px 2px #071a29!important;
}
body.tv.board-only #raceShowcaseScore .scoreFooter{
  color:#d4f2ed!important;
  border-color:#b2e2d344!important;
}
body.tv.board-only #partyTools{gap:7px!important}
body.tv.board-only #partyTools button{
  background:linear-gradient(150deg,#183853f0,#253f63f2)!important;
  border:1px solid #c0dbe6aa!important;
  border-radius:13px!important;
  min-height:38px!important;
}
body.tv.board-only #moveSpeedOverlay{
  right:clamp(12px,1.8vw,27px)!important;
  bottom:clamp(68px,8vh,100px)!important;
  padding:9px 13px!important;
  max-width:min(32vw,195px)!important;
  min-height:42px!important;
  font-size:clamp(12px,1vw,15px)!important;
  line-height:1.2!important;
  white-space:normal!important;
  z-index:20!important;
}
body.tv.board-only #sceneHint{opacity:.76!important}
@media(max-width:950px),(max-height:680px){
 body.tv.board-only #tvLandingBanner{
  top:clamp(58px,9vh,78px)!important;
  max-width:min(72vw,490px)!important;
  padding:10px 14px!important;
  font-size:clamp(16px,2.8vw,25px)!important;
 }
 body.tv.board-only #moveSpeedOverlay{
  bottom:clamp(50px,8vh,72px)!important;
  right:8px!important;
  max-width:150px!important;
  min-height:34px!important;
 }
 body.tv.board-only #partyTools button{min-height:34px!important}
}
@media(prefers-reduced-motion:reduce){
 body.tv.board-only #raceShowcaseScore .scoreRow{transition:none!important}
}


/* Keep speed, current turn and room code in three independent rows.
   Previously the room code was painted above and across the turn label. */
body.tv.board-only #boardRoomCode{
  position:absolute!important;
  right:clamp(10px,1.4vw,22px)!important;
  bottom:clamp(9px,1.2vh,16px)!important;
  z-index:30!important;
  box-sizing:border-box!important;
  max-width:min(43vw,270px)!important;
  min-height:34px!important;
  padding:5px 12px!important;
  border:1.5px solid #b1c3ec!important;
  border-radius:14px!important;
  background:#172b50f2!important;
  color:#ffe2a1!important;
  font-size:clamp(12px,1.35vw,17px)!important;
  line-height:1.3!important;
  white-space:nowrap!important;
  text-align:center!important;
}
body.tv.board-only #cccActiveTurn:not(.hidden){
  position:absolute!important;
  right:clamp(10px,1.4vw,22px)!important;
  bottom:clamp(56px,7vh,69px)!important;
  z-index:29!important;
  box-sizing:border-box!important;
  min-height:44px!important;
  max-width:min(43vw,270px)!important;
  padding:9px 13px!important;
  justify-content:flex-start!important;
  white-space:normal!important;
}
body.tv.board-only #moveSpeedOverlay:not(.hidden){
  right:clamp(10px,1.4vw,22px)!important;
  bottom:clamp(118px,15vh,143px)!important;
  z-index:29!important;
  max-width:min(43vw,270px)!important;
}
@media(max-width:700px),(max-height:570px){
 body.tv.board-only #boardRoomCode{
  bottom:7px!important;min-height:27px!important;
  font-size:11px!important;padding:3px 8px!important;
 }
 body.tv.board-only #cccActiveTurn:not(.hidden){
  bottom:43px!important;min-height:32px!important;
  font-size:11px!important;padding:5px 8px!important;
 }
 body.tv.board-only #moveSpeedOverlay:not(.hidden){
  bottom:86px!important;min-height:34px!important;
  font-size:11px!important;padding:6px 9px!important;
 }
}
