@font-face {
  font-family: 'Pixel';
  src: url('assets/pressstart2p.ttf') format('truetype');
  font-display: swap;
}

:root {
  --bg: #070d0b;
  --bg2: #0d1512;
  --panel: #15201c;
  --panel2: #1c2b25;
  --line: #2b4137;
  --green: #46e07a;
  --green-dim: #1f7a44;
  --red: #ff4d4d;
  --red-dim: #7a1f1f;
  --poke-red: #e63946;
  --amber: #ffcf40;
  --txt: #e8f5ee;
  --muted: #7f9c8e;
  --blue: #54a8ff;
  --cream: #f6f2e0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background-color: var(--bg);
  background-image: linear-gradient(180deg, #050a08 0%, #060d0a 50%, #081210 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* ---------- background: near-black with faint poke ball outlines ---------- */
.bg-layer { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

.bg-balls {
  position: absolute; inset: 0;
  background: url('assets/bg-balls-v3.png') repeat;
  background-size: 240px 240px;
  opacity: .5;
}

.bg-glow {
  position: absolute; inset: 0;
  background: radial-gradient(90% 60% at 50% 0%, rgba(58, 130, 92, .16) 0%, rgba(0, 0, 0, 0) 60%);
}

.scanlines {
  position: fixed; inset: 0; pointer-events: none; z-index: 5;
  background: repeating-linear-gradient(180deg,
    rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 1px,
    transparent 1px, transparent 3px);
  mix-blend-mode: overlay;
}


/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 4;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px clamp(14px, 4vw, 40px);
  border-bottom: 3px solid var(--line);
  background: rgba(7,13,11,.82);
  backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-ball { width: 26px; height: 26px; animation: spin 9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
.brand-txt { font-family: 'Pixel', monospace; font-size: 15px; letter-spacing: 1px; }
.brand-txt .dot { color: var(--poke-red); }
.tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Pixel', monospace; font-size: 9px; letter-spacing: 1px;
  color: var(--muted); border: 2px solid var(--line); padding: 7px 10px;
}
.dex-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--poke-red); box-shadow: 0 0 8px var(--poke-red); }

main {
  position: relative; z-index: 2;
  width: min(1080px, 94vw); margin: 0 auto;
  padding: clamp(18px, 4vw, 40px) 0 40px;
}

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 320px 1fr; gap: 22px; align-items: stretch; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }

.hero-art {
  position: relative; min-height: 320px;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(120% 90% at 50% 110%, #1d3a2a 0%, transparent 60%),
    var(--panel);
  border: 3px solid var(--line);
  box-shadow: 0 0 0 3px #050908, 0 18px 40px rgba(0,0,0,.55);
  overflow: hidden;
}
.hero-art::before {
  content: ''; position: absolute; inset: 12px;
  border: 2px dashed rgba(70,224,122,.22); pointer-events: none;
}
.hero-art::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(45deg, rgba(70,224,122,.05) 0 12px, transparent 12px 24px);
}
.wild-banner {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  font-family: 'Pixel', monospace; font-size: 9px; letter-spacing: 1px;
  text-align: center; padding: 9px 6px;
  color: #12060a; background: linear-gradient(90deg, #ffd23f, #ff9f1c);
  border-bottom: 3px solid #050908;
  animation: bannerIn .5s ease-out;
}
@keyframes bannerIn { from { transform: translateY(-100%) } to { transform: translateY(0) } }
@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-9px) } }
.dex-num {
  position: absolute; bottom: 10px; right: 12px; z-index: 2;
  font-family: 'Pixel', monospace; font-size: 9px; color: var(--muted);
}

/* ---------- dex panel ---------- */
.hero-panel {
  background: var(--panel);
  border: 3px solid var(--line);
  box-shadow: 0 0 0 3px #050908, 0 18px 40px rgba(0,0,0,.55);
  padding: clamp(16px, 2.4vw, 24px);
  display: flex; flex-direction: column; gap: 14px;
}

.title-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.title {
  font-family: 'Pixel', monospace;
  font-size: clamp(16px, 3.2vw, 25px);
  margin: 0; line-height: 1.5; color: #fff;
  text-shadow: 3px 3px 0 #050908, 6px 6px 0 rgba(70,224,122,.18);
  word-break: break-word;
}

.pill {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: 'Pixel', monospace; font-size: 9px;
  padding: 9px 12px; border: 2px solid var(--line);
  background: var(--panel2); color: var(--txt);
  letter-spacing: 1px; white-space: nowrap;
}
.led { width: 11px; height: 11px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 2px rgba(0,0,0,.4); }
.pill.online { border-color: var(--green-dim); background: #10281c; color: var(--green); }
.pill.online .led { background: var(--green); box-shadow: 0 0 12px var(--green); animation: beat 1.6s ease-in-out infinite; }
.pill.offline { border-color: var(--red-dim); background: #2a1212; color: var(--red); }
.pill.offline .led { background: var(--red); box-shadow: 0 0 12px var(--red); animation: beat .9s ease-in-out infinite; }
.pill.checking .led { background: var(--amber); animation: beat .7s ease-in-out infinite; }
@keyframes beat { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

/* type badges */
.types { display: flex; flex-wrap: wrap; gap: 8px; }
.type {
  font-family: 'Pixel', monospace; font-size: 8px; letter-spacing: 1px;
  padding: 7px 11px; border-radius: 3px; color: #0a0f0d;
  border: 2px solid rgba(0,0,0,.35);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.18);
}
.t-grass  { background: #78c850; }
.t-fire   { background: #f08030; }
.t-water  { background: #6890f0; color: #06122b; }
.t-electric { background: #f8d030; }
.t-steel  { background: #b8b8d0; }
.t-psychic{ background: #f85888; }

/* hp bar */
.hp-wrap { display: flex; align-items: center; gap: 11px; }
.hp-label { font-family: 'Pixel', monospace; font-size: 11px; color: var(--amber); }
.hp-track {
  flex: 1; height: 16px; background: #0a1210;
  border: 3px solid #2f4a3d; border-radius: 2px; overflow: hidden;
}
.hp-fill {
  height: 100%; width: 0%;
  background: linear-gradient(180deg, #7cf59c 0%, #35c96a 55%, #1f9c4e 100%);
  transition: width .6s cubic-bezier(.2,.9,.3,1), background .3s;
}
.hp-fill.low { background: linear-gradient(180deg, #ffd66b 0%, #f0a52b 55%, #c67e0d 100%); }
.hp-fill.zero { background: linear-gradient(180deg, #ff8a8a 0%, #d92626 55%, #a81616 100%); }
.hp-num { font-size: 12px; color: var(--muted); min-width: 62px; text-align: right; }

/* dialogue box */
.dialogue {
  position: relative;
  background: #0a1a13;
  border: 4px solid #cfe8d8;
  border-radius: 6px;
  box-shadow: 0 0 0 4px #050908, inset 0 0 0 3px #2b4137;
  padding: 15px 42px 15px 16px;
  min-height: 62px;
  display: flex; align-items: center;
}
.dialogue p { margin: 0; font-size: 14px; line-height: 1.6; color: #d6f2e2; }
.cursor {
  position: absolute; right: 14px; bottom: 10px;
  color: var(--amber); font-size: 12px;
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { 0%,100% { opacity: 1 } 50% { opacity: 0 } }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 10px; }
.stat { background: var(--panel2); border: 2px solid var(--line); padding: 11px 12px; display: flex; flex-direction: column; gap: 7px; }
.stat .k { font-family: 'Pixel', monospace; font-size: 8px; color: var(--muted); letter-spacing: 1px; }
.stat .v { font-size: 15px; color: #fff; }
.stat .v.green { color: var(--green); }
.stat .v.red { color: var(--red); }
.stat .v.amber { color: var(--amber); }

.addr-row { display: flex; gap: 10px; align-items: stretch; }
.addr {
  flex: 1; display: flex; align-items: center; padding: 12px 14px;
  background: #08120e; border: 2px solid var(--line);
  color: var(--green); font-size: 14px; overflow-x: auto; white-space: nowrap;
}
.copy {
  font-family: 'Pixel', monospace; font-size: 9px; padding: 0 16px;
  background: var(--panel2); color: var(--txt);
  border: 2px solid var(--line); cursor: pointer; transition: .12s;
}
.copy:hover { background: var(--green-dim); border-color: var(--green); color: #04120b; }
.copy.done { background: var(--green); color: #04120b; }

/* ---------- party ---------- */
.party-card {
  margin-top: 22px;
  background: var(--panel);
  border: 3px solid var(--line);
  box-shadow: 0 0 0 3px #050908, 0 18px 40px rgba(0,0,0,.5);
  padding: clamp(14px, 2.2vw, 20px);
}
.strip-title {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-family: 'Pixel', monospace; font-size: 11px; color: var(--cream);
  margin: 0 0 14px; letter-spacing: 1px;
}
.strip-sub { font-family: ui-monospace, monospace; font-size: 12px; color: var(--muted); letter-spacing: 0; }
.party { display: flex; flex-wrap: wrap; gap: 10px; }
.slot {
  display: flex; align-items: center; gap: 9px;
  background: var(--panel2); border: 2px solid var(--line);
  padding: 8px 13px 8px 9px;
  font-size: 13px; color: var(--muted);
}
.slot img { width: 20px; height: 20px; opacity: .28; filter: grayscale(1); }
.slot.filled { border-color: var(--green-dim); background: #0f2a1d; color: var(--green); }
.slot.filled img { opacity: 1; filter: none; animation: bob 3.4s ease-in-out infinite; }

/* ---------- repair ---------- */
.repair {
  margin-top: 22px; position: relative;
  background: linear-gradient(180deg, #1c1010 0%, var(--panel) 65%);
  border: 3px solid var(--line);
  box-shadow: 0 0 0 3px #050908, 0 18px 40px rgba(0,0,0,.5);
  padding: clamp(18px, 3vw, 30px); overflow: hidden;
}
.repair-head h2 {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-family: 'Pixel', monospace; font-size: clamp(11px, 2vw, 15px);
  margin: 0 0 12px; color: var(--amber); letter-spacing: 1px; line-height: 1.7;
}
.h-ball { width: 20px; height: 20px; }
.repair-head p { margin: 0 0 22px; color: var(--muted); font-size: 13px; max-width: 62ch; line-height: 1.65; }

.bigbtn {
  position: relative; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 25px 18px;
  font-family: 'Pixel', monospace; font-size: clamp(11px, 2.2vw, 16px); letter-spacing: 1px;
  color: #2a0a0a;
  background: linear-gradient(180deg, #ff6b6b 0%, #d92626 55%, #a81616 100%);
  border: 3px solid #5c0f0f;
  box-shadow: 0 7px 0 #5c0f0f, 0 14px 28px rgba(217,38,38,.32);
  cursor: pointer; transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn-ball { width: 26px; height: 26px; }
.bigbtn:hover:not(:disabled) { filter: brightness(1.07); }
.bigbtn:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 2px 0 #5c0f0f, 0 6px 14px rgba(217,38,38,.3); }
.bigbtn:hover:not(:disabled) .btn-ball { animation: throw .7s ease-in-out infinite; }
@keyframes throw { 0%,100% { transform: rotate(0) } 50% { transform: rotate(180deg) } }
.bigbtn:disabled {
  cursor: not-allowed; color: #ffd9d9;
  background: linear-gradient(180deg, #8d3a3a 0%, #6e2323 100%);
  border-color: #3d1010; box-shadow: 0 7px 0 #3d1010;
  filter: saturate(.65); opacity: .9;
}
.bigbtn.locked-by-limit:disabled { filter: saturate(.4) brightness(.85); }
.bigbtn.working { animation: pulse .9s ease-in-out infinite; }
@keyframes pulse { 0%,100% { filter: brightness(1) } 50% { filter: brightness(1.35) } }

.result {
  margin-top: 20px; padding: 16px 18px;
  border: 2px solid var(--line); background: #08120e;
  font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word;
}
.result.ok { border-color: var(--green-dim); background: #0f2018; color: var(--green); }
.result.warn { border-color: #7a6320; background: #221c0d; color: var(--amber); }
.result.bad { border-color: var(--red-dim); background: #211010; color: #ff9c9c; }

.repair-foot { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 20px; font-size: 11.5px; color: var(--muted); }
.repair-foot .k { font-family: 'Pixel', monospace; font-size: 8px; color: #55705f; display: block; margin-bottom: 5px; letter-spacing: 1px; }

.mons { position: absolute; right: -6px; bottom: -4px; display: flex; align-items: flex-end; gap: 2px; opacity: .3; pointer-events: none; }
.mon.sm { width: 62px; image-rendering: pixelated; }
.mon.md { width: 88px; image-rendering: pixelated; }
@media (max-width: 760px) { .mons { display: none; } }

/* ================= Pokemon TCG trainer card (hero, top left) ================= */
/* the dark panel is a fixed-height slot: the card is natural height inside, the slot
   never changes, so the page cannot shift when a different card rotates in. */
.hero-art {
  align-items: center; justify-content: center;
  height: 560px;
  padding: 40px 14px 22px;
}
.hero-art::after { display: none; }

.tcg {
  position: relative; z-index: 2; display: block; text-decoration: none;
  width: 100%; max-width: 292px; margin: 0 auto;
  padding: 11px 11px 9px;
  border-radius: 13px;
  border: 4px solid #c9a24a;
  background:
    radial-gradient(200% 120% at 50% 0%, #fffdf2 0%, #f7f0d8 28%, #efe3c1 100%);
  box-shadow: 0 0 0 3px #050908, 0 16px 34px rgba(0,0,0,.6);
  color: #33291a;
  font-family: ui-monospace, monospace;
  transition: transform .18s, box-shadow .18s;
}
.tcg:hover { transform: translateY(-3px); box-shadow: 0 0 0 3px #050908, 0 22px 40px rgba(0,0,0,.65); }
.tcg.holo {
  border-color: #e9cf7f;
  background:
    linear-gradient(115deg, #fff7d6 0%, #ffe9a8 18%, #cfe9ff 38%, #efd3ff 58%, #ffd98a 78%, #fff7d6 100%);
  background-size: 240% 240%;
  animation: holoShift 7s linear infinite;
}
@keyframes holoShift { 0% { background-position: 0% 50% } 100% { background-position: 240% 50% } }

.tcg-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.tcg-namebox { min-width: 0; }
.tcg-name { font-family: 'Pixel', monospace; font-size: 13px; color: #2b2a27; line-height: 1.25; word-break: break-word; }
.tcg-nick { font-size: 10px; color: #9a7b3f; margin-top: 2px; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.tcg-hp { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-family: 'Pixel', monospace; font-size: 11px; color: #2b2a27; }
.tcg-hp b { color: #c03a2b; font-size: 17px; }
.tcg-hp .energy { width: 15px; height: 15px; }

.tcg-img {
  border: 2px solid #b9932f; border-radius: 7px;
  background: linear-gradient(180deg, #e8f4ff 0%, #ffffff 55%, #eef6e3 100%);
  height: 150px; display: flex; align-items: center; justify-content: center;
  overflow: hidden; margin-bottom: 8px;
}
.tcg-img img { width: 88%; height: 88%; object-fit: contain; filter: drop-shadow(0 5px 5px rgba(0,0,0,.22)); }
.tcg-img img.pix { width: 112px; height: 112px; image-rendering: pixelated; }

.tcg-mid { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; flex-wrap: wrap; }
.tcg-types { display: flex; gap: 4px; }
.type-chip {
  font-family: 'Pixel', monospace; font-size: 5.5px; letter-spacing: .5px; color: #131a10;
  padding: 3px 5px; border-radius: 3px; border: 1px solid rgba(0,0,0,.25);
  text-shadow: 0 1px 0 rgba(255,255,255,.3);
}
.tcg-trait { font-size: 10px; color: #6a5a2f; }
.tcg-trait b { color: #2b2a27; }

.tcg-divider { height: 2px; background: linear-gradient(90deg, transparent, #b9932f 14%, #b9932f 86%, transparent); margin: 4px 0 8px; }

.tcg-moves { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.mv {
  display: flex; align-items: center; gap: 7px;
  border-radius: 5px; background: rgba(185,147,47,.10);
  padding: 5px 7px;
}
.mv-cost { display: flex; gap: 2px; flex: 0 0 auto; }
.mv-name { font-weight: bold; font-size: 11.5px; color: #2b2a27; }
.mv-name.muted { font-style: italic; color: #9a8f70; font-weight: normal; }
.mv-pad { flex: 1 1 auto; min-width: 6px; }
.mv-dmg {
  font-family: 'Pixel', monospace; font-size: 12px; color: #fff;
  background: linear-gradient(180deg, #ff6b52, #d93a28);
  min-width: 30px; height: 25px; padding: 0 7px; box-sizing: content-box;
  border-radius: 50% 50% 50% 50% / 42% 42% 58% 58%;
  border: 1px solid #a3281a;
  display: flex; align-items: center; justify-content: center;
}
.mv-dmg.none { background: transparent; border: 0; padding: 0; }

.tcg-stats {
  display: flex; justify-content: flex-end; gap: 14px; flex-wrap: wrap;
  padding-top: 6px; border-top: 1px solid #d9c98f; margin-bottom: 7px;
}
.tcs { display: flex; align-items: center; gap: 4px; font-size: 9.5px; color: #6a5a2f; }
.tcs b { font-size: 9.5px; color: #2b2a27; }
.tcs .energy { width: 9px; height: 9px; }
.tcs .ret-ener { background: #8d7b6a; }

.tcg-fine {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  border-top: 1px solid #d9c98f; padding-top: 6px;
  font-size: 7.5px; color: #8a7a4d;
}
.tcg-set { font-family: 'Pixel', monospace; font-size: 7px; color: #9a7b3f; white-space: nowrap; }

.energy {
  width: 11px; height: 11px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,.5);
  box-shadow: inset -1px -1px 0 rgba(0,0,0,.28), inset 1px 1px 0 rgba(255,255,255,.4);
  display: inline-block; flex: 0 0 auto;
}

/* ================= trainers page ================= */
.nav { display: flex; gap: 8px; }
.nav-link {
  font-family: 'Pixel', monospace; font-size: 9px; letter-spacing: 1px;
  color: var(--muted); text-decoration: none;
  border: 2px solid var(--line); padding: 8px 12px; background: var(--panel2);
  transition: .12s;
}
.nav-link:hover:not(.active) { color: var(--txt); border-color: var(--green-dim); }
.nav-link.active {
  color: #2b2410;
  background: linear-gradient(160deg, #f7e9b8 0%, #e8c15a 45%, #c99a2e 100%);
  border-color: #e8c15a;
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}

.page-head { margin-bottom: 20px; }
.page-title {
  font-family: 'Pixel', monospace; font-size: clamp(16px, 3vw, 24px);
  margin: 0 0 12px; color: #fff;
  text-shadow: 3px 3px 0 #050908, 6px 6px 0 rgba(70,224,122,.18);
}
.page-sub { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.65; max-width: 70ch; }
.page-meta { font-size: 12px; color: var(--green); }
.page-meta .stale { color: var(--amber); }

.trainer-tools { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.search {
  flex: 1; min-width: 220px;
  font-family: ui-monospace, monospace; font-size: 13px; color: var(--txt);
  background: #08120e; border: 2px solid var(--line); padding: 11px 13px; outline: none;
}
.search:focus { border-color: var(--blue); }
.search::placeholder { color: #4a6156; }
.count-note { font-size: 12px; color: var(--muted); }

.trainer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

.trainer-card {
  background: var(--panel); border: 3px solid var(--line);
  box-shadow: 0 0 0 3px #050908, 0 12px 26px rgba(0,0,0,.45);
  padding: 16px; cursor: pointer;
  transition: transform .1s, border-color .15s;
}
.trainer-card:hover { transform: translateY(-2px); border-color: var(--green-dim); }
.tc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.tc-name { font-family: 'Pixel', monospace; font-size: 13px; margin: 0; color: #fff; word-break: break-word; }
.tc-lv { font-family: 'Pixel', monospace; font-size: 9px; color: #04120b; background: var(--green); padding: 5px 8px; white-space: nowrap; }
.tc-party { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; min-height: 42px; }
.mini { width: 40px; height: 40px; image-rendering: pixelated; background: #0b1512; border: 2px solid var(--line); padding: 2px; }
.mini.shiny { border-color: var(--amber); box-shadow: 0 0 8px rgba(255,207,64,.5); }
.tc-line { font-size: 11.5px; color: var(--muted); }
.tc-line .k { color: #55705f; font-size: 10px; }
.tc-line .sep { color: #33473d; }
.tc-go { margin-top: 12px; font-family: 'Pixel', monospace; font-size: 8px; color: var(--blue); letter-spacing: 1px; }

/* drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(2,6,4,.82); z-index: 20; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 21;
  width: min(760px, 100vw); overflow-y: auto;
  background: var(--bg2); border-left: 3px solid var(--line);
  padding: 20px 22px 60px;
  box-shadow: -20px 0 50px rgba(0,0,0,.6);
}
.drawer-close {
  position: sticky; top: 0; float: right;
  font-family: 'Pixel', monospace; font-size: 9px; letter-spacing: 1px;
  background: var(--panel2); color: var(--txt); border: 2px solid var(--line);
  padding: 9px 12px; cursor: pointer; margin-bottom: 10px;
}
.drawer-close:hover { background: var(--red-dim); border-color: var(--red); }
body.drawer-open { overflow: hidden; }

.dw-head h2 {
  font-family: 'Pixel', monospace; font-size: clamp(14px, 2.6vw, 20px);
  margin: 0 0 12px; color: #fff; text-shadow: 3px 3px 0 #050908;
}
.dw-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.dw-h {
  font-family: 'Pixel', monospace; font-size: 9px; letter-spacing: 1px;
  color: var(--green); margin: 24px 0 10px; padding-bottom: 7px;
  border-bottom: 2px solid var(--line);
}
.dw-empty { color: var(--muted); font-size: 13px; }

.stats-wide { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }

.kit { display: flex; flex-direction: column; gap: 6px; }
.kit-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 7px 10px; background: var(--panel2); border: 2px solid var(--line); }
.kit-k { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.kit-v { color: var(--txt); }
.kit-v.ench { color: var(--blue); }

.typegrid { display: flex; flex-wrap: wrap; gap: 7px; }

.party-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.mon-card {
  background: var(--panel); border: 2px solid var(--line); padding: 12px; text-align: center;
}
.mon-card.shiny { border-color: var(--amber); box-shadow: 0 0 14px rgba(255,207,64,.28); }
.mon-sprite img { width: 72px; height: 72px; image-rendering: pixelated; }
.mon-sprite img.fallback { opacity: .35; width: 40px; height: 40px; }
.mon-name { font-family: 'Pixel', monospace; font-size: 9px; color: #fff; margin-top: 6px; line-height: 1.6; }
.mon-nick { font-size: 11px; color: var(--amber); margin-top: 4px; }
.mon-lv { font-family: 'Pixel', monospace; font-size: 8px; color: var(--green); margin-top: 6px; }
.mon-tags { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-top: 8px; }
.tagchip {
  font-size: 10px; color: var(--muted); background: #0b1512;
  border: 1px solid var(--line); padding: 2px 6px;
}
.tagchip.tera { color: var(--amber); border-color: #7a6320; }
.mon-held { font-size: 10.5px; color: var(--muted); margin-top: 7px; }
.mon-moves { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-top: 8px; }
.move { font-size: 10px; color: var(--blue); background: #0a1622; border: 1px solid #1d3a4d; padding: 2px 6px; }
.mon-bars { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.bar { display: flex; align-items: center; gap: 6px; font-size: 10px; }
.bar-k { font-family: 'Pixel', monospace; font-size: 7px; color: var(--muted); width: 18px; }
.bar-track { flex: 1; height: 7px; background: #0a1210; border: 1px solid var(--line); }
.bar-fill { display: block; height: 100%; background: var(--green); }
.bar-fill.mid { background: var(--amber); }
.bar-fill.low { background: var(--red); }
.bar-v { width: 30px; text-align: right; color: var(--muted); }

.type.t-normal { background: #a8a878; }
.type.t-fire { background: #f08030; }
.type.t-water { background: #6890f0; color: #06122b; }
.type.t-electric { background: #f8d030; }
.type.t-grass { background: #78c850; }
.type.t-ice { background: #98d8d8; }
.type.t-fighting { background: #c03028; color: #fff; }
.type.t-poison { background: #a040a0; color: #fff; }
.type.t-ground { background: #e0c068; }
.type.t-flying { background: #a890f0; }
.type.t-psychic { background: #f85888; }
.type.t-bug { background: #a8b820; }
.type.t-rock { background: #b8a038; }
.type.t-ghost { background: #705898; color: #fff; }
.type.t-dragon { background: #7038f8; color: #fff; }
.type.t-dark { background: #705848; color: #fff; }
.type.t-steel { background: #b8b8d0; }
.type.t-fairy { background: #ee99ac; }

@media (max-width: 700px) {
  .drawer { width: 100vw; border-left: none; padding: 16px 14px 60px; }
  .trainer-grid { grid-template-columns: 1fr; }
}

footer {
  position: relative; z-index: 2; text-align: center;
  padding: 22px 16px 34px;
  color: #93b3a2; font-size: 11.5px;
  background: rgba(8, 20, 14, .62);
  border-top: 2px solid rgba(43, 65, 55, .7);
  backdrop-filter: blur(2px);
}
