/* DRIVERGENCE design system. Neon on black, chamfered glass, late-90s sci-fi type. */
:root {
  --bg: #07040f; --bg2: #0d0820; --ink: #ece9ff; --mute: #8f8ab8; --dim: #4a4670;
  --cyan: #30e8ff; --pink: #ff3fb0; --amber: #ffb020; --lime: #5cff8a; --red: #ff5c5c; --violet: #8a5cff;
  --glass: rgba(12, 7, 30, 0.82); --glass2: rgba(20, 12, 44, 0.7); --line: rgba(48, 232, 255, 0.28);
  --display: "Orbitron", "Segoe UI", sans-serif; --body: "Rajdhani", "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.2, 0.9, 0.2, 1); --c: 14px;
  /* rarity: common, uncommon, rare, epic, legendary (TIERS in data.js holds the same five) */
  --t0: #b8bcc8; --t1: #4fe06a; --t2: #4a9dff; --t3: #b86bff; --t4: #ff8f1f;
}
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 17px; overflow: hidden; -webkit-user-select: none; user-select: none; touch-action: none; }
canvas.game { display: block; position: fixed; inset: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
/* scrollbars in the game's colours: thin, a dark track, a cyan thumb (unstyled ones were grey system bars) */
* { scrollbar-width: thin; scrollbar-color: rgba(48,232,255,0.45) rgba(255,255,255,0.04); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); }
::-webkit-scrollbar-thumb { background: rgba(48,232,255,0.4); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(48,232,255,0.7); }
::-webkit-scrollbar-corner { background: transparent; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: 2px; text-transform: uppercase; }
.glow-c { text-shadow: 0 0 12px rgba(48, 232, 255, 0.8), 0 0 32px rgba(48, 232, 255, 0.35); }
.glow-p { text-shadow: 0 0 12px rgba(255, 63, 176, 0.8), 0 0 32px rgba(255, 63, 176, 0.35); }
.num { font-family: var(--display); font-variant-numeric: tabular-nums; }
.c { color: var(--cyan); } .p { color: var(--pink); } .a { color: var(--amber); } .l { color: var(--lime); } .r { color: var(--red); } .m { color: var(--mute); }

/* scanlines and vignette over everything */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
#fx::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0,0,0,0.12) 0 1px, transparent 1px 3px); mix-blend-mode: multiply; opacity: 0.55; }
#fx::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(4, 2, 12, 0.55) 100%); }
#flash { position: fixed; inset: 0; pointer-events: none; z-index: 49; opacity: 0; transition: opacity 0.18s ease-out; background: radial-gradient(ellipse at center, transparent 45%, rgba(255, 60, 60, 0.28) 100%); }
#flash.hit { opacity: 1; transition: opacity 0.05s; }
/* the boost glow: its own layer, a slow steady fade in and out */
#boostglow { position: fixed; inset: 0; pointer-events: none; z-index: 48; opacity: 0; transition: opacity 0.6s ease; background: radial-gradient(ellipse at center, transparent 45%, rgba(48, 232, 255, 0.17) 100%); }
#boostglow.on { opacity: 1; }
#lines { position: fixed; inset: 0; pointer-events: none; z-index: 48; }

/* chamfered panel: gradient edge, glass inside */
.panel { position: relative; padding: 1px; background: linear-gradient(135deg, rgba(48,232,255,0.7), rgba(255,63,176,0.15) 45%, rgba(255,63,176,0.6)); clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c)); }
.panel > .in { background: var(--glass); clip-path: polygon(calc(var(--c) - 1px) 0, 100% 0, 100% calc(100% - var(--c) + 1px), calc(100% - var(--c) + 1px) 100%, 0 100%, 0 calc(var(--c) - 1px)); padding: 18px 22px; height: 100%; box-sizing: border-box; }
.panel.soft { background: linear-gradient(135deg, rgba(48,232,255,0.25), rgba(255,63,176,0.08) 50%, rgba(255,63,176,0.25)); }
.panel.hot { background: linear-gradient(135deg, var(--cyan), var(--pink)); animation: edge 2.4s linear infinite; background-size: 300% 300%; }
.panel.sel { background: linear-gradient(135deg, #fff, var(--cyan) 40%, var(--cyan) 60%, #fff); background-size: 300% 300%; animation: edge 1.6s linear infinite; box-shadow: 0 0 28px rgba(48,232,255,0.45); }
.panel.sel > .in::after { content: "SELECTED"; position: absolute; right: 14px; bottom: 10px; font-family: var(--display); font-size: 9px; letter-spacing: 3px; color: var(--cyan); }
.panel.sel.card:hover { transform: translateY(-4px) scale(1.01); }
@keyframes edge { 0% { background-position: 0% 50%; } 100% { background-position: 300% 50%; } }
.eyebrow { font-family: var(--display); font-size: 11px; letter-spacing: 4px; color: var(--mute); text-transform: uppercase; }
.title { font-size: 26px; font-weight: 900; }
.sub { color: var(--mute); font-weight: 500; }

/* buttons: skewed slabs with a glint */
.btn { position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 12px 26px; font-family: var(--display); font-size: 13px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: var(--ink); background: rgba(48, 232, 255, 0.08); border: 1px solid var(--line); clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); transition: transform 0.12s var(--ease), background 0.2s, box-shadow 0.2s; overflow: hidden; }
a.btn { text-decoration: none; }
.btn::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255,255,255,0.35), transparent); transform: skewX(-20deg); transition: left 0.5s var(--ease); }
.btn:hover { background: rgba(48, 232, 255, 0.18); box-shadow: 0 0 24px rgba(48, 232, 255, 0.35), inset 0 0 18px rgba(48, 232, 255, 0.12); transform: translateY(-1px); }
.btn:hover::after { left: 120%; }
.btn:active { transform: scale(0.97); }
.btn.primary { background: linear-gradient(90deg, var(--cyan), #4fb8ff); color: #061018; border-color: transparent; box-shadow: 0 0 22px rgba(48, 232, 255, 0.45); }
.btn.primary:hover { box-shadow: 0 0 40px rgba(48, 232, 255, 0.75); }
.btn.pink { background: linear-gradient(90deg, var(--pink), #ff6ad0); color: #1a0612; border-color: transparent; box-shadow: 0 0 22px rgba(255, 63, 176, 0.45); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 8px 16px; font-size: 11px; letter-spacing: 2px; }
.btn.big { padding: 18px 44px; font-size: 18px; letter-spacing: 5px; }
.btn[disabled] { opacity: 0.4; cursor: default; }
.btn[disabled]:hover { transform: none; box-shadow: none; }

/* bars */
.bar { position: relative; height: 10px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); overflow: hidden; clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }
.bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), #7af0ff); box-shadow: 0 0 12px var(--cyan); transition: width 0.7s var(--ease); }
.bar.pink > i { background: linear-gradient(90deg, var(--pink), #ff8ad4); box-shadow: 0 0 12px var(--pink); }
.bar.amber > i { background: linear-gradient(90deg, #ff8a20, var(--amber)); box-shadow: 0 0 12px var(--amber); }
.bar.lime > i { background: linear-gradient(90deg, #2fd46a, var(--lime)); box-shadow: 0 0 12px var(--lime); }
.bar.violet > i { background: linear-gradient(90deg, #6a3cff, var(--violet)); box-shadow: 0 0 12px var(--violet); }
.bar.seg { background: repeating-linear-gradient(90deg, rgba(255,255,255,0.06) 0 calc(10% - 2px), transparent calc(10% - 2px) 10%); }
.bar > i.pulse { animation: barpulse 1s ease-in-out infinite; }
@keyframes barpulse { 50% { filter: brightness(1.5); } }
.stat { display: grid; grid-template-columns: 90px 1fr 44px; gap: 12px; align-items: center; font-weight: 600; margin: 6px 0; }
.stat .k { font-family: var(--display); font-size: 10px; letter-spacing: 2px; color: var(--mute); }
.stat .v { font-family: var(--display); font-size: 12px; text-align: right; }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border: 1px solid var(--line); background: rgba(48,232,255,0.06); font-family: var(--display); font-size: 12px; letter-spacing: 1px; clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.chip .ico { width: 10px; height: 10px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); transform: rotate(45deg); }
.chip.member { border-color: rgba(255,63,176,0.5); background: rgba(255,63,176,0.1); }
.chip.member .ico { background: var(--pink); box-shadow: 0 0 8px var(--pink); }
.view { animation: rise 0.45s var(--ease) both; }
.view > * { animation: rise 0.5s var(--ease) both; }
.view > *:nth-child(2) { animation-delay: 0.05s; } .view > *:nth-child(3) { animation-delay: 0.1s; } .view > *:nth-child(4) { animation-delay: 0.15s; } .view > *:nth-child(5) { animation-delay: 0.2s; } .view > *:nth-child(6) { animation-delay: 0.25s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.head h2 { font-size: 30px; font-weight: 900; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: 1fr 1fr; } .cols-3 { grid-template-columns: repeat(3, 1fr); } .cols-4 { grid-template-columns: repeat(4, 1fr); } .cols-5 { grid-template-columns: repeat(5, 1fr); }
.row { display: flex; align-items: center; gap: 14px; }
/* the results' buttons (up to four): a button's overflow: hidden lets flex squeeze it under its own
   longest word, which cut CONTINUE off; they may wrap their words, never narrower than one */
.res-acts .btn { min-width: min-content; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }

/* cards */
.card { position: relative; cursor: pointer; transition: transform 0.2s var(--ease); }
.card:hover { transform: translateY(-4px) scale(1.01); }
.card:hover .in { background: var(--glass2); }
.card .in { transition: background 0.2s; }
.card.locked { opacity: 0.55; filter: saturate(0.4); }
.card.locked::after { content: "LOCKED"; position: absolute; right: 18px; top: 14px; font-family: var(--display); font-size: 10px; letter-spacing: 3px; color: var(--mute); }
.zone { height: 168px; display: flex; flex-direction: column; justify-content: flex-end; }
.zone .eyebrow { font-size: 10px; letter-spacing: 3px; }
.zone .in { background: var(--z, linear-gradient(160deg, #1b0f3a, #07040f)); display: flex; flex-direction: column; justify-content: flex-end; }
.zone .in::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 28px), repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 28px); }
.zone h3 { font-size: 16px; }
.mode { min-height: 140px; }
.mode .in { display: flex; flex-direction: column; gap: 8px; }
.mode .ico { font-family: var(--display); font-size: 30px; font-weight: 900; color: var(--cyan); line-height: 1; }
.mode.hot .ico { color: var(--pink); }
.tag { display: inline-block; padding: 2px 8px; font-family: var(--display); font-size: 9px; letter-spacing: 2px; border: 1px solid var(--line); color: var(--cyan); }
.tag.p { border-color: rgba(255,63,176,0.5); color: var(--pink); }
.tag.a { border-color: rgba(255,176,32,0.5); color: var(--amber); }
.tag.l { border-color: rgba(92,255,138,0.5); color: var(--lime); }

/* lists */
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px; padding: 10px 14px; background: rgba(255,255,255,0.03); border-left: 2px solid transparent; transition: background 0.15s, border-color 0.15s, transform 0.15s var(--ease); }
.item:hover { background: rgba(48,232,255,0.07); border-left-color: var(--cyan); transform: translateX(3px); }
/* a row of things with tooltips stays put: sliding moved them out from under the pointer and the tip flickered */
.item:has(.chips):hover { transform: none; }
.item.me { border-left-color: var(--pink); background: rgba(255,63,176,0.08); }
.item .rank { font-family: var(--display); font-size: 18px; font-weight: 900; color: var(--dim); }
.item.top1 .rank { color: var(--amber); text-shadow: 0 0 10px var(--amber); } .item.top2 .rank { color: #cfd6ff; } .item.top3 .rank { color: #d8884a; }
.item .name { font-weight: 600; font-size: 18px; }
.item .meta { color: var(--mute); font-size: 14px; }
.item .right { text-align: right; font-family: var(--display); font-size: 14px; }
.ico-hex { width: 40px; height: 40px; display: grid; place-items: center; background: rgba(48,232,255,0.08); clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); font-family: var(--display); font-weight: 900; color: var(--cyan); font-size: 12px; }
.ico-hex.p { color: var(--pink); background: rgba(255,63,176,0.1); }
.ico-hex.a { color: var(--amber); background: rgba(255,176,32,0.1); }
/* the Discord: its mark in its own colour, and the row that shows OUTLAW until it's linked */
.ico-hex.disc { background: rgba(88,101,242,0.16); } .ico-hex.disc svg { width: 22px; height: 22px; fill: #5865f2; }
.dc-promo { grid-template-columns: 150px 1fr auto; margin-top: 18px; padding: 10px 20px; gap: 22px; font-size: 15px; border: 1px solid rgba(88,101,242,0.55); background: linear-gradient(90deg, rgba(88,101,242,0.16), rgba(88,101,242,0.03)); box-shadow: 0 0 22px rgba(88,101,242,0.18); }
.dc-promo .m3d { flex-shrink: 0; }
.dc-promo .name { display: flex; align-items: center; gap: 10px; letter-spacing: 2px; font-family: var(--display); font-size: 18px; }
.dc-promo .meta { font-size: 14px; margin-top: 4px; max-width: 640px; }
.dc-promo:hover { transform: none; }
.dc-mk svg { width: 26px; height: 26px; fill: #5865f2; display: block; }

/* garage */
#garage-view { width: 100%; height: 330px; display: block; }
.craft-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.craft-groups { gap: 6px; margin-bottom: 8px; }
.craft-tab[style*="--tc"] { border-left: 2px solid var(--tc); }
.sr-cup { cursor: help; }
.craft-tab { flex: 0 0 150px; padding: 10px 12px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); cursor: pointer; transition: all 0.15s; clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.craft-tab:hover { border-color: var(--line); background: rgba(48,232,255,0.06); }
.craft-tab.on { border-color: var(--cyan); background: rgba(48,232,255,0.12); box-shadow: 0 0 16px rgba(48,232,255,0.25); }
.craft-tab .n { font-family: var(--display); font-size: 12px; letter-spacing: 1px; }
.craft-tab .cls { font-size: 12px; color: var(--mute); }
.slot { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 8px 10px; background: rgba(255,255,255,0.03); margin-bottom: 6px; cursor: pointer; transition: background 0.15s; }
.slot:hover { background: rgba(48,232,255,0.08); }
.slot .t { font-weight: 600; } .slot .d { font-size: 13px; color: var(--mute); }
.swatches { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.sw { width: 26px; height: 26px; cursor: pointer; border: 2px solid transparent; transform: rotate(45deg); transition: transform 0.15s, border-color 0.15s; }
.sw:hover { transform: rotate(45deg) scale(1.15); } .sw.on { border-color: #fff; }

/* research */
.queue { display: flex; flex-direction: column; gap: 10px; }
.q { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; padding: 12px 14px; background: rgba(255,255,255,0.03); }
.q .t { font-weight: 600; font-size: 18px; display: flex; align-items: center; gap: 10px; } .q .eta { font-family: var(--display); font-size: 13px; color: var(--cyan); }
.q .bar { grid-column: 1 / -1; }
.q.locked { opacity: 0.5; border: 1px dashed rgba(255,63,176,0.4); display: flex; align-items: center; justify-content: space-between; }
.mat { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 10px; padding: 6px 0; }
.mat .dot { width: 14px; height: 14px; transform: rotate(45deg); box-shadow: 0 0 10px currentColor; background: currentColor; margin-left: 8px; }

/* tournament and rankings */
.ladder .item { grid-template-columns: 44px 1fr 90px 90px; }
.race-step { display: flex; align-items: center; gap: 10px; }
.race-step .dotn { width: 28px; height: 28px; display: grid; place-items: center; font-family: var(--display); font-size: 11px; border: 1px solid var(--line); clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); }
.race-step.done .dotn { background: var(--lime); color: #061018; border-color: transparent; box-shadow: 0 0 10px var(--lime); }
.race-step.now .dotn { background: var(--cyan); color: #061018; box-shadow: 0 0 14px var(--cyan); animation: barpulse 1s infinite; }
.race-step .ln { flex: 1; height: 1px; background: var(--line); }
.tabs { display: flex; gap: 4px; }
.tabs button { padding: 8px 14px; font-family: var(--display); font-size: 11px; letter-spacing: 2px; color: var(--mute); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--cyan); border-bottom-color: var(--cyan); }

/* modal */
#modal { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; background: rgba(4,2,12,0.7); backdrop-filter: blur(6px); }
#modal.on { display: grid; }
#modal .panel { width: min(560px, 92vw); max-height: 92vh; overflow-y: auto; animation: pop 0.35s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: scale(0.92) translateY(10px); } to { opacity: 1; transform: none; } }
.perk { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; padding: 8px 0; }
.perk .tick { color: var(--pink); font-family: var(--display); }
.price { font-family: var(--display); font-size: 40px; font-weight: 900; }
.price small { font-size: 14px; color: var(--mute); letter-spacing: 2px; }

/* toasts */
#toasts { position: fixed; right: 22px; top: 80px; z-index: 60; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { padding: 10px 16px; background: var(--glass); border-left: 3px solid var(--cyan); font-family: var(--display); font-size: 12px; letter-spacing: 2px; animation: toastin 0.35s var(--ease) both, toastout 0.4s var(--ease) 3s forwards; box-shadow: 0 0 20px rgba(48,232,255,0.2); }
.toast.p { border-left-color: var(--pink); } .toast.a { border-left-color: var(--amber); } .toast.l { border-left-color: var(--lime); }
@keyframes toastin { from { opacity: 0; transform: translateX(30px); } }
@keyframes toastout { to { opacity: 0; transform: translateX(30px); } }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; display: none; }
#hud.on { display: block; }
.hbox { position: absolute; padding: 10px 16px; background: var(--glass); border: 1px solid var(--line); clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
#speed { left: 18px; bottom: 18px; min-width: 190px; text-align: right; font-family: var(--display); font-size: 48px; font-weight: 900; letter-spacing: 1px; line-height: 1; padding-top: 14px; transition: text-shadow 0.15s; }
#speed small { font-size: 12px; font-weight: 400; color: var(--mute); letter-spacing: 2px; margin-left: 6px; }
#speed.boosting { color: #fff; text-shadow: 0 0 14px var(--cyan), 0 0 40px var(--cyan); }
#speed.over { animation: overpulse 0.35s ease-in-out infinite alternate; }
#boostbar { position: absolute; left: 18px; bottom: 100px; width: 222px; }
#hullbar { position: absolute; left: 18px; bottom: 142px; width: 222px; }
/* the throttle, on a keyboard only (pads and phones drive on their own): the hull moves up over it */
#thrbar { position: absolute; left: 18px; bottom: 142px; width: 222px; display: none; }
body.keys #thrbar { display: block; } body.keys #hullbar { bottom: 184px; }
/* the speed: the craft's top speed at the tick halfway, three times it at the end. The gradient belongs to
   the bar, not the fill (sized to the bar's width), so going faster uncovers more of it: cyan, violet and
   pink past the top, amber, white at the end, and a white pulse in the last stretch */
#thrbar .bar > i { transition: none; background: linear-gradient(90deg, var(--cyan) 0%, #7af0ff 48%, var(--violet) 56%, var(--pink) 68%, #ff8a20 80%, var(--amber) 90%, #fff 100%); background-size: 222px 100%; box-shadow: 0 0 10px rgba(48,232,255,0.5); }
#thrbar.boost .bar > i { box-shadow: 0 0 12px var(--pink); }
#thrbar.hot .bar > i { box-shadow: 0 0 14px var(--amber); }
#thrbar.over .bar { animation: overpulse 0.35s ease-in-out infinite alternate; }
@keyframes overpulse { from { box-shadow: 0 0 6px #fff; border-color: rgba(255,255,255,0.4); } to { box-shadow: 0 0 22px #fff, 0 0 40px var(--amber); border-color: #fff; } }
#thrbar .bar > s { position: absolute; top: -1px; bottom: -1px; left: 50%; width: 2px; background: var(--ink); opacity: 0.7; }
#thrbar #thr-key { transition: color 0.1s, text-shadow 0.1s; }
#thrbar.on #thr-key { color: var(--cyan); text-shadow: 0 0 8px var(--cyan); }
#thrbar .lbl { font-family: var(--display); font-size: 9px; letter-spacing: 3px; color: var(--mute); margin-bottom: 4px; display: flex; justify-content: space-between; }
/* the next bend: which way, how tight, how far */
#bend { position: absolute; left: 50%; top: 92px; transform: translateX(-50%); display: none; align-items: center; gap: 10px; padding: 6px 14px; background: rgba(8,6,20,0.6); border: 1px solid var(--line); font-family: var(--display); letter-spacing: 2px; }
#bend.on { display: flex; }
#bend .arrow { font-size: 22px; line-height: 1; }
#bend .lvl { font-size: 18px; letter-spacing: -2px; }
#bend .d { font-size: 12px; color: var(--mute); min-width: 52px; text-align: right; }
#bend.l1 { color: var(--cyan); border-color: var(--cyan); } #bend.l2 { color: var(--amber); border-color: var(--amber); } #bend.l3 { color: var(--red); border-color: var(--red); }
#bend.now { animation: barpulse 0.4s infinite; }
#hullbar .bar > i { transition: width 0.15s linear, background 0.3s; }
#hullbar .lbl { font-family: var(--display); font-size: 9px; letter-spacing: 3px; color: var(--mute); margin-bottom: 4px; display: flex; justify-content: space-between; }
#hullbar.warn .bar > i { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
#hullbar.crit .bar > i { background: var(--red); box-shadow: 0 0 12px var(--red); animation: barpulse 0.5s infinite; }
#hullbar.crit .lbl span:first-child { color: var(--red); }
#boostbar .bar > i { transition: width 0.08s linear, opacity 0.2s; }
#boostbar.wait .bar > i { opacity: 0.45; }
#boostbar.cell .bar { animation: cellflash 0.45s ease-out; }
@keyframes cellflash { 0% { box-shadow: 0 0 18px var(--lime), inset 0 0 10px var(--lime); border-color: var(--lime); } 100% { box-shadow: none; } }
#boostbar .lbl { font-family: var(--display); font-size: 9px; letter-spacing: 3px; color: var(--mute); margin-bottom: 4px; display: flex; justify-content: space-between; }
#times { right: 18px; top: 18px; min-width: 210px; font-family: var(--display); font-size: 15px; line-height: 1.7; text-align: right; }
#times .k { font-size: 10px; letter-spacing: 3px; color: var(--mute); margin-right: 8px; }
#times .diff { font-size: 20px; line-height: 1.4; } #times .diff.up { color: var(--lime); } #times .diff.down { color: var(--red); }
#lap { left: 18px; top: 18px; font-family: var(--display); font-size: 20px; font-weight: 900; letter-spacing: 2px; }
#lap small { font-size: 11px; color: var(--mute); letter-spacing: 3px; margin-left: 6px; }
#pause-btn { right: 18px; top: 112px; pointer-events: auto; cursor: pointer; font-family: var(--display); font-weight: 900; font-size: 13px; letter-spacing: 1px; color: var(--mute); padding: 6px 12px; }
#pause-btn:hover { color: var(--cyan); }
#view-btn { right: 18px; top: 150px; pointer-events: auto; cursor: pointer; font-family: var(--display); font-weight: 900; font-size: 11px; letter-spacing: 1px; color: var(--mute); padding: 6px 10px; }
#view-btn:hover { color: var(--cyan); }
/* (on a phone it would sit over the right steering pad: the game menu's VIEW does it there) */
body.coarse #view-btn { display: none; }
/* in the cockpit the dash carries the speed */
body.cockpit #speed { display: none; }
/* a craft alongside without mirrors: an arrow at that edge */
.near { position: absolute; top: 46%; font-size: 34px; color: var(--pink); text-shadow: 0 0 12px var(--pink), 0 0 30px var(--pink); opacity: 0; transition: opacity 0.12s; pointer-events: none; }
#near-l { left: 10px; } #near-r { right: 10px; }
#modal .gm-col { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
@media (max-height: 520px) { #modal .gm-col { flex-direction: row; flex-wrap: wrap; } #modal .gm-col .btn { flex: 1 1 auto; } #modal .title { font-size: 22px; margin: 0; } #modal .gm-row { padding: 4px 0; } }
#modal .gm-keys { margin: 6px 0 12px; padding: 12px 14px; background: rgba(48,232,255,0.04); border: 1px solid rgba(48,232,255,0.14); clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
#modal .ck { display: grid; grid-template-columns: auto 1fr auto; gap: 7px 16px; align-items: center; margin-top: 10px; }
#modal .ck > span { display: flex; flex-wrap: wrap; gap: 5px; }
#modal .ck-h { font-family: var(--display); font-size: 9px; letter-spacing: 3px; color: var(--mute); }
#modal .ck > .ck-h:last-child { justify-content: flex-end; }
#modal .ck > span:nth-child(3n) { justify-content: flex-end; }
#modal .ck-a { font-family: var(--display); font-size: 11px; letter-spacing: 3px; color: var(--cyan); text-shadow: 0 0 8px rgba(48,232,255,0.45); }
#modal .ck kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 7px; box-sizing: border-box; font-family: var(--display); font-size: 10px; font-weight: 700; letter-spacing: 1px; color: var(--ink); background: linear-gradient(180deg, #221c46, #120e28); border: 1px solid rgba(48,232,255,0.4); border-bottom-width: 3px; border-radius: 4px; box-shadow: 0 0 10px rgba(48,232,255,0.12); }
#modal .ck kbd.ar { font-family: system-ui, sans-serif; font-size: 14px; }
#modal .ck kbd.pb { border-radius: 12px; border-color: rgba(255,63,176,0.55); box-shadow: 0 0 10px rgba(255,63,176,0.15); }
#modal .ck.touch { grid-template-columns: auto 1fr; }
#modal .ck.touch > span:nth-child(3n) { justify-content: flex-start; }
#modal .ck-t { font-size: 13px; color: var(--mute); }
#modal .ck-note { margin-top: 10px; font-size: 12px; color: var(--mute); }
#modal .gm-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line, rgba(255,255,255,0.08)); font-family: var(--display); font-size: 12px; letter-spacing: 3px; }
#pos { left: 160px; top: 18px; font-family: var(--display); font-size: 20px; font-weight: 900; color: var(--amber); display: none; }
#pos.on { display: block; }
#slots { position: absolute; right: 18px; bottom: 18px; display: none; gap: 10px; }
#slots.on { display: flex; }
.slotx { width: 64px; height: 64px; display: grid; place-items: center; background: var(--glass); border: 1px solid var(--line); clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); font-family: var(--display); font-size: 10px; letter-spacing: 1px; color: var(--cyan); text-align: center; }
.slotx.full { background: rgba(48,232,255,0.18); box-shadow: inset 0 0 20px rgba(48,232,255,0.3); animation: barpulse 1.4s infinite; }
.slotx .key { font-size: 9px; color: var(--mute); }
#objective { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); display: none; min-width: 360px; text-align: center; }
#objective.on { display: block; }
#objective .t { font-family: var(--display); font-size: 11px; letter-spacing: 4px; color: var(--mute); }
#objective .v { font-family: var(--display); font-size: 22px; font-weight: 900; margin: 2px 0 6px; }
#objective .bar { height: 8px; }
#msg { position: absolute; left: 50%; top: 24%; transform: translateX(-50%) scale(0.8); font-family: var(--display); font-size: 58px; font-weight: 900; letter-spacing: 6px; color: #fff; text-shadow: 0 0 24px var(--pink), 0 0 60px var(--pink); opacity: 0; transition: opacity 0.12s, transform 0.25s var(--ease); white-space: nowrap; }
#msg.on { opacity: 1; transform: translateX(-50%) scale(1); }
#msg.go { color: var(--lime); text-shadow: 0 0 24px var(--lime), 0 0 60px var(--lime); }
#msg.bad { text-shadow: 0 0 24px var(--red), 0 0 60px var(--red); animation: glitch 0.3s steps(2) 3; }
@keyframes glitch { 25% { transform: translateX(-50%) skewX(12deg); } 75% { transform: translateX(-50%) skewX(-12deg); } }
#banner { position: absolute; left: 0; right: 0; top: 36%; text-align: center; pointer-events: none; opacity: 0; }
#banner.on { animation: banner 1.8s var(--ease) both; }
#banner .big { font-family: var(--display); font-size: 42px; font-weight: 900; letter-spacing: 8px; color: #fff; text-shadow: 0 0 30px var(--cyan); }
#banner .small { font-family: var(--display); font-size: 14px; letter-spacing: 6px; color: var(--cyan); }
#banner .line { width: 0; height: 2px; margin: 8px auto; background: linear-gradient(90deg, transparent, var(--cyan), var(--pink), transparent); animation: linew 1.2s var(--ease) both; }
@keyframes banner { 0% { opacity: 0; transform: translateX(-80px); } 15% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(80px); } }
@keyframes linew { to { width: 420px; } }
#hint { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); font-family: var(--display); font-size: 11px; letter-spacing: 4px; color: var(--mute); }

/* landing */
#overlay { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: linear-gradient(180deg, rgba(7,4,15,0.1), rgba(7,4,15,0.7)); cursor: pointer; }
#overlay.off { display: none; }
#overlay h1 { font-size: clamp(30px, 7vw, 96px); font-weight: 900; letter-spacing: 0.1em; color: #fff; text-shadow: 0 0 30px var(--cyan), 0 0 80px var(--pink); animation: flicker 6s infinite; }
@keyframes flicker { 0%, 97%, 100% { opacity: 1; } 98% { opacity: 0.6; } 99% { opacity: 0.9; } }
#overlay .sub { margin: 4px 0 30px; letter-spacing: 8px; font-family: var(--display); font-size: 12px; color: var(--cyan); }
#overlay .best { font-family: var(--display); font-size: 16px; letter-spacing: 2px; margin-bottom: 22px; }
#overlay .best b { color: var(--cyan); }
#overlay .prompt { animation: pulse 1.6s infinite; }
#overlay .keys { margin-top: 26px; font-size: 14px; color: var(--mute); line-height: 1.7; }
#overlay .corner { position: absolute; bottom: 22px; left: 22px; font-family: var(--display); font-size: 10px; letter-spacing: 3px; color: var(--dim); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 10px rgba(48,232,255,0.5); } 50% { box-shadow: 0 0 34px rgba(48,232,255,0.9); } }

/* results */
#results { position: fixed; inset: 0; z-index: 25; display: none; place-items: center; background: radial-gradient(ellipse at center, rgba(7,4,15,0.35), rgba(7,4,15,0.92)); }
#results.on { display: grid; }
#results .panel { width: min(760px, 94vw); }
.res-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.res-head h2 { font-size: 36px; }
.res-place { font-family: var(--display); font-size: 64px; font-weight: 900; line-height: 1; color: var(--amber); text-shadow: 0 0 30px var(--amber); }
.res-place small { font-size: 16px; letter-spacing: 3px; }
.res-place.res-medal { font-size: 40px; letter-spacing: 4px; color: var(--mc); text-shadow: 0 0 24px var(--mc); }
.laps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0 16px; }
.res-times { gap: 8px 22px; } .res-times .num { font-size: 16px; letter-spacing: 0; } .res-times .eyebrow { white-space: nowrap; }
.lapc { padding: 10px 12px; background: rgba(255,255,255,0.04); font-family: var(--display); }
.lapc .k { font-size: 10px; letter-spacing: 3px; color: var(--mute); } .lapc .v { font-size: 20px; font-weight: 700; margin-top: 2px; }
.lapc.best .v { color: var(--cyan); text-shadow: 0 0 12px var(--cyan); }
.reward { display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center; padding: 8px 0; opacity: 0; animation: rise 0.5s var(--ease) forwards; }
.reward .big { font-family: var(--display); font-size: 22px; font-weight: 900; }
.box { width: 50px; height: 50px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(255,176,32,0.3), rgba(255,63,176,0.3)); border: 1px solid var(--amber); clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); font-family: var(--display); font-size: 10px; color: var(--amber); animation: boxglow 1.2s ease-in-out infinite; cursor: pointer; }
@keyframes boxglow { 50% { box-shadow: 0 0 26px var(--amber); transform: scale(1.06); } }
.box.open { animation: none; cursor: default; font-size: 13px; }
#results.held .panel { visibility: hidden; }

/* the reward box's own stage, before the results */
#boxstage { position: fixed; inset: 0; z-index: 46; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; overflow: hidden; background: radial-gradient(ellipse at center, rgba(40,14,60,0.7), rgba(4,2,12,0.82) 75%); animation: rise 0.4s var(--ease); }
#boxstage.out { opacity: 0; transition: opacity 0.3s; }
#boxstage .eyebrow { color: var(--amber); position: relative; }
.bs-title { font-size: clamp(28px, 6vw, 56px); font-weight: 900; letter-spacing: 0.12em; color: #fff; text-shadow: 0 0 24px var(--amber), 0 0 60px var(--pink); position: relative; }
.bs-box { position: relative; width: 170px; height: 170px; display: grid; place-items: center; cursor: pointer; animation: bsidle 1.4s ease-in-out infinite; }
.bs-box i { position: absolute; inset: 0; background: linear-gradient(135deg, var(--amber), var(--pink) 55%, var(--violet)); clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); filter: drop-shadow(0 0 30px var(--amber)); }
.bs-box i::after { content: ""; position: absolute; inset: 6px; background: linear-gradient(160deg, #2a1440, #0d0820); clip-path: inherit; }
.bs-box span { position: relative; font-family: var(--display); font-weight: 900; font-size: 18px; letter-spacing: 4px; color: var(--amber); text-shadow: 0 0 14px var(--amber); }
.bs-box.salvage i { background: linear-gradient(135deg, #cfd6ff, var(--cyan)); filter: drop-shadow(0 0 24px var(--cyan)); }
.bs-box.salvage span { color: var(--cyan); text-shadow: 0 0 14px var(--cyan); }
.bs-hint { font-family: var(--display); font-size: 12px; letter-spacing: 6px; color: var(--mute); animation: flicker 2s infinite; position: relative; }
@keyframes bsidle { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.07) rotate(2deg); } }
#boxstage.charge .bs-box { animation: bsshake 1.15s ease-in forwards; }
#boxstage.charge .bs-box i { animation: bscharge 1.15s ease-in forwards; }
@keyframes bsshake { 0% { transform: none; } 10% { transform: translateX(-3px) rotate(-2deg); } 20% { transform: translateX(3px) rotate(2deg); } 30% { transform: translateX(-5px) rotate(-4deg) scale(1.03); } 40% { transform: translateX(5px) rotate(4deg) scale(1.05); } 50% { transform: translateX(-7px) rotate(-6deg) scale(1.08); } 60% { transform: translateX(8px) rotate(6deg) scale(1.1); } 70% { transform: translateX(-10px) rotate(-8deg) scale(1.13); } 80% { transform: translateX(11px) rotate(9deg) scale(1.17); } 90% { transform: translateX(-12px) rotate(-10deg) scale(1.22); } 100% { transform: scale(1.3); } }
@keyframes bscharge { to { filter: drop-shadow(0 0 80px #fff) brightness(2.2); } }
#boxstage.burst .bs-box, #boxstage.burst .bs-hint { animation: bsgone 0.45s var(--ease) forwards; pointer-events: none; }
@keyframes bsgone { to { transform: scale(2.4); opacity: 0; } }
#boxstage.burst .bs-box, #boxstage.burst .bs-hint { position: absolute; }
.bs-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
#boxstage.burst .bs-flash { animation: bsflash 0.7s ease-out; }
@keyframes bsflash { 0% { opacity: 0.95; } 100% { opacity: 0; } }
.bs-rays { position: absolute; left: 50%; top: 50%; width: 180vmax; height: 180vmax; margin: -90vmax 0 0 -90vmax; opacity: 0; pointer-events: none; background: repeating-conic-gradient(rgba(255,176,32,0.22) 0deg 6deg, transparent 6deg 18deg); -webkit-mask: radial-gradient(circle, #000 0, transparent 45%); mask: radial-gradient(circle, #000 0, transparent 45%); }
#boxstage.burst .bs-rays { opacity: 1; transition: opacity 0.4s; animation: bsrays 14s linear infinite; }
@keyframes bsrays { to { transform: rotate(360deg); } }
.bs-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; position: relative; min-height: 10px; }
.bs-card { width: 150px; padding: 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--glass); border: 1px solid var(--amber); box-shadow: 0 0 30px rgba(255,176,32,0.35); clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); animation: bsdeal 0.55s var(--ease) both; }
.bs-card .big { font-family: var(--display); font-size: 26px; font-weight: 900; color: var(--amber); }
.bs-card .sub { text-align: center; }
.bs-card .bs-ico { width: 96px; height: 96px; display: grid; place-items: center; }
.bs-card .bs-ico img { width: 96px; height: 96px; }
.bs-card.rare { border-color: var(--rc); box-shadow: 0 0 44px var(--rc); }
.bs-card.rare .big { color: var(--rc); font-size: 18px; letter-spacing: 3px; }
@keyframes bsdeal { from { opacity: 0; transform: translateY(60px) rotateY(90deg) scale(0.6); } to { opacity: 1; transform: none; } }
.bs-foot { display: flex; gap: 14px; align-items: center; position: relative; margin-top: 8px; }
#bs-take { display: none; }
#boxstage.done #bs-take { display: inline-flex; animation: pop 0.4s var(--ease); }
#boxstage.done #bs-skip { display: none; }
.xp .lbl { display: flex; justify-content: space-between; font-family: var(--display); font-size: 11px; letter-spacing: 3px; color: var(--mute); margin-bottom: 6px; }
.rankup { font-family: var(--display); font-size: 14px; color: var(--lime); letter-spacing: 3px; text-shadow: 0 0 12px var(--lime); animation: pop 0.4s var(--ease) both; }
.signup { margin-top: 16px; padding: 12px 16px; border: 1px dashed rgba(255,63,176,0.5); display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* touch zones: two thumbs in the bottom corners (main.js, touch). The left corner is the steering
   pad (a thumb left of its middle steers left, right steers right, further out harder: --steer from
   main.js lights the side it's leaning); the right corner is BOOST, the big round button, with BRAKE
   beside it and DRIFT above it, all under one thumb that slides between them. The zones themselves
   take the touches; the pads are drawn only. Each lights while it's held (.on, from main.js). */
#touch { position: fixed; inset: 0; z-index: 5; display: none; --tin: max(14px, env(safe-area-inset-left)); --tbot: max(14px, env(safe-area-inset-bottom)); --trin: max(14px, env(safe-area-inset-right)); }
.coarse #touch { display: block; }
/* a race's end puts a stage or the results over it: the pads would show through, so they go */
body.staged #touch, body:has(#boxstage) #touch, body:has(#results.on) #touch { display: none; }
#tl, #tr { position: absolute; bottom: 0; top: 0; touch-action: none; }
#tl { left: 0; width: 46%; } #tr { right: 0; width: 54%; }
#touch .tk-pad, #touch .tk-boost, #touch .tk-brake, #touch .tk-drift { pointer-events: none; position: absolute; box-sizing: border-box; font-family: var(--display); letter-spacing: 2px; transition: background .12s, box-shadow .12s, border-color .12s, color .12s; }
.tk-pad { left: var(--tin); bottom: var(--tbot); width: 200px; height: 72px; display: grid; grid-template-columns: 1fr 2px 1fr; align-items: center; font-size: 26px; color: var(--cyan); border: 2px solid rgba(48,232,255,.45); border-radius: 18px; background: rgba(10,30,50,.28); box-shadow: 0 0 18px rgba(48,232,255,.15) inset; overflow: hidden; }
.tk-pad span { text-align: center; opacity: .5; transition: opacity .1s; }
.tk-pad i { height: 60%; background: rgba(48,232,255,.35); }
#tl.on .tk-pad { border-color: var(--cyan); box-shadow: 0 0 22px rgba(48,232,255,.5); }
#tl.on .tk-pad .l { opacity: calc(.5 + var(--sl, 0) * .5); color: #fff; }
#tl.on .tk-pad .r { opacity: calc(.5 + var(--sr, 0) * .5); color: #fff; }
.tk-boost { right: var(--trin); bottom: var(--tbot); width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; color: rgba(255,176,32,.85); border: 2px solid rgba(255,176,32,.45); background: rgba(40,24,0,.2); box-shadow: 0 0 20px rgba(255,176,32,.15) inset; }
.tk-brake { right: calc(var(--trin) + 108px); bottom: var(--tbot); width: 92px; height: 58px; border-radius: 29px; display: grid; place-items: center; font-size: 11px; color: var(--pink); border: 2px solid rgba(255,63,176,.45); background: rgba(40,0,24,.25); }
.tk-drift { right: var(--trin); bottom: calc(var(--tbot) + 108px); width: 96px; height: 58px; border-radius: 12px; display: grid; place-items: center; font-size: 11px; color: var(--cyan); border: 2px solid rgba(48,232,255,.4); background: rgba(0,24,40,.25); }
#tboost.on { background: rgba(255,176,32,.45); box-shadow: 0 0 26px rgba(255,176,32,.7); color: #fff; }
#tdrift.on { background: rgba(48,232,255,.4); box-shadow: 0 0 22px rgba(48,232,255,.6); color: #fff; }
#tb.on { background: rgba(255,63,176,.45); box-shadow: 0 0 22px rgba(255,63,176,.6); color: #fff; }
/* upright, the pads shrink so the two corners fit side by side */
@media (orientation: portrait) {
  .tk-pad { width: 170px; height: 68px; }
  .tk-boost { width: 84px; height: 84px; } .tk-brake { right: calc(var(--trin) + 94px); width: 80px; height: 54px; } .tk-drift { width: 84px; height: 54px; bottom: calc(var(--tbot) + 96px); }
}
/* the drift meter: shows while a drift charges, the marks at the tiers, cyan to pink to amber */
#driftbar { position: absolute; left: 50%; bottom: 24%; transform: translateX(-50%); width: 220px; opacity: 0; transition: opacity .15s; pointer-events: none; }
#driftbar.on { opacity: 1; }
#driftbar .lbl { font-family: var(--display); font-size: 9px; letter-spacing: 3px; color: var(--mute); margin-bottom: 4px; display: flex; justify-content: space-between; }
#driftbar .bar { position: relative; }
#driftbar .bar > i { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
#driftbar.t2 .bar > i { background: var(--pink); box-shadow: 0 0 10px var(--pink); }
#driftbar.t3 .bar > i { background: var(--amber); box-shadow: 0 0 12px var(--amber); }
#driftbar .bar > b { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.5); }
#driftbar.t1 .t { color: var(--cyan); } #driftbar.t2 .t { color: var(--pink); } #driftbar.t3 .t { color: var(--amber); }
/* the keyboard hint on the boost bar means nothing on a phone */
body.coarse #boostbar .lbl span:last-child { display: none; }

@media (max-width: 820px) {
  .garage-grid .row.between { flex-wrap: wrap; } .swatches { flex-wrap: wrap; }
  .cols-2, .cols-3 { grid-template-columns: 1fr; } .cols-4, .cols-5 { grid-template-columns: 1fr 1fr; }
  .garage-grid { grid-template-columns: 1fr !important; }
  .head { flex-wrap: wrap; gap: 8px; } .head h2 { font-size: 24px; }
  .mode { min-height: 0; } .zone { height: 120px; }
  .chip { font-size: 10px; padding: 4px 8px; gap: 5px; }
  .btn.big { padding: 14px 26px; font-size: 14px; letter-spacing: 3px; }
  #garage-view { height: 240px; }
  .ladder .item { grid-template-columns: 34px 1fr 64px 70px; } .item .name { font-size: 15px; }
  #results .panel { width: 96vw; } #results .in { padding: 14px; } .res-head h2 { font-size: 24px; } .res-place { font-size: 44px; } .res-place.res-medal { font-size: 28px; }
  #speed { font-size: 34px; min-width: 140px; } #times { min-width: 160px; font-size: 13px; }
  #objective { min-width: 220px; }
  #msg { font-size: 36px; }
  .laps { grid-template-columns: 1fr; }
}

/* live encounter HUD */
#slots .slotx { pointer-events: auto; cursor: pointer; }
#field { position: absolute; left: 50%; top: 30px; width: min(520px, 56vw); height: 26px; transform: translateX(-50%); display: none; }
#field.on { display: block; }
#field .line { position: absolute; left: 0; right: 0; top: 12px; height: 2px; background: linear-gradient(90deg, rgba(48,232,255,0.15), rgba(48,232,255,0.6), rgba(48,232,255,0.15)); box-shadow: 0 0 8px rgba(48,232,255,0.4); }
#field .who { background-size: cover; background-position: center 30%; position: absolute; top: 2px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; display: grid; place-items: center; background: rgba(7,4,15,0.85); border: 2px solid var(--c); box-shadow: 0 0 8px var(--c); font-family: var(--display); font-size: 10px; font-weight: 900; color: #fff; }
#field .who.me { --c: var(--cyan); width: 34px; height: 26px; top: 0; margin-left: -17px; border-radius: 13px; font-size: 9px; letter-spacing: 1px; z-index: 2; background: var(--cyan); color: #07040f; }
#pos small { font-size: 11px; color: var(--mute); margin-left: 6px; letter-spacing: 1px; }
#pos.warn { color: var(--pink); animation: barpulse 0.8s infinite; }
#objective .v small { font-size: 13px; }
.stat .v small { font-size: 10px; }

/* accounts */
.gold { color: #ffd24f !important; text-shadow: 0 0 10px rgba(255,210,79,0.45); }
#acc .field { display: block; width: 100%; margin-top: 10px; padding: 11px 14px; background: rgba(10,6,24,0.75); border: 1px solid var(--line); color: var(--ink); font-family: var(--body, inherit); font-size: 16px; outline: none; }
#acc .field:focus { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan), 0 0 14px rgba(48,232,255,0.25); }
#acc a { color: var(--mute); font-size: 13px; margin-right: 14px; text-decoration: none; letter-spacing: 1px; }
#acc a:hover { color: var(--cyan); }
#acc .err { min-height: 18px; margin-top: 8px; color: var(--pink); font-family: var(--display); font-size: 11px; letter-spacing: 1px; }
#acc .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
#acc .field { box-sizing: border-box; -webkit-user-select: text; user-select: text; }

/* materials: a still of the model, a live canvas over it while it turns */
.m3d { position: relative; display: inline-block; flex: none; vertical-align: middle; cursor: pointer; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--c) 55%, transparent)); }
.m3d img, .m3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.m3d.live img { visibility: hidden; }
.costs { display: inline-flex; flex-wrap: wrap; gap: 2px 10px; vertical-align: middle; }
.cost { display: inline-flex; align-items: center; gap: 3px; }
.cost.short { color: var(--amber); }
.drops { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }
.drop { display: flex; align-items: center; gap: 6px; animation: rise 0.5s var(--ease) both; }
.drop .num { font-size: 13px; }

/* an empty slot or an untrained part: the model as a dim outline */
.m3d.sil { filter: grayscale(1) brightness(0.45); opacity: 0.55; }
.m3d.sil.live { filter: grayscale(1) brightness(0.7); opacity: 0.8; }
/* the part picker: one card per Mk */
.picks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.pick { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; text-align: center; background: rgba(255,255,255,0.03); border: 1px solid transparent; }
.pick.on { border-color: var(--lime); background: rgba(92,255,138,0.06); }
.pick.locked .num { color: var(--dim); }
.pick .sub { font-size: 12px; line-height: 1.3; }
.pick .need { color: var(--amber); }
@media (max-width: 560px) { .picks { grid-template-columns: 1fr; } .pick { flex-direction: row; text-align: left; } }

/* achievements: the unlock toast, the skin chips in the garage */
.toast.ach { display: flex; flex-direction: column; gap: 2px; min-width: 240px; }
.toast.ach .ach-k { font-size: 10px; letter-spacing: 2px; opacity: 0.7; }
.toast.ach .ach-x { font-size: 11px; color: var(--amber); letter-spacing: 1px; }
.sw.skin.locked { opacity: 0.3; filter: grayscale(0.7); }
.sw-liv { flex-basis: 100%; display: flex; align-items: center; gap: 8px; margin-top: 4px; } .sw-liv .eyebrow { margin-right: 4px; } .sw.liv { width: 18px; height: 18px; } .sw.liv.locked { opacity: 0.25; }

/* stickers: the four spots in the garage, the picker grid, a sticker found in a box */
.stk { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stk-spot { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; background: rgba(255,255,255,0.03); border: 1px dashed var(--line); color: var(--mute); font-family: var(--display); font-size: 9px; letter-spacing: 1px; cursor: pointer; }
.stk-spot.on { border-style: solid; color: var(--ink); }
.stk-spot img { width: 44px; height: 44px; }
.stk-spot:not(.on)::before { content: '+'; font-size: 22px; line-height: 44px; height: 44px; color: var(--dim); }
.stk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 8px; }
.stk-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; background: rgba(255,255,255,0.03); border: 1px solid transparent; color: var(--ink); cursor: pointer; text-align: center; }
.stk-item img { width: 56px; height: 56px; }
.stk-item span { font-size: 12px; font-weight: 600; } .stk-item small { font-size: 10px; color: var(--mute); text-transform: uppercase; letter-spacing: 1px; }
.stk-item.on { border-color: var(--lime); }
.stk-item.locked { cursor: default; } .stk-item.locked img { filter: grayscale(1) brightness(0.4); }
.stk-item.r-rare span { color: var(--cyan); } .stk-item.r-epic span { color: var(--pink); } .stk-item.r-legend span { color: var(--amber); }
.stk-drop { width: 52px; height: 52px; }

/* track select: the selected track in 3D beside its numbers, a minimap on every card */
.track-preview { display: grid; grid-template-columns: 1fr 240px; align-items: stretch; overflow: hidden; }
.track-preview canvas { width: 100%; height: 260px; display: block; cursor: grab; }
.track-preview .tp-info { padding: 16px 18px; border-left: 1px solid var(--line); }
.track-preview .tp-info h3 { font-size: 22px; margin: 2px 0 10px; }
.track-preview .stat { display: flex; justify-content: space-between; padding: 3px 0; font-size: 13px; }
.track-preview .stat .k { font-family: var(--display); font-size: 10px; letter-spacing: 2px; color: var(--mute); }
.card.zone canvas.mini { width: 100%; height: 0; flex: 1 1 auto; min-height: 0; object-fit: contain; display: block; margin-bottom: 6px; opacity: 0.9; }
.zone { height: 200px; }
@media (max-width: 760px) { .track-preview { grid-template-columns: 1fr; } .track-preview .tp-info { border-left: none; border-top: 1px solid var(--line); } .track-preview canvas { height: 200px; } }

/* collection */
.jb { display: grid; gap: 4px; margin-top: 10px; }
.jb-row { display: grid; grid-template-columns: 34px 22px 1fr auto 70px; align-items: center; gap: 12px; padding: 9px 12px; background: rgba(255,255,255,0.03); border: 1px solid transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.jb-row:hover { background: rgba(48,232,255,0.08); border-color: var(--line); }
.jb-row .n { color: var(--dim); font-size: 12px; } .jb-row .t { font-family: var(--display); font-size: 13px; letter-spacing: 1px; } .jb-row .w { color: var(--mute); font-size: 13px; } .jb-row .b { color: var(--mute); font-size: 11px; text-align: right; }
.jb-row.on { background: rgba(48,232,255,0.12); border-color: var(--cyan); box-shadow: 0 0 18px rgba(48,232,255,0.25); } .jb-row.on .t { color: var(--cyan); }
.jb-row.locked { opacity: 0.4; cursor: default; }
.jb-row .eq { display: flex; align-items: flex-end; gap: 2px; height: 14px; opacity: 0.25; }
.jb-row .eq i { width: 4px; height: 4px; background: var(--cyan); }
.jb-row.on .eq { opacity: 1; } .jb-row.on .eq i { animation: eq 0.7s ease-in-out infinite alternate; } .jb-row.on .eq i:nth-child(2) { animation-delay: -0.3s; } .jb-row.on .eq i:nth-child(3) { animation-delay: -0.5s; }
@keyframes eq { from { height: 3px; } to { height: 14px; } }
.col-craft .in { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.col-craft.locked { opacity: 0.45; }
.col-skin-row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 12px; padding: 6px 0; }
.tag.locked { opacity: 0.35; }
@media (max-width: 760px) { .jb-row { grid-template-columns: 26px 18px 1fr 56px; } .jb-row .w { display: none; } }

/* journals */
.journal .pages { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pg { width: 30px; height: 38px; display: grid; place-items: center; background: linear-gradient(160deg, #efe6cf, #cbbd98); color: #2a2018; font-family: var(--display); font-size: 12px; font-weight: 900; border: none; clip-path: polygon(0 0, 100% 0, 100% 82%, 80% 100%, 0 100%); box-shadow: 0 0 10px rgba(255,176,32,0.25); cursor: pointer; }
.pg.missing { background: rgba(255,255,255,0.05); color: var(--dim); box-shadow: none; outline: 1px dashed rgba(255,255,255,0.15); cursor: default; }
.journal.done { box-shadow: 0 0 22px rgba(255,176,32,0.25); }
.page-text { font-size: 18px; line-height: 1.55; margin: 14px 0 0; padding: 16px 18px; background: linear-gradient(160deg, #efe6cf, #d8cba8); color: #2a2018; font-family: 'Courier New', monospace; }
.bs-card.page { border-color: #efe6cf; box-shadow: 0 0 40px rgba(239,230,207,0.45); cursor: pointer; }
.bs-card.page .pg { width: 62px; height: 78px; font-size: 26px; }
.bs-card.page .big { color: #efe6cf; font-size: 16px; letter-spacing: 2px; text-align: center; }

/* comms: a pilot's face and line at the bottom of the race */
#comms { position: absolute; left: 50%; bottom: 26px; transform: translate(-50%, 140%); display: flex; align-items: center; gap: 14px; width: min(560px, 92vw); padding: 10px 16px 10px 10px; background: linear-gradient(90deg, rgba(10,6,24,0.92), rgba(10,6,24,0.75)); border: 1px solid var(--line); box-shadow: 0 0 24px rgba(48,232,255,0.2); clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px); opacity: 0; transition: transform 0.35s var(--ease), opacity 0.35s; }
#comms.on { transform: translate(-50%, 0); opacity: 1; }
#comms .face { position: relative; flex: none; width: 76px; height: 76px; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #2a1450, #0a0618); border: 1px solid rgba(255,63,176,0.6); overflow: hidden; }
#comms .face canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
#comms .face.has canvas { opacity: 1; } #comms .face.has b { display: none; }
#comms .face b { font-family: var(--display); font-size: 30px; font-weight: 900; color: var(--pink); text-shadow: 0 0 12px var(--pink); }
#comms .face::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0,0,0,0.22) 0 1px, transparent 1px 3px); pointer-events: none; }
#comms.talking .face b { animation: talk 0.16s steps(2) infinite; }
@keyframes talk { 50% { transform: translateY(1px) scale(1.015); filter: brightness(1.15); } }
#comms .face { animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-1px); } }
#comms .who { font-family: var(--display); font-size: 10px; letter-spacing: 3px; color: var(--cyan); }
#comms .said { margin-top: 4px; font-size: 19px; font-weight: 600; color: #fff; min-height: 24px; }

.driver-bust { width: 96px; height: 96px; border: 1px solid var(--line); box-shadow: 0 0 14px rgba(48,232,255,0.25); clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.driver-bust.live { display: block; }
.card .say { position: absolute; left: 128px; top: 22px; max-width: calc(100% - 146px); padding: 6px 10px; background: rgba(10,6,24,0.92); border: 1px solid var(--cyan); color: #fff; font-size: 13px; line-height: 1.3; clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px); animation: pop 0.25s var(--ease); }

/* the quarters: the room full screen, a crosshair, what you aim at, a menu over the room */
#qt { position: fixed; inset: 0; z-index: 35; background: #05030c; }
/* the night drive */
#nd { position: fixed; inset: 0; z-index: 36; background: #0b0d16; }
#nd-cv { display: block; width: 100%; height: 100%; touch-action: none; }
.nd-hud { position: absolute; inset: 0; pointer-events: none; font-family: var(--display); color: #fff; }
.nd-hint { position: absolute; left: 22px; top: 20px; font-size: 15px; letter-spacing: 5px; text-shadow: 0 0 12px rgba(255,79,176,0.8); transition: opacity 2s; }
.nd-hint span { display: block; margin-top: 6px; font-size: 10px; letter-spacing: 2px; color: var(--cyan); opacity: 0.8; }
.nd-hint.off { opacity: 0; }
.nd-speed { position: absolute; right: 26px; bottom: 22px; font-size: 11px; letter-spacing: 3px; color: rgba(255,255,255,0.6); }
.nd-speed b { font-size: 34px; letter-spacing: 1px; color: #fff; text-shadow: 0 0 14px rgba(64,200,255,0.7); margin-right: 6px; }
.nd-top { position: absolute; right: 18px; top: 16px; display: flex; gap: 8px; pointer-events: auto; }
/* in the cockpit the dash shows the speed */
.nd-hud.in .nd-speed { display: none; }
/* what's playing, a moment in the corner when the radio changes (the chase view) */
.nd-now { position: absolute; left: 22px; bottom: 22px; padding: 8px 14px; background: rgba(8,6,18,0.7); border-left: 2px solid var(--pink, #ff3fb0); opacity: 0; transform: translateY(8px); transition: opacity 0.6s, transform 0.6s; }
.nd-now.on { opacity: 1; transform: none; }
.nd-now span { display: block; font-size: 9px; letter-spacing: 3px; color: var(--cyan); } .nd-now b { font-size: 15px; letter-spacing: 2px; }
.nd-flash { position: absolute; inset: 0; background: #c8d0ff; opacity: 0; mix-blend-mode: screen; }
.nd-fade { position: absolute; inset: 0; background: #05040a; opacity: 0; pointer-events: none; }
.nd-dest { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); padding: 8px 18px; background: rgba(8,6,18,0.72); border-bottom: 2px solid var(--amber); text-align: center; opacity: 0; transition: opacity 0.5s; }
.nd-dest.on { opacity: 1; } .nd-dest span { display: block; font-size: 10px; letter-spacing: 3px; color: var(--cyan); } .nd-dest b { font-size: 16px; letter-spacing: 2px; }
.nd-top .nd-rowb.on { border-color: var(--amber); color: var(--amber); }
/* Makers' Row (makersrow.js): the arcade street's sign and arrows, a store's browse panel over its set */
.mr-hud .mr-fade { position: absolute; inset: 0; background: #05040a; opacity: 0; transition: opacity 0.35s; pointer-events: none; z-index: 3; }
.mr-hud .mr-fade.on { opacity: 1; }
.mr-hud[data-mode="street"] .mr-store, .mr-hud[data-mode="store"] .mr-street { display: none; }
.mr-mk { display: block; object-fit: contain; }
.mr-at { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; pointer-events: auto; }
.mr-sign { display: flex; align-items: center; gap: 12px; min-width: 300px; max-width: 46vw; padding: 10px 16px; background: rgba(8,6,18,0.78); border-left: 3px solid var(--mc, var(--pink)); }
.mr-sign b { display: block; font-size: 16px; letter-spacing: 4px; } .mr-sign small { display: block; margin-top: 3px; font-family: var(--body); font-size: 13px; letter-spacing: 0; color: var(--mute); }
.mr-at .mr-in { opacity: 0.45; transition: opacity 0.3s; white-space: nowrap; } .mr-at.close .mr-in { opacity: 1; }
.mr-shops { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); display: flex; gap: 6px; pointer-events: auto; }
.mr-shops button { padding: 5px; background: rgba(8,6,18,0.6); border: 1px solid transparent; opacity: 0.6; transition: opacity 0.2s; }
.mr-shops button:hover, .mr-shops button.on { opacity: 1; } .mr-shops button.on { border-color: var(--line); }
.mr-store .nd-top { align-items: center; }
.mr-cr { font-size: 11px; letter-spacing: 2px; color: var(--mute); padding: 6px 10px; background: rgba(8,6,18,0.6); }
.mr-side { position: absolute; left: 18px; top: 66px; bottom: 18px; width: min(380px, 36vw); pointer-events: auto; --c: 12px; }
.mr-side > .in { height: 100%; box-sizing: border-box; overflow-y: auto; padding: 18px 20px; background: rgba(8,5,20,0.86); font-family: var(--body); }
.mr-maker { display: flex; align-items: center; gap: 14px; } .mr-maker h2 { font-size: 22px; letter-spacing: 4px; } .mr-maker .sub { font-size: 14px; margin-top: 2px; }
.mr-story { margin: 12px 0 4px; font-size: 14px; line-height: 1.45; color: var(--mute); }
.mr-story summary { cursor: pointer; font-family: var(--display); font-size: 10px; letter-spacing: 3px; color: var(--mc, var(--cyan)); list-style: none; }
.mr-story p { margin: 6px 0 0; }
.mr-hull { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.08); }
.mr-hn h3 { font-size: 26px; letter-spacing: 4px; margin-top: 2px; }
.mr-stats { display: grid; grid-template-columns: auto 1fr 28px; gap: 5px 10px; align-items: center; margin: 12px 0; font-family: var(--display); font-size: 10px; letter-spacing: 2px; color: var(--mute); }
.mr-stats i { height: 5px; background: rgba(255,255,255,0.08); } .mr-stats i b { display: block; height: 100%; background: linear-gradient(90deg, var(--mc, var(--cyan)), #fff); box-shadow: 0 0 8px var(--mc, var(--cyan)); }
.mr-stats .num { text-align: right; color: #fff; font-size: 12px; }
.mr-perk { font-size: 14px; line-height: 1.4; } .mr-perk b { font-family: var(--display); font-size: 11px; letter-spacing: 2px; color: var(--amber); margin-right: 4px; }
.mr-play { margin: 8px 0 0; font-size: 14px; line-height: 1.4; color: var(--ink); opacity: 0.85; }
.mr-price { margin-top: 14px; font-family: var(--display); font-size: 14px; letter-spacing: 2px; } .mr-price small { display: block; margin-top: 4px; font-family: var(--body); font-size: 13px; letter-spacing: 0; color: var(--amber); }
.mr-act { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.mr-earn { margin-top: 10px; padding: 10px 12px; font-size: 14px; line-height: 1.45; background: color-mix(in srgb, var(--mc, var(--lime)) 10%, transparent); border-left: 2px solid var(--mc, var(--lime)); }
.mr-earn b { display: block; margin-bottom: 4px; font-family: var(--display); font-size: 10px; letter-spacing: 3px; color: var(--mc, var(--lime)); }
.mr-cups { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 8px; }
.mr-cups button { width: 21px; height: 21px; padding: 0; background: color-mix(in srgb, var(--cc) 25%, #0a0814); border: 1px solid color-mix(in srgb, var(--cc) 50%, transparent); opacity: 0.55; cursor: pointer; transform: rotate(45deg) scale(0.72); }
.mr-cups button.won { border-color: #ffc860; box-shadow: 0 0 6px rgba(255,200,96,0.6); opacity: 0.85; }
.mr-cups button.on { opacity: 1; background: var(--cc); box-shadow: 0 0 10px var(--cc); }
.mr-cup { margin-bottom: 10px; font-family: var(--display); font-size: 13px; letter-spacing: 2px; color: #ffd890; }
.mr-cup span { font-size: 9px; letter-spacing: 1px; color: var(--mute); } .mr-cup small { display: block; margin-top: 3px; font-size: 10px; letter-spacing: 1.5px; color: var(--mute); }
.mr-store .nd-top .btn { background: rgba(8,6,18,0.75); }
.mr-nav { position: absolute; left: calc(min(380px, 36vw) + 18px + (100% - min(380px, 36vw) - 18px) / 2); bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; pointer-events: auto; }
.mr-nav .btn, .mr-at .btn:not(.primary) { background: rgba(8,6,18,0.75); }
.mr-nav span { font-size: 13px; letter-spacing: 3px; min-width: 52px; text-align: center; text-shadow: 0 0 10px #000; }
.mr-row .mr-marks { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 10px; }
.mr-row .mr-marks button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; background: rgba(255,255,255,0.03); border: 1px solid transparent; transition: border-color 0.2s, background 0.2s; }
.mr-row .mr-marks button:hover { border-color: var(--mc); background: color-mix(in srgb, var(--mc) 12%, transparent); }
.mr-row .mr-marks span { font-family: var(--display); font-size: 9px; letter-spacing: 1px; color: var(--mute); text-align: center; }
/* a phone or a narrow screen: the sign and arrows tighter, the store's panel a sheet along the bottom */
@media (max-width: 760px), (max-aspect-ratio: 1/1) {
  .mr-sign { min-width: 0; } .mr-sign small { display: none; }
  .mr-side { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; height: 46vh; }
  .mr-side > .in { padding: 12px 14px; }
  .mr-nav { left: 50%; bottom: calc(46vh + 16px); }
  .mr-maker h2 { font-size: 17px; } .mr-maker .mr-mk { width: 40px; height: 40px; }
  .mr-hn h3 { font-size: 20px; }
  .mr-row .mr-marks { grid-template-columns: repeat(3, 1fr); }
  .mr-at { width: calc(100% - 16px); bottom: 12px; flex-wrap: wrap; justify-content: center; } .mr-at .mr-in { flex-basis: 100%; justify-content: center; }
  .mr-street .nd-top { flex-direction: column; align-items: flex-end; } .mr-street .nd-hint { max-width: 58vw; }
  .mr-shops { top: 58px; } .mr-shops .mr-mk { width: 26px; height: 26px; }
  .mr-story, .mr-maker .sub { display: none; }
  .mr-hull { display: flex; flex-direction: column; margin-top: 10px; padding-top: 10px; }
  .mr-cups { order: -5; } .mr-cup { order: -4; margin-bottom: 4px; }
  .mr-hn { order: -3; } .mr-price { order: -2; margin-top: 6px; } .mr-act { order: -1; margin: 8px 0 4px; }
  .mr-stats { grid-template-columns: auto 1fr 26px auto 1fr 26px; gap: 4px 8px; }
}
@media (max-height: 500px) and (min-aspect-ratio: 1/1) {
  .mr-side { top: 54px; bottom: 8px; left: 8px; width: min(330px, 42vw); height: auto; }
  .mr-side > .in { padding: 10px 14px; }
  .mr-nav { left: calc(min(330px, 42vw) + 8px + (100% - min(330px, 42vw) - 8px) / 2); bottom: 12px; }
  .mr-at { bottom: 12px; } .mr-sign { padding: 6px 12px; }
  .mr-shops { top: 8px; } .mr-shops .mr-mk { width: 24px; height: 24px; }
  .mr-store .nd-top { top: 8px; } .mr-cr { display: none; }
  .mr-story, .mr-maker .sub { display: none; } .mr-maker .mr-mk { width: 36px; height: 36px; } .mr-maker h2 { font-size: 16px; }
  .mr-hull { display: flex; flex-direction: column; margin-top: 8px; padding-top: 8px; }
  .mr-cups { order: -5; margin-bottom: 4px; gap: 1px; } .mr-cups button { width: 17px; height: 17px; } .mr-cup { order: -4; margin-bottom: 2px; } .mr-cup small { display: inline; margin-left: 6px; }
  .mr-hn { order: -3; } .mr-hn h3 { font-size: 18px; } .mr-price { order: -2; margin-top: 4px; } .mr-act { order: -1; margin: 6px 0 2px; }
  .mr-stats { grid-template-columns: auto 1fr 24px auto 1fr 24px; gap: 3px 8px; margin: 8px 0; }
}
body.coarse .mr-stats { font-size: 12px; } body.coarse .nd-hint span { font-size: 12px; }
#qt-cv { display: block; width: 100%; height: 100%; touch-action: none; }
.qt-cross { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: rgba(255,255,255,0.85); box-shadow: 0 0 6px rgba(48,232,255,0.9); pointer-events: none; }
.qt-aim { position: absolute; left: 50%; top: calc(50% + 26px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 3px; opacity: 0; transition: opacity 0.15s; pointer-events: none; text-shadow: 0 0 10px rgba(0,0,0,0.9); }
.qt-aim.on { opacity: 1; } .qt-aim b { font-family: var(--display); font-size: 13px; letter-spacing: 3px; color: #fff; } .qt-aim span { font-size: 11px; letter-spacing: 2px; color: var(--cyan); }
.qt-edit { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); padding: 9px 16px; background: rgba(8,4,20,0.8); border: 1px solid var(--amber, #ffb020); color: #fff; font-family: var(--display); font-size: 11px; letter-spacing: 2px; opacity: 0; transition: opacity 0.15s; pointer-events: none; white-space: nowrap; }
.qt-edit.on { opacity: 1; }
.qt-top { position: absolute; left: 18px; top: 16px; right: 18px; display: flex; gap: 10px; align-items: center; }
.qt-top .chip { margin-left: auto; }
.qt-help { position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%); display: none; flex-direction: column; align-items: center; gap: 8px; padding: 14px 22px; background: rgba(8,4,20,0.75); border: 1px solid var(--line); pointer-events: none; text-align: center; }
.qt-help.on { display: flex; } .qt-help b { font-family: var(--display); font-size: 15px; letter-spacing: 4px; color: #fff; } .qt-help span { font-size: 12px; letter-spacing: 2px; color: var(--mute); }
/* the dart's power while you hold the throw */
/* the keys, bottom left: a cap and its use, a line each; F lights while rearranging */
.qt-keys { position: absolute; left: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 5px; pointer-events: none; text-shadow: 0 0 8px rgba(0,0,0,0.9); }
.qt-keys div { display: flex; align-items: center; gap: 9px; }
.qt-keys kbd { min-width: 44px; padding: 2px 6px; text-align: center; font-family: var(--display); font-size: 10px; letter-spacing: 1px; color: #fff; background: rgba(8,4,20,0.6); border: 1px solid rgba(255,255,255,0.22); border-bottom-width: 2px; border-radius: 3px; }
.qt-keys span { font-size: 11px; letter-spacing: 2px; color: rgba(255,255,255,0.55); }
.qt-keys.editing div:nth-child(5) kbd { border-color: var(--pink); color: var(--pink); box-shadow: 0 0 10px rgba(255,63,176,0.5); }
.qt-keys.editing div:nth-child(5) span { color: var(--pink); }
body.coarse .qt-keys { display: none; }
/* the menu: a cog, bottom right */
.qt-cog { position: absolute; right: 18px; bottom: 18px; width: 46px; height: 46px; padding: 10px; background: var(--glass); border: 1px solid var(--line); border-radius: 50%; cursor: pointer; color: var(--mute); transition: color 0.15s, transform 0.4s var(--ease); }
.qt-cog svg { width: 100%; height: 100%; fill: currentColor; display: block; }
.qt-cog:hover { color: var(--cyan); transform: rotate(60deg); }
.qt-power { position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%); width: 320px; height: 14px; background: rgba(8,4,20,0.8); border: 1px solid rgba(255,255,255,0.3); display: none; }
.qt-power.on { display: block; }
.qt-power i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #30e8ff, #ff3fb0); }
.qt-power b { position: absolute; top: -5px; bottom: -5px; width: 3px; margin-left: -1px; background: #ffd27a; box-shadow: 0 0 8px #ffd27a; }
.qt-power span { position: absolute; left: 0; top: -18px; font-family: var(--display); font-size: 10px; letter-spacing: 3px; color: rgba(255,255,255,0.6); }
.qt-power.sweet { border-color: #ffd27a; box-shadow: 0 0 12px rgba(255,210,122,0.6); }
/* the synth's keys on screen while you play */
.qt-synth { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(920px, calc(100% - 24px)); padding: 12px 14px 10px; background: rgba(8,4,20,0.82); border: 1px solid rgba(48,232,255,0.35); display: none; }
.qt-synth.on { display: block; }
.sy-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; font-family: var(--display); font-size: 11px; letter-spacing: 2px; color: rgba(255,255,255,0.6); }
.sy-top b { color: #fff; } .sy-top b.p, .sy-patch { color: var(--cyan); } .sy-oct { color: var(--amber, #ffb020); margin-left: 6px; } .sy-k { color: var(--pink, #ff3fb0); }
.sy-beat { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: rgba(255,63,176,0.25); vertical-align: middle; } .sy-beat.on { background: #ff3fb0; box-shadow: 0 0 10px #ff3fb0; }
.sy-keys { position: relative; display: flex; height: 92px; margin-top: 10px; touch-action: none; user-select: none; }
.sy-key { position: relative; flex: 1 1 0; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; font-family: var(--display); font-size: 10px; cursor: pointer; }
.sy-key.w { background: linear-gradient(#e8e6f0, #c8c6d4); color: #2a2438; border: 1px solid #3a3448; border-radius: 0 0 4px 4px; }
.sy-key.b { flex: 0 0 0; z-index: 2; } .sy-key.b span { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 22px; height: 56px; background: linear-gradient(#2a2638, #0c0a14); color: #c8c6d4; border-radius: 0 0 3px 3px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 5px; box-sizing: border-box; }
.sy-key.in.w { box-shadow: inset 0 -5px 0 #30e8ff; } .sy-key.in.b span { box-shadow: inset 0 -4px 0 #30e8ff; }
.sy-key.root.w { box-shadow: inset 0 -5px 0 #ff3fb0; } .sy-key.root.b span { box-shadow: inset 0 -4px 0 #ff3fb0; }
.sy-key.down.w { background: linear-gradient(#9ff4ff, #30e8ff); } .sy-key.down.b span { background: #30e8ff; color: #0a0814; }
.sy-help { margin-top: 8px; font-size: 9px; letter-spacing: 1.5px; color: rgba(255,255,255,0.4); text-align: center; }
@media (max-width: 700px) { .sy-keys { height: 120px; } .sy-help { display: none; } .sy-key { font-size: 8px; } }
.qt-menu { position: absolute; inset: 0; display: none; place-items: center; grid-template-columns: minmax(0, 1fr); background: rgba(4,2,12,0.45); padding: 40px 16px; }
.qt-menu.on { display: grid; }
.qt-card { width: min(1100px, 100%); max-height: calc(100vh - 80px); display: flex; flex-direction: column; background: rgba(10,6,24,0.94); border: 1px solid rgba(48,232,255,0.35); box-shadow: 0 0 60px rgba(48,232,255,0.15); clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px); }
.qt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 22px 10px; border-bottom: 1px solid rgba(48,232,255,0.12); }
.qt-head .tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.qt-head .tabs button { padding: 7px 12px; font-family: var(--display); font-size: 11px; letter-spacing: 2px; color: var(--mute); border: 1px solid var(--line); background: transparent; cursor: pointer; }
.qt-head .tabs button.on, .qt-head .tabs button:hover { color: #fff; border-color: var(--cyan); }
.qt-body { overflow-y: auto; padding: 4px 22px 22px; }
/* the card's clipped corner cut the scrollbar's end off: the scroller stops short of it */
.qt-body { margin-bottom: 14px; padding-bottom: 8px; }
.qt-body .view { padding-left: 0; padding-right: 0; }
.dc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.dc { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--line); }
.dc i { width: 42px; height: 42px; display: block; border: 1px solid rgba(255,255,255,0.15); }
.dc .name { font-weight: 600; } .dc .meta { font-size: 12px; color: var(--mute); } .dc.locked { opacity: 0.75; }
/* the price is the buy button: bright amber (pink when you can't afford it yet), full strength on a card you don't own */
.dc .btn.buy { display: inline-flex; flex-direction: row; align-items: baseline; gap: 8px; margin-top: 6px; padding: 5px 18px 5px 16px; white-space: nowrap; color: #1a1200; background: var(--amber); border-color: var(--amber); font-family: var(--display); font-size: 13px; letter-spacing: 1px; box-shadow: 0 0 12px rgba(255,176,32,0.35); }
.dc .btn.buy small { font-size: 10px; letter-spacing: 2px; opacity: 0.75; }
.dc .btn.buy.short { color: var(--pink); background: transparent; border-color: var(--pink); box-shadow: none; }
.dc .btn.buy.need { flex-wrap: wrap; white-space: normal; max-width: 100%; row-gap: 2px; padding: 5px 12px; font-size: 11px; line-height: 1.3; text-align: left; } .dc > div { min-width: 0; }
.dc.locked .btn.buy { filter: brightness(1.3); }
/* a glass cabinet's menu: its slots laid out like its shelves, then your figurines */
.cs-slots { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 8px; max-width: calc(var(--cols) * 128px); }
.cs-slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; min-height: 92px; background: rgba(255,240,220,0.04); border: 1px dashed rgba(255,240,220,0.22); color: var(--mute); font-family: var(--body); cursor: pointer; }
.cs-slot.full { border-style: solid; color: var(--ink); background: rgba(255,240,220,0.08); }
.cs-slot.on { border-color: var(--cyan); box-shadow: 0 0 12px rgba(48,232,255,0.35) inset; }
.cs-slot .cs-pic { width: 48px; height: 48px; display: grid; place-items: center; }
.cs-slot small { font-size: 12px; letter-spacing: 1px; }
.cs-slot em { font-style: normal; font-size: 12px; color: var(--pink); }
.cs-bar { margin: 16px 0 8px; flex-wrap: wrap; gap: 8px; }
.cs-figs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.cs-fig { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; padding: 8px 10px; text-align: left; background: rgba(255,255,255,0.03); border: 1px solid var(--line); color: var(--ink); font-family: var(--body); font-size: 15px; cursor: pointer; }
.cs-fig:hover { border-color: var(--cyan); } .cs-fig.here { border-color: var(--amber); background: rgba(255,176,32,0.08); }
.cs-fig b { display: block; font-weight: 600; } .cs-fig small { display: block; font-size: 12px; color: var(--mute); letter-spacing: 1px; }
.cs-fig .cs-pic { width: 44px; height: 44px; }
.cs-slot.full[style*="--tc"] { border-color: color-mix(in srgb, var(--tc) 60%, transparent); box-shadow: inset 0 -3px 0 var(--tc); }
.cs-slot.full.on { border-color: var(--cyan); }
/* a pinboard's places: on cork (or the felt wall), the pins round and close together */
.pin-slots { padding: 10px; background: #8a6040 radial-gradient(rgba(60,36,16,0.35) 1px, transparent 1.5px) 0 0 / 6px 6px; border: 6px solid #2a1c16; max-width: calc(var(--cols) * 104px + 32px); }
.pin-slots.pinwall { background: #1c2638 radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1.5px) 0 0 / 5px 5px; border-color: #2a1c16; border-top-color: #c8a050; }
.pin-slots .cs-slot { min-height: 80px; background: rgba(20,12,8,0.35); border-color: rgba(255,240,220,0.3); color: #f4ead8; }
.pin-slots .cs-slot.full { background: rgba(20,12,8,0.2); }
.stk-item.pin span { color: var(--tc); }
.cs-fig[style*="--tc"] { border-left: 3px solid var(--tc); }
/* the pinboard: the board as it hangs, pins anywhere on it */
.pb-wrap { display: flex; justify-content: center; margin: 6px 0 4px; }
.pb-board { aspect-ratio: var(--ar); padding: 22px; box-sizing: content-box; background: #2a1c16; border-radius: 4px; box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 0 2px #3a2820, inset 0 2px 0 rgba(255,255,255,0.08); }
.pb-board.pinwall { box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 3px 0 #c8a050, inset 0 -3px 0 #c8a050; }
.pb-face { position: relative; width: 100%; height: 100%; overflow: visible; touch-action: none; background: #9a7048 radial-gradient(rgba(60,36,16,0.4) 1px, transparent 1.6px) 0 0 / 5px 5px; box-shadow: inset 0 0 18px rgba(40,20,8,0.55); transition: box-shadow .15s; }
.pinwall .pb-face { background: #1c2638 radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1.6px) 0 0 / 4px 4px; box-shadow: inset 0 0 22px rgba(0,0,0,0.6); }
.pb-face.drop { box-shadow: inset 0 0 18px rgba(40,20,8,0.55), 0 0 0 2px var(--cyan), 0 0 18px rgba(48,232,255,0.4); }
.pb-empty { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,240,220,0.55); font-family: var(--display, var(--body)); letter-spacing: 3px; font-size: 14px; pointer-events: none; }
.pb-pin { position: absolute; width: var(--pin); aspect-ratio: 1; padding: 0; border: 0; background: none; transform: translate(-50%, -50%) rotate(var(--r)); cursor: grab; touch-action: none; filter: drop-shadow(2px 3px 2px rgba(0,0,0,0.45)); transition: filter .12s, transform .12s; }
.pb-pin img { width: 100%; height: 100%; pointer-events: none; -webkit-user-drag: none; }
.pb-pin:hover { filter: drop-shadow(3px 5px 4px rgba(0,0,0,0.5)) brightness(1.08); }
.pb-pin.on { filter: drop-shadow(0 0 6px var(--cyan)) drop-shadow(2px 3px 2px rgba(0,0,0,0.45)); }
.pb-pin.lift { opacity: 0.25; }
.pb-ghost { position: fixed; z-index: 9999; pointer-events: none; transform: translate(-50%, -50%) rotate(-4deg) scale(1.12); filter: drop-shadow(5px 9px 6px rgba(0,0,0,0.5)); }
.pb-ghost img { width: 100%; height: 100%; }
.pb-tools { min-height: 40px; display: flex; justify-content: center; }
.pb-sel { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.pb-sel b { letter-spacing: 2px; color: var(--cyan); margin-right: 6px; }
.pb-tin { touch-action: pan-y; user-select: none; }
.pb-tin.held { border-color: var(--cyan); box-shadow: 0 0 12px rgba(48,232,255,0.35) inset; }
.pb-tin .cs-pic img { pointer-events: none; -webkit-user-drag: none; }
.cs-fig small .tn { font-size: 10px; }
.cs-fig .cs-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; white-space: nowrap; margin: 2px 0; }
.cs-figs .sr-line { grid-column: 1 / -1; margin-top: 6px; }
/* the figurine series: a badge (or its painted logo), a line with the count, lit when whole */
.sr-b { display: inline-grid; place-items: center; min-width: 26px; height: 16px; padding: 0 4px; font-family: var(--display); font-size: 10px; font-weight: 900; letter-spacing: 1px; color: #07040f; background: var(--sc); clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%); vertical-align: middle; }
.sr-b.img { background: none; clip-path: none; padding: 0; } .sr-b.img img { height: 18px; width: auto; display: block; }
.sr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; margin-top: 8px; }
.sr-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 10px; border-left: 3px solid color-mix(in srgb, var(--sc) 45%, transparent); background: rgba(255,255,255,0.03); }
.sr-line b { font-family: var(--display); font-size: 13px; letter-spacing: 2px; color: #fff; }
.sr-line small { font-size: 12px; letter-spacing: 1px; color: var(--mute); }
.sr-line.done { border-left-color: var(--sc); background: color-mix(in srgb, var(--sc) 12%, transparent); box-shadow: 0 0 16px color-mix(in srgb, var(--sc) 30%, transparent); }
.sr-line.done b, .sr-line.done small { color: var(--sc); text-shadow: 0 0 10px color-mix(in srgb, var(--sc) 60%, transparent); }
.cap-tiers { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 12px; color: var(--mute); }
/* the galley: a recipe's ingredients named beside their counts */
.galley .cost small { font-size: 12px; color: var(--mute); margin-left: 2px; } .galley .cost.short small { color: var(--amber); }
@media (max-width: 760px) { .qt-edit { white-space: normal; width: calc(100% - 32px); text-align: center; } .qt-menu { padding: 12px 8px; } .qt-head { padding: 12px 14px 8px; } .qt-body { padding: 4px 12px 14px; } }

.qt-fade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity 0.4s; }
.qt-fade.on { opacity: 1; }
.lift-floors { display: grid; gap: 10px; max-width: 560px; }
.lift-floor { display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: center; padding: 14px 16px; text-align: left; color: #fff; background: rgba(255,255,255,0.03); border: 1px solid var(--line); cursor: pointer; font: inherit; }
.lift-floor b { font-family: var(--display); font-size: 26px; color: var(--amber, #ffb020); text-align: center; }
.lift-floor strong { display: block; font-family: var(--display); font-size: 13px; letter-spacing: 3px; } .lift-floor small { color: var(--mute); font-size: 12px; }
.lift-floor:hover { border-color: var(--cyan); } .lift-floor.on { opacity: 0.55; cursor: default; } .lift-floor.g b { color: var(--pink); }
#qt.playing .qt-cross, #qt.playing .qt-aim { display: none; }
.qt-play { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); padding: 8px 14px; background: rgba(8,4,20,0.7); border: 1px solid var(--line); color: var(--mute); font-family: var(--display); font-size: 10px; letter-spacing: 2px; opacity: 0; transition: opacity 0.3s; pointer-events: none; white-space: nowrap; }
.qt-play.on { opacity: 1; }

/* the loading screen: a pointer trail to play with while the game warms up */
#loading { position: fixed; inset: 0; z-index: 100; background: radial-gradient(ellipse at 50% 40%, #1a0a34 0%, #07040f 70%); transition: opacity 0.6s; cursor: crosshair; touch-action: none; }
#loading.gone { opacity: 0; pointer-events: none; }
#loading canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#loading .ld-mid { position: absolute; left: 0; right: 0; top: 34%; text-align: center; pointer-events: none; padding: 0 16px; }
#loading .title { font-family: var(--display, 'Orbitron', sans-serif); font-weight: 900; font-size: clamp(30px, 7vw, 68px); letter-spacing: 0.22em; color: #fff; text-shadow: 0 0 24px rgba(48,232,255,0.6), 0 0 60px rgba(255,63,176,0.35); }
#loading .line { margin-top: 10px; color: #9aa0c8; font-size: 15px; letter-spacing: 1px; }
#loading .ld-foot { position: absolute; left: 50%; bottom: 9vh; transform: translateX(-50%); width: min(380px, calc(100vw - 48px)); pointer-events: none; text-align: center; }
#loading .what { font-family: var(--display, 'Orbitron', sans-serif); font-size: 10px; letter-spacing: 4px; color: #30e8ff; margin-bottom: 10px; }
#loading .bar { height: 4px; background: rgba(255,255,255,0.08); overflow: hidden; }
#loading .fill { width: 0; height: 100%; background: linear-gradient(90deg, #30e8ff, #ff3fb0); box-shadow: 0 0 12px rgba(48,232,255,0.8); transition: width 0.3s; }

/* the showroom: craft cards with their numbers and what you can do */
.sr-list { display: grid; gap: 8px; margin-top: 14px; }
.sr-card { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 10px 14px; background: rgba(255,255,255,0.03); border: 1px solid var(--line); cursor: pointer; }
.sr-card:hover { border-color: var(--cyan); } .sr-card.own { border-color: rgba(92,255,138,0.35); }
.sr-card .name { font-family: var(--display); letter-spacing: 2px; font-size: 14px; } .sr-card .name small { color: var(--mute); font-size: 10px; letter-spacing: 2px; margin-left: 6px; }
.sr-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0; font-size: 11px; color: var(--mute); } .sr-stats b { color: #fff; }
.sr-card .meta { font-size: 12px; color: var(--mute); } .sr-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 760px) { .sr-card { grid-template-columns: 44px 1fr; } .sr-act { grid-column: 1 / -1; justify-content: flex-start; } }

/* the first race's coaching: one line at a time, low in the middle, clear of the bend callout */
#coach { position: absolute; left: 50%; top: 62%; transform: translate(-50%, 8px); max-width: min(720px, calc(100vw - 32px)); box-sizing: border-box; padding: 12px 20px; background: var(--glass); border: 1px solid var(--line); box-shadow: 0 0 24px rgba(48,232,255,0.25); font-family: var(--display); font-size: 15px; letter-spacing: 2px; text-align: center; color: var(--ink); opacity: 0; transition: opacity .3s var(--ease), transform .3s var(--ease); pointer-events: none; }
#coach.on { opacity: 1; transform: translate(-50%, 0); }
body.coarse #coach { font-size: 12px; top: 30%; }
/* the quarters' next step, top left under the bar */
.qt-next { position: absolute; left: 16px; top: 64px; max-width: min(420px, calc(100vw - 32px)); padding: 10px 14px; background: var(--glass); border: 1px solid var(--line); cursor: pointer; z-index: 3; }
.qt-next .eyebrow { font-size: 10px; } .qt-next .t { font-size: 14px; line-height: 1.35; margin-top: 2px; } .qt-next .w { font-size: 11px; color: var(--cyan); letter-spacing: 2px; font-family: var(--display); margin-top: 4px; }
#qt.playing .qt-next, #qt.menu-open .qt-next { display: none; }
#overlay .ov-event { color: var(--amber); letter-spacing: 3px; margin-top: 6px; }
#overlay .ov-event:empty { display: none; }
.rs-row .rec { font-size: 10px; color: var(--mute); letter-spacing: 1px; margin-left: 6px; }
.lotd { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; } .lotd:empty { display: none; }

/* the capsule's reveal: the reward box's stage with a turning model in the middle */
.capstage .cap-cv { position: relative; width: min(520px, calc(100vw - 32px)); flex: 1 1 0; min-height: 90px; max-height: min(380px, 48vh); cursor: grab; touch-action: none; }
/* (the model takes what the words and KEEP IT leave, so the button stays on a short screen) */
@media (max-height: 560px) {
  #boxstage.capstage { gap: 4px; padding: 8px 16px; }
  #boxstage.capstage > .eyebrow { display: none; }
  .capstage .bs-title { font-size: clamp(20px, 7vh, 40px); }
  .capstage .cap-cv { max-height: none; }
  .capstage .cap-what .big { font-size: clamp(16px, 5vh, 26px); }
  .capstage .cap-what .sub { margin-top: 2px; line-height: 1.3; }
  .capstage .bs-foot { margin-top: 2px; }
}
.capstage .cap-cv:active { cursor: grabbing; }
.capstage .cap-what { position: relative; text-align: center; opacity: 0; transform: translateY(8px); transition: opacity .4s var(--ease) .2s, transform .4s var(--ease) .2s; }
.capstage.burst .cap-what { opacity: 1; transform: none; }
.capstage .cap-what .big { font-family: var(--display); font-size: clamp(20px, 4vw, 30px); font-weight: 900; letter-spacing: 3px; color: var(--rc, var(--amber)); text-shadow: 0 0 18px var(--rc, var(--amber)); }
.capstage .cap-what .sub { letter-spacing: 3px; font-family: var(--display); font-size: 11px; margin-top: 4px; }
#boxstage.capstage.burst .bs-hint { position: relative; animation: none; }
body.staged #qt .qt-help, body.staged #qt .qt-next, body.staged #qt .qt-aim { visibility: hidden; }

/* the end of a cup: the standings counted up, your place and its trophy, then the prizes */
#boxstage.cupstage { overflow-y: auto; touch-action: pan-y; justify-content: flex-start; padding-top: 4vh; }
.cupstage .cs-mid { position: relative; display: flex; flex-wrap: wrap; gap: 22px; align-items: center; justify-content: center; width: min(980px, 100%); }
.cs-rows { flex: 1 1 340px; max-width: 460px; display: flex; flex-direction: column; gap: 4px; }
.cs-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 6px 12px; background: var(--glass); border-left: 3px solid var(--pc, rgba(48,232,255,0.25)); font-family: var(--display); font-size: 14px; letter-spacing: 1px; opacity: 0; transform: translateX(-14px); transition: opacity .25s var(--ease), transform .25s var(--ease); }
.cs-row.in { opacity: 1; transform: none; }
.cs-row b { color: var(--pc, var(--mute)); } .cs-row i { font-style: normal; color: var(--cyan); }
.cs-row.me { background: rgba(48,232,255,0.16); box-shadow: 0 0 24px rgba(48,232,255,0.35); }
.cs-row.me span { color: var(--cyan); }
.cs-win { flex: 0 1 320px; position: relative; display: flex; flex-direction: column; align-items: center; opacity: 0; transform: scale(0.9); transition: opacity .4s var(--ease), transform .4s var(--ease); }
.cs-win.on { opacity: 1; transform: none; }
.cs-win .cap-cv { width: min(320px, 80vw); height: 240px; touch-action: pan-y; cursor: grab; }
.cs-win.flat .cap-cv { display: none; }
.cbstage .cb-cv { position: relative; width: min(460px, calc(100vw - 32px)); height: min(320px, 42vh); cursor: pointer; touch-action: none; transition: height .5s var(--ease); }
.cbstage.opened .cb-cv { height: min(200px, 26vh); cursor: grab; }
#boxstage.cbstage.burst .bs-hint { display: none; }
.cbstage.case .bs-title { color: var(--amber); text-shadow: 0 0 18px var(--amber); }
.hull-card { width: 180px; }
.hull-card .bs-ico { width: 136px; height: 110px; overflow: visible; }
.hull-card .bs-ico .m3d, .hull-card .bs-ico .m3d img { width: 136px; height: 136px; }
.cs-place { text-align: center; }
.cs-place b { display: block; font-family: var(--display); font-weight: 900; font-size: 64px; line-height: 1; color: var(--pc, var(--ink)); text-shadow: 0 0 24px var(--pc, rgba(48,232,255,0.6)); }
.cs-place b small { font-size: 0.4em; margin-left: 4px; }
.cs-place span { font-family: var(--display); font-size: 12px; letter-spacing: 4px; color: var(--mute); }
.cs-cr { width: 72px; height: 72px; display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: 26px; color: var(--amber); border: 2px solid var(--amber); clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); box-shadow: inset 0 0 18px rgba(255,176,32,0.4); }
.cupstage .bs-card.rare { --rc: #ffd84a; }

/* a blueprint card: cyan lines on blueprint blue, unrolling as it's dealt */
.bs-card.bp-card { border-color: var(--cyan); box-shadow: 0 0 40px rgba(48,232,255,0.45); background: linear-gradient(rgba(48,232,255,0.12) 1px, transparent 1px) 0 0 / 12px 12px, linear-gradient(90deg, rgba(48,232,255,0.12) 1px, transparent 1px) 0 0 / 12px 12px, #0a2148; animation: bpunroll 0.6s var(--ease) both; width: 170px; }
.bs-card.bp-card .big { color: var(--cyan); font-size: 16px; letter-spacing: 4px; }
.bs-card.bp-card small { color: var(--mute); }
@keyframes bpunroll { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
/* the bed's skill cards and the printer's type cards */
.tech-card .pips { display: flex; gap: 4px; margin-top: 4px; }
.tech-card .pips i { width: 18px; height: 6px; background: rgba(48,232,255,0.15); }
.tech-card .pips i.on { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.tech-card .pips i.q { background: rgba(255,63,176,0.6); }
.pr-cats { gap: 12px; }
.pr-cat { cursor: pointer; text-align: center; }
.pr-cat .in { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pr-cat.locked { opacity: 0.4; filter: grayscale(1); }

/* the results: the race panel and, for a grid race, the finishing order beside it */
.res-wrap { display: flex; gap: 16px; align-items: stretch; max-height: 96vh; max-width: 96vw; }
/* (a short window scrolls the panel: it may shrink below its content, and its lining grows with the
   content rather than clipping everything past the first screen, so the buttons stay in reach) */
.res-wrap > .panel { overflow-y: auto; min-height: 0; }
.res-wrap > .panel > .in { height: auto; min-height: 100%; }
#results .res-stand { width: 330px; flex: none; }
.rs-rows { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.rs-row { display: grid; grid-template-columns: 22px 30px 1fr auto; gap: 10px; align-items: center; padding: 5px 10px; background: var(--glass2); border-left: 3px solid var(--rc); font-family: var(--display); font-size: 13px; letter-spacing: 1px; opacity: 0; }
.res-wrap.go .rs-row { animation: rscross 0.35s var(--ease) forwards; }
.rs-row b { color: var(--mute); } .rs-row:nth-child(-n+3) b { color: var(--amber); }
.rs-row .face { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--rc) center / cover no-repeat; color: #000; font-weight: 900; font-size: 11px; }
.rs-row i { font-style: normal; color: var(--cyan); font-variant-numeric: tabular-nums; }
.rs-row.est i { color: var(--mute); } .rs-row i small { font-size: 9px; letter-spacing: 1px; color: var(--dim); }
.rs-row.me { background: rgba(48,232,255,0.16); box-shadow: 0 0 18px rgba(48,232,255,0.3); } .rs-row.me .n { color: var(--cyan); } .rs-row.me .face { background-color: var(--cyan); }   /* (only the colour: the shorthand reset the size, so your face showed as the dark top corner of its still) */
.rs-note { font-size: 11px; margin-top: 10px; }
@keyframes rscross { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
/* a box's things as chips with their icons */
.chips { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 4px; }
.chip-i { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); }
.chip-i b { font-weight: 600; }
.pg-mini { width: 26px; height: 32px; display: grid; place-items: center; background: #e8dcc0; color: #3a2a1a; font-family: var(--display); font-size: 12px; }
@media (max-width: 1100px) { .res-wrap { flex-direction: column; overflow-y: auto; } #results .res-stand { width: min(760px, 94vw); } }

/* a tab with something waiting: today's daily cup not yet run */
.tab-dot { display: inline-block; width: 8px; height: 8px; margin-left: 8px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 8px var(--pink); vertical-align: middle; animation: flicker 2s infinite; }

/* a members' pilot: a PREMIUM badge across the card's corner (gold once you're a member) */
.driver-card .in { position: relative; overflow: hidden; }
.driver-card .premium { position: absolute; top: 14px; right: -34px; transform: rotate(35deg); width: 130px; text-align: center; padding: 3px 0; font-family: var(--display); font-size: 9px; letter-spacing: 3px; color: #1a1020; background: linear-gradient(90deg, var(--pink), var(--amber)); box-shadow: 0 0 14px rgba(255,63,176,0.6); }
.driver-card .premium.member { background: linear-gradient(90deg, #ffd84a, #ffb020); box-shadow: 0 0 14px rgba(255,216,74,0.6); }
.driver-card.locked { opacity: 1; filter: none; }
.driver-card.locked::after { content: none; }   /* (the ribbon says it: no LOCKED label) */
.driver-card.locked .ico-hex, .driver-card.locked h3, .driver-card.locked .sub { opacity: 0.6; }

/* the pilot you fly as: a face in the field bar's bubble, and your own lines on the comms in pink */
#field .who.me[style*="background-image"] { width: 30px; height: 30px; margin-left: -15px; top: -2px; border-radius: 50%; background-size: cover; background-position: center; border: 2px solid var(--cyan); box-shadow: 0 0 12px var(--cyan); }
#comms.mine { border-color: rgba(255,63,176,0.7); box-shadow: 0 0 24px rgba(255,63,176,0.3); }
#comms.mine .who { color: var(--pink); }

/* ---------- phones (the mobile pass, Oct 16) ---------- */
/* the landing: only the controls for the device in hand */
#overlay .keys-touch { display: none; }
body.coarse #overlay .keys-desk { display: none; }
body.coarse #overlay .keys-touch { display: block; }
/* the results scroll on a short screen (held sideways the panel was taller than the screen, and centred, so its buttons were out of reach) */
@media (max-width: 1100px), (max-height: 700px) {
  #results.on { place-items: start center; overflow-y: auto; padding: 10px 0 24px; }
  .res-wrap { flex-direction: column; max-height: none; overflow: visible; }
  .res-wrap > .panel { overflow: visible; }
}
/* the race on a short screen: a smaller comms panel up top on the right, clear of the speed and boost */
@media (max-height: 520px) {
  /* the field bar between the lap and place box and the timer box (it ran over your place) */
  #field { width: clamp(220px, calc(100vw - 540px), 520px); }
  /* the first race's coaching between the boost circle and the brake pill, clear of the bend callout and the comms */
  #coach, body.coarse #coach { top: 40%; }
  #comms { left: 12px; right: auto; top: 76px; bottom: auto; width: min(360px, 42vw); padding: 6px 10px 6px 6px; gap: 8px; transform: translate(0, -20px); }
  #comms.on { transform: translate(0, 0); }
  #comms .face { width: 48px; height: 48px; }
  #comms .said { font-size: 15px; min-height: 0; }
  #comms .who { font-size: 11px; letter-spacing: 2px; }
  /* the thumbs own the corners: the speed sits bottom middle with the hull and boost bars either side of
     it and the drift meter above, the weapon slots above the drift button */
  body.coarse #speed { left: 50%; right: auto; bottom: 12px; transform: translateX(-50%); min-width: 150px; font-size: 34px; padding: 8px 14px 6px; }
  body.coarse #hullbar { left: auto; right: calc(50% + 108px); bottom: 24px; width: 110px; }
  body.coarse #boostbar { left: calc(50% + 108px); bottom: 24px; width: 110px; }
  body.coarse #driftbar { bottom: 78px; width: 200px; }
  body.coarse #slots { right: max(14px, env(safe-area-inset-right)); bottom: 196px; gap: 8px; }
  body.coarse .slotx { width: 56px; height: 56px; }
}
/* a phone held sideways: the stages fit the short screen (the cup ceremony's COLLECT was off the bottom)
   and the landing's hint stays clear of the pads under it */
@media (max-height: 520px) {
  #boxstage { overflow-y: auto; justify-content: flex-start; padding: 8px 16px; gap: 8px; }
  #boxstage .bs-title { font-size: 24px; }
  .cupstage .cs-mid { gap: 6px 18px; }
  .cs-row { padding: 3px 10px; }
  .cs-win .cap-cv { height: 150px; }
  .cs-place b { font-size: 36px; }
  #boxstage .bs-foot { position: sticky; bottom: 0; z-index: 2; margin-top: 4px; padding: 6px 0; }
  body.coarse #overlay .keys { margin-top: 10px; max-width: 300px; }
}
/* the pads under the landing: shown so the thumbs know where to go, but faint */
body:has(#overlay:not(.off)) #touch > div > * { opacity: .45; }
/* a narrow screen: the results' buttons wrap, the wingmen row stacks, the pilot page's account panel
   takes a row of its own */
@media (max-width: 600px) {
  .res-acts, .res-acts > .row { flex-wrap: wrap; gap: 8px; }
  .res-acts > .row { width: 100%; }
  .res-acts .btn { flex: 1 1 auto; }
  .wing-mini { grid-template-columns: 64px 1fr; } .wing-mini > :nth-child(3) { grid-column: 1 / -1; }
}
@media (min-width: 601px) and (max-width: 900px) { .pilot-grid { grid-template-columns: 1fr 1fr; } .pilot-grid > :nth-child(3) { grid-column: 1 / -1; } }
/* the race held upright: the field bar below the lap box, and a word about turning the phone */
@media (max-width: 600px) and (orientation: portrait) {
  #pos { left: 14px; top: 60px; }
  #field { top: 100px; width: 88vw; }
  #bend { top: 134px; }
  #coach, body.coarse #coach { top: 55%; }   /* (under the boost circle: at 30% it sat on the comms) */
  /* the comms under the bend callout, over the road ahead (low down they covered the hull bar) */
  #comms { top: 180px; bottom: auto; transform: translate(-50%, -20px); } #comms.on { transform: translate(-50%, 0); }
  /* the thumbs own the bottom: the speed and the bars stack above the steering pad on the left, the
     weapon slots above the drift button on the right */
  #speed { left: 14px; bottom: 196px; min-width: 0; font-size: 28px; padding: 10px 12px 8px; }
  #hullbar, #boostbar, #driftbar { width: 150px; left: 14px; transform: none; }
  #boostbar { bottom: 256px; } #hullbar { bottom: 292px; } #driftbar { bottom: 328px; }
  body.coarse #slots { right: 14px; bottom: 176px; gap: 8px; } body.coarse .slotx { width: 56px; height: 56px; }
  #overlay .sub { letter-spacing: 3px; font-size: 12px; }
}
#turn-hint { position: fixed; left: 50%; top: 40%; transform: translateX(-50%); z-index: 31; padding: 10px 16px; background: var(--glass); border: 1px solid var(--line); font-family: var(--display); font-size: 12px; letter-spacing: 3px; color: var(--ink); text-align: center; pointer-events: none; opacity: 0; transition: opacity 0.5s; }
#turn-hint.on { opacity: 1; }
/* the phone floor (the legibility pass, Oct 18): labels, tags, small buttons and the HUD's small type at 12 px or
   more; letter-spacing comes in so they still fit */
body.coarse .eyebrow { font-size: 12px; letter-spacing: 2px; }
body.coarse .tag { font-size: 12px; letter-spacing: 1px; padding: 2px 6px; }
body.coarse .btn.sm { font-size: 12px; letter-spacing: 1px; padding: 8px 12px; }
body.coarse .chip { font-size: 12px; }
body.coarse .stat .k, body.coarse .track-preview .stat .k { font-size: 12px; letter-spacing: 1px; }
body.coarse .zone .eyebrow { font-size: 12px; letter-spacing: 1px; }
body.coarse .card.locked::after, body.coarse .panel.sel > .in::after { font-size: 12px; letter-spacing: 1px; }
body.coarse .tabs button, body.coarse .qt-head .tabs button { font-size: 12px; letter-spacing: 1px; }
body.coarse .lapc .k, body.coarse .xp .lbl { font-size: 12px; letter-spacing: 2px; }
body.coarse .cc-medals span, body.coarse .medal, body.coarse .cg-step b, body.coarse .race-step .dotn, body.coarse .rk-pick small { font-size: 12px; letter-spacing: 1px; }
body.coarse .sr-stats, body.coarse .sr-card .name small, body.coarse .perk-l b { font-size: 12px; letter-spacing: 1px; }
body.coarse .jb-row .b, body.coarse .stk-item small, body.coarse .stk-spot, body.coarse .rs-note, body.coarse .rs-row .rec, body.coarse .journal .sub.num { font-size: 12px; }
body.coarse .driver-card .premium { font-size: 11px; letter-spacing: 2px; }
body.coarse .qt-aim span, body.coarse .qt-next .w, body.coarse .qt-next .eyebrow, body.coarse #overlay .corner { font-size: 12px; letter-spacing: 1px; }
body.coarse #times { font-size: 14px; } body.coarse #times .k { font-size: 12px; letter-spacing: 2px; }
body.coarse #lap small, body.coarse #pos small { font-size: 12px; letter-spacing: 1px; }
body.coarse #hullbar .lbl, body.coarse #boostbar .lbl, body.coarse #driftbar .lbl { font-size: 11px; letter-spacing: 2px; }
body.coarse #comms .who { font-size: 12px; letter-spacing: 2px; }
body.coarse #objective .t, body.coarse #hint { font-size: 12px; letter-spacing: 2px; }
body.coarse #speed small { font-size: 12px; }
/* the quarters' top bar on a phone: smaller, wrapping, no keyboard hints */
body.coarse .qt-top { left: 10px; right: 10px; top: 10px; gap: 6px; flex-wrap: wrap; }
body.coarse .qt-top .btn { padding: 6px 8px; font-size: 12px; letter-spacing: 0.5px; }
body.coarse .kb { display: none; }   /* (every key hint: the room's top bar, the game menu, CLOSE (ESC)) */
body.coarse .qt-next { top: 54px; left: 10px; max-width: calc(100vw - 20px); }
/* the printer's header wraps on a narrow screen */
.printer .panel .row.between { flex-wrap: wrap; gap: 8px; }
/* the room's menus on a phone held sideways (or any short screen): the card fills the screen and
   everything in it is drawn at 70 percent, so a menu shows several rows instead of one; the room's
   own top bar steps aside while a menu is up */
@media (max-height: 500px) {
  .qt-menu { padding: 6px max(8px, env(safe-area-inset-right)) 6px max(8px, env(safe-area-inset-left)); }
  .qt-card { width: 100%; max-height: calc(100vh - 12px); max-height: calc(100dvh - 12px); }
  .qt-head { padding: 8px 14px 6px; align-items: center; } #qt-eye { display: none; } .qt-head .tabs { margin-top: 0; }
  .qt-body { padding: 4px 14px 12px; }
  .subtabs { margin: 0 0 10px; } .subtabs button { padding: 7px 12px 6px; }
  .qt-body .head { margin-bottom: 10px; } .qt-body .head h2 { font-size: 20px; }
  body:has(.qt-menu.on) .qt-top, body:has(.qt-menu.on) .qt-next, body:has(.qt-menu.on) #qt-help, body:has(.qt-menu.on) .qt-cog { display: none; }
}

/* the terminal's views (viewsPanel in ui.js): a second row of tabs under the terminal's own, underlined */
.subtabs { display: flex; flex-wrap: wrap; gap: 2px 6px; margin: 2px 0 16px; border-bottom: 1px solid var(--line); }
.subtabs button { padding: 10px 14px 9px; font-family: var(--display); font-size: 12px; letter-spacing: 3px; color: var(--mute); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s; }
.subtabs button:hover { color: var(--ink); } .subtabs button.on { color: #fff; border-bottom-color: var(--cyan); text-shadow: 0 0 10px rgba(48,232,255,.6); }
.views > .vbody > .view { padding-top: 0; }
/* the rankings' track row */
.rk-pick { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-bottom: 12px; }
.rk-pick .btn.sm { padding: 6px 10px; letter-spacing: 1px; white-space: nowrap; } .rk-pick small { font-size: 10px; color: var(--amber); margin-left: 4px; }
.tabs { flex-wrap: wrap; }
/* (on a narrow screen the track row scrolls sideways instead of stacking) */
@media (max-width: 600px) { .rk-pick { display: block; } .rk-pick .row.wrap { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: 6px; scrollbar-width: none; } .rk-pick .row.wrap::-webkit-scrollbar { display: none; } }
/* the companions' cards say what each one does */
.dc-grid.pets { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); } .dc-grid.pets .dc { align-items: flex-start; } .dc .does { color: var(--ink); display: block; margin-bottom: 2px; }

/* a hull's perk: its name in amber, what it does after it */
.perk-l { font-size: 13px; color: var(--mute); }
.perk-l b { font-family: var(--display); font-size: 10px; letter-spacing: 2px; color: var(--amber); margin-right: 6px; }

/* a patch note in the game (showNews in ui.js): the banner, then the note scrolling inside the modal */
.news-modal { max-width: 640px; }
.news-modal .nm-banner { width: 100%; display: block; margin-bottom: 12px; border: 1px solid var(--line); }
.news-modal .nm-body { max-height: 52vh; overflow-y: auto; font-size: 15px; line-height: 1.5; padding-right: 6px; }
.news-modal .nm-body h2 { font-family: var(--display); font-size: 14px; letter-spacing: 2px; color: var(--cyan); margin: 16px 0 6px; }
.news-modal .nm-body blockquote { margin: 0 0 8px; } .news-modal .nm-body blockquote p { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.news-modal .nm-body blockquote img { flex: 1 1 0; min-width: 0; max-width: 100%; height: auto; }
.news-modal .nm-body ul { padding-left: 18px; margin: 4px 0; }

/* the career as pictures (career() in ui.js): every step, reward, cup and test
   shows its track or its thing, not a letter in a hexagon */
.item.step > .tpic, .item.step > .m3d, .item.step > .rw-pic { flex: none; }
.tpic { width: 76px; height: 44px; object-fit: cover; border: 1px solid var(--line); display: block; }
.rw-pic { object-fit: contain; display: block; }
.cc-class { margin-top: 18px; }
.cc-class.locked { opacity: .7; } .cc-class.locked .cc-gate.locked { opacity: 1; }
.cc-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 10px; }
.cc-head h3 { font-size: 22px; margin: 2px 0 0; }
.cc-head .sub { font-size: 12px; max-width: 52%; text-align: right; }
.cc-stand { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; max-width: 52%; } .cc-stand .sub { max-width: none; }
.cc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.cc-card { position: relative; display: flex; flex-direction: column; background: rgba(13,8,32,.85); border: 1px solid var(--line); overflow: hidden; transition: border-color .2s, transform .2s; }
.cc-card:hover { border-color: var(--cyan); transform: translateY(-2px); }
.cc-card.me { border-color: var(--pink); box-shadow: 0 0 18px rgba(255,63,176,.35); }
.cc-card.final { border-color: rgba(255,176,32,.55); }
.cc-card.locked { filter: grayscale(.85) brightness(.6); }
.cc-pic { position: relative; aspect-ratio: 1200 / 630; overflow: hidden; }
.cc-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cc-pic::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(13,8,32,.95)); }
.cc-strip { position: absolute; left: 8px; bottom: 8px; z-index: 1; display: flex; gap: 4px; }
.cc-mini { width: 34px; height: 20px; object-fit: cover; border: 1px solid rgba(255,255,255,.35); opacity: .9; }
.cc-mini.done { border-color: var(--lime); }
.cc-mini.next { border-color: var(--pink); box-shadow: 0 0 8px var(--pink); }
.cc-body { padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.cc-name { font-family: var(--display); font-size: 15px; letter-spacing: 1px; }
.cc-meta { font-size: 12px; color: var(--mute); }
.cc-prize { display: flex; align-items: center; gap: 6px; margin: 2px 0 4px; }
.cc-prize .num { font-size: 12px; color: var(--amber); }
.cc-body .btn { margin-top: auto; align-self: flex-start; }
/* the members' cup card stands alone on the career page: a wide card, its picture on the left */
.cc-card.member { flex-direction: row; } .cc-card.member .cc-pic { flex: 0 0 300px; aspect-ratio: auto; } .cc-card.member .cc-body { justify-content: center; }
@media (max-width: 600px) { .cc-card.member { flex-direction: column; } .cc-card.member .cc-pic { flex: none; aspect-ratio: 1200 / 630; } }
.cc-note { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 12px 14px; border: 1px dashed var(--line); background: rgba(13,8,32,.5); }
.cc-note .big { font-family: var(--display); font-size: 26px; color: var(--cyan); }
.cc-note.locked { opacity: .6; }
.cc-note .sub { font-size: 12px; }
@media (max-width: 600px) { .cc-head { flex-direction: column; align-items: flex-start; } .cc-head .sub { max-width: none; text-align: left; } .cc-stand { align-items: flex-start; max-width: none; } .cc-stand .row { justify-content: flex-start !important; } .cc-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); } }
/* the gate out of a class (gateCard in ui.js): a band after its cups, the three steps on the left, the tests on the right */
.cc-gate { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr); gap: 16px; padding: 14px 16px; border: 1px solid rgba(255,176,32,.5); background: linear-gradient(90deg, rgba(255,176,32,.09), rgba(13,8,32,.85) 40%); }
.cc-gate.locked { opacity: .6; border-style: dashed; }
.cc-gate.passed { border-color: rgba(92,255,138,.5); background: linear-gradient(90deg, rgba(92,255,138,.07), rgba(13,8,32,.85) 40%); }
.cg-title { font-family: var(--display); font-size: 22px; letter-spacing: 2px; color: var(--amber); margin-top: 2px; } .cc-gate.passed .cg-title { color: var(--lime); }
.cg-steps { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; font-size: 14px; }
.cg-step { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center; color: var(--mute); }
.cg-step b { width: 24px; height: 24px; display: grid; place-items: center; font-family: var(--display); font-size: 10px; border: 1px solid var(--line); }
.cg-step.done { color: var(--ink); } .cg-step.done b { background: var(--lime); color: #061018; border-color: transparent; }
.cg-step.now { color: var(--ink); } .cg-step.now b { border-color: var(--amber); color: var(--amber); box-shadow: 0 0 10px rgba(255,176,32,.5); }
.cg-note { font-size: 12px; margin-top: 10px; }
.cg-tests { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cg-test { display: flex; flex-direction: column; gap: 4px; padding: 8px; background: rgba(13,8,32,.6); border: 1px solid var(--line); min-width: 0; }
.cg-test.locked { filter: grayscale(.8) brightness(.7); } .cg-test.med3 { border-color: rgba(240,192,64,.7); }
.cg-pic { position: relative; height: 70px; overflow: hidden; } .cg-pic .cc-img { height: 100%; }
.cg-test .cc-name { font-size: 13px; } .cg-test .btn { margin-top: auto; align-self: flex-start; } .cg-wait { font-size: 12px; margin-top: auto; }
@media (max-width: 900px) { .cc-gate { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .cg-tests { grid-template-columns: 1fr; } .cg-test { flex-direction: row; flex-wrap: wrap; align-items: center; } .cg-pic { width: 76px; height: 44px; } .cg-test .cc-name { flex: 1; } .cg-test .cc-meta, .cg-test .cc-medals { flex-basis: 100%; } }
.item.step { grid-template-columns: 76px 1fr auto; }
.item.step > .m3d { justify-self: center; }
.wing-mini { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; }
.wing-mini .name { font-family: var(--display); font-size: 13px; letter-spacing: 1px; }

/* placing a sticker on the craft in the garage view (garage.js placing): the hint and the buttons a phone needs */
/* the sticker studio: the craft big on the left, your stickers on the right */
#modal .panel.studio { width: min(1180px, 96vw); }
#modal .panel.studio .title { margin: 0; }
.stu { display: grid; grid-template-columns: 1fr 300px; gap: 14px; margin-top: 12px; }
.stu-view { position: relative; border: 1px solid var(--line); background: radial-gradient(ellipse at 50% 60%, rgba(48,232,255,0.06), transparent 70%); }
#stu-view { display: block; width: 100%; height: min(64vh, 600px); cursor: grab; }
#stu-view:active { cursor: grabbing; }
.stu-hint { position: absolute; left: 10px; top: 10px; right: 60px; font-size: 13px; color: var(--ink); text-shadow: 0 1px 4px #000; pointer-events: none; }
.stu-tools { position: absolute; left: 10px; bottom: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.stu-zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.stu-zoom button { width: 36px; height: 36px; background: rgba(7,4,15,.7); border: 1px solid var(--line); color: var(--ink); font: 600 22px/1 system-ui, sans-serif; cursor: pointer; }
.stu-zoom button:hover { border-color: var(--cyan); color: var(--cyan); }
.stu-side { max-height: min(64vh, 600px); overflow-y: auto; padding-right: 4px; }
.stu-on, .stu-have { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; margin-top: 8px; }
.stu-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; background: rgba(255,255,255,0.03); border: 1px solid transparent; color: var(--ink); cursor: pointer; text-align: center; }
.stu-item img { width: 52px; height: 52px; }
.stu-item span { font-size: 11px; font-weight: 600; line-height: 1.2; }
.stu-item small { font-size: 10px; color: var(--pink); letter-spacing: 1px; }
.stu-item:hover { border-color: var(--line); }
.stu-item.sel { border-color: var(--lime); background: rgba(92,255,138,0.08); }
.stu-item.full { opacity: 0.45; }
.stu-item.r-rare span { color: var(--cyan); } .stu-item.r-epic span { color: var(--pink); } .stu-item.r-legend span { color: var(--amber); }
@media (max-width: 760px), (max-height: 520px) {
  .stu { grid-template-columns: 1fr; }
  #stu-view { height: 46vh; }
  .stu-side { max-height: none; }
}
@media (max-height: 520px) and (min-width: 700px) { .stu { grid-template-columns: 1fr 240px; } #stu-view { height: 70vh; } .stu-side { max-height: 70vh; } }

/* licence medals (career test cards): the medal won on the picture, the three times under the name */
.medal { position: absolute; top: 8px; right: 8px; z-index: 1; font-family: var(--display); font-size: 10px; letter-spacing: 2px; padding: 4px 8px; border-radius: 12px; color: #1a1020; box-shadow: 0 0 12px rgba(0,0,0,.5); }
.medal.m1 { background: linear-gradient(135deg, #e8a070, #a0603a); }
.medal.m2 { background: linear-gradient(135deg, #f4f6fa, #9aa2b0); }
.medal.m3 { background: linear-gradient(135deg, #ffe48a, #d49a20); box-shadow: 0 0 16px rgba(255,200,80,.6); }
.cc-medals { display: flex; gap: 6px; margin: 2px 0 4px; }
.cc-medals span { font-family: var(--display); font-size: 11px; padding: 2px 6px; border: 1px solid var(--line); color: var(--mute); }
.cc-medals span::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.cc-medals .m3::before { background: #f0c040; } .cc-medals .m2::before { background: #c8ccd8; } .cc-medals .m1::before { background: #c8805a; }
.cc-medals span.on { color: var(--ink); border-color: currentColor; }
.cc-card.med3 { border-color: rgba(240,192,64,.7); }

/* ---------- rarity, the item tip, playstyles, the goal, ranks (Oct 20) ---------- */
/* an item's icon in its tier's frame: a thin edge, a tint behind the model, a bar along the foot */
.m3d.tf { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--tc) 50%, transparent)); }
.m3d.tf::before { content: ""; position: absolute; inset: 0; border: 1px solid color-mix(in srgb, var(--tc) 55%, transparent); border-bottom: 2px solid var(--tc); background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--tc) 24%, transparent), transparent 72%); }
.m3d.tf.tf-s::before { border: 0; border-bottom: 2px solid var(--tc); background: radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--tc) 30%, transparent), transparent 70%); }
.m3d.tf.sil::before { border-color: rgba(255,255,255,0.18); }
/* the tier's name, the style badge, the upgrade and goal markers */
.tn { display: inline-block; font-family: var(--display); font-size: 10px; letter-spacing: 2px; color: var(--tc); text-shadow: 0 0 8px color-mix(in srgb, var(--tc) 50%, transparent); vertical-align: middle; }
.sty { display: inline-block; padding: 1px 7px; font-family: var(--display); font-size: 10px; letter-spacing: 2px; color: var(--sc); border: 1px solid color-mix(in srgb, var(--sc) 60%, transparent); background: color-mix(in srgb, var(--sc) 10%, transparent); vertical-align: middle; }
.sty.on { color: #0a0614; background: var(--sc); box-shadow: 0 0 14px color-mix(in srgb, var(--sc) 60%, transparent); }
.sty.dim { opacity: 0.55; }
.upg { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 2px 8px; font-family: var(--display); font-size: 10px; letter-spacing: 2px; color: var(--lime); border: 1px solid rgba(92,255,138,0.5); background: rgba(92,255,138,0.07); }
.upg::before { content: ""; border: 4px solid transparent; border-bottom: 6px solid currentColor; margin-top: -5px; }
.upg b { font-family: var(--body); font-size: 13px; font-weight: 700; letter-spacing: 0.5px; }
.gm { display: inline-block; padding: 1px 6px; font-family: var(--display); font-size: 10px; letter-spacing: 2px; color: var(--pink); border: 1px solid rgba(255,63,176,0.6); background: rgba(255,63,176,0.1); vertical-align: middle; }
.btn.pin { padding: 6px 10px; font-size: 10px; letter-spacing: 1px; }
.btn.pin.on { background: rgba(255,63,176,0.18); border-color: var(--pink); color: var(--pink); }
/* the item tip */
#tip { position: fixed; z-index: 70; width: max-content; max-width: min(320px, calc(100vw - 16px)); padding: 10px 13px 11px; background: rgba(10,6,24,0.97); border: 1px solid var(--line); border-top: 2px solid var(--cyan); font-size: 14px; line-height: 1.4; color: var(--ink); pointer-events: none; opacity: 0; transition: opacity 0.12s; box-shadow: 0 8px 30px rgba(0,0,0,0.6); }
#tip.on { opacity: 1; }
#tip .tip-h { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; }
#tip .tip-h b { font-family: var(--display); font-size: 13px; letter-spacing: 2px; text-transform: uppercase; }
#tip .tip-sub { margin-top: 3px; font-family: var(--display); font-size: 10px; letter-spacing: 2px; color: var(--mute); }
#tip .tip-have, #tip .tip-does { margin-top: 5px; }
#tip .tip-state { margin-top: 8px; color: var(--mute); }
#tip .tip-goal { margin-top: 7px; padding: 5px 8px; border-left: 2px solid var(--pink); background: rgba(255,63,176,0.1); }
#tip .tip-k { margin-top: 8px; font-family: var(--display); font-size: 10px; letter-spacing: 2px; color: var(--mute); }
#tip .tip-list .m { color: var(--dim); }
#tip b { color: #fff; }
#tip.wide { max-width: min(400px, calc(100vw - 16px)); }
#tip .bt-row { display: grid; grid-template-columns: 30px 1fr auto 38px; align-items: center; gap: 8px; margin-top: 4px; padding: 2px 4px 2px 0; border-left: 2px solid var(--tc); padding-left: 6px; }
#tip .bt-row .m3d { width: 30px; height: 30px; }
#tip .bt-n { display: flex; flex-direction: column; line-height: 1.15; font-size: 13px; }
#tip .bt-n small { font-family: var(--display); font-size: 9px; letter-spacing: 1.5px; color: var(--mute); }
#tip .bt-row i { font-style: normal; font-family: var(--display); font-size: 9px; letter-spacing: 1px; color: var(--lime); text-align: right; }
#tip .bt-row.own .bt-n { color: var(--mute); }
.cc-box { position: absolute; top: 6px; right: 6px; z-index: 2; display: flex; align-items: flex-end; gap: 2px; padding: 2px 4px; background: radial-gradient(closest-side, rgba(10,6,24,.75), transparent); cursor: help; }
.cc-box .m3d { filter: drop-shadow(0 0 6px var(--c)); }
.cc-box .cb-n { position: absolute; left: 0; right: 0; bottom: -6px; text-align: center; font-family: var(--display); font-size: 9px; letter-spacing: 1px; color: var(--ink); text-shadow: 0 0 4px #000; white-space: nowrap; }
.cc-loot { font-size: 12px; color: var(--mute); }
.cc-loot b { color: var(--ink); font-weight: 600; }
.cc-gas { font-size: 12px; color: var(--mute); } .cc-gas b { font-weight: 600; }
.cc-gas.on { color: var(--ink); } .cc-gas.on b { color: var(--cyan); }
[data-tip] { cursor: help; }
.btn[data-tip], button [data-tip] { cursor: pointer; }
/* the garage: what the next rank opens, the playstyles */
.g-next { font-size: 13px; margin-top: 8px; line-height: 1.4; }
.g-sty-row { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 6px 0; font-size: 13px; line-height: 1.35; color: var(--mute); }
.g-sty-row.on { color: var(--ink); }
.g-sty-why { font-size: 13px; color: var(--mute); margin-top: 6px; line-height: 1.4; }
.g-sty-new { color: var(--cyan); }
#g-name .g-styles { font-size: 15px; letter-spacing: 2px; margin-left: 6px; }
.slot .t { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.slot.locked .tag.rank { color: var(--amber); border-color: rgba(255,176,32,0.5); }
.slot.sk { border-left: 3px solid var(--sk); } .slot.sk.empty { border-left-color: color-mix(in srgb, var(--sk) 45%, transparent); }
.slot .sk-tag { color: var(--sk); border-color: color-mix(in srgb, var(--sk) 55%, transparent); }
.pr-cat.sk { border-top: 3px solid var(--sk); } .pr-cat.sk h3, .sk-n { color: var(--sk); }
.slot .upnow { display: inline-block; margin-top: 4px; color: var(--lime); font-size: 12px; font-family: var(--display); letter-spacing: 1px; }
/* the part picker as rows: icon, what it is and does, what to do */
#modal .panel.wide { width: min(780px, 94vw); }
.picks.rows { grid-template-columns: 1fr 1fr; }
.picks.rows .pick { flex-direction: row; align-items: flex-start; text-align: left; gap: 12px; padding: 10px; }
.picks.rows .pick > .m3d { flex: none; }
.pick .pk-b { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.pick .pk-n { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.pick .pk-n .num { font-size: 13px; letter-spacing: 1px; }
.pick .pk-act { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; align-items: center; }
.tofind { margin-top: 14px; }
.tofind .eyebrow { margin-bottom: 6px; }
.tofind-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 5px 0; border-top: 1px solid rgba(255,255,255,0.05); font-size: 13px; }
.tofind-row .n { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; color: var(--ink); }
.tofind-row .w { color: var(--mute); font-size: 12px; }
@media (max-width: 640px) { .picks.rows { grid-template-columns: 1fr; } }
/* the printer's rows: the tier and style beside the name */
.item .name .tn, .item .name .sty { margin-left: 6px; }
.item .right .pin { margin-right: 6px; }
/* the bed: blueprints waiting on a skill, as chips you can pin */
.bp-chip { display: inline-flex; align-items: center; gap: 4px; margin: 3px 6px 0 0; padding: 1px 8px; font-size: 13px; color: var(--tc); border: 1px solid color-mix(in srgb, var(--tc) 50%, transparent); background: color-mix(in srgb, var(--tc) 8%, transparent); cursor: pointer; }
.bp-chip.on { border-color: var(--pink); box-shadow: 0 0 10px rgba(255,63,176,0.4); }
.tech-card.goal { outline: 1px solid rgba(255,63,176,0.6); }
.mat .tn { margin-left: 6px; }
/* the box and the cup's prizes: each card in its tier's colour, its tier named, a marker when it feeds the goal */
.bs-card.tiered { border-color: var(--tc); box-shadow: 0 0 30px color-mix(in srgb, var(--tc) 45%, transparent), inset 0 0 24px color-mix(in srgb, var(--tc) 12%, transparent); }
.bs-card.tiered .big { color: var(--tc); }
.bs-card.tiered[data-tier="3"], .bs-card.tiered[data-tier="4"] { box-shadow: 0 0 54px color-mix(in srgb, var(--tc) 70%, transparent), inset 0 0 30px color-mix(in srgb, var(--tc) 20%, transparent); }
.bs-card.tiered[data-tier="4"] { animation: bsdeal 0.55s var(--ease) both, legend 1.6s ease-in-out 0.6s infinite alternate; }
@keyframes legend { to { box-shadow: 0 0 80px color-mix(in srgb, var(--tc) 85%, transparent), inset 0 0 40px color-mix(in srgb, var(--tc) 30%, transparent); } }
.bs-card .tn { font-size: 11px; }
.bs-card .bs-marks { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; min-height: 0; }
.bs-card .bs-marks:empty { display: none; }
.bs-card .pin { margin-top: 4px; }
.chip-i.tiered b { color: var(--tc); }
.chip-i .gm { margin-left: 2px; }
/* the results: pilot and craft XP side by side, and a craft's rank up as a moment */
.xps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; margin-top: 14px; }
.bar.craft > i { background: linear-gradient(90deg, var(--amber), #ffd27a); box-shadow: 0 0 12px var(--amber); }
.craftup { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; margin-top: 12px; padding: 10px 14px; border: 1px solid var(--amber); background: linear-gradient(90deg, rgba(255,176,32,0.16), rgba(255,176,32,0.03)); box-shadow: 0 0 30px rgba(255,176,32,0.25); animation: pop 0.45s var(--ease) both; }
.craftup .cu-t { font-family: var(--display); font-size: 17px; font-weight: 900; letter-spacing: 3px; color: var(--amber); text-shadow: 0 0 14px rgba(255,176,32,0.7); }
.craftup .cu-w { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; align-items: center; }
.craftup .cu-w .sw1 { display: inline-block; width: 12px; height: 12px; vertical-align: -2px; margin-left: 6px; box-shadow: 0 0 8px currentColor; }
.craftup .sub { font-size: 13px; margin-top: 3px; }
@media (max-width: 640px) { .xps { grid-template-columns: 1fr; } .craftup { grid-template-columns: 1fr; } }
/* the quarters: the goal's chain in the NEXT UP corner, the two ranks top right */
.qt-next .g-head { display: flex; gap: 10px; align-items: center; }
.qt-next .g-name { font-family: var(--display); font-size: 13px; letter-spacing: 2px; color: var(--tc); text-transform: uppercase; }
.qt-next .g-x { margin-left: auto; align-self: flex-start; padding: 2px 6px; font-family: var(--display); font-size: 10px; letter-spacing: 1px; color: var(--mute); border: 1px solid rgba(255,255,255,0.15); }
.qt-next .g-x:hover { color: var(--ink); border-color: var(--line); }
.g-steps { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.g-steps li { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; font-size: 13px; line-height: 1.3; color: var(--mute); padding: 2px 4px; }
.g-steps li > i { width: 9px; height: 9px; border: 1px solid var(--dim); transform: rotate(45deg); }
.g-steps li.done { color: var(--dim); } .g-steps li.done > i { background: var(--lime); border-color: var(--lime); box-shadow: 0 0 6px var(--lime); }
.g-steps li.now { color: var(--ink); background: rgba(48,232,255,0.08); } .g-steps li.now > i { border-color: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.g-steps li[data-go]:hover { background: rgba(48,232,255,0.14); }
.g-steps li em { font-style: normal; font-family: var(--display); font-size: 11px; letter-spacing: 1px; color: var(--cyan); white-space: nowrap; }
.g-steps li.done em { color: var(--dim); }
.g-steps li small { display: block; font-size: 12px; color: var(--mute); }
.g-steps li.sum { font-family: var(--display); font-size: 10px; letter-spacing: 2px; }
.qt-ranks { position: absolute; right: 16px; top: 64px; width: 250px; padding: 9px 13px 10px; background: var(--glass); border: 1px solid var(--line); z-index: 3; }
.qt-ranks .rk { display: block; width: 100%; text-align: left; cursor: pointer; }
.qt-ranks .rk + .rk { margin-top: 8px; }
.qt-ranks .rl { display: flex; align-items: baseline; gap: 8px; font-family: var(--display); font-size: 11px; letter-spacing: 2px; color: var(--mute); }
.qt-ranks .rl b { color: var(--ink); font-size: 12px; } .qt-ranks .rl span { margin-left: auto; font-size: 10px; letter-spacing: 1px; }
.qt-ranks .bar { height: 6px; margin-top: 4px; }
.qt-ranks .bar.craft > i { background: linear-gradient(90deg, var(--amber), #ffd27a); box-shadow: 0 0 10px var(--amber); }
.qt-ranks .rn { font-size: 12px; color: var(--mute); margin-top: 3px; }
#qt.playing .qt-ranks, #qt.menu-open .qt-ranks { display: none; }
body.staged #qt .qt-ranks { visibility: hidden; }
/* the phone floor */
body.coarse .tn, body.coarse .sty, body.coarse .upg, body.coarse .gm, body.coarse .btn.pin { font-size: 12px; letter-spacing: 1px; }
body.coarse #tip .bt-n small, body.coarse #tip .bt-row i, body.coarse .cc-box .cb-n, body.coarse #tip .tip-sub, body.coarse #tip .tip-k, body.coarse .g-steps li em, body.coarse .g-steps li.sum, body.coarse .qt-next .g-x, body.coarse .slot .upnow { font-size: 12px; letter-spacing: 1px; }
body.coarse .qt-ranks { top: 54px; right: 10px; width: 200px; padding: 6px 10px 7px; }
body.coarse .qt-ranks .rl, body.coarse .qt-ranks .rl span, body.coarse .qt-ranks .rl b { font-size: 12px; letter-spacing: 1px; }
body.coarse .qt-ranks .rn, body.coarse .qt-ranks .rl span { display: none; }
.qt-ranks .rl { white-space: nowrap; }
body.coarse .qt-next { max-width: calc(100vw - 240px); }
body.coarse .qt-ranks { width: 170px; }
@media (max-width: 560px) { body.coarse .qt-next { max-width: calc(100vw - 20px); top: 96px; } body.coarse .qt-ranks { top: auto; bottom: 10px; right: 10px; } }
@media (max-height: 500px) { body:has(.qt-menu.on) .qt-ranks { display: none; } }
/* the cup box's stage on a phone: two cards a row */
@media (max-width: 480px) {
  .cbstage .bs-cards { gap: 8px; }
  .cbstage .bs-card, .cbstage .bs-card.bp-card, .cbstage .hull-card { box-sizing: border-box; width: min(44vw, 170px); padding: 10px 6px; }
  .cbstage .hull-card .bs-ico { width: 110px; height: 96px; }
  .cbstage .hull-card .bs-ico .m3d, .cbstage .hull-card .bs-ico .m3d img { width: 110px; height: 110px; }
  .cbstage.opened .cb-cv { height: min(170px, 22vh); }
}

/* the makers' marks (data.js MAKERS): a painting once it lands, else a badge in the maker's colour */
.mk-b { position: relative; display: inline-grid; place-items: center; flex: none; width: var(--mpx); height: var(--mpx); vertical-align: middle; background: linear-gradient(160deg, color-mix(in srgb, var(--mc), #fff 45%), var(--mc) 45%, color-mix(in srgb, var(--mc), #000 45%)); }
.mk-b::before { content: ''; position: absolute; inset: max(1.5px, calc(var(--mpx) * 0.09)); clip-path: inherit; border-radius: inherit; background: radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--mc) 32%, #140a26), #07040f 78%); }
.mk-b i { position: relative; font-style: normal; font-family: var(--display); font-weight: 900; font-size: calc(var(--mpx) * 0.42); line-height: 1; letter-spacing: 0; color: var(--mc); text-shadow: 0 0 calc(var(--mpx) * 0.2) color-mix(in srgb, var(--mc) 60%, transparent); }
.mk-b.long i { font-size: calc(var(--mpx) * 0.3); }
.mk-round { border-radius: 50%; }
.mk-shield { clip-path: polygon(0 6%, 50% 0, 100% 6%, 100% 56%, 50% 100%, 0 56%); } .mk-shield i { margin-top: -14%; }
.mk-hex { clip-path: polygon(25% 2%, 75% 2%, 100% 50%, 75% 98%, 25% 98%, 0 50%); }
.mk-b.img { background: none; clip-path: none; border-radius: 0; } .mk-b.img::before { display: none; } .mk-b.img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.mk-l { display: inline-flex; align-items: center; gap: 6px; font-family: var(--display); font-size: 11px; letter-spacing: 2px; color: var(--mute); }
.mk-l small { font-family: var(--body, inherit); letter-spacing: 0; font-size: 11px; text-transform: none; }
.g-maker { margin-top: 4px; } .g-maker .mk-l { cursor: help; }
.mk-head { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 4px 2px; }
.mk-head b { display: block; font-family: var(--display); font-size: 13px; letter-spacing: 3px; } .mk-head small { display: block; font-size: 12px; color: var(--mute); }
.mk-tip-h { display: flex; align-items: center; gap: 10px; }
.craft-tab .n .mk-b { margin: -2px 2px 0 0; }
body.coarse .mk-l, body.coarse .mk-l small { font-size: 12px; }
.null-mk.on { display: inline-block; width: 1.4em; height: 1.4em; margin-right: 6px; vertical-align: -0.35em; } .null-mk.on img { width: 100%; height: 100%; object-fit: contain; display: block; }
.mk-head { grid-column: 1 / -1; }
/* the showroom's list is one column (the capsule screen's series list shares the .sr-list name) */
.view.showroom > .sr-list { grid-template-columns: 1fr; }

/* trails and glows (the garage, the cup boxes, the Laurel cabinet): a streak of the thing's colours */
.lt-ic { display: inline-block; flex: none; position: relative; border: 1px solid color-mix(in srgb, var(--a) 40%, transparent); background: radial-gradient(ellipse 120% 40% at 100% 50%, color-mix(in srgb, var(--a) 30%, transparent), transparent 70%), #07040f; overflow: hidden; }
.lt-ic::before { content: ''; position: absolute; left: 8%; right: 0; top: 42%; height: 16%; background: linear-gradient(90deg, transparent, var(--b) 40%, var(--a)); box-shadow: 0 0 8px var(--a); border-radius: 50% 0 0 50%; }
.lt-ic.twin::before, .lt-ic.helix::before { top: 30%; height: 10%; }
.lt-ic.twin::after, .lt-ic.helix::after { content: ''; position: absolute; left: 8%; right: 0; top: 60%; height: 10%; background: linear-gradient(90deg, transparent, var(--a) 40%, var(--b)); box-shadow: 0 0 6px var(--b); }
.lt-ic.pulse::before, .lt-ic.tracer::before { background: repeating-linear-gradient(90deg, var(--a) 0 18%, transparent 18% 30%); }
.lt-ic.stripe::before { background: repeating-linear-gradient(115deg, var(--a) 0 10%, var(--b) 10% 20%); }
.lt-ic.rainbow::before { background: linear-gradient(90deg, transparent, #ff3050, #ffd040, #5cff8a, #30a8ff, #b06bff); }
.lt-ic.aurora::before { top: 18%; height: 50%; filter: blur(2px); opacity: 0.85; }
.lt-ic.glitch::before { background: repeating-linear-gradient(90deg, var(--a) 0 9%, transparent 9% 14%, var(--b) 14% 22%, transparent 22% 31%); }
.lt-ic.under::before { left: 15%; right: 15%; top: 55%; height: 30%; border-radius: 50%; filter: blur(3px); background: radial-gradient(var(--a), var(--b)); }
.lt-ic.edge::before { left: 10%; right: 10%; top: 35%; height: 30%; border-radius: 0; background: transparent; border: 2px solid var(--a); box-shadow: 0 0 8px var(--a), inset 0 0 6px var(--b); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.lt-ic.flame::before { left: 30%; right: 30%; top: 20%; height: 60%; border-radius: 50% 50% 40% 40%; background: radial-gradient(ellipse at 50% 70%, #fff, var(--a) 40%, var(--b) 70%, transparent); filter: blur(1px); }
.lt-thr { font-size: 13px; color: var(--mute); margin-bottom: 6px; }
.lt-thr b { font-family: var(--display); letter-spacing: 1px; color: var(--cyan); font-size: 12px; margin-right: 4px; }
.lt-row { display: grid; grid-template-columns: 96px 1fr; gap: 8px; align-items: start; padding: 5px 0; border-top: 1px solid var(--line); }
.lt-k { font-family: var(--display); font-size: 10px; letter-spacing: 1.5px; color: var(--mute); padding-top: 6px; }
.lt-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.lt-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 4px; font-size: 12px; color: var(--ink); background: color-mix(in srgb, var(--tc) 8%, transparent); border: 1px solid color-mix(in srgb, var(--tc) 55%, transparent); cursor: pointer; }
.lt-chip:not(:has(.lt-ic)) { padding-left: 8px; }
.lt-chip.on { border-color: var(--pink); box-shadow: 0 0 10px rgba(255,63,176,0.45); color: #fff; }
.lt-chip.locked { opacity: 0.45; filter: saturate(0.4); }
.lt-chip.locked::after { content: 'LOCKED'; font-family: var(--display); font-size: 8px; letter-spacing: 1px; color: var(--mute); }
body.coarse .lt-chip, body.coarse .lt-k, body.coarse .lt-chip.locked::after { font-size: 12px; }
@media (max-width: 700px) { .lt-row { grid-template-columns: 1fr; } }
.g-lt { padding: 4px 18px 14px; border-top: 1px solid var(--line); }
/* on a phone each row of trails or glows is one strip swiped sideways, and the craft stays pinned at the top of
   its panel while you scroll down to them, so what you tap shows on the hull above */
body.coarse .lt-row { grid-template-columns: 1fr; gap: 4px; }
body.coarse .lt-chips { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding-bottom: 2px; }
body.coarse .lt-chips::-webkit-scrollbar { display: none; }
body.coarse .lt-chip { flex: none; white-space: nowrap; }
body.coarse #garage-view { height: min(240px, 42vh); background: #0b0716; }
/* (pinned only on a phone held upright, and smaller: sideways it covered the whole menu, and upright a tall one hid the
   skins and colours under it) */
@media (orientation: portrait) { body.coarse #garage-view { position: sticky; top: 0; z-index: 2; height: min(200px, 28vh); } }
/* the keys and the cog step aside for a game, a menu and a box's stage; on a narrow phone the ranks sit above the cog */
#qt.playing .qt-keys, #qt.playing .qt-cog, #qt.menu-open .qt-keys, #qt.menu-open .qt-cog { display: none; }
body.staged #qt .qt-keys, body.staged #qt .qt-cog { visibility: hidden; }
body.coarse .qt-cog { right: 10px; bottom: 10px; }
@media (max-width: 560px) { body.coarse .qt-ranks { bottom: 66px; } }

/* what a blueprint does, a line each: stat gains green, costs red, what it does beyond stats cyan, the setting it needs amber over them */
.fx-lines { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; font-size: 12px; line-height: 1.3; text-align: left; }
.fx-lines .fl-up { color: var(--lime); } .fx-lines .fl-down { color: var(--red); } .fx-lines .fl-fx { color: var(--cyan); }
.fx-lines .fl-cond { color: var(--amber); font-family: var(--display); font-size: 10px; letter-spacing: 2px; text-transform: uppercase; }
/* (what the setting switches on sits under it; a cost elsewhere doesn't) */
.fx-lines .fl-cond ~ .fl-up, .fx-lines .fl-cond ~ .fl-fx { padding-left: 8px; border-left: 2px solid rgba(255,176,32,0.4); }
.bs-card .fx-lines { align-items: center; text-align: center; }
.bs-card .fx-lines .fl-cond ~ div { padding-left: 0; border-left: 0; }
body.coarse .pb-board { padding: 12px; }

/* the neon sign's menu */
.nn-prev { background: #0c0a14 radial-gradient(rgba(255,255,255,0.03) 1px, transparent 1.5px) 0 0 / 6px 6px; border: 1px solid var(--line); border-radius: 4px; margin: 6px 0 12px; }
.nn-prev canvas { display: block; width: 100%; max-width: 760px; margin: 0 auto; aspect-ratio: 1024 / 384; }
.nn-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.nn-in { flex: 1; max-width: 460px; padding: 10px 14px; font-family: var(--body); font-size: 20px; color: var(--ink); background: rgba(255,255,255,0.04); border: 1px solid var(--line); outline: none; }
.nn-in:focus { border-color: var(--cyan); box-shadow: 0 0 12px rgba(48,232,255,0.3); }
.nn-n { font-family: var(--display); font-size: 12px; letter-spacing: 2px; color: var(--mute); }
.nn-fonts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.nn-font { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 110px; padding: 8px 14px; color: var(--ink); background: rgba(255,255,255,0.03); border: 1px solid var(--line); cursor: pointer; }
.nn-font span { font-size: 26px; line-height: 1.1; } .nn-font small { font-family: var(--display); font-size: 10px; letter-spacing: 2px; color: var(--mute); }
.nn-font.on, .nn-font:hover { border-color: var(--cyan); box-shadow: 0 0 12px rgba(48,232,255,0.3) inset; }
.nn-cols { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.nn-col { width: 36px; height: 36px; border-radius: 50%; background: var(--nc); border: 2px solid rgba(255,255,255,0.15); box-shadow: 0 0 12px var(--nc); cursor: pointer; }
.nn-col.on { border-color: #fff; transform: scale(1.12); }

/* a meal's effect, set apart from its description: what it does in your next grid race */
.fx-line { margin-top: 3px; font-size: 14px; color: #8affb0; line-height: 1.3; }
.fx-line b { display: inline-block; margin-right: 6px; padding: 1px 5px; font-family: var(--display); font-size: 10px; letter-spacing: 1.5px; color: #061810; background: #5cff8a; vertical-align: 1px; }

/* the update bar (main.js's checkBuild): after a deploy an open page reloads before it races again */
#update-bar { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 9999; display: flex; align-items: center; gap: 14px; padding: 8px 10px 8px 16px; background: rgba(10,6,24,0.96); border: 1px solid var(--cyan); box-shadow: 0 0 24px rgba(48,232,255,0.35); font-family: var(--display); font-size: 12px; letter-spacing: 2px; color: #fff; }
#update-bar.nudge { animation: upd-nudge 0.5s; }
@keyframes upd-nudge { 0%, 100% { transform: translateX(-50%); } 25% { transform: translateX(calc(-50% - 8px)); } 75% { transform: translateX(calc(-50% + 8px)); } }

/* membership's welcome stage (memberReveal): the three lands' clips, what else opens, the cup */
#boxstage.memstage { overflow-y: auto; justify-content: flex-start; padding-top: max(24px, 6vh); padding-bottom: 24px; }
.memstage .bs-title { text-align: center; text-shadow: 0 0 24px #ffc84a, 0 0 60px var(--pink); }
.mr-lands { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: min(1000px, 100%); opacity: 0; transform: translateY(14px); transition: opacity 0.5s 0.5s, transform 0.5s 0.5s var(--ease); }
.memstage.done .mr-lands, .memstage.done .mr-perks, .memstage.done .mr-keep { opacity: 1; transform: none; }
.mr-land { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid rgba(255,200,74,0.5); box-shadow: 0 0 24px rgba(255,200,74,0.18); }
.mr-land video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mr-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; background: linear-gradient(transparent, rgba(4,2,12,0.92)); display: flex; flex-direction: column; gap: 1px; }
.mr-cap b { font-family: var(--display); letter-spacing: 3px; font-size: 15px; color: #ffc84a; } .mr-cap span { font-size: 13px; color: #fff; } .mr-cap small { font-size: 12px; color: var(--mute); }
.mr-perks { position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; width: min(1000px, 100%); opacity: 0; transform: translateY(14px); transition: opacity 0.5s 0.8s, transform 0.5s 0.8s var(--ease); }
.mr-perks > div { padding: 8px 12px; background: rgba(255,255,255,0.04); border-left: 2px solid #ffc84a; display: flex; flex-direction: column; }
.mr-perks b { font-family: var(--display); font-size: 12px; letter-spacing: 2px; color: #ffc84a; } .mr-perks span { font-size: 13px; color: var(--ink); }
.mr-keep { position: relative; opacity: 0; transition: opacity 0.5s 1s; font-size: 13px; }
@media (max-width: 700px) { .mr-lands { grid-template-columns: 1fr; } .mr-land { aspect-ratio: 21 / 9; } }

/* the rankings' way in: the boards are time trials, and a button that starts one on the track shown */
.rk-set { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 10px; padding: 12px 14px; border: 1px solid rgba(255,63,176,0.35); background: rgba(255,63,176,0.06); }
.rk-set.empty { margin-top: 0; margin-bottom: 10px; padding: 18px; }
.rk-set > div { display: flex; flex-direction: column; gap: 2px; } .rk-set b { font-family: var(--display); letter-spacing: 2px; font-size: 13px; color: var(--pink); } .rk-set span { font-size: 13px; color: var(--mute); }
@media (max-width: 600px) { .rk-set { flex-direction: column; align-items: stretch; } }
.res-board { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding: 6px 10px; background: rgba(255,63,176,0.06); border-left: 2px solid var(--pink); font-size: 13px; color: var(--mute); }
/* the garage's name and the swatches beside it: on a phone the swatches take their own row under the name
   (sideways they squeezed the name into a column, VEX- above 7) */
body.coarse .garage-grid .row.between:has(#sw) { flex-wrap: wrap; gap: 8px; }
body.coarse #sw { flex-basis: 100%; justify-content: flex-start; }
/* a class opened (classReveal): the class's name as the headline, its licence craft turning under it */
.clstage .cl-name { font-size: clamp(56px, 14vw, 128px); letter-spacing: 0.2em; text-shadow: 0 0 30px var(--cyan), 0 0 80px var(--pink); }
.clstage .cl-sub { position: relative; font-family: var(--display); letter-spacing: 8px; font-size: 14px; color: var(--cyan); margin-top: -6px; }
.clstage .cl-facts { width: min(1000px, 100%); grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 640px) { .clstage .cl-facts { grid-template-columns: 1fr 1fr; } }
.clstage .cap-cv { max-height: min(300px, 34vh); }
.clstage.done .cl-facts { opacity: 1; transform: none; }
@media (max-height: 500px) { .clstage .cl-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; } .clstage .cl-facts span { font-size: 11px; } .clstage .cap-cv { max-height: 26vh; } }
.qt-head .tabs a.qt-wiki { padding: 7px 12px; font-family: var(--display); font-size: 11px; letter-spacing: 2px; color: var(--mute); border: 1px solid var(--line); text-decoration: none; }
.qt-head .tabs a.qt-wiki:hover { color: #fff; border-color: var(--cyan); }
/* the career: a class folds under its heading (the chevron turns), and a members' cup run today is one quiet line */
.cc-head.cc-fold { cursor: pointer; position: relative; padding-left: 26px; }
.cc-chev { position: absolute; left: 4px; top: 50%; width: 10px; height: 10px; border-right: 2px solid var(--cyan); border-bottom: 2px solid var(--cyan); transform: translateY(-70%) rotate(45deg); transition: transform 0.2s var(--ease); }
.cc-class.folded .cc-chev { transform: translateY(-40%) rotate(-45deg); }
.cc-class.folded .cc-grid { display: none; }
.cc-class.folded .cc-head { margin-bottom: 0; opacity: 0.75; }
.cc-done { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 8px 12px; background: rgba(255,255,255,0.03); color: var(--mute); font-size: 13px; opacity: 0.8; }
/* the craft bar top right is the way to the garage: say so, and look like a button (Rob: not obvious) */
.qt-ranks .rk-craft { margin-top: 10px; padding: 7px 8px 6px; border: 1px solid rgba(255,63,176,0.35); background: rgba(255,63,176,0.06); transition: background 0.15s, border-color 0.15s; }
.qt-ranks .rk-craft:hover { background: rgba(255,63,176,0.14); border-color: var(--pink); }
.qt-ranks .rk-go { margin-top: 6px; font-family: var(--display); font-size: 10px; letter-spacing: 2px; color: var(--pink); }
.qt-ranks .rk-craft:hover .rk-go { color: #fff; }
/* a hull won and waiting for a bay: amber, in the garage's tabs and under the craft bar */
.craft-tab.waits { border-color: rgba(255,176,32,0.6); } .craft-tab.waits .cls { color: var(--amber); }
.qt-ranks .rk-wait { margin-top: 4px; font-family: var(--display); font-size: 10px; letter-spacing: 1.5px; color: var(--amber); animation: rk-wait 2s ease-in-out infinite; }
@keyframes rk-wait { 50% { opacity: 0.55; } }
/* the quarters' top right: four buttons under the bars, each an icon and a word */
.qt-ranks .rk-acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.qt-ranks .rk-acts button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px 5px; background: rgba(48,232,255,0.06); border: 1px solid rgba(48,232,255,0.3); color: var(--cyan); cursor: pointer; font-family: var(--display); font-size: 9px; letter-spacing: 1.5px; transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s var(--ease); }
.qt-ranks .rk-acts .rk-ico { display: block; width: 22px; height: 22px; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; filter: drop-shadow(0 0 3px currentColor); }
.qt-ranks .rk-acts button:hover .rk-ico { filter: drop-shadow(0 0 6px currentColor); }
.qt-ranks .rk-acts button:hover { background: rgba(48,232,255,0.16); border-color: var(--cyan); color: #fff; transform: translateY(-1px); }
.qt-ranks .rk-acts button[data-a="paint"], .qt-ranks .rk-acts button[data-a="parts"] { color: var(--pink); border-color: rgba(255,63,176,0.3); background: rgba(255,63,176,0.06); }
.qt-ranks .rk-acts button[data-a="paint"]:hover, .qt-ranks .rk-acts button[data-a="parts"]:hover { background: rgba(255,63,176,0.16); border-color: var(--pink); color: #fff; }
body.coarse .qt-ranks .rk-acts button { font-size: 10px; padding: 9px 2px 7px; }
body.coarse .qt-ranks .rk-acts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.coarse .qt-ranks .rk-acts button { flex-direction: row; justify-content: center; gap: 6px; letter-spacing: 1px; }
body.coarse .qt-ranks .rk-acts .rk-ico { width: 18px; height: 18px; flex: none; }
@media (max-width: 560px) { body.coarse .qt-help { bottom: 262px; max-width: calc(100vw - 20px); } }
/* the slot badge wherever it's shown, the tooltip included (not only in the loadout) */
.sk-tag { color: var(--sk); border-color: color-mix(in srgb, var(--sk) 55%, transparent) !important; background: color-mix(in srgb, var(--sk) 10%, transparent); }
#update-bar.quiet { border-color: var(--line); box-shadow: none; font-size: 11px; color: var(--mute); }
.g-slot { font-size: 11px; color: var(--amber); margin-top: 3px; }
/* TODAY on the career: small tiles in a row (todayCard) */
.today-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 12px; }
.td-tile { padding: 9px 11px; background: rgba(255,255,255,0.03); border: 1px solid var(--line); border-top: 2px solid var(--line); }
.td-tile.hot { border-top-color: var(--pink); background: rgba(255,63,176,0.06); }
.td-tile.done { opacity: 0.55; border-top-color: var(--lime); }
.td-l { font-family: var(--display); font-size: 9px; letter-spacing: 2px; color: var(--mute); }
.td-v { font-family: var(--display); font-size: 15px; letter-spacing: 1px; color: var(--ink); margin: 3px 0 2px; }
.td-tile.hot .td-v { color: #fff; } .td-tile.done .td-v { color: var(--lime); }
.td-s { font-size: 11px; color: var(--mute); line-height: 1.3; }

/* account settings: the terminal's ACCOUNT tab (accountPanel in ui.js) */
.acct-g .acct-grid { align-items: start; }
.acct-g .acct-big { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: 1px; color: #fff; margin-top: 6px; overflow-wrap: anywhere; }
.acct-g .acct-big .tag { vertical-align: middle; margin-left: 6px; }
.acct-g .sub { margin: 8px 0 0; }
.acct-g .acct-perks, .acct-g .acct-small { font-size: 14px; }
.acct-g .acct-acts { gap: 8px; margin-top: 12px; }
.acct-g .acct-out, .acct-g .acct-box { margin-top: 16px; }
.acct-g .acct-pub { margin-top: 16px; }
.acct-g .acct-link { flex: 1; min-width: 0; font-size: 13px; }
.acct-g .acct-check { align-items: center; gap: 8px; cursor: pointer; font-family: var(--display); font-size: 12px; letter-spacing: 2px; color: #fff; }
.acct-g .acct-check input { width: 18px; height: 18px; accent-color: var(--pink); }
.acct-g .acct-box { max-width: 520px; }
.acct-g .acct-more { margin-top: 12px; }
.acct-g .acct-more summary { cursor: pointer; font-family: var(--display); font-size: 12px; letter-spacing: 2px; color: var(--cyan); }
.acct-g .acct-form { display: grid; gap: 8px; margin-top: 8px; max-width: 420px; }
.acct-g .acct-form .btn { justify-self: start; margin-top: 4px; }
.acct-g .field { display: block; box-sizing: border-box; width: 100%; padding: 11px 14px; background: rgba(10,6,24,0.75); border: 1px solid var(--line); color: var(--ink); font-family: var(--body, inherit); font-size: 16px; outline: none; -webkit-user-select: text; user-select: text; }
.acct-g .field:focus { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan), 0 0 14px rgba(48,232,255,0.25); }
.acct-g .err { color: var(--pink); font-family: var(--display); font-size: 12px; letter-spacing: 1px; }
.acct-g .err:empty { display: none; }
.acct-g .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.acct-g a { color: var(--cyan); }
@media (max-width: 760px) { .acct-g .acct-grid { grid-template-columns: 1fr; } .acct-g .head { flex-wrap: wrap; gap: 10px; } }
/* a long hull name gives way (BASTION DRILL RANK 5 ran off the panel): the name ellipsed, the rank and XP whole */
.qt-ranks .rl { min-width: 0; white-space: nowrap; }
.qt-ranks .rl .rk-n { font-style: normal; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.qt-ranks .rl b, .qt-ranks .rl span { flex: none; }
/* a guest's podium: the ask to save the pilot, at the top of the results */
.save-ask { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; padding: 12px 14px; border: 1px solid var(--pink); background: rgba(255,63,176,0.1); box-shadow: 0 0 24px rgba(255,63,176,0.2); }
.save-ask .sa-t { font-family: var(--display); letter-spacing: 3px; font-size: 14px; color: #fff; }
.save-ask .sa-s { font-size: 13px; color: var(--ink); margin-top: 3px; }
@media (max-width: 600px) { .save-ask { flex-direction: column; align-items: stretch; } }
/* the loading screen's hint (loading.js): one line under the title, faded in */
#loading .ld-hint { position: relative; left: 50%; transform: translateX(-50%); width: min(640px, calc(100vw - 32px)); margin-top: 14px; min-height: 2.8em; text-align: center; color: #c8cce8; font-size: 15px; line-height: 1.4; opacity: 0; transition: opacity 0.25s; }
#loading:has(.ld-hint) .ld-foot { bottom: max(56px, 12vh); }
#loading .ld-hint.in { opacity: 1; }
/* the printer's refit: a bar with the time left where the UPGRADE button was */
.pr-refit { min-width: 220px; display: grid; gap: 6px; }
.pr-refit b { color: var(--amber, #ffb020); font-family: var(--display); letter-spacing: 2px; font-size: 13px; }
.pr-refit .eta { font-size: 13px; color: var(--ink, #dfe6ff); }
.pr-refit .bar i { background: #ffb020; }
