/* v0.9.35 (01-11-2026, Uday: "menus are narrow and tight, names overflow"): panels that scale with the window,
   names that never break mid-word, nothing hidden or cut at the smallest size (768 x 385). Loaded last. */

/* 1. Panel widths follow the window (were fixed 460 / 620 / 380 px) */
:root { --side-w: clamp(420px, 36vw, 540px); --side-wide: clamp(560px, 50vw, 760px); --detail-w: clamp(360px, 31vw, 480px); }

/* 2. Leaderboard rows: the name ends in "..." when it must, the title chip stays whole, never "COMEBAC / K KID" */
.lb li b { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; overflow-wrap: normal; line-height: 1.3; }
.lb li b > .nm { font-style: normal; min-width: 2.5em; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb li b > .ttl { flex: 0 1 auto; min-width: 0; margin-left: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #0b0e14; font-weight: 800; opacity: 1; }
.lb li span { white-space: nowrap; }

/* 3. Profile: the four Top-player lists get the whole right side (no 3D car behind a fence in the middle) */
.screen.page.has-right:has(.pf-driver) > .detail { left: var(--side-w); right: 0; width: auto; border-left: 1px solid var(--line); }
body:has(#ui > .screen.page .pf-driver) #gl { visibility: hidden; }
.pf-tops .tops { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
@container (min-width: 900px) { .pf-tops .tops { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container (max-width: 420px) { .pf-tops .tops { grid-template-columns: minmax(0, 1fr); } }
.pf-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pf-stats small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-titles li { align-items: center; }

/* 4. Pages with a right panel from 760 to 1199 px: both panels stay side by side, each scrolling on its own (the
      right one used to be folded under the left one, leaving a sliver of 3D fence on the right) */
@media (min-width: 760px) and (max-width: 1199px) {
  .screen.page.has-right > .side, .screen.page.has-right > .side.wide { width: 54%; }
  .screen.page.has-right > .detail { display: block; left: auto; right: 0; width: 46%; padding-left: 16px; padding-right: 16px; border-left: 1px solid var(--line); }
  .screen.page.has-right:has(.pf-driver) > .detail { left: 54%; width: auto; }
  body:has(#ui > .screen.page.has-right > .side) #gl { visibility: hidden; }
}

/* 5. Style shop: the items first, the timed titles after them; the car stays in view at small sizes */
.screen.page:has(.shop-tabs) .pg-body > .slot-text { order: 1; }
.screen.page:has(.shop-tabs) .pg-body > .shop-msg { order: 2; }
.screen.page:has(.shop-tabs) .pg-body > .shop-grid { order: 3; }
.screen.page:has(.shop-tabs) .pg-body > .timed-sec { order: 4; margin-top: 6px; }
.shop-tabs { flex-wrap: wrap; row-gap: 4px; }
.item .it-t b, .item .it-t small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.item .it-t { min-width: 0; }
@media (max-width: 900px) {
  .screen.page:has(.shop-tabs) > .side.wide { width: 60%; }
  body:has(#ui > .screen.page .shop-tabs) #gl { transform: translateX(30%) !important; }
  .shop-grid { grid-template-columns: 1fr 1fr; }
}
/* at small heights the shop header shrinks to title + tabs on one scrolling row, so the items show at once */
@media (max-height: 520px) {
  .screen.page:has(.shop-tabs) .pg-head p, .screen.page:has(.shop-tabs) .pg-head .kick { display: none; }
  .shop-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .shop-tabs::-webkit-scrollbar { display: none; }
  .shop-tabs > * { flex: none; }
  .screen.page:has(.shop-tabs) .slot-text { font-size: 12.5px; }
}

/* 6. Events: medal goals keep their words at small heights (they were icon-only empty pills) */
@media (max-height: 520px) {
  .m15-lad li { justify-content: flex-start; padding: 3px 6px; }
  .m15-lad li span { display: -webkit-box; font-size: 11px; line-height: 1.2; }
  .m15-lad li svg { width: 14px; height: 14px; }
}

/* 7. Season track: reward names get three short lines instead of being cut */
.sc small { -webkit-line-clamp: 3; line-height: 1.15; overflow-wrap: break-word; hyphens: auto; }
@media (max-height: 520px) { .sc small { font-size: 10.5px; -webkit-line-clamp: 3; } }

/* 8. Pop-ups (repair bill, yesterday's boards, info) always fit the window and scroll inside */
.hub-modal .hi-card, .bonus-card .hi-card { max-height: calc(100vh - 24px); overflow-y: auto; overscroll-behavior: contain; }
@media (max-height: 520px) {
  .hub-modal .hi-card, .bonus-card .hi-card { padding: 12px 14px; gap: 7px; }
  .bn-ray img { width: 40px; height: 40px; } .bn-ray h2 { font-size: 19px; }
  .bn-gift { padding: 8px 12px; } .bn-gift b { font-size: 20px; }
  .hi-card li.bn-row { font-size: 13px; }
  .bonus-card .hi-card > p { font-size: 13px; line-height: 1.35; }
  .hi-card ul.bn-bill { padding: 6px 10px; gap: 2px; }
}
/* the short rule line goes at the smallest heights so the whole bill fits with its button (no text under it) */
@media (max-height: 440px) { .bonus-card .bn-rule { display: none; } }

/* 9. Top bar: the worn title is a small chip like the others, not a large badge */
.tb-me .ttl { font-size: 10.5px; line-height: 1.5; padding: 1px 7px; letter-spacing: 0.06em; margin-left: 4px; }
