/* Typing Racer: the text box's choices and the dash's compact form (owner, 2026-12-02).
   The choices are in the race page's Settings tab (js/racer/textbox.js keeps them, js/trg.js draws the box).
   Loaded after css/_u_trg.css and css/racer-dash.css, before css/racer-neon.css. */

/* ---- Two lines (html.trgBlock; js/trg.js TrgBlockDraw puts .trgBlockBox on the box) -------------------------------
   The line being typed comes first in the page (so the letters run on in order), and each line keeps its place,
   top or bottom, by its number: the cursor runs along one, then drops to the other. */
#racerHud #lineDivContainer.trgBlockBox{display:flex; flex-direction:column; justify-content:center; padding:2px 12px 2px; white-space:nowrap;}
/* at most 48 letters a line (js/trg.js TRG_BLOCK_MAX sets --trgBlkW to that width): in a wider box the two lines sit
   centred, still starting at the same place */
#racerHud #lineDivContainer div.blockLines.trgBlkLine{flex:none; width:var(--trgBlkW, 100%); max-width:100%; margin:0 auto; font-size:30px; height:34px; line-height:34px; text-align:left; overflow:hidden;}
/* in a room the dash is 14px taller for the two lines (the race fits above it: FitRace in games/typing-racer.php) */
html.trgBlock:not(.trPortrait) body.hudFull #racerHud:not(.slim) #hudRow{height:102px;}
html.trgBlock:not(.trPortrait) body.hudFull #racerHud:not(.slim) #hudText,
html.trgBlock:not(.trPortrait) body.hudFull #racerHud:not(.slim) #lineDivContainer{height:94px;}
html.trgBlock:not(.trPortrait) body.hudFull #racerHud #lineDivContainer div.blockLines.trgBlkLine{height:40px; line-height:40px;}
/* and no wider than a 48-letter line (js/trg.js TrgBlockWidth sets --trgBlkMax), so there is no blank space either
   side of the words. On a big screen the room that leaves is shared out evenly: the speedometer sits centred in the space
   to the box's left, the buttons in the space to its right (equal auto margins; none when there is no spare room). */
html.trgBlock:not(.trPortrait) body.hudFull #racerHud:not(.slim) #hudText{max-width:var(--trgBlkMax, none); margin:0;}
html.trgBlock:not(.trPortrait) body.hudFull #racerHud:not(.slim) #hudRow > #wrapStats,
html.trgBlock:not(.trPortrait) body.hudFull #racerHud:not(.slim) #hudRow > #buttonWrapper{margin:0 auto;}
html.trgBlock:not(.trPortrait) body#typingRacer.hudFull{padding-bottom:171px;}
html.trgBlock:not(.trPortrait) body.hudFull #chatWrap, html.trgBlock:not(.trPortrait) body.hudFull #chatTeaser{bottom:171px;}
html.trgBlock:not(.trPortrait) body.hudFull #sJoinSolo #sJoinServer{bottom:177px;}
#racerHud #lineDivContainer div.trgBlkTop{order:0;}
#racerHud #lineDivContainer div.trgBlkBottom{order:1;}
/* a phone held upright keeps one line (RacerText.Block); its box is too short for two. On a touch screen the
   "Tap here to type" tag moves onto the box's lower edge, off the second line's first words */
html.trgBlock body.racerTouch:not(.racerTouchOn) #racerHud:not(.watching) #hudText::after{left:auto; right:12px; bottom:-9px;}

/* ---- Turbo cursor off (html.trgNoTurboFx; js/racer/boost.js marks .nxRim / .nxRimEven / .nxRimFire instead) ----------
   Only the rim takes the pace colour; the cursor, the letters behind it and the flame stay as they always are. */
#racerHud.nxRim #lineDivContainer{border-color:var(--nxC); box-shadow:0 0 0 4px var(--dk-pod, #0b1013), 0 0 0 5px var(--nxC), 0 0 24px 5px var(--nxGlow);}
#racerHud.nxRim.nxRimEven #lineDivContainer{border-color:#c3ccd4; box-shadow:0 0 0 4px var(--dk-pod, #0b1013), 0 0 0 5px #c3ccd4, 0 0 22px 4px rgba(255,255,255,.18);}
#racerHud.nxRimFire #lineDivContainer{border-color:#ff2a12; box-shadow:0 0 0 4px var(--dk-pod, #0b1013), 0 0 0 5px #ff2a12, 0 0 30px 9px rgba(255,36,18,.7);}
#racerHud.nxRim #lineDivContainer.trgStuck{border-color:#ff0362; box-shadow:0 0 0 4px var(--dk-pod, #0b1013), 0 0 0 5px #ff0362, 0 0 26px 7px rgba(255,3,98,.65);}
html.trgNoTurboFx #nitroFire{display:none !important;}

/* ---- The cars' pictures while racing (html.trRacing, owner 2026-12-03) ----------------------------------------------
   Each car picture is its own layer on the graphics card. The cars are moved by their left, top and margins (the glide,
   the pack, the wobble), so without this every frame repainted the race and drew all eight car pictures (SVG) again;
   now a moved car is only slid. Measured at 6x CPU slowdown, Smooth typing on: 499 -> 837 frames a race, key to screen
   144 -> 60 ms. (The picture already sets a z-index, so this changes nothing in what sits over what.) Only while
   racing: the finisher shows scale the picture, and a layer would keep it at its first size. */
html.trRacing .raceCar .racerImg{will-change:transform;}

/* ---- Smooth typing (html.trgLite) ------------------------------------------------------------------------------------
   Everything on the dash that is only for show stands still or goes, and the text box is drawn on its own, so a key
   redraws nothing but the box. (Calm animations come with it: html.trgCalm, js/racer/motion.js.) */
html.trgLite #racerHud, html.trgLite #racerHud *, html.trgLite #racerHud *::before, html.trgLite #racerHud *::after{transition:none !important; animation:none !important;}
html.trgLite #racerHud::before, html.trgLite #racerHud::after{animation:none !important;}
html.trgLite #racerHud .dkFx, html.trgLite #racerHud .dkDialFire, html.trgLite #racerHud .dkDialZap, html.trgLite #racerHud .dkDialGold, html.trgLite #racerHud .dkDialGhost{display:none !important;}
html.trgLite #racerHud #lineDivContainer{contain:layout paint; box-shadow:0 0 0 4px var(--dk-pod, #0b1013), 0 0 0 5px var(--dk-rim, #3e4c54);}
html.trgLite #racerHud.nxRim #lineDivContainer{box-shadow:0 0 0 4px var(--dk-pod, #0b1013), 0 0 0 5px var(--nxC);}
html.trgLite #racerHud.nxRim.nxRimEven #lineDivContainer{box-shadow:0 0 0 4px var(--dk-pod, #0b1013), 0 0 0 5px #c3ccd4;}
html.trgLite #racerHud.nxRimFire #lineDivContainer{box-shadow:0 0 0 4px var(--dk-pod, #0b1013), 0 0 0 5px #ff2a12;}
html.trgLite #racerHud.nxRim #lineDivContainer.trgStuck{box-shadow:0 0 0 4px var(--dk-pod, #0b1013), 0 0 0 5px #ff0362;}
html.trgLite #racerHud #nextGameBtn{box-shadow:inset 0 1px 0 rgba(255,255,255,.5), inset 0 -3px 0 rgba(0,0,0,.18), 0 3px 0 rgba(0,0,0,.45);}

/* ---- The compact dash (#racerHud.hudTight, js/racer/textbox.js: the dash under 1150px wide, chat column counted) ----
   Last Race goes and the buttons stack, Next Race over Lobby and Garage, so the text box keeps its room. */
#racerHud.hudTight:not(.slim) #scoreDiv{display:none;}
#racerHud.hudTight:not(.slim) #wrapStats{gap:4px; padding:0 8px;}
#racerHud.hudTight:not(.slim) #buttonWrapper{flex-direction:column; align-items:stretch; justify-content:center; gap:6px; width:150px;}
#racerHud.hudTight:not(.slim) #nextGameBtn{width:100%; height:40px; min-width:0; padding:0 10px 0 30px; border-radius:10px; font-size:15px;}
#racerHud.hudTight:not(.slim) #resetBtnDiv::before{left:11px; font-size:14px;}
#racerHud.hudTight:not(.slim) #dkSwitches{flex-direction:row; gap:6px;}
#racerHud.hudTight:not(.slim) #backToLobbyWrap, #racerHud.hudTight:not(.slim) #hudGarageWrap{flex:1 1 0; min-width:0;}
#racerHud.hudTight:not(.slim) #backToLobbyBtn, #racerHud.hudTight:not(.slim) #hudGarageBtn{width:100%; height:30px; padding:0 6px 0 24px; gap:5px; font-size:12px;}
#racerHud.hudTight:not(.slim) #hudGarageBtn{padding-left:7px;}
#racerHud.hudTight:not(.slim) #backToLobbyWrap::before{left:7px; font-size:12px;}

/* ---- The Settings tab (games/typing-racer.php #thPane-settings, 2026-12-02) -------------------------------------------
   Two groups, one row a choice: its name and what the picked choice does on the left, the choices as one segmented
   switch on the right. (The radios stay, out of sight, for the keyboard and screen readers.) */
#trHelp .tsGroup.tsRows{padding:10px 16px 12px;}
#trHelp .tsRows .tsRow{clear:both; display:grid; grid-template-columns:minmax(0, 1fr) auto; align-items:center; gap:6px 18px; padding:10px 0; border-top:1px solid #262e40;}
#trHelp .tsRows .tsRow:first-of-type{border-top:0; padding-top:6px;}
#trHelp .tsRows .tsHead{min-width:0;}
#trHelp .tsRows .tsLabel{display:block; font-weight:700; font-size:14.5px; line-height:1.3; color:#fff;}
#trHelp .tsRows .tsNow{display:block; margin-top:2px; font-size:12.5px; line-height:1.4; color:#97a1b8;}
#trHelp .tsRows .tsSeg{display:flex; gap:2px; padding:3px; border:1px solid #2f374c; border-radius:10px; background:#0b0d13;}
#trHelp .tsRows .tsSeg .tsOpt{position:relative; display:flex; align-items:center; margin:0; padding:6px 12px; border:1px solid transparent; border-radius:7px; background:transparent; white-space:nowrap; cursor:pointer;}
#trHelp .tsRows .tsSeg .tsOpt:not(.on):hover{border-color:#4a5674;}
#trHelp .tsRows .tsSeg .tsOpt.on{border-color:#3fd0ff; background:#10202c;}
#trHelp .tsRows .tsSeg .tsOpt input{position:absolute; left:0; top:0; width:1px; height:1px; margin:0; opacity:0; pointer-events:none;}
#trHelp .tsRows .tsSeg .tsOpt:has(input:focus-visible){outline:2px solid #fff; outline-offset:1px;}
#trHelp .tsRows .tsSeg .tsName{font-size:13.5px; font-weight:700; color:#aeb7cb;}
#trHelp .tsRows .tsSeg .tsOpt.on .tsName{color:#fff;}
#trHelp .tsRows .tsRow.tsLocked .tsSeg{opacity:.45;}
#trHelp .tsRows .tsRow.tsLocked .tsOpt{cursor:default;}
#trHelp .tsRows .tsRow.tsLocked .tsOpt:not(.on):hover{border-color:transparent;}
#trHelp .tsRows .tsFoot{margin:4px 0 0; padding-top:8px; border-top:1px solid #262e40; font-size:12px; line-height:1.45; color:#7f8aa3;}
@media (max-width:640px){
	#trHelp .tsRows .tsRow{grid-template-columns:minmax(0, 1fr);}
	#trHelp .tsRows .tsSeg{justify-self:start; flex-wrap:wrap; max-width:100%;}
}
