:root {
  --bg: #05070d;
  --surface: rgba(12, 18, 34, 0.86);
  --surface-2: rgba(17, 26, 48, 0.88);
  --ink: #edf7ff;
  --muted: #9aa9c3;
  --line: rgba(132, 222, 255, 0.28);
  --path: #2b3449;
  --grass: #286f5f;
  --grass-dark: #143f3a;
  --tree: #102923;
  --water: #175a8a;
  --center: #d24d75;
  --ember: #ff6a3d;
  --leaf: #5de69f;
  --tide: #49d5ff;
  --spark: #ffd84a;
  --neutral: #a6b4c8;
  --focus: #58e6ff;
  --danger: #ff5b78;
  --radius: 8px;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(88, 230, 255, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(88, 230, 255, 0.06) 1px, transparent 1px),
    linear-gradient(145deg, #05070d 0%, #111827 58%, #180b16 100%),
    var(--bg);
  background-size: 36px 36px, 36px 36px, auto;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

button:focus-visible {
  outline: 3px solid rgba(88, 230, 255, 0.38);
  outline-offset: 2px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--focus);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(88, 230, 255, 0.42);
}

.starter-screen {
  width: min(1180px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 24px;
  align-items: center;
  padding: 32px 0;
}

.intro-panel,
.starter-card,
.tool-panel,
.route-card,
.message-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.intro-panel {
  min-height: 470px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 42px;
}

.intro-panel h1,
.topbar h1 {
  margin: 0;
  font-size: 4rem;
  line-height: 0.96;
  letter-spacing: 0;
  text-shadow: 0 0 28px rgba(88, 230, 255, 0.2);
}

.intro-copy {
  max-width: 560px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.starter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.starter-card {
  min-height: 440px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  padding: 20px;
}

.starter-card__text h2,
.route-card h2,
.tool-panel h2,
.battle-status h2 {
  margin: 6px 0;
  font-size: 1.22rem;
  line-height: 1.15;
}

.starter-card__text p:not(.type-pill),
.route-card p,
.battle-status p,
.panel-note,
.tips-list {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.pokemon-meta {
  margin: 0 0 8px !important;
  color: var(--focus) !important;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.move-btn,
.team-row,
.dpad button {
  min-height: 44px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.primary-btn {
  border: 1px solid rgba(88, 230, 255, 0.7);
  background: #152238;
  color: var(--ink);
  padding: 12px 16px;
  font-weight: 850;
  box-shadow: inset 0 0 18px rgba(88, 230, 255, 0.12), 0 0 24px rgba(88, 230, 255, 0.16);
}

.secondary-btn,
.ghost-btn {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  padding: 12px 16px;
  font-weight: 800;
}

.ghost-btn.danger {
  color: var(--danger);
}

.primary-btn:hover,
.secondary-btn:hover:not(:disabled),
.ghost-btn:hover,
.move-btn:hover:not(:disabled),
.team-row:hover:not(:disabled),
.dpad button:hover {
  transform: translateY(-1px);
  border-color: rgba(88, 230, 255, 0.76);
  box-shadow: 0 0 22px rgba(88, 230, 255, 0.16);
}

.topbar {
  width: min(1440px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 24px 0 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.topbar h1 {
  font-size: 3.35rem;
}

.topbar__stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar__stats span {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 7px 10px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.game-shell {
  width: min(1440px, calc(100vw - 40px));
  margin: 0 auto 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.screen-panel {
  min-height: 740px;
  padding: 0;
}

.side-panel {
  display: grid;
  gap: 14px;
}

.completion-banner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(93, 230, 159, 0.58);
  border-radius: var(--radius);
  background: rgba(12, 44, 35, 0.82);
  padding: 12px 14px;
  margin-bottom: 12px;
  color: var(--ink);
}

.completion-banner span {
  color: var(--muted);
}

.capture-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 38%, rgba(88, 230, 255, 0.18), transparent 34%),
    rgba(3, 7, 18, 0.72);
  backdrop-filter: blur(12px);
}

.capture-card {
  width: min(560px, calc(100vw - 32px));
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(88, 230, 255, 0.54);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(10, 16, 31, 0.96), rgba(22, 15, 34, 0.96)),
    var(--surface);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.62), 0 0 54px rgba(88, 230, 255, 0.18);
  padding: 22px;
  text-align: center;
}

.capture-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent),
    linear-gradient(135deg, rgba(88, 230, 255, 0.12), rgba(255, 91, 213, 0.1));
  transform: translateX(-105%);
  animation: captureShine 2200ms ease-in-out infinite;
  pointer-events: none;
}

.capture-card.type-ember {
  border-color: rgba(255, 106, 61, 0.72);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.62), 0 0 64px rgba(255, 106, 61, 0.2);
}

.capture-card.type-leaf {
  border-color: rgba(93, 230, 159, 0.72);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.62), 0 0 64px rgba(93, 230, 159, 0.18);
}

.capture-card.type-tide {
  border-color: rgba(73, 213, 255, 0.72);
}

.capture-card.type-spark {
  border-color: rgba(255, 216, 74, 0.72);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.62), 0 0 64px rgba(255, 216, 74, 0.16);
}

.capture-card.type-neutral {
  border-color: rgba(166, 180, 200, 0.72);
}

.capture-card__burst {
  position: absolute;
  inset: 18px;
  pointer-events: none;
}

.capture-card__burst span {
  position: absolute;
  inset: 14%;
  border: 1px solid rgba(88, 230, 255, 0.22);
  border-radius: 50%;
  animation: capturePulse 1800ms ease-out infinite;
}

.capture-card__burst span:nth-child(2) {
  animation-delay: 280ms;
}

.capture-card__burst span:nth-child(3) {
  animation-delay: 560ms;
}

.capture-card__hero {
  min-height: 240px;
  position: relative;
  display: grid;
  place-items: center;
}

.capture-sprite {
  width: 230px;
  max-width: 62vw;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.38));
  animation: captureFloat 1800ms ease-in-out infinite;
}

.capture-orb {
  width: 104px;
  aspect-ratio: 1;
  position: absolute;
  top: 24px;
  right: 72px;
  z-index: 3;
  border: 4px solid #111827;
  border-radius: 50%;
  background: linear-gradient(#ff3347 0 48%, #111827 48% 55%, #f8fbff 55% 100%);
  box-shadow: 0 0 28px rgba(255, 49, 63, 0.34), inset 0 -12px 20px rgba(0, 0, 0, 0.18);
  animation: captureBallSettle 1200ms ease-in-out infinite;
}

.capture-orb__top,
.capture-orb__line,
.capture-orb__button {
  position: absolute;
  display: block;
}

.capture-orb__top {
  width: 24px;
  height: 16px;
  top: 18px;
  left: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.48);
  filter: blur(1px);
}

.capture-orb__line {
  width: 100%;
  height: 5px;
  left: 0;
  top: calc(50% - 2px);
  background: #111827;
}

.capture-orb__button {
  width: 28px;
  aspect-ratio: 1;
  left: calc(50% - 14px);
  top: calc(50% - 14px);
  border: 5px solid #111827;
  border-radius: 50%;
  background: #f8fbff;
  box-shadow: 0 0 18px rgba(88, 230, 255, 0.8);
  animation: captureButtonBlink 800ms steps(2, end) infinite;
}

.capture-card__copy {
  position: relative;
  z-index: 2;
}

.capture-card__copy h2 {
  margin: 6px 0;
  font-size: 2.15rem;
  line-height: 1;
}

.capture-card__copy p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.capture-card__stats {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 20px 0;
}

.capture-card__stats span {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(5, 10, 22, 0.72);
  color: var(--ink);
  padding: 8px;
  font-size: 0.78rem;
  font-weight: 850;
}

.capture-card__action {
  position: relative;
  z-index: 2;
  width: 100%;
}

@keyframes captureShine {
  0%,
  44% {
    transform: translateX(-105%);
  }

  72%,
  100% {
    transform: translateX(105%);
  }
}

@keyframes capturePulse {
  0% {
    opacity: 0.75;
    transform: scale(0.55);
  }

  100% {
    opacity: 0;
    transform: scale(1.35);
  }
}

@keyframes captureFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes captureBallSettle {
  0%,
  100% {
    transform: rotate(-8deg) translateY(0);
  }

  50% {
    transform: rotate(8deg) translateY(-4px);
  }
}

@keyframes captureButtonBlink {
  0%,
  100% {
    box-shadow: 0 0 18px rgba(88, 230, 255, 0.85);
  }

  50% {
    box-shadow: 0 0 4px rgba(88, 230, 255, 0.22);
  }
}

@keyframes animeSpeedBurst {
  0% {
    opacity: 0;
    transform: scale(0.68) rotate(0deg);
  }

  28% {
    opacity: 0.7;
  }

  100% {
    opacity: 0;
    transform: scale(1.05) rotate(8deg);
  }
}

@keyframes animeActionBurst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.18) rotate(0deg);
  }

  36% {
    opacity: 0.72;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.22) rotate(18deg);
  }
}

@keyframes attackNamePop {
  0% {
    opacity: 1;
    transform: translateY(0) scale(0.94);
  }

  38% {
    opacity: 1;
    transform: translateY(0) scale(1.04);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes attackPatternSweep {
  0% {
    opacity: 0;
    transform: translateX(-30px) rotate(-8deg) scale(0.9);
  }

  26% {
    opacity: 0.66;
  }

  100% {
    opacity: 0;
    transform: translateX(34px) rotate(8deg) scale(1.08);
  }
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 16px;
}

.progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--focus), #ff5bd5);
}

.overworld-layout {
  min-height: 660px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
}

.map-frame {
  position: relative;
  display: block;
  overflow: auto;
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #07111d;
  box-shadow: var(--shadow);
}

.three-stage {
  width: 100%;
  min-height: 100%;
  overflow: hidden;
}

.three-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.overworld-stage {
  height: 660px;
}

.route-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px;
}

.route-actions {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.battle-scene {
  height: clamp(500px, 58vh, 620px);
  min-height: 500px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #07111d;
  box-shadow: var(--shadow);
}

.battle-scene::before {
  content: "";
  position: absolute;
  inset: -38%;
  z-index: 1;
  pointer-events: none;
  background:
    repeating-conic-gradient(from -18deg at 50% 56%, rgba(88, 230, 255, 0.14) 0deg 1.2deg, transparent 1.2deg 8deg),
    radial-gradient(circle at 50% 56%, rgba(255, 91, 213, 0.16), transparent 44%);
  opacity: 0;
  transform: scale(0.72);
}

.battle-scene.is-anime-action::before {
  animation: animeSpeedBurst 620ms ease-out;
}

.battle-status {
  width: min(300px, 38vw);
  position: absolute;
  z-index: 3;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(6, 10, 20, 0.74);
  padding: 12px;
  backdrop-filter: blur(16px);
  box-shadow: 0 0 28px rgba(88, 230, 255, 0.08);
}

.opponent-status {
  top: 18px;
  right: 18px;
}

.player-status {
  left: 18px;
  bottom: 18px;
}

.battle-stage {
  height: 100%;
  min-height: 500px;
  position: relative;
  z-index: 0;
}

.anime-action-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  pointer-events: none;
  color: var(--move-a, var(--focus));
}

.anime-action-overlay__burst {
  width: min(58vw, 480px);
  aspect-ratio: 1;
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  background:
    repeating-conic-gradient(from 8deg, var(--move-a, rgba(88, 230, 255, 0.78)) 0deg 3deg, transparent 3deg 10deg),
    radial-gradient(circle, var(--move-glow, rgba(255, 91, 213, 0.34)), transparent 62%);
  filter: drop-shadow(0 0 24px var(--move-glow, rgba(88, 230, 255, 0.38)));
  opacity: 0;
  animation: animeActionBurst 620ms ease-out;
}

.anime-action-overlay__pattern {
  position: absolute;
  z-index: 1;
  color: var(--move-b, #ffffff);
  font-size: clamp(5rem, 16vw, 13rem);
  font-weight: 950;
  line-height: 1;
  opacity: 0;
  text-shadow: 0 0 34px var(--move-glow, rgba(88, 230, 255, 0.42));
  animation: attackPatternSweep 700ms ease-out;
}

.anime-action-overlay__word,
.anime-action-overlay__name {
  position: relative;
  z-index: 2;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0;
  text-shadow:
    0 0 18px rgba(0, 0, 0, 0.76),
    0 0 28px var(--move-glow, rgba(88, 230, 255, 0.42));
  opacity: 1;
  animation: attackNamePop 280ms ease-out both;
}

.anime-action-overlay__word {
  padding: 8px 18px;
  border: 1px solid var(--move-a, var(--focus));
  border-radius: var(--radius);
  background: rgba(5, 10, 22, 0.72);
  color: var(--move-b, #ffffff);
  font-size: clamp(2.15rem, 8vw, 5.6rem);
  font-weight: 950;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 18px 42px rgba(0, 0, 0, 0.34),
    0 0 36px var(--move-glow, rgba(88, 230, 255, 0.34));
}

.anime-action-overlay__name {
  margin-top: clamp(4.5rem, 12vw, 8rem);
  color: var(--ink);
  font-size: clamp(0.95rem, 2.8vw, 1.45rem);
  font-weight: 900;
}

.battle-menu {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 12px;
  margin-top: 14px;
}

.message-box {
  padding: 14px;
  box-shadow: none;
}

.message-box strong,
.message-box span {
  display: block;
}

.message-box span {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.battle-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.move-btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, var(--move-soft, rgba(88, 230, 255, 0.16)), rgba(5, 10, 22, 0.94) 68%),
    var(--surface);
  color: var(--ink);
  height: 70px;
  min-height: 70px;
  padding: 9px 10px;
  text-align: left;
  font-weight: 850;
}

.move-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.24;
  background:
    radial-gradient(circle at 84% 20%, var(--move-a, rgba(88, 230, 255, 0.45)), transparent 28%),
    linear-gradient(135deg, transparent, var(--move-glow, rgba(88, 230, 255, 0.18)));
}

.move-btn:hover:not(:disabled)::before {
  opacity: 0.42;
}

.move-btn.type-ember {
  border-color: rgba(255, 106, 61, 0.48);
}

.move-btn.type-leaf {
  border-color: rgba(93, 230, 159, 0.42);
}

.move-btn.type-tide {
  border-color: rgba(73, 213, 255, 0.48);
}

.move-btn.type-spark {
  border-color: rgba(255, 216, 74, 0.5);
}

.move-btn.type-neutral {
  border-color: rgba(166, 180, 200, 0.45);
}

.move-btn__fx,
.move-btn__name,
.move-btn small {
  position: relative;
  z-index: 1;
}

.move-btn__fx {
  position: absolute;
  top: 6px;
  right: 8px;
  color: var(--move-b, #ffffff);
  font-size: 0.88rem;
  font-weight: 950;
  opacity: 0.58;
  text-shadow: 0 0 14px var(--move-glow, rgba(88, 230, 255, 0.36));
}

.move-btn__name {
  max-width: calc(100% - 20px);
  font-size: 0.9rem;
  line-height: 1.05;
}

.move-btn small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
}

.attack-effect-slash::before,
.attack-effect-slash .anime-action-overlay__burst {
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, var(--move-a, #58e6ff) 14px 17px, transparent 17px 28px),
    radial-gradient(circle, var(--move-glow, rgba(88, 230, 255, 0.24)), transparent 64%);
}

.attack-effect-burst::before,
.attack-effect-burst .anime-action-overlay__burst {
  background:
    radial-gradient(circle at 50% 50%, var(--move-b, #ffffff) 0 5%, transparent 6% 16%, var(--move-a, #58e6ff) 17% 19%, transparent 20%),
    radial-gradient(circle, var(--move-glow, rgba(88, 230, 255, 0.24)), transparent 66%);
}

.attack-effect-arc::before,
.attack-effect-arc .anime-action-overlay__burst {
  background:
    repeating-conic-gradient(from 28deg, var(--move-a, #58e6ff) 0deg 8deg, transparent 8deg 24deg),
    radial-gradient(circle, var(--move-glow, rgba(88, 230, 255, 0.24)), transparent 62%);
}

.attack-effect-rush::before,
.attack-effect-rush .anime-action-overlay__burst {
  background:
    repeating-linear-gradient(90deg, transparent 0 12px, var(--move-a, #58e6ff) 12px 15px, transparent 15px 30px),
    linear-gradient(90deg, transparent, var(--move-glow, rgba(88, 230, 255, 0.24)), transparent);
}

.attack-effect-strike::before,
.attack-effect-strike .anime-action-overlay__burst {
  background:
    linear-gradient(45deg, transparent 45%, var(--move-a, #58e6ff) 46% 54%, transparent 55%),
    linear-gradient(-45deg, transparent 45%, var(--move-b, #ffffff) 46% 54%, transparent 55%),
    radial-gradient(circle, var(--move-glow, rgba(88, 230, 255, 0.22)), transparent 62%);
}

.attack-effect-surge::before,
.attack-effect-surge .anime-action-overlay__burst {
  background:
    repeating-radial-gradient(ellipse at 50% 55%, transparent 0 14px, var(--move-a, #58e6ff) 15px 18px, transparent 19px 32px),
    linear-gradient(135deg, var(--move-glow, rgba(88, 230, 255, 0.18)), transparent);
}

.attack-effect-bind::before,
.attack-effect-bind .anime-action-overlay__burst {
  background:
    repeating-linear-gradient(45deg, transparent 0 12px, var(--move-a, #58e6ff) 12px 14px, transparent 14px 24px),
    repeating-linear-gradient(-45deg, transparent 0 16px, var(--move-b, #ffffff) 16px 18px, transparent 18px 30px);
}

.attack-effect-rift::before,
.attack-effect-rift .anime-action-overlay__burst {
  background:
    radial-gradient(circle at 30% 25%, var(--move-b, #ffffff) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 42%, var(--move-a, #58e6ff) 0 3px, transparent 4px),
    radial-gradient(circle at 50% 60%, var(--move-glow, rgba(88, 230, 255, 0.28)), transparent 64%);
}

.attack-effect-capture::before,
.attack-effect-guard::before,
.attack-effect-impact::before {
  background:
    radial-gradient(circle at 70% 30%, var(--move-a, #58e6ff), transparent 30%),
    linear-gradient(135deg, transparent, var(--move-glow, rgba(88, 230, 255, 0.18)));
}

.tool-panel {
  padding: 14px;
  box-shadow: none;
}

.tool-panel h2 {
  margin-top: 0;
  font-size: 1rem;
}

.team-list {
  display: grid;
  gap: 8px;
}

.team-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.team-row.active {
  background: rgba(88, 230, 255, 0.12);
  border-color: var(--focus);
}

.team-row strong,
.team-row small {
  display: block;
}

.team-row small {
  color: var(--muted);
  font-size: 0.78rem;
}

.dpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.dpad button {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 850;
}

.dpad button:first-child {
  grid-column: 2;
}

.dpad button:nth-child(2) {
  grid-column: 1;
}

.dpad button:nth-child(3) {
  grid-column: 3;
}

.dpad button:last-child {
  grid-column: 2;
}

.panel-note {
  margin-top: 10px;
  font-size: 0.88rem;
}

.tips-list {
  padding-left: 18px;
}

.tips-list li + li {
  margin-top: 6px;
}

.log-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.45;
}

.log-list li + li {
  margin-top: 6px;
}

.bars {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}

.bars label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.bar {
  height: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(23, 32, 42, 0.12);
}

.bar span {
  display: block;
  height: 100%;
}

.bar.hp span {
  background: linear-gradient(90deg, #33d17a, #83ffbf);
}

.bar.energy span {
  background: linear-gradient(90deg, #ffc857, #ff5bd5);
}

.type-pill {
  width: fit-content;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(237, 247, 255, 0.28);
  border-radius: 999px;
  padding: 4px 10px;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 900;
}

.type-pill.type-ember {
  background: var(--ember);
}

.type-pill.type-leaf {
  background: var(--leaf);
}

.type-pill.type-tide {
  background: var(--tide);
}

.type-pill.type-spark {
  background: var(--spark);
  color: #1d1600;
}

.type-pill.type-neutral {
  background: var(--neutral);
}

.sprite {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  image-rendering: crisp-edges;
}

.pokemon-art {
  display: grid;
  place-items: center;
  width: 100%;
  position: relative;
  isolation: isolate;
}

.pokemon-art::before {
  content: "";
  width: 78%;
  aspect-ratio: 1;
  position: absolute;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(88, 230, 255, 0.18), transparent 62%),
    radial-gradient(circle, rgba(255, 91, 213, 0.12), transparent 70%);
  filter: blur(4px);
  z-index: -1;
}

.pokemon-art img {
  width: min(100%, 270px);
  max-height: 230px;
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.38));
}

.pokemon-art-large {
  min-height: 190px;
}

.pokemon-art-tiny {
  width: 52px;
  min-width: 52px;
  aspect-ratio: 1;
}

.pokemon-art-tiny img {
  width: 52px;
  max-height: 52px;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.35));
}

.pokemon-art__fallback {
  width: 100%;
}

.sprite-large {
  min-height: 180px;
}

.sprite-battle {
  max-width: 220px;
  position: relative;
  z-index: 1;
}

.sprite-tiny {
  width: 48px;
  min-width: 48px;
}

.is-battle .screen-panel {
  min-height: 710px;
}

@media (max-width: 1080px) {
  .starter-screen,
  .game-shell,
  .overworld-layout,
  .battle-menu {
    grid-template-columns: 1fr;
  }

  .starter-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar__stats {
    justify-content: flex-start;
  }

  .screen-panel {
    min-height: auto;
  }

  .battle-scene,
  .battle-stage {
    min-height: 500px;
  }
}

@media (max-width: 680px) {
  .starter-screen,
  .game-shell,
  .topbar {
    width: min(100vw - 20px, 1440px);
  }

  .intro-panel h1,
  .topbar h1 {
    font-size: 2.25rem;
  }

  .intro-panel,
  .route-card {
    padding: 20px;
  }

  .battle-actions {
    grid-template-columns: 1fr;
  }

  .battle-scene {
    height: auto;
    min-height: 0;
    overflow: hidden;
  }

  .battle-stage {
    height: 430px;
    min-height: 430px;
  }

  .battle-status {
    width: 100%;
    position: relative;
    inset: auto;
    margin-top: 10px;
  }

  .opponent-status {
    top: auto;
    right: auto;
  }

  .player-status {
    left: auto;
    bottom: auto;
  }

  .completion-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .capture-overlay {
    align-items: start;
    padding: 14px;
    overflow: auto;
  }

  .capture-card {
    width: 100%;
    padding: 16px;
  }

  .capture-card__hero {
    min-height: 190px;
  }

  .capture-sprite {
    width: 170px;
  }

  .capture-orb {
    width: 76px;
    right: 28px;
    top: 18px;
  }

  .capture-orb__button {
    width: 22px;
    left: calc(50% - 11px);
    top: calc(50% - 11px);
    border-width: 4px;
  }

  .capture-card__copy h2 {
    font-size: 1.55rem;
  }

  .capture-card__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
