:root {
  --bg: #14161c;
  --panel: #1e222b;
  --panel-2: #262b36;
  --line: #333a47;
  --text: #e7ebf3;
  --muted: #9aa4b5;
  --accent: #e3350d;       /* poke red */
  --accent-2: #ffcb05;     /* poke yellow */
  --ok: #4caf78;
  --bad: #e05656;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
header.topbar {
  background: var(--accent);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
}
header.topbar .brand { font-weight: 700; font-size: 18px; color: #fff; }
header.topbar nav a { color: #fff; margin-right: 14px; font-size: 14px; }
.container { max-width: 1100px; margin: 0 auto; padding: 20px; }
h1, h2, h3 { line-height: 1.2; }
.muted { color: var(--muted); }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
.grid { display: grid; gap: 12px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.mon {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
  position: relative;
  transition: transform .12s ease, box-shadow .12s ease,
              filter .35s ease, opacity .35s ease, border-color .2s ease;
}
.mon:hover { transform: translateY(-3px); box-shadow: 0 6px 16px #0007; }
.mon img { width: 72px; height: 72px; image-rendering: pixelated; }
.mon .name { font-size: 13px; font-weight: 600; }
.mon.locked { opacity: 0.34; filter: grayscale(0.8); }
.mon .lockbadge {
  position: absolute; top: 6px; right: 6px;
  font-size: 10px; background: #000a; padding: 2px 5px; border-radius: 6px;
}
.types { display: flex; gap: 4px; justify-content: center; margin: 4px 0; flex-wrap: wrap; }
.type {
  font-size: 10px; text-transform: uppercase; letter-spacing: .03em;
  padding: 2px 6px; border-radius: 6px; color: #fff; font-weight: 700;
}
button, .btn {
  background: var(--accent); color: #fff; border: none;
  padding: 7px 12px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
button.ghost, .btn.ghost { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); }
button.small { padding: 3px 8px; font-size: 12px; }
button:hover { filter: brightness(1.08); }
input, select {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  padding: 7px 10px; border-radius: 8px; font-size: 14px;
}
label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 4px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); font-weight: 600; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.badge.party { background: #1f5e3a; }
.badge.boxed { background: #3a4660; }
.badge.dead { background: #5e2424; }
.statbar { background: var(--panel-2); border-radius: 8px; height: 14px; overflow: hidden; }
.statbar > div { height: 100%; background: var(--ok); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.bigcap { font-size: 44px; font-weight: 800; color: var(--accent-2); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.pill { background: var(--panel-2); border:1px solid var(--line); border-radius:999px; padding:4px 10px; font-size:13px; }

/* Type colors */
.t-normal{background:#9099a1}.t-fire{background:#ff9d55}.t-water{background:#4d90d5}
.t-electric{background:#f4d23c;color:#222}.t-grass{background:#63bc5a}.t-ice{background:#73cec0;color:#222}
.t-fighting{background:#ce4069}.t-poison{background:#ab6ac8}.t-ground{background:#d97746}
.t-flying{background:#8fa9de}.t-psychic{background:#fa7179}.t-bug{background:#90c12c}
.t-rock{background:#c7b78b;color:#222}.t-ghost{background:#5269ac}.t-dragon{background:#0b6dc3}
.t-dark{background:#5a5366}.t-steel{background:#5a8ea2}.t-fairy{background:#ec8fe6}

/* --- Slick: animations, flashes, toasts --- */

/* Keep View Transitions quick & subtle */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }

/* Quick white flash overlay dropped on a catch/evolve target */
.flash-fx {
  position: absolute; inset: 0; border-radius: inherit;
  background: #fff; pointer-events: none; z-index: 5;
  animation: flashfx .45s ease-out forwards;
}
@keyframes flashfx { 0% { opacity: 0; } 25% { opacity: .85; } 100% { opacity: 0; } }

/* Pop-in for freshly rendered cards/sprites */
@keyframes popin { 0% { transform: scale(.7); opacity: 0; } 60% { transform: scale(1.06); } 100% { transform: scale(1); opacity: 1; } }
.popin { animation: popin .32s ease-out; }

/* Tracked (team) card gets a relative box so the flash sits correctly */
.tracked-card { position: relative; transition: border-color .25s ease; }

/* Toasts */
.toasts {
  position: fixed; right: 16px; bottom: 16px; z-index: 50;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-left: 4px solid var(--accent-2);
  border-radius: 8px; padding: 10px 14px; font-size: 13px; max-width: 280px;
  opacity: 0; transform: translateY(8px); transition: opacity .25s ease, transform .25s ease;
  box-shadow: 0 6px 18px #0008;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .mon, .statbar > div, .toast { transition: none; }
  .flash-fx, .popin { animation: none; }
}

/* --- Dramatic full-screen evolution overlay --- */
.evo-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  background: rgba(6, 8, 12, 0.92);
}
.evo-overlay.active { display: flex; }
.evo-stage { position: relative; width: 340px; height: 340px; }
.evo-stage img {
  position: absolute; inset: 0; margin: auto;
  width: 300px; height: 300px; object-fit: contain;
}
.evo-caption {
  position: absolute; bottom: 12%; left: 0; right: 0; text-align: center;
  color: var(--text); font-size: 20px; font-weight: 700; opacity: 0;
  text-shadow: 0 2px 12px #000;
}
.evo-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.evo-spark {
  position: absolute; top: 50%; left: 50%; width: 12px; height: 12px;
  border-radius: 50%; background: var(--accent-2); opacity: 0; pointer-events: none;
}
