/* NEXUS ARENA — "Архив мультивселенной"
   Ink + bone + amber. No glassmorphism, no build step. */

@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/manrope-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/manrope-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0100-02BA, U+2000-206F, U+20AC, U+2212;
}
@font-face {
  font-family: Unbounded;
  font-style: normal;
  font-weight: 500 900;
  font-display: swap;
  src: url(fonts/unbounded-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Unbounded;
  font-style: normal;
  font-weight: 500 900;
  font-display: swap;
  src: url(fonts/unbounded-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0100-02BA, U+2000-206F, U+20AC, U+2212;
}

:root {
  --bg: #0a0b0d;
  --bg-deep: #060708;
  --panel: #121417;
  --panel-2: #191c21;
  --panel-3: #22262c;
  --line: rgba(244, 239, 230, .1);
  --line-strong: rgba(244, 239, 230, .2);
  --text: #f4efe6;
  --muted: #9aa0a8;
  --muted-2: #6f757d;
  --accent: #ffb020;
  --accent-ink: #1a1204;
  --danger: #ff5a5f;
  --ok: #59d98e;
  --common: #8a9199;
  --rare: #4da3ff;
  --epic: #b071ff;
  --legendary: #ffb020;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 40px rgba(0, 0, 0, .45);
  --topbar: 72px;
  color-scheme: dark;
}

body[data-skin="solar"] {
  --bg: #120e08;
  --bg-deep: #0b0804;
  --panel: #1a140b;
  --panel-2: #231a0e;
  --panel-3: #2d2112;
  --accent: #ffcf5c;
  --line: rgba(255, 236, 200, .12);
}
body[data-skin="void"] {
  --bg: #070b14;
  --bg-deep: #04060b;
  --panel: #0d1420;
  --panel-2: #111a29;
  --panel-3: #172235;
  --accent: #6ea8ff;
  --line: rgba(200, 220, 255, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 Manrope, "Segoe UI", system-ui, sans-serif;
  padding-bottom: 96px;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 520px at 12% -10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    radial-gradient(700px 420px at 92% 0%, rgba(77, 163, 255, .08), transparent 70%);
  pointer-events: none;
  z-index: -2;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { font-family: Unbounded, Manrope, sans-serif; font-weight: 700; letter-spacing: -.02em; margin: 0; line-height: 1.1; }
p { margin: 0; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .92em; }
[hidden] { display: none !important; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: 8px; text-decoration: none; font-weight: 700;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.page-grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
}
.page-glow { position: fixed; width: 520px; height: 520px; filter: blur(120px); opacity: .08; pointer-events: none; z-index: -1; }
.glow-one { top: -200px; left: -160px; background: var(--accent); }
.glow-two { bottom: -240px; right: -140px; background: #4da3ff; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--topbar);
  display: flex; align-items: center; gap: 24px;
  padding: 0 32px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.brand {
  display: flex; align-items: center; gap: 12px;
  background: none; border: 0; padding: 0; color: var(--text);
}
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--accent); color: var(--accent);
  font-family: Unbounded, sans-serif; font-weight: 900; font-size: 18px;
  transform: rotate(-6deg);
}
.brand-mark.small { width: 26px; height: 26px; font-size: 12px; }
.brand-type { display: flex; flex-direction: column; align-items: flex-start; line-height: .9; letter-spacing: .18em; font-size: 10px; color: var(--muted); }
.brand-type strong { color: var(--text); font-family: Unbounded, sans-serif; font-size: 15px; letter-spacing: .06em; }
.breadcrumb { color: var(--muted); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.main-nav { display: flex; gap: 6px; margin-left: 12px; }
.nav-btn {
  background: none; border: 0; color: var(--muted); padding: 9px 12px;
  font-weight: 600; border-radius: 8px; transition: color .15s, background .15s;
}
.nav-btn:hover { color: var(--text); background: var(--panel-2); }
.nav-btn.active { color: var(--bg); background: var(--text); }
.topbar-side { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.connection-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px;
}
.connection-badge span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); }
.connection-badge.online span { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.wallet, .profile-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  padding: 8px 12px; border-radius: 9px; font-weight: 700; font-size: 13px;
}
.wallet span { color: var(--accent); }
.wallet-shards span { color: #c9c3b6; }
.profile-pill { font-family: Unbounded, sans-serif; font-size: 11px; letter-spacing: .06em; }

/* ---------- shared ---------- */
main { max-width: 1320px; margin: 0 auto; padding: 36px 32px 40px; }
.view { display: none; animation: fade-up .35s ease both; }
.view.visible { display: block; }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.kicker { display: inline-block; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); font-weight: 800; }
.muted { color: var(--muted); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 42px 0 18px; }
.section-head h2 { font-size: clamp(24px, 2.4vw, 34px); }
.section-head p { color: var(--muted); margin-top: 8px; max-width: 640px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-head h1 { font-size: clamp(38px, 5vw, 64px); }
.page-head p { color: var(--muted); margin-top: 10px; max-width: 680px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 12px 18px; font-weight: 700; font-size: 14px; line-height: 1;
  transition: transform .15s, background .15s, border-color .15s, color .15s;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .42; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-ghost, .btn-outline, .btn-white, .btn-banner-outline {
  background: transparent; border-color: var(--line-strong); color: var(--text);
}
.btn-ghost:hover:not(:disabled), .btn-outline:hover:not(:disabled) { border-color: var(--text); }
.btn-chip { background: var(--panel); border-color: var(--line); color: var(--muted); padding: 10px 14px; font-size: 13px; }
.btn-chip.active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.btn-sm, .btn-small { padding: 9px 13px; font-size: 12px; }
.btn-lg { padding: 15px 22px; font-size: 15px; }
.btn-combat { padding: 16px 26px; font-family: Unbounded, sans-serif; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.text-action { background: none; border: 0; color: var(--muted); font-size: 12px; font-weight: 700; padding: 4px 0; }
.text-action:hover { color: var(--accent); }

/* ---------- arena hero ---------- */
.arena-hero {
  position: relative; display: grid; grid-template-columns: 1.25fr .75fr; gap: 32px;
  padding: 48px; border: 1px solid var(--line); border-radius: var(--radius);
  background:
    linear-gradient(120deg, var(--panel-2), var(--panel) 55%, color-mix(in srgb, var(--accent) 7%, var(--panel)));
  overflow: hidden;
}
.arena-hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px; opacity: .18; pointer-events: none;
}
.arena-hero-copy { position: relative; z-index: 1; }
.arena-hero h1 { font-size: clamp(38px, 4.6vw, 68px); margin: 14px 0 18px; }
.arena-hero h1 em { font-style: normal; color: var(--accent); }
.arena-hero p { color: var(--muted); max-width: 560px; font-size: 16px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.catalog-line { display: flex; align-items: center; gap: 9px; margin-top: 26px; font-size: 12px; color: var(--muted); }
.catalog-line strong { color: var(--text); font-weight: 600; }
.info-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); }
.info-dot.ready { background: var(--ok); box-shadow: 0 0 10px var(--ok); }

.arena-hero-art { position: relative; min-height: 280px; display: grid; place-items: center; }
.art-portrait {
  position: absolute; width: 62%; height: 86%; object-fit: cover; object-position: top center;
  clip-path: polygon(50% 0, 100% 20%, 100% 80%, 50% 100%, 0 80%, 0 20%);
  filter: saturate(.9) contrast(1.05) drop-shadow(0 18px 40px rgba(0, 0, 0, .6));
  opacity: .92;
}
.arena-hero-art.has-art .art-core { display: none; }
.arena-hero-art.has-art .art-ring { opacity: .5; }
.art-ring { position: absolute; border: 1px solid var(--line-strong); border-radius: 50%; }
.ring-a { width: 260px; height: 260px; }
.ring-b { width: 180px; height: 180px; border-style: dashed; opacity: .7; }
.art-core {
  width: 112px; height: 112px; display: grid; place-items: center;
  font-family: Unbounded, sans-serif; font-weight: 900; font-size: 46px;
  color: var(--accent); border: 2px solid var(--accent); transform: rotate(-8deg);
  box-shadow: 0 0 60px color-mix(in srgb, var(--accent) 35%, transparent);
}
.art-spark { position: absolute; color: var(--accent); font-size: 22px; }
.spark-a { top: 12%; right: 18%; }
.spark-b { bottom: 14%; left: 14%; color: var(--muted); }
.art-tag {
  position: absolute; bottom: 6%; right: 6%;
  font-family: Unbounded, sans-serif; font-size: 10px; letter-spacing: .16em;
  color: var(--muted); border: 1px solid var(--line); padding: 6px 10px;
}

/* ---------- metrics ---------- */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.metric {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 4px;
}
.metric span { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.metric strong { font-family: Unbounded, sans-serif; font-size: 26px; line-height: 1.2; }
.metric small { color: var(--muted-2); font-size: 11px; }

/* ---------- team builder ---------- */
.segmented { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 4px; gap: 4px; }
.segmented .mode-btn {
  background: none; border: 0; color: var(--muted); padding: 9px 16px; border-radius: 7px;
  font-weight: 800; font-size: 12px; letter-spacing: .08em;
}
.segmented .mode-btn.active { background: var(--text); color: var(--bg); }
.battle-setup { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: stretch; }
.team-panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.team-you { border-top: 2px solid var(--accent); }
.team-enemy { border-top: 2px solid var(--danger); }
.team-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.team-tag { font-size: 9px; letter-spacing: .18em; color: var(--muted); font-weight: 800; }
.team-head h3 { font-size: 17px; margin-top: 4px; }
.power-pill { font-size: 10px; letter-spacing: .08em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; white-space: nowrap; }
.team-roster { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.team-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); padding-top: 10px; }
.vs-mark { align-self: center; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted-2); }
.vs-mark b { font-family: Unbounded, sans-serif; font-size: 20px; color: var(--text); }
.vs-mark span { font-size: 8px; letter-spacing: .2em; }

/* unit cards generated by app.js */
.unit-slot {
  display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 11px; text-align: left; color: var(--text); width: 100%;
  transition: border-color .15s, background .15s, transform .15s;
}
.unit-slot:hover:not(:disabled) { border-color: var(--line-strong); background: var(--panel-3); }
.unit-slot.selectable:hover { border-color: var(--accent); transform: translateY(-1px); }
.unit-slot:disabled { cursor: default; }
.unit-portrait {
  width: 54px; height: 54px; border-radius: 8px; overflow: hidden; position: relative;
  background: linear-gradient(145deg, var(--panel-3), var(--bg-deep));
  display: grid; place-items: center; border: 1px solid var(--line);
}
.unit-portrait span { font-family: Unbounded, sans-serif; font-size: 18px; color: var(--muted); }
.unit-portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.unit-portrait.pink-portrait { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.unit-content { min-width: 0; }
.unit-topline { font-size: 8px; letter-spacing: .18em; color: var(--muted-2); }
.unit-name { display: block; font-family: Unbounded, sans-serif; font-size: 13px; margin: 2px 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unit-role { font-size: 10px; color: var(--muted); display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-marker { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; }
.role-marker.mint { background: #59d98e; }
.role-marker.violet { background: var(--epic); }
.role-marker.cyan { background: var(--rare); }
.role-marker.pink { background: var(--danger); }
.unit-power { font-family: Unbounded, sans-serif; font-size: 13px; color: var(--muted); }
.unit-edit { color: var(--accent); font-size: 15px; }

/* ---------- match bar ---------- */
.match-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  margin-top: 14px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.match-difficulty { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.match-difficulty select {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  padding: 9px 12px; border-radius: 8px; font-weight: 600;
}
.match-difficulty small { color: var(--muted); font-size: 12px; }

/* ---------- battle report ---------- */
.battle-report {
  position: relative; margin-top: 18px; padding: 22px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--panel);
  box-shadow: var(--shadow); overflow: hidden;
}
.board-unit { position: relative; }
.damage-float {
  position: absolute; right: 10px; top: 2px; z-index: 3; pointer-events: none;
  font-family: Unbounded, sans-serif; font-size: 15px; font-weight: 900; color: var(--text);
  animation: damage-rise .9s ease-out forwards;
}
.damage-float.crit { color: var(--accent); font-size: 20px; }
.damage-float.heal { color: var(--ok); }
.damage-float.miss { color: var(--muted); font-size: 11px; }
@keyframes damage-rise { 0% { opacity: 0; transform: translateY(8px) scale(.8); } 20% { opacity: 1; transform: translateY(0) scale(1.15); } 100% { opacity: 0; transform: translateY(-26px) scale(1); } }
.board-unit.hit { animation: unit-hit .32s ease; }
.board-unit.hit-crit { animation: unit-hit .32s ease; border-color: var(--danger); }
@keyframes unit-hit { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 55% { transform: translateX(4px); } 80% { transform: translateX(-2px); } }
.cutin {
  position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; pointer-events: none;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 16%, transparent), transparent);
  animation: cutin-in .9s ease both;
}
.cutin span { font-size: 9px; letter-spacing: .24em; color: var(--accent); font-weight: 800; }
.cutin strong { font-family: Unbounded, sans-serif; font-size: clamp(22px, 4vw, 40px); color: var(--text); text-shadow: 0 6px 30px rgba(0, 0, 0, .8); }
.cutin.enemy { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--danger) 16%, transparent), transparent); }
.cutin.enemy span { color: var(--danger); }
@keyframes cutin-in { 0% { opacity: 0; transform: scale(1.06); } 18% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
.battle-result {
  display: flex; align-items: center; gap: 16px; margin-top: 18px; padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  border-radius: 10px; background: color-mix(in srgb, var(--accent) 6%, var(--panel-2));
  animation: fade-up .3s ease both;
}
.result-icon { font-size: 30px; color: var(--accent); }
.result-copy { flex: 1; min-width: 0; }
.result-copy h3 { font-size: 18px; margin-top: 4px; }
.result-copy p { color: var(--muted); font-size: 11px; margin-top: 3px; }
.result-reward { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 11px; color: var(--muted); }
.result-reward b { font-family: Unbounded, sans-serif; font-size: 15px; color: var(--accent); }
#auto-battle.active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.report-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.report-top h2 { font-size: clamp(20px, 2.2vw, 30px); margin-top: 5px; }
.report-top p { color: var(--muted); margin-top: 7px; }
.report-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status-chip {
  font-size: 10px; letter-spacing: .14em; font-weight: 800; color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  padding: 7px 10px; border-radius: 6px; white-space: nowrap;
}
.battle-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin: 20px 0 4px; }
.battle-bars span { font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.health-track { height: 8px; background: var(--panel-3); border-radius: 999px; overflow: hidden; margin: 6px 0 4px; }
.health-track i { display: block; height: 100%; width: 100%; background: var(--ok); border-radius: inherit; transition: width .35s ease; }
.health-track.enemy i { background: var(--danger); }
.battle-bars b { font-size: 12px; color: var(--muted); font-weight: 600; }
.battle-feed {
  display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto;
  margin-top: 14px; padding-right: 6px; scrollbar-width: thin;
}
.battle-entry {
  display: flex; gap: 10px; align-items: baseline; padding: 7px 10px;
  border-left: 2px solid var(--line-strong); background: var(--panel-2); border-radius: 0 6px 6px 0;
  font-size: 13px; animation: entry-in .25s ease both;
}
.battle-entry small { font-size: 9px; letter-spacing: .1em; white-space: nowrap; }
.battle-entry.knockout { border-left-color: var(--danger); }
.battle-entry.critical { border-left-color: var(--accent); }
.battle-entry.special { border-left-color: var(--epic); }
.battle-entry.heal { border-left-color: var(--ok); }
.battle-entry.dodge { opacity: .75; }
@keyframes entry-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.turn-order { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: thin; }
.turn-chip {
  display: flex; align-items: center; gap: 6px; flex: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px 4px 5px;
  background: var(--panel-2); color: var(--muted); max-width: 160px;
}
.turn-chip b {
  width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%;
  background: var(--panel-3); color: var(--text); font-family: Unbounded, sans-serif; font-size: 10px;
}
.turn-chip small { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.turn-chip.enemy b { color: var(--danger); }
.turn-chip.you b { color: var(--accent); }
.turn-chip.current { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent) inset; }
.battle-entry.guard { border-left-color: var(--ok); }
.battle-entry.energize { border-left-color: var(--rare); }
.battle-board { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; }
.board-team { display: flex; flex-direction: column; gap: 7px; }
.board-label { font-size: 9px; letter-spacing: .18em; color: var(--muted); font-weight: 800; margin-bottom: 2px; }
.board-you .board-label { color: var(--accent); }
.board-enemy .board-label { color: var(--danger); }
.board-unit {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px;
  transition: border-color .2s, opacity .2s;
}
.board-unit .unit-portrait { width: 44px; height: 44px; }
.board-unit-body { min-width: 0; }
.board-unit-body strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-unit-body small { display: block; color: var(--muted); font-size: 9px; margin: 1px 0 4px; }
.board-track, .board-energy { height: 4px; background: var(--panel-3); border-radius: 999px; overflow: hidden; margin-top: 3px; }
.board-track i { display: block; height: 100%; background: var(--ok); transition: width .3s ease; }
.board-energy i { display: block; height: 100%; background: var(--epic); transition: width .3s ease; }
.board-enemy .board-track i { background: var(--danger); }
.board-hp { font-family: Unbounded, sans-serif; font-size: 11px; color: var(--muted); }
.board-unit.acting { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.board-unit.down { opacity: .38; filter: grayscale(.8); }
body.battle-mode .arena-hero,
body.battle-mode .metrics,
body.battle-mode #view-arena > .section-head,
body.battle-mode .battle-setup,
body.battle-mode .match-bar { display: none; }
body.battle-mode .battle-report { margin-top: 0; }
.battle-report { scroll-margin-top: calc(var(--topbar) + 20px); }
.battle-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.battle-prompt { flex: 1 0 100%; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.report-footer { margin-top: 18px; display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- collection ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 20px; }
.search-field {
  flex: 1 1 260px; display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px;
}
.search-field input { flex: 1; border: 0; background: none; padding: 12px 0; outline: none; min-width: 0; }
.filter-bar select, .source-row select {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  padding: 11px 12px; border-radius: 10px;
}
.hero-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 14px; }
.hero-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .18s, border-color .18s;
}
.hero-card:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.hero-card.locked { opacity: .82; }
.hero-card.rare { border-top: 2px solid var(--rare); }
.hero-card.epic { border-top: 2px solid var(--epic); }
.hero-card.legendary { border-top: 2px solid var(--legendary); }
.hero-card.legendary .hero-rank { color: var(--legendary); }
.hero-card.epic .hero-rank { color: var(--epic); }
.hero-card.rare .hero-rank { color: var(--rare); }
.hero-card.legendary .hero-art { background: radial-gradient(circle at 50% 0%, rgba(255, 176, 32, .18), transparent 60%), linear-gradient(160deg, var(--panel-3), var(--bg-deep)); }
.hero-card.epic .hero-art { background: radial-gradient(circle at 50% 0%, rgba(176, 113, 255, .14), transparent 60%), linear-gradient(160deg, var(--panel-3), var(--bg-deep)); }
.hero-art { position: relative; aspect-ratio: 1 / 1.12; background: linear-gradient(160deg, var(--panel-3), var(--bg-deep)); overflow: hidden; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .4s ease; }
.hero-card:hover .hero-art img { transform: scale(1.04); }
.hero-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--panel) 2%, transparent 45%); }
.hero-symbol { position: absolute; inset: 0; display: grid; place-items: center; font-family: Unbounded, sans-serif; font-size: 54px; color: var(--muted-2); }
.favorite-btn {
  position: absolute; top: 9px; right: 9px; z-index: 2;
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--muted);
  font-size: 14px; display: grid; place-items: center;
}
.favorite-btn.active { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.hero-card-body { padding: 12px 13px 13px; display: flex; flex-direction: column; gap: 7px; }
.hero-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.hero-card-head h3 { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-rank { font-family: Unbounded, sans-serif; font-size: 13px; color: var(--accent); }
.publisher { font-size: 10px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.role-pill { font-size: 9px; letter-spacing: .04em; padding: 4px 7px; border-radius: 5px; border: 1px solid var(--line); color: var(--muted); }
.role-pill.mint { color: #59d98e; border-color: rgba(89, 217, 142, .3); }
.role-pill.violet { color: var(--epic); border-color: rgba(176, 113, 255, .3); }
.role-pill.cyan { color: var(--rare); border-color: rgba(77, 163, 255, .3); }
.role-pill.pink { color: var(--danger); border-color: rgba(255, 90, 95, .3); }
.hero-cta { background: none; border: 0; color: var(--accent); font-size: 11px; font-weight: 800; padding: 4px 0; }
.hero-shopline { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.hero-price { font-family: Unbounded, sans-serif; font-size: 11px; color: var(--text); }
.hero-price.free { color: var(--ok); }
.owned-pill { font-size: 10px; color: var(--ok); }
.hero-buy { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 6px; padding: 6px 10px; font-size: 10px; font-weight: 800; }
.hero-buy:disabled { opacity: .4; }
.hero-price-note { font-size: 9px; color: var(--muted-2); }
.gallery-foot { display: flex; justify-content: center; margin-top: 22px; }
.empty-state { padding: 40px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------- profile ---------- */
.profile-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 14px; }
.profile-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.profile-avatar {
  width: 62px; height: 62px; display: grid; place-items: center; margin-bottom: 18px;
  border: 1px solid var(--accent); color: var(--accent); font-family: Unbounded, sans-serif; font-size: 24px;
  transform: rotate(-5deg);
}
.profile-card h2 { font-size: 30px; margin: 6px 0 18px; }
.level-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.level-row strong { color: var(--text); }
.xp-track { height: 8px; background: var(--panel-3); border-radius: 999px; overflow: hidden; }
.xp-track i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s ease; }
.profile-card p { margin-top: 14px; font-size: 13px; }
.profile-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.profile-stats > div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.profile-stats small { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.profile-stats strong { font-family: Unbounded, sans-serif; font-size: 22px; }
.stat-currency strong { color: var(--accent); }
.skins-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.skin-card { display: grid; grid-template-columns: 74px 1fr; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; align-items: center; }
.skin-preview { height: 74px; border-radius: 8px; display: grid; place-items: center; font-size: 24px; border: 1px solid var(--line); }
.skin-card.nebula .skin-preview { background: linear-gradient(145deg, #2a2138, #0b0d12); color: #b071ff; }
.skin-card.solar .skin-preview { background: linear-gradient(145deg, #3a2a0c, #120e08); color: #ffcf5c; }
.skin-card.void .skin-preview { background: linear-gradient(145deg, #0e1c33, #04060b); color: #6ea8ff; }
.skin-card-body h3 { font-size: 14px; margin-bottom: 4px; }
.skin-card-body p { font-size: 11px; color: var(--muted); margin-bottom: 9px; }
.history-list { display: flex; flex-direction: column; gap: 7px; }
.history-entry { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 10px 13px; font-size: 12px; }
.history-entry strong { font-size: 12px; }
.history-entry small { display: block; color: var(--muted-2); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-entry > span:last-child { color: var(--muted); font-size: 10px; text-align: right; }
.win-dot { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: rgba(89, 217, 142, .12); color: var(--ok); font-weight: 800; }
.win-dot.lose { background: rgba(255, 90, 95, .12); color: var(--danger); }

/* ---------- shop ---------- */
.balance-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; text-align: right; }
.balance-card small { display: block; font-size: 9px; letter-spacing: .16em; color: var(--muted); }
.balance-card strong { font-family: Unbounded, sans-serif; font-size: 24px; color: var(--accent); }
.balance-card .muted { font-size: 10px; }
.shop-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; align-items: start; }
.shop-side { display: flex; flex-direction: column; gap: 14px; }
.shop-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.shop-panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.shop-panel-head h2 { font-size: 19px; }
.shop-tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.shop-tab {
  background: none; border: 0; color: var(--muted); padding: 11px 16px 12px;
  font-weight: 700; font-size: 13px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.shop-tab:hover { color: var(--text); }
.shop-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.shop-main { min-width: 0; }
.shop-hero-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.shop-hero {
  background: var(--panel-2); border: 1px solid var(--line); border-top: 2px solid var(--line);
  border-radius: 10px; padding: 10px; min-width: 0;
}
.shop-hero.rare { border-top-color: var(--rare); }
.shop-hero.epic { border-top-color: var(--epic); }
.shop-hero.legendary { border-top-color: var(--legendary); }
.shop-hero.owned { opacity: .74; }
.shop-hero-art {
  position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; overflow: hidden;
  border: 1px solid var(--line); border-radius: 7px; padding: 0;
  background: linear-gradient(160deg, var(--panel-3), var(--bg-deep)); color: var(--muted-2);
  font-family: Unbounded, sans-serif; font-size: 34px;
}
.shop-hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.shop-rarity {
  position: absolute; left: 6px; bottom: 6px; font-style: normal;
  font-size: 8px; letter-spacing: .08em; padding: 3px 5px; border-radius: 4px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); color: var(--muted);
}
.shop-hero h3 { font-size: 12px; margin: 8px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-hero > small { display: block; color: var(--muted); font-size: 10px; }
.shop-hero-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; }
.shop-price { font-family: Unbounded, sans-serif; font-size: 11px; color: var(--accent); }
.crystal-packs { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 16px; }
.crystal-pack {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; text-align: left; color: var(--text); display: flex; flex-direction: column; gap: 5px;
  transition: border-color .15s, background .15s;
}
.crystal-pack:hover { border-color: var(--line-strong); }
.crystal-pack.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--panel-2)); }
.crystal-pack strong { font-family: Unbounded, sans-serif; font-size: 18px; }
.crystal-pack span { font-size: 11px; color: var(--muted); }
.payment-info { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 16px; font-size: 12px; }
.payment-info dt { color: var(--muted); }
.payment-info dd { margin: 0; text-align: right; }
.btn-pay { width: 100%; padding: 15px; }
.payment-state { margin-top: 12px; font-size: 12px; color: var(--muted); min-height: 2.4em; }
.payment-state.verified { color: var(--ok); }
.payment-actions { display: flex; gap: 8px; margin-top: 10px; }
.fine-print { margin-top: 14px; font-size: 10px; color: var(--muted-2); line-height: 1.5; }
.shop-perks { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; font-size: 12px; color: var(--muted); }
.shop-perks span { color: var(--ok); margin-right: 6px; }
.recovery-code { display: block; margin-top: 10px; padding: 10px; background: var(--bg-deep); border: 1px dashed var(--line-strong); border-radius: 8px; word-break: break-all; color: var(--accent); }
.restore-block { margin-top: 12px; }
.restore-block summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.restore-block input { width: 100%; margin: 10px 0 8px; background: var(--bg-deep); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.payment-history { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.order-line { text-align: left; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; color: var(--muted); font-size: 11px; }
.order-line:hover { border-color: var(--line-strong); color: var(--text); }
.donor-badge { display: inline-block; margin-top: 16px; padding: 6px 10px; border-radius: 5px; background: rgba(89, 217, 142, .12); color: var(--ok); font-size: 10px; letter-spacing: .12em; }
.payment-note { font-size: 11px; color: var(--muted-2); margin-top: 8px; }

/* ---------- lab ---------- */
.lab-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.lab-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-top: 12px; }
.lab-card small { font-size: 9px; letter-spacing: .14em; color: var(--muted); }
.lab-card strong { display: block; font-family: Unbounded, sans-serif; font-size: 18px; margin: 4px 0 6px; }
.lab-card p { color: var(--muted); font-size: 12px; }
.edu-panel { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 18px; }
.edu-header span { font-size: 9px; letter-spacing: .16em; color: var(--accent); }
.edu-header h2 { font-size: 20px; margin: 4px 0; }
.edu-header p { color: var(--muted); font-size: 11px; }
.edu-tabs, .edu-filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 10px; }
.edu-tabs button, .edu-filters button, .edu-footer button {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
  padding: 8px 11px; border-radius: 7px; font-size: 11px;
}
.edu-tabs button.active, .edu-filters button.active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.edu-content { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow: auto; }
.edu-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 11px; text-align: left; color: var(--text); }
.edu-card.failed { border-color: rgba(255, 90, 95, .35); }
.edu-card-top { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; }
.edu-card code { display: block; color: var(--muted); font-size: 10px; margin: 5px 0; word-break: break-all; }
.edu-card p { font-size: 11px; color: var(--muted); }
.edu-source { color: var(--rare) !important; }
.edu-warning { color: var(--danger) !important; }
.edu-caption, .edu-empty { color: var(--muted); font-size: 12px; }
.edu-json-head { font-size: 12px; }
.edu-actions { display: flex; gap: 6px; margin-top: 8px; }
.edu-actions button { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); padding: 7px 10px; border-radius: 6px; font-size: 11px; }
.edu-content pre { margin: 8px 0 0; white-space: pre-wrap; word-break: break-word; font-size: 11px; color: var(--muted); }
.edu-footer { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.comparison-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.comparison-grid > div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.comparison-grid span { display: block; font-size: 9px; letter-spacing: .12em; color: var(--muted); }
.comparison-grid strong { display: block; font-family: Unbounded, sans-serif; font-size: 18px; margin: 4px 0; }
.comparison-grid small { color: var(--muted); font-size: 10px; }
.source-row { display: flex; gap: 8px; flex-wrap: wrap; }
.source-row select { flex: 1 1 260px; }
.get-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 11px; color: var(--muted); }
.get-grid > div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; padding: 9px; }
.get-grid b { color: var(--text); }
.get-grid code { display: block; color: var(--accent); font-size: 10px; margin-top: 3px; }
.code-sample { background: var(--bg-deep); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: 10px; color: var(--muted); overflow: auto; max-height: 300px; }

/* ---------- footer / bottom nav ---------- */
.site-footer {
  max-width: 1320px; margin: 0 auto; padding: 26px 32px 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  border-top: 1px solid var(--line); font-size: 11px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; font-family: Unbounded, sans-serif; font-size: 11px; letter-spacing: .1em; }
.bottom-nav { display: none; }

/* ---------- modals ---------- */
.modal {
  width: min(680px, calc(100vw - 32px)); max-height: min(82vh, 760px);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--panel); color: var(--text); padding: 0; overflow: hidden;
}
.modal::backdrop { background: rgba(4, 5, 6, .72); backdrop-filter: blur(3px); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 20px; margin-top: 4px; }
.modal-close { background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); width: 34px; height: 34px; border-radius: 8px; }
.modal-close:hover { color: var(--text); }
.modal-search { margin: 14px 22px 0; }
.picker-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 14px 22px; overflow-y: auto; max-height: 52vh; }
.picker-option {
  display: grid; grid-template-columns: 42px 1fr auto; gap: 10px; align-items: center;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px; text-align: left; color: var(--text);
}
.picker-option:hover:not(:disabled) { border-color: var(--accent); }
.picker-option:disabled { opacity: .45; cursor: not-allowed; }
.picker-option .unit-portrait { width: 42px; height: 42px; }
.picker-text strong { display: block; font-size: 12px; }
.picker-text small { color: var(--muted); font-size: 10px; }
.picker-option > span { font-family: Unbounded, sans-serif; font-size: 11px; color: var(--accent); white-space: nowrap; }
.modal-foot { padding: 12px 22px 18px; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); }
#hero-dialog-content { overflow-y: auto; max-height: calc(82vh - 80px); }
.hero-dialog-card { display: grid; grid-template-columns: 220px 1fr; gap: 18px; padding: 18px 22px; }
.hero-detail-art { aspect-ratio: 1 / 1.1; border-radius: 10px; background: var(--panel-3); display: grid; place-items: center; font-family: Unbounded, sans-serif; font-size: 48px; color: var(--muted-2); overflow: hidden; }
.hero-detail-art img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.hero-detail-pub { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.hero-detail-info { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; color: var(--muted); }
.hero-detail-info span { border: 1px solid var(--line); border-radius: 5px; padding: 4px 7px; }
.hero-detail-info .tier-common { color: var(--common); }
.hero-detail-info .tier-rare { color: var(--rare); border-color: rgba(77, 163, 255, .35); }
.hero-detail-info .tier-epic { color: var(--epic); border-color: rgba(176, 113, 255, .35); }
.hero-detail-info .tier-legendary { color: var(--legendary); border-color: rgba(255, 176, 32, .35); }
.hero-ultimate {
  margin-top: 14px; padding: 12px; border: 1px solid var(--line);
  border-left: 2px solid var(--accent); border-radius: 0 8px 8px 0; background: var(--panel-2);
}
.hero-ultimate span { display: block; font-size: 8px; letter-spacing: .16em; color: var(--accent); font-weight: 800; }
.hero-ultimate strong { display: block; font-family: Unbounded, sans-serif; font-size: 13px; margin: 4px 0 3px; }
.hero-ultimate p { color: var(--muted); font-size: 11px; }
.hero-stats { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.hero-stat { display: grid; grid-template-columns: 92px 1fr 28px; gap: 10px; align-items: center; font-size: 11px; color: var(--muted); }
.mini-track { height: 5px; background: var(--panel-3); border-radius: 999px; overflow: hidden; }
.mini-track i { display: block; height: 100%; background: var(--accent); }
.hero-stat strong { color: var(--text); text-align: right; }
.hero-modal-actions, .api-get-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 22px 12px; }
.api-get-actions { padding-bottom: 18px; }
.api-remote-response { margin: 0 22px 20px; background: var(--bg-deep); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: 10px; color: var(--muted); max-height: 180px; overflow: auto; white-space: pre-wrap; }
.confirm-modal { width: min(480px, calc(100vw - 32px)); }
.confirm-body { padding: 26px; }
.confirm-body h2 { font-size: 22px; margin: 8px 0 10px; }
.confirm-body p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--panel-3); border: 1px solid var(--line-strong); color: var(--text);
  padding: 12px 18px; border-radius: 10px; font-size: 13px; z-index: 100;
  box-shadow: var(--shadow); max-width: min(92vw, 520px);
  animation: toast-in .2s ease both;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .arena-hero { grid-template-columns: 1fr; padding: 34px; }
  .arena-hero-art { display: none; }
  .battle-setup { grid-template-columns: 1fr; }
  .vs-mark { flex-direction: row; gap: 8px; }
  .profile-grid, .shop-grid { grid-template-columns: 1fr; }
  .lab-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .topbar { padding: 0 18px; gap: 14px; }
  .breadcrumb, .main-nav { display: none; }
  main { padding: 24px 18px 40px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .picker-list { grid-template-columns: 1fr; }
  .get-grid, .comparison-grid { grid-template-columns: 1fr; }
  .site-footer { padding: 22px 18px 30px; flex-wrap: wrap; }
}
@media (max-width: 620px) {
  body { padding-bottom: 88px; }
  .topbar-side .connection-badge, .topbar-side .wallet-shards { display: none; }
  .arena-hero { padding: 24px; }
  .arena-hero h1 { font-size: 30px; }
  .hero-gallery { grid-template-columns: 1fr 1fr; gap: 10px; }
  .hero-card-body { padding: 10px 10px 11px; }
  .hero-card-head { align-items: flex-start; }
  .hero-card-head h3 { font-size: 12px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
  .hero-card-bottom { flex-wrap: wrap; }
  .hero-shopline { flex-wrap: wrap; }
  .hero-actions .btn { flex: 1 1 100%; }
  .section-head, .page-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .match-bar { flex-direction: column; align-items: stretch; }
  .match-difficulty { flex-direction: column; align-items: flex-start; gap: 6px; }
  .battle-bars { grid-template-columns: 1fr; gap: 12px; }
  .battle-board { grid-template-columns: 1fr; }
  .report-top { flex-direction: column; }
  .crystal-packs { grid-template-columns: 1fr; }
  .profile-stats { grid-template-columns: 1fr 1fr; }
  .hero-dialog-card { grid-template-columns: 1fr; }
  .hero-detail-art { max-height: 220px; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    border-top: 1px solid var(--line); backdrop-filter: blur(14px);
    padding: 8px 10px max(8px, env(safe-area-inset-bottom));
  }
  .bottom-nav button { background: none; border: 0; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; }
  .bottom-nav button span { font-size: 16px; }
  .bottom-nav button small { font-size: 9px; }
  .bottom-nav button.active { color: var(--accent); }
  .site-footer { padding-bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
