/* Critter Coin Chase: consistent, readable host mode settings */
body.tv .r20-mode-settings{scroll-margin-top:16px}
body.tv .r20-mode-settings.r20-mode-enter{animation:cccModeSlideIn .28s cubic-bezier(.2,.8,.2,1) both}
@keyframes cccModeSlideIn{from{opacity:.3;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
body.tv .r20-mode-settings h3{margin-bottom:15px}
body.tv .r20-mode-settings .r20-q-setting{display:flex;flex-direction:column;gap:10px}
body.tv .r20-mode-settings .r20-q-setting select{margin:0;max-width:100%;font-weight:800}
body.tv .r20-mode-settings .r20-q-setting button{margin:2px 0 0}
body.tv .r20-mode-settings .r20-q-setting .r20-championship-explain{margin:1px 0 3px;line-height:1.4}
body.tv .r20-mode-settings .r20-start-hint{font-size:13px;font-weight:700;line-height:1.4;color:#dce7fc;text-align:center;margin:4px auto 0;max-width:40ch}
body.tv .r20-mode-settings button:disabled,
body.tv .r20-mode-settings .boardStartButton:disabled{opacity:1!important;filter:none!important;cursor:not-allowed!important;background:linear-gradient(180deg,#69768e,#505e78)!important;border:2px solid #afbdd3!important;color:#fff5de!important;text-shadow:0 1px 1px #18233d!important;box-shadow:0 4px 0 #253146!important}
body.tv .r20-mode-settings button:disabled:hover{transform:none!important}
body.tv .r20-mode-choice:focus-visible,body.tv .r20-mode-settings button:focus-visible{outline:3px solid #ffe39c;outline-offset:4px}
body.tv .r20-mode-settings .coinGoalChooser{margin-block:10px}
body.tv .r20-mode-settings .raceEnvironmentLobby{margin-block:10px}
body.tv #control #players,body.tv #control #log{max-height:210px;overflow:auto}
@media(prefers-reduced-motion:reduce){body.tv .r20-mode-settings.r20-mode-enter{animation:none!important}}


/* Compact, consistent board-game setup controls (TV host only). */
body.tv:not(.board-only) #control #actions .coinGoalChooser,
body.tv:not(.board-only) #control #actions .raceEnvironmentLobby{
  display:block;min-width:0;margin:8px 0!important;padding:12px 13px!important;
  border:1px solid #6e88b6;border-radius:15px;
  background:#142244;
}
body.tv:not(.board-only) #control #actions .coinGoalLabel{
  display:block;margin:0 0 9px!important;color:#c3d9fa;
  font-size:12px;font-weight:900;letter-spacing:.045em;line-height:1.25;
}
body.tv:not(.board-only) #control #actions .coinGoalOptions{
  display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr));
  gap:7px!important;align-items:stretch;
}
body.tv:not(.board-only) #control #actions .coinGoalOptions .coinGoalButton{
  grid-column:span 2;min-width:0!important;width:100%!important;min-height:48px!important;
  margin:0!important;padding:7px 3px!important;
  border-radius:11px;font-size:clamp(10px,1vw,15px)!important;
  line-height:1.13;white-space:normal;
}
body.tv:not(.board-only) #control #actions .coinGoalOptions .coinGoalSelected{
  background:linear-gradient(#fff0b5,#e6b04c)!important;color:#25203c!important;
  border:2px solid #fff1b5!important;box-shadow:0 0 0 2px #e8b34c70!important;
}
body.tv:not(.board-only) #control #actions .ccc-setup-select select,
body.tv:not(.board-only) #control #actions .raceEnvironmentLobby select{
  display:block!important;position:static!important;box-sizing:border-box!important;
  width:100%!important;height:48px!important;min-height:48px!important;
  margin:0!important;padding:9px 12px!important;
  border:2px solid #a5b9dd!important;border-radius:12px!important;
  background:#f6f8fd!important;color:#233451!important;
  font-size:clamp(13px,1.1vw,16px)!important;line-height:1.3!important;
  font-weight:850;box-shadow:none!important;
}
body.tv:not(.board-only) #control #actions .raceEnvironmentLobby p{
  margin:7px 0 0!important;font-size:12px;line-height:1.3;color:#c4dbea;
}
body.tv:not(.board-only) #control #actions .ccc-advanced-settings{
  margin:9px 0 0;border:1px solid #6e88b6;border-radius:15px;
  background:#142244;overflow:hidden;
}
body.tv:not(.board-only) #control #actions .ccc-advanced-settings summary{
  cursor:pointer;list-style-position:inside;padding:13px 14px;
  font-size:14px;font-weight:900;color:#f9dda0;
}
body.tv:not(.board-only) #control #actions .ccc-advanced-settings[open] summary{
  border-bottom:1px solid #6e88b6;
}
body.tv:not(.board-only) #control #actions .ccc-advanced-settings .walkthroughSetting{
  margin:0!important;padding:12px 14px;gap:10px;
  border:0;border-bottom:1px solid #465d82;border-radius:0;background:transparent;
}
body.tv:not(.board-only) #control #actions .ccc-advanced-settings .walkthroughSetting:last-child{border-bottom:0}
body.tv:not(.board-only) #control #actions .ccc-advanced-settings .walkthroughSetting strong{font-size:13px;line-height:1.25}
body.tv:not(.board-only) #control #actions .ccc-advanced-settings .walkthroughSetting small{font-size:12px;line-height:1.3}
body.tv:not(.board-only) #control #actions .ccc-advanced-settings .walkthroughToggle{
  min-width:68px;min-height:42px;margin:0!important;padding:7px 12px!important;
}
@media(max-width:1350px){
  body.tv:not(.board-only) #control #actions .coinGoalOptions .coinGoalButton:nth-child(4){grid-column:2/span 2}
  body.tv:not(.board-only) #control #actions .coinGoalOptions .coinGoalButton:nth-child(5){grid-column:4/span 2}
  body.tv:not(.board-only) #control #actions .coinGoalOptions .coinGoalButton{
    font-size:14px!important;
  }
}
@media(min-width:1351px){
  body.tv:not(.board-only) #control #actions .coinGoalOptions{grid-template-columns:repeat(5,minmax(0,1fr))}
  body.tv:not(.board-only) #control #actions .coinGoalOptions .coinGoalButton{grid-column:auto}
}

/* Compact board settings only: leave the 3D scene and mode selection untouched. */
body.tv.ccc-host-lobby .r20-mode-settings .ccc-board-settings{margin-top:7px!important}
body.tv.ccc-host-lobby .r20-mode-settings .ccc-board-settings>summary{
  padding:4px 2px!important;line-height:1.3!important;
}
body.tv.ccc-host-lobby .r20-mode-settings .ccc-board-config{
  margin:4px 0 3px!important;font-size:clamp(11px,1.05vw,13px)!important;
  line-height:1.35!important;overflow-wrap:normal!important;
}
body.tv.ccc-host-lobby .r20-mode-settings .ccc-board-settings>.coinGoalChooser,
body.tv.ccc-host-lobby .r20-mode-settings .ccc-board-settings>.raceEnvironmentLobby{
  margin:7px 0!important;padding:9px 10px!important;
  border-radius:13px!important;
}
body.tv.ccc-host-lobby .r20-mode-settings .ccc-board-settings .coinGoalLabel{
  margin-bottom:6px!important;font-size:clamp(11px,1.04vw,13px)!important;
}
body.tv.ccc-host-lobby .r20-mode-settings .ccc-board-settings .coinGoalOptions{
  gap:6px!important;
}
body.tv.ccc-host-lobby .r20-mode-settings .ccc-board-settings .coinGoalButton{
  min-height:43px!important;padding:6px 5px!important;
}
body.tv.ccc-host-lobby .r20-mode-settings .ccc-board-settings .ccc-setup-select select,
body.tv.ccc-host-lobby .r20-mode-settings .ccc-board-settings .raceEnvironmentLobby select{
  height:44px!important;min-height:44px!important;
  padding:8px 11px!important;
}
body.tv.ccc-host-lobby .r20-mode-settings .ccc-board-settings .raceEnvironmentLobby p{
  margin-top:5px!important;
}
@media(max-width:650px){
 body.tv.ccc-host-lobby .r20-mode-settings .ccc-board-settings .coinGoalButton{
  min-height:46px!important;
 }
}


/* Chrome/Safari parity for closed dropdowns on the TV lobby.
   WebKit otherwise paints metallic controls with double spinner arrows.
   Keep the native select element and keyboard/screen-reader interactions. */
body.tv .r20-mode-settings select,
body.tv .r20-mini-music-setting select,
body.tv .ccc-ai-lobby-controls select,
body.tv .ccc-board-settings select{
  -webkit-appearance:none!important;
  -moz-appearance:none!important;
  appearance:none!important;
  box-sizing:border-box!important;
  display:block;
  max-width:100%!important;
  border:2px solid #a5b9dd!important;
  border-radius:12px!important;
  background-color:#f5f8ff!important;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23233451' stroke-width='2.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")!important;
  background-repeat:no-repeat!important;
  background-position:right 13px center!important;
  background-size:18px 18px!important;
  box-shadow:none!important;
  color:#233451!important;
  -webkit-text-fill-color:#233451!important;
  font-family:inherit!important;
  font-size:clamp(14px,1.35vw,18px)!important;
  font-weight:800!important;
  line-height:1.3!important;
  padding:9px 43px 9px 13px!important;
  min-height:44px!important;
  height:48px!important;
  text-align:left!important;
  text-align-last:left!important;
  cursor:pointer;
}
body.tv .r20-mode-settings select:focus-visible,
body.tv .r20-mini-music-setting select:focus-visible,
body.tv .ccc-ai-lobby-controls select:focus-visible,
body.tv .ccc-board-settings select:focus-visible{
  outline:3px solid #ffe39c!important;
  outline-offset:3px!important;
}
body.tv .r20-mode-settings select:disabled,
body.tv .r20-mini-music-setting select:disabled,
body.tv .ccc-ai-lobby-controls select:disabled{
  opacity:.68!important;
  cursor:not-allowed!important;
}
body.tv .r20-mode-settings .r20-championship-setup select,
body.tv .r20-mini-music-setting select{width:100%!important;min-width:0!important}
body.tv .r20-mini-music-setting .r20-mini-music-row{min-width:0}
body.tv .r20-mini-music-setting .r20-mini-music-row select{flex:1 1 auto}
body.tv .ccc-ai-lobby-controls select{
  width:auto!important;min-width:125px!important;
  height:43px!important;min-height:43px!important;
  background-color:#f5f8ff!important;
  color:#233451!important;
}
@media(max-width:600px){
  body.tv .r20-mode-settings select,
  body.tv .r20-mini-music-setting select{font-size:15px!important}
}

/* Persistent TV audio balance, shared with Host Controls and the soundtrack
   picker. No changes to game UI outside the setup panels. */
body.tv .r20-mini-music-setting .ccc-lobby-audio-mix{
 display:grid;gap:8px;max-width:100%;margin-top:9px;padding:11px;
 background:linear-gradient(160deg,#172f4e,#10233d);border:1px solid #87b2d5;
 border-radius:12px;
}
body.tv .ccc-lobby-audio-mix .ccc-lobby-mix-heading{color:#ffe6a9;font-size:12px;letter-spacing:.04em}
body.tv .ccc-lobby-audio-mix .ccc-lobby-mix-control{
 position:relative;display:grid;gap:7px;min-width:0;padding:8px 10px 9px;
 background:#24415f;border:1px solid #85afd07d;border-radius:10px;
 color:#fff7e5;font-weight:850;font-size:12px;
}
body.tv .ccc-lobby-audio-mix .ccc-lobby-mix-control input{
 display:block;width:100%;min-width:0;max-width:100%;margin:0;accent-color:#92edc0;
}
body.tv .ccc-lobby-audio-mix .ccc-lobby-mix-control output{
 position:absolute;top:8px;right:10px;color:#ffe5aa;font-weight:950;
}
body.tv .ccc-lobby-audio-mix .ccc-lobby-mix-preset{
 width:100%;min-height:40px;border:1px solid #9ce9bc;border-radius:9px;
 background:#255e5c;color:#e6fff5;font:850 12px system-ui;padding:8px 10px;
}


/* 16:9 host lobby: reserve space for the start/settings button without
   squeezing gameplay or altering the in-game panels. */
@media (min-width:1061px) and (max-height:950px){
 body.tv.ccc-host-lobby:not(.board-only) #app.layout{padding-top:9px!important;gap:12px!important}
 body.tv.ccc-host-lobby:not(.board-only) #app>aside#control{gap:7px!important;padding:10px 12px!important}
 body.tv.ccc-host-lobby #control .ccc-host-top{padding:0 2px 6px!important}
 body.tv.ccc-host-lobby #control #roomJoinQR{margin-block:0!important}
 body.tv.ccc-host-lobby #control .r20-quality-lobby{padding:8px!important}
 body.tv.ccc-host-lobby #control .r20-mode-heading{margin-bottom:5px!important;line-height:1.1!important}
 body.tv.ccc-host-lobby #control .r20-mode-cards{gap:4px!important}
 body.tv.ccc-host-lobby #control .r20-mode-choice{min-height:35px!important;padding:4px 8px!important}
 body.tv.ccc-host-lobby #control .r20-mode-choice small{font-size:10px!important;line-height:1.12!important}
 body.tv.ccc-host-lobby #control .r20-mode-settings{margin-top:5px!important;padding:6px!important}
 body.tv.ccc-host-lobby #control .r20-start-hint{margin-top:3px!important}
 body.tv.ccc-host-lobby #control .boardStartButton{min-height:38px!important}
}
/* Keep the entire game list below its own trigger rather than having the OS
   native select paint upward across the active-room badge. */
body.tv.ccc-host-lobby .ccc-party-option-label .ccc-party-native-select{
 position:absolute!important;width:1px!important;height:1px!important;
 min-width:1px!important;min-height:1px!important;
 overflow:hidden!important;clip-path:inset(50%)!important;
 padding:0!important;border:0!important;opacity:0!important;
 pointer-events:none!important;
}
body.tv.ccc-host-lobby .ccc-party-picker{
 position:relative;display:block;min-width:0;width:100%;margin-top:5px;
 border:1px solid #a5b9dd;border-radius:11px;background:#f6f8fd;color:#233451;
}
body.tv.ccc-host-lobby .ccc-party-picker-summary{
 padding:10px 12px;min-height:44px;cursor:pointer;list-style:none;
 font-size:clamp(12px,1vw,15px);font-weight:850;line-height:1.3;
 overflow-wrap:anywhere;
}
body.tv.ccc-host-lobby .ccc-party-picker-summary::-webkit-details-marker{display:none}
body.tv.ccc-host-lobby .ccc-party-picker[open] .ccc-party-picker-summary{
 border-bottom:1px solid #b7c8de;
}
body.tv.ccc-host-lobby .ccc-party-picker-items{
 max-height:min(220px,28dvh);overflow-y:auto;overscroll-behavior:contain;
 padding:5px;display:flex;flex-direction:column;gap:3px;
}
body.tv.ccc-host-lobby .ccc-party-picker-item{
 display:block;width:100%;min-height:34px;margin:0!important;
 padding:7px 9px!important;text-align:left;white-space:normal!important;
 color:#213454!important;background:#fff!important;
 border:1px solid #d6e1ef!important;border-radius:7px!important;
 font-size:12px!important;line-height:1.3!important;font-weight:650!important;
 box-shadow:none!important;transform:none!important;
}
body.tv.ccc-host-lobby .ccc-party-picker-item[aria-pressed="true"]{
 background:#d7f5e8!important;border-color:#51b69b!important;font-weight:850!important;
}
body.tv.ccc-host-lobby .ccc-party-picker-summary:focus-visible,
body.tv.ccc-host-lobby .ccc-party-picker-item:focus-visible{
 outline:3px solid #e4a22d;outline-offset:1px;
}
@media (min-width:1061px) and (max-height:950px){
 body.tv.ccc-host-lobby .ccc-party-mode-settings{gap:5px!important}
 body.tv.ccc-host-lobby .ccc-party-mode-settings h3{margin:0 0 4px!important}
 body.tv.ccc-host-lobby .ccc-party-active{margin:3px 0 5px!important;padding-block:6px!important}
}
