:root {
  --bg: #12151f;
  --panel: #1b2030;
  --panel-2: #232a3e;
  --panel-3: #2a3350;
  --line: #34405e;
  --line-2: #46557c;
  --ink: #e8ecf4;
  /* 7.3:1 and 4.7:1 on --panel */
  --muted: #a3aec6;
  --faint: #7e8aa8;
  --accent: #7fc8e8;
  --gold: #f0c45a;
  --warn: #f0c45a;
  --good: #79b04a;
  --bad: #e05a5a;
  --violet: #b46cff;
  --pixel: 'Pixelify Sans', ui-monospace, monospace;
  --sans: 'Inter', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--sans); font-feature-settings: 'tnum' 1; }
button, input, select { font: inherit; color: inherit; }
img, canvas { image-rendering: pixelated; }
/* Pixelify Sans only for the logo and large titles without digits; Inter for every number and label. */
h1, h2 { font-family: var(--pixel); font-weight: 600; letter-spacing: .02em; }
h3 { font-weight: 600; }
.px { font-weight: 600; font-variant-numeric: tabular-nums; }
a { color: var(--accent); }

.btn { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: #2b6f9e; border-color: #5fc8f0; }
.btn.gold { background: #7a3f1e; border-color: var(--gold); }
/* A diamond purchase waiting for its second click. */
.btn.gold.armed { background: var(--gold); color: #1a1206; border-color: #fff3c4; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.small { padding: 3px 8px; font-size: 12px; }
input, select { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; }

/* Landing (sign-in): the pitch on the left, the form card on the right; stacked on phones. Owned by the landing thread. */
.landing { position: relative; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 520px) 360px; gap: 56px;
  align-items: center; justify-content: center; padding: 32px 16px; overflow: hidden; isolation: isolate; }
.landing::before { content: ''; position: absolute; z-index: -1; left: 50%; top: 50%; width: 1400px; height: 1000px; transform: translate(-62%, -50%); pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(224, 120, 48, .2) 0, rgba(160, 70, 30, .08) 35%, transparent 65%); }
.landing .pitch { text-align: center; }
.landing h1 { margin: 0; font-size: 76px; line-height: .95; }
.landing .tag { margin: 14px 0 0; font-size: 22px; text-wrap: balance; }
/* The phoenix's front-facing idle loop from its sheet (80 px frames, idle = columns 4-11), drawn at 4x. */
.landing .hero { position: relative; width: 320px; height: 290px; margin: 0 auto 8px; }
.landing .hero .beast { position: absolute; inset: -20px 0 -10px; background: url(creatures/sheets/phoenix.png) -1280px 0 / 5760px 1280px no-repeat;
  image-rendering: pixelated; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .45)); animation: hero-idle 1.2s steps(8) infinite, hero-float 3.6s ease-in-out infinite; }
.landing .hero .glow { position: absolute; inset: 0 10px 10px; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 196, 100, .55) 0, rgba(240, 120, 40, .25) 38%, transparent 68%); animation: hero-glow 3.6s ease-in-out infinite; }
@keyframes hero-idle { to { background-position-x: -3840px; } }
@keyframes hero-float { 50% { transform: translateY(-8px); } }
@keyframes hero-glow { 50% { opacity: .7; transform: scale(.94); } }
.landing .embers { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.landing .embers i { position: absolute; bottom: -8px; left: var(--x); width: 3px; height: 3px; background: #f3a24a; box-shadow: 0 0 6px 1px rgba(240, 140, 60, .7);
  opacity: 0; animation: ember var(--d) linear var(--w) infinite; }
@keyframes ember { 10% { opacity: .8; } 80% { opacity: .5; } to { opacity: 0; transform: translate(30px, -92vh); } }
.auth { padding: 26px 28px 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.auth .modes { display: flex; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.auth .modes button { flex: 1; padding: 0 0 10px; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--muted); cursor: pointer; font: inherit; font-size: 16px; }
.auth .modes button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.auth form { display: grid; gap: 10px; }
.auth form input { padding: 11px 12px; font-size: 16px; }
.auth form .btn { margin-top: 6px; padding: 12px; }
.auth .err { color: var(--bad); }
.auth .err:empty { display: none; }
.auth .legal { margin-top: 16px; text-align: center; font-size: 13px; color: var(--faint); }
.auth .legal a { color: inherit; text-decoration: none; }
.auth .legal a:hover { text-decoration: underline; }
/* Account extras (client/account.ts): provider buttons, forgot link, and the one-card screens. Owned by the accounts thread. */
.auth .providers { display: grid; gap: 8px; }
.auth .btn.provider { display: block; padding: 11px; text-align: center; text-decoration: none; }
.auth .or { display: flex; align-items: center; gap: 10px; margin: 4px 0; color: var(--faint); font-size: 13px; }
.auth .or::before, .auth .or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.auth .forgot { justify-self: center; color: var(--muted); font-size: 13px; }
.auth .inapp { margin: 2px 0 0; text-align: center; color: var(--faint); font-size: 13px; }
.auth .err.note { color: var(--muted); }
.landing.solo { grid-template-columns: minmax(0, 380px); }
.landing.solo h2 { margin: 0 0 6px; font-size: 30px; }
.landing.solo .lead { margin: 0 0 16px; color: var(--muted); }
.landing.solo .switch { margin-top: 14px; font-size: 14px; }
@media (max-width: 899px) {
  .landing { grid-template-columns: minmax(0, 400px); gap: 28px; align-content: center; }
  .landing::before { transform: translate(-50%, -62%); }
  .landing h1 { font-size: 56px; }
  .landing .tag { font-size: 19px; }
  .landing .hero { width: 240px; height: 210px; }
  .landing .hero .beast { inset: -18px 0 -12px; background-size: 4320px 960px; background-position: -960px 0; animation-name: hero-idle-s, hero-float; }
}
@keyframes hero-idle-s { to { background-position-x: -2880px; } }
@media (prefers-reduced-motion: reduce) { .landing .hero .beast, .landing .hero .glow, .landing .embers { animation: none; } .landing .embers { display: none; } }

/* Shell: a 52 px app bar, then either the hunt or a full-screen page under a 44 px live hunt strip. */
html, body { height: 100%; }
.app { display: flex; flex-direction: column; height: 100vh; }
.app [hidden] { display: none !important; }
.game { flex: 1; min-height: 0; display: grid; grid-template-columns: 264px minmax(0, 1fr) 272px; gap: 10px; padding: 10px; }
@media (min-width: 1400px) { .game { grid-template-columns: 300px minmax(0, 1fr) 300px; } }

.appbar { flex: none; height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 14px; background: #161a27; border-bottom: 1px solid var(--line); position: relative; z-index: 40; }
.appbar .brand { font-family: var(--pixel); font-weight: 600; font-size: 19px; color: var(--accent); letter-spacing: .02em; white-space: nowrap; text-decoration: none; }
.nav { display: flex; gap: 2px; min-width: 0; }
.nav > a { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 11px; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: 14px; text-decoration: none; white-space: nowrap; }
.nav > a svg { width: 17px; height: 17px; flex: none; }
.nav > a:hover { background: var(--panel-2); color: var(--ink); }
.nav > a.on { background: var(--panel-3); color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.nav > a .dot, .iconbtn .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.nav > a .dot { margin-left: -3px; }
/* More menu: holds Bestiary, Community and Help at laptop widths only (see the 1201-1399 px rule). */
.nav .navmore { display: none; }
.navmore > button { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 8px 0 9px; border-radius: 8px; border: 0; background: none; color: var(--muted); font: 500 14px var(--sans); cursor: pointer; white-space: nowrap; }
.navmore > button:hover, .navmore > button[aria-expanded="true"] { background: var(--panel-2); color: var(--ink); }
.navmore > button.on { background: var(--panel-3); color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.navmore .chev { width: 14px; height: 14px; }
.navmore .menu { left: 0; right: auto; min-width: 180px; }
.navmore .menu a { display: flex; align-items: center; gap: 9px; }
.navmore .menu a svg { width: 17px; height: 17px; color: var(--muted); }
.navmore .menu a.on { background: var(--panel-3); }
.trainer b { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.spacer { flex: 1; }
.appbar .boosts { color: var(--gold); font-size: 12px; white-space: nowrap; }
.trainer { position: relative; display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); white-space: nowrap; outline: none; }
.trainer b, .trainer .lvl { font-weight: 600; }
.mini-xp { position: relative; width: 120px; height: 16px; border-radius: 8px; background: #0d1018; overflow: hidden; border: 1px solid #2a3350; }
.mini-xp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #235f92, #2b72ad); }
.mini-xp span { position: relative; display: block; text-align: center; font-size: 11px; line-height: 14px; font-weight: 600; color: #fff; text-shadow: 0 1px 2px #000; }
.trainer .pop { display: none; position: absolute; top: calc(100% + 6px); right: 0; z-index: 50; width: max-content; max-width: 340px; white-space: normal; padding: 8px 10px; border-radius: 8px; background: #0f131d; border: 1px solid #3c4a6e; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); font-size: 12.5px; color: var(--ink); }
.trainer:hover .pop, .trainer:focus .pop { display: block; }
.cur { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cur img { width: 18px; height: 18px; }
.menuwrap { position: relative; display: inline-flex; }
.iconbtn { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; color: var(--ink); }
.iconbtn svg { width: 18px; height: 18px; }
.iconbtn .dot { position: absolute; top: 5px; right: 5px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #2b6f9e; font-weight: 700; border: 0; cursor: pointer; color: #fff; }
.menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 50; min-width: 200px; display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: 10px; background: #0f131d; border: 1px solid #3c4a6e; box-shadow: 0 14px 40px rgba(0, 0, 0, .55); }
.menu p { margin: 4px 2px 8px; color: var(--muted); font-size: 13px; }
.menu > b { margin: 2px; }
.menu a, .menu > button:not(.btn) { display: block; text-align: left; padding: 7px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; background: none; border: 0; cursor: pointer; }
.menu a:hover, .menu > button:not(.btn):hover { background: var(--panel-2); }
kbd { font: 600 11px var(--sans); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--muted); }

.strip { flex: none; display: flex; align-items: center; gap: 14px; height: 44px; padding: 0 14px; background: #171c2b; border-bottom: 1px solid var(--line); font-size: 13px; cursor: pointer; white-space: nowrap; overflow: hidden; }
.strip img.sp { width: 32px; height: 32px; }
.strip .live { display: inline-flex; align-items: center; gap: 6px; color: var(--good); font-weight: 600; }
.strip .live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.strip .live.rest { color: var(--warn); } .strip .live.off { color: var(--bad); }
.strip .muted { color: var(--muted); }
.strip .ellip { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.strip .divider { width: 1px; height: 22px; background: var(--line-2); }
.strip .bars { display: grid; gap: 3px; width: 160px; flex: none; }
.thin { display: block; height: 6px; border-radius: 3px; background: #0d1018; overflow: hidden; }
.thin i { display: block; height: 100%; }
.thin.hp i { background: #79c25a; } .thin.xp i { background: var(--accent); }
.strip .gain { color: var(--accent); font-weight: 600; }
.strip .back { text-decoration: none; color: var(--ink); display: inline-flex; gap: 6px; align-items: center; }

.page { flex: 1; min-height: 0; overflow-y: auto; animation: fade .12s ease-out; }
.page-inner { max-width: 1600px; margin: 0 auto; padding: 14px 18px 40px; }
.pagetitle { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.pagetitle h1 { margin: 0; font-size: 22px; color: var(--ink); }
.pagetitle .meta { color: var(--muted); font-size: 13.5px; }
.pagetitle .btn { text-decoration: none; color: var(--ink); }
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.subtabs a { padding: 8px 12px; color: var(--muted); font-weight: 600; font-size: 13.5px; text-decoration: none; }
.subtabs a.on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.subtabs .muted { font-weight: 500; }
.crumbs { display: flex; align-items: center; gap: 8px; margin: 2px 0 14px; color: var(--muted); font-size: 13.5px; flex-wrap: wrap; }
.crumbs a:not(.btn) { color: var(--accent); text-decoration: none; }
.crumbs .btn { text-decoration: none; color: var(--ink); }
.btn.disabled { opacity: .4; pointer-events: none; }
.creature-page { max-width: 760px; }
.kv.account { max-width: 420px; }
@keyframes fade { from { opacity: 0; } }

.lcol, .rcol { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.panel.grow { flex: 1; min-height: 0; }
.panel.scroll { overflow-y: auto; }
.panel h4 { margin: 0 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.panel .hint, .panel .sub { color: var(--muted); font-size: 11px; margin: 0; }
.grow { flex: 1; min-width: 0; }

.onfield { display: flex; gap: 8px; align-items: center; cursor: pointer; margin-bottom: 6px; }
.onfield img { width: 64px; height: 64px; background: radial-gradient(circle at 50% 65%, #2a3350, #151a28); border-radius: 8px; }
.onfield .nm, .tslot .nm { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.onfield .chips { margin: 2px 0 4px; }
.stars { color: var(--gold); font-size: 11px; }
.bar { position: relative; height: 14px; background: var(--bg); border-radius: 4px; overflow: hidden; margin-top: 4px; border: 1px solid #10131f; }
.bar > i { display: block; height: 100%; }
/* Labeled bars use fills dark enough for white text (4.9:1 and up); thin bars carry no text and stay bright. */
.bar.hp > i { background: linear-gradient(90deg, #2f6b24, #3d7f2c); }
.bar.xp > i { background: linear-gradient(90deg, #235f92, #2b72ad); }
.bar > span { position: absolute; inset: 0; font-size: 11px; font-weight: 600; color: #fff; line-height: 12px; text-align: center; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0, 0, 0, .8); }
.bar.thin { height: 5px; border: 0; margin-top: 3px; }
.bar.thin.hp > i { background: #79c25a; }
.bar.thin.xp > i { background: var(--accent); }
.tslot { display: flex; gap: 6px; align-items: center; padding: 5px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); margin-bottom: 6px; cursor: pointer; }
.tslot:hover { border-color: var(--accent); }
.tslot.lead { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.tslot.down { opacity: .55; }
.tslot img { width: 40px; height: 40px; flex: none; }

.stage { position: relative; min-height: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #0c0f17; }
canvas#field { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.btn.tiny { padding: 1px 7px; font-size: 11px; border-radius: 5px; }

.arow { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 13px; }
.arow select { padding: 3px 6px; font-size: 12px; }
.icons { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 6px; }
.ico { display: inline-flex; align-items: center; gap: 3px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px 2px 2px; font-size: 11px; font-variant-numeric: tabular-nums; cursor: default; }
button.ico { cursor: pointer; }
.ico img { width: 20px; height: 20px; }
.ico.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }

.feed { display: flex; flex-direction: column; }
.feed .list { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; line-height: 1.4; min-height: 0; padding-right: 2px; }
.panel.feed { min-height: 220px; background: linear-gradient(180deg, #1d2234, #181c2b); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04); }
.feed .b-aura { color: var(--gold); font-weight: 600; }
.feed .b-legendary { color: var(--violet); font-weight: 600; }
.feed .b-bloodline { color: var(--accent); }
.feed .b-system { color: var(--muted); font-style: italic; }
.feed .t { color: var(--faint); font-size: 11px; margin-right: 6px; }
.feed form { display: flex; gap: 6px; margin-top: 6px; }
.feed form input { flex: 1; min-width: 0; padding: 5px 8px; }

.pane { min-width: 0; }
.pane h3 { margin: 4px 0 8px; font-size: 16px; }
.pane .hint { color: var(--muted); font-size: 12px; margin: 0 0 10px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.search { width: 180px; min-width: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 4px; text-align: center; cursor: pointer; position: relative; }
.card:hover { border-color: var(--accent); }
.card img { width: 64px; height: 64px; display: block; margin: 0 auto; }
.card .nm { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .lv { font-size: 11px; color: var(--muted); }
.card.aura { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.card.inteam::after { content: 'TEAM'; position: absolute; top: 4px; left: 5px; font-size: 9px; font-weight: 700; letter-spacing: .06em; color: var(--accent); }
.list { display: flex; flex-direction: column; gap: 6px; }
.item { display: flex; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.item img { width: 32px; height: 32px; }
.item .grow { flex: 1; min-width: 0; }
.item .sub { color: var(--muted); font-size: 12px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th, .tbl td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: 500; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { font-size: 11px; padding: 1px 6px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
/* Element chips: dark text on every color (4.8:1 and up) except Shade, which needs white. */
.el { display: inline-flex; align-items: center; height: 18px; font-size: 11px; padding: 0 7px; border-radius: 9px; color: #10131a; font-weight: 600; line-height: 1; }
.el.shade { color: #fff; }
.wiki h4 { margin: 14px 0 4px; font-size: 15px; color: var(--accent); }
.wiki p, .wiki li { color: var(--ink); font-size: 13px; }
.wiki code { background: var(--bg); padding: 1px 4px; border-radius: 4px; }

/* Modal */
.mon { display: grid; grid-template-columns: 160px 1fr; gap: 16px; }
.mon .pic { background: radial-gradient(circle at 50% 60%, #2a3350, #151a28); border-radius: 10px; display: flex; align-items: flex-end; justify-content: center; padding: 8px; }
.mon .pic img { width: 144px; height: 144px; }
.mon h2 { margin: 0; }
.statbars { display: grid; grid-template-columns: 54px 1fr 34px 30px; gap: 3px 8px; align-items: center; font-size: 12px; margin: 10px 0; }
.statbars .bar { height: 7px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.statbars .bar > i { display: block; height: 100%; background: var(--accent); }
.statbars .iv { color: var(--muted); text-align: right; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 110; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; box-shadow: 0 6px 20px rgba(0,0,0,.4); animation: pop .2s ease-out; }
.toast .n { color: var(--muted); font-weight: 600; margin-left: -6px; }
.toast .btn { pointer-events: auto; }
.toast.err { border-color: var(--bad); }
.toast.gold { border-color: var(--gold); color: var(--gold); font-weight: 600; }

/* Dialogs: decisions with consequences only. Above the modal and the hover card. */
.scrim { position: fixed; inset: 0; z-index: 100; background: rgba(6, 8, 13, .62); display: grid; place-items: center; padding: 16px; }
.dialog { width: 460px; max-width: 100%; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.dialog h3 { margin: 0; padding: 18px 20px 4px; font-size: 18px; font-weight: 600; }
.dialog .body { padding: 6px 20px 14px; color: var(--muted); }
.dialog .body p { margin: 8px 0; }
.dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin: 0; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.dlg-field { display: flex; align-items: center; gap: 10px; margin: 8px 0; color: var(--ink); }
.dlg-field > span:first-child { width: 86px; color: var(--muted); }
.dlg-field input { width: 120px; }
.coin-in { display: inline-flex; align-items: center; gap: 6px; }
.coin-in img { width: 18px; height: 18px; }
.coin-in input { width: 160px; }
.dialog .fee { color: var(--ink); }
.btn.danger { background: #4a1f25; border-color: #b9474f; color: #ffd4d6; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* App bar tiers, checked with a 16-character name and a 10-digit wallet: nav icons only from 1920 px;
   below 1680 px the bar tightens and Bestiary, Community and Help fold into More; below 1201 px the nav gets its own row with every link. */
@media (max-width: 1919px) { .nav > a svg { display: none; } .nav > a { padding: 0 9px; } }
@media (max-width: 1679px) { .appbar { gap: 8px; } .mini-xp { width: 80px; } .trainer b { max-width: 110px; } .appbar .net.on { font-size: 0; gap: 0; } }
@media (min-width: 1201px) and (max-width: 1679px) { .nav > a.nx { display: none; } .nav .navmore { display: inline-flex; } }
@media (min-width: 1201px) and (max-width: 1279px) { .appbar .cur .long { display: none; } .appbar .cur .short { display: inline; } }
@media (max-width: 1200px) {
  .app { height: auto; min-height: 100vh; }
  .appbar { height: auto; min-height: 52px; flex-wrap: wrap; padding: 6px 12px; }
  .nav { flex-wrap: wrap; order: 3; width: 100%; }
  .page { overflow: visible; }
  .game { grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: minmax(420px, 1fr) auto; height: auto; }
  .rcol { grid-column: 1 / -1; flex-direction: row; }
  .rcol > .panel { flex: 1; max-height: 320px; }
  .rcol .panel.auto { max-height: 360px; }
  .rcol > .panel.feed { flex: 1.3; max-height: none; height: 360px; }
  .stage { min-height: 520px; }
}
@media (max-width: 760px) {
  .game { grid-template-columns: 1fr; padding: 8px; }
  .strip .bars, .strip .divider, .strip .back kbd { display: none; }
  .page-inner { padding: 12px 12px 32px; }
  .search { width: 140px; }
  .row.between { flex-wrap: wrap; }
  .lcol { order: 3; }
  .stage { order: 2; min-height: 62vh; }
  .rcol { order: 4; flex-direction: column; }
  .session { display: none; }
  .combatlog { width: auto; right: 10px; max-width: none; }
  .mon { grid-template-columns: 1fr; }
}
.lv { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--muted); font-size: 12px; }

/* Rating calculator */
.calc { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 18px; }
.calc h5 { margin: 12px 0 6px; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.calc h5 .sub { text-transform: none; letter-spacing: 0; font-family: inherit; font-weight: 400; }
.calc .sub { color: var(--muted); font-size: 11px; }
.calc label.row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.calc label.row > span:first-child { width: 60px; color: var(--muted); font-size: 12px; }
.calc label.row select, .calc label.row input[type=number] { flex: 1; }
.calc-ivs { display: grid; grid-template-columns: 52px 62px 1fr 44px; gap: 4px 8px; align-items: center; font-size: 12px; }
.calc-ivs input { padding: 3px 6px; }
.calc .bar, .calc-parts .bar { margin-top: 0; border: 0; height: 7px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.calc .bar i { display: block; height: 100%; background: var(--accent, #6c8ee8); max-width: 100%; }
.calc .seg { display: flex; gap: 4px; }
.calc .seg .on { border-color: var(--gold); color: var(--gold); }
.calc .actions { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.calc-head { display: flex; align-items: center; gap: 14px; }
.calc-head img { width: 96px; height: 96px; image-rendering: pixelated; background: var(--panel-2); border-radius: 10px; }
.calc-score { font-weight: 700; font-size: 40px; line-height: 1; }
.calc-score .sub { font-size: 14px; }
.calc-parts { display: grid; grid-template-columns: 70px 1fr 90px; gap: 6px 8px; align-items: center; font-size: 12px; }
.calc-st { border-collapse: collapse; font-size: 12px; }
.calc-st th, .calc-st td { padding: 2px 12px 2px 0; text-align: right; }
.calc-st th:first-child, .calc-st td:first-child { text-align: left; color: var(--muted); }
@media (max-width: 760px) { .calc { grid-template-columns: 1fr; } }

/* Bestiary species sheet */
.spsheet h4 { margin: 16px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-size: 13px; }
.spsheet .sub { color: var(--muted); font-size: 11px; }
.sp-top { display: grid; grid-template-columns: auto 1fr; gap: 16px; margin-top: 8px; }
.sp-top h2 { margin: 0 0 4px; }
.sp-forms { display: flex; gap: 8px; }
.sp-forms figure { margin: 0; background: var(--panel-2); border-radius: 10px; padding: 8px; text-align: center; }
.sp-forms figure.aura { box-shadow: inset 0 0 0 1px var(--gold); }
.sp-forms img { width: 112px; height: 112px; image-rendering: pixelated; display: block; }
.sp-forms figcaption { font-size: 11px; color: var(--muted); }
.sp-forms .aura figcaption { color: var(--gold); }
.sp-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; margin: 8px 0; }
.sp-facts > div { background: var(--panel-2); border-radius: 8px; padding: 6px 10px; display: flex; flex-direction: column; }
.sp-facts span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sp-chain { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sp-node { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; text-align: center; cursor: pointer; display: flex; flex-direction: column; align-items: center; font-size: 12px; }
.sp-node.on { border-color: var(--accent); }
.sp-node img { width: 48px; height: 48px; image-rendering: pixelated; }
.sp-chain .arrow { color: var(--gold); display: flex; flex-direction: column; align-items: center; font-size: 18px; }
.sp-chain .arrow small { font-size: 10px; color: var(--muted); }
.sp-cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
.sp-stats { display: grid; grid-template-columns: 60px 1fr 36px 80px; gap: 4px 8px; align-items: center; font-size: 12px; }
.sp-stats .bar { margin-top: 0; height: 7px; border: 0; }
.sp-stats .bar i { background: var(--accent); }
.sp-bl { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.sp-bl > div { background: var(--panel-2); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; border-top: 3px solid var(--line); }
.sp-bl b { font-weight: 700; font-size: 16px; }
.sp-bl .bl1 { border-top-color: #79b04a; } .sp-bl .bl2 { border-top-color: #6c9be8; } .sp-bl .bl3 { border-top-color: #a77de6; } .sp-bl .bl4 { border-top-color: var(--gold); }
.sp-bl .aura { color: var(--gold); }
.spsheet .ico { width: 18px; height: 18px; vertical-align: middle; image-rendering: pixelated; }
@media (max-width: 760px) { .sp-top, .sp-cols { grid-template-columns: 1fr; } .sp-bl { grid-template-columns: repeat(3, 1fr); } }

/* Admin dev tools */
.pane h4.adm-h { margin: 14px 0 0; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.pane h4.adm-h + .actions { margin-top: 6px; }
.pane .actions select { max-width: 260px; padding: 4px 8px; font-size: 12px; }
.pane .actions input[type=number] { padding: 4px 8px; font-size: 12px; }

/* Connection: a chip in the app bar and a banner while the hunt is paused. */
.net { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.net::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.net.on { color: var(--good); } .net.wait { color: var(--warn); } .net.off { color: var(--bad); }
.netbanner { position: fixed; top: 52px; left: 50%; transform: translateX(-50%); z-index: 95; min-height: 36px; display: flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 0 0 10px 10px; font-size: 13px; box-shadow: 0 6px 20px rgba(0, 0, 0, .45); }
.netbanner.down { background: #4a1f25; border: 1px solid #b9474f; border-top: 0; color: #ffd4d6; }
.netbanner.up { background: #1f3d24; border: 1px solid #4f9a4a; border-top: 0; color: #cdf2c4; }
.netbanner[hidden] { display: none; }

/* Automation warnings and shrine state lines */
.warn { margin: 6px 0 4px; padding: 6px 8px; border-radius: 6px; font-size: 12px; background: rgba(240, 196, 90, .12); border: 1px solid rgba(240, 196, 90, .45); color: #f6dc9a; }
.warn.bad { background: rgba(224, 90, 90, .14); border-color: rgba(224, 90, 90, .55); color: #ffc2bd; }
.warn .btn { margin-left: 4px; }
.shrine .state { margin-top: 4px; font-size: 12px; }
.shrine .state.good { color: #9fd38a; }
.shrine .state.warn { margin: 4px 0 0; }
.item .cur.sub img { width: 15px; height: 15px; }

/* Creature markers: grade letter, bloodline crest, aura tag, favorite, rare trait.
   Gray-green-blue-purple-orange is the grade scale only; gold is kept for auras. */
.gr { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 5px; font: 800 11px/1 var(--sans); color: #0b0f17; letter-spacing: -.02em; flex: none; vertical-align: middle; }
.gr.c { background: transparent; color: #aeb6c7; box-shadow: inset 0 0 0 1.5px #5d6884; }
.gr.b { background: #62c26e; }
.gr.a { background: #4ea3ff; }
.gr.s { background: #b77cff; }
.gr.sp { background: linear-gradient(135deg, #ffbd6b, #ff7f30); box-shadow: 0 0 8px rgba(255, 140, 60, .45); }
.gr.lg { min-width: 40px; height: 40px; font-size: 20px; border-radius: 9px; }
.gr.sm { min-width: 16px; height: 16px; font-size: 10px; border-radius: 4px; padding: 0 3px; }
.crest { display: inline-flex; align-items: center; gap: 2px; font: 700 11px/1 var(--sans); vertical-align: middle; }
.crest svg { width: 11px; height: 13px; }
.crest.b2 { color: #62c26e; } .crest.b3 { color: #4ea3ff; } .crest.b4 { color: #b77cff; } .crest.b5 { color: #ff9f43; }
.aura-tag { display: inline-flex; align-items: center; gap: 3px; height: 18px; padding: 0 6px; border-radius: 9px; font: 700 10.5px/1 var(--sans); color: #2a1d00; background: linear-gradient(135deg, #ffe58a, #f5b941); vertical-align: middle; }
.aura-dot { width: 14px; height: 14px; display: inline-grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, #ffe58a, #f5b941); color: #2a1d00; font-size: 9px; font-weight: 900; }
.fav { color: #f0c45a; font-size: 13px; line-height: 1; }
.rare { color: #b77cff; font-size: 11px; line-height: 1; }
.marks { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 18px; }
.marks .lv { color: var(--muted); font-size: 12px; }
.nmrow { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.nmrow .nm { min-width: 0; }

/* Storage cards: grade top-left, flags stacked top-right */
.card { padding: 8px 6px 7px; }
.card .tl { position: absolute; top: 5px; left: 5px; }
.card .tr { position: absolute; top: 5px; right: 5px; display: grid; gap: 3px; justify-items: end; }
.card .nm { font-size: 12px; font-weight: 600; }
.card.aura { background: radial-gradient(circle at 50% 38%, rgba(245, 200, 76, .18), transparent 60%), var(--panel-2); border-color: #8a7330; box-shadow: none; }
.card.inteam::after { content: none; }
.teamtag { font-size: 9px; font-weight: 700; letter-spacing: .06em; color: var(--accent); }

/* Creature page grade box and the calculator's grade scale */
.gradebox { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gradescale { position: relative; display: grid; gap: 2px; margin: 12px 0 4px; }
.gradescale .gs { height: 22px; border-radius: 4px; font: 700 11px/22px var(--sans); text-align: center; color: #0b0f17; opacity: .45; white-space: nowrap; overflow: hidden; }
.gradescale .gs small { font-weight: 500; }
.gradescale .gs.on { opacity: 1; }
.gradescale .gs.c { background: #5d6884; color: #e8ecf4; } .gradescale .gs.b { background: #62c26e; } .gradescale .gs.a { background: #4ea3ff; }
.gradescale .gs.s { background: #b77cff; } .gradescale .gs.sp { background: linear-gradient(135deg, #ffbd6b, #ff7f30); }
.gradescale b { position: absolute; top: -4px; width: 2px; height: 30px; background: var(--ink); transform: translateX(-1px); }
.calc-head { display: flex; align-items: center; gap: 12px; }
.calc-score { font-size: 22px; }

/* Hover card (one global node, above pages, below dialogs) */
.hc { position: fixed; z-index: 60; width: 312px; padding: 12px; border-radius: 12px; background: #0f131d; border: 1px solid #3c4a6e; box-shadow: 0 14px 40px rgba(0, 0, 0, .55); font-size: 12.5px; }
.hc[hidden] { display: none; }
.hc .top { display: flex; gap: 10px; align-items: center; }
.hc .top img { width: 48px; height: 48px; flex: none; }
.hc .top b { font-size: 15px; font-weight: 600; }
.hc .muted, .hc .sub { color: var(--muted); }
.hc .sub { font-size: 12px; }
.hc hr { border: 0; border-top: 1px solid #2a3350; margin: 9px 0; }
.hc .gline { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.hc table { width: 100%; border-collapse: collapse; }
.hc td { padding: 2px 0; }
.hc td.k { color: var(--muted); width: 72px; }
.hc td.v { width: 64px; font-weight: 600; white-space: nowrap; }
.hc td.p { text-align: right; color: var(--muted); width: 60px; }
.mbar { height: 6px; border-radius: 3px; background: #232b42; overflow: hidden; margin: 0 6px; }
.mbar i { display: block; height: 100%; }
.hc .ivs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; text-align: center; }
.hc .ivs div { padding: 3px 0; border-radius: 5px; background: #1a2133; }
.hc .ivs div.unused { opacity: .45; }
.hc .ivs small { display: block; font-size: 10px; color: var(--faint); }
.hc .ivs b { font-size: 12px; }
.hc .foot { color: var(--muted); font-size: 11.5px; margin-top: 4px; }
.hc .foot b { color: var(--ink); }
.hc .rare-name { color: #b77cff; }
.pill { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 9px; font-size: 11px; font-weight: 600; background: var(--panel-3); color: var(--ink); white-space: nowrap; }
.pill.bad { background: rgba(224, 90, 90, .18); color: #ffb3ad; }

/* ---------- Hunt screen ---------- */
.pill { gap: 4px; }
.pill svg { width: 12px; height: 12px; }
.pill.lead { background: rgba(127, 200, 232, .16); color: var(--accent); }
.pill.share, .pill.amber { background: rgba(240, 196, 90, .14); color: var(--warn); }
.pill.good { background: rgba(121, 194, 90, .15); color: #9fd38a; }
button.pill { border: 0; cursor: pointer; font: inherit; font-size: 11px; font-weight: 600; }
.huntcard .good, .risk-safe { color: #9fd38a; }
.huntcard .warn, .risk-ok { color: var(--warn); }
.risk-risky { color: #ff9a8f; }
.link { color: var(--accent); font-size: 12px; font-weight: 500; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* Team rail */
.panel.team { padding: 0 0 4px; flex: 0 1 auto; min-height: 0; }
.phead { display: flex; align-items: center; gap: 8px; padding: 10px 12px 6px; }
.phead h4 { margin: 0; flex: 1; }
.phead .count { color: var(--faint); margin-left: 4px; letter-spacing: 0; }
.slot { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 9px; padding: 8px 10px; margin: 0 8px 6px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; position: relative; }
.slot:hover { border-color: var(--line-2); }
.slot img, .slot .walker { width: 48px; height: 48px; }
/* A creature walking in place: a 4-frame strip stepped by CSS. */
.walker { display: inline-block; flex: none; background-size: 400% 100%; background-repeat: no-repeat; image-rendering: pixelated; animation: mi-walk .56s steps(4) infinite; }
.slot.fainted .walker, .slot.out .walker { animation: none; }
@keyframes mi-walk { to { background-position-x: 133.333%; } }
@media (prefers-reduced-motion: reduce) { .walker { animation: none; } }
.slot .r1 { display: flex; align-items: center; gap: 6px; }
.slot .r1 .nm { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .r1 .gr { margin-left: auto; }
.slot .r2 { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin: 3px 0 4px; font-size: 12.5px; color: var(--muted); }
.slot .r2 .lv { font-size: 12.5px; }
.slot .bar.thin { margin-top: 3px; height: 6px; border-radius: 3px; }
.slot.lead { grid-template-columns: 64px minmax(0, 1fr); border-color: #4f86b0; background: #1f2b40; }
.slot.lead img, .slot.lead .walker { width: 64px; height: 64px; }
.slot .eta { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.slot.out { opacity: .5; }
.slot.fainted img, .slot.fainted .walker { filter: grayscale(1); }
.slot.empty { display: block; border: 1px dashed var(--line-2); background: none; color: var(--faint); font-size: 12.5px; text-align: center; text-decoration: none; padding: 8px; }
.slot.empty:hover { color: var(--ink); border-color: var(--accent); }
/* Player card: outfit, name and guild tag, trainer level and XP. */
.panel.playercard { padding: 0; flex: none; overflow: hidden; background: linear-gradient(180deg, #252d47, #1b2032); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07); }
.pc { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; color: var(--ink); text-decoration: none; }
.pc:hover { background: rgba(255, 255, 255, .03); }
.pc-face { width: 44px; height: 44px; flex: none; border-radius: 9px; border: 1px solid var(--line-2); image-rendering: pixelated; background-color: #12151f;
  background-repeat: no-repeat; background-size: 88px 88px; background-position: -22px -10px; box-shadow: inset 0 0 10px rgba(0, 0, 0, .55); }
.pc-main { display: grid; gap: 4px; flex: 1; min-width: 0; }
.pc-name { display: flex; align-items: baseline; gap: 5px; min-width: 0; font-size: 14px; }
.pc-name b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-name .gtag { flex: none; }
.pc-lv { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.pc-l b { color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.pc-xp { position: relative; flex: 1; height: 7px; border-radius: 4px; background: #0d1018; border: 1px solid #2a3350; overflow: hidden; }
.pc-xp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #235f92, #3b8fd0); }
.pc-pct { font-variant-numeric: tabular-nums; min-width: 28px; text-align: right; }
.slot.dragging { opacity: .4; }
.slot.dropto { box-shadow: 0 0 0 2px var(--accent) inset; }

/* Watch mode: the lead's move bar. Each icon is the move's element glyph in a cooldown ring that fills as the
   cooldown runs (client/watch.ts drives it); a full, bright ring means ready. The Signature sits in a gold frame. */
.movebar { display: flex; gap: 6px; margin-top: 7px; align-items: center; }
.movebar .mv { position: relative; width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #141a29; box-shadow: 0 0 0 1px rgba(16, 19, 31, .9); }
.movebar .mv .ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.movebar .mv .trk { fill: none; stroke: #2b3450; stroke-width: 3; }
.movebar .mv .arc { fill: none; stroke: var(--el, var(--accent)); stroke-width: 3; stroke-dasharray: 100; stroke-dashoffset: 0; }
.movebar .mv .glyph { width: 15px; height: 15px; image-rendering: pixelated; filter: drop-shadow(1px 1px 0 #10131f); }
.movebar .mv:not(.locked):not(.cd) { box-shadow: 0 0 0 1px rgba(16, 19, 31, .9), 0 0 7px -1px var(--el); }
.movebar .mv.heavy .glyph { width: 17px; height: 17px; }
.movebar .mv.wave { border-radius: 30%; }
.movebar .mv.sig { width: 36px; height: 36px; background: #221d18; box-shadow: 0 0 0 2px #8a6a2a, 0 0 0 3px #10131f; }
.movebar .mv.sig:not(.locked):not(.cd) { box-shadow: 0 0 0 2px var(--gold), 0 0 0 3px #10131f, 0 0 10px 1px rgba(240, 196, 90, .45); }
.movebar .mv.sig .glyph { width: 18px; height: 18px; }
.movebar .mv.locked { opacity: .32; }
.movebar .mv.locked .arc { display: none; }
.movebar .mv.locked .glyph { filter: grayscale(1); }
/* Battery saver and reduced motion: the ring's state comes in the markup and moves in steps. */
.movebar .mv.cd .arc { stroke-dashoffset: calc(100 - var(--p, 0) * 100); opacity: .7; }
.movebar .mv.cd .glyph { opacity: .38; filter: saturate(.3); }
.bar.big { height: 16px; border-radius: 5px; margin-top: 5px; }
.bar > span { text-align: left; padding: 0 6px; line-height: 14px; }
.bar > span em { float: right; font-style: normal; opacity: .9; }
.rail-foot { padding: 2px 12px 8px; color: var(--muted); font-size: 12px; margin: 0; }
.panel.shrinesum { display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-size: 12.5px; flex: none; }
.shrinesum svg { width: 16px; height: 16px; color: var(--warn); flex: none; }

/* Overlays on the field */
.ov { position: absolute; background: rgba(14, 18, 27, .86); border: 1px solid rgba(70, 85, 124, .8); border-radius: 10px; backdrop-filter: blur(3px); }
.huntcard { top: 10px; left: 10px; padding: 9px 12px 10px; width: 360px; max-width: calc(100% - 20px); box-sizing: border-box;
  background: linear-gradient(180deg, rgba(24, 30, 46, .92), rgba(14, 18, 27, .9)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 8px 24px rgba(0, 0, 0, .35); }
.huntcard .hc-top { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.huntcard .hc-tools { display: inline-flex; gap: 6px; margin-left: auto; }
.hc-tool { display: inline-flex; align-items: center; justify-content: center; gap: 6px; box-sizing: border-box; width: 76px; height: 28px; padding: 0 8px; border-radius: 7px;
  border: 1px solid var(--line-2); background: linear-gradient(180deg, #2a3350, #222a40); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07); color: var(--ink); font: 600 12.5px/1 var(--sans); text-decoration: none; cursor: pointer; }
.hc-tool svg { width: 15px; height: 15px; flex: none; }
.hc-tool span { line-height: 1; }
.hc-tool:hover { border-color: var(--accent); }
.huntcard .what .lvl { color: var(--muted); font-size: 13px; font-weight: 500; }
.huntcard .facts .dot { color: var(--faint); }
.huntcard .crumb { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .07em; color: var(--muted); text-transform: uppercase; text-decoration: none; }
.huntcard .crumb:hover { color: var(--ink); }
.huntcard .what { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.huntcard .what img { width: 34px; height: 34px; }
.huntcard .what b { font-size: 17px; font-weight: 600; }
.huntcard .muted { color: var(--muted); }
.huntcard .facts { margin-top: 4px; font-size: 12.5px; color: var(--muted); display: flex; gap: 6px 8px; align-items: center; flex-wrap: wrap; }
.huntcard .facts.early { color: #d9c6ff; }
.huntcard .seg { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; border: 0; border-radius: 0; overflow: visible; }
.huntcard .seg button { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 9px 0 4px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); cursor: pointer; max-width: 150px; }
.huntcard .seg button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.huntcard .seg button img { width: 24px; height: 24px; flex: none; }
.huntcard .seg button:hover { color: var(--ink); border-color: var(--line-2); }
.huntcard .seg button.on { border-color: #5fb4e0; color: var(--ink); background: #22354d; }
.narrow-only { display: none; }
.suggest { top: 10px; right: 10px; width: 300px; padding: 10px 12px; font-size: 12.5px; color: var(--muted); }
.suggest b { color: var(--ink); }
.suggest .t { display: flex; gap: 6px; align-items: center; color: var(--warn); font-weight: 600; font-size: 12px; margin-bottom: 3px; }
.suggest .t svg { width: 14px; height: 14px; }
.suggest .acts { display: flex; gap: 6px; margin-top: 8px; }
.btn.ghost { background: transparent; }
.combatlog { left: 10px; bottom: 10px; width: 440px; max-width: calc(100% - 320px); padding: 6px; display: grid; gap: 3px; font-size: 12.5px; cursor: pointer; }
.combatlog:empty { display: none; }
.combatlog.open { max-height: 60%; overflow-y: auto; }
.combatlog > div { padding: 4px 8px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: pop .2s ease-out; }
.combatlog > div > span { margin-left: 5px; }
.combatlog .xp { color: var(--accent); font-weight: 600; }
.combatlog .coin { color: var(--warn); font-weight: 600; }
.combatlog .muted, .combatlog .dim, .combatlog .miss { color: var(--muted); }
.combatlog .catch { background: rgba(78, 163, 255, .14); }
.combatlog .lvl, .combatlog .gold { background: rgba(240, 196, 90, .12); color: #ffe2a0; }
.combatlog .gold { font-weight: 600; }
.combatlog .bad { color: #ff9a8f; background: rgba(224, 90, 90, .1); }
.combatlog .warn { color: var(--warn); }
.combatlog .gr, .combatlog .crest { margin: 0 2px; }
.combatlog .fight { background: rgba(35, 42, 62, .75); border-left: 2px solid var(--line-2); animation: none; }
.combatlog .fight.sig { border-left-color: var(--gold); background: rgba(240, 196, 90, .1); }
.combatlog .fight .fmv { font-weight: 600; color: color-mix(in srgb, var(--el) 72%, #fff); }
.combatlog .fight .strong { color: var(--gold); font-weight: 600; margin: 0; }
.combatlog .fight .weak { color: var(--muted); margin: 0; }
.combatlog .fight .crit { color: #ff9a8f; margin: 0; }
.combatlog .cn { cursor: pointer; text-decoration: underline dotted rgba(232, 236, 244, .4); text-underline-offset: 2px; }
.session { position: absolute; right: 10px; bottom: 10px; width: 292px; padding: 9px 12px; font-size: 12.5px; background: rgba(14, 18, 27, .86); border: 1px solid rgba(70, 85, 124, .8); border-radius: 10px; backdrop-filter: blur(3px); }
.session .h { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.session .h b { font-size: 11px; letter-spacing: .07em; color: var(--muted); }
.session .clock { font-variant-numeric: tabular-nums; }
.session table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.session td { padding: 2px 0; white-space: nowrap; }
.session td:first-child { color: var(--muted); max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.session td:nth-child(2) { text-align: right; }
.session td:nth-child(3) { text-align: right; width: 84px; }
.session td em { font-style: normal; color: var(--muted); }
.session tr.sep td { border-top: 1px solid var(--line); padding-top: 5px; }
.session tr.neg b { color: #ff9a8f; }
.session.pill-mode { width: auto; padding: 0; }
.spill { display: block; padding: 7px 12px; font-size: 12.5px; white-space: nowrap; background: none; border: 0; cursor: pointer; color: var(--ink); }
.zoom { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: grid; gap: 4px; }
.zoom .btn { width: 30px; height: 30px; font-size: 16px; padding: 0; background: rgba(14, 18, 27, .86); }
@media (max-width: 1399px) {
  .combatlog { width: 330px; }
  .narrow-only { display: inline-flex; }
}

/* ---------- Automation and the right rail ---------- */
.panel.auto { padding: 0 0 6px; flex: none; }
.auto .phead .pill { margin-left: auto; }
.auto .grp { padding: 6px 12px 8px; border-top: 1px solid var(--line); }
.auto .phead + .grp { border-top: 0; }
.auto h5 { margin: 0 0 4px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.auto .line { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 13px; }
.auto .line select { margin-left: auto; height: 28px; padding: 0 6px; font-size: 12.5px; min-width: 0; max-width: 58%; }
.auto .hint { font-size: 11.5px; color: var(--muted); margin: 3px 0 0; }
.auto .foot { padding: 6px 12px 0; margin: 0; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line); }
.auto .warn { margin: 4px 0 0; }
.auto .grp.now { padding-top: 2px; }
/* The seal and potion in use: two compact chips, each a shortcut to the order. */
.ainuse { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 6px 0; }
.ause { display: flex; align-items: center; gap: 6px; min-width: 0; height: 32px; padding: 0 8px; border-radius: 8px; cursor: pointer; color: var(--ink); font: 500 12.5px var(--sans);
  border: 1px solid var(--line-2); background: linear-gradient(180deg, #262e47, #1e2438); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
.ause img, .ause .noimg { width: 18px; height: 18px; flex: none; image-rendering: pixelated; }
.ause .nm { flex: 1; min-width: 0; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ause b { font-weight: 700; font-variant-numeric: tabular-nums; }
.ause:hover { border-color: var(--accent); }
.ause.none b, .ause.none .nm { color: #ffb3ad; }
.ause.off { opacity: .55; }
/* Advanced: one row per section with its current setting; the body opens under it. */
.advs { border-top: 1px solid var(--line); }
.adv + .adv { border-top: 1px solid rgba(52, 64, 94, .6); }
.adv-h { display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; padding: 0 12px; background: none; border: 0; color: var(--ink); font: 500 12.5px var(--sans); cursor: pointer; text-align: left; }
.adv-h:hover { background: rgba(255, 255, 255, .03); }
.adv-h .nm { white-space: nowrap; }
.adv-h .now { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.adv-h .chev { width: 7px; height: 7px; flex: none; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(-45deg); transition: transform .12s; margin-right: 2px; }
.adv.open .adv-h .chev { transform: rotate(45deg); }
.adv-b { padding: 0 12px 8px; }
.usesort { display: flex; align-items: center; gap: 6px; margin: 6px 0 4px; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.usesort > span { margin-right: auto; white-space: nowrap; }
.usesort .best { display: inline-flex; align-items: center; gap: 6px; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12px; color: var(--ink); cursor: pointer; }
input.toggle.sm { width: 28px; height: 16px; }
input.toggle.sm::after { top: 2px; left: 2px; width: 12px; height: 12px; }
input.toggle.sm:checked::after { left: 14px; }
.uselist .grip { display: grid; place-items: center; width: 18px; height: 24px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--faint); cursor: grab; touch-action: none; flex: none; }
.uselist .grip svg { width: 14px; height: 14px; }
.uselist .grip:hover, .uselist .grip:focus-visible { color: var(--ink); background: var(--panel-3); }
.uselist li.dragging { border-color: var(--accent); box-shadow: 0 4px 12px rgba(0, 0, 0, .4); }
.uselist { list-style: none; margin: 0 0 2px; padding: 0; display: grid; gap: 3px; }
.uselist li { display: flex; align-items: center; gap: 4px; height: 30px; padding: 0 8px 0 2px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); font-size: 12.5px; }
.uselist li label { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; cursor: pointer; }
.uselist li input { margin: 0; accent-color: var(--accent); }
.uselist li img { width: 18px; height: 18px; }
.uselist li .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uselist li .n { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.uselist li.off { opacity: .55; }
.uselist li.on.empty .n { color: #ffc2bd; }
.uselist .mv { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--muted); font-size: 10px; cursor: pointer; }
.uselist .mv:hover:not(:disabled) { background: var(--panel-3); color: var(--ink); }
.uselist .mv:disabled { opacity: .25; cursor: default; }
.cnt { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cnt img { width: 18px; height: 18px; }
.line .push { margin-left: auto; }
input.toggle { appearance: none; -webkit-appearance: none; width: 34px; height: 20px; border-radius: 10px; background: #2c3550; position: relative; flex: none; margin: 0; padding: 0; border: 0; cursor: pointer; }
input.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #8d98b3; transition: left .12s; }
input.toggle:checked { background: #2b6f9e; }
input.toggle:checked::after { left: 17px; background: #fff; }
input.toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rtabs, .tabs2 { display: flex; gap: 4px; align-items: center; }
.rtabs { display: none; padding: 0 2px; }
.rtabs button, .tabs2 button { padding: 5px 10px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: none; border: 0; cursor: pointer; }
.rtabs button.on, .tabs2 button.on { background: var(--panel-3); color: var(--ink); }
.tabs2 { margin: -2px 0 6px; }
@media (min-width: 1201px) { .rcol .panel.auto { max-height: 62%; overflow-y: auto; } }
@media (min-width: 761px) and (max-width: 1200px) { .rcol .panel.auto { overflow-y: auto; } }

/* Roll pills: grade scale colors (gray, green, blue, purple, orange), gold for an aura, neutral for facts. */
.rpills { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.rp { position: relative; display: inline-flex; align-items: baseline; gap: 4px; height: 22px; padding: 0 9px; border-radius: 11px; font: 700 12px/22px var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap; cursor: default; outline: none; border: 1px solid transparent; }
.rp small { font-size: 10.5px; font-weight: 600; opacity: .8; }
.rp i { font-style: normal; font-weight: 600; opacity: .8; }
.rp.t-n { background: #222a3d; color: var(--ink); border-color: #34405e; }
.rp.t-c { background: rgba(93, 104, 132, .16); color: #c3c9d6; border-color: #5d6884; }
.rp.t-b { background: rgba(98, 194, 110, .16); color: #8fdc98; border-color: rgba(98, 194, 110, .55); }
.rp.t-a { background: rgba(78, 163, 255, .16); color: #93c6ff; border-color: rgba(78, 163, 255, .55); }
.rp.t-s { background: rgba(183, 124, 255, .17); color: #d2b0ff; border-color: rgba(183, 124, 255, .6); }
.rp.t-sp { background: linear-gradient(135deg, #ffbd6b, #ff7f30); color: #2a1300; box-shadow: 0 0 8px rgba(255, 140, 60, .4); }
.rp.t-gold { background: linear-gradient(135deg, #ffe58a, #f5b941); color: #2a1d00; }
.rp:hover, .rp:focus-visible { filter: brightness(1.15); }
.rp::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 7px); transform: translateX(-50%); z-index: 5; width: max-content; max-width: 250px; white-space: normal; padding: 7px 9px; border-radius: 8px; background: #1b2236; border: 1px solid #46557c; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); color: var(--ink); font: 500 12px/1.4 var(--sans); text-align: left; pointer-events: none; display: none; }
/* display, not opacity: a hidden tip must not widen the page on a phone. */
.rp:hover::after, .rp:focus-visible::after { display: block; }
.rpills .rp:first-child::after { left: 0; transform: none; }
.rpills .rp:last-child::after { left: auto; right: 0; transform: none; }

/* Trainer page */
a.trainer { color: var(--ink); text-decoration: none; cursor: pointer; }
a.trainer:hover { border-color: var(--line-2); }
.trainer-page { display: grid; gap: 12px; max-width: 900px; }
.trainer-page .panel { padding: 14px 16px; }
.trainer-page .muted { color: var(--muted); }
.tp-hero { display: flex; gap: 20px; align-items: center; }
.tp-sprite { flex: none; width: 168px; height: 168px; display: grid; place-items: center; border-radius: 12px; background: radial-gradient(circle at 50% 62%, #33406a, #151a28 70%); }
.tp-sprite img { width: 128px; height: 128px; }
.tp-hero h2 { margin: 0 0 4px; font-size: 26px; }
.tp-level { display: flex; align-items: baseline; gap: 10px; }
.tp-level .lvl { font-size: 20px; font-weight: 700; color: var(--ink); }
.tp-bar { height: 22px; max-width: 520px; }
.tp-bar > span { line-height: 20px; font-size: 12px; }
.tp-hero p { margin: 8px 0; font-size: 13px; }
.tp-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tp-stats > div { background: var(--panel-2); border-radius: 8px; padding: 8px 12px; display: flex; flex-direction: column; }
.tp-stats span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.tp-stats b { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tp-outfit { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.tp-outfit p { margin: 4px 0 0; font-size: 13px; }
.tp-dirs { display: flex; gap: 6px; }
.tp-dirs img { width: 64px; height: 64px; background: var(--panel-2); border-radius: 8px; image-rendering: pixelated; }
.tp-outfit > p { flex: 1 1 260px; }
.trainer-page .tp-sprite { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.tp-sprite img { image-rendering: pixelated; }
.tp-preview { max-width: 156px; font-size: 11px; font-weight: 600; text-align: center; color: var(--warn); background: rgba(16, 19, 31, .8); border-radius: 6px; padding: 2px 4px; }
.ofgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; margin-top: 12px; }
.ofcard { display: flex; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.ofcard.on { border-color: #8a7330; }
.ofcard .nm { font-size: 15px; color: var(--ink); }
.ofcard p { margin: 4px 0 6px; font-size: 12.5px; color: var(--muted); }
.ofcard .of-how { margin-top: 0; font-size: 12px; }
.ofcard .buyrow { gap: 6px; }
.of-pic { flex: none; width: 84px; height: 84px; display: grid; place-items: center; border-radius: 8px; background: radial-gradient(circle at 50% 62%, #33406a, #151a28 75%); }
.of-pic img { width: 64px; height: 64px; image-rendering: pixelated; }
.ofcard.locked .of-pic img { opacity: .75; }
.tface { display: inline-block; width: 20px; height: 20px; margin-right: 5px; vertical-align: -5px; border-radius: 4px; background-color: var(--panel-3); background-repeat: no-repeat; background-size: 64px 64px; background-position: -22px -12px; image-rendering: pixelated; }
@media (max-width: 760px) { .tp-hero { flex-direction: column; align-items: stretch; } .tp-sprite { width: 100%; } }

/* Creatures page: filters, grid or list, selection */
.fbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.fbar select { height: 32px; padding: 0 8px; font-size: 12.5px; }
.fsearch { display: flex; align-items: center; gap: 6px; width: 260px; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--faint); }
.fsearch:focus-within { outline: 2px solid var(--accent); }
.fsearch svg { width: 15px; height: 15px; flex: none; }
.fsearch input { border: 0; background: none; padding: 0; outline: 0; width: 100%; font-size: 13px; color: var(--ink); }
.fsearch input:focus { outline: 0; }
.gseg { display: inline-flex; align-items: center; gap: 3px; height: 32px; padding: 0 5px 0 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); font-size: 12.5px; color: var(--muted); }
.gseg span:first-child { margin-right: 3px; }
.gseg button { border: 0; background: none; padding: 2px; border-radius: 5px; cursor: pointer; opacity: .55; line-height: 0; }
.gseg button.on { opacity: 1; outline: 2px solid var(--accent); outline-offset: -1px; }
.gseg button:hover { opacity: 1; }
.btn.tog { height: 32px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; color: var(--muted); background: var(--panel); }
.btn.tog.on { border-color: #5fb4e0; color: var(--ink); background: #1f3046; }
.fsort { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.vseg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.vseg button { display: grid; place-items: center; width: 34px; height: 30px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.vseg button.on { background: var(--panel-3); color: var(--ink); }
.vseg svg { width: 16px; height: 16px; }
.fbar > .btn:last-child { height: 32px; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; padding-bottom: 80px; }
.cgrid .card { height: 124px; box-sizing: border-box; }
.card .teamtag { position: absolute; bottom: 6px; right: 6px; }
.card .stars { color: var(--gold); font-size: 10px; }
.card.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: #22324a; }
.pick { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line-2); background: var(--bg); box-sizing: border-box; }
.card .pick { position: absolute; bottom: 6px; left: 6px; }
.pick.on { background: #2b6f9e; border-color: #5fb4e0; }
.pick.on::after { content: ''; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.ctable-wrap { overflow-x: auto; padding-bottom: 80px; }
.ctable { width: 100%; border-collapse: collapse; font-size: 13px; }
.ctable th { position: sticky; top: 0; background: var(--bg); text-align: left; padding: 0; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
.ctable th button { border: 0; background: none; padding: 7px 8px; font: 600 12px var(--sans); color: var(--muted); cursor: pointer; width: 100%; text-align: inherit; }
.ctable th button:hover { color: var(--ink); }
.ctable th.num { text-align: right; }
.ctable td { padding: 4px 8px; border-bottom: 1px solid #222a3d; white-space: nowrap; font-variant-numeric: tabular-nums; height: 32px; }
.ctable td.num { text-align: right; }
.ctable td img { width: 32px; height: 32px; vertical-align: middle; }
.ctable tbody tr[data-open] { cursor: pointer; }
.ctable tbody tr[data-open]:hover td { background: var(--panel); }
.ctable tr.sel td { background: #1d2c42; }
.ctable .nm { font-weight: 600; }
.ctable .fav { color: var(--gold); }
.ctable .rare-name { color: var(--gold); }
.selbar { position: fixed; left: 50%; bottom: 52px; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; border-radius: 12px; background: #0f131d; border: 1px solid #3c4a6e; box-shadow: 0 12px 30px rgba(0, 0, 0, .55); white-space: nowrap; max-width: calc(100vw - 32px); flex-wrap: wrap; }
.selbar b { margin-right: 6px; }
.selbar > span { color: var(--muted); font-size: 12.5px; }

/* Team tab */
.tcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 8px; }
.tcard { position: relative; display: grid; justify-items: center; gap: 3px; padding: 22px 8px 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); cursor: grab; min-height: 150px; box-sizing: border-box; }
.tcard.lead { border-color: #5fb4e0; }
.tcard img { width: 72px; height: 72px; }
.tcard .nm { font-weight: 600; font-size: 13px; display: flex; gap: 5px; align-items: center; max-width: 100%; }
.tcard .lv { font-size: 12px; color: var(--muted); }
.tcard.empty { cursor: pointer; color: var(--muted); border-style: dashed; background: none; align-content: center; font: inherit; font-size: 13px; }
.tcard.empty:hover { color: var(--ink); border-color: var(--line-2); }
.tcard.dragging { opacity: .4; }
.tcard.dropto { border-color: var(--accent); }
.slotno { position: absolute; top: 6px; left: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
.tcard .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 6px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; }
.tcard .x:hover:not(:disabled) { background: var(--panel-3); color: var(--ink); }
.tcard .x:disabled { opacity: .3; cursor: default; }

/* Shrines */
.shead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 20px 0 6px; }
.shead h3 { margin: 0; }
.shards { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.shards img { width: 18px; height: 18px; }
.scards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; align-items: start; }
.pane .muted, .pagehead .muted, .dialog .muted { color: var(--muted); }
.scard { display: grid; gap: 6px; padding: 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.scard.t2 { border-color: #4f6b8f; }
.scard.t3 { border-color: #8a7330; }
.scard.t4 { border-color: #b46cff; }
.sslot { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 8px; border-radius: 8px; background: var(--panel); }
.sslot img { width: 36px; height: 36px; }
.sslot .grow { flex: 1; min-width: 0; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.scard .state { font-size: 12px; color: var(--muted); }
.scard .state.good { color: #9fd38a; }
.scard .state.warn { margin: 0; }
.pane details.idle { margin: 6px 0 10px; }
.pane details.idle summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.pane details.idle .item, .pane .item.fuse { margin-bottom: 6px; }
.warn-text { color: var(--warn) !important; }

/* Pickers and mini cards in dialogs */
.picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; max-height: 50vh; overflow-y: auto; }
.pcard { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink); text-align: left; cursor: pointer; font: inherit; font-size: 12.5px; }
.pcard:hover:not(:disabled) { border-color: var(--accent); }
.pcard:disabled { opacity: .5; cursor: default; }
.pcard img { width: 40px; height: 40px; flex: none; }
.pcard .grow { min-width: 0; }
.minis { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.mini { position: relative; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); }
.mini img { width: 40px; height: 40px; }
.mini .gr { position: absolute; top: 2px; left: 2px; }
.minis .more { align-self: center; color: var(--muted); font-size: 12px; }
.dialog .dlg-field select { width: 90px; }
@media (max-width: 760px) { .scards, .picker { grid-template-columns: 1fr; } .fsearch { width: 100%; } }

/* Creature page */
.crumbs .ink { color: var(--ink); }
.crumbs .muted { color: var(--muted); }
.crumbs .btn.pg { width: 32px; padding: 3px 0; text-align: center; font-size: 15px; }
.crumbs .btn.disabled { opacity: .4; pointer-events: none; }
.cp { display: grid; grid-template-columns: 380px minmax(0, 1fr) 380px; gap: 14px; align-items: start; }
.cp-left, .cp-mid, .cp-right { display: grid; gap: 12px; min-width: 0; }
.cp .panel { padding: 0; }
.cp-pic { position: relative; height: 230px; display: grid; place-items: center; border-radius: 10px 10px 0 0; border-bottom: 1px solid var(--line); }
.cp-pic img { width: 192px; height: 192px; }
.cp-state { position: absolute; top: 10px; left: 10px; display: flex; gap: 5px; flex-wrap: wrap; }
.cp-stars { position: absolute; bottom: 8px; right: 12px; color: var(--gold); letter-spacing: 2px; }
.cp-body { padding: 14px 16px 16px; }
.cp-name { margin: 0; font: 600 22px/1.2 var(--pixel); color: var(--ink); }
.cp-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; font-size: 12.5px; }
.cp-sub .muted, .cp .muted { color: var(--muted); }
.cp-grade { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); font-size: 12.5px; }
.cp-grade b { font-size: 15px; }
.cp-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.cp-acts .btn { height: 40px; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; }
.cp-why { margin: 8px 0 0; font-size: 12px; color: var(--warn); }
.cp-facts { display: grid; grid-template-columns: 90px 1fr; gap: 6px 10px; margin: 14px 0 0; font-size: 13px; }
.cp-facts.wide { grid-template-columns: 140px 1fr; margin-top: 12px; }
.cp-facts dt { color: var(--muted); }
.cp-facts dd { margin: 0; }
.cp-card { padding: 14px 16px !important; }
.cp-card p { margin: 6px 0; font-size: 13px; }
.cp-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cp-h h4 { margin: 0; font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cp-h h5 { margin: 0; font-size: 15px; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.cp-h > .muted, .cp-h > .linkbtn { margin-left: auto; font-size: 13px; }
.cp-h > h5 + .muted { margin-left: 0; }
.cp-h .pill { margin-left: auto; }
.cp-h b { color: var(--ink); font-size: 16px; }
.cp-ico { width: 30px; height: 30px; }
.cp-stats { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.cp-stats th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 2px 6px 6px; }
.cp-stats td { padding: 5px 6px; white-space: nowrap; }
.cp-stats .num { text-align: right; }
.cp-stats td.w { width: 45%; }
.cp-stats td.w2 { width: 22%; }
.cp-stats tr.dim td { color: var(--faint); }
.cp-stats tr.dim b { color: var(--faint); }
.cp-stats tr.dim .sbar i { opacity: .45; }
.sbar { display: block; height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; }
.sbar > i { display: block; height: 100%; background: linear-gradient(90deg, #e0662a, #f08a3a); border-radius: 3px; }
.sbar.tal > i, .parts .sbar > i { background: var(--accent); }
.parts .sbar.bl > i { background: var(--violet); }
.parts .sbar.gold > i { background: var(--gold); }
.parts b.bl { color: var(--violet); }
.parts td:last-child { font-size: 12px; }
.cp-xp { height: 22px; }
.cp-xp > span { line-height: 20px; font-size: 12px; }
.cp-prev { font-size: 12.5px !important; color: var(--muted); }
.cp-prev b { color: var(--good); }
.cp-check { list-style: none; padding: 0; margin: 6px 0 10px; font-size: 13px; }
.cp-check li { margin: 3px 0; }
.cp-check .ok { color: #9fd38a; }
.cp-check .no { color: #ffb3ad; }
.cp-starrow { color: var(--gold); letter-spacing: 1px; }
.cp-starrow span { color: var(--line-2); }
.cp-card .row { flex-wrap: wrap; }
.cp-card select { min-width: 0; }
.btn.danger-outline { background: none; border-color: #b9474f; color: #ffb3b6; }
.cp-card.sell { border-color: #4a2a33; }
.bad-text { color: #ffb3ad; }
.rare-name { color: var(--gold); }
.cp .rpills { margin-top: 10px; }
@media (max-width: 1399px) {
  .cp { grid-template-columns: 320px minmax(0, 1fr); }
  .cp-right { grid-column: 1 / -1; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}
@media (max-width: 860px) {
  .cp { grid-template-columns: 1fr; }
  .cp-right { grid-template-columns: 1fr; }
}

/* Map page */
.mhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; font-size: 13.5px; }
.mhead .crumb { color: var(--muted); }
.mhead .crumb b { color: var(--ink); font-size: 16px; }
.legend { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.legend .lg { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-left: 6px; }
.lg.safe { background: #79c25a; } .lg.ok { background: var(--warn); } .lg.risky { background: var(--bad); } .lg.locked { background: #6b7590; }
.mhead label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.mhead select { height: 32px; padding: 0 8px; font-size: 13px; color: var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: none; color: var(--muted); padding: 0 12px; height: 30px; font: 600 13px var(--sans); cursor: pointer; }
.seg button.on { background: var(--panel-3); color: var(--ink); }
.mapwrap { display: grid; grid-template-columns: minmax(0, 1fr) 408px; gap: 14px; align-items: start; }
.mapbox { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.mapart { position: relative; height: clamp(480px, calc(100vh - 210px), 760px); }
.mart { position: absolute; inset: 0; width: 100%; height: 100%; }
.mnode { position: absolute; transform: translate(-50%, -26px); display: grid; justify-items: center; gap: 3px; border: 0; background: none; padding: 0; cursor: pointer; z-index: 1; }
.mnode .ring { position: relative; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: #1b2236; border: 3px solid #6b7590; box-sizing: border-box; box-shadow: 0 2px 6px rgba(0, 0, 0, .45); }
.mnode .ring img { width: 42px; height: 42px; }
.mnode.risk-safe .ring { border-color: #79c25a; }
.mnode.risk-ok .ring { border-color: var(--warn); }
.mnode.risk-risky .ring { border-color: var(--bad); }
.mnode.locked .ring { border-color: #6b7590; background: #3a4258; }
.mnode .lock { position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; background: #10131f; color: #c8d0e2; display: grid; place-items: center; }
.mnode .lock svg { width: 11px; height: 11px; }
.mnode .lbl { display: grid; justify-items: center; padding: 2px 8px 3px; border-radius: 6px; background: rgba(16, 19, 31, .88); line-height: 1.25; white-space: nowrap; }
.mnode .lbl b { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.mnode .lbl span { font-size: 11.5px; color: #c8d0e2; font-variant-numeric: tabular-nums; }
.mnode.locked .lbl span { color: var(--muted); }
.mnode:hover .ring, .mnode.on .ring { box-shadow: 0 0 0 3px rgba(127, 200, 232, .6), 0 2px 6px rgba(0, 0, 0, .45); }
.mnode.on .lbl { outline: 1px solid var(--accent); }
.mnode.here .ring::after { content: ''; position: absolute; inset: -9px; border-radius: 50%; border: 2px solid var(--accent); animation: pulse 1.8s ease-out infinite; }
.mnode .pin { position: absolute; top: -18px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, .5); z-index: 2; }
@keyframes pulse { from { opacity: .9; transform: scale(.85); } to { opacity: 0; transform: scale(1.35); } }
@media (prefers-reduced-motion: reduce) { .mnode.here .ring::after { animation: none; } }
img.unseen { filter: brightness(0) opacity(.55); }
.winset { position: absolute; top: 14px; left: 14px; width: 234px; padding: 10px 12px; border-radius: 10px; background: rgba(16, 19, 31, .92); border: 1px solid var(--line); z-index: 2; font-size: 12.5px; }
.winset .cap { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.wmini { position: relative; height: 110px; margin: 8px 0; border-radius: 8px; background: #1d3a63; }
.wreg { position: absolute; padding: 14px 16px; border-radius: 50%; border: 2px solid transparent; font: 600 12px var(--sans); cursor: pointer; background: #dfe6f0; color: #10131f; }
.wreg + .wreg { background: #e3c79a; }
.wreg + .wreg + .wreg { background: #c6e07a; }
.wreg.shut { opacity: .6; }
.wreg.on { border-color: var(--accent); }
.wline { margin: 4px 0 0; color: #c8d0e2; display: flex; gap: 6px; align-items: baseline; }
.wline .dot { position: static; width: 8px; height: 8px; border-radius: 50%; background: #6b7590; flex: none; display: inline-block; }
.wline .dot.on { background: var(--accent); }
.wline .lk svg { width: 11px; height: 11px; color: var(--muted); }
.apanel { border-radius: 12px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; max-height: clamp(480px, calc(100vh - 210px), 760px); }
.ap-head { padding: 14px 16px 8px; }
.ap-head h2 { margin: 0; font: 600 20px var(--pixel); color: var(--ink); }
.ap-head p { margin: 4px 0 0; font-size: 12.5px; }
.ap-better { display: flex; align-items: center; gap: 8px; margin: 0 12px 8px; padding: 8px 10px; border-radius: 8px; background: rgba(121, 194, 90, .1); border: 1px solid rgba(121, 194, 90, .35); font-size: 12.5px; }
.ap-better > span { flex: 1; }
.ap-cards { flex: 1; overflow-y: auto; display: grid; gap: 10px; padding: 4px 12px 12px; align-content: start; }
.hcard { padding: 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.hcard.here { border-color: #5fb4e0; }
.hcard.locked { opacity: .8; }
.hc-top { display: flex; align-items: center; gap: 10px; }
.hc-top > img { width: 40px; height: 40px; flex: none; }
.hc-top b { color: var(--ink); }
.hc-sub { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 12px; flex-wrap: wrap; }
.hc-note { margin: 8px 0 0; font-size: 12px; color: var(--accent); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.tiles > div { display: grid; padding: 6px 8px; border-radius: 7px; background: var(--panel); font-size: 11.5px; color: var(--muted); }
.tiles b { font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.hc-lock { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12.5px; }
.hc-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; }
.hc-foot:empty { display: none; }
.hcard .muted, .ap-head .muted, .ap-better .muted { color: var(--muted); }
.ink { color: var(--ink); }
.gold-text { color: var(--gold); }
.ap-foot { padding: 10px 16px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.ap-foot p { margin: 0 0 6px; }
.ap-foot b { color: var(--ink); font-weight: 600; }
@media (max-width: 1180px) { .mapwrap { grid-template-columns: 1fr; } .apanel { max-height: none; } }
/* On a wide map the inset is the switcher alone, so it never covers an area node; the region lines show on phones. */
@media (min-width: 761px) {
  .winset { width: auto; display: flex; align-items: center; gap: 8px; padding: 6px 8px; }
  .winset .wmini { display: flex; gap: 4px; height: auto; margin: 0; background: none; }
  .winset .wreg { position: static; padding: 4px 11px; border-radius: 999px; }
  .winset .wlines { display: none; }
}
@media (max-width: 760px) { .winset { position: static; width: auto; margin: 8px; } .mapart { height: 520px; } }

/* Shop, Bag, Market, Bosses */
.coinv { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.coinv img { width: 16px; height: 16px; }
.coinv.big { font-size: 15px; }
.subtabs .ti { width: 14px; height: 14px; vertical-align: -2px; }
.pane h4.sec { margin: 16px 0 8px; font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pane h4.sec:first-child { margin-top: 0; }
.pane h4.sec .muted { text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 6px; }
.shopgrid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 14px; align-items: start; }
.cards2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.scard2 { display: flex; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.scard2.on { border-color: #8a7330; }
.scard2 > img { width: 44px; height: 44px; flex: none; }
.scard2 .nm { font-size: 15px; color: var(--ink); }
.scard2 p { margin: 4px 0 8px; font-size: 12.5px; color: var(--muted); }
.scard2 p b { color: var(--ink); }
.buyrow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; }
.amber-text { color: var(--warn); }
.good-text { color: #9fd38a; }
.sidecard { padding: 14px 16px; font-size: 12.5px; }
.sidecard h4 { margin: 0 0 6px; font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sidecard p { margin: 8px 0; }
.sidecard .muted { color: var(--muted); }
.tbl2 { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; margin: 8px 0; }
.tbl2 th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 4px 6px; }
.tbl2 td { padding: 6px; border-top: 1px solid #222a3d; white-space: nowrap; }
.tbl2 .num { text-align: right; }
.tbl2 td img { width: 16px; height: 16px; vertical-align: -3px; }
.tbl2 tr.on td { background: rgba(240, 196, 90, .07); }
.bagrow .cnt { color: var(--muted); font-variant-numeric: tabular-nums; }
.pane .item .row { flex-wrap: wrap; justify-content: flex-end; }
.pane .item .muted, .pane .item .sub .muted { color: var(--muted); }
.mrow img { width: 44px; height: 44px; }
.mrow .nmrow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 600; }
.mrow .sub { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.mprice { display: grid; justify-items: end; gap: 4px; }
.mprice .each { font-size: 11.5px; }
.list.sold .sub { color: var(--muted); font-size: 12.5px; }
.bosscards { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 12px; }
.bosscard .muted { color: var(--muted); }
.bossres { display: flex; gap: 14px; padding: 14px 16px; margin-bottom: 12px; }
.bossres.win { border-color: #8a7330; }
.bossres.loss { border-color: #6a3038; }
.bossres > img { width: 72px; height: 72px; }
/* Boss Ladder (client/ladder.ts) and the boss cards: a framed, shaded look shared by both. */
.sech { display: flex; align-items: baseline; gap: 12px; margin: 0 0 10px; }
.sech h3 { margin: 0; font: 600 18px var(--pixel); letter-spacing: .03em; }
.sech .muted { color: var(--muted); font-size: 12.5px; }
.ladder-h { margin-top: 26px; scroll-margin-top: 70px; }
.ladder { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px; align-items: start; }
.ladder > * { min-width: 0; }
.lsteps { display: flex; flex-direction: column; gap: 4px; max-height: 640px; overflow-y: auto; padding-right: 4px; }
.lstep { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto 14px; align-items: center; gap: 8px; text-align: left; padding: 4px 8px 4px 4px; cursor: pointer; color: var(--ink);
  background: linear-gradient(180deg, #222944, #1a1f31); border: 1px solid var(--line); border-radius: 8px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); font: inherit; }
.lstep img { width: 36px; height: 36px; image-rendering: pixelated; }
.lstep .nm { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lstep .lv { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lstep .ok { color: var(--good); font-size: 12px; font-weight: 700; text-align: center; }
.lstep.on { border-color: var(--violet); background: linear-gradient(180deg, #33295a, #241f40); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 0 0 1px rgba(180, 108, 255, .35); }
.lstep.on .lv { color: var(--ink); }
.lstep.locked { opacity: .55; }
.lstep:hover { border-color: var(--accent); }
.lstep-detail, .bosscard { padding: 14px 16px; min-width: 0; background: linear-gradient(180deg, #20263a, #191d2c); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 6px 18px rgba(0, 0, 0, .25); }
.lhead { display: flex; gap: 14px; align-items: center; }
.lhead > img { width: 84px; height: 84px; flex: none; border-radius: 10px; image-rendering: pixelated;
  background: radial-gradient(circle at 50% 60%, #2c3557, #12151f 75%); border: 1px solid var(--line); box-shadow: inset 0 0 12px rgba(0, 0, 0, .5); }
.lhead h3 { margin: 0 0 6px; font-size: 20px; line-height: 1.2; }
.lhead h3 .lvl { color: var(--gold); font-weight: 600; font-size: 16px; margin-left: 4px; white-space: nowrap; }
.lhead .chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip.good { color: var(--good); border-color: var(--good); }
.chip.bad { color: var(--bad); border-color: var(--bad); }
/* The estimate: verdict, both Powers, the team with type and level marks, and the weak-to hint. */
.est { margin: 12px 0 4px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: linear-gradient(180deg, #151a29, #11141f); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .45); display: grid; gap: 8px; }
.est-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.verdict { display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 6px; font: 700 13px var(--sans); letter-spacing: .08em; text-transform: uppercase; border: 1px solid; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); }
.verdict.outmatched { color: #ffb3ad; border-color: #a8434b; background: linear-gradient(180deg, #4a1f27, #36161c); }
.verdict.even { color: #ffe1a1; border-color: #a9822f; background: linear-gradient(180deg, #4a3a17, #362a10); }
.verdict.favoured { color: #c9f1a6; border-color: #5f9a3a; background: linear-gradient(180deg, #23401d, #1a3016); }
.est-pow { font-size: 13px; font-variant-numeric: tabular-nums; }
.est-pow .muted, .est-weak .muted { color: var(--muted); }
.est-team { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; }
.mate { position: relative; display: inline-flex; flex-direction: column; align-items: center; width: 48px; padding: 2px 0 3px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); }
.mate img { width: 34px; height: 34px; image-rendering: pixelated; }
.mate .mlv { font-size: 10.5px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.mate .mlv.hi { color: #b7e08d; } .mate .mlv.mid { color: var(--warn); } .mate .mlv.lo { color: #ff9a92; }
.mate .mk { position: absolute; top: 1px; right: 3px; display: flex; flex-direction: column; line-height: 1; }
.mate .mk i { font-style: normal; font-size: 9px; }
.mate .mk .up { color: #9fe07a; } .mate .mk .dn { color: #ff8a80; }
.est-weak { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; }
/* Drops with their chances. */
.drops { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; margin: 10px 0 2px; }
.lstep-detail .drops { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
.drop { display: grid; grid-template-columns: 28px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 7px 9px; border-radius: 8px;
  background: linear-gradient(180deg, #262e47, #1e2438); border: 1px solid var(--line-2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); font-size: 12px; min-width: 0; }
.drop img { grid-row: span 2; width: 28px; height: 28px; image-rendering: pixelated; object-fit: contain; }
.drop b { font-weight: 500; font-size: 11px; line-height: 1.25; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.drop .pct { font: 700 15px/1.2 var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; }
.drop.rare { border-color: #8a6bd1; background: linear-gradient(180deg, #2c2650, #211d3b); }
.drop.rare .pct { color: #d7c2ff; }
.lstep-detail h4.sec { margin: 14px 0 6px; }
/* Entry: the key, the fight button and auto-repeat on one line. */
.lentry { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.lentry .grow { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: 13px; }
.lentry .muted { color: var(--muted); font-size: 12px; }
.lentry.running { border: 1px solid var(--violet); border-radius: 10px; padding: 10px 12px; background: rgba(180, 108, 255, .08); }
.lkey { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
.lkey img { width: 20px; height: 20px; image-rendering: pixelated; }
.lkey b { font-variant-numeric: tabular-nums; }
.lentry .btn { height: 32px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
.lrepeat { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.lrepeat label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.lrepeat input[type=number] { width: 56px; height: 32px; padding: 0 8px; box-sizing: border-box; }
.lrepeat input[type=checkbox] { margin: 0; accent-color: var(--accent); }
.bosscard .lentry .btn { margin-left: auto; }
.crests { margin: 10px 0 0; font-size: 12.5px; }
@media (max-width: 760px) {
  .ladder { grid-template-columns: minmax(0, 1fr); }
  .lsteps { flex-direction: row; max-height: none; overflow-x: auto; overflow-y: hidden; padding: 0 0 6px; scroll-snap-type: x proximity; }
  .lstep { grid-template-columns: 32px auto; grid-template-rows: auto auto; row-gap: 0; flex: none; scroll-snap-align: start; padding: 4px 10px 4px 4px; }
  .lstep img { grid-row: span 2; width: 32px; height: 32px; }
  .lstep .ok { display: none; }
  .lhead > img { width: 64px; height: 64px; }
  .lrepeat { margin-left: 0; }
  .lstep-detail, .bosscard { padding: 12px; }
  .drops, .lstep-detail .drops { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sech { flex-wrap: wrap; }
  .sech .link { white-space: nowrap; }
}
.bossres h3 { margin: 0 0 6px; font-size: 16px; }
.bossres .muted { color: var(--muted); }
.rewards { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.rw { display: inline-flex; align-items: center; gap: 5px; }
.rw img { width: 22px; height: 22px; }
@media (max-width: 1180px) { .shopgrid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .cards2, .bosscards { grid-template-columns: 1fr; } }

/* Community: Records and Leaderboards. */
.reclist { display: grid; gap: 6px; }
.recrow { display: grid; grid-template-columns: minmax(200px, 260px) minmax(130px, 180px) 1fr; align-items: center; gap: 14px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.recrow.me { border-color: rgba(78, 163, 255, .55); }
.rec-sp { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 0; }
.rec-sp img { width: 44px; height: 44px; image-rendering: pixelated; flex: none; }
.rec-sp > span, .rec-who { display: grid; gap: 2px; min-width: 0; }
.rec-sp .muted, .rec-who .muted { font-size: 12px; color: var(--muted); }
.rec-who .pill { justify-self: start; }
.rec-rolls .rpills { margin-top: 0; }
.boardseg { margin-bottom: 12px; }
.boardwrap { max-width: 620px; }
.board { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.board th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 6px 10px; text-transform: uppercase; letter-spacing: .05em; }
.board td { padding: 9px 10px; border-top: 1px solid var(--line); }
.board .num { text-align: right; }
.board th.num:first-child, .board td.rank { text-align: right; width: 44px; color: var(--muted); }
.board tr.top1 td.rank { color: var(--gold); font-weight: 700; }
.board tr.top2 td.rank { color: #c9d2e3; font-weight: 700; }
.board tr.top3 td.rank { color: #d99a6c; font-weight: 700; }
.board tr.me td { background: rgba(78, 163, 255, .1); }
.feed .b-record { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 4px 6px; border-left: 3px solid var(--gold); border-radius: 4px; background: rgba(245, 185, 65, .1); color: var(--ink); font-weight: 600; }
.feed .b-record .bsp { width: 22px; height: 22px; image-rendering: pixelated; }
.feed .b-record a { color: var(--accent); font-weight: 500; text-decoration: none; }
@media (max-width: 760px) {
  .recrow { grid-template-columns: 1fr auto; gap: 8px; }
  .rec-rolls { grid-column: 1 / -1; }
  .rec-who { text-align: right; }
  .rec-who .pill { justify-self: end; }
  .boardseg { display: flex; overflow-x: auto; max-width: 100%; }
  .boardseg button { flex: none; min-height: 40px; }
  .feed .b-record a { min-height: 40px; display: inline-flex; align-items: center; }
}

/* While you were away: a card at the top of the field; it never blocks the hunt. */
.ov.away { top: 12px; left: 50%; transform: translateX(-50%); width: min(400px, calc(100% - 24px)); z-index: 12; padding: 12px 14px; background: rgba(18, 23, 36, .96); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.ov.away[hidden] { display: none; }
.away .aw-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.away .aw-h b { font-size: 14.5px; }
.away .aw-h .iconbtn { width: 40px; height: 40px; font-size: 18px; line-height: 1; }
.away .aw-rows { display: grid; gap: 5px; font-size: 13px; font-variant-numeric: tabular-nums; }
.away .aw-rows > div { display: flex; justify-content: space-between; gap: 12px; }
.away .aw-rows span { color: var(--muted); }
.away .aw-rows .wide { color: var(--ink); }
.away .aw-rows b { font-weight: 600; text-align: right; }
.away .aw-f { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
/* Region travel: purely visual, 2 s, nothing to press. */
.travel { position: absolute; inset: 0; display: grid; place-items: center; z-index: 11; pointer-events: none; font: 600 22px var(--pixel); color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, .8); background: radial-gradient(ellipse at center, rgba(10, 13, 22, .55), rgba(10, 13, 22, .15) 70%); opacity: 0; }
.travel[hidden] { display: none; }
.travel.go { animation: travel 2s ease-in-out forwards; }
@keyframes travel { 0% { opacity: 0; } 15%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* Phone: a 48 px top bar, a bottom nav, and the hunt as field, lead card, then tabs. */
.lvring, .cur .short, .bnav, .ptabs, .phone-only, .morebtn { display: none; }
@media (max-width: 760px) {
  body { font-size: 13px; }
  .app { min-height: 100vh; padding-bottom: 62px; }
  .appbar { height: 48px; min-height: 48px; flex-wrap: nowrap; gap: 10px; padding: 0 12px; position: sticky; top: 0; }
  .appbar .brand { font-size: 17px; }
  .appbar .nav, .appbar .boosts, .appbar #netstatus, .appbar .menuwrap:not(.phone-only), .trainer b, .trainer .lvl, .trainer .mini-xp, .trainer .pop { display: none !important; }
  .appbar .phone-only { display: inline-flex; position: static; }
  .phone-only .menu { position: fixed; top: auto; right: 8px; left: 8px; bottom: 70px; z-index: 60; }
  .phone-only .menu a, .phone-only .menu > button { min-height: 40px; display: flex; align-items: center; gap: 6px; }
  .trainer { padding: 0; border: 0; background: none; }
  .lvring { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 1%), #2a3350 0); }
  .lvring span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #161a27; font-size: 11.5px; font-weight: 700; color: var(--ink); }
  .cur .long { display: none; }
  .cur .short { display: inline; }
  .cur { font-size: 13px; }
  .bnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; height: 62px; z-index: 45; background: #161a27; border-top: 1px solid var(--line); }
  .bnav a, .bnav button { position: relative; display: grid; justify-items: center; align-content: center; gap: 3px; color: var(--muted); text-decoration: none; background: none; border: 0; font: 500 11px var(--sans); cursor: pointer; }
  .bnav svg { width: 22px; height: 22px; }
  .bnav .on { color: var(--accent); }
  .bnav .dot { position: absolute; top: 9px; right: calc(50% - 16px); width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }

  /* Hunt: the field, the lead card, then one panel at a time. */
  .game { display: flex; flex-direction: column; gap: 8px; padding: 8px; height: auto; }
  .lcol, #teamlist, #teamlist .slots { display: contents; }
  #teamlist .phead, #teamlist .rail-foot { display: none; }
  .stage { order: 1; min-height: 0; height: auto; overflow: visible; display: flex; flex-direction: column; border: 0; background: none; }
  .stage canvas#field { position: relative; inset: auto; height: 290px; width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block; flex: none; }
  .slot { margin: 0; }
  .slot.lead { order: 2; }
  .panel.playercard { order: 2; }
  .pc { padding: 6px 10px 6px 6px; }
  .pc-face { width: 36px; height: 36px; background-size: 72px 72px; background-position: -18px -8px; }
  .game:not([data-ptab="team"]) .panel.playercard { display: none; }
  .ptabs { order: 3; display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid var(--line); }
  .ptabs button { min-height: 40px; background: none; border: 0; color: var(--muted); font: 600 13px var(--sans); cursor: pointer; }
  .ptabs button.on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
  .slot:not(.lead), .slot.empty { order: 4; }
  .shrinesum { order: 5; }
  .rcol { order: 6; flex-direction: column; }
  .rcol .rtabs { display: none !important; }
  .rcol > .panel { max-height: none; }
  .game:not([data-ptab="team"]) .slot:not(.lead), .game:not([data-ptab="team"]) .slot.empty, .game:not([data-ptab="team"]) .shrinesum { display: none; }
  .game[data-ptab="team"] .rcol, .game[data-ptab="log"] .rcol { display: none; }
  .game[data-ptab="auto"] .rcol .feed { display: none; }
  .game[data-ptab="world"] .rcol .auto, .game[data-ptab="chat"] .rcol .auto { display: none; }
  .game[data-ptab="world"] .rcol .feed, .game[data-ptab="chat"] .rcol .feed { display: flex; min-height: max(360px, calc(100vh - 520px)); }
  .rcol .panel.auto { overflow: visible; }

  /* The hunt card: one compact chip over the top of the field. */
  .huntcard { top: 8px; left: 8px; right: 8px; width: auto; max-width: none; padding: 7px 10px; padding-right: 92px; }
  .huntcard .crumb, .huntcard .what .el, .huntcard .facts .narrow-only, .huntcard .seg { display: none; }
  .huntcard .hc-top { min-height: 0; }
  .huntcard .hc-tools { position: absolute; top: 7px; right: 7px; flex-direction: column; gap: 5px; }
  .hc-tool { width: 78px; height: 30px; }
  .huntcard .what { margin-top: 0; }
  .huntcard .what img { width: 26px; height: 26px; }
  .huntcard .what b { font-size: 15px; }
  .huntcard .facts { font-size: 12px; }
  .ov.suggest { display: none !important; }
  /* The away card sits under the field on a phone, never over the hunt card. */
  .ov.away { position: static; transform: none; width: auto; margin-top: 8px; z-index: auto; box-shadow: none; padding: 10px 12px; }
  .zoom { top: 196px; right: 8px; transform: none; }
  .zoom .btn { width: 40px; height: 40px; }
  /* The log: the last line over the field, the whole log and the session in the Log tab. */
  .combatlog { left: 8px; right: auto; top: 238px; bottom: auto; width: auto; max-width: calc(100% - 64px); padding: 2px; }
  .combatlog > div:not(:last-child) { display: none; }
  .game[data-ptab="log"] .combatlog { position: static; max-width: none; margin-top: 8px; padding: 6px; }
  .game[data-ptab="log"] .combatlog > div { display: block; }
  .session { display: none; }
  .game[data-ptab="log"] .session { display: block; position: static; width: auto; margin-top: 8px; }
  .game[data-ptab="log"] .slot.lead { order: 0; }

  /* Pages: a 38 px strip that returns to the hunt. */
  /* 44 px rather than 38 so "Back to hunt" is a 40 px target; the whole strip also returns to the hunt. */
  .strip { height: 44px; gap: 8px; padding: 0 10px; position: sticky; top: 48px; z-index: 30; }
  .strip .ellip, .strip .divider { display: none; }
  .strip .live { font-size: 0; gap: 0; }
  .strip .bars { display: grid; width: 56px; }
  .strip img.sp { width: 26px; height: 26px; }
  .strip .gain { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .strip .back { flex: none; padding: 0 10px; height: 40px; }
  .page { overflow: visible; }

  /* Touch: 40 px targets. */
  .btn, .btn.small, .subtabs a, .seg button, .vseg button, .gseg, .fbar select, .fsearch, .tog { min-height: 40px; }
  .btn.small { display: inline-flex; align-items: center; justify-content: center; }
  .appbar .brand { display: inline-flex; align-items: center; min-height: 40px; }
  .appbar .trainer { display: inline-flex; align-items: center; min-height: 40px; }
  .link, .linkbtn, .crumbs a:not(.btn) { display: inline-flex; align-items: center; min-height: 40px; }
  .gseg { height: auto; }
  .gseg button { min-width: 30px; min-height: 40px; display: inline-grid; place-items: center; }
  .gseg { padding: 0 4px 0 8px; }
  select, input[type=number], input[type=text], input[type=search], input:not([type]), input[type=range] { min-height: 40px; }
  input[type=checkbox]:not(.toggle) { width: 22px; height: 22px; }
  label.line, label:has(> input[type=checkbox]) { min-height: 40px; }
  .uselist li, .sealtiles button { min-height: 40px; }
  .uselist .mv { width: 34px; height: 34px; }
  .spill { min-height: 40px; }
  .tbl, .tbl2 { display: block; overflow-x: auto; max-width: 100%; }
  .crumbs .btn.pg { width: 40px; }

  /* Creatures: 4 columns of 52 px sprites, filters scroll sideways, selection above the nav. */
  .cgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .cgrid .card { height: auto; padding: 18px 2px 6px; }
  .cgrid .card img { width: 52px; height: 52px; }
  .cgrid .card .nm { font-size: 11px; }
  .card .teamtag { display: none; }
  .fbar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .fbar > * { flex: none; }
  .fbar .spacer { display: none; }
  .fsearch { width: 220px; }
  .selbar { bottom: 70px; left: 8px; right: 8px; transform: none; max-width: none; white-space: normal; }
  .pagetitle { gap: 8px; }
  .pagetitle .meta { font-size: 12px; }
  .subtabs { overflow-x: auto; }
  .subtabs a { display: inline-flex; align-items: center; white-space: nowrap; }
  .tcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cp-facts.wide { grid-template-columns: 110px 1fr; }
  .cp-stats td.w2, .cp-stats th:last-child { display: none; }
  .mhead .legend { display: none; }
  .mnode .lbl b { font-size: 11px; }
  /* Names only on a phone, so neighbouring labels don't cover each other; the picked and current areas keep their rate. */
  .mnode .lbl { padding: 1px 5px 2px; }
  .mnode:not(.on):not(.here) .lbl span { display: none; }
  .mnode .ring { width: 40px; height: 40px; }
  .mnode .ring img { width: 32px; height: 32px; }
  .toasts { bottom: 74px; }
  /* The text keeps a readable width; buttons that do not fit drop to their own line. */
  .item { flex-wrap: wrap; }
  .item > .grow { flex-basis: 180px; }
  .item > .row { margin-left: auto; }
  .tiles b { font-size: 13px; }
  .dialog { width: 100%; }
}

/* Chat showcase: a creature someone showed in chat. Hover or long-press opens its card. */
.feed .show-chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px 1px 2px; border: 1px solid #3c4a6e; border-radius: 999px; background: #151a28; cursor: help; vertical-align: middle; max-width: 100%; }
.feed .show-chip img { width: 22px; height: 22px; image-rendering: pixelated; flex: none; }
.feed .show-chip b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed .show-chip .muted { color: var(--muted); font-size: 11px; white-space: nowrap; }
.feed .show-chip:hover, .feed .show-chip:focus-visible { border-color: var(--accent); }
@media (pointer: coarse) { .feed .show-chip { min-height: 32px; } }

/* Bestiary milestones: catch progress per region and its one-time diamond rewards. */
.dexm { margin: 0 0 10px; padding: 10px 12px; border: 1px solid #2a3350; border-radius: 10px; background: #121725; }
.dexm-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.dexm-bar { flex: 1; min-width: 120px; height: 8px; margin: 0; }
.dexm-bar > i { background: linear-gradient(90deg, #235f92, var(--accent)); }
.dexm-steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.dexm-steps li { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; border-radius: 8px; border: 1px solid #2a3350; font-size: 12px; color: var(--muted); }
.dexm-steps li b { color: var(--ink); font-size: 13px; }
.dexm-steps .dm-r { display: inline-flex; align-items: center; gap: 3px; color: var(--ink); }
.dexm-steps .dm-r img { width: 14px; height: 14px; }
.dexm-steps .dm-ready { border-color: var(--gold); background: rgba(245, 185, 65, .1); }
.dexm-steps .dm-ready .dm-s { color: var(--gold); font-weight: 600; }
.dexm-steps .dm-done .dm-s { color: var(--good, #79c25a); }
@media (max-width: 560px) { .dexm-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Daily quests: the rail card on the hunt and the Quests page. */
.panel.questsum { display: flex; flex-direction: column; gap: 4px; padding: 9px 12px; font-size: 12px; flex: none; }
.questsum .qs-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.questsum .qs-head .muted { color: var(--muted); }
.questsum .qs-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px; align-items: center; gap: 8px; color: var(--muted); }
.questsum .qs-row.done { color: var(--good); }
.questsum .qs-row .bar { margin: 0; }
.questsum .qs-row.done .bar > i { background: var(--good); }
.questsum .btn { align-self: flex-start; margin-top: 2px; }
.q-claim { margin: 0 0 10px; }
.q-day { margin-bottom: 12px; padding: 12px 14px; }
.q-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.q-row { padding: 8px 10px; border: 1px solid #2a3350; border-radius: 8px; }
.q-row.done { border-color: rgba(121, 176, 74, .5); }
.q-main { display: flex; align-items: center; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
.q-bar { display: block; height: 8px; margin: 6px 0; }
.q-bar > i { background: linear-gradient(90deg, #235f92, var(--accent)); }
.q-row.done .q-bar > i { background: var(--good); }
.q-reward { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.q-reward img, .q-bonus img { width: 16px; height: 16px; vertical-align: -3px; image-rendering: pixelated; }
.q-bonus { margin: 10px 0 0; display: flex; align-items: center; gap: 6px; }
@media (max-width: 760px) { .questsum { order: 6; } .game:not([data-ptab="team"]) .questsum { display: none; } }
.questsum .qs-row .ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.questsum .qs-week { display: flex; justify-content: space-between; gap: 8px; margin-top: 2px; padding-top: 5px; border-top: 1px solid var(--line); color: var(--muted); }
.questsum .qs-week.done { color: var(--good); }
/* Quests page: today on the left, the week on the right; one column on narrow screens. */
.q-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; align-items: start; }
@media (max-width: 1000px) { .q-cols { grid-template-columns: minmax(0, 1fr); } }
/* Rewards: an icon and an amount; the full name is the tooltip (and read by screen readers). */
.rw { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.rw img { width: 18px; height: 18px; image-rendering: pixelated; }
.q-reward { gap: 6px 14px; margin-top: 2px; }
.q-st { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.q-st.ready { color: var(--warn); font-weight: 700; }
.q-st.good { color: var(--good); font-weight: 700; }
.q-row.claimed { opacity: .7; }
.q-claim { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.q-claimbtn { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.q-claimbtn .rw { color: inherit; font-size: 12.5px; }
.q-claimbtn .rw img { width: 16px; height: 16px; }
.q-bonus { font-size: 13px; }
.q-bonus > span:first-child { color: var(--muted); }
/* Weekly chest: a track with a seal per step at its marks; full-size steps list their rewards under the seal. */
.q-chest { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.q-chest-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.chest { position: relative; margin: 14px 18px 4px 4px; padding-bottom: 54px; }
.chest .ch-bar { display: block; height: 8px; border-radius: 4px; background: var(--bg); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5); overflow: hidden; }
.chest .ch-bar > i { display: block; height: 100%; background: var(--gold); }
.chest .ch-nodes { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
.chest .cn { position: absolute; top: -9px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.chest .seal { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font: normal 700 11px/1 var(--sans); color: var(--muted); background: var(--panel-2); box-shadow: 0 0 0 2px var(--line); }
.chest .cn.ready .seal { color: var(--bg); background: var(--gold); box-shadow: 0 0 0 2px var(--ink), 0 0 10px var(--gold); }
.chest .cn.claimed .seal { color: var(--ink); background: var(--bad); box-shadow: 0 0 0 2px var(--line); }
.chest .cn-rw { display: flex; align-items: flex-start; gap: 6px; }
.chest .cn-rw .rw { flex-direction: column; gap: 1px; font-size: 12.5px; }
.chest .cn-rw .rw img { width: 20px; height: 20px; }
.chest .cn.locked .cn-rw { opacity: .85; }
.chest .cn.claimed .cn-rw { opacity: .5; }
.questsum .qs-chestbar { position: relative; flex: 1; display: block; }
.questsum .qs-chestbar .bar { margin: 0; }
.questsum .qs-chestbar .tick { position: absolute; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; transform: rotate(45deg); background: var(--line); box-shadow: 0 0 0 1px var(--bg); }
.questsum .qs-chestbar .tick.ready { background: var(--gold); }
.questsum .qs-chestbar .tick.claimed { background: var(--bad); }
.questsum .qs-chest { display: flex; align-items: center; gap: 10px; margin-top: 3px; padding-top: 6px; border-top: 1px solid var(--line); color: var(--muted); text-decoration: none; }
.questsum .qs-chest > span { white-space: nowrap; }

/* Crafting bench on the Bag page. */
.bnrow { align-items: center; }
.bn-recipe { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 3px 0; font-size: 12.5px; }
.bn-in, .bn-out { display: inline-flex; align-items: center; gap: 4px; }
.bn-in img, .bn-out img { width: 18px; height: 18px; image-rendering: pixelated; }
.bn-in.short { color: #ffb3ad; }
.bn-out b { color: var(--ink); }
/* Battery saver: the scene isn't drawn; the stage becomes a scrolling page of big session cards. */
.stage.saver-on { overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 10px; background: var(--bg); }
.stage.saver-on canvas#field, .stage.saver-on .zoom, .stage.saver-on .session, .stage.saver-on .travel { display: none !important; }
.stage.saver-on .ov { position: relative; inset: auto; transform: none; width: auto; max-width: none; flex: none; }
.stage.saver-on .away { order: 0; } .stage.saver-on .huntcard { order: 1; } .stage.saver-on .suggest { order: 2; } .stage.saver-on .saver { order: 3; } .stage.saver-on .combatlog { order: 4; }
.saver { display: flex; flex-direction: column; gap: 10px; }
.saver[hidden] { display: none; }
.sv-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.sv-t { font-size: 12px; letter-spacing: .08em; color: var(--muted); }
.sv-clock { font-weight: 600; font-variant-numeric: tabular-nums; }
.sv-head .muted { color: var(--muted); font-size: 13px; }
.sv-head .ellip { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.sv-card { padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.sc-l { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-v { display: block; margin-top: 4px; font-size: 28px; line-height: 1.15; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-r { margin-top: 2px; font-size: 14px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.sc-n { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.sv-card.neg .sc-v { color: #ff9a8f; }
.sv-foot { margin: 0; font-size: 12px; color: var(--muted); }
.saverbtn { height: 30px; }
@media (max-width: 1399px) { .sv-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } .sc-v { font-size: 24px; } }
@media (max-width: 760px) {
  .stage.saver-on { padding: 0; background: none; overflow: visible; }
  .sv-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .sc-v { font-size: 20px; }
  .stage.saver-on .huntcard .seg { position: absolute; }
  .stage.saver-on .combatlog { top: auto; }
}

/* The log box: Log and this session's catches as two tabs. */
.combatlog .lg-tabs { display: flex; gap: 2px; padding: 0 2px 2px; animation: none; }
.lg-tabs button, .cap-sorts button { background: none; border: 0; color: var(--muted); font: 600 12px var(--sans); padding: 3px 9px; border-radius: 6px; cursor: pointer; }
.lg-tabs button.on, .cap-sorts button.on { background: var(--panel-3); color: var(--ink); }
.lg-tabs .count { font-weight: 500; color: var(--faint); margin-left: 2px; }
.combatlog.catches { width: 520px; max-height: 62%; overflow-y: auto; cursor: default; }
.combatlog .cap-sorts { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 2px; animation: none; }
.combatlog .cap-list { display: grid; gap: 4px; padding: 0; overflow: visible; white-space: normal; animation: none; }
.cap { display: flex; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 8px; background: rgba(35, 42, 62, .7); border: 1px solid var(--line); cursor: pointer; }
.cap:hover { border-color: var(--line-2); }
.cap.sold { opacity: .5; }
.cap img { width: 36px; height: 36px; flex: none; }
.cap-main { min-width: 0; flex: 1; }
.cap-top { display: flex; align-items: baseline; gap: 6px; font-size: 13px; white-space: nowrap; }
.cap-top .muted { overflow: hidden; text-overflow: ellipsis; }
.cap-top time { color: var(--faint); font-size: 11.5px; }
.cap .rpills { flex-wrap: nowrap; overflow: hidden; margin-top: 3px; gap: 4px; }
.cap .rp { height: 18px; font-size: 11px; line-height: 18px; padding: 0 6px; }
.combatlog .cap-empty { margin: 2px 8px 4px; color: var(--muted); white-space: normal; }
.stage.saver-on .combatlog.catches { max-height: none; overflow: visible; }
@media (max-width: 1399px) { .combatlog.catches { width: 440px; } }
@media (max-width: 760px) {
  .game:not([data-ptab="log"]) .combatlog .lg-tabs, .game:not([data-ptab="log"]) .combatlog.catches { display: none; }
  .game[data-ptab="log"] .combatlog.catches { max-height: none; }
}

/* Chat channels: World, Trade, Guild, Help, with new-line counts; Trade cards for shared listings. */
.unread { display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; margin-left: 3px; border-radius: 9px; background: var(--accent); color: #0b0f17; font-size: 10.5px; font-weight: 700; }
.feed .tabs2 { flex-wrap: wrap; }
.feed .guild-empty { margin: 10px 4px; display: grid; gap: 4px; }
.feed #chat input:disabled, .feed #chat button:disabled { opacity: .5; cursor: not-allowed; }
.feed .lcard { display: flex; align-items: center; gap: 8px; margin: 4px 0 2px; padding: 6px 8px; border: 1px solid #8a7330; border-radius: 8px; background: rgba(240, 196, 90, .07); }
.feed .lcard[data-showcase] { cursor: help; }
.feed .lcard img { width: 32px; height: 32px; image-rendering: pixelated; flex: none; }
.feed .lc-main { min-width: 0; flex: 1; display: grid; gap: 2px; }
.feed .lc-name { display: flex; align-items: center; gap: 5px; min-width: 0; }
.feed .lc-name b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed .lc-name .muted, .feed .lc-price .muted { color: var(--muted); font-size: 11px; }
.feed .lc-price { display: flex; align-items: center; gap: 4px; color: var(--warn); font-weight: 600; font-variant-numeric: tabular-nums; }
.feed .lc-price img { width: 14px; height: 14px; }
.feed .lcard .btn { flex: none; text-decoration: none; color: var(--ink); }
.mrow.focus { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn) inset; }
@media (max-width: 1399px) { .tabs2 { display: flex; } }
@media (max-width: 760px) { .ptabs { grid-template-columns: repeat(4, 1fr); } .feed .lcard .btn { min-height: 40px; display: inline-flex; align-items: center; } }

/* Active boosts on the team rail, and players online in the app bar. */
.panel.boostsum { flex: none; padding: 8px 12px; font-size: 12.5px; }
.boostsum .phead { display: flex; align-items: baseline; justify-content: space-between; }
.boostsum h4 { margin: 0 0 4px; }
.boostlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.boostlist li { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: baseline; }
.boostlist b { font-weight: 600; white-space: nowrap; }
.boostlist .eff { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.boostlist .left { color: var(--warn); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.boostlist li.idle .left { color: var(--muted); }
.appbar .players { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.appbar .players::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
@media (max-width: 760px) { .appbar .players { display: none; } .boostsum { order: 5; } .game:not([data-ptab="team"]) .boostsum { display: none; } }
/* Below 1400 px the app bar has no room: the count sits at the end of the chat channel tabs. */
.players-narrow { display: none; margin-left: auto; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
@media (max-width: 1399px) { .appbar .players { display: none; } }
@media (max-width: 760px) { .players-narrow { display: inline; } }

/* Guild page: two columns (guild, bank and settings; roster and members), one on narrow screens. Tags in chat and on boards. */
.gtag { color: var(--gold); font-weight: 700; font-size: .92em; margin-right: 3px; letter-spacing: .02em; }
.gcols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.gstack { display: grid; gap: 12px; min-width: 0; }
@media (max-width: 1000px) { .gcols { grid-template-columns: minmax(0, 1fr); } }
.gcard { padding: 12px 14px; min-width: 0; }
.gcard p { margin: 6px 0; }
.gcard .hint { font-size: 12px; margin: 6px 0; }
.gtitle { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gtitle h2 { margin: 0; font-size: 22px; }
.gtitle h2 .gtag { font-family: var(--sans); }
.gposter { color: var(--muted); font-size: 12px; margin-top: 2px; white-space: normal; }
.gposter.big { font-size: 14px; color: var(--ink); font-style: italic; }
.gnote { color: var(--warn); font-size: 12.5px; }
.gsub { margin: 12px 0 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.gscroll { overflow-x: auto; }
.glist td, .gmembers td { white-space: normal; vertical-align: middle; }
.glist td.num, .gmembers td.num { white-space: nowrap; }
.gmembers tr.me td { background: rgba(78, 163, 255, .08); }
.gacts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.gname { display: inline-flex; align-items: center; gap: 5px; }
.gdot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); flex: none; }
.glines { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.glines li { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 6px 8px; border: 1px solid #2a3350; border-radius: 8px; }
.gform { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; margin: 4px 0 8px; }
.gform label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.gform label.wide { grid-column: 1 / -1; }
.gform input, .gform select { width: 100%; }
.gtag-in { text-transform: uppercase; }
.gwhy { margin-left: 8px; font-size: 12px; }
.gtagrow { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; }
.gtagrow label { display: grid; gap: 3px; color: var(--muted); }
.gtagrow input { width: 80px; }
.gbar > i { background: linear-gradient(90deg, #7a3f1e, var(--gold)); }
.ggive { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 10px 0 4px; }
.ggive-c { display: inline-flex; gap: 6px; align-items: center; }
.ggive-c input { width: 84px; padding: 4px 8px; }
.gslots { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.gslots li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 5px 8px; border: 1px solid #2a3350; border-radius: 8px; font-size: 13px; }
.gslots li.empty { border-style: dashed; }
.gslots li.picked { border-color: var(--warn); }
.gslot { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.boostlist b a { color: inherit; text-decoration: none; }
.boostlist b a:hover { text-decoration: underline; }
@media (max-width: 760px) { .gform { grid-template-columns: minmax(0, 1fr); } .gacts .btn { min-height: 32px; } }
.gtag-in::placeholder { text-transform: none; }
@media (max-width: 760px) { .gmembers .gjoined { display: none; } .gmembers td { padding: 6px 4px; } .gacts { justify-content: flex-start; } }
/* ---------- Arena ---------- */
.ar-tier { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 10px; font-size: 11.5px; font-weight: 700; color: var(--tc); background: color-mix(in srgb, var(--tc) 16%, transparent); border: 1px solid color-mix(in srgb, var(--tc) 45%, transparent); white-space: nowrap; }
.ar-tier.big { height: 30px; padding: 0 14px; border-radius: 15px; font-size: 15px; }
.ar-top { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.3fr); gap: 12px; margin-bottom: 14px; align-items: start; }
.ar-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ar-sec h3 { margin: 6px 0 8px; font-size: 15px; }
.ar-me { display: flex; flex-direction: column; gap: 8px; padding: 14px; }
.ar-me p { margin: 0; }
.ar-me-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ar-ar { font-size: 15px; } .ar-ar b { font-size: 22px; }
.ar-rec { color: var(--muted); font-size: 13px; }
.ar-q { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.ar-lineups { padding: 12px; }
.ar-l-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.ar-l-title h4 { margin: 0; }
.ar-l-title .muted { font-size: 12px; }
.ar-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.ar-list li { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--panel-2); }
.ar-list li.on { border-color: var(--accent); }
.ar-l-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.ar-l-head .muted { font-size: 12px; }
.ar-team { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.ar-mon { position: relative; display: inline-flex; flex-direction: column; align-items: center; width: 52px; font-size: 10.5px; color: var(--muted); }
.ar-mon img { width: 40px; height: 40px; }
.ar-mon.aura img { filter: drop-shadow(0 0 3px var(--gold)); }
.ar-mon i { position: absolute; top: 0; left: 2px; font-style: normal; font-weight: 700; color: var(--accent); font-size: 10px; }
.ar-edit label { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.ar-elist { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 4px; }
.ar-elist li { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.ar-elist .ar-mon { width: 44px; }
.ar-elist .ar-mon span { display: none; }
.ar-recent { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.ar-recent > li { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.ar-m { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; background: none; color: inherit; font: inherit; font-size: 13px; text-align: left; cursor: pointer; flex-wrap: wrap; }
.ar-m:hover { background: var(--panel-2); }
.ar-m .good, .ar-recent .good { color: #9fd38a; }
.ar-m .bad, .ar-recent .bad { color: #ffb3ad; }
.ar-log { padding: 4px 10px 10px; border-top: 1px solid var(--line); font-size: 12.5px; }
.ar-roster { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.ar-roster b { min-width: 70px; }
.ar-log ol { list-style: none; padding: 0; margin: 6px 0; max-height: 320px; overflow-y: auto; display: grid; gap: 2px; }
.ar-log li { padding: 2px 6px; border-radius: 4px; }
.ar-log li.me { background: rgba(127, 200, 232, .07); }
.ar-log li.them { background: rgba(224, 90, 90, .06); }
.ar-t { display: inline-block; width: 48px; color: var(--faint); font-variant-numeric: tabular-nums; }
.ar-ladder .linkbtn { text-decoration: none; color: var(--ink); }
.ar-ladder .linkbtn:hover { color: var(--accent); }
.ar-peek { margin-top: 10px; padding: 10px; }
.ar-notice { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; padding: 10px 12px; }
.ar-notice img, .ar-prizes img { width: 16px; height: 16px; vertical-align: -3px; }
.ar-prizes { max-width: 420px; }
.ar-locked { padding: 16px; margin-bottom: 14px; }
.ar-locked h3 { margin: 0 0 6px; }
@media (max-width: 900px) {
  .ar-top, .ar-cols { grid-template-columns: 1fr; }
}
.ar-mon.out { opacity: .45; }
/* Refine: its own pill, apart from the grade colors (it never moves the grade). */
.rp.t-rf { background: rgba(64, 200, 190, .14); color: #8fe6dc; border-color: rgba(64, 200, 190, .55); }
.cp-stats .rf { margin-left: 5px; font-size: 11px; font-weight: 700; color: #8fe6dc; }
.cp-refine .seg { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 8px; }
.cp-refine .seg .btn { min-width: 0; }
.cp-refine .seg .btn.on { border-color: #40c8be; color: var(--ink); background: rgba(64, 200, 190, .16); }
.cp-refine .seg .btn small { margin-left: 4px; color: #8fe6dc; font-weight: 700; }
.cp-refine .cost { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.calc-rf { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.calc-rf label { display: flex; flex-direction: column; font-size: 11.5px; color: var(--muted); gap: 2px; }
.calc-rf input { width: 100%; min-width: 0; }
.hc .foot .rf { margin-left: 2px; font-size: 10.5px; font-weight: 700; color: #8fe6dc; }
.cp-refine .seg .ico16 { width: 16px; height: 16px; margin-right: 4px; vertical-align: -3px; image-rendering: pixelated; }

/* ---------- Guild War (Guild page) ---------- */
.gwar-h { margin: 18px 0 8px; font-size: 17px; }
.gwar-you { font-size: 13px; }
.gwar-bonus { font-size: 13px; color: var(--gold); }
.gwar-t td, .gwar-t th { white-space: nowrap; }
/* Phones: drop the detail columns (fell at, survival, combat, season KOs) so GP and the prize stay in view. */
@media (max-width: 600px) { .gwar-t .opt { display: none; } }
.gwar-t tr.me td { background: rgba(78, 163, 255, .08); }
.gwar-medal { font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gwar-logh { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; flex-wrap: wrap; }
.gwar-logh .muted { font-size: 12px; }
.gwar-log { list-style: none; margin: 6px 0 0; padding: 0; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; }
.gwar-log li { display: flex; gap: 8px; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.gwar-log li:last-child { border-bottom: 0; }
.gwar-log li.fall { color: var(--warn); }
.gwar-log .t { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; width: 34px; text-align: right; }
.rp.t-medal { background: rgba(214, 160, 70, .16); color: #f0c97a; border-color: rgba(214, 160, 70, .6); }
.medal-chip { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 9px; font-size: 11px; font-weight: 700; color: #f0c97a; background: rgba(214, 160, 70, .16); border: 1px solid rgba(214, 160, 70, .6); white-space: nowrap; }
/* ---------- Element Halls ---------- */
.hl-intro { padding: 12px 14px; margin-bottom: 12px; font-size: 13.5px; }
.hl-intro p { margin: 0 0 6px; } .hl-intro p:last-child { margin-bottom: 0; }
.hl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; margin-bottom: 16px; }
.hl-card { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-top: 3px solid var(--hc); min-width: 0; }
.hl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hl-head h3 { margin: 0; font-size: 15px; }
.hl-keeper, .hl-mine { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--panel-2); }
.hl-mine .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.hl-vacant { margin: 0; font-size: 13px; }
.hl-podium table { width: 100%; font-size: 12.5px; }
.hl-podium td { vertical-align: middle; }
.hl-who { white-space: nowrap; }
.hl-mini { display: inline-flex; gap: 0; flex-wrap: wrap; }
.hl-mini .ar-mon { width: 28px; }
.hl-mini .ar-mon img { width: 26px; height: 26px; }
.hl-mini .ar-mon span { display: none; }
.hl-podium .linkbtn { margin-top: 4px; font-size: 12.5px; }
@media (max-width: 520px) { .hl-grid { grid-template-columns: minmax(0, 1fr); } }


/* ---------- Friends, profiles, friendly battles, training ---------- */
.plink { color: inherit; text-decoration: none; }
.plink:hover, .plink:focus-visible { color: var(--accent); text-decoration: underline; }
.gdot.off { background: var(--line-2); }
.pf a.btn, .fr-acts a.btn, .fr-chath a.btn { text-decoration: none; }
.pf-why { margin: 6px 0 0; font-size: 12.5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fr-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.fr-add input { flex: 0 1 220px; min-width: 0; }
.fr-list td { vertical-align: middle; }
.fr-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.fr-inbox, .fr-invites, .fr-status { padding: 10px 12px; margin-bottom: 12px; }
.fr-inbox h4, .fr-invites h4 { margin: 0 0 6px; }
.fr-inbox ul, .fr-invites ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.fr-invites li { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.fr-status { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 13px; }
.fr-chath { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.fr-thread { padding: 10px; }
.fr-thread ol { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; max-height: 50vh; overflow-y: auto; font-size: 13.5px; }
.fr-thread li { padding: 4px 8px; border-radius: 6px; overflow-wrap: anywhere; }
.fr-thread li.me { background: rgba(127, 200, 232, .08); }
.fr-thread li.them { background: var(--panel-2); }
.fr-thread .t { color: var(--faint); font-size: 11.5px; margin-right: 6px; }
.fr-send { display: flex; gap: 8px; }
.fr-send input { flex: 1; min-width: 0; }
.fr-show { display: flex; gap: 8px; flex-wrap: wrap; }
.fr-show .show-chip, .pf .show-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border: 1px solid #3c4a6e; border-radius: 999px; background: #151a28; cursor: help; }
.pf .show-chip img { width: 32px; height: 32px; image-rendering: pixelated; }
.fr-show-edit { display: grid; gap: 6px; max-width: 420px; }
.pf { display: grid; gap: 12px; }
.pf > .panel { padding: 12px 14px; }
.pf-hero { display: flex; gap: 18px; align-items: center; }
.pf-hero h2 { margin: 0 0 6px; font-size: 24px; display: flex; align-items: center; gap: 6px; }
.pf-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0; font-size: 13.5px; }
.pf-acts { margin-top: 10px; flex-wrap: wrap; }
@media (max-width: 760px) { .pf-hero { flex-direction: column; align-items: stretch; } .pf-hero .tp-sprite { width: 100%; } }
.fb-log { padding: 6px 10px 10px; border-top: 1px solid var(--line); font-size: 12.5px; }
.fb-end { margin: 6px 0; }
.fb-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fb-side { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--panel-2); }
.fb-side.won { border-color: var(--good); }
.fb-sh { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.fb-team { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.fb-team li { display: flex; gap: 6px; align-items: center; }
.fb-team img { width: 32px; height: 32px; image-rendering: pixelated; flex: none; }
.fb-team .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fb-hp { display: block; height: 4px; border-radius: 2px; background: var(--panel-3); overflow: hidden; }
.fb-hp i { display: block; height: 100%; background: var(--good); }
.fb-log details.ar-log { border-top: 0; padding: 4px 0 0; }
.fb-log details summary { cursor: pointer; color: var(--muted); }
.tr-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tr-side { padding: 10px 12px; }
.tr-side h4 { margin: 0; }
.tr-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.tr-list > li { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--panel-2); font-size: 13px; }
.tr-list > li img { width: 36px; height: 36px; image-rendering: pixelated; flex: none; }
.tr-list .grow { min-width: 0; flex: 1; }
.tr-acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.tr-stats { font-size: 11.5px; overflow-wrap: anywhere; }
.tr-side .actions select { max-width: 100%; min-width: 0; flex: 1 1 160px; }
.tr-edit { padding: 12px; margin-bottom: 12px; }
.tr-edit h4 { margin: 0 0 8px; }
.tr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tr-grid label, .tr-six label { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: var(--muted); min-width: 0; }
.tr-grid label.wide { grid-column: span 2; }
.tr-grid select, .tr-grid input, .tr-six input { width: 100%; min-width: 0; }
.tr-grid label.tr-check { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); }
.tr-grid label.tr-check input { width: auto; }
.tr-sub { margin: 10px 0 4px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tr-six { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.tr-go { margin: 12px 0; align-items: center; }
.tr-result { padding: 10px 12px; }
.tr-result h4 { margin: 0; }
@media (max-width: 900px) { .tr-cols, .fb-sides { grid-template-columns: 1fr; } .tr-six { grid-template-columns: repeat(3, 1fr); } .tr-grid label.wide { grid-column: 1 / -1; } }

/* Starter checklist (client/starter.ts): a small card on the hunt rail for new trainers. */
.panel.startersum { display: flex; flex-direction: column; gap: 4px; padding: 9px 12px; font-size: 12px; flex: none; }
.startersum .qs-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.startersum .qs-head .muted, .startersum .muted { color: var(--muted); }
.startersum button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-decoration: underline; }
.startersum .st-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.startersum .st-list li { display: flex; align-items: center; gap: 7px; color: var(--muted); min-width: 0; }
.startersum .st-list li.next { color: var(--ink); }
.startersum .st-list li.done { color: var(--good); }
.startersum .st-box { width: 13px; height: 13px; flex: none; border: 1px solid var(--line); border-radius: 3px; display: grid; place-items: center; font-size: 10px; line-height: 1; }
.startersum li.done .st-box { border-color: var(--good); }
.startersum .ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.startersum .st-hint, .startersum .st-reward { margin: 2px 0 0; color: var(--muted); font-size: 11.5px; }
.startersum .btn { align-self: flex-start; margin-top: 2px; }
.menu .locked { display: flex; align-items: center; gap: 6px; padding: 7px 10px; color: var(--muted); opacity: .7; cursor: default; font-size: 13px; }
@media (max-width: 760px) { .startersum { order: 2; } }
/* Coin eggs (Shop → Coin eggs) */
.egg-ic, .egg-ti { display: inline-block; flex: none; width: 34px; height: 44px; border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%; background: radial-gradient(circle at 35% 30%, #fff8 0 12%, transparent 13%), linear-gradient(160deg, #e9dcc0, #b9a274); border: 1px solid #00000055; }
.egg-ti { width: 10px; height: 13px; vertical-align: -2px; }
.egg-ic.bl2 { background: radial-gradient(circle at 35% 30%, #fff8 0 12%, transparent 13%), linear-gradient(160deg, #cfe6f2, #6d9fbf); }
.egg-ic.bl3 { background: radial-gradient(circle at 35% 30%, #fff8 0 12%, transparent 13%), linear-gradient(160deg, #e2d2f7, #8b6bc4); }
.egg-ic.bl4 { background: radial-gradient(circle at 35% 30%, #fff8 0 12%, transparent 13%), linear-gradient(160deg, #ffe7a8, var(--gold)); box-shadow: 0 0 10px #f0c45a55; }
/* Rig-drawn eggs (art/rig3d/parts/eggs.ts), 34x44 like the box. */
.egg-ic.bl2, .egg-ic.bl3, .egg-ic.bl4 { border: 0; border-radius: 0; box-shadow: none; background: center / 34px 44px no-repeat; image-rendering: pixelated; }
.egg-ic.bl2 { background-image: url(art/icon-egg-bl2.png); }
.egg-ic.bl3 { background-image: url(art/icon-egg-bl3.png); }
.egg-ic.bl4 { background-image: url(art/icon-egg-bl4.png); }
/* The preview stage and incubator chambers show eggs at 68 x 88: the egg drawn at that size, not a 2x copy. */
.egg-ic.big.bl2 { background-image: url(art/icon-egg-bl2@68.png); }
.egg-ic.big.bl3 { background-image: url(art/icon-egg-bl3@68.png); }
.egg-ic.big.bl4 { background-image: url(art/icon-egg-bl4@68.png); }
.subtabs a.locked { opacity: .7; }
.incubators { padding: 12px 14px; margin-bottom: 12px; }
.incubators h4 { margin: 0; }
.inc-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 8px; }
.inc { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.inc.empty, .inc.locked { border-style: dashed; }
.inc-n { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--panel); color: var(--muted); }
.inc .grow { min-width: 0; }
.inc-at { margin: 3px 0 0; font-size: 11.5px; }
.egg-pick { align-items: center; gap: 10px; flex-wrap: wrap; }
.egg-pick .sec { margin: 0; }
.egg-pool { margin: 4px 0 10px; line-height: 1.9; }
.egg-card p { margin: 4px 0; }
.incbar { height: 8px; margin-top: 6px; border-radius: 4px; background: var(--panel); overflow: hidden; }
.incbar > i { display: block; height: 100%; min-width: 2px; background: linear-gradient(90deg, #8b6bc4, var(--gold)); }
.combatlog .logbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.ar-log .sigmv { color: var(--gold); }

/* ---------- Battle Plan ---------- */
.plan-intro { padding: 12px 14px; margin-bottom: 12px; font-size: 13.5px; }
.plan-intro p { margin: 0; }
.plan-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.plan-col { display: grid; gap: 12px; min-width: 0; }
.plan-war, .plan-practice { padding: 12px; }
.plan-war h4, .plan-practice h4 { margin: 0 0 6px; }
.plan-war h5 { margin: 12px 0 2px; font-size: 13px; }
.plan-war p, .plan-practice p { font-size: 12.5px; margin: 4px 0; }
.plan-wl { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.plan-wl .btn.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.plan-rules { display: grid; gap: 6px; margin-top: 6px; }
.plan-rule { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); cursor: pointer; font-size: 13px; }
.plan-rule .muted { font-size: 12px; }
.plan-rule.on { border-color: var(--accent); background: rgba(127, 200, 232, .12); }
.plan-vs { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; margin: 8px 0; background: var(--panel-2); }
.plan-vs label { display: flex; align-items: center; gap: 8px; font-size: 13px; flex-wrap: wrap; }
.plan-vs label > span { min-width: 56px; color: var(--muted); }
.plan-vs select { max-width: 100%; }
.plan-practice .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.plan-result { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.plan-score { font-size: 14px !important; }
.plan-result details summary { cursor: pointer; font-size: 12.5px; color: var(--accent); margin: 6px 0; }
@media (max-width: 900px) { .plan-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Tournaments ---------- */
.tn-intro { padding: 12px 14px; margin-bottom: 12px; font-size: 13.5px; }
.tn-intro p { margin: 0; }
.tn-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.tn-card { position: relative; padding: 14px; border-top: 3px solid var(--tc); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tn-card h3 { margin: 0; color: var(--tc); font-size: 17px; }
.tn-card p { margin: 0; font-size: 12.5px; }
.tn-card .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.tn-emblem { width: 48px; height: 42px; flex: none; }
.tn-card .tn-emblem { position: absolute; top: 10px; right: 12px; }
.tn-blurb { color: var(--muted); padding-right: 52px; min-height: 34px; }
.tn-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.tn-live { color: var(--tc); font-weight: 600; }
.tn-edit, .tn-event, .tn-other, .tn-trophies, .tn-none { padding: 12px; margin-bottom: 12px; }
.tn-edit { border-left: 3px solid var(--tc); }
.tn-edit .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.tn-edit select { max-width: 100%; min-width: 0; flex: 1 1 260px; }
.tn-pay { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; }
.tn-event { border-top: 3px solid var(--tc); }
.tn-event h3, .tn-event h4 { margin: 0; }
.tn-event > h4 { margin: 14px 0 6px; }
.tn-my { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-top: 10px; background: var(--panel-2); }
.tn-sides { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 8px; }
.tn-sides h5, .tn-order h5 { margin: 4px 0; font-size: 13px; }
.tn-sheet { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.tn-sheet li { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; min-width: 0; }
.tn-sheet li .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tn-sheet li.banned { opacity: .55; border-style: dashed; }
.tn-rolls { font-size: 11.5px; }
.tn-order { margin-top: 10px; }
.tn-order p { font-size: 12px; margin: 2px 0 6px; }
.tn-order .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.tn-out { opacity: .55; }
.tn-prac { font-size: 12.5px; margin: 6px 0 0; }
.tn-games { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.tn-games > li { border-top: 1px solid var(--line); padding-top: 8px; }
.tn-orders { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 4px; font-size: 12px; }
.tn-bracket { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.tn-col { display: flex; flex-direction: column; justify-content: space-around; gap: 8px; min-width: 170px; }
.tn-col h5 { margin: 0; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tn-m { display: grid; gap: 2px; text-align: left; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); cursor: pointer; color: var(--ink); font-size: 12.5px; }
.tn-m:hover { border-color: var(--tc); }
.tn-m span { display: grid; grid-template-columns: 1fr auto; column-gap: 6px; }
.tn-m span small { grid-column: 1; font-size: 10.5px; color: var(--tc); }
.tn-m span em { grid-row: 1; grid-column: 2; font-style: normal; font-weight: 700; }
.tn-m span.w b { color: var(--tc); }
.tn-m span.l { opacity: .55; }
.tn-trophies h4 { margin: 0 0 8px; }
.tn-tlist { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 10px; }
.tn-tlist li { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 10px; }
.tn-tlist .tn-emblem { width: 34px; height: 30px; }
img.tn-emblem { image-rendering: pixelated; }
.tn-tlist img.tn-emblem { image-rendering: auto; }
.tn-titles { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tn-titles .btn.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tn-trophies p { font-size: 12.5px; }
.trainer-title { font-size: 12px; color: var(--warn); }
@media (max-width: 900px) { .tn-cards, .tn-sides { grid-template-columns: minmax(0, 1fr); } }
.tn-soon-note { padding: 10px 14px; margin-bottom: 12px; font-size: 13.5px; border-left: 3px solid var(--warn); }
.tn-card.tn-soon { overflow: hidden; padding-top: 30px; }
.tn-ribbon { position: absolute; top: 0; left: 0; padding: 4px 12px; font: 700 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #1b1f2c; background: var(--tc); border-bottom-right-radius: 8px; }

/* Name tags: a nickname's species as quiet secondary text (client/fmt.ts nameHtml). */
.nick-sp { font-size: .8em; font-weight: 400; color: var(--muted); }
.cp-nick .nick-row input { min-width: 0; }

/* ---------- UI round 2: team rail (lead card and compact bench), roll pills, scene tools, creature popup ---------- */
.panel.team { overflow: visible; }
.slot.lead { display: block; padding: 8px 10px 9px; }
.slot.lead .lead-top { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 9px; align-items: center; }
.slot.lead .lead-top img, .slot.lead .lead-top .walker { width: 56px; height: 56px; }
.slot.lead .r1 { display: flex; align-items: center; gap: 6px; }
.slot.lead .r2 { display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; margin: 2px 0 0; overflow: hidden; }
.slot.lead .onfield { margin-left: auto; font-size: 11.5px; font-style: italic; white-space: nowrap; }
.slot.lead .rpills { margin-top: 6px; gap: 4px; }
.slot.lead .rp { height: 20px; line-height: 20px; padding: 0 7px; font-size: 11.5px; }
.slot.lead .bar.big { margin-top: 5px; }
.slot.bench { grid-template-columns: 34px minmax(0, 1fr); gap: 8px; align-items: center; padding: 5px 8px 6px; }
.slot.bench img, .slot.bench .walker { width: 34px; height: 34px; }
.slot.bench .r1 { gap: 6px; }
.slot.bench .r1 .lv { flex: none; font-size: 12px; }
.slot.bench .ko { font-size: 11px; font-weight: 700; color: var(--bad, #ff8a80); }
.peek-btn { margin-left: auto; flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .12s; }
.peek-btn svg { width: 17px; height: 17px; }
.slot:hover .peek-btn, .slot:focus-within .peek-btn, .peek-btn:focus-visible { opacity: 1; }
.peek-btn:hover { color: var(--ink); background: rgba(127, 127, 127, .15); }
@media (hover: none) { .peek-btn { opacity: .75; } }
.rpills.m { display: flex; flex-wrap: nowrap; gap: 3px; margin: 3px 0 0; overflow: visible; }
.rp.m { height: 16px; padding: 0 5px; border-radius: 3px; font-size: 10.5px; line-height: 15px; gap: 0; }
.rpills.m .rp:first-child::after { left: 0; transform: none; }
.slivers { display: grid; gap: 2px; margin-top: 4px; }
.sl { position: relative; display: block; height: 3px; border-radius: 2px; background: rgba(0, 0, 0, .35); overflow: hidden; }
.sl > i { position: absolute; inset: 0 auto 0 0; }
.sl.hp > i { background: #79c25a; }
.sl.xp > i { background: #3b8fd0; }
.sl.xp.idle { opacity: .45; }
.sl.xp.idle > i { filter: grayscale(1); }
.bar.xp.idle { opacity: .6; }
.bar.xp.idle > i { filter: grayscale(.9); }

/* Player card: the card opens the player screen; three small doors on the right. */
.pc { display: flex; align-items: center; gap: 6px; padding: 0; }
.pc-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 8px 4px 8px 8px; color: inherit; text-decoration: none; }
.pc-doors { display: grid; grid-template-columns: repeat(3, 26px); gap: 3px; padding-right: 8px; flex: none; }
.pc-door { position: relative; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; color: var(--muted); text-decoration: none; }
.pc-door svg { width: 16px; height: 16px; }
.pc-door:hover { color: var(--ink); background: rgba(127, 127, 127, .15); }
.pc-door .dot { position: absolute; top: -3px; right: -3px; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 7px; background: #c0392b; color: #fff; font: 700 9.5px/14px var(--sans); text-align: center; }

/* Scene tools: map, battery saver and zoom stacked in the scene's top-right corner. */
.fieldtools { position: absolute; top: 10px; right: 10px; z-index: 4; display: grid; gap: 5px; justify-items: center; }
.fieldtools .ft { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 7px; border: 1px solid var(--line-2); background: rgba(14, 18, 27, .86); color: var(--ink); font: 700 17px/1 var(--sans); cursor: pointer; text-decoration: none; }
.fieldtools .ft svg { width: 17px; height: 17px; }
.fieldtools .ft:hover { border-color: var(--accent); }
.fieldtools .ft-gap { height: 4px; }
.stage.saver-on .fieldtools { display: none; }
@media (max-width: 760px) { .fieldtools { top: auto; bottom: 64px; } }

/* The creature popup: over the hunt, which keeps running underneath. */
.peek-scrim { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(8, 6, 4, .5); }
.peek-scrim[hidden] { display: none; }
.peek { position: relative; width: min(600px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 16px 18px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); box-shadow: 0 18px 50px rgba(0, 0, 0, .55); outline: none; }
.pk-x { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.pk-x svg { width: 18px; height: 18px; }
.pk-x:hover { color: var(--ink); background: rgba(127, 127, 127, .15); }
.pk-head { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; align-items: center; padding-right: 26px; }
.pk-pic { position: relative; display: grid; place-items: center; width: 112px; height: 112px; border-radius: 10px; background: radial-gradient(circle at 50% 62%, #33406a, #151a28 72%); }
.pk-pic img { width: 96px; height: 96px; image-rendering: pixelated; }
.pk-stars { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; color: var(--gold); font-size: 11px; }
.pk-name { margin: 0; font-size: 22px; line-height: 1.1; }
.pk-nick { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--muted); font-size: 13px; }
.pk-lv { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 2px; }
.pk-lv b { font-size: 16px; }
.peek .bar.big { height: 16px; margin-top: 5px; }
.peek .bar.big > span { line-height: 14px; }
.peek .rpills { margin-top: 12px; }
.pk-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-top: 12px; }
.pk-h { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pk-st { display: grid; grid-template-columns: 58px 42px minmax(0, 1fr) 22px; gap: 6px; align-items: center; font-size: 13px; height: 21px; }
.pk-st span:first-child { color: var(--muted); }
.pk-st b { text-align: right; font-variant-numeric: tabular-nums; }
.pk-st em { font-style: normal; text-align: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.pk-sb { height: 6px; border-radius: 3px; background: rgba(0, 0, 0, .3); overflow: hidden; }
.pk-sb i { display: block; height: 100%; background: var(--accent); }
.pk-st.off { opacity: .5; }
.peek .movebar { margin: 0 0 8px; }
.pk-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; margin: 0; font-size: 13px; }
.pk-facts dt { color: var(--muted); }
.pk-facts dd { margin: 0; }
.pk-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.pk-nav { margin-left: auto; display: inline-flex; gap: 4px; }
.pk-nav .btn { width: 28px; font-size: 16px; }
@media (max-width: 560px) { .pk-cols { grid-template-columns: 1fr; } .pk-head { grid-template-columns: 80px minmax(0, 1fr); } .pk-pic { width: 80px; height: 80px; } .pk-pic img { width: 68px; height: 68px; } }
/* Collection: each card carries its rolls as the same colored pills as the team rail. */
.cgrid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
.cgrid .card { height: 146px; }
.card .rpills.m { justify-content: center; margin-top: 5px; }
.ctable .rp { height: 20px; line-height: 20px; padding: 0 7px; font-size: 11.5px; }
.combatlog .rpills.m { display: inline-flex; vertical-align: -2px; margin: 0 3px; }
.cap-best { display: inline-grid; place-items: center; color: var(--gold); }
.cap-best svg { width: 14px; height: 14px; }

/* Player screen (#/trainer): you on the left, tabs on the right; every tab fits one screen at 1440x900. */
.player-hub { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; align-items: start; }
.ph-id { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; }
.ph-portrait { position: relative; display: grid; place-items: center; height: 190px; border-radius: 10px; background: radial-gradient(circle at 50% 62%, #33406a, #151a28 72%); }
.ph-portrait img { width: 144px; height: 144px; image-rendering: pixelated; }
.ph-preview { position: absolute; bottom: 6px; left: 6px; right: 6px; text-align: center; font-size: 11.5px; font-weight: 700; color: var(--warn); }
.ph-name { margin: 6px 0 0; font-size: 24px; line-height: 1.1; }
.ph-outfit { color: var(--muted); font-size: 13px; }
.ph-outfit a { color: var(--accent); }
.ph-lv { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.ph-lv span:first-child { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.ph-lv b { font-size: 20px; }
.ph-lv .muted { margin-left: auto; }
.ph-id .bar.big { height: 18px; margin: 0; }
.ph-id .bar.big > span { line-height: 16px; }
.ph-next { margin: 0; font-size: 12.5px; color: var(--muted); }
.ph-boosts { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.ph-boosts ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 13px; }
.ph-boosts li { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; }
.ph-boosts p { margin: 0; font-size: 13px; }
.ph-sub { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ph-body { min-width: 0; }
.ph-body .panel { padding: 12px 14px; }
.ph-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ph-h h4 { margin-bottom: 8px; }
.ph-over { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 12px; }
.ph-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ph-tile { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; background: var(--panel-2); min-width: 0; }
.ph-tile span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-tile b { font-size: 19px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ph-tile em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.ph-rec { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; align-items: start; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.ph-rec:last-of-type { border-bottom: 0; margin-bottom: 4px; }
.ph-rec > span { color: var(--muted); }
.ph-rec .rpills { margin-top: 4px; }
.ph-rec .cn { cursor: pointer; font-weight: 600; }
.ph-gname { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.ph-gname svg { width: 26px; height: 26px; color: var(--accent); flex: none; }
.ph-guild p { margin: 8px 0 10px; font-size: 13px; }
.ph-flist { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.ph-flist li { display: flex; align-items: center; gap: 8px; min-height: 28px; font-size: 13.5px; }
.ph-flist li .link { margin-left: auto; }
.ph-flist.big li { min-height: 36px; padding: 2px 0; border-bottom: 1px solid var(--line); }
.ph-flist li .spacer { flex: 1; }
.ph-wait { margin: 0 0 6px; font-size: 13px; font-weight: 600; }
.ph-fr { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.ph-frside { display: grid; gap: 12px; }
.ph-frside .fr-add { display: flex; gap: 6px; }
.ph-frside .fr-add input { flex: 1; min-width: 0; }
.ph-frside p { margin: 6px 0 0; font-size: 13px; }
.ph-more { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.ph-more h4 { width: 100%; }
.ph-outfits .ofgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.ph-outfits .ofcard { flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 10px; }
.ph-outfits .of-pic { width: 72px; height: 72px; }
.ph-outfits .of-pic img { width: 64px; height: 64px; }
.ph-outfits .ofcard p:not(.of-how) { display: none; }
.ph-outfits .ofcard .row.between { flex-direction: column; align-items: center; gap: 4px; }
.ph-outfits .ofcard .buyrow { justify-content: center; }
.ph-dirs { display: flex; gap: 6px; }
.ph-dirs img { width: 48px; height: 48px; image-rendering: pixelated; border-radius: 6px; background: var(--panel-2); }
.ph-settings { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.ph-set { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.ph-set:last-child { border-bottom: 0; }
.ph-set p { margin: 2px 0 0; font-size: 12.5px; }
.ph-ctl { display: flex; justify-content: flex-end; }
.ph-seg { display: inline-flex; gap: 3px; }
.ph-seg button { min-width: 38px; height: 28px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: 600 13px var(--sans); cursor: pointer; }
.ph-seg button.on { background: var(--accent); color: var(--bg); border-color: var(--accent); }
@media (max-width: 1100px) { .player-hub { grid-template-columns: 1fr; } .ph-id { display: grid; grid-template-columns: 120px minmax(0, 1fr); column-gap: 14px; } .ph-portrait { grid-row: span 6; height: 120px; } .ph-portrait img { width: 96px; height: 96px; } .ph-boosts { grid-column: 1 / -1; } }
@media (max-width: 760px) { .ph-over, .ph-fr, .ph-settings { grid-template-columns: 1fr; } .ph-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ph-outfits .ofgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.player-hub a.btn, .peek a.btn { text-decoration: none; }
/* Boosts, charms and shrines: one line of chips under the team. */
.panel.boostsum { padding: 7px 9px; }
.bchips { display: flex; flex-wrap: wrap; gap: 4px; }
.bchip { display: inline-flex; align-items: baseline; gap: 4px; height: 22px; padding: 0 7px; border-radius: 5px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink); font-size: 12px; line-height: 20px; text-decoration: none; white-space: nowrap; }
.bchip b { font-weight: 700; }
.bchip em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.bchip.idle { opacity: .7; }
a.bchip:hover { border-color: var(--accent); }
.panel.team { flex: none; }
.slot.bench .r1 { line-height: 18px; }
.slot.bench .r1 .nm { line-height: 18px; }
.slot.bench .rpills.m { margin-top: 2px; }
.slot.bench .slivers { margin-top: 3px; }
.slot.bench .peek-btn { width: 18px; height: 18px; }
.slot.bench .peek-btn svg { width: 15px; height: 15px; }
.slot.lead .movebar { margin-top: 6px; gap: 5px; }
.slot.lead .movebar .mv { width: 30px; height: 30px; }
.playercard .bchips { padding: 0 8px 7px; }
.lcol > .panel.questsum { flex: 0 1 auto; min-height: 0; overflow: hidden; }
/* The faster-hunt card sits left of the scene tools. */
.ov.suggest { right: 54px; }
.cap .rpills { margin-top: 3px; gap: 4px; }
.cap .rp { height: 20px; line-height: 20px; padding: 0 7px; font-size: 11.5px; }
/* A nicknamed bench row keeps just the nickname; the popup shows the species. */
.slot.bench .nick-sp { display: none; }

/* === UI button icons (art thread) ===
   Rig-drawn icons (art/rig3d/icons/ui-*.ts) in place of the line SVGs: 32 px art at 16 px,
   so 1x screens halve it evenly and 2x screens show it pixel for pixel. */
img.ui-ic { display: block; width: 16px; height: 16px; }
.slot.bench .peek-btn img.ui-ic { width: 14px; height: 14px; }
.subtabs img.hub-ti { width: 16px; height: 16px; vertical-align: -3px; margin-right: 1px; }

/* === Boss portraits (art thread) ===
   Painted close-ups (art/rig3d/build-portraits.ts), 78 px inside the 84 px boss box so the box's
   gilt edge stays visible round them. */
.lhead > img.bport { padding: 3px; }
