:root {
  --bg: #f7f1df;
  --panel: #fff8eb;
  --panel-border: #3d2f24;
  --title: #1c160f;
  --text: #3e342d;
  --accent: #f18f01;
  --accent-2: #2a9d8f;
  --accent-3: #e76f51;
  --win: #1f9d55;
  --lose: #d1495b;
  --draw: #3d7ea6;
  --button-text: #111111;
  --shadow: 0 12px 0 rgba(61, 47, 36, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  position: relative;
}

.app {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
  position: relative;
}

.hero,
.learning-box,
.panel,
.menu-panel {
  background: var(--panel);
  border: 3px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 28px;
  margin-bottom: 20px;
}

.app-version {
  color: #6d6259;
  font-size: 0.95rem;
  font-weight: 800;
  margin: 0;
  bottom: 16px;
  position: fixed;
  right: 16px;
  text-align: right;
  z-index: 20;
}

.eyebrow {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-3);
  margin: 0 0 10px;
}

h1,
h2,
h3 {
  color: var(--title);
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  margin-bottom: 12px;
}

.intro,
.learning-box p,
.panel-header p,
.result,
.story-box,
.score {
  font-size: 1.05rem;
  line-height: 1.5;
}

.learning-box,
.panel,
.menu-panel {
  padding: 24px;
  margin-bottom: 20px;
}

.is-hidden {
  display: none;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.menu-btn,
.back-btn {
  border: 3px solid var(--panel-border);
  border-radius: 20px;
  box-shadow: 0 8px 0 rgba(61, 47, 36, 0.18);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.menu-btn {
  background: linear-gradient(135deg, #ffd166, #f18f01);
  color: #1c160f;
  font-size: 1.2rem;
  min-height: 110px;
  padding: 22px;
  text-align: center;
}

.back-btn {
  background: #fffdf7;
  color: var(--title);
  margin-bottom: 16px;
  padding: 10px 16px;
}

.learning-box ul {
  margin: 12px 0 0;
  padding-left: 20px;
}

.panel-header {
  margin-bottom: 18px;
}

.rps-top-bar {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.rps-top-bar h2 {
  margin-bottom: 0;
}

.choice-row,
.battle-actions {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
}

.battle-actions-wrap {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.battle-actions {
  display: grid;
  grid-template-columns: repeat(3, 92px);
  justify-content: start;
  margin-bottom: 0;
}

.ability-legend {
  align-items: center;
  display: flex;
  gap: 10px;
}

.ability-legend-item {
  align-items: center;
  background: rgba(255, 253, 247, 0.96);
  border: 3px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: 0 6px 0 rgba(61, 47, 36, 0.12);
  cursor: pointer;
  display: inline-flex;
  height: 64px;
  justify-content: center;
  padding: 0;
  width: 64px;
}

.ability-legend-item:hover {
  transform: translateY(-2px);
}

.ability-legend-item:active {
  transform: translateY(2px);
}

.ability-legend-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.versus-board {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(280px, 340px) minmax(250px, 1fr);
  align-items: start;
  gap: 16px;
  margin-bottom: 18px;
}

.rps-center-panel {
  display: grid;
  gap: 12px;
  justify-items: center;
  align-self: center;
  width: 100%;
}

.hand-card {
  align-self: start;
  aspect-ratio: 1 / 1;
  background: #dff7df;
  border: 2px solid var(--panel-border);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hand-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 209, 102, 0.25), transparent 45%),
    linear-gradient(315deg, rgba(17, 138, 178, 0.18), transparent 40%);
  pointer-events: none;
}

.winner-burst {
  position: absolute;
  inset: -20px;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.95) 0 8%, transparent 9%),
    radial-gradient(circle at 18% 28%, rgba(255, 209, 102, 0.95) 0 4%, transparent 5%),
    radial-gradient(circle at 82% 24%, rgba(239, 71, 111, 0.95) 0 4%, transparent 5%),
    radial-gradient(circle at 30% 78%, rgba(42, 157, 143, 0.95) 0 4%, transparent 5%),
    radial-gradient(circle at 74% 76%, rgba(17, 138, 178, 0.95) 0 4%, transparent 5%),
    radial-gradient(circle at 50% 50%, rgba(255, 209, 102, 0.45) 0 34%, transparent 55%);
  z-index: 0;
}

.hand-card.celebrate .winner-burst {
  animation: burst-pop 0.9s ease-out;
}

.hand-card.celebrate {
  box-shadow:
    0 0 0 3px rgba(255, 209, 102, 0.8) inset,
    0 0 28px rgba(255, 209, 102, 0.65);
}

.hand-image {
  width: min(420px, 100%);
  height: 420px;
  object-fit: contain;
  object-position: center center;
  display: block;
  margin: 0 auto 12px;
  transform-origin: center;
  position: relative;
  z-index: 1;
  border-radius: 18px;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    filter 0.22s ease;
}

.hand-image.pop {
  animation: hand-pop 0.45s ease;
}

.hand-image.swap-out {
  opacity: 0.18;
  transform: scale(0.9);
  filter: blur(2px);
}

.rps-banner {
  border: 3px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: 0 8px 0 rgba(61, 47, 36, 0.16);
  color: #fffdf7;
  display: flex;
  align-items: center;
  font-size: clamp(1.4rem, 3.6vw, 2.6rem);
  font-weight: 900;
  justify-content: center;
  letter-spacing: 1px;
  margin: 0;
  min-height: 120px;
  padding: 14px 18px;
  position: relative;
  text-align: center;
  text-transform: uppercase;
  width: 100%;
  max-width: 340px;
  z-index: 4;
  line-height: 1.08;
}

.rps-banner.neutral {
  background: #7d6b57;
}

.rps-banner.win {
  background: var(--win);
}

.rps-banner.lose {
  background: var(--lose);
}

.rps-banner.draw {
  background: var(--draw);
}

button {
  border: 3px solid var(--panel-border);
  border-radius: 18px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background 0.12s ease;
}

button:hover {
  transform: translateY(-2px);
}

button:active {
  transform: translateY(2px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
}

.choice-btn,
.big-btn {
  background: var(--accent);
  color: var(--button-text);
  box-shadow: 0 6px 0 rgba(61, 47, 36, 0.18);
}

.choice-btn {
  align-items: center;
  aspect-ratio: 1 / 1;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  justify-content: center;
  height: 280px;
  min-width: 0;
  overflow: hidden;
  padding: 10px 10px 56px;
  position: relative;
  text-align: center;
}

.choice-icon {
  left: 50%;
  border-radius: 16px;
  display: block;
  flex: 0 0 auto;
  height: 288px;
  margin-bottom: 0;
  object-fit: contain;
  object-position: center center;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 288px;
}

.choice-btn span {
  display: block;
  font-size: 1rem;
  left: 50%;
  position: absolute;
  bottom: 14px;
  transform: translateX(-50%);
  width: calc(100% - 24px);
}

.big-btn {
  padding: 14px 22px;
}

.secondary {
  background: var(--accent-2);
}

.story-box,
.result,
.score {
  margin-bottom: 0;
}

.rps-score-center {
  background: rgba(255, 253, 247, 0.9);
  border: 2px solid var(--panel-border);
  border-radius: 999px;
  display: inline-block;
  font-weight: 900;
  padding: 8px 14px;
  text-align: center;
}

.story-box {
  background: #fffdf7;
  border: 2px dashed var(--panel-border);
  border-radius: 18px;
  padding: 18px;
  margin-top: 14px;
}

.battle-board {
  background:
    linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08)),
    url("./assets/batalla-de-heroes/BG_Campo.png") center center / cover no-repeat;
  border: 3px solid var(--panel-border);
  border-radius: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
  gap: 16px;
  margin-bottom: 18px;
  overflow: hidden;
  padding: 18px;
  position: relative;
}

.battle-versus {
  color: #d62828;
  font-size: clamp(2.8rem, 8vw, 5.6rem);
  font-weight: 900;
  left: 50%;
  letter-spacing: 2px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  text-shadow:
    0 3px 0 rgba(61, 47, 36, 0.85),
    0 0 22px rgba(214, 40, 40, 0.22);
  top: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  z-index: 5;
}

.battle-versus.show {
  animation: versus-pop 0.85s ease forwards;
}

.battle-board.is-hidden,
.battle-actions.is-hidden,
.battle-actions-wrap.is-hidden,
.battle-items.is-hidden,
.battle-setup.is-hidden,
.battle-start-bar.is-hidden {
  display: none;
}


.battle-setup {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 420px));
  justify-content: center;
  margin-bottom: 18px;
}

.setup-card,
.fighter-card {
  background: rgba(255, 253, 247, 0.9);
  border: 2px solid var(--panel-border);
  border-radius: 18px;
  padding: 16px;
}

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

.select-card {
  background: #fffdf7;
  border: 3px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: 0 6px 0 rgba(61, 47, 36, 0.14);
  color: var(--title);
  min-height: 120px;
  padding: 14px 12px;
  position: relative;
  text-align: center;
}

.select-card.active {
  background: #d6f5df;
  box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.35) inset;
}

.hero-select-card.locked {
  background: #f1ece2;
  box-shadow:
    0 6px 0 rgba(61, 47, 36, 0.08),
    0 0 0 3px rgba(61, 47, 36, 0.08) inset;
}

.terrain-select-card.locked {
  background: #f1ece2;
  box-shadow:
    0 6px 0 rgba(61, 47, 36, 0.08),
    0 0 0 3px rgba(61, 47, 36, 0.08) inset;
}

.hero-select-card.locked .portrait-shell {
  filter: grayscale(1) saturate(0.25);
}

.terrain-select-card.locked .select-art {
  filter: grayscale(1);
}

.hero-select-card.locked span:not(.lock-badge) {
  color: #6d6259;
}

.terrain-select-card.locked span:not(.lock-badge) {
  color: #6d6259;
}

.lock-badge {
  align-items: center;
  background: rgba(255, 253, 247, 0.96);
  border: 2px solid var(--panel-border);
  border-radius: 999px;
  box-shadow: 0 3px 0 rgba(61, 47, 36, 0.12);
  display: inline-flex;
  font-size: 1rem;
  height: 32px;
  justify-content: center;
  position: absolute;
  right: 10px;
  top: 10px;
  width: 32px;
}

.select-art {
  display: block;
  font-size: 2rem;
  margin-bottom: 8px;
}

.terrain-preview {
  background:
    linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08)),
    url("./assets/batalla-de-heroes/BG_Campo.png") center center / cover no-repeat;
  border: 3px solid var(--panel-border);
  border-radius: 18px;
  display: block;
  height: 76px;
  margin: 0 auto 10px;
  width: 100%;
}

[data-terrain-preview="cueva"] {
  background:
    radial-gradient(circle at 50% 18%, rgba(153, 216, 255, 0.24) 0 10%, transparent 11%),
    linear-gradient(180deg, #303846 0 24%, #3b4450 24% 42%, #232b35 42% 100%);
}

[data-terrain-preview="espacio"] {
  background:
    radial-gradient(circle at 18% 24%, rgba(255, 255, 255, 0.95) 0 1.2%, transparent 1.4%),
    radial-gradient(circle at 74% 32%, rgba(255, 255, 255, 0.92) 0 1%, transparent 1.2%),
    radial-gradient(circle at 56% 66%, rgba(255, 255, 255, 0.9) 0 1.1%, transparent 1.3%),
    linear-gradient(180deg, #0b102b 0, #27154b 55%, #4a1875 100%);
}

[data-terrain-preview="ciudad"] {
  background:
    linear-gradient(180deg, #ffbf94 0 28%, #86abd1 28% 58%, #48556e 58% 100%),
    linear-gradient(90deg, transparent 0 8%, rgba(34, 40, 54, 0.78) 8% 14%, transparent 14% 22%, rgba(47, 55, 70, 0.8) 22% 31%, transparent 31% 100%);
}

[data-terrain-preview="volcan"] {
  background:
    radial-gradient(circle at 50% 80%, rgba(255, 180, 82, 0.95) 0 12%, transparent 13%),
    radial-gradient(circle at 50% 78%, rgba(255, 108, 57, 0.9) 0 20%, transparent 21%),
    linear-gradient(180deg, #4d121a 0 24%, #7c241f 24% 54%, #2e2020 54% 100%);
}

[data-terrain-preview="mar"] {
  background:
    linear-gradient(180deg, #a7e6ff 0 26%, #70caef 26% 44%, #2796ca 44% 70%, #0d5890 70% 100%),
    radial-gradient(ellipse at 22% 62%, rgba(255, 255, 255, 0.18) 0 12%, transparent 13%);
}

.portrait-shell {
  align-items: center;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.95) 0 12%, transparent 13%),
    linear-gradient(180deg, var(--portrait-a), var(--portrait-b));
  border: 3px solid var(--panel-border);
  border-radius: 20px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
  display: flex;
  height: 82px;
  justify-content: center;
  margin: 0 auto 10px;
  overflow: hidden;
  position: relative;
  width: 82px;
}

.portrait-shell.enemy {
  transform: scale(1.02);
}

.portrait-aura {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.45) 0 28%, transparent 60%);
  height: 110px;
  position: absolute;
  width: 110px;
}

.portrait-core {
  font-size: 2.4rem;
  position: relative;
  transform: translateY(2px);
  z-index: 2;
}

.portrait-image {
  display: block;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  position: relative;
  width: 100%;
  z-index: 2;
}

.portrait-squad {
  align-items: end;
  display: flex;
  gap: 2px;
  height: 100%;
  justify-content: center;
  padding: 4px 2px 0;
  position: relative;
  width: 100%;
  z-index: 2;
}

.squad-member {
  align-items: end;
  display: flex;
  flex: 1 1 0;
  height: 100%;
  justify-content: center;
  min-width: 0;
  position: relative;
}

.squad-life {
  background: rgba(255, 253, 247, 0.96);
  border: 2px solid var(--panel-border);
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(61, 47, 36, 0.12);
  color: var(--title);
  font-size: 0.72rem;
  font-weight: 900;
  left: 50%;
  line-height: 1;
  padding: 4px 8px;
  position: absolute;
  top: -8px;
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 4;
}

.squad-member-2 {
  transform: scale(1.06);
  z-index: 2;
}

.squad-member-1,
.squad-member-3 {
  opacity: 0.96;
  transform: translateY(8px) scale(0.88);
}

.portrait-squad .portrait-creature,
.portrait-squad .portrait-figure {
  transform-origin: center bottom;
}

.hero-grid .portrait-shell.has-image {
  padding: 4px;
}

.hero-grid .portrait-aura {
  display: none;
}

.hero-grid .portrait-image {
  object-fit: contain;
  object-position: center center;
  transform: scale(1.2);
}

.portrait-creature {
  display: block;
  height: 72px;
  position: relative;
  width: 60px;
  z-index: 2;
}

.creature-back,
.creature-body,
.creature-detail,
.creature-eye {
  position: absolute;
}

.creature-body {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 28%), linear-gradient(180deg, var(--portrait-a), var(--portrait-b));
  border: 2px solid rgba(61, 47, 36, 0.42);
  left: 10px;
  top: 14px;
}

.creature-back {
  background: var(--creature-accent);
  opacity: 0.88;
}

.creature-detail {
  background: var(--creature-accent);
}

.creature-eye {
  background: var(--creature-face);
  border-radius: 999px;
  height: 4px;
  top: 34px;
  width: 4px;
  z-index: 3;
}

.portrait-creature .eye-left {
  left: 24px;
}

.portrait-creature .eye-right {
  right: 24px;
}

.portrait-creature.wolf .creature-body,
.portrait-creature.lion .creature-body,
.portrait-creature.lizard .creature-body {
  border-radius: 22px 22px 18px 18px;
  height: 34px;
  width: 40px;
}

.portrait-creature.wolf .creature-back,
.portrait-creature.lion .creature-back {
  border-radius: 999px;
  height: 24px;
  left: 6px;
  top: 10px;
  width: 48px;
}

.portrait-creature.wolf .detail-a,
.portrait-creature.lion .detail-a {
  border-radius: 999px 999px 4px 4px;
  height: 16px;
  left: 13px;
  top: 8px;
  transform: rotate(-12deg);
  width: 10px;
}

.portrait-creature.wolf .detail-b,
.portrait-creature.lion .detail-b {
  border-radius: 999px 999px 4px 4px;
  height: 16px;
  right: 13px;
  top: 8px;
  transform: rotate(12deg);
  width: 10px;
}

.portrait-creature.lion .creature-back {
  box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.24);
}

.portrait-creature.rock .creature-body,
.portrait-creature.crystal .creature-body {
  border-radius: 28px 28px 20px 20px;
  height: 38px;
  width: 42px;
}

.portrait-creature.rock .detail-a,
.portrait-creature.rock .detail-b {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  height: 6px;
  top: 28px;
  width: 12px;
}

.portrait-creature.rock .detail-a {
  left: 16px;
}

.portrait-creature.rock .detail-b {
  right: 16px;
}

.portrait-creature.crystal .creature-body {
  clip-path: polygon(50% 0%, 88% 20%, 100% 55%, 72% 100%, 28% 100%, 0% 55%, 12% 20%);
}

.portrait-creature.crystal .creature-back {
  background: rgba(255, 255, 255, 0.18);
  clip-path: polygon(50% 0%, 100% 40%, 70% 100%, 30% 100%, 0% 40%);
  height: 36px;
  left: 14px;
  top: 8px;
  width: 32px;
}

.portrait-creature.robot .creature-body {
  border-radius: 12px;
  height: 34px;
  width: 40px;
}

.portrait-creature.robot .creature-back {
  border: 2px solid rgba(61, 47, 36, 0.35);
  border-radius: 10px;
  height: 14px;
  left: 17px;
  top: 4px;
  width: 26px;
}

.portrait-creature.robot .detail-a,
.portrait-creature.robot .detail-b {
  border-radius: 999px;
  height: 18px;
  top: 24px;
  width: 7px;
}

.portrait-creature.robot .detail-a {
  left: 7px;
}

.portrait-creature.robot .detail-b {
  right: 7px;
}

.portrait-creature.octopus .creature-body,
.portrait-creature.alien .creature-body,
.portrait-creature.pumpkin .creature-body,
.portrait-creature.coral .creature-body,
.portrait-creature.flame .creature-body {
  border-radius: 22px;
  height: 34px;
  width: 40px;
}

.portrait-creature.octopus .detail-a,
.portrait-creature.octopus .detail-b,
.portrait-creature.coral .detail-a,
.portrait-creature.coral .detail-b {
  border-radius: 999px;
  height: 18px;
  top: 42px;
  width: 8px;
}

.portrait-creature.octopus .detail-a,
.portrait-creature.coral .detail-a {
  left: 18px;
}

.portrait-creature.octopus .detail-b,
.portrait-creature.coral .detail-b {
  right: 18px;
}

.portrait-creature.alien .creature-body {
  border-radius: 50% 50% 42% 42%;
}

.portrait-creature.alien .creature-back {
  border-radius: 999px;
  height: 10px;
  left: 18px;
  top: 4px;
  width: 24px;
}

.portrait-creature.pumpkin .detail-a,
.portrait-creature.pumpkin .detail-b,
.portrait-creature.flame .detail-a,
.portrait-creature.flame .detail-b {
  border-radius: 999px 999px 6px 6px;
  height: 14px;
  top: 8px;
  width: 10px;
}

.portrait-creature.pumpkin .detail-a,
.portrait-creature.flame .detail-a {
  left: 16px;
}

.portrait-creature.pumpkin .detail-b,
.portrait-creature.flame .detail-b {
  right: 16px;
}

.portrait-creature.bat .creature-body,
.portrait-creature.shark .creature-body {
  border-radius: 18px 18px 14px 14px;
  height: 26px;
  top: 22px;
  width: 34px;
}

.portrait-creature.bat .creature-back,
.portrait-creature.shark .creature-back {
  background: linear-gradient(180deg, var(--creature-accent), transparent);
  height: 24px;
  top: 22px;
  width: 20px;
}

.portrait-creature.bat .creature-back {
  left: 0;
  clip-path: polygon(100% 0%, 0% 50%, 100% 100%);
}

.portrait-creature.bat .detail-a {
  right: 0;
  top: 22px;
  clip-path: polygon(0% 0%, 100% 50%, 0% 100%);
  height: 24px;
  width: 20px;
}

.portrait-creature.bat .detail-b {
  background: var(--creature-accent);
  border-radius: 999px 999px 4px 4px;
  height: 10px;
  left: 22px;
  top: 12px;
  width: 16px;
}

.portrait-creature.shark .creature-back {
  left: 8px;
  top: 10px;
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.portrait-creature.shark .detail-a {
  background: var(--creature-accent);
  clip-path: polygon(0% 50%, 100% 0%, 100% 100%);
  height: 18px;
  right: 2px;
  top: 26px;
  width: 16px;
}

.portrait-creature.shark .detail-b {
  background: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  height: 8px;
  left: 20px;
  top: 36px;
  width: 20px;
}

.portrait-figure {
  display: block;
  height: 74px;
  position: relative;
  width: 44px;
  z-index: 2;
}

.portrait-figure.playmobil .figure-head {
  border-radius: 999px 999px 18px 18px;
  height: 20px;
  left: 12px;
  width: 20px;
}

.portrait-figure.playmobil .figure-hair {
  border-radius: 999px 999px 8px 8px;
  height: 11px;
  left: 11px;
  width: 22px;
}

.portrait-figure.playmobil .figure-body {
  border-radius: 14px 14px 10px 10px;
  height: 30px;
  left: 12px;
  top: 19px;
  width: 20px;
}

.portrait-figure.playmobil .figure-arm {
  border-radius: 999px;
  height: 20px;
  top: 23px;
  width: 9px;
}

.portrait-figure.playmobil .arm-left {
  left: 6px;
  transform: rotate(8deg);
}

.portrait-figure.playmobil .arm-right {
  right: 6px;
  transform: rotate(-8deg);
}

.portrait-figure.playmobil .figure-leg {
  border-radius: 999px 999px 8px 8px;
  height: 24px;
  top: 46px;
  width: 9px;
}

.portrait-figure.playmobil .leg-left {
  left: 12px;
}

.portrait-figure.playmobil .leg-right {
  right: 12px;
}

.portrait-figure.playmobil .figure-arm::after,
.portrait-figure.playmobil .figure-leg::after {
  background: currentColor;
  border-radius: 999px;
  content: "";
  position: absolute;
}

.portrait-figure.playmobil .figure-arm::after {
  background: var(--figure-skin);
  bottom: -2px;
  height: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
}

.portrait-figure.playmobil .figure-leg::after {
  background: rgba(61, 47, 36, 0.7);
  bottom: -2px;
  height: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 11px;
}

.figure-head {
  background: var(--figure-skin);
  border: 2px solid rgba(61, 47, 36, 0.45);
  border-radius: 999px;
  height: 18px;
  left: 13px;
  position: absolute;
  top: 2px;
  width: 18px;
}

.figure-hair {
  background: var(--figure-hair);
  border-radius: 999px 999px 8px 8px;
  height: 10px;
  left: 12px;
  position: absolute;
  top: 1px;
  width: 20px;
}

.figure-eye {
  background: #1f160f;
  border-radius: 999px;
  height: 2px;
  position: absolute;
  top: 12px;
  width: 2px;
}

.eye-left {
  left: 19px;
}

.eye-right {
  right: 19px;
}

.figure-cape {
  background: var(--figure-cape);
  border-radius: 12px 12px 18px 18px;
  height: 34px;
  left: 9px;
  opacity: 0.85;
  position: absolute;
  top: 18px;
  width: 26px;
}

.figure-body {
  background: linear-gradient(180deg, var(--figure-trim) 0 22%, var(--figure-suit) 22% 100%);
  border: 2px solid rgba(61, 47, 36, 0.45);
  border-radius: 12px 12px 10px 10px;
  height: 28px;
  left: 13px;
  position: absolute;
  top: 20px;
  width: 18px;
}

.figure-belt {
  background: #f8fafc;
  border-radius: 999px;
  height: 4px;
  left: 13px;
  position: absolute;
  top: 36px;
  width: 18px;
}

.figure-arm,
.figure-leg {
  background: var(--figure-suit);
  border: 2px solid rgba(61, 47, 36, 0.45);
  border-radius: 999px;
  position: absolute;
}

.figure-arm {
  height: 22px;
  top: 22px;
  width: 8px;
}

.arm-left {
  left: 8px;
  transform: rotate(18deg);
}

.arm-right {
  right: 8px;
  transform: rotate(-18deg);
}

.figure-leg {
  height: 24px;
  top: 46px;
  width: 8px;
}

.leg-left {
  left: 14px;
}

.leg-right {
  right: 14px;
}

.portrait-placeholder {
  align-items: center;
  background: rgba(255, 255, 255, 0.55);
  border: 3px dashed var(--panel-border);
  border-radius: 22px;
  display: flex;
  font-size: 2.4rem;
  height: 100%;
  justify-content: center;
  width: 100%;
}

.select-subtitle {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  margin-top: 6px;
}

.battle-start-bar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.music-controls {
  align-items: center;
  background: rgba(255, 253, 247, 0.92);
  border: 3px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: 0 6px 0 rgba(61, 47, 36, 0.12);
  display: flex;
  gap: 12px;
  padding: 10px 12px;
}

.music-toggle-btn {
  margin-bottom: 0;
  white-space: nowrap;
}

.music-volume-control {
  align-items: center;
  display: flex;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 800;
}

.music-volume-control input {
  accent-color: var(--accent-3);
  width: 120px;
}

.battle-top-bar {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.top-back-btn {
  margin-bottom: 0;
}

.battle-shop {
  margin-bottom: 18px;
}

.dungeon-map {
  margin-bottom: 18px;
}

.map-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.map-track {
  display: block;
  margin: 8px 0 18px;
}

.map-board {
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.4) 0 5%, transparent 6%),
    radial-gradient(circle at 82% 16%, rgba(255, 255, 255, 0.32) 0 4%, transparent 5%),
    linear-gradient(180deg, #d8d1bd, #c9c0ac);
  border: 3px solid rgba(61, 47, 36, 0.4);
  border-radius: 22px;
  min-height: 690px;
  overflow: hidden;
  padding: 20px 20px 28px;
  position: relative;
}

.map-root-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}

.map-root-wrap::after {
  background: rgba(61, 47, 36, 0.35);
  content: "";
  height: 26px;
  left: 50%;
  position: absolute;
  top: 56px;
  transform: translateX(-50%);
  width: 4px;
}

.map-routes-row {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 36px;
  position: relative;
  z-index: 1;
}

.map-routes-row::before,
.map-routes-row::after {
  background: rgba(61, 47, 36, 0.32);
  content: "";
  height: 4px;
  position: absolute;
  top: -30px;
  width: 132px;
}

.map-routes-row::before {
  left: calc(50% - 126px);
  transform: rotate(-22deg);
  transform-origin: right center;
}

.map-routes-row::after {
  right: calc(50% - 126px);
  transform: rotate(22deg);
  transform-origin: left center;
}

.map-node {
  align-items: center;
  background: #fffdf7;
  border: 3px solid var(--panel-border);
  border-radius: 999px;
  box-shadow: 0 6px 0 rgba(61, 47, 36, 0.14);
  display: flex;
  font-size: 1.5rem;
  height: 56px;
  justify-content: center;
  position: relative;
  width: 56px;
}

.map-route-column {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding-top: 6px;
}

.map-route-column.active .map-node {
  filter: none;
}

.map-route-column:not(.active) .map-node {
  opacity: 0.92;
}

.map-route-column .map-node::after {
  background: repeating-linear-gradient(
    to bottom,
    rgba(61, 47, 36, 0.35) 0 6px,
    transparent 6px 14px
  );
  content: "";
  height: 22px;
  left: 50%;
  position: absolute;
  top: calc(100% + 4px);
  transform: translateX(-50%);
  width: 4px;
}

.final-boss-wrap {
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.final-boss-wrap::before,
.final-boss-wrap::after {
  background: repeating-linear-gradient(
    to right,
    rgba(61, 47, 36, 0.32) 0 6px,
    transparent 6px 14px
  );
  content: "";
  height: 4px;
  position: absolute;
  top: -18px;
  width: 128px;
}

.final-boss-wrap::before {
  left: calc(50% - 132px);
  transform: rotate(28deg);
  transform-origin: right center;
}

.final-boss-wrap::after {
  right: calc(50% - 132px);
  transform: rotate(-28deg);
  transform-origin: left center;
}

.final-boss-node {
  font-size: 2.3rem;
  height: 82px;
  width: 82px;
}

.final-boss-node::before {
  background: repeating-linear-gradient(
    to bottom,
    rgba(61, 47, 36, 0.35) 0 6px,
    transparent 6px 14px
  );
  content: "";
  height: 24px;
  left: 50%;
  position: absolute;
  top: -24px;
  transform: translateX(-50%);
  width: 4px;
}

.map-route-column .map-node:last-child::after {
  display: none;
}

.map-node-btn {
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background 0.12s ease;
}

.map-node-btn:hover {
  transform: scale(1.08);
}

.map-node.current {
  background: #fff3bf;
  transform: scale(1.08);
}

.map-node.done {
  background: #d6f5df;
}

.shop-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.shop-btn {
  min-height: 0;
}

#shop-inventory {
  font-weight: 700;
  margin: 12px 0 0;
}

#shop-coins {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.4px;
  margin: 0 0 14px;
}

.battle-fighter {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: #1f160f;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 360px;
  padding: 104px 0 72px;
  position: relative;
  text-align: center;
}

#battle-player-card {
  order: 1;
}

#battle-enemy-card {
  order: 2;
}

.fighter-stats {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: center;
  width: 100%;
}

.status-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  min-height: 34px;
  width: 100%;
}

.status-pill {
  align-items: center;
  background: rgba(255, 253, 247, 0.96);
  border: 2px solid var(--panel-border);
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(61, 47, 36, 0.12);
  display: inline-flex;
  font-size: 1rem;
  font-weight: 900;
  justify-content: center;
  line-height: 1;
  min-width: 34px;
  padding: 6px 10px;
}

.life-bar {
  background: rgba(255, 255, 255, 0.72);
  border: 2px solid var(--panel-border);
  border-radius: 999px;
  height: 24px;
  margin: 0 0 14px;
  max-width: 240px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.shield-counter {
  align-items: center;
  background: rgba(214, 240, 255, 0.95);
  border: 2px solid var(--panel-border);
  border-radius: 999px;
  display: inline-flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 14px;
  min-width: 70px;
  padding: 4px 10px;
}

.shield-counter-icon {
  font-size: 1rem;
  line-height: 1;
}

.shield-counter-value {
  color: #1c160f;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1;
}

.fighter-top {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
  z-index: 6;
}

.life-bar-fill {
  background: linear-gradient(90deg, #56c271, #b8f28a);
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  transition: width 0.2s ease;
  width: 0%;
}

.life-bar-fill.enemy {
  background: linear-gradient(90deg, #f36f6f, #ffb173);
}

.life-bar-text {
  color: #1c160f;
  font-size: 0.95rem;
  font-weight: 900;
  inset: 0;
  letter-spacing: 0.4px;
  line-height: 20px;
  margin: auto;
  position: absolute;
  text-align: center;
  z-index: 1;
}

.enemy-intent {
  align-items: center;
  background: rgba(255, 243, 191, 0.95);
  border: 2px solid var(--panel-border);
  border-radius: 999px;
  display: flex;
  font-size: 1.05rem;
  font-weight: 900;
  height: 52px;
  justify-content: center;
  left: 50%;
  min-width: 52px;
  padding: 0 12px;
  position: absolute;
  bottom: 6px;
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 6;
}

.enemy-intent.is-hidden,
.player-intent.is-hidden {
  display: none;
}

.player-intent {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: 1.4rem;
  font-weight: 900;
  min-width: 0;
  padding: 0;
}

.fighter-art {
  align-items: center;
  display: flex;
  height: 220px;
  justify-content: center;
  margin: 0 auto 8px;
  position: relative;
  width: 100%;
}

.fighter-art.attack-left {
  animation: lunge-left 0.55s ease;
}

.fighter-art.attack-right {
  animation: lunge-right 0.55s ease;
}

.shield-visual {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.28) 0 34%, rgba(110, 231, 255, 0.2) 35% 56%, transparent 57%),
    linear-gradient(180deg, rgba(147, 197, 253, 0.28), rgba(34, 211, 238, 0.12));
  border: 3px solid rgba(191, 219, 254, 0.88);
  border-radius: 999px 999px 28px 28px;
  box-shadow:
    0 0 20px rgba(125, 211, 252, 0.38),
    inset 0 0 18px rgba(255, 255, 255, 0.35);
  height: 168px;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 36px;
  transform: translateX(-50%) scale(0.76);
  transition: opacity 0.18s ease;
  width: 124px;
  z-index: 3;
}

.shield-visual.show {
  animation: shield-pop 0.55s ease;
  opacity: 1;
}

.fighter-art .portrait-shell {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  height: 100%;
  margin-bottom: 0;
  width: 100%;
  z-index: 2;
}

.fighter-art .portrait-aura {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.38) 0 22%, transparent 58%);
  height: 190px;
  width: 190px;
}

.fighter-art .portrait-core {
  font-size: 6rem;
  transform: translateY(6px);
}

.fighter-art .portrait-image {
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  transform: scale(1.18);
  width: 100%;
}

#player-art .portrait-image {
  transform: scale(1.55);
}

.fighter-art .portrait-squad {
  gap: 10px;
  padding-top: 10px;
}

.fighter-art .portrait-squad .squad-member-2 {
  transform: scale(1.18);
}

.fighter-art .portrait-squad .squad-member-1,
.fighter-art .portrait-squad .squad-member-3 {
  transform: translateY(16px) scale(0.92);
}

.fighter-art .portrait-squad .portrait-image {
  transform: scale(1.05);
}

.fighter-art .portrait-squad .portrait-creature {
  transform: scale(1.2);
}

.fighter-art .portrait-squad .squad-life {
  font-size: 0.82rem;
  top: -2px;
}

#enemy-art .portrait-shell.squad {
  overflow: visible;
}

#enemy-art .portrait-shell.formation-wolf-boss .portrait-squad {
  align-items: end;
  gap: 16px;
  padding-top: 0;
}

#enemy-art .portrait-shell.formation-wolf-boss .portrait-squad .squad-member-2 {
  transform: translateY(-24px) scale(1.34);
  z-index: 3;
}

#enemy-art .portrait-shell.formation-wolf-boss .portrait-squad .squad-member-1,
#enemy-art .portrait-shell.formation-wolf-boss .portrait-squad .squad-member-3 {
  transform: translateY(10px) scale(1.04);
  z-index: 2;
}

#enemy-art .portrait-shell.formation-wolf-boss .portrait-squad .squad-member-1 .portrait-image,
#enemy-art .portrait-shell.formation-wolf-boss .portrait-squad .squad-member-3 .portrait-image {
  transform: scale(1.12);
}

.combat-line-board {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: center;
  padding: 8px 0 4px;
}

.combat-line-start {
  align-items: center;
  background: #fff3bf;
  border: 3px solid var(--panel-border);
  border-radius: 999px;
  box-shadow: 0 6px 0 rgba(61, 47, 36, 0.14);
  display: flex;
  font-size: 1.5rem;
  height: 60px;
  justify-content: center;
  width: 60px;
}

.combat-line-track {
  align-items: center;
  display: flex;
  gap: 30px;
  position: relative;
}

.combat-line-track::before {
  background: linear-gradient(90deg, rgba(61, 47, 36, 0.25), rgba(61, 47, 36, 0.35));
  content: "";
  height: 4px;
  left: 12px;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 0;
}

.combat-line-node {
  position: relative;
  z-index: 1;
}

.target-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 10px 0 0;
}

.target-btn {
  background: #fff7d6;
  border: 3px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: 0 6px 0 rgba(61, 47, 36, 0.14);
  color: var(--title);
  min-width: 120px;
  padding: 10px 14px;
}

.target-btn-name,
.target-btn-life {
  display: block;
}

.target-btn-name {
  font-size: 0.95rem;
  font-weight: 900;
}

.target-btn-life {
  font-size: 0.88rem;
  margin-top: 4px;
}

.fighter-art .portrait-figure {
  height: 188px;
  width: 118px;
}

.fighter-art .portrait-figure.playmobil .figure-head {
  height: 44px;
  left: 37px;
  width: 44px;
}

.fighter-art .portrait-figure.playmobil .figure-hair {
  height: 24px;
  left: 35px;
  width: 48px;
}

.fighter-art .portrait-figure.playmobil .figure-body {
  height: 72px;
  left: 36px;
  top: 42px;
  width: 46px;
}

.fighter-art .portrait-figure.playmobil .figure-arm {
  height: 54px;
  top: 46px;
  width: 16px;
}

.fighter-art .portrait-figure.playmobil .arm-left {
  left: 18px;
}

.fighter-art .portrait-figure.playmobil .arm-right {
  right: 18px;
}

.fighter-art .portrait-figure.playmobil .figure-leg {
  height: 66px;
  top: 108px;
  width: 18px;
}

.fighter-art .portrait-figure.playmobil .leg-left {
  left: 36px;
}

.fighter-art .portrait-figure.playmobil .leg-right {
  right: 36px;
}

.fighter-art .portrait-figure.playmobil .figure-arm::after {
  bottom: -4px;
  height: 12px;
  width: 12px;
}

.fighter-art .portrait-figure.playmobil .figure-leg::after {
  bottom: -3px;
  height: 8px;
  width: 20px;
}

.fighter-art .portrait-creature {
  height: 176px;
  width: 152px;
}

.fighter-art .portrait-creature .creature-body {
  border-width: 3px;
  left: 26px;
  top: 32px;
}

.fighter-art .portrait-creature .creature-eye {
  height: 8px;
  top: 78px;
  width: 8px;
}

.fighter-art .portrait-creature .eye-left {
  left: 56px;
}

.fighter-art .portrait-creature .eye-right {
  right: 56px;
}

.fighter-art .portrait-creature.wolf .creature-body,
.fighter-art .portrait-creature.lion .creature-body,
.fighter-art .portrait-creature.lizard .creature-body,
.fighter-art .portrait-creature.rock .creature-body,
.fighter-art .portrait-creature.crystal .creature-body,
.fighter-art .portrait-creature.octopus .creature-body,
.fighter-art .portrait-creature.alien .creature-body,
.fighter-art .portrait-creature.pumpkin .creature-body,
.fighter-art .portrait-creature.coral .creature-body,
.fighter-art .portrait-creature.flame .creature-body,
.fighter-art .portrait-creature.robot .creature-body {
  height: 78px;
  width: 96px;
}

.fighter-art .portrait-creature.bat .creature-body,
.fighter-art .portrait-creature.shark .creature-body {
  height: 58px;
  width: 84px;
}

.fighter-art .portrait-creature.wolf .creature-back,
.fighter-art .portrait-creature.lion .creature-back {
  height: 48px;
  left: 18px;
  top: 20px;
  width: 116px;
}

.fighter-art .portrait-creature.wolf .detail-a,
.fighter-art .portrait-creature.wolf .detail-b,
.fighter-art .portrait-creature.lion .detail-a,
.fighter-art .portrait-creature.lion .detail-b {
  height: 28px;
  top: 18px;
  width: 18px;
}

.fighter-art .portrait-creature.wolf .detail-a,
.fighter-art .portrait-creature.lion .detail-a {
  left: 34px;
}

.fighter-art .portrait-creature.wolf .detail-b,
.fighter-art .portrait-creature.lion .detail-b {
  right: 34px;
}

.fighter-art .portrait-creature.lion .creature-back {
  box-shadow: 0 0 0 16px rgba(245, 158, 11, 0.24);
}

.fighter-art .portrait-creature.robot .creature-back {
  border-width: 3px;
  height: 26px;
  left: 48px;
  top: 10px;
  width: 54px;
}

.fighter-art .portrait-creature.robot .detail-a,
.fighter-art .portrait-creature.robot .detail-b,
.fighter-art .portrait-creature.octopus .detail-a,
.fighter-art .portrait-creature.octopus .detail-b,
.fighter-art .portrait-creature.coral .detail-a,
.fighter-art .portrait-creature.coral .detail-b {
  height: 34px;
  top: 96px;
  width: 12px;
}

.fighter-art .portrait-creature.robot .detail-a {
  left: 18px;
  top: 54px;
}

.fighter-art .portrait-creature.robot .detail-b {
  right: 18px;
  top: 54px;
}

.fighter-art .portrait-creature.octopus .detail-a,
.fighter-art .portrait-creature.coral .detail-a {
  left: 42px;
}

.fighter-art .portrait-creature.octopus .detail-b,
.fighter-art .portrait-creature.coral .detail-b {
  right: 42px;
}

.fighter-art .portrait-creature.alien .creature-back {
  height: 22px;
  left: 44px;
  top: 8px;
  width: 64px;
}

.fighter-art .portrait-creature.pumpkin .detail-a,
.fighter-art .portrait-creature.pumpkin .detail-b,
.fighter-art .portrait-creature.flame .detail-a,
.fighter-art .portrait-creature.flame .detail-b {
  height: 24px;
  top: 18px;
  width: 18px;
}

.fighter-art .portrait-creature.pumpkin .detail-a,
.fighter-art .portrait-creature.flame .detail-a {
  left: 42px;
}

.fighter-art .portrait-creature.pumpkin .detail-b,
.fighter-art .portrait-creature.flame .detail-b {
  right: 42px;
}

.fighter-art .portrait-creature.bat .creature-back {
  height: 50px;
  left: 2px;
  top: 42px;
  width: 44px;
}

.fighter-art .portrait-creature.bat .detail-a {
  height: 50px;
  right: 2px;
  top: 42px;
  width: 44px;
}

.fighter-art .portrait-creature.bat .detail-b {
  height: 18px;
  left: 56px;
  top: 18px;
  width: 38px;
}

.fighter-art .portrait-creature.shark .creature-back {
  height: 38px;
  left: 44px;
  top: 10px;
  width: 30px;
}

.fighter-art .portrait-creature.shark .detail-a {
  height: 30px;
  right: 12px;
  top: 56px;
  width: 26px;
}

.fighter-art .portrait-creature.shark .detail-b {
  height: 14px;
  left: 52px;
  top: 72px;
  width: 42px;
}

.fighter-art .portrait-figure .figure-head {
  border-width: 3px;
  height: 40px;
  left: 39px;
  top: 0;
  width: 40px;
}

.fighter-art .portrait-figure .figure-hair {
  height: 22px;
  left: 37px;
  top: -1px;
  width: 44px;
}

.fighter-art .portrait-figure .figure-eye {
  height: 4px;
  top: 24px;
  width: 4px;
}

.fighter-art .portrait-figure .eye-left {
  left: 52px;
}

.fighter-art .portrait-figure .eye-right {
  right: 52px;
}

.fighter-art .portrait-figure .figure-cape {
  height: 82px;
  left: 27px;
  top: 32px;
  width: 64px;
}

.fighter-art .portrait-figure .figure-body {
  border-width: 3px;
  height: 66px;
  left: 38px;
  top: 42px;
  width: 42px;
}

.fighter-art .portrait-figure .figure-belt {
  height: 8px;
  left: 38px;
  top: 76px;
  width: 42px;
}

.fighter-art .portrait-figure .figure-arm {
  border-width: 3px;
  height: 58px;
  top: 46px;
  width: 14px;
}

.fighter-art .portrait-figure .arm-left {
  left: 24px;
}

.fighter-art .portrait-figure .arm-right {
  right: 24px;
}

.fighter-art .portrait-figure .figure-leg {
  border-width: 3px;
  height: 68px;
  top: 108px;
  width: 16px;
}

.fighter-art .portrait-figure .leg-left {
  left: 40px;
}

.fighter-art .portrait-figure .leg-right {
  right: 40px;
}

.fighter-art .portrait-shell.full-body .portrait-core {
  font-size: 6.6rem;
  transform: translateY(18px);
}

.fighter-art .portrait-shell.full-body .portrait-aura {
  height: 205px;
  width: 205px;
}

.battle-fighter h3 {
  background: rgba(255, 253, 247, 0.82);
  border: 2px solid var(--panel-border);
  border-radius: 999px;
  display: inline-block;
  margin: 0;
  padding: 6px 14px;
}

.battle-action-btn {
  align-items: center;
  aspect-ratio: 1 / 1;
  display: flex;
  font-size: 1.95rem;
  justify-content: center;
  min-width: 0;
  padding: 0;
  white-space: nowrap;
}

#ability-btn {
  font-size: 1.4rem;
  letter-spacing: -0.4px;
}

@keyframes lunge-left {
  0% { transform: translateX(0) scale(1); }
  35% { transform: translateX(32px) scale(1.05); }
  70% { transform: translateX(44px) scale(1.02); }
  100% { transform: translateX(0) scale(1); }
}

@keyframes lunge-right {
  0% { transform: translateX(0) scale(1); }
  35% { transform: translateX(-32px) scale(1.05); }
  70% { transform: translateX(-44px) scale(1.02); }
  100% { transform: translateX(0) scale(1); }
}

@keyframes shield-pop {
  0% { opacity: 0; transform: translateX(-50%) scale(0.62); }
  40% { opacity: 1; transform: translateX(-50%) scale(1.05); }
  100% { opacity: 1; transform: translateX(-50%) scale(1); }
}

.battle-controls {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.battle-items {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.battle-item-btn {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 10px;
  margin-bottom: 0;
  padding: 10px 14px;
}

.item-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.item-icon.mega {
  font-size: 1.5rem;
}

.item-count {
  font-size: 1rem;
  font-weight: 900;
  min-width: 1ch;
}

@keyframes hand-pop {
  0% {
    opacity: 0.35;
    transform: scale(0.65) rotate(-10deg);
  }

  60% {
    opacity: 1;
    transform: scale(1.08) rotate(4deg);
  }

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

@keyframes burst-pop {
  0% {
    opacity: 0;
    transform: scale(0.4) rotate(-12deg);
  }

  35% {
    opacity: 1;
    transform: scale(1.06) rotate(0deg);
  }

  100% {
    opacity: 0;
    transform: scale(1.18) rotate(10deg);
  }
}

@keyframes versus-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4);
  }

  25% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  62% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.16);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.34);
  }
}

@media (max-width: 640px) {
  .app {
    width: min(100% - 20px, 980px);
    padding-top: 20px;
  }

  .versus-board {
    grid-template-columns: 1fr;
  }

  #player-hand-card {
    order: 3;
  }

  #rps-banner {
    order: 2;
    min-height: 88px;
  }

  #computer-hand-card {
    order: 1;
  }

  .hero,
  .learning-box,
  .panel,
  .menu-panel {
    padding: 18px;
    border-radius: 18px;
  }

  .menu-btn,
  .back-btn,
  .big-btn {
    width: 100%;
  }

  .battle-actions {
    grid-template-columns: repeat(3, 78px);
  }

  .battle-controls {
    align-items: stretch;
    flex-direction: column;
  }

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

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

  .battle-top-bar,
  .battle-start-bar,
  .music-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .music-volume-control {
    justify-content: space-between;
  }

  .music-volume-control input {
    width: 100%;
  }

  .choice-icon {
    height: 58px;
    width: 58px;
  }
}
