/* TROPRPG theme: crimson + violet on near-black, angular neon panels */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #07060b;
  --bg2: #110b19;
  --panel: rgba(18, 12, 28, .86);
  --panel2: rgba(34, 20, 48, .9);
  --line: #4a2a66;
  --line2: #6b3aa0;
  --text: #f1ecf7;
  --muted: #a99bc0;
  --accent: #ff2a3c;        /* crimson */
  --accent-soft: rgba(255, 42, 60, .18);
  --accent2: #a855f7;       /* violet */
  --gold: #ffcc33;
  --good: #3ddc84;
  --bad: #ff4d5e;
  --warn: #ffb020;
  --shiny: #7fd3ff;
  --dark: #c084fc;
  --golden: #ffd34d;
  --radius: 10px;
  --glow-red: 0 0 14px rgba(255, 42, 60, .45), 0 0 2px rgba(255, 42, 60, .9);
  --glow-violet: 0 0 14px rgba(168, 85, 247, .35);
  --font-head: 'Rajdhani', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', Tahoma, sans-serif;
  font-family: var(--font-body);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; color: var(--text); font-size: 14px; }
body {
  background-color: var(--bg);
  background-image: url('../img/backdrop.jpg');
  background-size: 100% auto;
  background-repeat: no-repeat;
  background-position: center top;
  background-attachment: fixed;
}
a { color: #d7b3ff; text-decoration: none; }
a:hover { color: #fff; text-decoration: underline; }
h1, h2, h3 { margin: 0 0 10px; font-family: var(--font-head); letter-spacing: .3px; }
h1 { font-size: 26px; color: #fff; text-shadow: 0 0 12px rgba(255, 42, 60, .45); }
h1::after { content: ''; display: block; width: 64px; height: 2px; margin-top: 4px; background: linear-gradient(90deg, var(--accent), transparent); }
h2 { font-size: 19px; color: #fff; }
h3 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.hidden { display: none !important; }

/* Controls */
button, .btn {
  background: linear-gradient(180deg, #ff3b4c, #c8102e); color: #fff; border: 1px solid rgba(255, 120, 130, .45);
  border-radius: 8px; padding: 8px 14px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600;
  box-shadow: 0 0 10px rgba(255, 42, 60, .25); display: inline-block; line-height: 1.2;
}
button:hover, .btn:hover { filter: brightness(1.12); text-decoration: none; color: #fff; box-shadow: var(--glow-red); }
button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
button.secondary, .btn.secondary { background: linear-gradient(180deg, #2a1a3d, #1a1026); color: var(--text); border: 1px solid var(--line2); box-shadow: none; }
button.secondary:hover, .btn.secondary:hover { box-shadow: var(--glow-violet); border-color: var(--accent2); }
button.danger { background: linear-gradient(180deg, #ff4d5e, #a00a1c); }
button.good { background: linear-gradient(180deg, #3ddc84, #168a4c); border-color: rgba(120, 255, 180, .4); box-shadow: 0 0 10px rgba(61, 220, 132, .25); }
button.gold { background: linear-gradient(180deg, #ffd34d, #c9900a); color: #241a00; border-color: rgba(255, 230, 150, .6); }
button.small, .btn.small { padding: 4px 9px; font-size: 12px; }
button .ico, .btn .ico { width: 18px; height: 18px; vertical-align: -4px; }
input, select, textarea {
  background: #0d0914; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent2); box-shadow: var(--glow-violet); }
textarea { width: 100%; min-height: 110px; }
label { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 3px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 8px 18px; background: linear-gradient(180deg, rgba(20, 8, 16, .97), rgba(10, 6, 14, .95));
  border-bottom: 1px solid rgba(255, 42, 60, .55); box-shadow: 0 2px 18px rgba(255, 42, 60, .18);
}
.topbar .brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-head); font-size: 26px; font-weight: 700; letter-spacing: 1px; color: #fff; font-style: italic; }
.topbar .brand a { color: inherit; }
.topbar .brand a:hover { text-decoration: none; }
.topbar .brand .rpg { color: var(--accent); text-shadow: var(--glow-red); }
.topbar .brand small { color: var(--muted); font-weight: 500; font-size: 13px; margin-left: 6px; letter-spacing: 0; font-style: italic; font-family: var(--font-body); }
.logo { width: 38px; height: 38px; filter: drop-shadow(0 0 6px rgba(255, 42, 60, .6)); }
.topbar .links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.topbar .links a { color: var(--text); font-size: 13px; }
.chip {
  white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; font-weight: 600; font-size: 13px;
  background: rgba(20, 12, 30, .9); border: 1px solid var(--line2); box-shadow: inset 0 0 12px rgba(168, 85, 247, .12);
}
.chip .tsprite { width: 26px; height: 26px; }
.chip.gold { color: var(--gold); border-color: rgba(255, 204, 51, .5); }
.chip.staff { background: linear-gradient(180deg, #4a3300, #2a1d00); border-color: var(--gold); color: var(--gold); }
.chip:hover { text-decoration: none; box-shadow: var(--glow-violet); }
.banner { background: linear-gradient(90deg, #ff2a3c, #a00a1c); color: #fff; padding: 6px 18px; font-weight: 600; text-align: center; }

/* Layout: icon nav | content | (home only) aside */
.layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 18px; max-width: 1480px; margin: 16px auto; padding: 0 16px; align-items: start; }
.layout.with-aside { grid-template-columns: 236px minmax(0, 1fr) 320px; }
@media (max-width: 1100px) { .layout.with-aside { grid-template-columns: 236px minmax(0, 1fr); } .layout.with-aside .aside { grid-column: 1 / -1; } }
@media (max-width: 820px) { .layout, .layout.with-aside { grid-template-columns: 1fr; } .sidebar { position: static !important; } }
.content { min-width: 0; }

/* Panels */
.panel {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px;
  box-shadow: 0 0 0 1px rgba(255, 42, 60, .08), 0 10px 30px rgba(0, 0, 0, .45), inset 0 0 40px rgba(168, 85, 247, .05);
  backdrop-filter: blur(6px);
}
.panel::before { content: ''; position: absolute; left: 14px; right: 14px; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .7; }
.panel.tight { padding: 10px 12px; }
.panel.red { border-color: rgba(255, 42, 60, .55); box-shadow: 0 0 18px rgba(255, 42, 60, .18); }

/* Left navigation */
.sidebar { position: sticky; top: 64px; }
.sidebar .panel { padding: 8px; }
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-item > a, .nav-item > button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; margin: 2px 0; border-radius: 8px;
  color: var(--text); font-size: 14px; font-weight: 600; font-family: var(--font-head); letter-spacing: .3px; text-align: left;
  background: transparent; border: 1px solid transparent; box-shadow: none; cursor: pointer;
}
.nav-item > a:hover, .nav-item > button:hover { background: rgba(168, 85, 247, .12); text-decoration: none; border-color: rgba(168, 85, 247, .35); box-shadow: none; color: #fff; }
.nav-item.active > a, .nav-item.active > button { background: linear-gradient(90deg, rgba(255, 42, 60, .35), rgba(255, 42, 60, .08)); border-color: rgba(255, 42, 60, .7); box-shadow: inset 0 0 18px rgba(255, 42, 60, .18), 0 0 10px rgba(255, 42, 60, .25); color: #fff; }
.nav-item .ico { width: 22px; height: 22px; flex: 0 0 22px; color: #fff; filter: drop-shadow(0 0 4px rgba(255, 255, 255, .35)); }
.nav-item.active .ico { color: var(--accent); filter: drop-shadow(0 0 6px rgba(255, 42, 60, .8)); }
.nav-item .caret { margin-left: auto; font-size: 10px; color: var(--muted); transition: transform .2s; }
.nav-item.open .caret { transform: rotate(180deg); }
.nav-sub { list-style: none; margin: 0 0 4px 34px; padding: 0 0 0 10px; border-left: 1px solid var(--line); }
.nav-sub a { display: block; padding: 4px 8px; border-radius: 6px; font-size: 12.5px; color: var(--muted); }
.nav-sub a:hover { color: #fff; background: rgba(168, 85, 247, .1); text-decoration: none; }
.nav-sub a.active { color: var(--accent); }
.sidebar h3 { font-size: 11px; margin: 8px 10px 4px; color: var(--accent); }

/* Right column (home) */
.aside .panel { padding: 12px 14px; }
.aside-title { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .6px; }
.aside-title .ico { width: 20px; height: 20px; color: var(--accent); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); } }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px 4px; border-radius: 10px;
  background: linear-gradient(180deg, rgba(40, 22, 60, .9), rgba(16, 10, 26, .95)); border: 1px solid var(--line2); color: #fff; font-size: 11px; font-weight: 600; text-align: center;
  box-shadow: inset 0 0 18px rgba(168, 85, 247, .12);
}
.tile:hover { text-decoration: none; border-color: var(--accent2); box-shadow: var(--glow-violet); }
.tile .ico { width: 26px; height: 26px; }

/* Hero + home */
.hero {
  position: relative; border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; border: 1px solid rgba(255, 42, 60, .5);
  box-shadow: 0 0 24px rgba(255, 42, 60, .25); aspect-ratio: 1467 / 274; min-height: 140px;
  background: url('../img/hero.jpg') center / cover no-repeat;
}
.hero::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 -40px 40px -20px rgba(7, 6, 11, .9); }
.welcome { display: flex; align-items: center; gap: 16px; border-color: rgba(255, 42, 60, .5); }
.welcome .tsprite { width: 84px; height: 84px; flex: 0 0 84px; filter: drop-shadow(0 0 10px rgba(255, 42, 60, .5)); }
.welcome h1 { font-size: 28px; }
.welcome h1 em { color: var(--accent); font-style: italic; text-shadow: var(--glow-red); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi {
  position: relative; background: linear-gradient(180deg, rgba(32, 16, 50, .95), rgba(14, 8, 24, .95)); border: 1px solid var(--line2); border-radius: 10px; padding: 14px 10px; text-align: center;
  box-shadow: inset 0 0 24px rgba(168, 85, 247, .12), 0 0 12px rgba(168, 85, 247, .12);
}
.kpi .ico { width: 30px; height: 30px; margin: 0 auto 6px; display: block; color: var(--gold); filter: drop-shadow(0 0 6px rgba(255, 204, 51, .5)); }
.kpi b { display: block; font-family: var(--font-head); font-size: 26px; line-height: 1.1; color: var(--gold); text-shadow: 0 0 10px rgba(255, 204, 51, .4); }
.kpi span { color: var(--muted); font-size: 12px; }
.news { border-left: 3px solid var(--accent); padding-left: 10px; margin-bottom: 10px; }
.news b { color: var(--gold); font-family: var(--font-head); font-size: 17px; }
.news-nav { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.news-nav button { width: 10px; height: 10px; padding: 0; border-radius: 50%; background: #3a2a4c; border: 0; box-shadow: none; }
.news-nav button.active { background: var(--accent); box-shadow: var(--glow-red); }
.lead-card { display: flex; gap: 12px; align-items: center; }
.lead-card img.sprite { width: 112px; height: 112px; object-fit: contain; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 7px 8px; border-bottom: 1px solid rgba(74, 42, 102, .6); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; }
tr:hover td { background: rgba(168, 85, 247, .06); }
table.compact td, table.compact th { padding: 4px 6px; font-size: 12.5px; }

/* Pokemon cards */
.pcard { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; gap: 10px; align-items: center; transition: border-color .15s, box-shadow .15s; }
.pcard:hover { border-color: var(--line2); box-shadow: var(--glow-violet); }
.pcard img.sprite { width: 88px; height: 88px; object-fit: contain; background: radial-gradient(circle, rgba(168, 85, 247, .18), transparent 70%); border-radius: 8px; }
.pcard .name { font-weight: 700; }
.pcard .meta { color: var(--muted); font-size: 12px; }
.hpbar { height: 8px; background: #000; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.hpbar > div { height: 100%; background: linear-gradient(90deg, #3ddc84, #1fa85f); transition: width .4s; }
.hpbar.mid > div { background: linear-gradient(90deg, #ffb020, #d98700); }
.hpbar.low > div { background: linear-gradient(90deg, #ff4d5e, #b0101f); }
.variant-shiny { color: var(--shiny); }
.variant-dark { color: var(--dark); }
.variant-golden { color: var(--golden); text-shadow: 0 0 6px rgba(255, 211, 77, .6); }
.type { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11px; color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .6); margin-right: 3px; }
.badge-chip { display: inline-block; background: rgba(255, 204, 51, .08); border: 1px solid var(--gold); color: var(--gold); border-radius: 12px; padding: 2px 9px; font-size: 11px; margin: 2px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; background: var(--panel2); border: 1px solid var(--line); }
.pill.good { border-color: var(--good); color: var(--good); }
.pill.bad { border-color: var(--bad); color: var(--bad); }
.pill.warn { border-color: var(--warn); color: var(--warn); }
.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; text-align: center; font-size: 12px; }
.stat-grid div { background: rgba(0, 0, 0, .3); border-radius: 4px; padding: 4px 2px; }
.stat-grid b { display: block; font-size: 13px; }

/* Battle: your Pokemon on the left, the foe on the right */
.battle { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 700px) { .battle { grid-template-columns: 1fr; } }
.fighter { background: linear-gradient(180deg, rgba(34, 20, 48, .95), rgba(14, 8, 24, .95)); border: 1px solid var(--line2); border-radius: 10px; padding: 12px; text-align: center; position: relative; }
.fighter.mine { border-color: rgba(61, 220, 132, .5); }
.fighter.foe { border-color: rgba(255, 42, 60, .55); }
.fighter img.mon { width: 150px; height: 150px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .6)); }
.fighter.mine img.mon { transform: scaleX(-1); }
.fighter img.trainer { position: absolute; top: 8px; width: 56px; height: 56px; object-fit: contain; opacity: .9; }
.fighter.mine img.trainer { left: 8px; }
.fighter.foe img.trainer { right: 8px; }
.fighter .lvl { color: var(--muted); font-size: 12px; }
.gender { margin-left: 4px; font-weight: bold; }
.gender.male { color: #6fa8ff; }
.gender.female { color: #ff7aa8; }
.tsprite { object-fit: contain; image-rendering: pixelated; vertical-align: middle; }
img.leader { width: 80px; height: 80px; object-fit: contain; image-rendering: pixelated; background: radial-gradient(circle, rgba(255, 42, 60, .2), transparent 70%); border-radius: 8px; }
.moves { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.moves button { padding: 10px; text-align: left; background: linear-gradient(180deg, #2a1a3d, #170e24); border: 1px solid var(--line2); color: var(--text); box-shadow: none; }
.moves button:hover { border-color: var(--accent); box-shadow: var(--glow-red); }
.moves button small { display: block; color: var(--muted); font-weight: 400; }
.log { background: #050308; border: 1px solid var(--line); border-radius: 8px; padding: 10px; height: 180px; overflow-y: auto; font-family: Consolas, monospace; font-size: 12.5px; }
.log div { padding: 1px 0; }
.log .new { color: var(--accent); }

/* roster stats column (toggle) */
table.roster.stats-hidden .statcell { display: none; }
.statline { display: flex; flex-wrap: wrap; gap: 3px; }
.statline .stat { background: rgba(0, 0, 0, .35); border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.statline .stat b { color: var(--muted); font-weight: normal; font-size: 10px; margin-right: 3px; }
.gen-head h2 { font-size: 16px; }

/* Sprite / starter pickers */
.sprite-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; max-height: 55vh; overflow: auto; }
.sprite-pick, .starter-pick { background: var(--panel2); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: none; font-weight: 500; }
.sprite-pick img { width: 56px; height: 56px; object-fit: contain; image-rendering: pixelated; }
.sprite-pick span { font-size: 10px; color: var(--muted); max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sprite-pick.active, .sprite-pick:hover, .starter-pick.active, .starter-pick:hover { border-color: var(--accent); box-shadow: var(--glow-red); }
.starter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.starter-pick img { width: 64px; height: 64px; object-fit: contain; }
.starter-pick span { font-size: 11px; }

/* Auth */
.auth-wrap { max-width: 460px; margin: 28px auto; padding: 0 14px; }
.auth-wrap.wide { max-width: 780px; }
.auth-wrap .panel { padding: 22px; }
.auth-wrap input { width: 100%; }
.auth-hero { max-width: 1100px; margin: 18px auto 0; padding: 0 14px; }
.auth-hero .hero { margin-bottom: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tabs button { background: transparent; color: var(--muted); border: 0; border-radius: 8px 8px 0 0; box-shadow: none; }
.tabs button.active { background: var(--panel2); color: #fff; border-bottom: 2px solid var(--accent); }

/* Toasts */
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #1a1026; border: 1px solid var(--line2); border-left: 4px solid var(--accent2); padding: 10px 14px; border-radius: 8px; box-shadow: 0 4px 16px rgba(0, 0, 0, .5); max-width: 340px; font-size: 13px; animation: fade .3s; }
.toast.err { border-left-color: var(--bad); }
.toast.ok { border-left-color: var(--good); }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Admin */
.admin-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.admin-nav button { background: var(--panel2); color: var(--text); border: 1px solid var(--line); box-shadow: none; font-family: var(--font-head); font-size: 14px; }
.admin-nav button.active { background: linear-gradient(180deg, #ff3b4c, #c8102e); border-color: var(--accent); box-shadow: var(--glow-red); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 12px; }
.form-grid input, .form-grid select { width: 100%; }
pre.json { background: #050308; padding: 8px; border-radius: 6px; overflow: auto; font-size: 11.5px; max-height: 300px; }
.modal-bg { position: fixed; inset: 0; background: rgba(3, 2, 6, .75); display: flex; align-items: center; justify-content: center; z-index: 50; backdrop-filter: blur(3px); }
.modal { background: #140c1f; border: 1px solid var(--line2); border-radius: 12px; padding: 18px; width: min(680px, 94vw); max-height: 90vh; overflow: auto; box-shadow: 0 0 30px rgba(168, 85, 247, .25); }
.sprite-sm { width: 52px; height: 52px; object-fit: contain; vertical-align: middle; }
.clock { font-size: 12px; color: var(--muted); }
.daynight { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.daynight.day { background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.daynight.night { background: var(--dark); box-shadow: 0 0 6px var(--dark); }
.cms-content img { max-width: 100%; }

/* Footer */
.footer { text-align: center; color: var(--muted); font-size: 11px; padding: 24px 14px 30px; position: relative; }
.footer::before { content: ''; display: block; width: min(900px, 90%); height: 1px; margin: 0 auto 14px; background: linear-gradient(90deg, transparent, var(--accent), transparent); }

/* ---------------------------------------------------------------- mobile / small screens */
.sprite-sm, .pcard img.sprite, .lead-card img.sprite, .fighter img.mon { flex: 0 0 auto; }
@media (max-width: 820px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px 16px; }
  .topbar .brand { font-size: 22px; }
  .topbar .brand small { display: none; }
  .topbar .links { justify-content: flex-start; flex-wrap: wrap; width: 100%; }
  .topbar .links a { white-space: nowrap; }
  .layout { padding: 0 12px; margin: 12px auto; gap: 12px; }
  .sidebar { position: static !important; }
  .sidebar .panel { padding: 8px; }
  .sidebar .nav-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
  .sidebar .nav-item.open { grid-column: 1 / -1; }
  .sidebar .nav-item > a, .sidebar .nav-item > button { flex-direction: column; justify-content: center; text-align: center; gap: 4px; padding: 8px 4px; font-size: 11px; }
  .sidebar .nav-item .caret { display: none; }
  .sidebar .nav-sub { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 0; padding: 0; border-left: 0; }
  .sidebar .nav-sub a { background: var(--panel2); border: 1px solid var(--line); padding: 6px 10px; }
  .panel { padding: 14px; overflow-wrap: anywhere; }
  .panel h1 { font-size: 22px; }
  table { display: block; max-width: 100%; overflow-x: auto; }
  .battle { grid-template-columns: 1fr; }
  .fighter img.trainer { width: 40px; height: 40px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .row { flex-wrap: wrap; }
  .hero { aspect-ratio: auto; min-height: 0; height: 104px; width: 100%; }
  html, body { overflow-x: clip; }
  .content, .sidebar, .aside { min-width: 0; max-width: 100%; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi b { font-size: clamp(15px, 5vw, 24px); overflow-wrap: anywhere; }
  .welcome h1 { font-size: 22px; }
  input, select, textarea { max-width: 100%; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
  .sprite-grid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }
  .fighter img.mon { width: 120px; height: 120px; }
  .topbar .brand span { font-size: 20px; }
}

/* Site header banner (every page) */
.site-banner { position: relative; line-height: 0; border-bottom: 1px solid rgba(255, 42, 60, .55); box-shadow: 0 4px 22px rgba(255, 42, 60, .25); background: #07060b; }
.site-banner img { display: block; width: 100%; height: auto; }
.site-version { position: absolute; right: 12px; bottom: 10px; line-height: 1.2; padding: 3px 10px; border-radius: 999px; font-family: var(--font-head); font-size: 12px; font-weight: 700; letter-spacing: .6px; color: #fff; background: rgba(12, 6, 18, .75); border: 1px solid rgba(255, 42, 60, .7); box-shadow: var(--glow-red); }
@media (max-width: 480px) { .site-version { font-size: 10px; right: 8px; bottom: 6px; } }
