:root {
  color-scheme: light;
  --ink: #202331;
  --muted: #687082;
  --line: rgba(32, 35, 49, 0.14);
  --panel: rgba(255, 255, 255, 0.9);
  --shadow: 0 16px 34px rgba(32, 35, 49, 0.18);
  --bubble: #f6a8d5;
  --wind: #9fdcaa;
  --water: #7fc4f2;
  --earth: #c7a06e;
  --metal: #b9c0cf;
  font-family: ui-rounded, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  min-height: 100%;
  touch-action: manipulation;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: #151926;
  overscroll-behavior: none;
  touch-action: manipulation;
  user-select: none;
}

button {
  min-height: 56px;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff, #edf1f6);
  box-shadow: 0 6px 0 rgba(32, 35, 49, 0.16), 0 14px 24px rgba(32, 35, 49, 0.12);
  font: inherit;
  font-weight: 900;
  letter-spacing: 0;
  cursor: pointer;
  touch-action: manipulation;
}

button:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(32, 35, 49, 0.16), 0 8px 16px rgba(32, 35, 49, 0.1);
}

button:disabled {
  color: #9ca4b2;
  background: #e2e6ee;
  box-shadow: none;
  transform: none;
}

button.primary {
  color: #fff;
  background: linear-gradient(180deg, #ff8e71, #ec4f64);
}

button.secondary {
  color: #243d5a;
  background: linear-gradient(180deg, #dff5ff, #a9d9ef);
}

button.ghost,
.icon-button {
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 0 0 1px var(--line);
}

.jumbo {
  min-height: 64px;
  font-size: 1.05rem;
}

.app-shell {
  min-height: 100svh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 24%),
    #151926;
}

.app {
  width: min(430px, 100vw);
  min-height: 100svh;
  margin: 0 auto;
  background: #f6f1e8;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 46px rgba(0, 0, 0, 0.38);
}

.screen {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  overflow: hidden;
  animation: screen-in 0.24s ease-out both;
}

.app-top,
.resource-bar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.app-top h1,
.lead-card h1,
.brand {
  margin: 0;
  letter-spacing: 0;
}

.app-top h1 {
  font-size: 1.65rem;
  line-height: 1.05;
}

.subtitle,
.starter-card p,
.zone-card p,
.dex-card p,
.mon-detail p,
.settings-row p,
.empty-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.38;
  font-weight: 750;
}

.eyebrow {
  margin: 0 0 4px;
  color: #d54d5f;
  font-size: 0.78rem;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.icon-button {
  width: 56px;
  min-width: 56px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.8rem;
  line-height: 1;
}

.resource-bar {
  min-height: 54px;
  border-radius: 18px;
  padding: 8px;
  color: #fff;
  background: linear-gradient(180deg, #29324b, #171b2b);
  box-shadow: 0 7px 0 rgba(0, 0, 0, 0.2), 0 14px 24px rgba(0, 0, 0, 0.18);
}

.resource-bar span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 13px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 900;
}

.progress-strip {
  position: relative;
  z-index: 3;
  border-radius: 14px;
  padding: 9px 12px;
  color: #fff;
  background: rgba(32, 35, 49, 0.76);
  font-size: 0.86rem;
  font-weight: 900;
}

.nav-icon {
  position: relative;
  width: 24px;
  height: 24px;
  display: inline-block;
  flex: 0 0 auto;
}

.nav-icon::before,
.nav-icon::after {
  content: "";
  position: absolute;
  display: block;
}

.nav-icon-jar::before,
.nav-icon-explore::before {
  inset: 5px 4px 3px;
  border: 3px solid currentColor;
  border-radius: 50% 50% 45% 45%;
}

.nav-icon-jar::after {
  left: 8px;
  top: 1px;
  width: 8px;
  height: 7px;
  border-radius: 3px;
  background: currentColor;
}

.nav-icon-badge::before,
.nav-icon-party::before {
  inset: 2px 4px;
  clip-path: polygon(50% 0, 92% 18%, 82% 92%, 50% 76%, 18% 92%, 8% 18%);
  background: currentColor;
}

.nav-icon-dex::before {
  inset: 3px 4px;
  border: 3px solid currentColor;
  border-radius: 4px;
}

.nav-icon-dex::after {
  left: 11px;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: currentColor;
}

.nav-icon-settings::before {
  inset: 5px;
  border: 4px solid currentColor;
  border-radius: 50%;
}

.nav-icon-settings::after {
  left: 10px;
  top: 0;
  width: 4px;
  height: 24px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
}

.title-screen {
  grid-template-rows: 1fr auto;
  padding: 28px 18px 22px;
  color: #fff;
  background:
    radial-gradient(circle at 72% 22%, rgba(255, 210, 108, 0.95), transparent 18%),
    linear-gradient(160deg, #1c2c46 0%, #315c72 50%, #e76a65 100%);
}

.title-orbit {
  position: absolute;
  inset: 9% -18% auto;
  height: 360px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  transform: rotate(-14deg);
}

.title-copy {
  position: relative;
  z-index: 2;
  align-self: end;
  padding-bottom: 258px;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.16);
}

.brand {
  font-size: 3.7rem;
  line-height: 0.9;
}

.title-copy .subtitle {
  max-width: 290px;
  color: rgba(255, 255, 255, 0.84);
}

.title-monsters {
  position: absolute;
  inset: auto 0 126px;
  height: 280px;
  pointer-events: none;
}

.title-monster {
  position: absolute;
  display: grid;
  place-items: center;
  animation: idle-float 2.6s ease-in-out infinite;
}

.title-monster-1 { left: 16px; bottom: 20px; transform: rotate(-9deg); }
.title-monster-2 { left: 112px; bottom: 26px; animation-delay: -0.5s; }
.title-monster-3 { right: 12px; bottom: 12px; transform: rotate(8deg); animation-delay: -1s; }

.title-actions {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 10px;
}

.home-screen {
  background:
    linear-gradient(180deg, #74c2cf 0%, #d9f0d2 50%, #f6f1e8 100%);
}

.home-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 580px;
  padding-bottom: 74px;
}

.home-stage-glow {
  position: absolute;
  width: 330px;
  height: 330px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 245, 171, 0.94), rgba(255, 255, 255, 0) 66%);
}

.lead-platform,
.battle-platform,
.encounter-platform {
  position: absolute;
  width: 254px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(64, 78, 68, 0.38), rgba(64, 78, 68, 0.08) 68%, transparent 70%);
}

.lead-platform {
  top: 345px;
}

.lead-monster {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  margin-top: 62px;
  animation: idle-float 2.4s ease-in-out infinite;
}

.lead-card {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  z-index: 3;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.lead-card h1 {
  font-size: 1.85rem;
}

.heal-inline {
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
}

.home-menu,
.bottom-nav {
  position: relative;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.home-menu button,
.bottom-nav button {
  min-height: 76px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 8px 4px;
  font-size: 0.82rem;
}

.bottom-nav {
  position: sticky;
  bottom: max(8px, env(safe-area-inset-bottom));
  margin-top: 4px;
  border-radius: 20px;
  padding: 8px;
  background: rgba(32, 35, 49, 0.88);
  backdrop-filter: blur(12px);
}

.bottom-nav button {
  min-height: 64px;
  color: #fff;
  background: transparent;
  box-shadow: none;
}

.bottom-nav button.active {
  color: #202331;
  background: linear-gradient(180deg, #ffe98a, #ffc35b);
  box-shadow: inset 0 -3px 0 rgba(133, 83, 0, 0.2);
}

.starter-screen,
.explore-menu-screen,
.dex-screen,
.party-detail-screen,
.settings-screen {
  background: linear-gradient(180deg, #f8faf8, #eee5d7);
}

.starter-grid,
.zone-list,
.dex-grid,
.settings-list,
.party-grid,
.box-list {
  display: grid;
  gap: 12px;
  align-content: start;
}

.starter-card,
.zone-card,
.dex-card,
.mon-detail,
.box-panel,
.settings-row {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.starter-card {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.starter-art,
.dex-sprite,
.detail-sprite {
  display: grid;
  place-items: center;
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-title h2,
.card-title h3 {
  margin: 0;
}

.type-pill,
.small-chip,
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  color: #202331;
  background: #eef2f5;
  font-size: 0.82rem;
  font-weight: 1000;
}

.battle-name .type-pill,
.battle-name .status-badge {
  min-height: 22px;
  padding: 3px 7px;
  font-size: 0.68rem;
}

.type-mark {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-left: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
}

.type-mark.strong { color: #087a35; }
.type-mark.weak { color: #a52835; }

.type-방울,
.type-bg-방울 { background: var(--bubble); }
.type-바람,
.type-bg-바람 { background: var(--wind); }
.type-물,
.type-bg-물 { background: var(--water); }
.type-대지,
.type-bg-대지 { background: var(--earth); }
.type-금속,
.type-bg-금속 { background: var(--metal); }

.zone-card {
  position: relative;
  width: 100%;
  min-height: 132px;
  overflow: hidden;
  padding: 16px;
  text-align: left;
}

.zone-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background: linear-gradient(135deg, #fff, transparent);
  pointer-events: none;
}

.zone-pond { background: linear-gradient(135deg, #b9ecff, #e5fbff); }
.zone-hill { background: linear-gradient(135deg, #b7e28f, #eef8cb); }
.zone-valley { background: linear-gradient(135deg, #c7b09a, #f0dbc1); }
.zone-factory { background: linear-gradient(135deg, #b9c0cf, #edf0f7); }
.zone-cave { background: linear-gradient(135deg, #756eb8, #c8eef2); }

.zone-card.locked {
  filter: grayscale(0.55);
}

.lock-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(32, 35, 49, 0.42);
  font-size: 1.45rem;
  font-weight: 1000;
  letter-spacing: 0.08em;
}

.zone-meta,
.dex-hints,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.explore-screen {
  place-items: center;
  text-align: center;
}

.battle-wipe {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  background: linear-gradient(90deg, #202331 0 50%, #202331 50% 100%);
  animation: wipe-open 0.58s ease-in-out both;
}

.wild-card {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 100%;
  padding: 20px 14px;
}

.wild-art {
  position: relative;
  z-index: 2;
  animation: enemy-enter 0.5s cubic-bezier(0.2, 1, 0.3, 1) both;
}

.encounter-platform {
  top: 232px;
}

.wild-card h2 {
  margin: 0;
  font-size: 2rem;
}

.battle-screen {
  grid-template-rows: minmax(458px, 1fr) auto;
  gap: 0;
  padding: 0;
  background: #91d6e8;
}

.battle-field {
  position: relative;
  min-height: 458px;
  overflow: hidden;
}

.field-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.zone-bg-pond .field-sky,
.zone-bg-pond {
  background: linear-gradient(180deg, #9ce4ff 0%, #d6fbff 48%, #70cfe4 100%);
}

.zone-bg-hill .field-sky,
.zone-bg-hill {
  background: linear-gradient(180deg, #8fd5f2 0%, #ddf7bf 50%, #85c96b 100%);
}

.zone-bg-valley .field-sky,
.zone-bg-valley {
  background: linear-gradient(180deg, #c5ddf0 0%, #e3c29f 48%, #9a7b61 100%);
}

.zone-bg-factory .field-sky,
.zone-bg-factory {
  background: linear-gradient(180deg, #b8c4d2 0%, #e8edf1 44%, #8793a5 100%);
}

.zone-bg-cave .field-sky,
.zone-bg-cave {
  background: linear-gradient(180deg, #756eb8 0%, #b9edf1 46%, #4e6279 100%);
}

.field-shapes::before,
.field-shapes::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  opacity: 0.38;
}

.field-shapes::before {
  width: 82px;
  height: 82px;
  right: 30px;
  top: 76px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: -150px 90px 0 -30px rgba(255, 255, 255, 0.5);
}

.field-shapes::after {
  left: -40px;
  right: -40px;
  bottom: -72px;
  height: 180px;
  border-radius: 50% 50% 0 0;
  background: rgba(255, 255, 255, 0.28);
}

.battle-unit {
  position: absolute;
  z-index: 2;
  display: grid;
}

.enemy-unit {
  top: 42px;
  right: 8px;
  width: 260px;
  justify-items: end;
  animation: enemy-enter 0.42s ease-out both;
}

.player-unit {
  left: 6px;
  bottom: 10px;
  width: 308px;
  justify-items: start;
}

.enemy-unit .battle-info {
  margin-right: 76px;
  order: 1;
}

.enemy-unit .platform-wrap {
  order: 2;
}

.player-unit .battle-info {
  margin-left: 104px;
  order: 2;
}

.player-unit .platform-wrap {
  order: 1;
}

.battle-info {
  width: 186px;
  border: 2px solid rgba(32, 35, 49, 0.16);
  border-radius: 16px 16px 16px 4px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 5px 0 rgba(32, 35, 49, 0.1);
}

.player-unit .battle-info {
  border-radius: 16px 16px 4px 16px;
}

.battle-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 1000;
}

.battle-name strong {
  flex: 1 1 100%;
}

.battle-info p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.hp-track,
.xp-track {
  position: relative;
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe4ea;
  margin-top: 7px;
}

.hp-track {
  background: #d84d54;
}

.hp-lag,
.hp-fill,
.xp-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
}

.hp-lag {
  background: #ffb24e;
  transition: width 0.72s ease 0.18s;
}

.hp-fill {
  background: linear-gradient(90deg, #6bd467, #27ad64);
  transition: width 0.42s ease;
}

.hp-track.hp-warn .hp-fill {
  background: linear-gradient(90deg, #ffd65a, #f0a832);
}

.hp-track.hp-danger .hp-fill {
  background: linear-gradient(90deg, #ff6b5d, #d92d47);
  animation: hp-blink 0.72s ease-in-out infinite;
}

.xp-track {
  height: 7px;
}

.xp-fill {
  background: linear-gradient(90deg, #54d2ff, #5a76ff);
}

.platform-wrap {
  position: relative;
  width: 210px;
  height: 178px;
}

.enemy-unit .platform-wrap {
  width: 178px;
  height: 152px;
}

.battle-platform {
  left: 0;
  right: 0;
  bottom: 2px;
  margin: auto;
}

.enemy-unit .battle-platform {
  width: 154px;
  height: 44px;
}

.player-unit .battle-platform {
  width: 204px;
  height: 58px;
}

.sprite-wrap {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  animation: idle-float 2.2s ease-in-out infinite;
}

.player-unit .sprite-wrap {
  transform-origin: 44% 72%;
}

.enemy-unit .sprite-wrap {
  transform-origin: 55% 72%;
}

.sprite-wrap.is-attacking {
  animation: attack-lunge 0.34s ease-in-out both;
}

.enemy-unit .sprite-wrap.is-attacking {
  animation-name: enemy-lunge;
}

.sprite-wrap.is-hit {
  animation: hit-shake 0.28s ease-in-out 2;
}

.sprite-wrap.is-fainted {
  animation: faint-out 0.66s ease-in both;
}

.sprite-wrap.is-captured {
  animation: captured-in 0.7s cubic-bezier(0.22, 0.9, 0.28, 1) both;
}

.sprite-wrap::before,
.sprite-wrap::after {
  content: "";
  position: absolute;
  inset: 22% 18%;
  z-index: 3;
  display: none;
  pointer-events: none;
}

.sprite-wrap.fx-방울::before {
  display: block;
  border: 3px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  box-shadow: 24px 28px 0 -8px rgba(246, 168, 213, 0.9), -18px 42px 0 -7px rgba(255, 255, 255, 0.88);
  animation: bubble-pop 0.5s ease-out both;
}

.sprite-wrap.fx-물::before {
  display: block;
  background:
    radial-gradient(circle, rgba(127, 196, 242, 0.95) 0 28%, transparent 30%) 16% 0 / 18px 38px repeat-y,
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 24%, transparent 26%) 72% 0 / 16px 34px repeat-y;
  animation: water-drop 0.52s linear both;
}

.sprite-wrap.fx-바람::before {
  display: block;
  background: repeating-linear-gradient(140deg, transparent 0 12px, rgba(255, 255, 255, 0.82) 13px 17px, transparent 18px 30px);
  animation: wind-streak 0.48s ease-out both;
}

.sprite-wrap.fx-금속::before {
  display: block;
  background:
    linear-gradient(45deg, transparent 45%, #fff26f 46% 54%, transparent 55%),
    linear-gradient(-35deg, transparent 45%, #dfe7ff 46% 54%, transparent 55%);
  animation: metal-spark 0.42s steps(2, end) both;
}

.sprite-wrap.fx-대지::before {
  display: block;
  inset: 56% 8% 8%;
  border-radius: 50%;
  background: rgba(118, 98, 74, 0.32);
  box-shadow: -22px -6px 0 -6px rgba(118, 98, 74, 0.52), 28px -10px 0 -7px rgba(118, 98, 74, 0.58);
  animation: earth-burst 0.48s ease-out both;
}

.dust {
  position: absolute;
  left: 50%;
  bottom: 24px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(118, 98, 74, 0.42);
  animation: dust-puff 0.62s ease-out both;
  pointer-events: none;
}

.dust-a { margin-left: -40px; }
.dust-b { margin-left: -8px; animation-delay: 0.08s; }
.dust-c { margin-left: 26px; animation-delay: 0.14s; }

.impact-flash::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  background: rgba(255, 255, 255, 0.82);
  animation: flash-out 0.32s ease-out both;
  pointer-events: none;
}

.damage-float {
  position: absolute;
  top: 16%;
  left: 56%;
  color: #e3324f;
  font-size: 1.55rem;
  font-weight: 1000;
  text-shadow: 0 2px 0 #fff, 0 4px 0 rgba(0, 0, 0, 0.12);
  animation: damage-rise 0.52s ease-out both;
  pointer-events: none;
}

.battle-panel {
  position: relative;
  z-index: 5;
  display: grid;
  gap: 10px;
  padding: 12px 12px max(12px, env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  background: #f8f4ec;
  box-shadow: 0 -8px 24px rgba(32, 35, 49, 0.18);
}

.battle-log {
  min-height: 72px;
  width: 100%;
  border: 3px solid #202331;
  border-radius: 18px;
  padding: 14px;
  text-align: left;
  background: #fff;
  box-shadow: 0 5px 0 rgba(32, 35, 49, 0.18);
  font-size: 1rem;
}

.battle-controls {
  display: grid;
  gap: 10px;
}

.move-grid,
.learn-grid,
.switch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.move-button,
.learn-grid button,
.switch-grid button {
  min-height: 70px;
  display: grid;
  align-content: center;
  gap: 3px;
  text-align: left;
}

.move-button small,
.battle-controls small {
  color: rgba(32, 35, 49, 0.72);
  font-size: 0.76rem;
  font-weight: 900;
}

.support-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.support-row button {
  min-height: 58px;
  padding: 8px 6px;
  font-size: 0.78rem;
}

.capture-fx {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.capture-fx span {
  position: absolute;
  width: 32px;
  height: 32px;
  border: 4px solid #202331;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff5b5b 0 48%, #fff 50% 100%);
  box-shadow: 0 4px 0 rgba(32, 35, 49, 0.22);
}

.capture-fx span::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 9px;
  width: 8px;
  height: 8px;
  border: 2px solid #202331;
  border-radius: 50%;
  background: #fff;
}

.capture-throw span {
  animation: jar-arc 1.1s cubic-bezier(0.25, 0.9, 0.32, 1) both;
}

.capture-success span,
.capture-break span {
  left: 64%;
  top: 28%;
  animation: jar-shake 0.32s ease-in-out 3;
}

.capture-fx i,
.capture-fx b {
  position: absolute;
  display: none;
}

.capture-success i,
.capture-success b {
  display: block;
  width: 9px;
  height: 9px;
  background: #ffe45d;
  clip-path: polygon(50% 0, 62% 36%, 100% 50%, 62% 64%, 50% 100%, 38% 64%, 0 50%, 38% 36%);
  animation: star-pop 0.72s ease-out both;
}

.capture-success i { left: 57%; top: 23%; }
.capture-success b { left: 76%; top: 26%; animation-delay: 0.1s; }

.level-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 7;
  width: min(330px, calc(100% - 32px));
  transform: translate(-50%, -50%);
  border: 3px solid #202331;
  border-radius: 18px;
  padding: 16px;
  background: #fff7cf;
  box-shadow: 0 8px 0 rgba(32, 35, 49, 0.2), 0 18px 38px rgba(32, 35, 49, 0.24);
  animation: level-pop 0.48s ease-out both;
}

.level-panel strong,
.level-panel span {
  display: block;
}

.level-panel strong {
  color: #d54d5f;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.level-panel span {
  margin-top: 4px;
  font-size: 1.4rem;
  font-weight: 1000;
}

.level-panel dl,
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 12px 0 0;
}

.level-panel div,
.stat-grid div {
  border-radius: 12px;
  padding: 8px 4px;
  background: rgba(255, 255, 255, 0.74);
  text-align: center;
}

.level-panel dt,
.stat-grid dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 1000;
}

.level-panel dd,
.stat-grid dd {
  margin: 2px 0 0;
  font-size: 1.05rem;
  font-weight: 1000;
}

.dex-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-bottom: 4px;
}

.dex-card {
  min-height: 238px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.dex-card.unseen {
  opacity: 0.72;
}

.silhouette {
  width: 98px;
  height: 98px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: rgba(32, 35, 49, 0.36);
  background: rgba(32, 35, 49, 0.14);
  font-size: 2.6rem;
  font-weight: 1000;
}

.echo-preview {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 900;
}

.echo-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bubble), var(--water));
}

.party-manager {
  display: grid;
  gap: 12px;
}

.mon-detail,
.box-panel {
  padding: 14px;
}

.mon-detail {
  display: grid;
  gap: 10px;
}

.move-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  margin: 8px 0 12px;
  list-style: none;
}

.move-list li,
.box-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.move-list li {
  display: grid;
  gap: 3px;
}

.move-list span,
.box-row small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.box-row {
  width: 100%;
  min-height: 60px;
  display: grid;
  gap: 2px;
  text-align: left;
}

.settings-list {
  align-content: start;
}

.settings-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.settings-row strong {
  font-size: 1.03rem;
}

canvas {
  max-width: 100%;
  height: auto;
  image-rendering: auto;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes idle-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -9px; }
}

@keyframes enemy-enter {
  from { opacity: 0; transform: translateX(70px) scale(0.92); }
  68% { opacity: 1; transform: translateX(-6px) scale(1.08); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes attack-lunge {
  0%, 100% { transform: translate(0, 0); }
  48% { transform: translate(46px, -26px) scale(1.05); }
}

@keyframes enemy-lunge {
  0%, 100% { transform: translate(0, 0); }
  48% { transform: translate(-38px, 28px) scale(1.05); }
}

@keyframes hit-shake {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-8px); }
  70% { transform: translateX(7px); }
}

@keyframes faint-out {
  0% { opacity: 1; transform: rotate(0) translateY(0) scale(1); }
  58% { opacity: 0.72; transform: rotate(-16deg) translateY(12px) scale(0.9); }
  100% { opacity: 0; transform: rotate(24deg) translateY(36px) scale(0.62); }
}

@keyframes captured-in {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  45% { opacity: 0.86; transform: translate(38px, -28px) scale(0.56); }
  100% { opacity: 0; transform: translate(78px, -48px) scale(0.08); }
}

@keyframes dust-puff {
  from { opacity: 0.5; transform: translate(-50%, 0) scale(0.35); }
  to { opacity: 0; transform: translate(-50%, -26px) scale(1.9); }
}

@keyframes damage-rise {
  from { opacity: 0; transform: translateY(10px) scale(0.9); }
  18% { opacity: 1; }
  to { opacity: 0; transform: translateY(-34px) scale(1.08); }
}

@keyframes flash-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes jar-arc {
  0% { left: 13%; top: 78%; transform: rotate(-40deg) scale(0.8); }
  52% { left: 41%; top: 14%; transform: rotate(180deg) scale(1); }
  100% { left: 64%; top: 28%; transform: rotate(360deg) scale(1); }
}

@keyframes jar-shake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-16deg); }
  75% { transform: rotate(16deg); }
}

@keyframes star-pop {
  0% { opacity: 0; transform: scale(0.2); }
  28% { opacity: 1; transform: scale(1.7); }
  100% { opacity: 0; transform: translateY(-28px) scale(0.9); }
}

@keyframes level-pop {
  from { opacity: 0; transform: translate(-50%, -44%) scale(0.88); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes wipe-open {
  0% { clip-path: inset(0 0 0 0); }
  55% { clip-path: inset(0 0 0 0); }
  100% { clip-path: inset(0 50% 0 50%); }
}

@keyframes hp-blink {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.45); }
}

@keyframes bubble-pop {
  from { opacity: 0.9; transform: scale(0.55); }
  to { opacity: 0; transform: scale(1.45); }
}

@keyframes water-drop {
  from { opacity: 0; transform: translateY(-18px); }
  20% { opacity: 1; }
  to { opacity: 0; transform: translateY(34px); }
}

@keyframes wind-streak {
  from { opacity: 0; transform: translate(-24px, 18px); }
  25% { opacity: 1; }
  to { opacity: 0; transform: translate(34px, -24px); }
}

@keyframes metal-spark {
  from { opacity: 0; transform: scale(0.7) rotate(0); }
  40% { opacity: 1; }
  to { opacity: 0; transform: scale(1.18) rotate(8deg); }
}

@keyframes earth-burst {
  from { opacity: 0; transform: translateY(14px) scale(0.6); }
  30% { opacity: 1; }
  to { opacity: 0; transform: translateY(-18px) scale(1.45); }
}

@media (min-width: 431px) {
  body {
    display: grid;
    place-items: start center;
  }
}

@media (max-height: 760px) {
  .home-stage {
    min-height: 500px;
  }

  .lead-monster canvas {
    width: 214px !important;
    height: 214px !important;
  }

  .battle-screen {
    grid-template-rows: minmax(414px, 1fr) auto;
  }

  .battle-field {
    min-height: 414px;
  }
}
