/* Single dark world, same tokens as the club site: navy grid, lime pixel type, orange accents. */
:root {
  --bg: #070b14; --panel: rgba(11, 18, 32, .92); --panel-solid: #0b1220; --line: #273347; --text: #e8eadf;
  --muted: #8f9cb3; --lime: #c9db4c; --orange: #e8833a; --gold: #e3b341; --red: #ef6b55;
  --mono: 'Courier New', Courier, 'Nimbus Mono PS', 'Liberation Mono', ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 13px/1.5 var(--mono); overflow: hidden; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
body.pad-hints :focus, body.pad-hints .pad-focus {
  outline: 3px solid var(--lime);
  outline-offset: 3px;
  box-shadow: 0 0 0 2px #070b14, 0 0 12px rgba(201, 219, 76, .55);
}
.pad-glyph {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.15em; height: 1.15em; padding: 0 .28em; margin: 0 .12em;
  border: 1px solid var(--lime); border-radius: 3px; background: #121a10;
  color: var(--lime); font: 700 10px/1.15 var(--mono); letter-spacing: .04em;
  vertical-align: middle;
}
.pad-glyph.pad-playstation { border-radius: 999px; color: #d8e4ff; border-color: #8fb3ff; background: #101628; }
.realm-ability-glyph {
  position: relative; z-index: 2; margin-top: 3px; min-width: 28px; padding: 2px 6px;
  border: 1px solid currentColor; border-radius: 4px; font-size: 11px; letter-spacing: .08em;
  background: rgba(10, 7, 16, .72);
}
.realm-ability-glyph.is-cooling { filter: grayscale(.4); opacity: .85; }
.realm-ability-button.pad-hints { padding-bottom: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.px { display: inline-block; line-height: 0; }
.px svg { height: 1em; width: auto; max-width: 100%; display: block; }
.gate-card h1 .px { display: block; }
.gate-card h1 .px + .px { margin-top: .22em; }
#view { position: fixed; inset: 0; display: block; image-rendering: pixelated; touch-action: none; cursor: crosshair; }

/* ---------------------------------------------------------- gate */
#gate { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; overflow-y: auto;
  /* The live plaza shows through behind the card. */
  background: radial-gradient(ellipse at center, rgba(7, 11, 20, .35) 0%, rgba(7, 11, 20, .78) 75%); }
.gate-live { font-size: 11px; color: var(--lime); letter-spacing: .06em; margin: -4px 0 12px; }
.gate-live::before { content: ''; display: inline-block; width: 7px; height: 7px; background: var(--red); margin-right: 7px; vertical-align: 1px; animation: live-dot 1.6s steps(2, end) infinite; }
@keyframes live-dot { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .gate-live::before { animation: none; } }
.gate-card { width: min(560px, 100%); background: var(--panel-solid); border: 1px solid var(--lime); padding: 22px 18px; }
.gate-card h1 { font-size: clamp(30px, 9vw, 48px); color: var(--lime); margin: 0 0 6px; font-weight: 400; }
.gate-card h2 { font-size: 22px; margin: 0 0 6px; font-weight: 400; }
.rule { height: 2px; background: var(--orange); width: 60%; margin: 16px 0; border: 0; }
.lede { color: var(--muted); text-transform: uppercase; font-size: 12px; letter-spacing: .03em; line-height: 1.9; margin: 0 0 16px; }
.steps { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; font-size: 12px; min-height: 0; }
.steps li { display: flex; gap: 10px; align-items: center; text-transform: uppercase; }
.steps li::before { content: ''; width: 10px; height: 10px; flex: none; border: 1px solid var(--line); }
.steps li.on::before { background: var(--orange); border-color: var(--orange); }
.steps li.done::before { background: var(--lime); border-color: var(--lime); }
.steps li.fail { color: var(--red); }
.steps li.fail::before { background: var(--red); border-color: var(--red); }
.lede-tight { margin: 8px 0 0; }
.gate-google { display: grid; gap: 8px; margin: 0 0 10px; }
.gate-google .btn { width: 100%; }
.gate-dev { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); letter-spacing: .06em; }
.gate-dev input { flex: 1; min-width: 0; background: #0e1727; border: 1px solid var(--line); color: var(--text, #eef4d8); padding: 8px 10px; font: inherit; font-size: 13px; }
.gate-error { border: 1px solid var(--red); color: var(--red); padding: 10px 12px; font-size: 12px; margin: 0 0 14px; }
.gate-error a { color: var(--lime); }
.wallets { display: grid; gap: 8px; margin: 0 0 14px; }
.wallet { display: flex; align-items: center; gap: 12px; padding: 12px; background: #0e1727; border: 1px solid var(--line); cursor: pointer; min-height: 48px; font-weight: 700; text-align: left; }
.wallet:hover { border-color: var(--lime); }
.wallet small { display: block; font-weight: 400; font-size: 10px; color: var(--muted); letter-spacing: .04em; margin-top: 2px; }
.wallets-title { font-size: 11px; color: var(--muted); letter-spacing: .06em; margin: 0 0 2px; }
.conn { position: fixed; inset: 0; z-index: 30; display: grid; place-content: center; gap: 16px; text-align: center; padding: 16px; background: rgba(7,11,20,.82); }
.conn p { margin: 0; color: var(--orange); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; max-width: 420px; }
.btn { appearance: none; border: 0; cursor: pointer; background: var(--lime); color: #0a0f05; font-weight: 700; font-size: 13px;
  letter-spacing: .05em; text-transform: uppercase; padding: 12px 18px; min-height: 44px; box-shadow: 4px 4px 0 var(--orange); width: 100%; }
.btn:hover:not(:disabled) { background: #d6e85e; }
a.btn { display: inline-block; text-decoration: none; text-align: center; }
.rot.forever { color: #ffd25e; border-color: #ffd25e; }
.rot.forever.on { background: #ffd25e; color: #0b0f1a; }
.modal-card.forever-card { border-color: #ffd25e; }
.modal-card.forever-card h3 { color: #ffd25e; }
.cm-perks { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.cm-status { color: var(--orange); min-height: 1em; }
.imd-card canvas { width: 100%; height: auto; image-rendering: pixelated; border: 2px solid #2a3240; background: #0e1626; }
.imd-links { width: 100%; }
.imd-links .btn { width: auto; flex: 1 1 140px; }
.imd-price { margin: 0; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.imd-price b { font-size: 22px; color: var(--text, #e8eadf); }
.imd-price .up { color: #4fd17a; } .imd-price .down { color: var(--red); }
.b-art.agent-art canvas { width: 132px; height: 108px; image-rendering: pixelated; }
.btn:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--orange); }
.btn:disabled { background: var(--line); color: var(--muted); box-shadow: 4px 4px 0 #1b2535; cursor: default; }
.btn.pending, .btn.pending:disabled { cursor: wait; }
.fine { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin: 16px 0 0; }
.fine a, .modal-text a { color: var(--lime); text-decoration: none; border-bottom: 1px dashed currentColor; }
.fine a:hover, .fine a:focus-visible { color: var(--text); }
.pick-tabs { display: flex; margin-top: 14px; }
.pick-tabs button { flex: 1; background: none; border: 1px solid var(--line); color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .05em; padding: 10px 6px; min-height: 44px; cursor: pointer; }
.pick-tabs button.on { color: var(--lime); border-color: var(--lime); box-shadow: inset 0 -3px 0 var(--lime); }
.pick-empty { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 14px 0 18px; }
.pick-grid[hidden] { display: none; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin: 14px 0 18px; }
.pcard { background: #0e1727; border: 1px solid var(--line); padding: 8px; display: flex; flex-direction: column; gap: 6px; align-items: stretch; cursor: pointer; text-align: left; }
.pcard .art { aspect-ratio: 1; background: #1b2535; display: grid; place-items: center; color: var(--muted); font-size: 34px; font-weight: 700; max-width: 100%; }
.pcard .art canvas { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.pcard.sel { border-color: var(--lime); box-shadow: inset 0 -3px 0 var(--lime); }
.pcard:hover:not(.locked) { border-color: var(--orange); }
.pcard.locked { cursor: not-allowed; opacity: .55; }
.pid { font-weight: 700; font-size: 13px; color: var(--lime); }
.pcard.locked .pid { color: var(--muted); }
.pst { font-size: 10px; color: var(--muted); letter-spacing: .05em; }

/* ---------------------------------------------------------- HUD */
#hud { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
#hud > * { pointer-events: auto; }
.top { position: absolute; top: env(safe-area-inset-top, 0px); left: 0; right: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  justify-content: space-between; padding: 10px 12px; background: linear-gradient(rgba(7,11,20,.9), rgba(7,11,20,0)); pointer-events: none; }
.top > * { pointer-events: auto; }
.brand { color: var(--lime); font-size: 16px; display: flex; align-items: center; gap: 10px; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: .1em; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { background: var(--panel); border: 1px solid var(--line); padding: 4px 8px; font-size: 11px; letter-spacing: .05em; white-space: nowrap; }
.chip b { font-size: 13px; margin-left: 4px; font-variant-numeric: tabular-nums; }
.chip.wood b { color: var(--gold); } .chip.stone b { color: #c9d2e0; }
.chip.badge { color: var(--lime); border-color: var(--lime); font-weight: 700; }
.chip.clock { color: var(--orange); }
.chip.travel { display: inline-flex; align-items: center; gap: 2px; padding: 0 2px; }
.chip.travel button { background: none; border: 0; color: var(--lime); font: inherit; font-weight: 700; padding: 4px 7px; min-height: 28px; cursor: pointer; }
.chip.travel button:disabled { color: var(--line); cursor: default; }
.chip.travel #dhome { border-left: 1px solid var(--line); }
.chip.travel #dname { padding: 0 2px; font-weight: 700; }
.tier { font-size: 12px; line-height: 1.7; color: var(--muted); margin: 10px 0 0; }
.tier:empty { display: none; }
.tier b { color: var(--lime); }
.tier a { color: var(--orange); }
.bottom { position: absolute; left: 0; right: 0; bottom: env(safe-area-inset-bottom, 0px); padding: 10px 12px 12px; display: grid; gap: 8px;
  background: linear-gradient(rgba(7,11,20,0), rgba(7,11,20,.92) 35%); pointer-events: none; }
.bottom > * { pointer-events: auto; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.modes { display: flex; }
.modes button { background: var(--panel); border: 1px solid var(--line); padding: 8px 14px; min-height: 40px; cursor: pointer; font-weight: 700; letter-spacing: .05em; }
.modes button + button { border-left: 0; }
.modes button.on { background: var(--lime); color: #0a0f05; border-color: var(--lime); }
.modes button.locked { color: var(--muted); }
.hint { font-size: 11px; color: var(--muted); letter-spacing: .03em; flex: 1; min-width: 0; }
.palette { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.piece { flex: none; background: var(--panel); border: 1px solid var(--line); padding: 6px 10px; cursor: pointer; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; text-align: left; min-height: 44px; }
.piece b { grid-row: span 2; color: var(--muted); font-size: 11px; align-self: center; }
.piece .pn { font-weight: 700; font-size: 12px; letter-spacing: .04em; }
.piece .pc { font-size: 10px; color: var(--muted); letter-spacing: .03em; }
.piece.sel { border-color: var(--lime); box-shadow: inset 0 -3px 0 var(--lime); }
.piece.poor .pn { color: var(--muted); }
.piece[data-piece="remove"].sel { border-color: var(--orange); box-shadow: inset 0 -3px 0 var(--orange); }
.rot { flex: none; background: var(--panel); border: 1px dashed var(--orange); color: var(--orange); padding: 6px 10px; min-height: 44px; cursor: pointer; font-weight: 700; font-size: 12px; }
.emotes { position: relative; }
.emote-pop { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 30; display: grid; grid-template-columns: repeat(auto-fill, 60px); gap: 4px; justify-content: start;
  width: min(calc(100vw - 24px), 408px); padding: 8px; background: var(--panel-solid, #0c1721); border: 1px solid var(--line); box-shadow: 6px 6px 0 rgba(0,0,0,.35); }
.emo { position: relative; width: 60px; height: 60px; padding: 0; overflow: hidden; background: #131c2e; border: 1px solid var(--line); cursor: pointer; }
.emo:hover, .emo:focus-visible { border-color: var(--lime); outline: 0; background: #1a2740; }
/* One art pixel is 2 screen px; the sheet is 12 frames wide and a row per emote (client/emotes.js). */
.emo i { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; image-rendering: pixelated;
  background: url(emotes.png) 0 calc(var(--row) * -64px) / 768px 1152px no-repeat; animation: emo calc(var(--n) * 100ms) steps(var(--n)) infinite; }
@keyframes emo { to { background-position-x: calc(var(--n) * -64px); } }
@media (prefers-reduced-motion: reduce) { .emo i { animation: none; } }
.log { position: absolute; left: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 150px); width: min(360px, calc(100% - 24px)); pointer-events: none; display: grid; gap: 2px; }
.log p { margin: 0; font-size: 12px; background: rgba(7,11,20,.7); padding: 2px 8px; overflow-wrap: anywhere; }
.log b { color: var(--muted); } .log b.mapedit { color: var(--lime); }
.zoom { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); display: grid; gap: 4px; }
.zoom button { width: 36px; height: 36px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; font-size: 18px; font-weight: 700; }
.toast { position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 70px); transform: translateX(-50%); background: var(--panel-solid); border: 1px solid var(--orange);
  color: var(--orange); padding: 8px 12px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-align: center; max-width: calc(100% - 32px); pointer-events: none; z-index: 40; }
[hidden] { display: none !important; }
@media (min-width: 760px) {
  .log { bottom: calc(env(safe-area-inset-bottom, 0px) + 120px); }
    .bottom { grid-template-columns: auto 1fr; align-items: end; }
  .bottom .emotes { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 520px) { .hint { display: none; } .brand small { display: none; } .toast { top: calc(env(safe-area-inset-top, 0px) + 118px); } }

/* Frames: hang dialog and viewer */
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(7, 11, 20, .72); }
.modal-card { width: min(440px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--panel-solid); border: 1px solid var(--lime); padding: 18px; display: grid; gap: 12px; }
.mist-card { width: min(420px, 100%); max-height: min(88vh, 640px); overflow-y: auto; gap: 8px; padding: 14px; }
.mist-diagram { width: 100%; height: 28px; image-rendering: pixelated; background: #070b14; border: 1px solid var(--line); }
.mist-blocks { display: grid; gap: 3px; max-height: 96px; overflow-y: auto; }
.mist-block { display: grid; grid-template-columns: 24px 1fr auto; gap: 6px; align-items: center; font-size: 11px; color: var(--muted); }
.mist-block.on { color: var(--orange); }
.mist-block.done { color: var(--lime); }
.mist-block.flash .mist-bar i { animation: mist-flash .7s ease; }
.mist-block small { grid-column: 2 / -1; color: var(--muted); font-size: 10px; }
.mist-bar { display: block; height: 7px; background: #1b2535; border: 1px solid var(--line); }
.mist-bar i { display: block; height: 100%; background: var(--lime); }
.mist-block.on .mist-bar i { background: var(--orange); }
.mist-give { display: grid; gap: 6px; }
.mist-give input { width: 100%; background: #0e1727; border: 1px solid var(--line); color: var(--text); padding: 6px; font: inherit; }
.mist-give input:disabled { opacity: .55; }
.mist-quick { display: flex; gap: 6px; flex-wrap: nowrap; }
.mist-quick .btn { min-width: 0; flex: 1; padding: 6px 4px; }
.mist-cap { color: var(--orange); font-weight: 700; }
@keyframes mist-flash { from { filter: brightness(2.2); } to { filter: none; } }
.mist-h4 { margin: 0; color: var(--lime); font-size: 12px; letter-spacing: .06em; }
.mist-board { display: grid; gap: 2px; font-size: 11px; color: var(--text); }
.mist-board p { margin: 0; }
.modal-card h3 { margin: 0; font-size: 16px; letter-spacing: .06em; color: var(--lime); overflow-wrap: anywhere; }
.modal-text { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; text-transform: uppercase; letter-spacing: .03em; }
#framer-in { width: 100%; background: #0e1727; border: 1px solid var(--line); color: var(--text); padding: 11px 10px; font: inherit; font-size: 13px; min-height: 44px; }
#framer-in:focus { border-color: var(--lime); outline: none; }
.framer-chains { margin: 10px 0 0; }
.framer-nfts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; max-height: 148px; overflow: auto; }
.framer-nfts[hidden] { display: none; }
.framer-nfts button { position: relative; width: 64px; height: 64px; padding: 0; border: 1px solid var(--line); background: #0e1727; cursor: pointer; color: var(--text); font: inherit; }
.framer-nfts button:hover, .framer-nfts button.sel { border-color: var(--lime); }
.framer-nfts .nft-tile { width: 100%; height: 100%; display: grid; place-items: center; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.framer-nfts .chain-badge { position: absolute; left: 3px; top: 3px; font-size: 8px; font-weight: 700; letter-spacing: .06em; padding: 1px 4px; background: #16240f; color: var(--lime); border: 1px solid var(--lime); }
.framer-pepes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.framer-pepes button { width: 56px; height: 56px; padding: 0; border: 1px solid var(--line); background: #0e1727; cursor: pointer; }
.framer-pepes button:hover, .framer-pepes button.sel { border-color: var(--lime); }
.framer-pepes canvas { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover:not(:disabled) { background: #0e1727; }
a.btn { display: inline-flex; align-items: center; text-decoration: none; }
.viewer-art { background: #0e1727; border: 1px solid var(--line); display: grid; place-items: center; min-height: 120px; }
.viewer-art img, .viewer-art video { display: block; width: 100%; max-height: 60vh; object-fit: contain; }
.viewer-art img.small, .viewer-art video.small { image-rendering: pixelated; }
.viewer-art .modal-text { padding: 24px; text-align: center; }

/* Swarm Watcher */
.chip.swarmchip { cursor: pointer; color: var(--lime); border-color: var(--lime); font: inherit; font-size: 11px; font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.chip.swarmchip:hover { background: #16240f; }
.chip.guestchip { cursor: pointer; color: #0a0f05; background: var(--lime); border-color: var(--lime); font: inherit; font-size: 11px; font-weight: 700; }
.chip.guestchip:hover { filter: brightness(1.1); }
#guest { margin-top: 10px; }
.chip.swarmchip i { font-style: normal; background: var(--orange); color: #0a0f05; padding: 0 4px; font-size: 10px; }
.swarm { position: fixed; right: 12px; top: 56px; bottom: 132px; width: min(380px, calc(100% - 24px)); overflow-y: auto; z-index: 6;
  background: var(--panel-solid); border: 1px solid var(--lime); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.swarm header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.swarm h3 { margin: 0; color: var(--lime); font-size: 15px; letter-spacing: .08em; }
.swarm h4 { margin: 6px 0 0; font-size: 11px; letter-spacing: .1em; color: var(--orange); }
.swarm header button { background: none; border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 18px; width: 36px; height: 36px; cursor: pointer; }
.swarm-sub { margin: 0; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.swarm-sub.off { color: var(--red); }
.swarm-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.swarm-stats div { background: #0e1727; border: 1px solid var(--line); padding: 8px; }
.swarm-stats b { display: block; font-size: 20px; color: var(--text); font-variant-numeric: tabular-nums; }
.swarm-stats span { font-size: 10px; color: var(--muted); letter-spacing: .06em; }
.swarm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.swarm-list li { background: #0e1727; border: 1px solid var(--line); padding: 8px; display: grid; gap: 4px; font-size: 12px; }
.swarm-list li.fresh { border-color: var(--orange); }
.swarm-list .row { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
.swarm-list .name { font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.swarm-list .tick { color: var(--lime); }
.swarm-list .when { color: var(--muted); font-size: 10px; white-space: nowrap; }
.swarm-list .kind { font-size: 10px; color: #0a0f05; background: var(--lime); padding: 1px 5px; letter-spacing: .05em; justify-self: start; }
.swarm-list .title { color: var(--text); line-height: 1.45; overflow-wrap: anywhere; }
.swarm-list .links { display: flex; gap: 10px; flex-wrap: wrap; font-size: 10px; }
.swarm-list .links a { color: var(--lime); text-decoration: none; letter-spacing: .05em; }
.swarm-list .links a:hover { text-decoration: underline; }
.swarm-list .empty { color: var(--muted); background: none; border-style: dashed; }
.swarm footer { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.log b.sw { color: var(--orange); }
@media (max-width: 600px) {
  .swarm { left: 8px; right: 8px; width: auto; top: auto; bottom: 120px; max-height: 58vh; }
}

/* Swarmpocalypse: town side */
.modes button.play { background: var(--orange); color: #0a0f05; border-color: var(--orange); }
.modes button.play:hover { background: #f09a55; }
.sp { border: 1px solid var(--orange); padding: 10px; display: grid; gap: 8px; background: #160f0a; }
.sp h4 { margin: 0; }
.sp-text { margin: 0; font-size: 11px; line-height: 1.6; color: var(--muted); text-transform: uppercase; }
.sp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sp-tabs { display: flex; gap: 0; }
.sp-tabs button { flex: 1; background: none; border: 1px solid var(--line); color: var(--muted); font: inherit; font-size: 10px; font-weight: 700; padding: 6px; cursor: pointer; }
.sp-tabs button.on { color: var(--lime); border-color: var(--lime); }
.sp-board { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 11px; counter-reset: rank; }
.sp-board li { display: grid; grid-template-columns: 22px 1fr auto auto; gap: 8px; padding: 4px 6px; background: #0e1727; counter-increment: rank; }
.sp-board li::before { content: counter(rank); color: var(--muted); }
.sp-board li.empty { display: block; color: var(--muted); background: none; }
.sp-board li.empty::before { content: none; }
.sp-board .won { color: var(--lime); }
.join-banner { position: absolute; left: 50%; transform: translateX(-50%); top: 92px; display: flex; gap: 10px; align-items: center; background: var(--panel-solid); border: 1px solid var(--orange); padding: 6px 6px 6px 12px; font-size: 12px; font-weight: 700; z-index: 7; max-width: calc(100% - 24px); }
.join-banner .btn { padding: 6px 12px; min-height: 0; box-shadow: none; }
.queue-banner { top: 136px; border-color: var(--lime); }

/* Swarmpocalypse: in a round */
body.arena #hud .top, body.arena .modes, body.arena #hint, body.arena #swarm, body.arena #palette, body.arena #join-banner, body.arena #queue-banner { display: none !important; }
#ahud { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
#ahud > * { pointer-events: auto; }
#ahud .bar { height: 8px; background: #0e1727; border: 1px solid var(--line); position: relative; overflow: hidden; }
#ahud .bar i { position: absolute; inset: 0 auto 0 0; width: 100%; background: var(--lime); transition: width .15s linear; }
.a-top { position: absolute; top: max(8px, env(safe-area-inset-top)); left: 8px; right: 8px; display: flex; gap: 10px; align-items: center; pointer-events: none; }
.a-top > * { pointer-events: auto; }
.a-timer { font-size: 22px; font-weight: 700; color: var(--text); background: var(--panel); border: 1px solid var(--line); padding: 4px 10px; font-variant-numeric: tabular-nums; }
.a-tower { flex: 1; max-width: 420px; background: var(--panel); border: 1px solid var(--line); padding: 5px 8px; display: grid; gap: 4px; font-size: 10px; letter-spacing: .08em; color: var(--lime); }
.a-tower .bar { height: 10px; }
.a-tower.hurt .bar i { background: var(--red); }
.a-stat { background: var(--panel); border: 1px solid var(--line); padding: 3px 10px; text-align: center; }
.a-stat b { display: block; font-size: 16px; } .a-stat span { font-size: 9px; color: var(--muted); }
.a-leave { margin-left: auto; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font: inherit; font-size: 11px; font-weight: 700; padding: 8px 10px; cursor: pointer; }
.a-boss { position: absolute; top: calc(max(8px, env(safe-area-inset-top)) + 84px); left: 50%; transform: translateX(-50%); width: min(520px, calc(100% - 24px)); display: grid; gap: 4px; text-align: center; font-size: 11px; font-weight: 700; color: var(--red); letter-spacing: .1em; }
.a-boss .bar i { background: var(--red) !important; }
/* XP: a clear strip right under the top bar, not squeezed above the bottom bar. */
.a-xp { position: absolute; left: 8px; right: 8px; top: calc(max(8px, env(safe-area-inset-top)) + 54px); display: flex; gap: 8px; align-items: center; pointer-events: none !important; }
#ahud .a-xp .bar { flex: 1; height: 10px; border-color: #2c4a66; box-shadow: inset 0 0 0 1px #070b14; }
.a-xp .bar i { background: linear-gradient(#a8e8ff, #6fd3ff 45%, #3a9fd6) !important; }
.a-xp b { font-size: 12px; color: #a8e8ff; background: var(--panel); border: 1px solid #2c4a66; padding: 2px 8px; letter-spacing: .06em; }
.a-loadout { position: absolute; left: 8px; bottom: 112px; display: flex; gap: 4px; flex-wrap: wrap; max-width: calc(100% - 16px); pointer-events: none !important; }
.a-loadout span { font-size: 9px; font-weight: 700; padding: 3px 5px; background: var(--panel); border: 1px solid var(--line); letter-spacing: .04em; }
.a-loadout span.p { color: var(--muted); }
.a-center { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); display: grid; gap: 8px; justify-items: center; text-align: center; pointer-events: none; }
.a-center > * { pointer-events: auto; }
.a-center b { font-size: 64px; color: var(--lime); line-height: 1; text-shadow: 4px 4px 0 #070b14; }
.a-center span { font-size: 13px; font-weight: 700; letter-spacing: .08em; background: var(--panel); padding: 4px 8px; }
.a-dead b { color: var(--red); }
.a-choice { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; background: rgba(7, 11, 20, .55); padding: 16px; z-index: 2; }
.a-choice h3 { margin: 0; text-align: center; color: var(--lime); font-size: 22px; letter-spacing: .1em; text-shadow: 3px 3px 0 #070b14; }
.a-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 220px)); gap: 10px; }
.a-cards button { text-align: left; background: var(--panel-solid); border: 2px solid var(--line); color: var(--text); font: inherit; padding: 12px; cursor: pointer; display: grid; gap: 6px; min-height: 130px; align-content: start; }
.a-cards button:hover, .a-cards button:focus-visible { border-color: var(--lime); outline: none; }
.a-cards .k { font-size: 10px; color: var(--muted); letter-spacing: .08em; }
.a-cards .n { font-size: 14px; font-weight: 700; color: var(--lime); }
.a-cards .t { font-size: 12px; line-height: 1.5; color: var(--text); }
.a-cards .new { color: var(--orange); }
.a-choice .bar { width: min(680px, 100%); justify-self: center; height: 4px !important; }
.a-end { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(7, 11, 20, .7); padding: 16px; z-index: 3; }
.a-end table { width: 100%; border-collapse: collapse; font-size: 12px; }
.a-end td, .a-end th { padding: 6px; border-bottom: 1px solid var(--line); text-align: left; }
.a-end th { color: var(--muted); font-size: 10px; letter-spacing: .06em; }
.a-end h3.won { color: var(--lime); } .a-end h3.lost { color: var(--red); }
@media (max-width: 600px) {
  .a-cards { grid-template-columns: 1fr; }
  .a-cards button { min-height: 0; }
  .a-timer { font-size: 18px; }
  .a-stat { display: none; }
  .join-banner { top: 120px; }
  .queue-banner { top: 164px; }
}

.sp-skin summary { cursor: pointer; font-size: 11px; font-weight: 700; color: var(--lime); letter-spacing: .04em; }
.sp-skin ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; font-size: 11px; }
.sp-skin li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 6px; background: #0e1727; }
.sp-skin .w { font-weight: 700; }
/* Co-op level-up: a strip at the bottom, the fight stays visible and playable */
.a-choice.compact { inset: auto 8px 160px 8px; background: none; place-content: end center; pointer-events: none !important; gap: 6px; padding: 0; }
.a-choice.compact > * { pointer-events: auto; }
.a-choice.compact h3 { font-size: 14px; }
.a-choice.compact .a-cards { grid-template-columns: repeat(3, minmax(0, 200px)); gap: 6px; }
.a-choice.compact .a-cards button { min-height: 0; padding: 8px; gap: 3px; background: rgba(11, 18, 32, .94); }
.a-choice.compact .a-cards .t { font-size: 11px; }
@media (max-width: 600px) {
  .a-choice.compact { bottom: 150px; }
  .a-choice.compact .a-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .a-choice.compact .a-cards .t { display: none; }
  .a-choice.compact .a-cards .n { font-size: 11px; }
}

.a-nuke { top: 30%; z-index: 4; }
.a-nuke b { color: var(--orange); font-size: 72px; animation: nuke-pop .4s ease-out; }
.a-nuke span { color: var(--lime); max-width: min(560px, calc(100vw - 32px)); line-height: 1.5; }
@keyframes nuke-pop { from { transform: scale(2.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .a-nuke b { animation: none; } }

.chip.snd { cursor: pointer; font: inherit; font-size: 11px; font-weight: 700; color: var(--text); }
.a-leave.a-snd { margin-left: auto; color: var(--text); }
.a-snd + .a-leave { margin-left: 0; }

/* The Swarm Plaza: tabs, $OG, the build menu and building dialogs. */
.tabs { display: flex; }
.tabs button { background: var(--panel); border: 1px solid var(--line); color: var(--muted); font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .08em; padding: 6px 12px; min-height: 32px; cursor: pointer; }
.tabs button + button { border-left: 0; }
/* The raffle and staking pages, from the menu (a new tab, so the game keeps running). */
.tabs .tab-out { display: inline-flex; align-items: center; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-left: 0; color: var(--orange); font-size: 11px; font-weight: 700; letter-spacing: .08em; padding: 6px 12px; min-height: 32px; text-decoration: none; }
.tabs .tab-out:hover { color: var(--lime); }
.tabs button.on { color: #0a0f05; background: var(--lime); border-color: var(--lime); }
.chip.og { color: var(--lime); border-color: #3d4a1a; }
.chip.og b { color: var(--lime); }
.chip.burned { color: var(--orange); border-color: #5a3215; }
.chip.burned b { color: var(--orange); }
.chip.burned::before { content: ''; display: inline-block; width: 6px; height: 8px; margin-right: 5px; background: var(--orange); clip-path: polygon(50% 0, 100% 60%, 80% 100%, 20% 100%, 0 60%); vertical-align: -1px; }
.games h4 small { color: var(--muted); font-weight: 400; margin-left: 6px; letter-spacing: .06em; }
.catalog { display: flex; gap: 8px; align-items: stretch; }
.bottom .catalog { grid-column: 1 / -1; }
.cat-items { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; flex: 1; min-width: 0; }
.bcard { flex: none; width: 104px; background: var(--panel); border: 1px solid var(--line); padding: 4px 6px 6px; cursor: pointer; display: grid; gap: 2px; text-align: left; color: var(--text); font: inherit; }
.bcard canvas { width: 80px; height: 77px; display: block; margin: 0 auto; image-rendering: pixelated; }
.bcard .bn { font-weight: 700; font-size: 11px; letter-spacing: .04em; }
.bcard .bc { font-size: 11px; color: var(--orange); font-weight: 700; }
.bcard .bs { font-size: 10px; color: var(--muted); }
.bcard.sel { border-color: var(--lime); box-shadow: inset 0 -3px 0 var(--lime); }
.bcard.poor .bc { color: var(--muted); text-decoration: line-through; }
.cat-side { display: flex; flex-direction: column; gap: 6px; width: 120px; flex: none; }
.cat-note { font-size: 9px; color: var(--muted); letter-spacing: .04em; line-height: 1.4; }
.b-art { display: grid; place-items: center; background: #0e1727; border: 1px solid var(--line); padding: 6px; }
.b-art canvas { width: 192px; height: 184px; image-rendering: pixelated; }
.btn.burn { background: var(--orange); box-shadow: 4px 4px 0 #5a3215; }
/* Cap / other disabled burns: grey on orange is unreadable; mute the fill instead. */
.btn.burn:disabled { background: #2a3344; color: #e8eadf; box-shadow: 4px 4px 0 #1b2535; }
.btn.danger { color: var(--red); border-color: var(--red); }
.a-end-og { margin: 0; color: var(--lime); font-weight: 700; font-size: 14px; letter-spacing: .05em; }
@media (max-width: 600px) {
  .tabs button, .tabs .tab-out { padding: 6px 8px; font-size: 10px; }
  .bcard { width: 92px; }
  .bcard canvas { width: 80px; height: 77px; }
  .cat-side { width: 84px; }
  .cat-note { display: none; }
  .bcard .bs { display: none; }
}

/* Launch party banner */
.party { position: fixed; left: 0; right: 0; top: 18%; z-index: 9; display: grid; place-items: center; pointer-events: none; padding: 0 16px; }
/* While a launch's builders collect their pay at the Watcher's crown, the banner moves out of the way. */
.party.paying { top: auto; bottom: 150px; }
@media (max-width: 700px) { .party.paying { bottom: 200px; } }
.party.paying .party-in { gap: 4px; padding: 8px 14px; }
.party.paying .party-title { font-size: clamp(14px, 2.6vw, 22px); }
.party.paying #party-name { font-size: 15px; }
.party-in { display: grid; gap: 10px; justify-items: center; text-align: center; background: rgba(7, 11, 20, .78); border: 2px solid var(--lime); box-shadow: 0 0 0 4px rgba(232, 131, 58, .55), 0 0 40px rgba(201, 219, 76, .45); padding: 16px 22px; animation: party-in .5s cubic-bezier(.2, 1.6, .4, 1) both, party-glow 1s ease-in-out .5s infinite alternate; max-width: 100%; }
.party-title { color: var(--lime); font-size: clamp(28px, 7vw, 56px); }
#party-name { color: var(--orange); font-size: clamp(16px, 4vw, 26px); letter-spacing: .08em; overflow-wrap: anywhere; }
#party-sub { color: var(--muted); font-size: 11px; letter-spacing: .12em; }
@keyframes party-in { from { transform: scale(.2) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes party-glow { from { box-shadow: 0 0 0 4px rgba(232, 131, 58, .55), 0 0 30px rgba(201, 219, 76, .35); } to { box-shadow: 0 0 0 6px rgba(255, 126, 182, .6), 0 0 60px rgba(111, 211, 255, .5); } }
@media (prefers-reduced-motion: reduce) { .party-in { animation: none; } }

/* Clubs: the bar inside a club, the Navigator, the catalog, settings */
.club-bar { position: absolute; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + 52px); z-index: 4; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center;
  background: var(--panel-solid); border: 1px solid var(--lime); padding: 6px 10px; max-width: calc(100% - 24px); }
.cb-name { display: grid; }
.cb-name b { color: var(--lime); font-size: 13px; letter-spacing: .05em; }
.cb-name span { color: var(--muted); font-size: 10px; }
.cb-desc { color: var(--text); font-size: 11px; max-width: 260px; overflow-wrap: anywhere; }
.cb-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.cb-actions .btn { width: auto; padding: 6px 10px; min-height: 32px; font-size: 11px; box-shadow: none; }
#cb-like.on { color: var(--orange); border-color: var(--orange); }
.club-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.club-row .meta { font-size: 10px; color: var(--muted); letter-spacing: .04em; }
.club-row .desc { grid-column: 1 / -1; color: var(--text); font-size: 11px; overflow-wrap: anywhere; }
.club-row .btn { width: auto; padding: 6px 10px; min-height: 30px; font-size: 11px; box-shadow: none; }
.door-tag { font-size: 9px; padding: 1px 4px; border: 1px solid var(--line); margin-left: 6px; letter-spacing: .05em; }
.door-tag.holders { color: var(--lime); border-color: var(--lime); }
.door-tag.locked { color: var(--red); border-color: var(--red); }
.door-tag.og { color: var(--gold, #f2c14e); border-color: var(--gold, #f2c14e); }
.og-min { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -2px 0 4px 24px; }
.og-min .hint { font-size: 9px; color: var(--muted); letter-spacing: .05em; flex-basis: 100%; }
.og-min .hint:first-child { flex-basis: auto; }
.og-min #cs-og-presets { display: flex; gap: 4px; }
.og-min .chip { font: inherit; font-size: 10px; padding: 3px 6px; background: none; color: var(--fg, #e8edf5); border: 1px solid var(--line); cursor: pointer; }
.og-min .chip.on { border-color: var(--gold, #f2c14e); color: var(--gold, #f2c14e); }
.og-min input { width: 120px; font: inherit; font-size: 12px; padding: 3px 6px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.fcard { background: #0e1727; border: 1px solid var(--line); padding: 6px; display: grid; gap: 3px; font-size: 10px; }
.fcard canvas { width: 64px; height: 60px; margin: 0 auto; image-rendering: pixelated; display: block; }
.fcard b { font-size: 11px; color: var(--text); letter-spacing: .03em; }
.fcard .price { color: var(--orange); font-weight: 700; font-size: 11px; }
.fcard .made { color: var(--muted); }
.fcard .btn { padding: 4px 6px; min-height: 28px; font-size: 10px; box-shadow: none; }
.fcard.retired { opacity: .55; }
.fcard .tier { font-weight: 700; font-size: 10px; letter-spacing: .04em; }
.fcard .own { color: var(--lime); }
.fcard.unfound canvas { filter: brightness(.25) saturate(0); }
.fcard.unfound .own { color: var(--muted); }
/* SWARM PACKS: the open-pack screen and the opening show. */
.swarm.shop { width: min(440px, calc(100% - 24px)); }
.pk-screen { display: grid; gap: 8px; }
.pk-drops { display: grid; gap: 4px; }
.pk-drop { display: grid; grid-template-columns: 40px 1fr auto auto auto; gap: 6px; align-items: center; background: #0e1727; border: 1px solid var(--line); padding: 4px 6px; font-size: 10px; }
.pk-drop canvas { width: 36px; height: 34px; image-rendering: pixelated; display: block; }
.pk-drop b { font-size: 11px; color: var(--text); letter-spacing: .03em; }
.pk-drop .pk-odd { color: var(--orange); font-weight: 700; font-variant-numeric: tabular-nums; }
.pk-drop .own { color: var(--lime); }
.pk-drop.unfound canvas { filter: brightness(.45) saturate(.35); }
.pk-drop.unfound .own { color: var(--muted); }
.cr-card { border: 1px solid #c99355; background: linear-gradient(135deg, #22180e, #0e1727); padding: 10px; display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.cr-icon canvas { width: 108px; height: auto; image-rendering: pixelated; display: block; animation: cr-bob 2.4s ease-in-out infinite; }
@keyframes cr-bob { 50% { transform: translateY(-3px); } }
.cr-info { display: grid; gap: 5px; min-width: 0; }
.cr-info b { color: #e9b26f; font-size: 13px; letter-spacing: .08em; }
.cr-info span { color: var(--muted); font-size: 10px; letter-spacing: .04em; line-height: 1.5; }
.cr-info .cr-held { color: var(--text); font-size: 12px; font-weight: 700; }
.cr-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cr-why { color: var(--orange); font-size: 10px; letter-spacing: .04em; }
.cr-odds { display: flex; gap: 4px 10px; flex-wrap: wrap; font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.cr-info .cr-coll { color: var(--lime); }
.crate-ov { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 16px;
  background: radial-gradient(ellipse at 50% 42%, rgba(30, 36, 58, .92), rgba(5, 7, 13, .96) 70%); cursor: pointer; user-select: none; }
.crate-ov[hidden] { display: none; }
.crate-ov canvas { width: min(640px, 94vw); height: auto; aspect-ratio: 160 / 130; image-rendering: pixelated;
  -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent); mask-image: radial-gradient(closest-side, #000 72%, transparent); }
.crate-text { text-align: center; display: grid; gap: 6px; justify-items: center; max-width: 520px; margin-top: -10px; }
.crate-text.pop { animation: cr-pop .45s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes cr-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.crate-tier { padding: 3px 12px; font-weight: 800; font-size: 12px; letter-spacing: .18em; box-shadow: 0 0 18px currentColor; }
.crate-text h3 { margin: 0; font-size: 20px; letter-spacing: .08em; color: var(--text); }
.crate-text p { margin: 0; color: var(--muted); font-size: 11px; letter-spacing: .04em; line-height: 1.6; text-transform: uppercase; }
.crate-hint { margin: 0; color: var(--muted); font-size: 10px; letter-spacing: .12em; opacity: .7; }
.crate-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.crate-actions .btn { width: auto; min-width: 150px; }
@media (prefers-reduced-motion: reduce) { .cr-icon canvas, .crate-text.pop { animation: none; } }
.shop-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 10px; }
.shop-head small { color: var(--orange); font-size: 10px; letter-spacing: .05em; }
.icard { flex: none; width: 92px; background: var(--panel); border: 1px solid var(--line); padding: 4px; cursor: pointer; display: grid; gap: 2px; text-align: left; color: var(--text); font: inherit; font-size: 10px; }
.icard canvas { width: 64px; height: 60px; display: block; margin: 0 auto; image-rendering: pixelated; }
.icard .n { font-weight: 700; font-size: 10px; }
.icard.sel { border-color: var(--lime); box-shadow: inset 0 -3px 0 var(--lime); }
.inv-empty { color: var(--muted); font-size: 11px; align-self: center; padding: 8px; }
.field { display: grid; gap: 4px; font-size: 10px; color: var(--muted); letter-spacing: .06em; }
.field input { background: #0e1727; border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 13px; padding: 8px 10px; }
.doors { border: 1px solid var(--line); padding: 8px 10px; display: grid; gap: 6px; font-size: 12px; }
.doors legend { font-size: 10px; color: var(--muted); letter-spacing: .06em; padding: 0 4px; }
.doors label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.in-club .toast { top: calc(env(safe-area-inset-top, 0px) + 112px); }
@media (max-width: 600px) { .in-club .toast { top: calc(env(safe-area-inset-top, 0px) + 200px); } .club-bar { top: calc(env(safe-area-inset-top, 0px) + 112px); } .cb-desc { display: none; } }

/* A chip pulses when its number changes (the number counts up in JS). */
.chip.bump { animation: chip-bump .45s ease-out; }
@keyframes chip-bump { 0% { transform: scale(1); } 30% { transform: scale(1.12); box-shadow: 0 0 0 2px var(--lime); } 100% { transform: scale(1); box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .chip.bump { animation: none; } }

/* First visit: how to play, in three cards. */
.howto-card { width: min(720px, 100%); }
.howto { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.howto li { border: 1px solid var(--line); background: #0e1727; padding: 10px; display: grid; gap: 6px; align-content: start; }
.howto b { color: var(--lime); font-size: 12px; letter-spacing: .06em; }
.howto span { color: var(--muted); font-size: 11px; line-height: 1.5; text-transform: uppercase; letter-spacing: .03em; }
.howto-art { height: 84px; display: grid; place-items: center; background: #16304a; border: 1px solid #1d2a40; }
.howto-art canvas { image-rendering: pixelated; max-height: 76px; max-width: 100%; width: auto; }
@media (max-width: 600px) { .howto { grid-template-columns: 1fr; } .howto li { grid-template-columns: 84px 1fr; } .howto-art { grid-row: span 2; height: 72px; } }

/* Pick screen: whose characters these are, and a way to change it. */
.pick-who { font-size: 11px; color: var(--muted); letter-spacing: .05em; margin: 2px 0 10px; text-transform: uppercase; }
.pick-who b { color: var(--text); font-weight: 700; text-transform: none; }
.linkish { font: inherit; font-size: 11px; color: var(--lime); background: none; border: 0; border-bottom: 1px dashed currentColor; padding: 0; cursor: pointer; letter-spacing: .05em; }
.linkish:hover, .linkish:focus-visible { color: var(--text); }

/* Raffles (on chain): shared piece cards, wallet bar, reveal */
.bx-entry { border: 1px solid #ffd25e; background: linear-gradient(135deg, #1d1a10, #0e1727); padding: 10px; display: grid; gap: 6px; }
.bx-entry b { color: #ffd25e; font-size: 13px; letter-spacing: .08em; }
.bx-entry span { color: var(--muted); font-size: 10px; letter-spacing: .04em; line-height: 1.5; }
.bx-entry .btn { justify-self: start; }
.bx-wallet { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; background: #0e1727; border: 1px solid var(--line); padding: 8px; font-size: 11px; letter-spacing: .04em; }
.bx-wallet .btn { padding: 6px 10px; min-height: 30px; font-size: 10px; box-shadow: none; }
.bx-status { margin: 0; font-size: 11px; color: var(--lime); letter-spacing: .04em; border-left: 3px solid var(--lime); padding: 4px 8px; background: #0e1727; }
.bx-status.busy { color: #ffd25e; border-color: #ffd25e; }
.bx-tier h4 { color: var(--tier); }
.bx-tier small { color: var(--tier) !important; }
.bx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 6px; }
.bx-piece { --tier: #c9d2e0; background: #0e1727; border: 1px solid var(--tier); box-shadow: inset 0 -3px 0 var(--tier); padding: 5px; display: grid; gap: 2px; font-size: 10px; text-align: center; }
.bx-piece canvas { width: 64px; height: 60px; margin: 0 auto; image-rendering: pixelated; display: block; }
.bx-piece b { font-size: 10px; color: var(--text); letter-spacing: .02em; }
.bx-piece span { color: var(--tier); font-weight: 700; }
.bx-got { display: flex; flex-wrap: wrap; gap: 4px; }
.bx-got .bx-piece { padding: 2px; }
.bx-got .bx-piece canvas { width: 40px; height: 38px; }
.bx-got .bx-piece b { display: none; }
.bx-fine a { color: var(--lime); text-decoration: none; }
.rf-tabs { margin: 2px 0; }
.rf-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rf-stat { background: #0e1727; border: 1px solid var(--line); padding: 8px; display: grid; gap: 2px; }
.rf-stat small { color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.rf-stat b { color: var(--lime); font-size: 14px; letter-spacing: .02em; overflow-wrap: anywhere; }
.rf-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; }
.rf-row .field { flex: 1 1 110px; }
.rf-row .btn { padding: 8px 10px; min-height: 36px; font-size: 11px; box-shadow: none; width: auto; flex: 0 0 auto; }
.rf-row select, .rf-edit select { background: #0e1727; border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 12px; padding: 7px 8px; }
.rf-note { display: block; color: var(--muted); font-size: 10px; letter-spacing: .04em; line-height: 1.5; flex-basis: 100%; }
.rf-raffle { border: 1px solid var(--line); background: #0b1322; padding: 8px; display: grid; gap: 6px; }
.rf-raffle > .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rf-raffle > .row b { color: var(--text); letter-spacing: .06em; font-size: 12px; }
.rf-raffle .when { font-size: 10px; color: var(--muted); letter-spacing: .04em; text-align: right; }
.rf-raffle .when.open { color: var(--lime); }
.rf-raffle .when.closed { color: #ffd25e; }
.rf-raffle .links { display: flex; gap: 8px; flex-wrap: wrap; }
.rf-raffle .links .btn, .rf-edit .links .btn { padding: 4px 8px; min-height: 28px; font-size: 10px; box-shadow: none; }
.rf-pool { border-left: 3px solid var(--tier); padding-left: 8px; display: grid; gap: 5px; }
.rf-won { color: #ffd25e !important; }
.rf-setup { display: grid; gap: 4px; }
.rf-step { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #0e1727; border: 1px solid var(--line); padding: 6px 8px; font-size: 10px; letter-spacing: .04em; }
.rf-step.done { color: var(--lime); }
.rf-step .btn { padding: 4px 8px; min-height: 28px; font-size: 10px; box-shadow: none; }
@media (max-width: 600px) { .rf-stats { grid-template-columns: 1fr 1fr; } }
.icard .nftn { color: #ffd25e; font-weight: 700; }
/* The reveal: pieces pop in one by one, rarer ones glow. */
.br-card { width: min(560px, 100%); border-color: #ffd25e; }
.br-card h3 { color: #ffd25e; }
.br-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.br-items .bx-piece { opacity: 0; transform: scale(.6) rotate(-6deg); }
.br-items .bx-piece.pop { animation: bx-pop .45s cubic-bezier(.2, 1.6, .4, 1) forwards; }
.br-items .bx-piece.t2 { box-shadow: inset 0 -3px 0 var(--tier), 0 0 12px -2px var(--tier); }
.br-items .bx-piece.t3 { box-shadow: inset 0 -3px 0 var(--tier), 0 0 18px 0 var(--tier); }
.br-items .bx-piece.t4 { box-shadow: inset 0 -3px 0 var(--tier), 0 0 26px 4px var(--tier); background: #1d1a10; }
@keyframes bx-pop { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .br-items .bx-piece.pop { animation: none; opacity: 1; transform: none; } }
@media (max-width: 600px) { .br-items { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); } }

/* ---------------------------------------------------------- games hub */
.swarm.games { width: min(560px, calc(100% - 24px)); }
.gh-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gh-card { appearance: none; background: #0e1727; border: 1px solid var(--line); padding: 0; cursor: pointer; text-align: left; display: grid; gap: 2px; color: var(--text); font: inherit; overflow: hidden; }
.gh-card:hover, .gh-card:focus-visible { border-color: var(--lime); }
.gh-card b { font-size: 13px; letter-spacing: .06em; color: var(--lime); padding: 6px 8px 0; }
.gh-card small { font-size: 10px; color: var(--muted); letter-spacing: .04em; padding: 0 8px 8px; line-height: 1.4; }
.gh-art { position: relative; display: block; aspect-ratio: 16 / 10; background: #070b14; overflow: hidden; }
.gh-art img, .gh-art video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.gh-art video { opacity: 0; transition: opacity .2s; }
.gh-art video.on { opacity: 1; }
.gh-card:hover .gh-art img { transform: scale(1.03); }
.gh-art img { transition: transform .3s; }
.gh-new { position: absolute; top: 6px; left: 6px; font-style: normal; font-size: 10px; font-weight: 700; background: var(--orange); color: #0a0f05; padding: 1px 6px; letter-spacing: .06em; }
.gh-back { appearance: none; background: none; border: 0; color: var(--muted); font: inherit; font-size: 11px; font-weight: 700; padding: 0; cursor: pointer; justify-self: start; letter-spacing: .04em; }
.gh-back:hover { color: var(--lime); }
.gh-clip { aspect-ratio: 16 / 10; background: #070b14; overflow: hidden; border: 1px solid var(--line); }
.gh-clip video { width: 100%; height: 100%; object-fit: cover; display: block; }
#mgd { border-color: var(--lime); background: #0d140a; }
.mg-how { margin: 0; padding-left: 18px; font-size: 11px; line-height: 1.6; color: var(--muted); display: grid; gap: 3px; }
.mg-ladder { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.mg-ladder canvas { width: 34px; height: 34px; }
.mg-ladder span { color: var(--muted); font-size: 10px; }
.sp-board.mgb li { grid-template-columns: 22px 1fr auto auto; }
.sp-board .tier { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.sp-board .tier canvas { width: 16px; height: 16px; }
@media (max-width: 600px) { .gh-grid { gap: 6px; } .gh-card b { font-size: 12px; } }
@media (prefers-reduced-motion: reduce) { .gh-art img, .gh-art video { transition: none; } }

/* ---------------------------------------------------------- PEPE MERGE */
.mg { position: fixed; inset: 0; z-index: 30; background: #070b14; }
#mg-view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
/* THE OUTER WORLD: the realm, seen from above. */
#realm-view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; outline: none; image-rendering: pixelated; }
/* (The 3D picture sits under it; the 2D canvas then only draws bullets, effects, names and the HUD over it.) */
#realm-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; image-rendering: pixelated; }
#realm-gl[hidden] { display: none; }
.realm-bag-toggle, .realm-ability-button { position: absolute; z-index: 4; border: 2px solid #c9db4c; background: rgba(10, 7, 16, .93); color: #f5f5ec; font: inherit; font-weight: 800; cursor: pointer; }
.realm-bag-toggle { left: 12px; top: 100px; padding: 7px 12px; font-size: 11px; }
.realm-ability-button { left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: 104px; min-height: 88px; padding: 5px 4px 6px; display: grid; justify-items: center; align-content: center; gap: 2px; overflow: hidden; color: var(--skill-color, #8dff86); border-color: var(--skill-color, #8dff86); box-shadow: 0 0 0 2px rgba(10,7,16,.85), 0 0 16px color-mix(in srgb, var(--skill-color, #8dff86) 35%, transparent); }
.realm-ability-button::before { content: ''; position: absolute; inset: 0; background: rgba(3, 6, 14, .78); transform-origin: bottom; transform: scaleY(var(--cooldown, 0)); pointer-events: none; }
.realm-ability-sweep { position: absolute; inset: -20%; pointer-events: none; background: conic-gradient(from 180deg, rgba(3,6,14,.82) calc(var(--cooldown, 0) * 360deg), transparent 0); opacity: 0; }
.realm-ability-shine { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.35) 48%, transparent 62%); transform: translateX(-120%); }
.realm-ability-button > span { position: relative; z-index: 1; line-height: 1.1; }
.realm-ability-icon { font-size: 31px; text-shadow: 0 0 12px currentColor; }
.realm-ability-name { font-size: 10px; letter-spacing: .08em; }
.realm-ability-state { font-size: 9px; color: #fff; }
.realm-ability-button:disabled { cursor: default; }
.realm-ability-button:disabled .realm-ability-icon { opacity: .55; text-shadow: none; }
.realm-ability-button.is-cooling { filter: grayscale(.72) saturate(.35); box-shadow: 0 0 0 2px rgba(10,7,16,.85); }
.realm-ability-button.is-cooling .realm-ability-sweep { opacity: 1; }
.realm-ability-button.is-ready { animation: realm-ability-pulse 1.6s ease-in-out infinite; }
.realm-ability-button.is-ready .realm-ability-shine { animation: realm-ability-shine 1.8s ease-in-out infinite; }
@keyframes realm-ability-shine { 0% { transform: translateX(-120%); } 45%, 100% { transform: translateX(120%); } }
@keyframes realm-ability-pulse { 0%, 100% { box-shadow: 0 0 0 2px rgba(10,7,16,.85), 0 0 16px color-mix(in srgb, var(--skill-color, #8dff86) 35%, transparent); } 50% { box-shadow: 0 0 0 2px rgba(10,7,16,.85), 0 0 26px color-mix(in srgb, var(--skill-color, #8dff86) 70%, transparent); } }
@media (prefers-reduced-motion: reduce) {
  .realm-ability-button.is-ready, .realm-ability-button.is-ready .realm-ability-shine { animation: none; }
}
.realm-bag-panel { position: absolute; z-index: 5; left: 12px; top: 140px; width: min(350px, calc(100vw - 24px)); max-height: min(70vh, 600px); overflow-y: auto; padding: 14px; border: 2px solid #c9db4c; background: rgba(10, 7, 16, .96); color: #f5f5ec; font: inherit; font-size: 12px; box-shadow: 6px 6px 0 #06070e; }
.realm-bag-panel[hidden] { display: none; }
.realm-bag-head { display: flex; justify-content: space-between; align-items: center; color: #c9db4c; letter-spacing: .1em; }
.realm-bag-head button { color: #fff; background: transparent; border: 0; font-size: 22px; cursor: pointer; }
.realm-bag-panel h4 { margin: 15px 0 6px; color: #7fe0ff; }
.realm-bag-row { padding: 7px 0; border-top: 1px solid #343345; }
.realm-bag-row b { display: block; }
.realm-bag-row small { display: block; margin-top: 2px; color: #bfc8d4; }
.realm-bag-drop { margin-top: 6px; padding: 4px 9px; border: 1px solid #ff9a5a; background: #25141a; color: #ffb582; font: inherit; font-size: 10px; font-weight: 800; cursor: pointer; }
.realm-bag-drop:disabled { opacity: .5; cursor: default; }
.realm-bag-risk { color: #ff9a5a; line-height: 1.4; }
.realm-vitals { margin: 8px 0 12px; }
.realm-vital-label { display: flex; justify-content: space-between; margin: 5px 0 3px; font-size: 11px; }
.realm-vital-track { height: 13px; border: 1px solid #586070; background: #1b1a26; }
.realm-vital-track > div { height: 100%; transition: width .12s linear; }
.realm-hp-fill { background: #d94c49; }
.realm-mp-fill { background: #548fdf; }
.realm-item-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.realm-item-slot { display: grid; place-items: center; min-height: 52px; border: 1px solid #4e5364; background: #171c2a; color: #d5e3ec; font: inherit; cursor: pointer; }
.realm-item-slot img { width: 34px; height: 34px; image-rendering: pixelated; }
.realm-item-slot small { font-size: 9px; line-height: 1.1; }
.realm-item-slot:disabled { opacity: .55; cursor: default; }
.realm-item-slot.selected { border-color: #c9db4c; box-shadow: inset 0 0 0 1px #c9db4c; }
.realm-item-detail { margin-top: 8px; min-height: 56px; padding: 7px; border: 1px solid #343345; line-height: 1.4; }
.realm-item-detail b, .realm-item-detail small { display: block; }
.realm-item-detail small { color: #bfc8d4; }
.realm-potions { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.realm-potions button { display: flex; align-items: center; gap: 5px; padding: 5px; border: 1px solid #506178; background: #172133; color: #fff; font: inherit; cursor: pointer; }
.realm-potions button:disabled { opacity: .5; cursor: default; }
.realm-potions img { width: 28px; height: 28px; image-rendering: pixelated; }
.realm-potions b, .realm-potions small { display: block; }
@media (min-width: 760px) {
  #realm-view, #realm-gl { right: 232px; width: calc(100% - 232px); }
  .realm-bag-panel { left: auto; right: 0; top: 0; width: 232px; height: 100%; max-height: none; box-sizing: border-box; border-width: 0 0 0 2px; overflow-y: auto; box-shadow: none; }
  .realm-bag-toggle { left: auto; right: 240px; top: 12px; }
  .realm-ability-button { left: calc((100% - 232px) / 2); }
}
.outfit-abilities { margin: 12px 0; padding: 10px; border: 1px solid #38475a; background: #0d1423; }
.outfit-characters { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 12px 0; padding: 10px; border: 1px solid #38475a; background: #0d1423; }
.outfit-characters h3, .outfit-characters p { width: 100%; margin: 0; }
.outfit-characters .nm { min-width: 130px; }
.outfit-ability-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.outfit-ability-list button { text-align: left; min-height: 65px; padding: 8px; border: 1px solid #485568; background: #121d2e; color: #eee; font: inherit; cursor: pointer; }
.outfit-ability-list button.on { border-color: #c9db4c; background: #273126; }
.outfit-ability-list small { display: block; margin-top: 3px; color: #b7c5d4; }
@media (max-width: 480px) { .outfit-ability-list { grid-template-columns: 1fr; } .realm-bag-toggle { top: 88px; } }
/* SWARM BALL: the match screen and its results card. */
#sb-view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; outline: none; }
/* The 3D picture sits under the 2D canvas, which then only draws names, messages and the scoreboard over it. */
#sb-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
#sb-gl[hidden] { display: none; }
.mg-view3d { position: absolute; top: 10px; right: 58px; height: 40px; min-width: 52px; padding: 0 10px; background: rgba(11, 18, 32, .85); border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 14px; letter-spacing: .06em; cursor: pointer; z-index: 3; }
.mg-view3d:hover { border-color: var(--lime); }
.mg-view3d.on { border-color: var(--lime); color: var(--lime); }
#sbd { border-color: var(--orange); background: #140d08; }
.sb-final { display: flex; justify-content: center; align-items: center; gap: 14px; }
.sb-final i { font-style: normal; color: var(--muted); font-size: 24px; }
.sb-team { display: grid; gap: 2px; justify-items: center; }
.sb-team b { font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.sb-team small { font-size: 10px; letter-spacing: .1em; font-weight: 700; }
.sb-team.t0 b, .sb-team.t0 small { color: var(--lime); }
.sb-team.t1 b, .sb-team.t1 small { color: var(--orange); }
.sb-res { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 11px; text-align: left; }
.sb-res li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 4px 8px; background: #0e1727; border-left: 3px solid var(--lime); }
.sb-res li.t1 { border-left-color: var(--orange); }
.sb-res li.mapedit { background: #1a2640; font-weight: 700; }
.sb-res .dim { color: var(--muted); }
/* SWARM DEFENSE's four corners on the results card */
.sb-team.c0 b, .sb-team.c0 small { color: #e8473a; }
.sb-team.c1 b, .sb-team.c1 small { color: #f2c93a; }
.sb-team.c2 b, .sb-team.c2 small { color: #52c43a; }
.sb-team.c3 b, .sb-team.c3 small { color: #3a8ae8; }
.sb-res li.c0 { border-left-color: #e8473a; }
.sb-res li.c1 { border-left-color: #f2c93a; }
.sb-res li.c2 { border-left-color: #52c43a; }
.sb-res li.c3 { border-left-color: #3a8ae8; }
.sb-join { display: flex; gap: 8px; }
.sb-join input { width: 7em; background: #0e1727; border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 14px; font-weight: 700; letter-spacing: .3em; padding: 6px 8px; text-transform: uppercase; }
.sb-join input:focus { outline: none; border-color: var(--lime); }
.sp-board.sbb li { grid-template-columns: 22px 1fr auto auto; }
.sb-bar { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; align-items: center; z-index: 2; max-width: calc(100% - 70px); }
.sb-bar .btn { width: auto; flex: none; padding: 6px 12px; font-size: 11px; min-height: 32px; box-shadow: 3px 3px 0 var(--orange); }
.sb-bar .btn.ghost { box-shadow: none; background: rgba(11, 18, 32, .9); }
/* The warm-up bar is two buttons (MENU, KICK OFF) so the pitch stays clear; the rest drops down from MENU. */
.sb-menu { position: absolute; left: 0; top: calc(100% + 6px); display: flex; flex-direction: column; gap: 6px; width: max-content; min-width: 190px; max-width: calc(100vw - 20px); max-height: calc(100dvh - 64px); overflow-y: auto; padding: 8px; background: rgba(11, 18, 32, .96); border: 1px solid var(--orange); }
.sb-menu[hidden] { display: none; }
.sb-menu .btn { width: 100%; text-align: left; box-shadow: none; }
.sb-menu .sb-chip { border: 0; padding: 2px 2px 6px; background: none; border-bottom: 1px solid rgba(255, 255, 255, .12); }
@media (max-height: 460px) { .sb-menu { gap: 4px; padding: 6px; min-width: 170px; } .sb-menu .btn { min-height: 26px; padding: 3px 10px; font-size: 10px; } }
.sb-chip { background: rgba(11, 18, 32, .9); border: 1px solid var(--orange); color: var(--text); font-size: 11px; font-weight: 700; padding: 6px 10px; letter-spacing: .08em; }
.sb-chip b { color: var(--orange); letter-spacing: .25em; font-size: 13px; }
.mg-sub.og { color: var(--lime); font-weight: 700; }
.mg-quit { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; background: rgba(11, 18, 32, .85); border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 20px; cursor: pointer; z-index: 2; }
.mg-quit:hover { border-color: var(--lime); }
.mg-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(360px, calc(100% - 32px)); background: var(--panel-solid); border: 1px solid var(--lime); padding: 18px 16px; display: grid; gap: 10px; text-align: center; z-index: 3; }
.mg-card h3 { margin: 0; color: var(--lime); font-size: 15px; letter-spacing: .1em; }
.mg-score { font-size: 44px; font-weight: 700; color: var(--text); line-height: 1; font-variant-numeric: tabular-nums; }
.mg-stats { display: grid; gap: 6px; font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.mg-top { display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--text); font-weight: 700; }
.mg-top canvas { width: 32px; height: 32px; }
.mg-sub { margin: 0; font-size: 11px; color: var(--muted); letter-spacing: .04em; line-height: 1.5; }
.mg-sub.best { color: var(--gold); font-weight: 700; }
.mg-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.mg-actions .btn { flex: 1 1 auto; }

/* SWARM BALL v2 tuning panel (a private match's host, while it warms up). */
.sb-tune { position: absolute; left: 10px; top: 56px; z-index: 3; width: min(340px, calc(100% - 20px)); max-height: calc(100% - 70px); overflow-y: auto; background: rgba(11, 18, 32, .95); border: 1px solid var(--orange); padding: 8px 10px; display: grid; gap: 4px; font-size: 10px; }
.sb-tune-head { display: flex; align-items: center; gap: 6px; }
.sb-tune-head b { flex: 1; color: var(--orange); letter-spacing: .08em; }
.sb-tune-head .btn { width: auto; min-height: 26px; padding: 3px 8px; font-size: 10px; }
.sb-tune-row { display: grid; grid-template-columns: 1fr 120px 42px; gap: 6px; align-items: center; color: var(--muted); }
.sb-tune-row input { width: 100%; accent-color: var(--lime); }
.sb-tune-row .v { color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.sb-tune-row .n { cursor: help; }
.sb-tune-row .n i { font-style: normal; color: var(--orange); }
.sb-tune-group { margin-top: 6px; padding-top: 4px; border-top: 1px solid rgba(255, 255, 255, .12); color: var(--lime); letter-spacing: .08em; }
.sb-tune-help { color: var(--text); background: rgba(255, 255, 255, .05); padding: 4px 6px; line-height: 1.4; }
.sb-tune-help[hidden] { display: none; }

/* SWARM GEMS: played on the town's own map; the panel floats on the right (at the bottom on a phone held upright). */
#gtd { border-color: #4f7dff; background: #0a0f1e; }
#hud > #gt, #hud > #sg, #hud > #rp, #hud > #lr { position: fixed; inset: 0; z-index: 25; pointer-events: none; }
#gt > *, #sg > *, #rp > *, #lr > * { pointer-events: auto; }
/* RUN PEPE RUN: a slimmer panel (the track wants the screen). */
#rpd { border-color: #7ad7ff; background: #08111a; }
.rp-side { width: 240px; bottom: auto; }
.gt-tools #rp-go { grid-column: 1 / -1; }
.rp-down { color: #ff8f6b !important; }
.rp-bar { position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%); display: grid; gap: 6px; background: rgba(11, 18, 32, .9); border: 1px solid var(--line); padding: 8px; font-size: 10px; letter-spacing: .04em; }
.rp-bar[hidden], .rp-pick[hidden] { display: none; }
.rp-xp { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; position: relative; }
.rp-xp > i { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(198, 168, 255, .25); pointer-events: none; }
.rp-xp > span { position: relative; padding: 4px 6px; color: #c6a8ff; font-weight: 700; }
.rp-pts { font: inherit; background: none; border: 1px solid var(--line); color: var(--muted); padding: 4px 8px; cursor: pointer; }
.rp-pts.on { color: #0b1220; background: #c6a8ff; border-color: #c6a8ff; animation: gt-in .6s ease-in-out infinite alternate; }
.rp-slots { display: flex; gap: 4px; align-items: stretch; }
.rp-gap { width: 10px; }
.rp-slot { position: relative; width: 56px; height: 52px; background: #0d1526; border: 1px solid var(--line); color: var(--text); font: inherit; padding: 4px 2px 2px; display: grid; justify-items: center; align-content: start; gap: 2px; overflow: hidden; cursor: pointer; }
.rp-slot.item { width: 46px; }
.rp-slot:disabled { opacity: .45; cursor: default; }
.rp-slot.passive { border-style: dashed; }
.rp-slot b { font-size: 8px; line-height: 1.1; text-align: center; }
.rp-slot small { color: #c6a8ff; font-size: 8px; }
.rp-slot kbd { position: absolute; right: 2px; bottom: 1px; font: inherit; font-size: 8px; color: var(--muted); }
.rp-slot .cd { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: rgba(5, 8, 15, .72); color: #fff; font-style: normal; font-size: 14px; font-weight: 700; display: grid; place-items: center; }
.rp-item { width: 36px; height: 36px; image-rendering: pixelated; }
.rp-n { position: absolute; left: 3px; bottom: 1px; color: #fff !important; }
.rp-pick { position: absolute; left: 50%; bottom: 170px; transform: translateX(-50%); width: min(620px, calc(100vw - 20px)); background: var(--panel-solid); border: 1px solid #c6a8ff; padding: 10px; display: grid; gap: 8px; font-size: 10px; z-index: 3; }
.rp-pick .gt-bookhead .btn { width: auto; min-height: 28px; padding: 2px 10px; }
.rp-skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.rp-skill { font: inherit; text-align: left; background: #0d1526; border: 1px solid var(--line); color: var(--text); padding: 6px; display: grid; gap: 3px; cursor: pointer; }
.rp-skill b { color: #c6a8ff; }
.rp-skill small { color: var(--muted); }
.rp-skill.have { border-color: #c6a8ff; }
.rp-skill:disabled { opacity: .5; cursor: default; }
@media (max-width: 700px) {
  .rp-bar { bottom: auto; top: 54px; padding: 4px; }
  .rp-slot { width: 44px; height: 44px; }
  .rp-slot.item { width: 36px; }
  .rp-item { width: 26px; height: 26px; }
  .rp-pick { bottom: auto; top: 150px; }
}
/* SWARM SIEGE uses the same panel. */
#sgd { border-color: #e3b341; background: #14100a; }
.gt-tools #sg-go, .gt-tools #sg-next { grid-column: 1 / -1; }
.sg-dot { width: 10px; height: 10px; display: inline-block; flex: none; }
.sg-tips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 0 0 4px 16px; }
.gt-side .sg-tips .btn { min-height: 26px; padding: 2px 4px; justify-content: center; box-shadow: none; }
.gt-best .sg-dot { justify-self: center; }
#sg.folded .gt-side > #sg-sel:not(:empty) { display: grid; }
.gt .mg-quit { top: 10px; right: 10px; }
.gt-side { position: absolute; top: 58px; right: 62px; bottom: 70px; width: 290px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; font-size: 11px; letter-spacing: .03em; }
.gt-side > div:empty { display: none; }
.gt-fold { display: none; }
.gt-side h5 { margin: 0 0 4px; font-size: 11px; color: var(--muted); letter-spacing: .06em; font-weight: 700; }
.gt-top { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; background: var(--panel); border: 1px solid var(--line); padding: 8px; }
.gt-top b { font-size: 14px; color: var(--lime); }
.gt-hp { text-align: right; color: var(--orange); font-weight: 700; }
.gt-castle { grid-column: 1 / -1; height: 6px; background: #2a1414; }
.gt-castle i { display: block; height: 100%; background: linear-gradient(90deg, #ef6b55, #ffb070); }
.gt-time { grid-column: 1 / -1; color: var(--muted); }
.gt-sofar { grid-column: 1 / -1; color: var(--gold, #f5c84b); font-weight: 700; }
#gt .gt-top { display: flex; flex-wrap: wrap; gap: 4px; align-items: stretch; padding: 6px; border-color: #3a4a68; box-shadow: inset 0 0 0 1px #111623; }
#gt .gt-chip { display: inline-flex; align-items: baseline; gap: 5px; background: #0b1220; border: 1px solid var(--line); padding: 4px 7px; font-size: 10px; letter-spacing: .05em; white-space: nowrap; }
#gt .gt-chip em { color: var(--muted); font-style: normal; font-size: 9px; }
#gt .gt-chip b { font-size: 12px; color: var(--lime); margin: 0; }
#gt .gt-chip.gt-goldchip b { color: var(--gold); }
#gt .gt-chip.gt-swarm b { color: var(--gold); }
#gt .gt-chip.gt-clock b { color: var(--orange); }
#gt .gt-chip.gt-kills b { color: #c6a8ff; }
#gt .gt-chip.gt-gems b { color: #7ad7ff; }
#gt .gt-castlechip { flex: 1 1 110px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 2px 6px; align-items: center; }
#gt .gt-castlechip .gt-castle { grid-column: 1 / -1; height: 5px; background: #1a0e12; border: 1px solid #3a2024; }
#gt .gt-castlechip b { color: var(--orange); }
.gt-next, .gt-me, .gt-build, .gt-recipes, .gt-info, .gt-team { background: var(--panel); border: 1px solid var(--line); padding: 8px; display: grid; gap: 4px; }
.gt-trait { color: #ffb0a6; }
.gt-gold { font-size: 14px; font-weight: 700; color: var(--gold); }
.gt-odds { color: var(--muted); }
.gt-side .btn { width: 100%; min-height: 36px; padding: 6px 10px; font-size: 11px; box-shadow: 3px 3px 0 var(--orange); display: flex; align-items: center; gap: 8px; text-align: left; }
.gt-side .btn.ghost { box-shadow: none; background: rgba(11, 18, 32, .9); }
.gt-side .btn.on { border-color: var(--orange); color: var(--orange); }
.gt-step { margin: 0; color: var(--text); }
.gt-fast b { color: #ffe27a; }
.gt-where { color: var(--gold); font-weight: bold; letter-spacing: .04em; animation: gt-in .2s ease-out; }
.gt-choices { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.gt-icon { width: 24px; height: 24px; image-rendering: pixelated; flex: none; }
.gt-infohead { display: flex; align-items: center; gap: 8px; }
.gt-infohead b { font-size: 12px; }
.gt-mate { display: grid; grid-template-columns: 10px 1fr auto; gap: 6px; align-items: center; }
.gt-mate i { width: 8px; height: 8px; display: block; }
.gt-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.gt-tools #gt-go { grid-column: 1 / -1; }
.gt-tools #lr-go, .gt-tools #lr-copy, .gt-tools #lr-sit, .gt-tools #lr-codechip, .gt-tools #lr-wait { grid-column: 1 / -1; }
.gt-tools #lr-wait { margin: 0; color: #ffc277; font-size: 11px; letter-spacing: .04em; }
.gt-banner { position: absolute; top: 18%; left: 50%; transform: translateX(-50%); background: rgba(11, 18, 32, .88); border: 1px solid #4f7dff; padding: 10px 18px; text-align: center; display: grid; gap: 4px; pointer-events: none; max-width: min(560px, 80vw); }
.gt-banner b { color: var(--gold); font-size: 20px; letter-spacing: .08em; }
.gt-banner span { color: var(--text); font-size: 11px; letter-spacing: .04em; }
.gt-banner.go { animation: gt-in .25s ease-out; }
@keyframes gt-in { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.gt-bookbox { position: absolute; inset: 40px max(10px, calc(50% - 320px)); z-index: 3; background: var(--panel-solid); border: 1px solid #4f7dff; padding: 12px; overflow-y: auto; font-size: 11px; display: grid; gap: 8px; align-content: start; }
.gt-bookbox[hidden] { display: none; }
.gt-bookhead { display: flex; align-items: center; justify-content: space-between; }
.gt-bookhead .btn { width: auto; min-height: 30px; padding: 2px 10px; }
.gt-booklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.gt-booklist li { border: 1px solid var(--line); padding: 6px; display: grid; gap: 3px; }
.gt-best { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.gt-best li { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: center; font-size: 11px; }
.gt .dim { color: var(--muted); }
.gt .mg-card { position: absolute; }
@media (max-width: 700px) {
  .gt-side { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 42vh; }
  .gt-fold { display: block; position: sticky; top: 0; align-self: flex-end; background: var(--panel-solid); border: 1px solid var(--line); color: var(--text); width: 36px; height: 28px; font: inherit; z-index: 1; }
  .gt.folded .gt-side > :not(.gt-fold):not(.gt-top):not(.gt-build) { display: none; }
  .gt.folded .gt-fold { transform: rotate(180deg); }
}

/* The Boathouse's paint pots */
.paint-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 4px 0 10px; }
.paint-row .paint { background: #0b1220; border: 2px solid #2a3346; padding: 4px; cursor: pointer; line-height: 0; }
.paint-row .paint canvas { width: 45px; height: 21px; image-rendering: pixelated; }
.paint-row .paint:hover, .paint-row .paint:focus-visible { border-color: #c9db4c; }
.paint-row .paint.on { border-color: #ffd25e; }

/* City works contribution amount in the shared confirmation dialog. */
#city-amount { display: grid; gap: 6px; color: var(--lime); font-size: 11px; letter-spacing: .05em; }
#city-amount select { background: #0e1727; border: 1px solid var(--line); color: var(--text); font: inherit; padding: 10px; min-height: 44px; }

/* LAVA RING */
.lr-side { width: 276px; bottom: auto; max-height: calc(100vh - 100px); }
.lr-spells { display: grid; gap: 5px; background: rgba(11,18,32,.92); border: 1px solid #39465c; padding: 8px; grid-template-columns: 1fr 1fr; }
.lr-spells .btn { min-height: 45px; font-size: 10px; display: grid; gap: 1px; padding: 5px 7px; }
.lr-spells .btn small { color: #b0bdc4; font-size: 9px; }
.lr-spells .btn.on { background: #e8833a; color: #111; }
.lr-stick { position: absolute; left: 22px; bottom: 24px; width: 112px; height: 112px; border-radius: 50%; border: 2px solid #e3b341; background: rgba(11,18,32,.7); touch-action: none; }
.lr-stick-knob { position: absolute; left: 37px; top: 37px; width: 34px; height: 34px; border-radius: 50%; background: #e3b341; }
@media (max-width: 700px) {
  .lr-side { top: 45px; right: 8px; left: auto; bottom: auto; width: min(230px, 58vw); max-height: 42vh; }
  .lr-spells .btn { min-height: 38px; }
}

.lr-side { border: 1px solid #6a4d4f; box-shadow: 0 0 0 2px #111623, 0 8px 30px #080b14bb; }
.lr-side .gt-top { border-bottom: 2px solid #d85b37; }
.lr-tip { background: #221c2a; color: #ffc277; border: 1px solid #69423c; padding: 7px 9px; font-size: 9px; letter-spacing: .04em; line-height: 1.5; }
.lr-hot { box-shadow: inset 0 0 0 2px #ff692f, 0 0 20px #fc572866; animation: lr-hot-pulse .35s alternate infinite; }
@keyframes lr-hot-pulse { from { background: #351b27; } to { background: #713020; } }
.lr-spells .btn.on { background: #f09a47; box-shadow: inset 0 0 0 2px #ffe5a0; }
.lr-spells .btn:focus-visible { outline: 2px solid #fff0ae; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .lr-hot { animation: none; } }

@media (max-width: 700px) {
  .lr-side { top: 42px; left: 8px; right: 8px; width: auto; max-height: 36vh; }
  .lr-tip { display: none; }
  .lr-spells { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; padding: 4px; }
  .lr-spells .btn { min-height: 34px; padding: 3px; font-size: 8px; overflow: hidden; }
  .lr-spells .btn small { display: none; }
}

.lr-art { background: radial-gradient(ellipse at 50% 52%, #4b4c55 0 47%, #f98632 48% 54%, #68202a 55% 60%, #101420 61% 67%, #233927 68%); min-height: 100px; }
.lr-full-banner { margin: 8px 0 0; padding: 10px 12px; background: #3a1518; border: 2px solid #ef6b55; color: #ffd0c8; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-align: center; }
.swarm-list li.lr-full { border-color: #ef6b55; background: #241016; }
.swarm-list li.lr-full .when { color: #ef6b55; font-weight: 700; }

/* Unavoidable between-round upgrade phase. Arena stays visible through the veil. */
.lr-choose { position: absolute; inset: 0; z-index: 4; display: flex; align-items: flex-start; justify-content: center; background: linear-gradient(to bottom, rgba(7, 11, 20, .78) 0%, rgba(7, 11, 20, .52) 58%, rgba(7, 11, 20, .34) 100%); padding: 10px 16px 88px; overflow: auto; }
.lr-choose[hidden] { display: none; }
.lr-choose-in { width: min(920px, 100%); margin: 0 auto; display: grid; gap: 8px; align-content: start; }
.lr-choose-head { display: grid; grid-template-columns: 1fr auto auto; gap: 6px 16px; align-items: end; }
.lr-choose-head h2 { margin: 0; grid-column: 1 / -1; color: var(--lime); letter-spacing: .08em; }
.lr-choose-head h2 .px { display: block; }
.lr-choose-head h2 .px svg { height: 22px; }
.lr-choose-gold { margin: 0; font-size: 22px; font-weight: 700; color: #ffd25e; letter-spacing: .08em; text-shadow: 3px 3px 0 #5a3215; }
.lr-choose-count { margin: 0; font-size: 28px; font-weight: 700; color: var(--text); letter-spacing: .1em; font-variant-numeric: tabular-nums; }
.lr-choose-count.warn { color: #ef6b55; animation: lr-count-pulse .35s alternate infinite; }
.lr-choose-ready { margin: 0; grid-column: 1 / -1; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.lr-blast { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; background: rgba(11, 18, 32, .82); border: 2px solid #7adf4a; padding: 6px 8px; box-shadow: 4px 4px 0 #1b2535; }
.lr-blast .lr-prev { width: 108px; height: 60px; }
.lr-blast-copy { display: grid; gap: 2px; }
.lr-blast-copy b { color: #c9db4c; letter-spacing: .08em; font-size: 12px; }
.lr-blast-copy span { color: var(--muted); font-size: 10px; letter-spacing: .04em; }
.lr-choose-slots { display: flex; flex-wrap: wrap; gap: 6px; }
.lr-slot { border: 1px solid #39465c; background: #0e1626; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .06em; padding: 6px 8px; }
.lr-slot.on { color: var(--text); border-color: var(--ink, var(--orange)); box-shadow: inset 0 -3px 0 var(--ink, var(--orange)); }
.lr-choose-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.lr-card { appearance: none; display: grid; gap: 3px; text-align: left; cursor: pointer; font: inherit; color: var(--text); background: rgba(11, 18, 32, .88); border: 2px solid var(--ink, var(--line)); padding: 6px; box-shadow: 4px 4px 0 #1b2535; min-height: 0; width: 100%; }
.lr-card:hover:not(:disabled), .lr-card:focus-visible { box-shadow: 4px 4px 0 var(--ink, var(--orange)); outline: none; }
.lr-card:disabled { cursor: default; }
.lr-card.maxed { border-color: #39465c; color: var(--muted); }
.lr-card.broke { border-color: #ef6b55; }
.lr-card.full { opacity: .7; }
.lr-card-key { justify-self: start; background: var(--ink, var(--lime)); color: #0b1220; font-size: 10px; font-style: normal; font-weight: 700; padding: 1px 6px; letter-spacing: .08em; }
.lr-prev { width: 144px; height: 80px; justify-self: center; image-rendering: pixelated; background: #070b14; border: 1px solid #1b2535; }
.lr-card-name { font-size: 12px; letter-spacing: .08em; color: var(--glow, var(--lime)); }
.lr-card-blurb, .lr-card-stat, .lr-card-meta { font-size: 10px; color: var(--muted); letter-spacing: .04em; line-height: 1.4; }
.lr-card-stat { color: var(--text); font-weight: 700; }
.lr-card-go { font-size: 11px; letter-spacing: .06em; color: #0b1220; background: var(--ink, var(--lime)); padding: 6px 8px; text-align: center; }
.lr-card.maxed .lr-card-go { background: #2a3344; color: #e8eadf; }
.lr-card.broke .lr-card-go { background: #5a2018; color: #ffb0a6; }
.lr-card.full .lr-card-go { background: #2a3344; color: var(--muted); }
#lr-choose-go { width: auto; min-width: 140px; min-height: 36px; padding: 6px 14px; }
#lr.shopping .lr-side, #lr.shopping .lr-stick { visibility: hidden; }
#lr.shopping ~ .bottom { z-index: 26; }
#lr .mg-quit { z-index: 6; }
@keyframes lr-count-pulse { from { transform: scale(1); text-shadow: none; } to { transform: scale(1.08); text-shadow: 0 0 12px #ef6b55; } }
@media (prefers-reduced-motion: reduce) { .lr-choose-count.warn { animation: none; } }
@media (max-width: 700px) {
  .lr-choose { padding: 10px 8px 72px; }
  #lr-choose-go { grid-column: 1 / -1; justify-self: stretch; width: 100%; }
  .lr-choose-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lr-choose-head h2 .px svg { height: 16px; }
  .lr-choose-gold { font-size: 16px; }
  .lr-choose-count { font-size: 20px; }
}

/* SWARM DEFENSE on the SWARM BALL page, and its map editor */
.sd-block { margin-top: 18px; padding-top: 12px; border-top: 1px solid #2a3240; }
.sd-block h4 small { color: var(--muted); }
.mapedit { position: fixed; inset: 0; z-index: 60; background: #0b1220; display: grid; grid-template-rows: auto 1fr; color: var(--text); }
.mapedit-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; border-bottom: 1px solid #2a3240; }
.mapedit-head h3 { margin: 0; font-size: 14px; letter-spacing: .08em; color: var(--lime); }
.mapedit-head .mg-quit { position: static; }
.mapedit-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 12px; padding: 12px 16px; min-height: 0; }
.mapedit-canvas { display: grid; place-items: center; min-height: 0; overflow: auto; }
.mapedit-canvas canvas { image-rendering: pixelated; cursor: crosshair; touch-action: none; border: 1px solid #2a3240; }
.mapedit-side { display: grid; align-content: start; gap: 8px; overflow-y: auto; font-size: 11px; }
.mapedit-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mapedit-row .btn { width: auto; min-height: 28px; padding: 4px 8px; font-size: 10px; }
.mapedit-field { display: grid; gap: 3px; color: var(--muted); letter-spacing: .06em; }
.mapedit-field input { font: inherit; background: #0e1727; color: var(--text); border: 1px solid #2a3240; padding: 5px 6px; min-width: 0; }
.mapedit-size .mapedit-field { width: 64px; }
.mapedit-tools { display: grid; gap: 4px; }
.mapedit-corner { width: 56px; font-size: 10px; letter-spacing: .06em; }
.mapedit-tool { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; background: #0e1727; color: var(--text); border: 1px solid #2a3240; font: inherit; font-size: 10px; cursor: pointer; }
.mapedit-tool i { width: 10px; height: 10px; border: 1px solid #000; display: inline-block; }
.mapedit-tool.on, [data-sym].on { border-color: var(--lime); color: var(--lime); }
.mapedit-status { margin: 0; padding: 6px 8px; background: #0e1727; border-left: 3px solid var(--muted); }
.mapedit-status.ok { border-left-color: #52c43a; color: #b8f5a0; }
.mapedit-status.bad { border-left-color: #e8473a; color: #ffb0a0; }
@media (max-width: 760px) { .mapedit-body { grid-template-columns: 1fr; grid-template-rows: minmax(260px, 55vh) auto; } }

/* The Outfitter (the shop and the bag) and the Outer World's HUD */
.outfit-card { width: min(680px, 100%); max-height: min(92vh, 800px); gap: 8px; padding: 14px; overflow-y: auto; }
.outfit-main { display: grid; gap: 8px; }
.outfit-worn { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.outfit-slot { display: grid; gap: 3px; align-content: start; border: 1px solid var(--line); padding: 6px; font-size: 10px; background: #070b14; min-width: 0; }
.outfit-slot.on { border-color: var(--lime); }
.outfit-slot .k { color: var(--muted); letter-spacing: .08em; font-size: 9px; }
.outfit-slot .nm { font-weight: 700; overflow-wrap: anywhere; }
.outfit-slot .nm.none { color: var(--muted); font-weight: 400; }
.outfit-slot .fx { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.outfit-slots { margin-top: 0; }
.outfit-list { display: grid; gap: 4px; max-height: min(38vh, 300px); overflow-y: auto; }
.outfit-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 2px 8px; align-items: center; border: 1px solid var(--line); padding: 6px 8px; font-size: 11px; }
.outfit-row .nm { grid-column: 2; font-weight: 700; overflow-wrap: anywhere; }
.outfit-row .fx { grid-column: 2; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.outfit-row .act { grid-row: 1 / span 2; grid-column: 3; display: flex; gap: 6px; align-items: center; }
.outfit-item-icon { grid-column: 1; grid-row: 1 / span 2; width: 34px; height: 34px; image-rendering: pixelated; }
.outfit-slot .outfit-item-icon { grid-column: auto; grid-row: auto; }
.outfit-roster-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.outfit-roster-head h3 { width: auto; margin: 0; }
.outfit-fame { color: var(--gold); font-size: 11px; }
.outfit-character-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; width: 100%; }
.outfit-character-card { display: grid; justify-items: start; gap: 3px; border: 1px solid #435268; background: #101b2e; padding: 8px; min-width: 0; }
.outfit-character-card.on { border-color: var(--lime); box-shadow: inset 0 0 0 1px var(--lime); }
.outfit-slot-label, .outfit-level { font-size: 9px; color: var(--muted); }
.outfit-character-icon, .outfit-class-icon, .outfit-class-portrait { image-rendering: pixelated; }
.outfit-character-icon, .outfit-class-portrait { width: 56px; height: 56px; flex-shrink: 0; object-fit: contain; background: radial-gradient(circle, rgba(108,125,162,.2), transparent 70%); }
.outfit-character-card strong { font-size: 12px; }
.outfit-empty-icon { display: grid; place-items: center; width: 40px; height: 40px; border: 1px dashed #526079; color: var(--lime); font-size: 26px; }
.outfit-slot-unlock { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; border: 1px dashed #526079; padding: 7px; font-size: 10px; }
.outfit-class-title { width: 100%; margin: 5px 0 0; font-size: 11px; color: var(--lime); }
.outfit-class-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: 100%; }
.outfit-class-card { display: flex; gap: 8px; align-items: center; border: 1px solid #435268; background: #101b2e; padding: 7px; min-width: 0; }
.outfit-class-card.locked { opacity: .65; }
.outfit-class-info { display: grid; gap: 3px; min-width: 0; flex: 1; }
.outfit-class-info strong { color: #f5f5ea; font-size: 11px; }
.outfit-class-info span, .outfit-class-info small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.outfit-class-card .btn { flex-shrink: 0; }
.outfit-unlock-note { max-width: 90px; color: var(--gold); font-size: 9px; line-height: 1.4; }
.outfit-abilities { display: flex; align-items: center; gap: 9px; }
.outfit-ability-list { display: flex; align-items: center; gap: 8px; }
@media (max-width: 560px) { .outfit-character-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); } .outfit-class-grid { grid-template-columns: 1fr; } .outfit-slot-unlock { flex-direction: column; align-items: flex-start; } .outfit-row .act { flex-wrap: wrap; justify-content: flex-end; } }
.outfit-row .pr { color: var(--gold); font-size: 11px; white-space: nowrap; }
.btn.small { width: auto; min-height: 32px; padding: 6px 10px; font-size: 11px; box-shadow: 2px 2px 0 var(--orange); }
.btn.small.ghost { box-shadow: none; }
.btn.small:disabled { opacity: .45; cursor: default; }
.outfit-confirm { display: grid; gap: 8px; }
.outfit-confirm .nm { margin: 0; font-weight: 700; font-size: 12px; }
.realm-opts { display: grid; gap: 2px; margin-top: 6px; }
.realm-opts .pick-tabs { margin-top: 4px; }
.realm-keys { margin: 4px 0 0; font-size: 10px; letter-spacing: .04em; line-height: 1.5; color: var(--muted); }
.realm-keys b { color: var(--lime); }

