:root {
  --bg: #0B1020;
  --surface: #141B2E;
  --raised: #1D2640;
  --line: #2A3556;
  --text: #F4F6FB;
  --muted: #9AA4BF;
  --action: #FFC53D;
  --energy: #5B5BFF;
  --danger: #FF4D5E;
  --paper: #fbfaf6;
  --ink: #1c2329;
  --link: #2a5db0;
  --t-wormhole: #B36BFF; --t-pathfinder: #2EE6A6; --t-navigator: #38BDF8; --t-trailblazer: #A3E635;
  --t-wanderer: #FFB547; --t-sightseer: #FF8A65; --t-lost: #7C86A2;
  --radius: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); font: 16px/1.5 var(--sans);
  background: radial-gradient(1000px 520px at 50% -220px, rgba(91, 91, 255, .28) 0%, transparent 70%) no-repeat, var(--bg);
}
a { color: var(--action); }
b, strong { font-weight: 600; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* motion */
.btn, .pack, .tabs button, .diffpick button, .gbtn, .top nav a, .archive a {
  transition: transform 180ms var(--ease), background-color 180ms var(--ease), border-color 180ms var(--ease),
    color 180ms var(--ease), filter 180ms var(--ease), box-shadow 180ms var(--ease);
}
.btn:active, .pack:active, .tabs button:active, .diffpick button:active, .gbtn:active {
  transform: scale(.97); transition-duration: 120ms;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px;
  max-width: 1100px; margin: 0 auto; flex-wrap: wrap; }
.logo { font: 800 28px/1 var(--display); color: var(--text); text-decoration: none; letter-spacing: -.8px; }
.logo span { color: var(--action); }
.top nav { display: flex; gap: 4px; }
.top nav a { color: var(--muted); text-decoration: none; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 15px; white-space: nowrap; }
.top nav a:hover { color: var(--text); }
.top nav a.on { background: var(--raised); color: var(--text); }
@media (max-width: 560px) {
  .top { padding: 12px 16px 6px; }
  .top nav { width: 100%; overflow-x: auto; margin: 0 -6px; scrollbar-width: none; }
  .top nav::-webkit-scrollbar { display: none; }
  .top nav a { padding: 8px 11px; font-size: 14px; }
}
main { max-width: 1100px; margin: 0 auto; padding: 8px 20px 60px; }
@media (max-width: 560px) { main { padding: 8px 16px 48px; } }

/* generic */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -.5px; margin: 0 0 8px; overflow-wrap: anywhere; }
h1 { font-size: clamp(32px, 6vw, 52px); line-height: 1.02; }
h2 { font-size: 26px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { text-transform: uppercase; letter-spacing: 2px; font-size: 12px; font-weight: 600; color: var(--action); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px;
  min-height: 48px; padding: 12px 24px; font-weight: 600; background: var(--action); color: var(--bg); text-decoration: none;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .35); }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: var(--raised); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--muted); }
.btn.small { padding: 8px 16px; font-size: 14px; }
.btn.coral { background: var(--danger); color: #fff; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
input[type=text], input[type=email] { font: inherit; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); min-width: 0; }
:focus-visible { outline: 3px solid var(--energy); outline-offset: 2px; }
.stat b, .stats b, .scoreline, .countdown, table.lb, .diffpick span { font-variant-numeric: tabular-nums; }

/* home */
.today { position: relative; overflow: hidden; margin: 14px 0 22px; padding: clamp(22px, 4vw, 36px); border-radius: 24px;
  background: radial-gradient(600px 300px at 100% 0%, rgba(255, 197, 61, .22), transparent 70%),
              linear-gradient(140deg, var(--energy) 0%, #2B2F8F 55%, var(--surface) 100%);
  border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 18px 50px -20px rgba(91, 91, 255, .6); }
.today .eyebrow { color: var(--text); opacity: .85; }
.today h1 { margin: 6px 0 18px; }
.today .walk { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font: 800 clamp(22px, 4.4vw, 34px)/1.1 var(--display); letter-spacing: -.4px; }
.today .walk i { font-style: normal; color: var(--action); }
.today .meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0 22px; color: rgba(244, 246, 251, .8); font-size: 14px; }
.today .meta .diff { background: rgba(11, 16, 32, .45); }
.today .foot { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.today .btn { font-size: 18px; padding: 14px 34px; min-height: 56px; }
.countdown { font-size: 13px; color: rgba(244, 246, 251, .8); }
.countdown b { display: block; font: 800 26px/1 var(--display); color: var(--text); letter-spacing: .5px; }

/* hero / pre-game */
.hero { text-align: center; padding: 26px 0 10px; }
.hero p { max-width: 560px; margin: 8px auto 0; }
.matchup { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: stretch; margin: 26px 0; }
.end { background: var(--paper); color: var(--ink); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.end .lbl { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; font-weight: 600; padding: 12px 16px 0; color: #6b7a86; }
.end h3 { font-size: 24px; padding: 2px 16px 0; color: var(--ink); }
.end p { margin: 4px 16px 16px; font-size: 14px; color: #44515c; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.end img { width: 100%; height: 150px; object-fit: cover; background: #dde3e7; }
.end .noimg { height: 150px; background: linear-gradient(135deg, #cfe3ea, #e9eef1); display: grid; place-items: center; font-size: 46px; }
.arrow { align-self: center; font-size: 30px; color: var(--action); text-align: center; }
.arrow i { font-style: normal; }
.arrow b { display: block; font: 800 14px var(--sans); color: var(--muted); margin-top: 4px; white-space: nowrap; }
@media (max-width: 680px) {
  .matchup { grid-template-columns: 1fr; }
  .arrow i { display: inline-block; transform: rotate(90deg); }
  .arrow { display: flex; align-items: center; justify-content: center; gap: 10px; }
  .matchup .arrow b, .matchup .arrow .diff { margin: 0; }
}
.rules { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; font-size: 14px; color: var(--muted); margin-top: 14px; }

/* play HUD */
.hud { position: sticky; top: 0; z-index: 5; background: rgba(11, 16, 32, .92); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px;
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.hud .route { flex: 1 1 300px; min-width: 0; font-size: 14px; }
@media (max-width: 560px) {
  .hud { gap: 8px; padding: 10px 12px; }
  .hud .stat { min-width: 46px; }
  .hud .btn.small { padding: 8px 12px; }
}
.hud .route .target { font-weight: 600; color: var(--action); }
.crumbs { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: rtl; text-align: left; }
.stat { text-align: center; min-width: 56px; }
.stat b { display: block; font: 800 22px/1 var(--display); }
.stat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.depth { height: 4px; border-radius: 4px; background: var(--raised); flex-basis: 100%; overflow: hidden; }
.depth i { display: block; height: 100%; background: linear-gradient(90deg, var(--t-pathfinder), var(--action), var(--danger)); transition: width 180ms var(--ease); }

/* article */
#article { background: var(--paper); color: var(--ink); border-radius: var(--radius); padding: 24px clamp(16px, 4vw, 40px) 40px;
  font: 16px/1.6 Georgia, "Times New Roman", serif; overflow-wrap: break-word; min-height: 60vh; position: relative; }
#article.loading { opacity: .5; pointer-events: none; }
#article h1.atitle { font: 400 32px/1.2 Georgia, serif; border-bottom: 1px solid #c8ccd1; padding-bottom: 6px; margin: 0 0 14px; color: var(--ink); }
#article h2 { font: 400 24px/1.3 Georgia, serif; border-bottom: 1px solid #c8ccd1; margin: 26px 0 8px; padding-bottom: 3px; }
#article h3, #article h4 { font: 600 17px var(--sans); margin: 18px 0 6px; }
#article a { color: var(--link); text-decoration: none; }
#article a:hover { text-decoration: underline; }
#article a.dead { color: inherit; pointer-events: none; }
#article a.anchor { color: #5a6c7a; }
#article img { max-width: 100%; height: auto; }
#article table { border-collapse: collapse; font-size: 13.5px; }
#article .tablewrap { overflow-x: auto; max-width: 100%; margin: 6px 0 14px; -webkit-overflow-scrolling: touch; }
#article .tablewrap.scrolls { padding-bottom: 4px; box-shadow: inset -14px 0 12px -12px rgba(0, 0, 0, .35); }
#article .tablewrap::-webkit-scrollbar { height: 8px; }
#article .tablewrap::-webkit-scrollbar-track { background: #eceef0; border-radius: 4px; }
#article .tablewrap::-webkit-scrollbar-thumb { background: #a9b1b8; border-radius: 4px; }
#article .scrollhint { font: 600 12px var(--sans); color: #6b7a86; margin-top: 10px; }
#article td, #article th { vertical-align: top; padding: 3px 6px; }
#article table.wikitable td, #article table.wikitable th { border: 1px solid #a2a9b1; }
#article table.wikitable th { background: #eaecf0; }
#article .infobox { float: right; clear: right; width: 300px; margin: 0 0 14px 18px; background: #f3f4f6; border: 1px solid #a2a9b1;
  font: 13px/1.4 var(--sans); display: table; }
#article .infobox th, #article .infobox td { padding: 3px 6px; }
#article .infobox-above, #article .infobox-title { font-size: 17px; font-weight: 600; text-align: center; }
#article .infobox-header { background: #e1e5ea; text-align: center; }
#article figure, #article .thumb { margin: 6px 0 14px 18px; float: right; clear: right; max-width: 260px;
  background: #f3f4f6; border: 1px solid #c8ccd1; padding: 4px; font: 12px/1.4 var(--sans); }
#article figure.mw-halign-left, #article .tleft { float: left; margin: 6px 18px 14px 0; }
#article figure.mw-halign-center, #article figure.mw-halign-none { float: none; margin: 10px auto; }
#article figcaption { padding: 4px 2px 0; }
#article .hatnote, #article .dablink { font-style: italic; color: #54595d; padding-left: 1.6em; margin-bottom: 8px; font-size: 15px; }
#article .navbox, #article .navbox-inner { width: 100%; font: 12px/1.5 var(--sans); border: 1px solid #a2a9b1; margin-top: 10px; clear: both; display: table; }
#article .navbox-title, #article .navbox-group { background: #ccccff; font-weight: 600; padding: 2px 6px; }
#article .navbox-group { background: #ddddff; text-align: right; white-space: nowrap; }
#article .navbox-list { padding: 2px 6px; }
#article .navbox-list ul, #article .hlist ul { margin: 0; padding: 0; }
#article .hlist li, #article .navbox-list li { display: inline; }
#article .hlist li:not(:last-child)::after, #article .navbox-list li:not(:last-child)::after { content: " · "; font-weight: 600; }
#article .reflist, #article .references { font-size: 13px; }
#article .mw-editsection, #article .noprint.mw-empty-elt, #article .mw-empty-elt, #article .metadata.ambox,
#article .ambox, #article .navbar, #article .sistersitebox, #article .mw-jump-link, #article .portalbox,
#article .side-box, #article .mw-references-wrap .mw-cite-backlink { display: none; }
#article .shortdescription { display: none; }
#article sup { line-height: 0; }
#article blockquote { border-left: 3px solid #c8ccd1; margin: 10px 0; padding: 0 14px; color: #3d474f; }
#article .gallery { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }
#article .gallerybox { width: 160px; font-size: 12px; }
#article .tmulti .trow { display: flex; gap: 4px; }
@media (max-width: 680px) {
  #article .infobox, #article figure, #article .thumb { float: none; width: 100% !important; max-width: 100%; margin: 10px 0; }
}
.reached-flash { animation: flash 1s; }
@keyframes flash { from { box-shadow: 0 0 0 6px var(--action); } to { box-shadow: 0 0 0 0 transparent; } }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(5, 8, 18, .8); display: grid; place-items: center; z-index: 50; padding: 16px; overflow-y: auto; }
.modal .box { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px; width: min(520px, 100%);
  max-height: calc(100vh - 32px); overflow-y: auto; position: relative; }
.modal .x { position: absolute; top: 8px; right: 8px; width: 48px; height: 48px; background: none; border: 0; color: var(--muted); font-size: 28px; }
.tier { text-align: center; }
.tier .emoji { font-size: 64px; line-height: 1; }
.tier h2 { font-size: 38px; margin: 6px 0 0; color: var(--tc, var(--text)); }
.t-wormhole { --tc: var(--t-wormhole); } .t-pathfinder { --tc: var(--t-pathfinder); } .t-navigator { --tc: var(--t-navigator); }
.t-trailblazer { --tc: var(--t-trailblazer); } .t-wanderer { --tc: var(--t-wanderer); } .t-sightseer { --tc: var(--t-sightseer); } .t-lost { --tc: var(--t-lost); }
.scoreline { display: flex; justify-content: center; gap: 26px; margin: 16px 0; }
.pathlist { font-size: 14px; background: var(--bg); border-radius: 10px; padding: 10px 14px; margin: 10px 0; }
.pathlist b { color: var(--action); }
.pathlist .step { color: var(--muted); }

/* depth scale */
.scale { display: grid; gap: 6px; margin: 12px 0; }
.scale div { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 10px; font-size: 14px; background: var(--raised);
  border-left: 4px solid var(--tc, var(--line)); }
.scale div > span:first-child { font: 800 15px var(--display); color: var(--tc, var(--text)); }
.scale div.me { outline: 2px solid var(--tc, var(--action)); background: color-mix(in srgb, var(--tc, var(--action)) 16%, var(--raised)); }

/* leaderboards & lists */
.tabs { display: flex; gap: 6px; margin: 10px 0; }
.tabs button { min-height: 48px; background: var(--raised); color: var(--muted); border: 0; border-radius: 999px; padding: 6px 18px; font-weight: 600; font-size: 14px; }
.tabs button.on { background: var(--action); color: var(--bg); }
table.lb { width: 100%; border-collapse: collapse; font-size: 14px; }
table.lb td, table.lb th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
table.lb th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
table.lb tr.me td { color: var(--action); font-weight: 600; }
.pack { cursor: pointer; transition: transform .15s; text-decoration: none; color: inherit; display: block; }
.pack:hover { transform: translateY(-3px); border-color: var(--energy); }
.pack .ico { font-size: 32px; }
.bar { height: 6px; background: var(--bg); border-radius: 6px; overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; background: var(--t-pathfinder); }
.archive a { display: flex; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.archive a:hover { background: var(--raised); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; text-align: center; }
.stats div { background: var(--raised); border-radius: 12px; padding: 14px 6px; }
.stats b { display: block; font: 800 28px/1 var(--display); }
.stats span { font-size: 12px; color: var(--muted); }
.gbtn { min-height: 48px; background: #fff; color: #1f1f1f; border: 0; border-radius: 999px; padding: 11px 20px; font-weight: 600; display: inline-flex; gap: 10px; align-items: center; }
.ok { color: var(--t-pathfinder); } .err { color: var(--danger); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--action); color: var(--bg);
  padding: 10px 18px; border-radius: 999px; font-weight: 600; z-index: 60; }
.spinner { text-align: center; padding: 60px; color: var(--muted); }
footer.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 30px 0 0; }

/* difficulty */
.diff { display: inline-block; font: 600 11px/1 var(--sans); letter-spacing: 1px; text-transform: uppercase; padding: 4px 8px;
  border-radius: 999px; border: 1px solid currentColor; vertical-align: middle; }
.arrow .diff { margin-top: 8px; }
.d-e { color: #A3E635; } .d-m { color: #38BDF8; } .d-h { color: #FF8A65; } .d-x { color: #B36BFF; }
.tryeasy { text-align: center; margin: 12px 0 0; }
.diffpick { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.diffpick button { min-height: 48px; background: var(--raised); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 14px; color: var(--text); }
.diffpick button span { font-weight: 400; opacity: .6; font-size: 12px; }
.diffpick button.on { border-color: currentColor; background: var(--bg); box-shadow: 0 0 0 1px currentColor inset; }
.diffpick button:not(.on):hover { border-color: var(--muted); }
.diffpick button.d-e { color: #A3E635; } .diffpick button.d-m { color: #38BDF8; } .diffpick button.d-h { color: #FF8A65; } .diffpick button.d-x { color: #B36BFF; }

/* profile editor */
.editor { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.editor label, .editor .lbl { display: block; font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.editor .lbl { margin-top: 10px; }
img.av { border-radius: 50%; object-fit: cover; background: var(--raised); }
.avgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; max-width: 520px; }
.avgrid button { aspect-ratio: 1; padding: 4px; border-radius: 50%; border: 2px solid transparent; background: var(--raised);
  transition: transform 180ms var(--ease), border-color 180ms var(--ease); }
.avgrid button img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.avgrid button:hover { transform: scale(1.06); }
.avgrid button:active { transform: scale(.94); }
.avgrid button[aria-checked="true"] { border-color: var(--action); }

/* level chip (xp flag) */
.lvlslot:empty { display: none; }
.lvlslot { margin: 10px 0 0; }
.lvlslot.inset { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.lvlchip { display: flex; gap: 12px; align-items: center; }
.lvltext { flex: 1; min-width: 0; display: grid; gap: 4px; max-width: 360px; }
.lvltext b { font: 800 18px var(--display); }
.lring { position: relative; display: inline-grid; place-items: center; flex: none; }
.lring svg { position: absolute; inset: 0; }
.lring circle { fill: none; stroke-width: 5; }
.lring .trk { stroke: var(--raised); } .lring .val { stroke: var(--action); stroke-linecap: round; }
.lring b { font: 800 18px var(--display); font-variant-numeric: tabular-nums; }
.xpbar { height: 8px; border-radius: 999px; background: var(--raised); overflow: hidden; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--energy), var(--action)); transform-origin: left; }
.xpgain { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 12px; }
.xpgain:empty { display: none; }
.xpgain b { font: 800 26px var(--display); color: var(--action); }
.num { font-variant-numeric: tabular-nums; }

/* ---- shared cinematic layer ---- */
.cine { position: fixed; inset: 0; z-index: 60; overflow: hidden; background: #0A0F24; color: var(--text); cursor: pointer; }
.skiphint { position: absolute; bottom: max(14px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  font-size: 12px; color: rgba(244, 246, 251, .55); letter-spacing: 1px; text-transform: uppercase; }

.confetti { position: fixed; z-index: 80; width: 9px; height: 13px; border-radius: 2px; pointer-events: none; }

/* level-up / promotion moment (screen 8) */
.celebrate { display: grid; place-items: center; background: radial-gradient(600px 420px at 50% 40%, rgba(255, 197, 61, .22), transparent 70%), #0A0F24; }
.cel { text-align: center; padding: 20px; }
.cel .kick { text-transform: uppercase; letter-spacing: 4px; font-weight: 700; color: var(--action); }
.cel h2 { font-size: clamp(32px, 8vw, 64px); margin: 6px 0 18px; text-wrap: balance; }
.badgebox { position: relative; width: 180px; height: 180px; margin: 0 auto 18px; }
.badgebox > div { position: absolute; inset: 0; display: grid; place-items: center; }
.badgebox .newb { visibility: hidden; }
.bigring { width: 160px; height: 160px; border-radius: 50%; display: grid; place-items: center; font: 800 64px var(--display); font-variant-numeric: tabular-nums;
  background: radial-gradient(circle at 35% 30%, #FFE08A, var(--action) 55%, #C98A00); color: #1b1300; box-shadow: 0 0 0 8px rgba(255, 197, 61, .25), 0 20px 50px -10px rgba(255, 197, 61, .6); }
.oldb .bigring { filter: grayscale(.6) brightness(.8); }
.cel .sub { color: var(--muted); min-height: 1.5em; }

/* career card, history, public profile (xp flag) */
.career h3.sub { font-size: 18px; margin: 22px 0 10px; }
.achs { display: flex; flex-wrap: wrap; gap: 8px; }
.ach { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--raised); color: var(--muted); border: 1px dashed var(--line); }
.ach i { font-style: normal; filter: grayscale(1); opacity: .5; }
.ach.got { color: var(--text); border: 1px solid color-mix(in srgb, var(--action) 60%, transparent); background: color-mix(in srgb, var(--action) 12%, var(--raised)); }
.ach.got i { filter: none; opacity: 1; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.history { display: grid; gap: 6px; }
.hrow { display: grid; grid-template-columns: 32px 32px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px;
  background: var(--raised); color: var(--text); text-decoration: none; border-left: 4px solid var(--muted); }
.hrow.win { border-left-color: var(--action); } .hrow.loss { border-left-color: var(--energy); }
.hres { font: 800 18px var(--display); text-align: center; } .hrow.win .hres { color: var(--action); } .hrow.loss .hres { color: #a5a5ff; }
.hname { display: flex; flex-direction: column; min-width: 0; } .hname b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hscore { font-weight: 700; }
@media (max-width: 560px) { .hrow { grid-template-columns: 26px 32px minmax(0, 1fr) auto; } .hdate { display: none; } }
.pubhead { display: flex; gap: 18px; align-items: center; padding: 26px 0 18px; }
.pubhead h1 { margin: 0 0 6px; overflow-wrap: anywhere; }
@media (max-width: 560px) { .pubhead { flex-direction: column; text-align: center; } .pubhead .row { justify-content: center; } }

/* division badge (ranked flag) */
.divb { position: relative; display: inline-grid; place-items: center; flex: none; vertical-align: middle; }
.divb svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.divb path { fill: color-mix(in srgb, var(--dc) 30%, #0B1020); stroke: var(--dc); stroke-width: 2.5; }
.divb b { position: relative; font: 800 13px var(--display); color: var(--dc); margin-top: -2px; }
.bigdiv .divb b, .divb.big b { font-size: 40px; }

/* leaderboards (ranked / xp flags) */
.groupchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.groupchips button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--raised); color: var(--muted); font-weight: 600; font-size: 13px; }
.groupchips button.on { background: var(--text); color: var(--bg); }
ol.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
ol.board li { display: grid; grid-template-columns: 36px 36px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--raised); }
ol.board li.me { outline: 2px solid var(--action); }
.brank { font: 800 18px var(--display); text-align: center; color: var(--muted); }
ol.board li:nth-child(-n+3) .brank { color: var(--action); }
.bname { color: var(--text); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bdiv { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.bval { font-weight: 700; text-align: right; }
@media (max-width: 560px) { ol.board li { grid-template-columns: 26px 32px minmax(0, 1fr) auto auto; gap: 8px; } .bdiv > span:not(.divb) { display: none; } }
.rankbadge { display: flex; gap: 10px; align-items: center; }

/* plans and paywall (plans flag) */
.paywall { text-align: center; padding: 10px 6px; }
.pwbadge, .probadge { display: inline-block; padding: 3px 10px; border-radius: 999px; font: 800 12px var(--display); letter-spacing: 2px;
  background: linear-gradient(135deg, #FFD66B, var(--action)); color: var(--bg); text-decoration: none; }
.pwbadge { margin-bottom: 10px; }
.billing { display: flex; justify-content: center; gap: 4px; margin: 6px auto 18px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); width: max-content; }
.billing button { border: 0; border-radius: 999px; padding: 10px 18px; min-height: 44px; font-weight: 700; background: transparent; color: var(--muted); }
.billing button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.billing span { color: var(--t-pathfinder); font-size: 12px; }
.billing button[aria-pressed="true"] span { color: #0a7a55; }
.tiers { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 12px; align-items: stretch; }
@media (max-width: 760px) { .tiers { grid-template-columns: 1fr; } }
.tier-card { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.tier-card.current { outline: 2px solid var(--muted); }
.tier-card.pro { border: 1px solid var(--action); background: radial-gradient(400px 200px at 100% 0, rgba(255, 197, 61, .18), transparent 70%), var(--surface); }
.tier-card .price { font: 800 34px var(--display); } .tier-card .price span { font-size: 15px; color: var(--muted); font-weight: 600; }
table.compare { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 480px; }
table.compare th, table.compare td { padding: 10px 8px; text-align: left; }
table.compare tbody tr:nth-child(odd) { background: rgba(255, 255, 255, .03); }
table.compare td:last-child { color: var(--action); font-weight: 600; }
.locked { padding: 16px; border-radius: 14px; border: 1px dashed var(--line); text-align: center; }
.usage { margin: 2px 0 10px; }

/* shop + avatar editor (shop flag) */
.avsvg { flex: none; display: inline-block; vertical-align: middle; }
.shophead { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-end; padding: 20px 0 14px; }
.shophead h1 { margin: 0; }
.wallet { display: flex; gap: 10px; align-items: center; padding: 6px 6px 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.wallet b { font-size: 16px; }
.itemgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 22px; }
.itemgrid.small { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.itemcard { --rc: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 10px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); border-bottom: 3px solid var(--rc); color: var(--text); text-align: center;
  transition: transform 180ms var(--ease), border-color 180ms var(--ease); }
button.itemcard:hover { transform: translateY(-2px); border-color: var(--rc); }
.itemcard.on { outline: 2px solid var(--action); }
.itemcard.locked { opacity: .55; } .itemcard.owned .price { color: var(--t-pathfinder); }
.itemcard b { font-size: 14px; } .itemcard .rar, .sheet .rar { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--rc); }
.itemcard .price { font-weight: 700; font-size: 13px; }
.itemcard .rar { text-transform: none; letter-spacing: 0; font-weight: 600; }
.txtitem { display: grid; place-items: center; min-height: 64px; font: 800 15px var(--display); color: var(--action); }
.bundles { display: grid; gap: 10px; margin-bottom: 22px; }
.bundle { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.bundle > div { display: grid; gap: 6px; justify-items: start; }
.sheet { text-align: center; } .sheet .prev.big { display: block; margin: 0 auto 10px; } .sheet .kick { color: var(--action); font-weight: 800; letter-spacing: 3px; text-transform: uppercase; }
.inkpacks { display: grid; gap: 8px; margin: 14px 0; } .inkpacks div { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; text-align: left; }
.aved { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 18px; padding-top: 18px; }
@media (max-width: 760px) { .aved { grid-template-columns: 1fr; } }
.avprev { position: sticky; top: 10px; align-self: start; display: grid; gap: 14px; padding: 18px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }
@media (max-width: 760px) { .avprev { position: static; } }
.avstage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 270px; border-radius: 18px;
  background: radial-gradient(circle at 50% 40%, rgba(91, 91, 255, .25), transparent 70%), #0A0F24; }
.avstage b { font: 800 22px var(--display); }
.avstage.vs { background: linear-gradient(135deg, #FFD66B, var(--action)); color: #1b1300; }
.avstage.row { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 16px; min-height: 90px; }
.seg { display: flex; justify-content: center; gap: 4px; }
.seg button { border: 1px solid var(--line); background: var(--raised); color: var(--muted); border-radius: 999px; padding: 6px 12px; min-height: 40px; font-weight: 600; font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.tabs.slots { flex-wrap: wrap; }

/* admin dashboard (admin flag) */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { display: grid; gap: 2px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.kpi span { font-size: 13px; color: var(--muted); } .kpi b { font: 800 30px/1.1 var(--display); } .kpi small { color: var(--muted); font-size: 12px; }
.agrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 860px) { .agrid { grid-template-columns: 1fr; } }
.agrid h3 { font-size: 17px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: #2A3556; stroke-width: 1; } .chart .tick { fill: #9AA4BF; font: 11px var(--sans); }
.chart .dlabel { fill: #F4F6FB; font: 600 11px var(--sans); }
.chart .hit { fill: transparent; } .chart .xhair { stroke: #9AA4BF; stroke-width: 1; }
.cwrap { position: relative; }
.ctip { position: absolute; top: 0; transform: translateX(-50%); pointer-events: none; padding: 8px 10px; border-radius: 10px; background: var(--raised);
  border: 1px solid var(--line); font-size: 12px; white-space: nowrap; box-shadow: 0 8px 20px rgba(0, 0, 0, .35); }
.ctip i, .legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.tview summary { cursor: pointer; font-size: 12px; color: var(--muted); margin-top: 6px; }
.tview table, .atable { width: 100%; border-collapse: collapse; font-size: 13px; }
.tview td, .tview th, .atable td, .atable th { padding: 6px 8px; text-align: left; } .atable tr:nth-child(even) { background: rgba(255, 255, 255, .03); }
.admin .card { overflow-x: auto; }   /* wide tables scroll inside their card on phones */
.atable td { white-space: nowrap; } .atable td.small { white-space: normal; min-width: 200px; }

/* casual side modes (flag: sidemodes) */
.sidemodes { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.sidemodes a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; }
.sidemodes a[aria-current] { border-color: var(--action); color: var(--action); }
.trichips { display: inline-flex; flex-wrap: wrap; gap: 6px; vertical-align: middle; min-width: 0; max-width: 100%; }
.end .trichips { display: flex; padding: 10px 16px 16px; }
.tchip { padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); color: var(--action); font-weight: 600; font-size: 13px; overflow-wrap: anywhere; }
.tchip.hit { color: var(--t-pathfinder); border-color: currentColor; }
.sidechips { margin-top: 0; }
/* Bot opponents (flag: bots): always labelled */
.bottag { display: inline-block; vertical-align: middle; margin-left: 4px; padding: 1px 6px; border-radius: 6px; background: var(--energy); color: #fff;
  font: 800 11px/1.5 var(--sans); letter-spacing: 1px; white-space: nowrap; flex: none; }
.botfound { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 18px; }

/* challenge links (flag: challenge) */
.chghost { margin-top: 4px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chghost b { color: var(--text); font-weight: 600; }
.chghost.done b { color: var(--danger); }
.chmake { margin-top: 12px; text-align: left; }
.chmake label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.chmake input { flex: 1 1 160px; min-width: 0; }
.chmake #chlink { width: 100%; margin-top: 8px; font-size: 12px; }
.chvs { margin: 16px auto; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.chvs th, .chvs td { padding: 6px 16px; text-align: center; }
.chvs th { font-size: 13px; color: var(--muted); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chvs td:first-child { text-align: left; color: var(--muted); font-size: 13px; }
.chvs td:not(:first-child) { font: 800 20px/1 var(--display); }
.chcard h1 { overflow-wrap: anywhere; }

/* Weekly recap (flag weekly_recap): shared by the home card and #/recap */
.rstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; text-align: center; margin: 6px 0 12px; }
.rstats div { background: rgba(255, 255, 255, .07); border-radius: 12px; padding: 10px 4px; }
.rstats b { display: block; font: 800 22px/1.1 var(--display); }
.rstats span { font-size: 12px; color: var(--muted); }
.rbest, .rtopics { display: grid; gap: 3px; margin-bottom: 12px; overflow-wrap: anywhere; }
.rtopics ul { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.rtopics li { display: flex; gap: 6px; align-items: center; padding: 5px 10px; border-radius: 999px; background: rgba(46, 230, 166, .15); }
.rtopics li .num { font-size: 12px; opacity: .8; }
.recap { display: grid; gap: 4px; }
.recap .btn { justify-self: start; }
