/* Critter Coin Chase · uncluttered TV host bar.
   Only critical actions stay exposed. All optional options live in one drawer. */
body:not(.tv) #cccHostControls{display:none!important}
body.tv #cccHostControls{
 position:absolute;z-index:100004;top:13px;right:14px;
 display:block;width:176px;max-width:min(330px,calc(100vw - 22px));
 padding:0;margin:0;color:#fff5de;border:1px solid #e9d39bbd;
 border-radius:13px;background:linear-gradient(155deg,#284665f5,#172b4cf5);
 box-shadow:0 4px 0 #0c1a34ad,0 11px 24px #08142b91;
 font:850 12px/1.25 system-ui,-apple-system,'Segoe UI',sans-serif;
 backdrop-filter:blur(9px);
}
body.tv #cccHostControls[open]{width:315px;max-height:min(75vh,650px);overflow:auto}
body.tv #cccHostControls .ccc-host-summary{
 cursor:pointer;display:block;list-style:none;user-select:none;
 padding:12px 13px;letter-spacing:.07em;min-height:19px;color:#fff8e7;
}
body.tv #cccHostControls .ccc-host-summary::-webkit-details-marker{display:none}
body.tv #cccHostControls .ccc-host-summary:after{content:'⌄';float:right;color:#ffe2a2;font-size:20px;line-height:12px}
body.tv #cccHostControls[open] .ccc-host-summary{border-bottom:1px solid #ffedb83b;background:#42668377}
body.tv #cccHostControls[open] .ccc-host-summary:after{content:'⌃'}
body.tv #cccHostControls .ccc-host-summary:focus-visible{outline:3px solid #b5f6ed;outline-offset:-3px;border-radius:12px}
body.tv #cccHostControls #partyTools,body.tv.board-only #cccHostControls #partyTools{
 position:static!important;inset:auto!important;display:grid!important;
 grid-template-columns:repeat(2,minmax(0,1fr));gap:8px!important;
 justify-content:stretch!important;align-items:stretch!important;
 box-sizing:border-box;width:100%!important;max-width:none!important;
 margin:0!important;padding:11px!important;background:transparent!important;
 box-shadow:none!important;
}
body.tv #cccHostControls:not([open]) #partyTools{display:none!important}
body.tv #cccHostControls #partyTools button{
 border-radius:10px!important;padding:9px 6px!important;
 min-height:43px!important;white-space:normal!important;
 font:850 11px/1.22 system-ui!important;
 color:#fff8e7!important;background:linear-gradient(175deg,#355c7f,#243a62)!important;
 border:1px solid #d9e6f498!important;box-shadow:0 3px 0 #0c1933!important;
 text-shadow:none!important;letter-spacing:0!important;
}
body.tv #cccHostControls #partyTools button:hover:not(:disabled){background:linear-gradient(175deg,#4a7694,#305475)!important}
body.tv #cccHostControls #partyTools button:focus-visible{outline:3px solid #9ef0d8;outline-offset:2px}
body.tv #cccHostControls .raceEnvironmentToolbar{
 grid-column:1/-1;display:grid;grid-template-columns:88px minmax(0,1fr);
 align-items:center;gap:8px;width:100%;box-sizing:border-box;
 padding:8px 9px;border-radius:10px;background:#1024437f;
 color:#e6f9ed;font-weight:900;
}
body.tv #cccHostControls .raceEnvironmentToolbar[hidden]{display:none!important}
body.tv #cccHostControls .raceEnvironmentToolbar select{
 display:block;width:100%!important;max-width:none!important;min-width:0;
 border-radius:8px;padding:7px;font:800 12px system-ui;
}
/* Board-view toggle and pause remain one-click controls. */
body.tv.board-only #tvBoardModeBtn{top:14px;left:14px;min-height:40px;z-index:100003}
body.tv.board-only .r20-quality-controls:not(.r20-quality-lobby):not(.r20-quality-inline){top:68px;left:14px;right:auto;z-index:100002}
body.tv.board-only #cccBoardHelp{
 display:block!important;position:absolute!important;
 top:68px!important;left:156px!important;bottom:auto!important;
 z-index:100003!important;padding:10px 13px!important;min-height:40px!important;
 background:linear-gradient(160deg,#244f68,#18334f)!important;
 border-color:#e9e2b3!important;box-shadow:0 4px 0 #0d1b2ea6,0 10px 22px #0007!important;
 font:850 12px system-ui!important;white-space:nowrap;
}
body.tv.board-only #raceShowcaseLogo{left:235px;top:14px;z-index:18}
/* Keep the score card at bottom-left completely clear of rule buttons. */
@media(max-width:800px){body.tv.board-only #raceShowcaseLogo{display:none!important}}
@media(max-width:600px){
 body.tv #cccHostControls{top:9px;right:9px;width:147px;max-width:calc(100vw - 18px)}
 body.tv #cccHostControls[open]{width:min(300px,calc(100vw - 18px))}
 body.tv #cccHostControls .ccc-host-summary{font-size:11px;padding:11px 9px}
 body.tv.board-only #tvBoardModeBtn{top:10px;left:9px;min-height:38px;font-size:11px;padding:7px 9px}
 body.tv.board-only .r20-quality-controls:not(.r20-quality-lobby):not(.r20-quality-inline){top:59px;left:9px}
 body.tv.board-only #cccBoardHelp{top:59px!important;left:138px!important;padding:9px!important;min-height:36px!important;font-size:11px!important}
}

/* Persistent, independent Music / Game Sounds mixer for board and all
   mini-games. The soundtrack picker and pre-game menus use the same settings. */
body.tv #cccHostControls .ccc-host-volume-mixer{
 display:grid;gap:8px;padding:12px;border-top:1px solid #b3d7ed65;
 background:linear-gradient(160deg,#122d4af5,#102039f5);
}
body.tv #cccHostControls:not([open]) .ccc-host-volume-mixer{display:none!important}
body.tv #cccHostControls .ccc-host-mixer-heading{
 color:#ffdf9b;font:950 12px/1.25 system-ui;letter-spacing:.04em
}
body.tv #cccHostControls .ccc-host-mixer-note{
 margin:0;color:#c9e4f4;font:650 11px/1.35 system-ui
}
body.tv #cccHostControls .ccc-host-volume-mixer label{
 position:relative;display:grid!important;grid-template-columns:1fr!important;gap:8px!important;
 min-width:0;margin:0!important;padding:10px 11px 9px!important;
 background:#193656!important;border:1px solid #80a6c07c!important;
 border-radius:11px!important;color:#f0f8ff!important;
 font:900 12px/1.3 system-ui!important;
}
body.tv #cccHostControls .ccc-host-volume-mixer label input{
 display:block!important;width:100%!important;min-width:0!important;
 max-width:none!important;margin:0!important;accent-color:#79f2c6!important;cursor:pointer;
}
body.tv #cccHostControls .ccc-host-volume-mixer label output{
 position:absolute;right:11px;top:10px;color:#ffe8ab;
 font:950 12px/1.3 system-ui;pointer-events:none;
}
body.tv #cccHostControls .ccc-host-volume-mixer button{
 display:block;width:100%;min-height:38px;padding:7px 9px;line-height:1.25;
 border-radius:9px;background:#274e70;color:#f8f5e8;border:1px solid #8fc7dd;
 font:850 11px system-ui;cursor:pointer;
}
body.tv #cccHostControls .ccc-host-volume-mixer .ccc-host-mix-preset{
 background:#245d58;border-color:#8af5bd;color:#e8fff5
}
body.tv #cccHostControls .ccc-host-volume-mixer button:focus-visible,
body.tv #cccHostControls .ccc-host-volume-mixer input:focus-visible{
 outline:3px solid #f9de8c;outline-offset:2px;
}
/* One persistent SFX slider shared by the board and every TV mini-game. */
body.tv #cccHostControls .ccc-host-effects-volume{
 display:grid!important;grid-template-columns:1fr!important;gap:7px!important;
 padding:10px 12px!important;margin:0!important;
 color:#e7f5ff!important;background:#1029479c!important;
 border-top:1px solid #a4c0d563!important;
 font:850 12px/1.3 system-ui!important;
}
body.tv #cccHostControls .ccc-host-effects-volume input{
 display:block!important;width:100%!important;max-width:100%!important;
 min-width:0!important;margin:0!important;accent-color:#ffcb79!important;
 touch-action:pan-x;
}
body.tv #cccHostControls:not([open]) .ccc-host-effects-volume{display:none!important}


/* Single-outline Host Controls within fullscreen mini-games. */
#r20MiniGame.r20-mg-tv #cccHostControls{
 border:2px solid #94d8ea!important;border-radius:14px!important;
 outline:0!important;box-shadow:0 12px 26px #071834a8!important;
 background:linear-gradient(155deg,#29496a,#172d4e)!important;
}
#r20MiniGame.r20-mg-tv #cccHostControls>.ccc-host-summary{
 display:block!important;background:transparent!important;
 border:0!important;outline:0!important;box-shadow:none!important;
 margin:0!important;border-radius:12px!important;
 padding:11px 13px!important;color:#fff5d7!important;
}
#r20MiniGame.r20-mg-tv #cccHostControls>.ccc-host-summary:focus-visible{
 outline:2px solid #c8ffef!important;outline-offset:-3px!important;
}
#r20MiniGame.r20-mg-tv #cccHostControls::before,
#r20MiniGame.r20-mg-tv #cccHostControls::after,
#r20MiniGame.r20-mg-tv #cccHostControls>.ccc-host-summary::before{content:none!important}

/* Soundtrack picker: show actual music percentage beside its existing slider. */
#raceMusicVolumeValue{display:inline-block;min-width:38px;text-align:right;color:#ffe6a3;font:900 13px system-ui}

/* Fullscreen presentation: only floating HOST controls fade. The room badge,
   timers, game choices, player portraits and in-game actions remain readable. */
@media (hover:hover) and (pointer:fine){
 body.tv.ccc-fullscreen-controls-hidden #r20MiniGame #cccVisibleFullscreen,
 body.tv.ccc-fullscreen-controls-hidden #cccVisibleFullscreen:not(.ccc-fullscreen-lobby),
 body.tv.ccc-fullscreen-controls-hidden #tvBoardModeBtn,
 body.tv.ccc-fullscreen-controls-hidden #cccHostControls:not([open]),
 body.tv.ccc-fullscreen-controls-hidden #partyTools:not(#cccHostControls #partyTools),
 body.tv.ccc-fullscreen-controls-hidden #cccBoardHelp:not(#cccHostControls #cccBoardHelp),
 body.tv.ccc-fullscreen-controls-hidden #cccBoardMenu:not(#cccHostControls #cccBoardMenu),
 body.tv.ccc-fullscreen-controls-hidden .r20-quality-controls:not(.r20-quality-lobby):not(.r20-quality-inline),
 body.tv.ccc-fullscreen-controls-hidden #r20MiniGame.r20-mg-tv .r20-mg-practice-bar,
 body.tv.ccc-fullscreen-controls-hidden #r20MiniGame.r20-mg-tv .r20-mg-champ-bar{
  opacity:0!important;
  visibility:hidden!important;
  pointer-events:none!important;
  transform:translateY(-12px)!important;
 }
 body.tv #cccVisibleFullscreen,
 body.tv #tvBoardModeBtn,
 body.tv #cccHostControls,
 body.tv #partyTools,
 body.tv #cccBoardHelp,
 body.tv #cccBoardMenu,
 body.tv .r20-quality-controls:not(.r20-quality-lobby):not(.r20-quality-inline),
 body.tv #r20MiniGame.r20-mg-tv .r20-mg-practice-bar,
 body.tv #r20MiniGame.r20-mg-tv .r20-mg-champ-bar{
  transition:opacity .28s ease,transform .28s ease,visibility .28s ease!important;
 }
}


/* Fullscreen board toolbar: Pause is not allowed over the Critter Party logo.
   Host Controls occupy the upper-right corner; Pause sits directly below. */
body.tv.board-only #app .r20-quality-controls:not(.r20-quality-lobby):not(.r20-quality-inline),
body.tv.board-only #boardWrap .r20-quality-controls:not(.r20-quality-lobby):not(.r20-quality-inline){
 position:fixed!important;
 top:76px!important;right:14px!important;left:auto!important;bottom:auto!important;
 transform:none!important;z-index:100002!important;
 display:flex!important;align-items:center!important;justify-content:flex-end!important;
 width:max-content!important;max-width:min(190px,calc(100vw - 28px))!important;
 padding:4px!important;margin:0!important;background:#162c4bd9!important;
}
@media(max-width:650px){
 body.tv.board-only #app .r20-quality-controls:not(.r20-quality-lobby):not(.r20-quality-inline),
 body.tv.board-only #boardWrap .r20-quality-controls:not(.r20-quality-lobby):not(.r20-quality-inline){
  top:62px!important;right:9px!important;left:auto!important;max-width:150px!important;
 }
}


/* Board-only fullscreen: the branded sign is centred at the top.
   Anchor the dedicated Pause toolbar below the top-right host drawer,
   never over the sign or the board centre. */
body.tv.board-only #r20QualityControls:not(.r20-quality-mini-header):not(.r20-quality-inline):not(.r20-quality-lobby){
 position:fixed!important;top:76px!important;right:14px!important;
 left:auto!important;bottom:auto!important;transform:none!important;
 width:max-content!important;max-width:175px!important;margin:0!important;
 padding:3px!important;justify-content:flex-end!important;
 z-index:100020!important;
}
body.tv.board-only #r20QualityControls > button{
 min-height:44px!important;white-space:nowrap!important;
}
@media(max-width:650px){
 body.tv.board-only #r20QualityControls:not(.r20-quality-mini-header):not(.r20-quality-inline):not(.r20-quality-lobby){
  top:65px!important;right:9px!important;left:auto!important;
  max-width:145px!important;
 }
}


/* Always dock the active fullscreen-board Pause control below the brand.
   This selector also covers the moment before JavaScript has positioned it. */
body.tv #app #r20QualityControls.ccc-board-pause-docked,
body.tv.board-only #r20QualityControls.ccc-board-pause-docked{
 position:fixed!important;
 top:96px!important;right:14px!important;left:auto!important;bottom:auto!important;
 inset-block-start:96px!important;inset-inline-start:auto!important;
 inset-inline-end:14px!important;transform:none!important;
 width:max-content!important;max-width:min(190px,calc(100vw - 28px))!important;
 margin:0!important;padding:3px!important;
 z-index:100020!important;
}
@media(max-width:650px){
 body.tv #app #r20QualityControls.ccc-board-pause-docked,
 body.tv.board-only #r20QualityControls.ccc-board-pause-docked{
  top:86px!important;right:9px!important;
  inset-block-start:86px!important;inset-inline-end:9px!important;
 }
}


/* Dedicated board Pause action, not the old quality-controls toolbar.
   Keep the centred Critter Party sign unobstructed at all board sizes. */
#cccBoardPauseButton{
 position:fixed!important;
 top:96px!important;
 right:14px!important;
 left:auto!important;
 bottom:auto!important;
 transform:none!important;
 box-sizing:border-box!important;
 width:max-content!important;
 min-width:115px!important;
 min-height:45px!important;
 max-width:calc(100vw - 28px)!important;
 margin:0!important;
 padding:9px 18px!important;
 z-index:2147482000!important;
 display:inline-flex!important;
 align-items:center!important;
 justify-content:center!important;
 border:2px solid #ffe49a!important;
 border-radius:14px!important;
 background:linear-gradient(165deg,#244e81,#152945)!important;
 box-shadow:0 4px 0 #a97932,0 8px 18px #00152c99!important;
 color:#fff1c8!important;
 font:950 clamp(14px,1.2vw,19px)/1.15 system-ui,sans-serif!important;
 letter-spacing:.02em!important;
 text-shadow:none!important;
 white-space:nowrap!important;
 cursor:pointer!important;
}
#cccBoardPauseButton[hidden]{display:none!important}
#cccBoardPauseButton:hover{filter:brightness(1.12)}
#cccBoardPauseButton:focus-visible{outline:3px solid #a6ffe0;outline-offset:3px}
@media(max-width:650px){
 #cccBoardPauseButton{
  top:86px!important;right:9px!important;min-height:41px!important;
  min-width:95px!important;padding:7px 10px!important;font-size:13px!important;
 }
}


/* Final board Pause isolation: the old centred quality toolbar must NEVER
   appear on the 3D board. The separate #cccBoardPauseButton is the only
   one-click Pause action during board play. */
body.tv.board-only.ccc-board-playing #r20QualityControls,
body.tv.ccc-board-playing #r20QualityControls:not(.r20-quality-mini-header),
body.tv.board-only #app #r20QualityControls:not(.r20-quality-lobby){
 display:none!important;visibility:hidden!important;pointer-events:none!important;
}
body.tv.board-only #cccBoardPauseButton:not([hidden]),
body.tv.ccc-board-playing #cccBoardPauseButton:not([hidden]){
 display:inline-flex!important;position:fixed!important;
 top:96px!important;right:14px!important;
 left:auto!important;bottom:auto!important;transform:none!important;
 z-index:2147482000!important;
}
