/* v0.9.27 (CrazyGames QA round 10, Chromebook at 764x385: "the text is too small; players should not need to go
   fullscreen to read the interface"). Below 1000x560 the race HUD is not the big layout scaled down any more (that made
   7 px text): it is this compact layout at full size (src/ui/hud.js fit adds .compact). Smaller panels, fewer rows (the
   top three and you), a smaller wheel and map, Ray's card shorter; every text 11 px or more. Loaded last. */

.hud.compact { --g: 8px; --lcol-w: 178px; --rcol-w: 176px; --stat-w: 196px; --map-w: 104px; --dash-w: 224px; --dash-b: 24px; font-size: 12px; }

/* top left: the order, top three and you */
.hud.compact .lcol { width: var(--lcol-w); gap: 6px; }
.hud.compact .tower { padding: 4px 0; }
.hud.compact .tower .row { height: 18px; padding: 0 7px; gap: 5px; font-size: 12px; }
.hud.compact .tower .pos { width: 16px; font-size: 11px; }
.hud.compact .tower .nm { width: 34px; }
.hud.compact .tower .gap, .hud.compact .tower .gap em, .hud.compact .tower .pen { font-size: 11px; }
.hud.compact .tower .ty, .hud.compact .tyl { width: 15px; height: 15px; font-size: 11px; border-width: 2px; }
.hud.compact .tower .thead { font-size: 11px; padding: 1px 8px 4px; }
.hud.compact .pitbar { max-width: min(420px, 55vw); }
.hud.compact .pitbar > div { padding: 4px 8px; }
.hud.compact .pitbar small, .hud.compact .pb-lim small, .hud.compact .pb-lim span, .hud.compact .pb-spd span { font-size: 11px; }
.hud.compact .pb-lim, .hud.compact .pb-spd { min-width: 50px; }
.hud.compact .pb-lim b, .hud.compact .pb-spd b { font-size: 17px; }
.hud.compact .pb-do span { font-size: 12px; margin-top: 1px; }
.hud.compact .penbar { padding: 5px 9px 7px 7px; gap: 8px; }
.hud.compact .penbar .ai { width: 24px; height: 24px; }
.hud.compact .penbar .ai svg { width: 16px; height: 16px; }
.hud.compact .penbar b { font-size: 13px; }
.hud.compact .penbar small, .hud.compact .penbar span { font-size: 11px; }
.hud.compact .warnbox { padding: 3px 8px; }

/* top middle: lap / position */
.hud.compact .hud-top { gap: 6px; }
.hud.compact .hud-top > div { padding: 3px 10px; min-width: 64px; }
.hud.compact .hud-top .wide { min-width: 96px; }
.hud.compact .hud-top small { font-size: 11px; letter-spacing: 0.1em; }
.hud.compact .hud-top b { font-size: 18px; }
.hud.compact .hud-top b i { font-size: 12px; }
.hud.compact .hud-top b.mono { font-size: 15px; }
.hud.compact .flagbar { top: 56px; font-size: 11px; padding: 4px 12px; }

/* top right: weather and settings, one short row */
.hud.compact .rcol { width: var(--rcol-w); gap: 6px; }
.hud.compact .rtop { gap: 6px; }
.hud.compact .wx-now { gap: 7px; padding: 5px 8px; }
.hud.compact .wx-now .ic, .hud.compact .wx-now .ic svg { width: 20px; height: 20px; }
.hud.compact .wx-now b { font-size: 12px; white-space: nowrap; }
.hud.compact .wx-now small { font-size: 11px; white-space: nowrap; }
.hud.compact .hud-gear { min-width: 0; padding: 5px 7px; font-size: 11px; letter-spacing: 0.04em; }
.hud.compact .hud-gear span { display: none; }
.hud.compact .hud-gear svg { width: 18px; height: 18px; }
.hud.compact .skiptut { top: 56px; padding: 6px 12px; font-size: 12px; }
.hud.compact .rcol > .skiptut { position: static; }

/* bottom: the wheel smaller, the car card two lines, a small map */
.hud.compact .dash { bottom: calc(var(--dash-b) - 10px); }
.hud.compact .wheel { zoom: 0.7; }
.hud.compact .speed span, .hud.compact .dash-row { font-size: 16px; }
.hud.compact .limbar { padding: 3px 10px; }
.hud.compact .limbar b { font-size: 15px; }
.hud.compact .limbar span { font-size: 11px; }
.hud.compact .status { bottom: 26px; padding: 5px 8px; gap: 7px; }
.hud.compact .status .diag { width: 26px; height: 52px; }
.hud.compact .st-temp, .hud.compact .st-last { display: none; }
.hud.compact .st-r { grid-template-columns: 32px auto 1fr; gap: 5px; }
.hud.compact .st-r b { font-size: 13px; }
.hud.compact .st-r small, .hud.compact .st-r small:last-child { font-size: 11px; }
.hud.compact .st-r .tyl { width: 17px; height: 17px; border-width: 2px; }
.hud.compact .minimap { bottom: 26px; padding: 3px; border-radius: 10px; }
.hud.compact .minimap canvas { width: 96px; height: 96px; }
.hud.compact .keyhint { bottom: 3px; font-size: 11px; padding: 2px 10px; }
.hud.compact .keyhint kbd { font-size: 11px; }

/* messages and alerts: above the car card (left) and above the map (right), never on the road */
.hud.compact .alerts { left: var(--g); right: auto; width: var(--stat-w); bottom: 96px; height: auto; gap: 5px; }
.hud.compact .alert { gap: 7px; padding: 5px 8px 5px 6px; border-radius: 10px; }
.hud.compact .alert .ai { width: 24px; height: 24px; }
.hud.compact .alert .ai svg { width: 16px; height: 16px; }
.hud.compact .alert b { font-size: 12px; letter-spacing: 0.05em; }
.hud.compact .alert span { font-size: 11px; }
.hud.compact .chance b { font-size: 12px; }
.hud.compact .chance i { font-size: 11px; white-space: normal; }
.hud.compact .strip { left: auto; right: var(--g); width: min(300px, 40vw); bottom: 138px; height: auto; }
.hud.compact .msg { font-size: 12px; padding: 4px 8px; }

/* the top centre: lights, the big texts, Ray's card, the grid tyre pick */
.hud.compact .lights { top: 54px; gap: 7px; padding: 6px 10px; }
.hud.compact .lights .lamp { width: 20px; height: 20px; }
.hud.compact .bigmsg { top: 92px; }
.hud.compact .bigmsg b { font-size: 26px; }
.hud.compact .bigmsg span { font-size: 12px; }
.hud.compact.counting .bigmsg b { font-size: 40px; }
.hud.compact .mentor { top: 58px; bottom: auto; width: min(460px, calc(100vw - 2 * (var(--lcol-w) + 2 * var(--g)))); min-width: 0; gap: 9px; padding: 6px 10px 6px 6px; border-radius: 12px; }
.hud.compact .mentor img { width: 36px; height: 36px; border-radius: 8px; }
.hud.compact .mentor small { font-size: 11px; letter-spacing: 0.1em; }
.hud.compact .mentor b { font-size: 13px; line-height: 1.3; margin-top: 1px; }
.hud.compact .mentor b kbd { font-size: 11px; padding: 1px 5px; }
.hud.compact .mentor span { font-size: 11.5px; line-height: 1.3; margin-top: 1px; }
.hud.compact .mentor button { margin-top: 4px; padding: 4px 10px; font-size: 12px; }
.hud.compact .qdone { width: min(340px, calc(100vw - 2 * (var(--lcol-w) + 2 * var(--g)))); padding: 8px 12px; gap: 4px; }
.hud.compact .qdone b { font-size: 14px; }
.hud.compact .qdone span { font-size: 12px; }
.hud.compact .brakehint b { font-size: 16px; }
.hud.compact .brakehint span { font-size: 11px; }

/* the grid tyre pick: centred, the five sets in one row */
.hud.compact .pitpanel.grid { top: 100px; width: min(420px, calc(100vw - 2 * (var(--lcol-w) + 2 * var(--g)))); padding: 8px 10px; }
.hud.compact .pitpanel.grid h4 { font-size: 13px; margin: 0 0 3px; }
.hud.compact .pitpanel.grid .gt-why { font-size: 11.5px; margin: 0 0 6px; }
.hud.compact .pitpanel.grid .gridwx, .hud.compact .pitpanel.grid .eng { display: none; }
.hud.compact .pitpanel.grid .tyres { flex-direction: row; flex-wrap: wrap; gap: 4px; }
.hud.compact .pitpanel.grid .tyres button { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 2px; padding: 4px 2px; font-size: 11px; text-align: center; align-items: center; }
.hud.compact .pitpanel.grid .tyres button kbd { margin: 0; font-size: 11px; }
.hud.compact .pitpanel.grid .gt-how { font-size: 11px; margin-top: 5px; }
/* the pit-stop pick (B) in the right column */
.hud.compact .pitpanel:not(.grid) { padding: 8px 10px; }
.hud.compact .pitpanel:not(.grid) h4 { font-size: 13px; margin-bottom: 5px; }
.hud.compact .pitpanel:not(.grid) .tyres button { padding: 3px 8px; font-size: 12px; }
.hud.compact .pitpanel:not(.grid) .rep { margin: 5px 0 3px; font-size: 12px; }

/* the screen tour cards */
.hud.compact .spot-card { width: min(300px, calc(100vw - 20px)); padding: 9px 12px 9px; }
.hud.compact .spot-card small { font-size: 11px; }
.hud.compact .spot-card > b { font-size: 15px; margin: 2px 0 3px; }
.hud.compact .spot-card > span { font-size: 12.5px; line-height: 1.35; }
.hud.compact .spot-card .row { margin-top: 7px; }
.hud.compact .spot-card button { padding: 5px 11px; font-size: 12px; }
.hud.compact:has(.lights.on) .bigmsg { top: 96px; }
.hud.compact .spot-card.lesson { width: min(400px, calc(100vw - 20px)); gap: 10px; padding: 10px 12px; }
.hud.compact .spot-card.lesson > img { width: 40px; height: 40px; }
.hud.compact .spot-card.lesson b { font-size: 15px; }
.hud.compact .spot-card.lesson span { font-size: 12.5px; }

/* the slightly scaled big layout (1000x560 to 1100x620, zoom 0.9 or more): the smallest labels one pixel up */
.hud.zoomed .tower .row, .hud.zoomed .tower .thead, .hud.zoomed .hud-top small, .hud.zoomed .wx-now small, .hud.zoomed .st-r small,
.hud.zoomed .st-r small:last-child, .hud.zoomed .keyhint, .hud.zoomed .keyhint kbd, .hud.zoomed .pitbar small, .hud.zoomed .alert span,
.hud.zoomed .hud-gear, .hud.zoomed .mentor small, .hud.zoomed .tower .gap, .hud.zoomed .tower .pos { font-size: 12px; }
/* the pit-lane pill sits above the wheel here (under it, it would cover the controls strip) */
.hud.compact .limbar { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); margin: 0 0 4px; white-space: nowrap; }

/* v0.9.28 the qualifying garage in a small window: the tyre prompt and the five sets first, then what each tyre does;
   the weather and the engineer's line give way (the car card and the weather panel show them) */
.hud.compact .rcol.pp { width: 214px; }
.hud.compact .garagepanel { display: flex; flex-direction: column; padding: 8px 10px; }
.hud.compact .garagepanel h4 { order: 0; margin: 0 0 2px; font-size: 13px; }
.hud.compact .garagepanel .gp-clock { order: 1; margin: 0 0 4px; }
.hud.compact .garagepanel .gp-clock b { font-size: 16px; }
.hud.compact .garagepanel .gp-go { order: 2; margin: 0 0 6px; padding: 6px 8px; font-size: 12px; }
.hud.compact .garagepanel .tyres { order: 3; gap: 3px; }
.hud.compact .garagepanel .tyres button { padding: 3px 8px; font-size: 12px; }
.hud.compact .garagepanel .gt-why { order: 4; margin: 6px 0 0; font-size: 11.5px; line-height: 1.35; }
.hud.compact .garagepanel .gp-skip, .hud.compact .garagepanel .gp-crew { order: 5; margin-top: 5px; padding: 5px 8px; font-size: 12px; }
.hud.compact .garagepanel .gridwx, .hud.compact .garagepanel .eng { display: none; }
/* messages never run under a panel: beside the garage column, and not at all while the grid tyre pick is up (it says it) */
.hud.compact:has(.rcol.pp) .strip { display: none; }   /* (the garage panel says what matters) */
.hud.compact .garagepanel .gp-go { white-space: normal; }
.hud.compact:has(.pitpanel.grid:not(.hidden)) .strip { display: none; }
/* Ray's card sits between the order and the garage column while the garage is open */
.hud.compact:has(.rcol.pp) .mentor, .hud.compact:has(.rcol.pp) .mentor.show { left: calc(var(--lcol-w) + 2 * var(--g)); width: calc(100vw - 214px - var(--lcol-w) - 5 * var(--g)); transform: none; }
