/* v0.9.39 (r21): centred dialogs with balanced buttons, tab bars that look like buttons, player cards with actions, club boards, DMs */

/* ---- dialogs: the card sits in the middle of the screen; button rows fill the card evenly */
.hub-modal > .hub-info { display: flex; justify-content: center; align-items: center; width: 100%; max-width: 100%; }
.hub-modal .hi-card > button:last-child, .hub-modal .hi-card > .primary:last-child { justify-self: stretch; width: 100%; text-align: center; }
.hub-modal .hi-card > :is(div, footer, p, nav):has(> button):not(:has(> :not(button))) { display: flex; gap: 10px; justify-content: stretch; width: 100%; }
.hub-modal .hi-card > :is(div, footer, p, nav):has(> button):not(:has(> :not(button))) > button { flex: 1 1 0; min-width: 0; justify-content: center; text-align: center; }
.hub-modal .hi-card > :is(div, footer, p, nav):has(> button):not(:has(> :not(button))) > button.ghost { flex: 0.6 1 0; }
.story-modal .mentor { justify-content: center; }
.story-modal .mentor button { width: 100%; text-align: center; margin-top: 10px; }
.hub-modal .hi-card.gf20 > h2, .hub-modal .hi-card.gf20 > p { text-align: center; justify-self: center; }

/* ---- tab bars: each tab is a visible button; the open tab is solid */
.m15-tabs, .m15-subs, .subtabs { gap: 6px; padding: 5px; background: rgba(6, 9, 15, 0.78); border-color: rgba(255, 255, 255, 0.12); }
.m15-tabs button, .m15-subs button, .subtabs button {
  background: rgba(255, 255, 255, 0.075); border: 1px solid rgba(255, 255, 255, 0.14); color: #d9dfe8; box-shadow: none; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.m15-tabs button:hover, .m15-subs button:hover, .subtabs button:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.32); color: #fff; transform: translateY(-1px); }
.m15-tabs button.on, .m15-subs button.on, .subtabs button.on { background: #ffcc00; border-color: #ffcc00; color: #17120a; box-shadow: 0 3px 12px rgba(255, 204, 0, 0.28); transform: none; }
.m15-tabs button.on svg, .m15-subs button.on svg, .subtabs button.on svg { color: #17120a; }
.m15-boards .m15-tabs button.on { background: #60a5fa; border-color: #60a5fa; color: #07111f; box-shadow: 0 3px 12px rgba(96, 165, 250, 0.3); }
.lb19-tabs button.on { background: var(--c, #60a5fa); border-color: var(--c, #60a5fa); color: #07111f; box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3); }

.tabrow { gap: 6px; border-bottom: 0; padding: 5px; background: rgba(6, 9, 15, 0.7); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 12px; }
.tabrow button { padding: 7px 13px; margin: 0; border-radius: 9px; background: rgba(255, 255, 255, 0.075); border: 1px solid rgba(255, 255, 255, 0.14); color: #d9dfe8; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.tabrow button:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.32); color: #fff; }
.tabrow button.on { background: #ffcc00; border-color: #ffcc00; color: #17120a; }

.hc18-tabs button, .gc-tabs button { background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14); color: #d4dbe5; cursor: pointer; }
.hc18-tabs button:hover, .gc-tabs button:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.3); }
.hc18-tabs button.on, .gc-tabs button.on { background: rgb(var(--t, 45, 212, 191)); border-color: transparent; color: #04211c; }
.hc18-tabs, .gc-tabs { gap: 5px; }

.ev20-tg button { background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14); color: #d4dbe5; cursor: pointer; }
.ev20-tg button:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.ev20-tg button.on { border-color: transparent; }

.cl-tabs button { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.11); cursor: pointer; }
.cl-tabs button:hover { background: rgba(255, 255, 255, 0.11); border-color: rgba(255, 255, 255, 0.26); }
.cl-tabs button.on { background: rgba(255, 204, 0, 0.16); border-color: #ffcc00; }

/* ---- driver card actions */
.pc39-acts { display: flex; gap: 10px; margin-top: 14px; }
.pc39-acts button { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 12px; }
.pc39-acts button svg { width: 18px; height: 18px; flex: none; }
.pc39-acts button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Messages popup (shares the chat popup frame) */
[data-dm39] { position: relative; }
.dm39 .gc-card { display: flex; flex-direction: column; }
.dm39-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); border-top: 1px solid var(--line); }
.dm39-th { min-height: 0; overflow-y: auto; border-right: 1px solid var(--line); padding: 10px; }
.dm39-th ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.dm39-th li.dim, .dm39-list li.dim { color: var(--txt-2); padding: 10px; font-size: 14px; list-style: none; }
.dm39-t { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 2px 8px; text-align: left; padding: 9px 11px; border-radius: 11px; border: 1px solid transparent; background: rgba(255, 255, 255, 0.04); color: var(--txt); cursor: pointer; }
.dm39-t:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.18); }
.dm39-t.on { background: rgba(var(--t), 0.14); border-color: rgba(var(--t), 0.5); }
.dm39-t .nm19 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.dm39-t small { grid-column: 1; color: var(--txt-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm39-t em, .dm39-t i { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-style: normal; }
.dm39-t em { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #ef4444; color: #fff; font: 800 11px/20px var(--f-ui, inherit); text-align: center; }
.dm39-t i { color: var(--dim); font-size: 12px; }
.dm39-cv { min-height: 0; display: flex; flex-direction: column; }
.dm39-empty { margin: auto; max-width: 380px; text-align: center; display: grid; gap: 8px; padding: 20px; }
.dm39-empty b { font-size: 18px; } .dm39-empty span { color: var(--txt-2); }
.dm39-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.dm39-who { display: grid; text-align: left; background: none; border: 0; color: var(--txt); cursor: pointer; padding: 2px 4px; border-radius: 8px; }
.dm39-who .nm19 { font-size: 18px; font-weight: 800; } .dm39-who small { color: rgb(var(--t)); font-size: 12px; }
.dm39-who:hover { background: rgba(255, 255, 255, 0.06); }
.dm39-list { flex: 1; min-height: 0; overflow-y: auto; list-style: none; margin: 0; padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.dm39-m { align-self: flex-start; max-width: 74%; padding: 8px 12px 7px; border-radius: 13px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); }
.dm39-m.me { align-self: flex-end; background: rgba(var(--t), 0.13); border-color: rgba(var(--t), 0.4); }
.dm39-m p { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.dm39-m small { display: block; margin-top: 3px; color: var(--dim); font-size: 11.5px; }
.dm39-m small .link { background: none; border: 0; padding: 0; color: var(--dim); font-size: 11.5px; text-decoration: underline; cursor: pointer; }
.dm39-m.inv { max-width: min(420px, 90%); background: linear-gradient(160deg, rgba(52, 211, 153, 0.16), rgba(14, 18, 25, 0.9)); border-color: rgba(52, 211, 153, 0.5); }
.dm39-inv { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.dm39-inv b { display: block; font-size: 16px; } .dm39-inv span:not(.cl19-crest) { color: var(--txt-2); font-size: 12.5px; }
.dm39-inv .kick { color: #6ee7b7; }
.dm39-inv em.ok { font-style: normal; color: #6ee7b7; font-weight: 700; font-size: 13px; }
.dm39-foot { padding: 10px 18px 14px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.dm39-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dm39-say { display: flex; gap: 8px; }
.dm39-say input { flex: 1; min-width: 0; padding: 11px 14px; border-radius: 11px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.3); color: var(--txt); font: inherit; }
.dm39-say button { padding: 0 22px; }
.dm39-err { margin: 0; min-height: 0; color: #fb7185; font-size: 13px; } .dm39-err:empty { display: none; }
.dm39-note { margin: 0; padding: 14px 18px; color: var(--txt-2); border-top: 1px solid var(--line); }
@media (max-width: 760px) { .dm39-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); } .dm39-th { max-height: 140px; border-right: 0; border-bottom: 1px solid var(--line); } }

/* ---- who raced: club Cup / Duel / Sprint boards */
.cl39-col { display: grid; gap: 14px; align-content: start; min-height: 0; }
.cl39-duo { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1100px) { .cl39-duo { grid-template-columns: 1fr; } }
.cl39-raced .cl39-sub { margin: 2px 0 10px; color: var(--txt-2); font-size: 13px; }
.cl39-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 360px; overflow-y: auto; }
.cl39-rows li { display: grid; grid-template-columns: 24px minmax(0, 1fr) 64px 46px 44px; gap: 8px; align-items: center; padding: 7px 10px; border-radius: 9px; background: rgba(255, 255, 255, 0.04); }
.cl39-rows li.dim { display: block; color: var(--txt-2); background: none; }
.cl39-rows li em { font-style: normal; font-weight: 800; color: var(--txt-2); text-align: right; }
.cl39-rows li .nm19 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.cl39-rows li b { text-align: right; font-variant-numeric: tabular-nums; }
.cl39-t { text-align: right; font: 700 13px var(--f-mono, monospace); color: var(--txt-2); } .cl39-t.best { color: #c084fc; } .cl39-t.dim { opacity: .5; }
.cl39-rows li > i { font-style: normal; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-align: center; color: #052e1c; background: #34d399; border-radius: 6px; padding: 2px 4px; }
.cl39-rows li > i:empty { background: none; }
.cl39-rows li.ct { background: rgba(52, 211, 153, 0.08); }
.cl39-rows li.me { outline: 1px solid rgba(255, 204, 0, 0.55); }
.cl39-rows li.dim { font-size: 14px; padding: 6px 2px; }
.hc18-tabs button { padding: 4px 8px; letter-spacing: .06em; } .hc18-tabs { gap: 3px; }

/* ---- main menu: chat at the top of the right column, live boards under it */
.hub18 .hub-right { justify-content: flex-start; }
.hub18 .hc18 { height: clamp(250px, 46vh, 470px); }
.hub18 .cb19 { display: none; }
.lv39 { flex: 1 1 auto; min-height: 150px; display: flex; flex-direction: column; border-radius: 18px; border: 1px solid rgba(96, 165, 250, 0.34); background: linear-gradient(160deg, rgba(96, 165, 250, 0.1), rgba(10, 13, 19, 0.86) 55%); backdrop-filter: blur(6px); padding: 10px 14px 8px; overflow: hidden; }
.lv39 header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.lv39 header b { display: flex; align-items: center; gap: 7px; font: 800 15px var(--f-display); letter-spacing: .08em; text-transform: uppercase; color: #93c5fd; }
.lv39-tabs { display: flex; gap: 4px; }
.lv39-tabs button { padding: 4px 9px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.07); color: #d4dbe5; font: 700 11.5px var(--f-display); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.lv39-tabs button:hover { background: rgba(255, 255, 255, 0.14); }
.lv39-tabs button.on { background: #60a5fa; border-color: #60a5fa; color: #07111f; }
.lv39-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; flex: 1; min-height: 0; align-content: start; overflow: hidden; }
.lv39-rows.in { animation: lv39-in .45s ease both; }
@keyframes lv39-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.lv39-rows li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 5px 9px; border-radius: 9px; background: rgba(255, 255, 255, 0.04); font-size: 13.5px; }
.lv39-rows li:has(.cl19-crest) { grid-template-columns: 22px 24px minmax(0, 1fr) auto; }
.lv39-rows li em { font-style: normal; font-weight: 800; color: var(--txt-2); text-align: right; }
.lv39-rows li .nm19, .lv39-rows li b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: #fff; }
.lv39-rows li > span:last-child { font: 700 12.5px var(--f-mono, monospace); color: var(--txt-2); }
.lv39-rows li.me { background: rgba(255, 204, 0, 0.12); outline: 1px solid rgba(255, 204, 0, 0.45); }
.lv39-rows li.gap { margin-top: 4px; }
.lv39-rows li.dim { display: block; color: var(--txt-2); background: none; }
.lv39-go { align-self: flex-end; margin-top: 4px; background: none; border: 0; color: #93c5fd; font-size: 12.5px; cursor: pointer; padding: 2px 0; }
.lv39-go:hover { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .lv39-rows.in { animation: none; } }
body:is([data-hublv="0"], [data-hublv="1"]) .lv39 { display: none !important; }

/* v0.9.40: helmet colours on the profile's driver card */
.pf-helm40{display:flex;align-items:center;gap:14px;margin-top:12px;flex-wrap:wrap}
.pf-helm40 .pf-hl{font-weight:700;min-width:96px}
.pf-helm40 .pf-hpv svg{width:40px;height:40px}
.pf-helm40 .swatches{margin:3px 0}
