/* GOTTA LONG 'EM ALL — Pokémon-route theme
   Sky/route-map background, blue trainer-bar header with pokéball tabs,
   white card tiles with thick coloured borders + pokéball studs,
   chunky yellow prices, HP bar = oracle confidence. */
:root {
  --panel: #ffffff;
  --panel-2: #eef5fb;
  --line: #c9d8e8;
  --text: #22304a;
  --muted: #5e7190;
  --navy: #1e2940;
  --blue: #2f62c4;
  --blue-d: #1e4aa0;
  --yellow: #ffcb05;
  --red: #e23b33;
  --long: #1f9e50;
  --short: #e2453b;
  --foil: linear-gradient(115deg, #6ee7d8 0%, #8b7cf6 45%, #f472b6 100%);
  --font-display: 'Chakra Petch', sans-serif;
  --font-logo: 'Luckiest Guy', cursive;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}
* { box-sizing: border-box; margin: 0; }
html { background: #79c2ec; }
body {
  font-family: var(--font-body);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  background:
    radial-gradient(55% 38% at 12% 28%, rgba(146,205,98,.6), transparent 62%),
    radial-gradient(48% 34% at 84% 62%, rgba(146,205,98,.5), transparent 62%),
    radial-gradient(40% 28% at 55% 88%, rgba(146,205,98,.45), transparent 62%),
    radial-gradient(36% 26% at 62% 16%, rgba(243,214,140,.5), transparent 60%),
    linear-gradient(180deg, #8fd0f2, #5fa8dc);
  background-attachment: fixed;
}
button { font: inherit; cursor: pointer; color: inherit; background: none; border: none; }
input { font: inherit; color: var(--text); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- pokéball ---------- */
.pokeball, .tabs button::before, .stud {
  background:
    radial-gradient(circle at 50% 50%, #fff 0 17%, var(--navy) 18% 27%, transparent 28%),
    linear-gradient(180deg, var(--red) 0 45%, var(--navy) 45% 55%, #fff 55% 100%);
  border: 2px solid var(--navy);
  border-radius: 50%;
}

/* ---------- topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 26px;
  padding: 10px 22px;
  background: linear-gradient(180deg, #4079d8, var(--blue));
  border-bottom: 4px solid var(--blue-d);
  position: sticky; top: 0; z-index: 10;
  box-shadow: 0 3px 0 rgba(0,0,0,.12);
}
.brand { display: flex; align-items: center; gap: 14px; }
.wordmark {
  font-family: var(--font-logo); font-weight: 400; font-size: 26px;
  line-height: .92; max-width: 190px; letter-spacing: .02em;
  color: var(--yellow);
  -webkit-text-stroke: 1.5px var(--blue-d);
  text-shadow: 2px 3px 0 var(--blue-d);
}
.mode-badge {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em;
  color: #fff; border: 2px solid #fff; border-radius: 6px;
  padding: 3px 7px; background: var(--red); font-weight: 600;
  box-shadow: 1px 2px 0 rgba(0,0,0,.2);
}
.tabs { display: flex; gap: 6px; flex: 1; }
.tabs button {
  font-family: var(--font-display); font-weight: 700; font-size: 11px;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 6px 10px 7px; border-radius: 12px; color: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.tabs button::before { content: ''; width: 30px; height: 30px; display: block; }
.tabs button:hover { background: rgba(255,255,255,.15); }
.tabs button.active { background: rgba(255,255,255,.28); }
.wallet { display: flex; align-items: baseline; gap: 8px; color: #fff; }
.wallet-label, .wallet-unit { color: #d8e6ff; font-size: 12px; }
#balance { font-size: 16px; font-weight: 600; }

/* ---------- layout ---------- */
.view { display: none; padding: 24px; max-width: 1240px; margin: 0 auto; }
.view.active { display: block; }
.panel {
  background: var(--panel); border: 2px solid var(--navy);
  border-radius: 16px; padding: 20px; margin-bottom: 20px;
  box-shadow: 3px 4px 0 rgba(20,35,70,.22);
}
.panel-title {
  font-family: var(--font-display); font-size: 15px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; margin-bottom: 14px;
}
.copy { color: var(--muted); max-width: 64ch; margin-bottom: 16px; }

/* ---------- grade chip ---------- */
.slab {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  border: 2px solid var(--navy); border-radius: 8px;
  padding: 2px 8px; min-width: 34px; background: #888; flex: none;
  box-shadow: 1px 2px 0 rgba(20,35,70,.25);
}
.slab .g {
  font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 1.15;
  color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.3);
}
.slab .lv { font-family: var(--font-mono); font-size: 9px; color: rgba(255,255,255,.92); }
.slab[data-g="S"] { background: #8e5bc0; }
.slab[data-g="A"] { background: #2e7f74; }
.slab[data-g="B"] { background: #d9952b; }
.slab[data-g="C"] { background: #8c3b3b; }

/* ---------- small card art (ticket, positions) ---------- */
.card-art {
  width: 46px; height: 64px; border-radius: 6px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  color: rgba(255,255,255,.9); border: 2px solid var(--navy);
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
  overflow: hidden; background: var(--panel-2);
}
.card-art.has-img img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- ticker ---------- */
.ticker {
  overflow: hidden; border: 2px solid var(--navy); border-radius: 10px;
  background: #16203a; margin-bottom: 16px; padding: 8px 0; color: #e9edf6;
  box-shadow: 2px 3px 0 rgba(20,35,70,.25);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.ticker-track { display: inline-flex; gap: 18px; white-space: nowrap;
  animation: tick 55s linear infinite; will-change: transform; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes tick { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }
.tk { font-size: 12px; display: inline-flex; gap: 7px; align-items: baseline; }
.tk b { font-family: var(--font-display); font-weight: 600; letter-spacing: .04em; }
.tk i { font-style: normal; font-family: var(--font-mono); }
.tk i.up { color: #4ade80; } .tk i.down { color: #fb7185; }
.tk-sep { color: #3a4663; }

/* ---------- search + chips ---------- */
.mkt-controls { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
#mkt-search {
  flex: 1; min-width: 220px; background: var(--panel);
  border: 2px solid var(--navy); border-radius: 999px;
  padding: 11px 16px 11px 46px; font-family: var(--font-mono); font-size: 13px;
  box-shadow: 2px 3px 0 rgba(20,35,70,.22);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='%23fff' stroke='%231e2940' stroke-width='2'/%3E%3Cpath d='M2 12a10 10 0 0 1 20 0z' fill='%23e23b33'/%3E%3Crect x='2' y='10.8' width='20' height='2.4' fill='%231e2940'/%3E%3Ccircle cx='12' cy='12' r='3.2' fill='%23fff' stroke='%231e2940' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 24px; background-position: 14px center;
}
#mkt-search:focus { outline: 3px solid var(--yellow); outline-offset: -1px; }
.chips { display: flex; gap: 8px; }
.chips button {
  font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: 0 16px; border-radius: 10px;
  border: 2px solid var(--navy); color: var(--text); background: var(--panel);
  box-shadow: 2px 3px 0 rgba(20,35,70,.22);
}
.chips button.active { color: #fff; background: var(--blue); }

/* ---------- market tiles ---------- */
.mkt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 26px; }
.mkt-tile {
  text-align: left; background: var(--panel);
  border: 6px solid var(--navy); border-radius: 22px;
  padding: 0; position: relative;
  transition: transform .12s; display: flex; flex-direction: column;
  box-shadow: 4px 5px 0 rgba(20,35,70,.25);
}
.mkt-tile:hover { transform: translateY(-3px); }
.mkt-tile.is-index { border-color: #8e5bc0; }
.stud { position: absolute; width: 26px; height: 26px; z-index: 2; }
.stud.tl { top: -16px; left: 18px; }
.stud.tr { top: -16px; right: 18px; }
.stud.br { bottom: -16px; right: 18px; }
.tile-art {
  height: 200px; position: relative; display: flex; align-items: center; justify-content: center;
  padding: 12px 0 8px; border-radius: 16px 16px 0 0; overflow: hidden;
  background: var(--panel-2);
}
.art-initials {
  font-family: var(--font-display); font-weight: 700; font-size: 34px;
  color: rgba(255,255,255,.88); text-shadow: 0 2px 12px rgba(0,0,0,.5);
}
.art-logo {
  width: 78%; max-height: 62%; object-fit: contain;
  filter: drop-shadow(0 3px 10px rgba(0,0,0,.45));
}
.art-tag {
  position: absolute; top: 8px; right: 8px; font-family: var(--font-mono); font-size: 9px;
  letter-spacing: .1em; padding: 3px 6px; border-radius: 4px;
  background: rgba(0,0,0,.45); color: rgba(255,255,255,.85); border: 1px solid rgba(255,255,255,.25);
}
.tile-art.shimmer::after {
  content: ''; position: absolute; inset: -60%;
  background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.2) 47%,
    rgba(139,124,246,.25) 50%, rgba(110,231,216,.2) 53%, transparent 62%);
  transform: translateX(-70%) rotate(8deg);
  transition: transform .7s ease;
}
.mkt-tile:hover .tile-art.shimmer::after { transform: translateX(55%) rotate(8deg); }
@media (prefers-reduced-motion: reduce) { .tile-art.shimmer::after { display: none; } }
.tile-art.has-img img { width: 88%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.3)); }
.index-art {
  background: radial-gradient(120% 120% at 30% 20%, rgba(139,124,246,.5), transparent 60%),
              radial-gradient(120% 120% at 80% 90%, rgba(244,114,182,.35), transparent 60%), #2a2440;
  flex-direction: column; gap: 2px;
}
.index-art span {
  font-family: var(--font-display); font-weight: 700; font-size: 32px; letter-spacing: .12em;
  background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.index-art b { font-family: var(--font-mono); font-size: 10px; letter-spacing: .25em; color: #9aa3c0; }
.tile-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tile-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.mkt-name { font-weight: 700; font-size: 15px; }
.mkt-set { color: var(--muted); font-size: 12px; }
.mkt-price {
  font-family: var(--font-logo); font-size: 24px; letter-spacing: .03em;
  color: var(--yellow);
  -webkit-text-stroke: 1px var(--navy);
  text-shadow: 2px 2px 0 var(--navy);
}
.mkt-label { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.tile-bottom { display: flex; justify-content: space-between; align-items: baseline; }
.delta { font-weight: 700; }
.delta.up { color: var(--long); } .delta.down { color: var(--short); }
.oi-mini { color: var(--muted); font-size: 11px; }
.hp-row { display: flex; align-items: center; gap: 8px; }
.hp {
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
  color: var(--red); letter-spacing: .04em;
}
.hp-bar {
  flex: 1; height: 12px; border: 2px solid var(--navy); border-radius: 999px;
  background: #dfe9f2; overflow: hidden;
}
.hp-bar > div { height: 100%; background: linear-gradient(180deg, #5ad36e, #1f9e50);
  border-radius: 999px; transition: width .4s; }

/* ---------- trade ---------- */
.trade-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; gap: 12px; }
.chart-ctl { display: flex; gap: 4px; align-self: center; }
.chart-ctl button {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  padding: 5px 10px; border-radius: 8px; border: 2px solid var(--line); color: var(--muted);
  background: var(--panel-2);
}
.chart-ctl button.active { border-color: var(--navy); color: var(--text); background: var(--yellow); }
.chart-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.chart-sub { color: var(--muted); font-size: 12px; }
.chart-price { text-align: right; }
.big { font-size: 24px; font-weight: 600; display: block; }
#chart { width: 100%; border-radius: 10px; background: var(--panel-2); border: 2px solid var(--line); }
.oracle-strip { margin-top: 16px; }
.strip-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px;
  font-family: var(--font-display); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
.strip-note { font-family: var(--font-body); color: var(--muted); font-size: 11px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.src-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.src-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .06em; padding: 6px 8px; border-bottom: 2px solid var(--line); }
.src-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); }
.src-table td:first-child { font-family: var(--font-body); font-weight: 600; }
.tag { font-size: 10px; padding: 2px 6px; border-radius: 5px; font-family: var(--font-mono); border: 1px solid currentColor; }
.tag.ok { color: var(--long); background: rgba(31,158,80,.08); }
.tag.stale { color: #b07c14; background: rgba(217,149,43,.1); }
.tag.rej { color: var(--short); background: rgba(226,69,59,.08); }

.ticket-card { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.dir-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.dir {
  font-family: var(--font-display); font-weight: 700; letter-spacing: .08em;
  padding: 10px; border-radius: 10px; border: 2px solid var(--navy); color: var(--muted);
  background: var(--panel-2); box-shadow: 1px 2px 0 rgba(20,35,70,.2);
}
.dir.long.active { color: #fff; background: var(--long); }
.dir.short.active { color: #fff; background: var(--short); }
.field { display: block; margin-bottom: 12px; }
.field span { display: flex; justify-content: space-between; align-items: baseline;
  color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.field em { font-style: normal; font-size: 11px; color: var(--muted); }
.field input[type=number] {
  width: 100%; background: var(--panel-2); border: 2px solid var(--navy);
  border-radius: 8px; padding: 9px 10px; font-family: var(--font-mono);
}
.field input[type=number]:focus { outline: 3px solid var(--yellow); outline-offset: -1px; }
input[type=range] { width: 100%; accent-color: var(--blue); }
.sltp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ticket-meta { margin: 6px 0 14px; }
.ticket-meta div { display: flex; justify-content: space-between; padding: 5px 0;
  border-bottom: 1px dashed var(--line); }
.ticket-meta dt { color: var(--muted); font-size: 12px; }
.cta {
  width: 100%; padding: 12px; border-radius: 12px;
  font-family: var(--font-logo); font-size: 17px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--navy); background: var(--yellow);
  border: 3px solid var(--navy);
  box-shadow: 2px 3px 0 var(--navy);
  transition: transform .08s, box-shadow .08s;
}
.cta:hover { transform: translate(-1px, -1px); box-shadow: 3px 4px 0 var(--navy); }
.cta:active { transform: translate(1px, 2px); box-shadow: 1px 1px 0 var(--navy); }
.cta:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.ticket-foot { color: var(--short); font-size: 12px; margin-top: 10px; min-height: 18px; }

/* ---------- positions ---------- */
.pos-list, .hist-list { display: flex; flex-direction: column; gap: 10px; }
.pos-row {
  display: grid; grid-template-columns: 56px 1.4fr 1fr 1fr 1fr 1fr auto;
  gap: 14px; align-items: center;
  background: var(--panel-2); border: 2px solid var(--line);
  border-radius: 12px; padding: 12px 14px;
}
.pos-dir { font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: .06em; }
.pos-dir.long { color: var(--long); } .pos-dir.short { color: var(--short); }
.pnl.up { color: var(--long); } .pnl.down { color: var(--short); }
.pos-actions { display: flex; gap: 6px; }
.btn {
  padding: 7px 12px; border-radius: 8px; font-size: 12px; font-weight: 700;
  background: var(--panel); border: 2px solid var(--navy);
  box-shadow: 1px 2px 0 rgba(20,35,70,.25);
  /* Set, not inherited: inside .wallet the inherited colour is white on white. */
  color: var(--navy);
}
.btn:hover { background: var(--panel-2); }
.btn.ghost { background: none; box-shadow: none; }
.btn.danger { color: var(--short); }
.hist-row {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr 1fr;
  gap: 14px; padding: 9px 14px; border-bottom: 1px solid var(--line);
  font-size: 12.5px; align-items: center;
}
.hist-row .reason { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.empty { color: var(--muted); padding: 18px 4px; }

/* ---------- stats / pool / kv ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--panel-2); border: 2px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.stat .k { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.stat .v { font-family: var(--font-mono); font-size: 18px; font-weight: 600; margin-top: 4px; }
.vault-actions { display: flex; gap: 10px; align-items: center; }
.vault-actions input { width: 140px; background: var(--panel-2); border: 2px solid var(--navy);
  border-radius: 8px; padding: 9px 10px; font-family: var(--font-mono); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }
.sub-title { font-family: var(--font-display); font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 8px; font-weight: 700; }
.kv { margin: 0; }
.kv-row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0;
  border-bottom: 1px dashed var(--line); }
.kv-row dt { color: var(--muted); font-size: 12.5px; }
.kv-row dd { margin: 0; }

/* ---------- leaderboard ---------- */
.lb-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.lb-head .panel-title { margin-bottom: 0; }
.lb-row {
  display: grid; grid-template-columns: 44px 1.6fr .8fr .8fr 1fr 1fr 1fr;
  gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line);
  align-items: center; font-size: 13px;
}
.lb-row.lb-header { color: var(--muted); font-size: 11px; text-transform: uppercase;
  letter-spacing: .07em; border-bottom: 2px solid var(--line); }
.lb-row.me { background: rgba(255,203,5,.18); border-radius: 8px; }
.rank { color: var(--muted); }
.rank.top1, .rank.top2, .rank.top3 { font-weight: 700; color: var(--blue); }
.you { font-style: normal; font-family: var(--font-mono); font-size: 10px; color: var(--blue);
  border: 1px solid var(--blue); border-radius: 4px; padding: 1px 5px; margin-left: 6px; }

/* ---------- prize ---------- */
.prize-hero { border-color: #8e5bc0; }
.prize-amount {
  font-family: var(--font-logo); font-size: 46px; line-height: 1.1; margin-top: 6px;
  color: var(--yellow); -webkit-text-stroke: 1.5px var(--navy); text-shadow: 3px 3px 0 var(--navy);
}

/* ---------- referral ---------- */
.ref-link-row { display: flex; gap: 10px; margin-top: 6px; }
.ref-link-row input {
  flex: 1; background: var(--panel-2); border: 2px solid var(--navy); border-radius: 8px;
  padding: 10px 12px; font-family: var(--font-mono); font-size: 12.5px;
}

/* ---------- oracle doc ---------- */
.doc p { color: var(--muted); max-width: 70ch; margin-bottom: 12px; }
.doc p b { color: var(--text); }
.doc h3 { font-family: var(--font-display); font-size: 13px; letter-spacing: .08em;
  text-transform: uppercase; margin: 22px 0 10px; font-weight: 700; }
.grade-doc { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 14px 0; }
.grade-tile { border: 2px solid var(--line); border-radius: 10px; padding: 12px; background: var(--panel-2); }
.grade-tile .desc { color: var(--muted); font-size: 12px; margin-top: 6px; }

/* ---------- toasts ---------- */
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast {
  background: var(--panel); border: 2px solid var(--navy); border-left: 6px solid var(--blue);
  border-radius: 10px; padding: 10px 14px; font-size: 13px; max-width: 320px;
  box-shadow: 2px 3px 0 rgba(20,35,70,.25);
  animation: slide .2s ease-out;
}
.toast.win { border-left-color: var(--long); }
.toast.loss { border-left-color: var(--short); }
@keyframes slide { from { transform: translateX(20px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } .cta { transition: none; } }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .trade-grid { grid-template-columns: 1fr; }
  .pos-row { grid-template-columns: 1fr 1fr 1fr; row-gap: 8px; }
  .tabs { overflow-x: auto; }
  .topbar { flex-wrap: wrap; gap: 12px; }
}
@media (max-width: 800px) {
  .lb-row { grid-template-columns: 36px 1.4fr 1fr 1fr; }
  .lb-row > :nth-child(5), .lb-row > :nth-child(6) { display: none; }
}

/* ---------- order type toggle + battles ---------- */
.otype-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.otype {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  padding: 7px; border-radius: 8px; border: 2px solid var(--line); color: var(--muted);
  background: var(--panel-2);
}
.otype.active { border-color: var(--navy); background: var(--yellow); color: var(--navy); }
.battle-form { display: grid; grid-template-columns: 1fr 1fr 1.4fr auto; gap: 14px; align-items: end; }
.battle-form select, .battle-form input[type=text] {
  width: 100%; background: var(--panel-2); border: 2px solid var(--navy);
  border-radius: 8px; padding: 9px 10px; font-family: var(--font-mono); color: var(--text);
}
.battle-form .cta { width: auto; padding: 10px 22px; font-size: 14px; }
@media (max-width: 800px) { .battle-form { grid-template-columns: 1fr; } }
.share-btn { text-decoration: none; display: inline-block; }
.hist-row { grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr auto; }

/* ---------- wallet button ---------- */
.wallet-btn { background: var(--yellow); color: var(--navy); margin-right: 10px; font-family: var(--font-mono); }
.wallet-btn.connected { background: var(--panel); color: var(--text); }

/* Devnet on-chain mode */
.devnet-banner {
  background: linear-gradient(90deg, #b45309, #92400e);
  color: #fde68a;
  font: 600 11px/1 'IBM Plex Mono', ui-monospace, monospace;
  letter-spacing: .08em;
  text-align: center;
  padding: 6px 10px;
  text-transform: uppercase;
}

/* Versus tiles: both legs facing each other, the ratio is the price.
   Images carry a real box here for the same reason the card tiles do — a
   lazy image with no dimensions never enters the viewport and never loads. */
.tile-art.versus-art {
  gap: 4px; padding: 10px 6px 6px;
  background:
    radial-gradient(90% 90% at 12% 15%, rgba(244,114,182,.30), transparent 55%),
    radial-gradient(90% 90% at 88% 85%, rgba(110,231,216,.28), transparent 55%),
    linear-gradient(160deg, #241f3a, #171327);
}
.versus-art .vs-leg {
  flex: 1 1 0; min-width: 0; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.versus-art .vs-leg img {
  width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.45));
}
.versus-art .vs-fallback {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  color: rgba(255,255,255,.82); text-align: center; line-height: 1.1;
}
.versus-art .vs-mark {
  flex: 0 0 auto; font-family: var(--font-display); font-size: 13px;
  letter-spacing: .06em; color: rgba(255,255,255,.92);
  padding: 3px 7px; border-radius: 999px;
  background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.28);
}
.mkt-tile.is-versus .mkt-price::before { content: none; }

/* The Hatchery sits beside the on-chain badge: a second door out of the app. */
.mode-badge.hatch { background: var(--yellow); color: var(--navy); border-color: #c79a00; }
