/* Typing Racer 2.0: the lead ad in the top bar (Nov 27 2026). Loaded after css/racer-narrow.css.
   The page's script (RacerAdStart and RacerTopFit in games/typing-racer.php) picks the unit once, when the page has
   loaded, by the room there is: 728x90, else 320x50 (#leadPlug.ad320), else none (.adNone). Then it only places it.

   The rule the layout keeps: nothing is ever drawn over the ad and the ad is never drawn over anything.
   On a short window (the band: title and buttons at the left, coins at the right, 90px tall) the ad sits in the gap
   between them, in the middle of the page when that is clear and as near it as it can be when not. If the gap gets
   too small for the unit that was loaded (the chat column opened, the window narrowed), the ad steps aside (.adHide)
   until there is room again. On taller windows, tablets and phones the ad has a row of its own, as before. */

/* until the size is chosen nothing shows where the ad will be */
body#typingRacer #leadPlug.adWait{visibility:hidden;}
body#typingRacer #leadPlug.adNone, body#typingRacer #leadPlug.adHide{display:none;}
/* the 320x50 unit, wherever it sits */
html body#typingRacer #leadPlug.ad320{width:320px; height:50px;}
/* the unit is a fixed size (no "auto" format), so its box never grows into the lobby under it */
body#typingRacer #leadPlug ins.adsbygoogle{display:inline-block; vertical-align:top;}

/* the band: the script sets `left`; this is where it sits before that (the middle) and how high */
@media only screen and (max-height:819px) and (min-width:1000px){
	body#typingRacer #leadPlug{position:absolute; left:calc(50% - 364px); top:52px; margin:0;}		/* (52px: where the band starts inside #trgInterfaceContainer, css/_u_trg.css) */
	body#typingRacer #leadPlug.ad320{left:calc(50% - 160px); top:72px;}
}

/* A logged-out visitor's "Racer chat" card is put away while the race runs: on a laptop it lay over the right end
   of the road. It is back for the results. */
html.trRacing body#typingRacer #chatTeaser{display:none;}

/* The sign-up bar under the menu gives way when the lobby would not fit under it (FitRace in games/typing-racer.php
   sets html.trNoNudge on a short window, and takes it off when there is room). The menu's Register is still there. */
html.trNoNudge body#typingRacer > .stoConsentBannerWrap{display:none !important;}

/* In a room the Lobby button gives up its word when that is what lets the ad keep its place (body.trAdTight, AdPlace) */
body#typingRacer.trAdTight #topLobbyBtn{width:28px; padding:0; gap:0; justify-content:center;}
body#typingRacer.trAdTight #topLobbyBtn .tlWord{display:none;}

/* A logged-out visitor's "Racer chat" card never reaches up into the top bar: on a short window its body is shorter
   (in the lobby it stands 86px off the foot of the window, in a room 157px; the top bar ends about 150px down). */
body#typingRacer #chatTeaser .ctBody{height:min(300px, calc(100vh - 285px));}
body#typingRacer.hudFull #chatTeaser .ctBody{height:min(300px, calc(100vh - 356px));}
