/* Lobby: player banner + currencies on top, tab bar on the left, the tab's page on the right.
   Uses tokens from tokens.css. Background: violet with a faint tiled pattern of Hunt's own icons. */
#lobby.lobby { position: fixed; inset: 0; display: grid; overflow: hidden; z-index: 2;
  background-color: #5a45b8;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='none' stroke='%232a1a6a' stroke-opacity='.28' stroke-width='5' stroke-linejoin='round'%3E%3Ccircle cx='40' cy='40' r='20'/%3E%3Cpath d='M40 12v14M40 54v14M12 40h14M54 40h14'/%3E%3Cpath d='M128 24c-12 0-20 8-20 18 0 6 3 10 7 12v8h26v-8c4-2 7-6 7-12 0-10-8-18-20-18z'/%3E%3Cpath d='M126 128l6 13 14 2-10 10 3 14-13-7-13 7 3-14-10-10 14-2z'/%3E%3Cpath d='M30 120h30l8-8h10v14h-8l-4 6H48l-4 18H34l4-18h-8z'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(ellipse at 60% 40%, #7a63dc 0%, #5a45b8 55%, #3d2c8a 100%);
  background-size: 180px 180px, cover;
  grid-template-columns: auto 1fr; grid-template-rows: auto 1fr;
  grid-template-areas: "top top" "tabs page"; }
.lobby > * { position: relative; z-index: 1; }

/* top: player banner (level shield, name, XP) + currencies + settings */
.lb-top { grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(env(safe-area-inset-top) + 4px) var(--sa-r) 4px 0; background: rgba(18,9,30,.55); border-bottom: var(--line) solid var(--ink); }
.pbanner { display: flex; align-items: center; gap: 8px; cursor: pointer; background: linear-gradient(#4a8df0, #2f6bd0); border: var(--line) solid var(--ink); border-left: 0; padding: 4px calc(var(--u) * 4) 4px calc(var(--sa-l) + 6px); clip-path: polygon(0 0, 100% 0, calc(100% - 22px) 100%, 0 100%); min-width: min(42vw, 420px); position: relative; }
.pbanner .shield { width: calc(var(--u) * 6); height: calc(var(--u) * 6.6); flex: none; filter: drop-shadow(0 3px 0 var(--ink)); }
.pb-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pbanner .pname { font-family: var(--font); font-size: calc(var(--u) * 2.4); color: #fff; -webkit-text-stroke: 1px var(--ink); paint-order: stroke; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xpbar { height: calc(var(--u) * 1.4); background: #241a3a; border: 3px solid var(--ink); border-radius: 4px; overflow: hidden; }
.xpbar i { display: block; height: 100%; width: 0; background: linear-gradient(#5fd0ff, #2a8de0); }
.pb-row { display: flex; align-items: center; gap: 6px; min-width: 0; } .pb-row .pname { flex: 1; min-width: 2em; }
.pbanner .ptro { flex: none; font-family: var(--font); font-size: max(var(--t-xs), calc(var(--u) * 1.5)); color: var(--gold); display: flex; gap: 3px; align-items: center; }
.guestchip { position: relative; flex: none; display: flex; align-items: center; background: var(--red); color: #fff; border: 3px solid var(--ink); border-radius: 999px; font-family: var(--font); font-size: var(--t-xs); line-height: 1; padding: 3px 0 3px 10px; white-space: nowrap; cursor: pointer; }
.guestchip[hidden] { display: none; } .guestchip i { font-style: normal; }
/* the pill stays slim; its hit areas (open / dismiss) are thumb-sized */
.guestchip::before { content: ''; position: absolute; inset: -12px 0; }
.guestchip span { position: relative; } .guestchip button { position: relative; border: 0; background: none; color: #fff; font: inherit; cursor: pointer; padding: 0; width: 26px; height: 16px; }
.guestchip button::after { content: ''; position: absolute; left: 50%; top: 50%; width: calc(var(--tap) + 4px); height: calc(var(--tap) + 4px); transform: translate(-50%, -50%); }
.lb-cur { display: flex; align-items: center; gap: calc(var(--u) * .8); flex-wrap: wrap; justify-content: flex-end; }
.cur { position: relative; display: flex; align-items: center; gap: 4px; background: rgba(18,9,30,.85); border: 3px solid var(--ink); border-radius: 8px; padding: 2px 4px 2px 6px; font-family: var(--font); font-size: max(var(--t-sm), calc(var(--u) * 2)); color: #fff; }
.cur .ico { font-size: max(var(--t-sm), calc(var(--u) * 1.7)); }
.cur b { font-weight: 400; min-width: 2em; text-align: right; }
.cur small { font-size: max(var(--t-xs), .5em); color: var(--text-dim); margin-right: 2px; }
.cur .plus { border: 3px solid var(--ink); border-radius: 6px; background: var(--green); padding: 0 1px; cursor: pointer; font-size: max(var(--t-xs), calc(var(--u) * 1.5)); line-height: 1; }
.missions { gap: 6px; padding-right: 10px; cursor: pointer; }
.missions .ring { width: max(32px, calc(var(--u) * 3.2)); height: max(32px, calc(var(--u) * 3.2)); }
.missions .mt { display: flex; flex-direction: column; line-height: 1; font-size: max(var(--t-xs), .8em); }
.missions .mt small { font-family: var(--font-ui); font-weight: 700; font-size: max(var(--t-xs), .6em); color: var(--text-dim); margin-top: 2px; }
.gear { border: 3px solid var(--ink); border-radius: 10px; background: linear-gradient(#3fc6f0, #1f95c8); width: calc(var(--u) * 5); height: calc(var(--u) * 5); display: grid; place-items: center; cursor: pointer; box-shadow: var(--drop); font-size: calc(var(--u) * 2.8); padding: 0; }

/* left tab bar */
.lb-tabs { grid-area: tabs; display: flex; flex-direction: column; width: calc(var(--sa-l) + var(--u) * 13); padding-bottom: env(safe-area-inset-bottom); min-height: 0; overflow: auto; background: rgba(18,9,30,.55); border-right: var(--line) solid var(--ink); }
.tabbtn { position: relative; flex: 1; min-height: calc(var(--u) * 7); border: 0; border-bottom: 3px solid var(--ink); border-radius: 0; background: linear-gradient(#2c2645, #221c38); color: #fff; font-family: var(--font); font-size: max(var(--t-xs), calc(var(--u) * 1.6)); line-height: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; padding: 4px 4px 4px var(--sa-l); -webkit-text-stroke: .5px var(--ink); }
.tabbtn .ico { font-size: calc(var(--u) * 3.6); filter: drop-shadow(0 2px 0 var(--ink)); }
.tabbtn.on { background: linear-gradient(#4a8df0, #2f6bd0); margin-right: -4px; z-index: 2; }
.tabbtn#rail_pass { background: linear-gradient(#ffc83d, #f0a01a); color: #fff; }
.tabbtn#rail_pass.on { background: linear-gradient(#ffd96a, #ffb800); }
.tabbtn .dot { top: 6px; right: 8px; }
.tabbtn .ico { flex: none; }
.tabchip { position: absolute; top: 4px; left: 50%; transform: translateX(-40%); background: var(--gold); color: var(--ink); border: 3px solid var(--ink); border-radius: 999px; font-size: max(var(--t-xs), .7em); padding: 1px 7px; white-space: nowrap; -webkit-text-stroke: 0; }

/* pages */
.lb-page { grid-area: page; min-height: 0; min-width: 0; overflow: hidden; padding: 8px var(--sa-r) calc(var(--sa-b) + 12px) calc(var(--u) * 2); }
.pg { height: 100%; min-height: 0; }
.pg[hidden] { display: none !important; }
.pg-play { display: grid; grid-template-columns: minmax(170px, 34%) 1fr; gap: calc(var(--u) * 2); }
.modelist { display: flex; flex-direction: column; gap: calc(var(--u) * 1); min-height: 0; overflow: auto; padding: 4px 8px 8px 4px; }
.modebtn { position: relative; flex: 1; min-height: calc(var(--u) * 6.2); max-height: calc(var(--u) * 10); display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 4px 12px; border: var(--line) solid var(--ink); border-radius: 10px; background: linear-gradient(color-mix(in srgb, var(--mc) 80%, #fff 20%), var(--mc)); box-shadow: inset 0 -6px 0 rgba(0,0,0,.22), var(--drop); color: #fff; font-family: var(--font); cursor: pointer; text-align: left; }
.modebtn .mi { font-size: calc(var(--u) * 2.6); filter: drop-shadow(0 2px 0 var(--ink)); }
.modebtn .mn { flex: 1; display: flex; flex-direction: column; line-height: 1.05; }
.modebtn .mn b { font-weight: 400; font-size: calc(var(--u) * 2.5); -webkit-text-stroke: 1px var(--ink); paint-order: stroke; }
.modebtn .mn small { font-size: max(var(--t-xs), calc(var(--u) * 1.4)); opacity: .9; }
.modebtn .go { font-size: calc(var(--u) * 2.4); background: #fff; color: var(--ink); width: calc(var(--u) * 3.8); height: calc(var(--u) * 3.8); border: 3px solid var(--ink); border-radius: 8px; display: grid; place-items: center; clip-path: polygon(15% 0, 100% 50%, 15% 100%); padding-left: 3px; }
.modebtn.sel { outline: 4px solid var(--gold); outline-offset: 2px; }
.modebtn:active { transform: translateY(3px); box-shadow: inset 0 -6px 0 rgba(0,0,0,.22), var(--drop-press); }
.fillbots { background: none; border: 0; text-align: left; display: flex; align-items: center; gap: 10px; font-family: var(--font); color: #fff; font-size: max(var(--t-sm), calc(var(--u) * 2.2)); cursor: pointer; padding: 4px 6px; -webkit-text-stroke: 1px var(--ink); paint-order: stroke; }
.fillbots .cb { width: calc(var(--u) * 4); height: calc(var(--u) * 4); border-radius: 50%; border: 3px solid rgba(255,255,255,.8); display: grid; place-items: center; background: rgba(18,9,30,.3); }
.fillbots .cb.on::after { content: '✓'; color: #fff; font-size: calc(var(--u) * 2.6); -webkit-text-stroke: 0; }
.party { display: flex; flex-direction: column; gap: calc(var(--u) * 1.4); min-height: 0; padding: 4px 0 0 0; }
.slots { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.8fr) repeat(3, minmax(0, 1fr)); gap: calc(var(--u) * 1.2); }
.slot { position: relative; min-height: 0; border: var(--line) solid var(--ink); border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--font); color: #fff; cursor: pointer; }
.slot.me { background: linear-gradient(#2d2540, #1b1530); box-shadow: var(--drop); justify-content: flex-end; padding: 4px 4px 8px; gap: 3px; }
.slot.me #stage { width: 100%; flex: 1; min-height: 0; touch-action: manipulation; }
.slot.invite { background: rgba(255,255,255,.08); border-color: rgba(18,9,30,.35); color: rgba(255,255,255,.55); font-size: max(var(--t-sm), calc(var(--u) * 1.9)); text-align: center; line-height: 1.1; gap: 6px; }
.slot.invite .plus { font-size: calc(var(--u) * 8); line-height: .8; color: rgba(255,255,255,.4); }
.slot.invite:hover { background: rgba(255,255,255,.16); }
.np-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.np-name { font-size: calc(var(--u) * 2.4); -webkit-text-stroke: 1px var(--ink); paint-order: stroke; }
.role { font-family: var(--font); font-size: max(var(--t-xs), calc(var(--u) * 1.1)); color: #fff; border: 3px solid var(--ink); border-radius: 999px; padding: 0 7px; background: var(--role-col, var(--panel-hi)); }
.np-tro { font-family: var(--font); color: var(--gold); font-size: max(var(--t-xs), calc(var(--u) * 1.5)); display: flex; align-items: center; gap: 4px; }
.np-mode { color: var(--text-dim); font-size: max(var(--t-xs), .85em); margin-left: 4px; }
.power { display: flex; align-items: center; gap: 5px; width: 100%; font-family: var(--font); font-size: max(var(--t-xs), calc(var(--u) * 1.3)); color: var(--text-dim); padding: 0 4px; }
.actions { display: grid; grid-template-columns: 1fr 1fr 1.6fr; gap: calc(var(--u) * 1.2); align-items: stretch; }
.actions .btn { position: relative; font-size: max(var(--t-sm), calc(var(--u) * 2)); }
.btn.gold { background: linear-gradient(#ffd96a, #ffb800); color: #fff; -webkit-text-stroke: 1px var(--ink); }
.bar { flex: 1; height: calc(var(--u) * 1.3); background: var(--panel-2); border: 3px solid var(--ink); border-radius: 999px; overflow: hidden; position: relative; }
.bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#ffe066, #ffb800); border-right: 3px solid var(--ink); }
.bar.shine i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.7) 45%, transparent 60%); background-size: 250% 100%; animation: shine 2.2s linear infinite; }
@keyframes shine { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.taunt { position: absolute; top: 8%; left: 50%; background: #fff; color: var(--ink); font-family: var(--font); border: var(--line) solid var(--ink); border-radius: 14px; padding: 2px 10px; font-size: max(var(--t-sm), calc(var(--u) * 1.8)); pointer-events: none; animation: pop-in 250ms var(--ease-out) both; white-space: nowrap; }
.btn.play { background: linear-gradient(#5ee67a, #2fb84d); color: #fff; font-size: calc(var(--u) * 4.4); letter-spacing: 2px; -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke; }
.btn.play::before { content: ''; position: absolute; inset: calc(var(--u) * -.8); border-radius: calc(var(--radius) + 6px); background: radial-gradient(closest-side, rgba(94, 230, 122, .7), rgba(94, 230, 122, 0)); z-index: -1; animation: play-glow 2.4s ease-in-out infinite; will-change: opacity; pointer-events: none; }
@keyframes play-glow { 0%, 100% { opacity: .15; } 50% { opacity: .9; } }
body.reduce-flash .btn.play::before { animation: none; opacity: .5; }
#lobby #credit { position: absolute; z-index: 3; right: var(--sa-r); bottom: max(1px, env(safe-area-inset-bottom)); color: var(--gold); font-family: var(--font); font-size: 11px; opacity: .95; text-shadow: 0 1px 0 var(--ink), 0 0 3px var(--ink); }

/* profile page */
.pg-profile, .pg-locker { overflow: auto; padding-right: var(--sa-r); }
.phead { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: calc(var(--u) * 1.4) calc(var(--u) * 2.4); margin: calc(var(--u) * 1.2) 0 calc(var(--u) * 2.4); background: #262a40; border-radius: 6px; }
.ph-name .pname { font-size: calc(var(--u) * 3.6); color: #fff; }
.ph-lv { font-family: var(--font); color: var(--text-dim); font-size: max(var(--t-sm), calc(var(--u) * 2)); }
.bigshield { width: calc(var(--u) * 14); height: calc(var(--u) * 15.7); margin: calc(var(--u) * -3) 0; filter: drop-shadow(0 6px 0 var(--ink)); }
.ph-tot { display: flex; justify-content: flex-end; gap: calc(var(--u) * 4); }
.ph-tot div { display: flex; flex-direction: column; align-items: center; font-family: var(--font); color: #fff; }
.ph-tot b { font-weight: 400; font-size: calc(var(--u) * 4); line-height: 1; } .ph-tot span { color: var(--text-dim); font-size: max(var(--t-sm), calc(var(--u) * 1.8)); }
.ribbonhead { display: inline-block; margin: calc(var(--u) * 1) 0 calc(var(--u) * .8); padding: 2px calc(var(--u) * 5) 2px calc(var(--u) * 3); background: linear-gradient(#5aa0ff, #3a7fea); border: var(--line) solid var(--ink); font-family: var(--font); color: #fff; font-size: calc(var(--u) * 2.4); -webkit-text-stroke: 1px var(--ink); paint-order: stroke; clip-path: polygon(3% 0, 100% 0, 97% 100%, 0 100%); box-shadow: var(--drop); }
.stiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: calc(var(--u) * 1.2); margin-bottom: 6px; }
.stiles.six { grid-template-columns: repeat(3, 1fr); }
.stile { background: #262a40; border: var(--line) solid var(--ink); border-radius: 4px; box-shadow: var(--drop); padding: calc(var(--u) * .8) calc(var(--u) * 1.4); display: flex; flex-direction: column; font-family: var(--font); color: #fff; }
.stile b { font-weight: 400; font-size: calc(var(--u) * 3.2); line-height: 1.05; } .stile span { color: var(--text-dim); font-size: max(var(--t-sm), calc(var(--u) * 1.6)); }

/* locker page */
.lockgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(var(--u) * 1) calc(var(--u) * 2.4); padding-top: 4px; }
.lsec { display: flex; flex-direction: column; align-items: center; cursor: default; }
.lsec[data-open], .lsec[data-armory] { cursor: pointer; }
.lsec .ribbonhead { align-self: stretch; text-align: center; }
.ltiles { display: grid; grid-template-columns: repeat(3, calc(var(--u) * 8)); gap: calc(var(--u) * 1); justify-content: center; }
.ltiles.one { grid-template-columns: max(104px, calc(var(--u) * 16)); }
.lsec > .hint { max-width: 26ch; text-align: center; }
.ltile { aspect-ratio: 1; background: linear-gradient(#5aa0ff, #3d7fe0); border: var(--line) solid var(--ink); border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--font); color: #fff; font-size: max(var(--t-xs), calc(var(--u) * 1.3)); text-align: center; overflow: hidden; }
.ltile.big { background: linear-gradient(#a8566a, #8a3f55); aspect-ratio: auto; min-height: calc(var(--u) * 14.5); line-height: 1.1; font-size: max(var(--t-sm), calc(var(--u) * 1.6)); gap: 4px; padding: 4px; }
.ltile.big .ico { font-size: calc(var(--u) * 6); }
.ltile canvas { width: 100%; flex: 1; min-height: 0; }
.ltile.emote { background: linear-gradient(#3a3f5e, #262a40); } .ltile.emote span { color: var(--ec); -webkit-text-stroke: 1px var(--ink); paint-order: stroke; padding: 2px; }

/* portrait phones: tabs along the bottom, the credit on its own line above them, and the play
   page laid out so PLAY is always in view: modes (two per row), your party, then the action bar */
@media (orientation: portrait) {
  #lobby.lobby { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto; grid-template-areas: "top" "page" "credit" "tabs"; }
  .lb-tabs { flex-direction: row; width: auto; border-right: 0; border-top: var(--line) solid var(--ink); padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); overflow: hidden; }
  .lb-page { padding: 8px var(--sa-r) 4px var(--sa-l); }
  #lobby #credit { position: relative; grid-area: credit; justify-self: end; padding: 0 var(--sa-r) 3px; line-height: 1.2; }
  .lb-top { flex-direction: column; align-items: stretch; gap: 6px; padding-right: 0; } .pbanner { min-width: 0; clip-path: none; border-right: 0; padding-right: var(--sa-r); }
  .lb-cur { flex-wrap: nowrap; justify-content: space-between; padding: 0 var(--sa-r) 0 var(--sa-l); } .missions .mt { display: none; } .lb-cur .cur small { display: none; }
  .tabbtn { flex: 1 1 0; min-width: 0; padding: 4px 2px; min-height: max(var(--tap), calc(var(--u) * 8)); border-bottom: 0; border-right: 3px solid var(--ink); font-size: var(--t-xs); text-align: center; }
  .tabbtn:last-child { border-right: 0; } .tabbtn.on { margin-right: 0; }
  .tabchip { position: static; transform: none; order: -1; margin-bottom: 1px; } .tabbtn .ico { font-size: calc(var(--u) * 3); }
  .pg-play { display: flex; flex-direction: column; overflow: hidden; gap: calc(var(--u) * 1.2); }
  .modelist { flex: 0 1 auto; min-height: calc(var(--tap) * 2); display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: minmax(var(--tap), auto); gap: 8px; overflow-y: auto; padding: 6px 6px 8px 6px; }
  .modebtn { min-height: max(var(--tap), calc(var(--u) * 6.4)); max-height: none; padding: 4px 8px; gap: 6px; min-width: 0; } .modebtn .mn small, .modebtn .go { display: none; }
  .modebtn .mn b { font-size: max(var(--t-sm), calc(var(--u) * 2.2)); }
  .fillbots { font-size: max(var(--t-sm), calc(var(--u) * 1.8)); gap: 6px; }
  .party { flex: 1 1 0; min-height: 0; }
  .slots { flex: 1 1 0; min-height: 0; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); } .slot.me .power .bar { display: none; } .slot.me .power { justify-content: space-between; } .slots .invite:last-child { display: none; }
  .actions { flex: none; grid-template-columns: 1fr 1fr; padding-bottom: 8px; /* room for the button shadow and PLAY glow */ } .actions .play { grid-column: span 2; }
  .lockgrid, .stiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lockgrid { gap: calc(var(--u) * 1) calc(var(--u) * 1.2); }
}
/* short upright phones: one action row so the hunter keeps some room */
@media (orientation: portrait) and (max-height: 620px) {
  .actions { grid-template-columns: 1fr 1fr 1.6fr; } .actions .play { grid-column: auto; padding-left: 0; padding-right: 0; }
  .tabbtn { min-height: max(var(--tap), calc(var(--u) * 8.8)); }
}
/* upright phones without much height: your hunter becomes one wide card (friends are a tap away on the FRIENDS tab) */
@media (orientation: portrait) and (max-height: 740px) {
  .slots { grid-template-columns: minmax(0, 1fr); } .slots .invite { display: none; }
  .slot.me { display: grid; grid-template-columns: minmax(0, 36%) minmax(0, 1fr); grid-template-rows: 1fr auto auto 1fr; align-items: center; justify-items: center; gap: 0 6px; padding: 4px 8px; }
  .slot.me #stage { grid-row: 1 / -1; height: 100%; } .slot.me .np-row { grid-area: 2 / 2; } .slot.me .power { grid-area: 3 / 2; } .slot.me .np-tro { grid-area: 4 / 2; align-self: start; }
}
/* phone-width top bar: the TEST tags go (the + button explains test currency) so the rest fits */
@media (max-width: 760px) { .lb-cur .cur small, .guestchip i { display: none; } .guestchip span { display: inline-block; } .guestchip span::first-letter { text-transform: uppercase; } .pbanner { min-width: 0; flex: 1; padding-right: calc(var(--u) * 3); } }
/* short landscape phones: tighter, two invite slots so your hunter's POWER row has room */
@media (orientation: landscape) and (max-height: 430px) {
  .modebtn .mn small { display: none; }
  .tabchip { display: none; } /* no room in a short tab; the mode is named on your hunter's card */
  .modelist { gap: 5px; padding-bottom: 6px; }
  .party { gap: 6px; }
}
@media (orientation: landscape) and (max-width: 760px) {
  .slots { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr); } .slots .invite:last-child { display: none; }
  .slot.me .power .bar { display: none; } .slot.me .power { justify-content: space-between; }
}
/* touch: thumb-sized controls in the lobby */
@media (any-pointer: coarse) {
  .lb-cur .cur { min-height: var(--tap); }
  /* the whole currency chip opens the test-currency note, not just the little + */
  .lb-cur .cur .plus::after { content: ''; position: absolute; inset: -3px; }
  .gear { flex: none; width: max(var(--tap), calc(var(--u) * 5)); height: max(var(--tap), calc(var(--u) * 5)); }
  .tabbtn { min-height: var(--tap); }
  .modebtn, .fillbots, .power { min-height: var(--tap); }
  .ltiles { grid-template-columns: repeat(3, max(var(--tap), calc(var(--u) * 8))); }
  .settings-list label, .ui-pop label.opt, .ui-screen label.opt { min-height: var(--tap); }
  .settings-list { gap: 4px 14px; }
  .ui-screen summary { min-height: var(--tap); display: flex; align-items: center; }
}

/* ---------- full-screen screens ---------- */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(var(--u) * 17), 1fr)); gap: calc(var(--u) * 1.6) calc(var(--u) * 1.2); padding: calc(var(--u) * 3) 4px calc(var(--u) * 2); }
.bcard { cursor: pointer; padding: 0 0 calc(var(--u) * .6); display: flex; flex-direction: column; align-items: center; aspect-ratio: 3 / 3.6; }
.bcard canvas { width: 118%; margin-top: -22%; aspect-ratio: 1; pointer-events: none; }
.bcard .bc-name { font-size: calc(var(--u) * 2.4); margin-top: -6%; }
.bcard .bc-tro { font-family: var(--font); font-size: max(var(--t-sm), calc(var(--u) * 1.5)); color: var(--gold); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
.bcard.sel { outline: 4px solid var(--gold); outline-offset: 3px; }
.bcard .lockv { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(27,16,51,.55); border-radius: var(--radius); font-size: calc(var(--u) * 4); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.detail { position: fixed; inset: 0; z-index: 45; display: flex; align-items: center; justify-content: center; padding: var(--sa-t) var(--sa-r) var(--sa-b) var(--sa-l); background: rgba(27,16,51,.7); perspective: 1200px; }
.detail > .card-b { width: min(980px, 100%); max-height: 100%; overflow: auto; display: grid; grid-template-columns: minmax(0, 38%) 1fr; gap: calc(var(--u) * 1.5); padding: calc(var(--u) * 1.5); }
.detail.enter > .card-b { animation: flip-in 380ms var(--ease-out) both; }
@keyframes flip-in { from { transform: rotateY(-75deg) scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.detail .portrait { width: 100%; aspect-ratio: 1; }
.stats { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 10px; align-items: center; font-family: var(--font); color: #fff; font-size: max(var(--t-sm), calc(var(--u) * 1.7)); }
.stats .num { color: var(--gold); }
.abil { display: grid; grid-template-columns: calc(var(--u) * 13) 1fr; gap: 10px; align-items: center; background: rgba(27,16,51,.45); border: 3px solid var(--ink); border-radius: var(--radius-sm); padding: 6px; margin-top: 8px; }
.abil canvas { width: 100%; aspect-ratio: 16 / 10; border-radius: 8px; border: 3px solid var(--ink); background: #8ee05e; }
.abil h4 { margin: 0; font-family: var(--font); font-weight: 400; color: var(--gold); font-size: max(var(--t-sm), calc(var(--u) * 1.9)); }
.abil p { margin: 2px 0 0; font-family: var(--font-ui); font-weight: 700; font-size: max(var(--t-xs), calc(var(--u) * 1.4)); color: #fff; }
.skinrow { display: flex; gap: 8px; overflow-x: auto; padding: 8px 2px; }
.skinrow .sk { flex: none; width: calc(var(--u) * 11); text-align: center; cursor: pointer; padding: 4px; font-family: var(--font); color: #fff; font-size: max(var(--t-xs), calc(var(--u) * 1.3)); }
.skinrow .sk canvas { width: 100%; aspect-ratio: 1; }
.skinrow .sk.on { outline: 4px solid var(--gold); }

.modes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(calc(var(--u) * 22), 1fr)); gap: calc(var(--u) * 1.4); padding: calc(var(--u) * 1) 6px; height: 100%; }
.mcard { cursor: pointer; padding: calc(var(--u) * .8); display: flex; flex-direction: column; gap: 4px; }
.mcard canvas { width: 100%; flex: 1; min-height: calc(var(--u) * 9); border-radius: 10px; border: 3px solid var(--ink); }
.mcard .mc-name { font-size: calc(var(--u) * 2.6); }
.mcard .mc-desc { font-family: var(--font-ui); font-weight: 700; color: #fff; font-size: max(var(--t-xs), calc(var(--u) * 1.35)); }
.mcard .mc-meta { display: flex; justify-content: space-between; font-family: var(--font); color: var(--gold); font-size: max(var(--t-xs), calc(var(--u) * 1.5)); }
.mcard.sel { outline: 4px solid var(--gold); outline-offset: 3px; }
.events-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; font-family: var(--font); color: var(--text-dim); font-size: max(var(--t-xs), calc(var(--u) * 1.5)); padding: 4px; }
.events-row .ico { font-size: max(var(--t-sm), calc(var(--u) * 1.8)); }

.locker { display: grid; grid-template-columns: minmax(0, 34%) 1fr; grid-template-rows: minmax(0, 1fr); gap: calc(var(--u) * 1.4); height: 100%; min-height: 0; }
.locker .preview { display: flex; flex-direction: column; align-items: center; padding: 8px; min-height: 0; }
/* the canvas takes what is left, so an equipped title never pushes the button out of the card */
.locker .preview canvas { width: 100%; flex: 1 1 0; min-height: 0; }
.locker:not(.armory) .preview { overflow: hidden; } #lkTitle { flex: none; min-height: 1.2em; } #lkFx { flex: none; }
.locker .items { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.locker .items > .chips { flex: none; } .locker .items > .chips:empty { display: none; }
.armory .items > .chips { overflow: visible; }
.pedestals { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(var(--u) * 14), 1fr)); gap: 10px; overflow: auto; padding: 6px 2px 10px; }
.ped { padding: 4px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; font-family: var(--font); color: #fff; font-size: max(var(--t-xs), calc(var(--u) * 1.5)); text-align: center; }
.ped canvas { width: 100%; aspect-ratio: 1; }
.ped.on { outline: 4px solid var(--gold); }
/* (display + margin: an old short-screen rule in style.css hides bare .tag, which hid EQUIPPED on phones) */
.ped .tag { display: inline-flex; align-items: center; gap: 3px; margin: 0; font-size: max(var(--t-xs), .8em); color: var(--gold); }
.ped .tag .ico { width: 1.1em; height: 1.1em; }

.pass-wrap { display: flex; flex-direction: column; gap: 8px; height: 100%; min-height: 0; }
.pass-top { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.pass-top .bar { min-width: 200px; height: calc(var(--u) * 2); }
.track { flex: 1; min-height: 0; overflow-x: auto; overflow-y: hidden; display: flex; gap: 8px; padding: 8px 4px 12px; scroll-behavior: smooth; }
.tier { flex: none; width: max(88px, calc(var(--u) * 13)); display: grid; grid-template-rows: 1fr auto 1fr; gap: 6px; }
.tier .num { text-align: center; font-family: var(--font); color: var(--text-dim); font-size: max(var(--t-sm), calc(var(--u) * 2)); }
.tier.reached .num { color: var(--gold); }
.rw { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px; font-family: var(--font); color: #fff; font-size: max(var(--t-sm), calc(var(--u) * 1.35)); text-align: center; position: relative; }
.rw .ico { font-size: calc(var(--u) * 3); }
.rw.premium { --card-col: #8f5cff; }
.rw.free { --card-col: #3a86ff; }
.rw.got { opacity: .5; }
.rw.locked { filter: saturate(.4) brightness(.8); }
.rw .claim { margin-top: 2px; }

.road-wrap { position: relative; height: 100%; overflow-y: auto; overflow-x: hidden; }
.road-svg { display: block; margin: 0 auto; }
.node { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 8px; }
.node .disc { width: calc(var(--u) * 6); height: calc(var(--u) * 6); border-radius: 50%; border: var(--line) solid var(--ink); background: var(--panel-2); display: flex; align-items: center; justify-content: center; font-family: var(--font); color: #fff; font-size: max(var(--t-sm), calc(var(--u) * 1.6)); box-shadow: var(--drop); }
.node.reached .disc { background: var(--gold); color: var(--ink); }
.node .rlabel { font-family: var(--font); color: #fff; font-size: max(var(--t-sm), calc(var(--u) * 1.6)); white-space: nowrap; background: rgba(27,16,51,.7); border: 3px solid var(--ink); border-radius: 10px; padding: 2px 8px; display: flex; gap: 6px; align-items: center; }
.node.left .rlabel { order: -1; }
.marker { position: absolute; transform: translate(-50%, -50%); width: calc(var(--u) * 7); height: calc(var(--u) * 7); border-radius: 50%; background: radial-gradient(circle, rgba(255,230,120,.9), rgba(255,210,63,0) 70%); animation: marker 1.4s ease-in-out infinite; pointer-events: none; }
@keyframes marker { 50% { transform: translate(-50%, -50%) scale(1.25); } }
body.reduce-flash .marker { animation: none; }
.missionlist { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; text-align: left; }
.mission { font-size: max(var(--t-sm), calc(var(--u) * 1.8)); display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; background: var(--panel-2); border: 3px solid var(--ink); border-radius: var(--radius-sm); padding: 6px 10px; font-family: var(--font); color: #fff; }
.mission .bar { grid-column: 1; height: 12px; }
.settings-list { display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: center; text-align: left; font-family: var(--font); color: #fff; font-size: max(var(--t-sm), calc(var(--u) * 1.9)); }
.settings-list input[type=checkbox] { flex: none; width: 26px; height: 26px; accent-color: var(--gold); }
.stat-table { width: 100%; border-collapse: collapse; font-family: var(--font-ui); font-weight: 700; color: #fff; font-size: max(var(--t-xs), calc(var(--u) * 1.5)); }
.stat-table th { font-family: var(--font); font-weight: 400; color: var(--gold); }
.zone-table { width: 100%; border-collapse: collapse; font-family: var(--font-ui); font-weight: 700; color: #fff; font-size: max(var(--t-xs), calc(var(--u) * 1.5)); } /* Free Play table: same look */
.zone-table th { font-family: var(--font); font-weight: 400; color: var(--gold); } .zone-table td, .zone-table th,
.stat-table td, .stat-table th { padding: 3px 6px; border-bottom: 2px solid rgba(27,16,51,.4); }

/* matchmaking + intro + results */
.mm { position: fixed; inset: 0; z-index: 35; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--u) * 1.2); background: radial-gradient(circle at 50% 45%, #5b37b8, #1b1033 75%); padding: var(--sa-t) var(--sa-r) var(--sa-b) var(--sa-l); }
.mm canvas { width: min(46vh, 60vw); aspect-ratio: 1; }
.mm .found { font-size: calc(var(--u) * 4); }
.mm .tip { font-family: var(--font-ui); font-weight: 700; color: var(--text-dim); font-size: max(var(--t-sm), calc(var(--u) * 1.6)); min-height: 1.4em; text-align: center; max-width: 80vw; transition: opacity .3s; }
.mm .mmmode { font-family: var(--font); color: #fff; font-size: max(var(--t-sm), calc(var(--u) * 2.2)); }
/* friend room: the radar column moves left, the room card sits on the right */
.mm.room { padding-right: calc(var(--sa-r) + min(36vw, 360px) + 24px); }
.mmroom { position: absolute; right: calc(var(--sa-r) + 16px); top: 50%; transform: translateY(-50%); width: min(36vw, 360px); max-height: calc(100% - 32px); overflow: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; color: #fff; font-family: var(--font); }
.mmroom > small { font-size: max(var(--t-xs), .8em); color: var(--text-dim); letter-spacing: .08em; }
.mmcode { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mmcode b { font-size: calc(var(--u) * 5); letter-spacing: .08em; color: var(--gold); text-shadow: 0 3px 0 #1b1033; user-select: all; }
.mmlist { margin: 0; padding: 0 0 0 1.4em; font-size: max(var(--t-sm), calc(var(--u) * 2)); line-height: 1.5; }
.mmlist small { font-size: max(var(--t-xs), .65em); color: var(--gold); }
.mmhost { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.mmhost[hidden] { display: none; }
.mmwait { font-size: max(var(--t-sm), calc(var(--u) * 1.8)); color: var(--text-dim); }
.mmcredit { position: absolute; right: max(10px, var(--sa-r)); bottom: max(3px, var(--sa-b)); font: 400 var(--t-xs) "Lilita One", sans-serif; color: #ffd23f; opacity: .55; pointer-events: none; }
.intro { position: fixed; inset: 0; z-index: 36; pointer-events: none; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(105deg, rgba(58,134,255,.92) 0 48%, var(--ink) 48% 52%, rgba(255,40,70,.92) 52%); }
.intro.enter { animation: intro-in 2.2s ease both; }
@keyframes intro-in { 0% { clip-path: inset(0 50% 0 50%); } 15% { clip-path: inset(0 0 0 0); } 85% { clip-path: inset(0 0 0 0); opacity: 1; } 100% { opacity: 0; } }
.intro .vs { font-size: calc(var(--u) * 12); line-height: 1; }
.intro .entering { font-size: calc(var(--u) * 4); color: #fff; }
.intro .entering b { color: var(--gold); font-weight: 400; }
.intro .imode { font-family: var(--font); color: var(--ink); background: var(--gold); border: var(--line) solid var(--ink); border-radius: 999px; padding: 2px 16px; font-size: max(var(--t-sm), calc(var(--u) * 2.2)); margin-top: 8px; }
.intro canvas { max-width: 60vw; } /* upright phones: 48vh is wider than the screen */
.res { position: fixed; inset: 0; z-index: 34; display: grid; grid-template-columns: minmax(0, 40%) 1fr; gap: calc(var(--u) * 2); align-items: center; padding: var(--sa-t) var(--sa-r) var(--sa-b) var(--sa-l); background: radial-gradient(circle at 30% 50%, #6a3fd0, #1b1033 80%); }
.res .left { display: flex; flex-direction: column; align-items: center; min-height: 0; height: 100%; justify-content: center; }
.res .rank { font-size: calc(var(--u) * 13); line-height: 1; }
.res .rank.slam { animation: slam .55s cubic-bezier(.2, 1.4, .3, 1) both; }
@keyframes slam { 0% { transform: scale(3) rotate(-8deg); opacity: 0; } 60% { transform: scale(.92); opacity: 1; } 100% { transform: none; } }
.res .posecv { width: 100%; flex: 1; min-height: 0; max-height: 52vh; }
.res .right { display: flex; flex-direction: column; gap: calc(var(--u) * 1); min-height: 0; max-height: 100%; overflow: auto; padding: 6px; }
.res .rmsg { font-family: var(--font); color: #fff; font-size: calc(var(--u) * 2.4); }
.res .gain { display: flex; gap: 10px; flex-wrap: wrap; }
.res .gain .cur { font-size: calc(var(--u) * 2.6); }
.res .xp { display: flex; align-items: center; gap: 8px; font-family: var(--font); color: #fff; font-size: max(var(--t-sm), calc(var(--u) * 1.8)); }
.res .xp .bar { height: calc(var(--u) * 2); }
.res .btns { display: flex; gap: 10px; margin-top: auto; }
.res #mvp { align-self: flex-start; }
.res .rlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 10px; font-family: var(--font); color: #fff; font-size: max(var(--t-xs), calc(var(--u) * 1.5)); }
.res .rlist li { background: var(--panel-2); border: 3px solid var(--ink); border-radius: 10px; padding: 1px 8px; display: flex; gap: 6px; }
.res .rlist li.me { background: var(--panel-hi); }
.res .rlist .r { color: var(--gold); }
.res .rlist .k { margin-left: auto; opacity: .85; }
@media (orientation: portrait) { .res { grid-template-columns: 1fr; } .detail > .card-b, .locker { grid-template-columns: 1fr; } }

.res .rlist { font-size: max(var(--t-xs), calc(var(--u) * 1.4)); }
.res .rlist li { white-space: nowrap; overflow: hidden; }
.res .rlist li .k { flex: none; }
.res .gain .cur b { min-width: 0; }

.ui-body.modes { display: flex; flex-direction: column; overflow: hidden; }
.ui-body.modes .modes-grid { flex: 1; min-height: 0; height: auto; }
.ui-body.modes .events-row { flex: none; }

/* ARMORY */
.armory .preview { gap: 2px; overflow: auto; }
.armory .stats { width: 100%; display: grid; grid-template-columns: 1fr; gap: 3px; font-size: inherit; }
.statrow { width: 100%; display: grid; grid-template-columns: minmax(calc(var(--u) * 9), auto) 1fr minmax(calc(var(--u) * 7), auto); gap: 6px; align-items: center; font-family: var(--font); color: #fff; font-size: max(var(--t-sm), calc(var(--u) * 1.3)); }
.statrow b { text-align: right; color: var(--gold); font-weight: normal; }
.statrow .bar { height: max(11px, calc(var(--u) * 1.3)); border-width: 2px; }
.perks { width: 100%; display: grid; gap: 4px; margin-top: 6px; }
.perkrow { display: grid; grid-template-columns: minmax(calc(var(--u) * 3.4), auto) 1fr 1fr; gap: 8px; align-items: center; font-family: var(--font); color: #fff; font-size: max(var(--t-sm), calc(var(--u) * 1.3)); }
.perkrow .chipbtn { white-space: normal; min-width: 0; padding-left: 6px; padding-right: 6px; line-height: 1.05; }
.perkrow .chipbtn[disabled] { opacity: .4; }
.armory .ped canvas { aspect-ratio: 2; flex: none; }
.armory .ped { justify-content: flex-start; min-height: 0; }
.armory .pedestals { grid-auto-rows: min-content; }
.armory .ped .tag { white-space: nowrap; font-size: max(var(--t-xs), .75em); display: flex; align-items: center; gap: 3px; }
.armory .ped .tag .ico, .armory .ped .tag svg { width: 1.1em; height: 1.1em; }
.lvups { font-family: var(--font); color: #fff; font-size: max(var(--t-xs), calc(var(--u) * 1.4)); display: grid; gap: 2px; margin-top: 4px; }
.lvups b { color: var(--gold); font-weight: normal; }
.power .btn { padding: 2px 8px; font-size: max(var(--t-xs), .9em); flex: none; } .power .bar { min-width: 0; }
.pwlv { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.pwnum { font-family: var(--font); font-size: calc(var(--u) * 4.2); color: var(--gold); -webkit-text-stroke: 2px var(--ink); min-width: 2ch; text-align: center; }
.pwpick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 6px 0; }
.pwpick .pwhead { grid-column: 1 / -1; font-family: var(--font); color: #fff; font-size: max(var(--t-sm), calc(var(--u) * 1.6)); text-align: left; }
.pwpick .chipbtn { text-align: left; line-height: 1.15; padding: 6px 8px; white-space: normal; }
.pwpick .chipbtn small { font-family: system-ui, sans-serif; opacity: .85; font-size: max(var(--t-xs), .85em); }
.pwpick .pwhead small { font-size: max(var(--t-xs), .85em); }
.pwpick .chipbtn[disabled] { opacity: .45; }
.mxp { margin-top: 4px; }
.coinsline { font-family: var(--font); color: var(--gold); font-size: max(var(--t-sm), calc(var(--u) * 1.6)); }
.ucards { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; perspective: 600px; }
.ucard { min-width: calc(var(--u) * 12); padding: 6px 10px; border: 3px solid var(--ink); border-radius: 12px; background: var(--panel-2); box-shadow: inset 0 -4px 0 var(--uc);
  display: flex; flex-direction: column; font-family: var(--font); color: #fff; text-align: center; animation: ureveal .55s cubic-bezier(.2,1.4,.4,1) both; }
/* visible by default: 'both' hides a card only until its reveal plays, so with Reduce Flashing (no animations) it is simply there */
body.reduce-flash .ucard { opacity: 1; transform: none; }
.ucard { font-size: var(--t-sm); } .ucard small { color: var(--uc); font-size: var(--t-xs); } .ucard b { font-weight: normal; font-size: 1.1em; } .ucard span { font-size: var(--t-xs); opacity: .85; }
@keyframes ureveal { from { opacity: 0; transform: rotateY(90deg) scale(.6); } to { opacity: 1; transform: none; } }

/* ---------- primary actions stay in view on short screens ---------- */
.ui-pop > .card-a > [data-close] { position: sticky; bottom: 0; z-index: 2; box-shadow: var(--drop), 0 0 0 8px var(--panel); margin-top: 8px; }
.ui-pop > .card-a > [data-close]:active { box-shadow: var(--drop-press), 0 0 0 8px var(--panel); }
.detail-actions .btn { flex: 0 1 auto; padding-left: calc(var(--u) * 1.4); padding-right: calc(var(--u) * 1.4); }
.detail-actions { position: sticky; bottom: calc(var(--u) * -1.5); z-index: 2; display: flex; gap: 8px; justify-content: flex-end; margin: auto calc(var(--u) * -1.5) calc(var(--u) * -1.5); padding: 8px calc(var(--u) * 1.5) calc(var(--u) * 1.5 + 5px); background: linear-gradient(transparent, rgba(18, 9, 30, .82) 30%); border-radius: 0 0 calc(var(--radius) - 4px) 0; }
.ar-actions { position: sticky; bottom: -8px; z-index: 2; flex: none; width: calc(100% + 16px); display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: auto -8px -8px; padding: 8px 8px 13px; background: linear-gradient(transparent, var(--panel) 28%); }
.res .btns { position: sticky; bottom: -6px; z-index: 2; padding: 8px 0 11px; margin-bottom: -6px; background: linear-gradient(transparent, rgba(27, 16, 51, .9) 30%); }
.stile.tap { cursor: pointer; }
.detail .np-tro { display: inline-flex; vertical-align: middle; }
/* short screens: a full-width CLOSE so the text scrolling under it is cleanly covered */
@media (max-height: 480px) { .ui-pop > .card-a > [data-close] { display: flex; width: 100%; } }
@media (orientation: portrait) {
  .detail .portrait { aspect-ratio: auto; height: 24vh; }
  .locker { grid-template-rows: minmax(0, 34%) minmax(0, 1fr); } .armory { grid-template-rows: minmax(0, 46%) minmax(0, 1fr); }
  .detail .np-tro { display: inline-flex; }
  .res { grid-template-rows: minmax(0, 36%) minmax(0, 1fr); align-items: stretch; }
  .ui-head { flex-wrap: wrap; } .ui-head .chips { flex: 1 0 100%; order: 3; }
}

/* ---------- lobby behaviour (previews, NEW tags, earned-only items, focus) ---------- */
.armory .ped { position: relative; }
.newtag { position: absolute; top: 4px; left: 4px; z-index: 1; background: var(--red); color: #fff; border: 3px solid var(--ink); border-radius: 999px; padding: 1px 7px; font-family: var(--font); font-size: max(var(--t-xs), calc(var(--u) * 1.2)); }
.ped.peek:not(.on) { outline: 3px dashed var(--gold); outline-offset: -3px; }
.ped .tag.earn { color: #fff; opacity: .9; text-align: center; white-space: normal; }
/* mode buttons only pick a mode (PLAY starts): a tick on the picked one, not a play arrow */
.modebtn .go { clip-path: none; border-radius: 50%; padding: 0; background: rgba(18, 9, 30, .35); border-color: rgba(18, 9, 30, .6); color: var(--ink); font-size: calc(var(--u) * 2.2); }
.modebtn.sel .go { background: #fff; border-color: var(--ink); }
.modebtn.sel .go::after { content: '✓'; }
/* keyboard focus: a clear white ring on every control, text fields included */
:focus { outline: none; }
:focus-visible, input:focus-visible, .field:focus-visible, textarea:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
input:focus-visible, .field:focus-visible { outline-offset: 1px; box-shadow: 0 0 0 6px var(--ink); }
.ui-screen:focus-visible, .ui-pop:focus-visible, .detail:focus-visible { outline: none; }

/* ---------- HUNT RACERS: play page (modes, track with its preview, your driver's car), driver
   select, track picker, race friends ---------- */
.lobby.racing .trackbtn .tpv { flex: none; width: calc(var(--u) * 8); height: calc(var(--u) * 5); min-height: 26px; min-width: 40px; border: 3px solid var(--ink); border-radius: 6px; background: #12091e; pointer-events: none; }
.lobby.racing .trackbtn { --mc: #2b9c6c; }
.lobby.racing .fillbots.na { opacity: .45; }
.np-car { font-family: var(--font-ui); font-weight: 700; color: var(--text-dim); font-size: max(var(--t-xs), calc(var(--u) * 1.35)); text-align: center; line-height: 1.15; }
@media (orientation: portrait) {
  .lobby.racing .trackbtn { grid-column: span 2; }
  .lobby.racing .modelist { grid-auto-rows: minmax(var(--tap), auto); }
}
@media (orientation: portrait) and (max-height: 740px) {
  .lobby.racing .slot.me .np-car { grid-area: 3 / 2; }
}
.grid-cards.drivers .dcard { aspect-ratio: auto; padding: calc(var(--u) * .8) 4px calc(var(--u) * .8); gap: 2px; }
.dcard canvas { width: 100%; aspect-ratio: 4 / 3; margin: 0; }
.dcard .bc-name { margin-top: 0; }
.dcard .dc-car { font-family: var(--font-ui); font-weight: 700; color: #fff; font-size: max(var(--t-xs), calc(var(--u) * 1.4)); text-align: center; }
.detail.driver .dd-car { font-family: var(--font); color: var(--gold); font-size: max(var(--t-sm), calc(var(--u) * 2.6)); -webkit-text-stroke: 1px var(--ink); paint-order: stroke; }
.detail.driver .abil canvas { background: #3b3550; }
.track-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, calc(var(--u) * 24)), 1fr)); gap: calc(var(--u) * 1.6); padding: calc(var(--u) * 2) 4px; }
.tcard { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 6px 6px 8px; cursor: pointer; color: #fff; font-family: var(--font); text-align: left; min-height: var(--tap); }
.tcard canvas { width: 100%; aspect-ratio: 16 / 9; border: 3px solid var(--ink); border-radius: 8px; background: #12091e; pointer-events: none; }
.tcard .tc-name { font-size: max(var(--t-sm), calc(var(--u) * 2.4)); }
.tcard .tc-sub { font: 700 max(var(--t-xs), calc(var(--u) * 1.4)) var(--font-ui); color: var(--text-dim); }
.tcard.sel { outline: 4px solid var(--gold); outline-offset: 3px; }
@media (orientation: landscape) and (max-height: 430px) { .track-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: 8px; } .tcard canvas { aspect-ratio: 2 / 1; } }
.racefriends .rf-help { color: #fff; font-size: max(var(--t-sm), calc(var(--u) * 1.6)); margin: 2px 0 4px; max-width: 34em; }
.racefriends .rf-row { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; margin: 4px 0; }
.racefriends .rf-chips { justify-content: center; margin: 4px 0; }
.racefriends .fillbots { min-height: var(--tap); }
.racefriends .rf-row .btn { min-height: var(--tap); }

/* the racing lobby's tiled pattern: steering wheel, chequered flag, star, bolt */
#lobby.lobby.racing { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='none' stroke='%232a1a6a' stroke-opacity='.28' stroke-width='5' stroke-linejoin='round' stroke-linecap='round'%3E%3Ccircle cx='40' cy='40' r='20'/%3E%3Ccircle cx='40' cy='40' r='5'/%3E%3Cpath d='M40 45v15M35 38l-14-4M45 38l14-4'/%3E%3Cpath d='M122 70V18h34v24h-34M133 18v24M144 18v24M122 30h34'/%3E%3Cpath d='M126 128l6 13 14 2-10 10 3 14-13-7-13 7 3-14-10-10 14-2z'/%3E%3Cpath d='M48 108l-14 24h13l-7 22 21-28H48l8-18z'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(ellipse at 60% 40%, #7a63dc 0%, #5a45b8 55%, #3d2c8a 100%); }
.lobby.racing .modebtn.sel .mn small { display: block; } /* the picked mode always says what it is */
@media (orientation: portrait) and (min-height: 741px) { .lobby.racing .modebtn .mn small { display: block; } }
/* driver cards: the four car stats as small bars + the built-in weapon */
.dcard .dc-stats { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; padding: 2px 8px; font: 700 var(--t-xs)/1.15 var(--font-ui); color: #fff; }
.dcard .dc-stats span { margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcard .dc-stats i { display: block; height: 6px; border-radius: 3px; background: rgba(18,9,30,.55); overflow: hidden; }
.dcard .dc-stats b { display: block; height: 100%; background: #fff; border-radius: 3px; }
.dcard .dc-wpn { font-family: var(--font); color: #fff; font-size: max(var(--t-xs), calc(var(--u) * 1.4)); -webkit-text-stroke: 1px var(--ink); paint-order: stroke; }
.racefriends .rf-chips { flex-wrap: wrap; overflow: visible; }
.racefriends .rf-chips .chipbtn { min-height: var(--tap); }
.racefriends #roomPlay { min-width: calc(var(--tap) * 2); }
.grid-cards.drivers { grid-template-columns: repeat(auto-fit, minmax(calc(var(--u) * 17), 1fr)); }
.dcard .dc-stats { padding: 2px 6px; letter-spacing: -.01em; }
/* short landscape phones: four modes + track + FILL WITH BOTS fit without scrolling */
@media (orientation: landscape) and (max-height: 430px) { .lobby.racing .modelist { gap: 3px; padding: 3px 8px 4px 4px; } }
/* upright phones: three driver cards a row, so all six fit on one screen */
@media (orientation: portrait) { .grid-cards.drivers { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 12px; } }
/* short upright phones: the track and FILL WITH BOTS share a row, so your car card keeps its room */
@media (orientation: portrait) and (max-height: 740px) {
  .lobby.racing .trackbtn { grid-column: auto; }
  .lobby.racing .trackbtn .tpv { width: 40px; height: 28px; }
  .lobby.racing .modelist .fillbots { padding: 0 4px; }
}
/* tall screens (tablets, desktop): your driver's stats on the car card */
.np-stats { display: none; }
@media (min-height: 700px) and (orientation: landscape) {
  .lobby.racing .np-stats { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; width: min(100%, 260px); padding: 4px 10px 6px; font: 700 max(var(--t-xs), calc(var(--u) * 1.4)) var(--font-ui); color: var(--text-dim); }
  .lobby.racing .np-stats i { display: block; height: 7px; border-radius: 4px; background: rgba(255,255,255,.12); overflow: hidden; }
  .lobby.racing .np-stats b { display: block; height: 100%; border-radius: 4px; background: var(--gold); }
}

/* GARAGE: the 8 unlockable cars (rarity glow: a slow breathe, steady under Reduce Flashing) and locked cars */
.dcard { position: relative; }
.dcard.rar { box-shadow: 0 0 0 2px var(--rar), 0 0 16px var(--rar); animation: rar-breathe 2.6s ease-in-out infinite; }
@keyframes rar-breathe { 50% { box-shadow: 0 0 0 2px var(--rar), 0 0 26px var(--rar); } }
body.reduce-flash .dcard.rar, body.reduce-flash .detail.rar > .card-b { animation: none; }
.dcard.locked canvas { opacity: .55; filter: saturate(.6); }
.dcard.locked .dc-rar::after { content: ' · LOCKED'; }
.detail [data-locked] { opacity: .55; filter: grayscale(.7); cursor: default; }
.dc-rar { display: inline-block; padding: 1px 8px; border-radius: 999px; font: 700 var(--t-xs)/1.3 var(--font-ui); letter-spacing: .14em; color: #06040c; background: var(--rar); box-shadow: 0 0 8px var(--rar); }
.dcard .dc-rar { position: absolute; top: 6px; left: 6px; }
.dc-lock { width: 100%; padding: 2px 8px 0; display: flex; flex-direction: column; gap: 3px; }
.dc-need { font: 700 var(--t-xs)/1.2 var(--font-ui); color: #fff; text-align: center; }
.dc-prog { display: block; height: 8px; border-radius: 4px; background: rgba(18,9,30,.7); border: 1px solid rgba(255,255,255,.25); overflow: hidden; }
.dc-prog b { display: block; height: 100%; background: var(--rar, var(--gold)); border-radius: 3px; }
.detail.rar > .card-b { box-shadow: 0 0 0 3px var(--rar), 0 0 30px var(--rar); }
.detail .dd-perk { font: 700 var(--t-sm)/1.3 var(--font-ui); color: #fff; } .detail .dd-perk b { color: var(--rar, var(--gold)); letter-spacing: .1em; margin-right: 6px; }
.detail .dd-lock { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 10px; background: rgba(18,9,30,.55); }
.detail .dd-lock h4 { margin: 0; font: 700 var(--t-sm)/1.2 var(--font-ui); letter-spacing: .12em; color: var(--rar, var(--gold)); }
.detail .dd-need, .detail .dd-ch { display: grid; grid-template-columns: minmax(0, 1fr) 30% auto; align-items: center; gap: 8px; font: 700 var(--t-xs)/1.25 var(--font-ui); color: #fff; }
.detail .dd-ch { grid-template-columns: minmax(0, 1fr) auto; color: #d9ccff; }
.detail .dd-or { font: 700 var(--t-xs)/1.25 var(--font-ui); color: #d9ccff; }
