:root {
  --bg-top: #120e11;
  --bg-mid: #23181a;
  --bg-bottom: #080709;
  --panel-line: rgba(255, 227, 173, 0.16);
  --bronze: #c28b45;
  --bronze-bright: #f7cf7d;
  --ember: #ff7a54;
  --text: #f8f2e9;
  --muted: #c8bba8;
  --surface-radius: 28px;
  --board-inset: 11.6%;
  --move-time: 560ms;
  --ease-heavy: cubic-bezier(0.18, 0.86, 0.24, 1);
  --ease-soft: cubic-bezier(0.22, 0.61, 0.36, 1);
  --display-font: "Baskerville Old Face", Baskerville, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --body-font: "Trebuchet MS", "Segoe UI", Verdana, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top center, rgba(196, 130, 73, 0.16), transparent 34%),
    radial-gradient(circle at 18% 20%, rgba(255, 139, 82, 0.08), transparent 26%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 50%, var(--bg-bottom) 100%);
  font-family: var(--body-font);
}

body {
  overflow-x: hidden;
}

button {
  font: inherit;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  padding: 32px clamp(18px, 4vw, 48px) 42px;
}

.app-shell.menu-open .hud,
.app-shell.menu-open .arena {
  filter: blur(8px) saturate(0.8);
  pointer-events: none;
  user-select: none;
}

.scene-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 143, 64, 0.16), transparent 20%),
    radial-gradient(circle at 80% 12%, rgba(120, 160, 255, 0.11), transparent 22%),
    radial-gradient(circle at 50% 80%, rgba(215, 167, 86, 0.08), transparent 30%);
  filter: blur(14px);
}

.setup-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
}

.setup-overlay[hidden] {
  display: none !important;
}

.setup-overlay__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 6, 8, 0.42), rgba(8, 5, 7, 0.78)),
    radial-gradient(circle at center, rgba(255, 205, 132, 0.09), transparent 38%);
  backdrop-filter: blur(16px);
}

.setup-card {
  position: relative;
  z-index: 1;
  width: min(1080px, 96vw);
  padding: 32px;
  border-radius: 34px;
  border: 1px solid rgba(255, 226, 173, 0.18);
  background:
    linear-gradient(160deg, rgba(34, 22, 25, 0.96), rgba(12, 9, 11, 0.92)),
    radial-gradient(circle at top, rgba(255, 213, 135, 0.08), transparent 32%);
  box-shadow:
    0 38px 80px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.setup-card h1 {
  margin: 8px 0 10px;
  font-family: var(--display-font);
  font-size: clamp(2rem, 5vw, 4.3rem);
  line-height: 0.95;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.setup-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 26px;
}

.setup-block {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid rgba(255, 226, 173, 0.1);
  background: rgba(255, 255, 255, 0.03);
  transition: opacity 160ms ease, transform 160ms ease;
}

.setup-block--disabled {
  opacity: 0.48;
}

.setup-block h2 {
  margin: 0;
  font-family: var(--display-font);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.segmented-control {
  display: grid;
  gap: 10px;
}

.setup-toggle,
.launch-button {
  border: 1px solid rgba(255, 215, 140, 0.24);
  border-radius: 22px;
  padding: 14px 16px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 212, 138, 0.16), rgba(58, 27, 18, 0.24)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 60%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 24px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.setup-toggle:hover,
.launch-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 220, 150, 0.52);
}

.setup-toggle.is-active {
  background:
    linear-gradient(180deg, rgba(103, 181, 255, 0.24), rgba(28, 53, 76, 0.4)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 60%);
  border-color: rgba(127, 195, 255, 0.58);
}

.launch-button {
  min-width: 220px;
  justify-self: start;
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.launch-button--secondary {
  min-width: 180px;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
}

.setup-actions {
  margin-top: 24px;
}

.setup-actions__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.setup-actions__note {
  margin-top: 12px;
  max-width: 720px;
}

.difficulty-slider {
  display: grid;
  gap: 14px;
}

.difficulty-slider input[type="range"] {
  width: 100%;
  accent-color: var(--bronze-bright);
}

.difficulty-slider__meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: var(--muted);
}

.difficulty-slider__meta strong {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--text);
  font-family: var(--display-font);
}

.setup-hint {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.hud,
.arena {
  position: relative;
  z-index: 1;
}

.hud {
  display: grid;
  grid-template-columns: minmax(320px, 1.35fr) minmax(280px, 1fr);
  gap: 24px;
  align-items: start;
  margin: 0 auto 24px;
  max-width: 1440px;
}

.hud__title,
.hud__panel,
.panel-card,
.board-card {
  border: 1px solid var(--panel-line);
  background:
    linear-gradient(145deg, rgba(34, 22, 25, 0.92), rgba(18, 12, 14, 0.86)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 28%);
  border-radius: var(--surface-radius);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -18px 36px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(12px);
}

.hud__title {
  padding: 28px clamp(22px, 3.2vw, 36px);
}

.hud__title h1 {
  margin: 8px 0 10px;
  font-family: var(--display-font);
  font-size: clamp(2.2rem, 4.6vw, 4.3rem);
  line-height: 0.95;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--bronze-bright);
}

.tagline,
.panel-card p,
.promotion-modal__copy,
#victory-copy,
#credits-copy,
.setup-actions__note {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.hud__panel {
  padding: 20px;
  display: grid;
  gap: 14px;
}

.status-chip {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 230, 185, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.status-chip span {
  font-size: 0.76rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bronze-bright);
}

.status-chip strong {
  font-size: 1.02rem;
  color: var(--text);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button-row button,
#victory-restart-button,
.promotion-button {
  border: 1px solid rgba(255, 215, 140, 0.28);
  border-radius: 999px;
  padding: 12px 18px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 212, 138, 0.18), rgba(81, 37, 17, 0.26)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent 60%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 12px 22px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button-row button:hover,
#victory-restart-button:hover,
.promotion-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 220, 150, 0.54);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 18px 28px rgba(0, 0, 0, 0.24);
}

.button-row button.is-active {
  background:
    linear-gradient(180deg, rgba(95, 173, 255, 0.26), rgba(25, 44, 67, 0.44)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 60%);
  border-color: rgba(127, 195, 255, 0.5);
}

.arena {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(260px, 0.62fr);
  gap: 24px;
  align-items: start;
  margin: 0 auto;
  max-width: 1440px;
}

.board-card {
  padding: clamp(14px, 2.8vw, 26px);
}

.board-stage {
  position: relative;
  width: min(82vw, 920px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  perspective: 2000px;
}

.board-stage::before {
  content: "";
  position: absolute;
  inset: -2%;
  border-radius: 34px;
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 212, 138, 0.12), transparent 34%),
    radial-gradient(circle at 50% 100%, rgba(82, 116, 255, 0.08), transparent 28%);
  filter: blur(18px);
  pointer-events: none;
}

.board-surface {
  position: absolute;
  inset: 0;
  border-radius: 30px;
  overflow: hidden;
  transform-origin: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 30%),
    url("../assets/svg/board.svg") center/cover no-repeat;
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -24px 42px rgba(0, 0, 0, 0.24);
  transition: transform 420ms var(--ease-heavy), filter 420ms var(--ease-soft);
}

.board-stage--battle .board-surface {
  transform: scale(1.04) rotateX(4deg);
  filter: saturate(1.1) contrast(1.04);
}

.board-stage--blood-rush .board-surface {
  filter: saturate(1.18) contrast(1.08) hue-rotate(-8deg);
}

.board-grid,
.pieces-layer {
  position: absolute;
  inset: var(--board-inset);
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  z-index: 2;
}

.board-square {
  position: relative;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.board-square::before,
.board-square::after {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 14px;
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.board-square::before {
  background: radial-gradient(circle, rgba(255, 247, 215, 0.08), rgba(255, 255, 255, 0));
}

.board-square:hover::before {
  opacity: 1;
}

.board-square--selected::before {
  opacity: 1;
  box-shadow:
    inset 0 0 0 2px rgba(255, 221, 158, 0.58),
    0 0 22px rgba(255, 205, 123, 0.3);
}

.board-square--legal::after,
.board-square--capture::after,
.board-square--check::after {
  opacity: 1;
}

.board-square--legal::after {
  inset: 34%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(127, 203, 255, 0.92), rgba(84, 168, 235, 0.34) 60%, transparent 65%);
}

.board-square--capture::after {
  inset: 16%;
  border: 2px solid rgba(255, 113, 101, 0.9);
  box-shadow:
    inset 0 0 0 2px rgba(255, 224, 201, 0.28),
    0 0 26px rgba(255, 96, 81, 0.4);
}

.board-square--check::after {
  inset: 8%;
  background: radial-gradient(circle at center, rgba(186, 33, 27, 0.48), transparent 72%);
  box-shadow:
    inset 0 0 0 2px rgba(255, 110, 98, 0.66),
    0 0 30px rgba(212, 54, 41, 0.48);
}

.board-square--impact::after {
  opacity: 1;
  inset: 12%;
  background:
    radial-gradient(circle at center, rgba(201, 37, 28, 0.45), transparent 58%),
    radial-gradient(circle at center, rgba(255, 223, 173, 0.22), transparent 72%);
  box-shadow:
    inset 0 0 0 2px rgba(255, 130, 115, 0.42),
    0 0 30px rgba(189, 25, 21, 0.38);
}

.board-square--footfall::after {
  opacity: 1;
  inset: 22%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 234, 190, 0.34), transparent 68%);
}

.pieces-layer {
  z-index: 3;
  pointer-events: none;
}

.piece {
  position: absolute;
  width: 12.5%;
  height: 12.5%;
  --piece-offset-x: -7%;
  --piece-offset-y: -9%;
  z-index: var(--piece-depth, 1);
  transform-origin: center;
  transition:
    transform var(--move-time) var(--ease-heavy),
    opacity 260ms ease,
    filter 240ms ease;
  will-change: transform, opacity, filter;
  filter:
    drop-shadow(0 22px 18px rgba(0, 0, 0, 0.28))
    drop-shadow(0 10px 10px rgba(0, 0, 0, 0.22));
}

.piece::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 8%;
  height: 16%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.28), transparent 70%);
  transform: translateY(4px) scaleX(0.88);
  opacity: 0.9;
}

.piece img {
  position: absolute;
  left: var(--piece-offset-x);
  top: var(--piece-offset-y);
  width: 118%;
  height: 118%;
  object-fit: contain;
  image-rendering: auto;
  animation: idle-float 4.2s ease-in-out infinite;
}

.piece[data-color="w"] {
  --piece-offset-y: -17%;
}

.piece[data-color="b"] {
  --piece-offset-y: -18%;
}

.piece--walking img {
  animation: march-bob 180ms linear infinite;
}

.piece--selected {
  filter:
    drop-shadow(0 0 20px rgba(255, 216, 132, 0.58))
    drop-shadow(0 16px 18px rgba(0, 0, 0, 0.28));
}

.piece--threatened {
  filter:
    drop-shadow(0 0 16px rgba(255, 105, 95, 0.48))
    drop-shadow(0 16px 18px rgba(0, 0, 0, 0.28));
}

.piece--moving {
  z-index: 10;
  filter:
    drop-shadow(0 0 20px rgba(255, 228, 166, 0.5))
    drop-shadow(0 26px 28px rgba(0, 0, 0, 0.3));
}

.piece--defeated {
  opacity: 0;
}

.piece--spawn {
  animation: piece-spawn 420ms var(--ease-heavy);
}

.board-vignette,
.battle-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.board-vignette {
  z-index: 4;
  border-radius: 30px;
  background:
    radial-gradient(circle at center, transparent 42%, rgba(0, 0, 0, 0.18) 88%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 18%, transparent 72%, rgba(0, 0, 0, 0.18) 100%);
}

.battle-particles {
  z-index: 6;
}

.battle-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 7;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.battle-overlay.is-active {
  opacity: 1;
}

.battle-overlay__backdrop,
.battle-overlay__shockwave {
  position: absolute;
  inset: 0;
}

.battle-overlay__backdrop {
  background:
    radial-gradient(circle at center, rgba(255, 198, 136, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(3, 3, 5, 0.1), rgba(7, 4, 4, 0.74));
  backdrop-filter: blur(8px);
}

.battle-overlay__spray,
.battle-overlay__gash {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.battle-overlay__spray {
  background:
    radial-gradient(circle at 54% 46%, rgba(193, 29, 25, 0.44), transparent 14%),
    radial-gradient(circle at 61% 43%, rgba(255, 222, 182, 0.24), transparent 10%),
    radial-gradient(circle at 68% 40%, rgba(176, 16, 26, 0.34), transparent 7%);
}

.battle-overlay__gash {
  background:
    linear-gradient(120deg, transparent 42%, rgba(255, 242, 214, 0.84) 49%, rgba(185, 30, 30, 0.82) 51%, transparent 58%),
    linear-gradient(120deg, transparent 36%, rgba(255, 178, 130, 0.3) 47%, transparent 60%);
  transform: translateX(-14%) scale(0.7) rotate(-12deg);
}

.battle-overlay__shockwave {
  background: radial-gradient(circle, rgba(255, 248, 237, 0.25), transparent 36%);
  opacity: 0;
}

.battle-overlay.is-active .battle-overlay__shockwave {
  animation: shockwave 900ms ease forwards;
}

.battle-overlay.is-active .battle-overlay__spray {
  animation: spray-hit 980ms ease forwards;
}

.battle-overlay.is-active .battle-overlay__gash {
  animation: slash-cut 780ms var(--ease-heavy) forwards;
}

.battle-overlay__actors {
  position: absolute;
  inset: 0;
}

.battle-piece {
  position: absolute;
  top: 13%;
  width: min(42vw, 360px);
  aspect-ratio: 0.84 / 1;
  transform-origin: center bottom;
}

.battle-piece img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
  filter:
    drop-shadow(0 0 28px rgba(255, 219, 163, 0.3))
    drop-shadow(0 36px 38px rgba(0, 0, 0, 0.42));
}

.battle-piece--attacker {
  left: 7%;
  transform: translateX(-8%) scale(0.94);
}

.battle-piece--defender {
  right: 7%;
  transform: translateX(8%) scale(0.94);
}

.battle-overlay__caption {
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.36);
  border: 1px solid rgba(255, 226, 184, 0.16);
  font-family: var(--display-font);
  font-size: clamp(1rem, 2vw, 1.35rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.battle-overlay--visceral .battle-overlay__caption {
  background: rgba(24, 10, 10, 0.56);
  border-color: rgba(255, 186, 173, 0.22);
}

.battle-overlay.attack-p.is-active .battle-piece--attacker {
  animation: pawn-thrust 1280ms var(--ease-heavy);
}

.battle-overlay.attack-n.is-active .battle-piece--attacker {
  animation: knight-lunge 1280ms var(--ease-heavy);
}

.battle-overlay.attack-b.is-active .battle-piece--attacker {
  animation: bishop-blast 1360ms var(--ease-heavy);
}

.battle-overlay.attack-r.is-active .battle-piece--attacker {
  animation: rook-slam 1320ms var(--ease-heavy);
}

.battle-overlay.attack-q.is-active .battle-piece--attacker {
  animation: queen-arcane 1420ms var(--ease-heavy);
}

.battle-overlay.attack-k.is-active .battle-piece--attacker {
  animation: king-strike 1320ms var(--ease-heavy);
}

.battle-overlay.is-active .battle-piece--defender {
  animation: defender-brace 1460ms var(--ease-soft);
}

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

.panel-card {
  padding: 20px;
}

.panel-card h2 {
  margin: 0 0 10px;
  font-family: var(--display-font);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.move-feed {
  margin: 0;
  padding-left: 1.4rem;
  max-height: 52vh;
  overflow: auto;
  color: var(--muted);
}

.move-feed li {
  margin-bottom: 0.7rem;
  line-height: 1.55;
}

.promotion-modal,
.victory-overlay,
.credits-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 20;
}

.promotion-modal[hidden],
.victory-overlay[hidden],
.credits-overlay[hidden] {
  display: none !important;
}

.promotion-modal__scrim,
.victory-overlay__scrim,
.credits-overlay__scrim {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 10, 0.72);
  backdrop-filter: blur(10px);
}

.promotion-modal__card,
.victory-overlay__card,
.credits-overlay__card {
  position: relative;
  z-index: 1;
  width: min(92vw, 560px);
  padding: 28px;
  border-radius: 28px;
  border: 1px solid rgba(255, 223, 174, 0.16);
  background:
    linear-gradient(160deg, rgba(44, 28, 32, 0.95), rgba(18, 11, 13, 0.92)),
    radial-gradient(circle at top, rgba(255, 213, 135, 0.08), transparent 32%);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.promotion-modal__card h2,
.victory-overlay__card h2,
.credits-overlay__card h2 {
  margin: 8px 0 12px;
  font-family: var(--display-font);
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.promotion-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.promotion-button {
  display: grid;
  gap: 10px;
  place-items: center;
  padding: 14px 10px;
  border-radius: 22px;
}

.promotion-button img {
  width: 86px;
  height: 86px;
  object-fit: contain;
}

.promotion-button span {
  color: var(--muted);
}

.victory-overlay__card {
  text-align: center;
}

.credits-overlay__card {
  text-align: center;
}

.button-row--center {
  justify-content: center;
}

@keyframes idle-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes march-bob {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-4px) rotate(-1.5deg);
  }
  50% {
    transform: translateY(-1px) rotate(1.2deg);
  }
  75% {
    transform: translateY(-4px) rotate(-1deg);
  }
}

@keyframes piece-spawn {
  from {
    opacity: 0;
    filter: brightness(0.78) saturate(0.78);
  }
  to {
    opacity: 1;
    filter: brightness(1) saturate(1);
  }
}

@keyframes shockwave {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  30% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
    transform: scale(1.2);
  }
}

@keyframes spray-hit {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.8);
  }
  24% {
    opacity: 0.92;
  }
  68% {
    opacity: 0.3;
    transform: scale(1.08);
  }
}

@keyframes slash-cut {
  0% {
    opacity: 0;
    transform: translateX(-18%) scale(0.68) rotate(-16deg);
  }
  20% {
    opacity: 0.95;
  }
  56% {
    opacity: 0.75;
    transform: translateX(10%) scale(1.06) rotate(-4deg);
  }
  100% {
    opacity: 0;
    transform: translateX(24%) scale(1.16) rotate(4deg);
  }
}

@keyframes defender-brace {
  0%,
  100% {
    transform: translateX(8%) scale(0.94);
    filter: brightness(1);
  }
  55% {
    transform: translateX(1%) scale(0.98);
  }
  72% {
    transform: translateX(16%) scale(0.9);
    filter: brightness(1.55);
  }
}

@keyframes pawn-thrust {
  0%,
  100% {
    transform: translateX(-8%) scale(0.94);
  }
  42% {
    transform: translateX(14%) translateY(-1%) scale(1);
  }
  74% {
    transform: translateX(20%) translateY(2%) scale(1.02);
  }
}

@keyframes knight-lunge {
  0%,
  100% {
    transform: translateX(-8%) translateY(0) scale(0.94);
  }
  36% {
    transform: translateX(10%) translateY(-4%) rotate(-5deg) scale(1.03);
  }
  64% {
    transform: translateX(24%) translateY(0) rotate(2deg) scale(1.08);
  }
}

@keyframes bishop-blast {
  0%,
  100% {
    transform: translateX(-8%) scale(0.94);
    filter: brightness(1);
  }
  35% {
    transform: translateX(5%) scale(1.02);
    filter: brightness(1.18);
  }
  60% {
    transform: translateX(15%) scale(1.03);
    filter: brightness(1.38);
  }
}

@keyframes rook-slam {
  0%,
  100% {
    transform: translateX(-8%) scale(0.94);
  }
  40% {
    transform: translateX(12%) translateY(-5%) scale(1);
  }
  58% {
    transform: translateX(22%) translateY(2%) scale(1.08);
  }
}

@keyframes queen-arcane {
  0%,
  100% {
    transform: translateX(-8%) scale(0.94);
    filter: brightness(1);
  }
  28% {
    transform: translateX(2%) scale(1.01) rotate(-2deg);
  }
  62% {
    transform: translateX(18%) scale(1.08) rotate(2deg);
    filter: brightness(1.45) saturate(1.15);
  }
}

@keyframes king-strike {
  0%,
  100% {
    transform: translateX(-8%) scale(0.94);
  }
  38% {
    transform: translateX(12%) translateY(-2%) rotate(-3deg) scale(1.02);
  }
  66% {
    transform: translateX(18%) rotate(2deg) scale(1.06);
  }
}

@media (max-width: 1100px) {
  .setup-grid,
  .hud,
  .arena {
    grid-template-columns: 1fr;
  }

  .board-stage {
    width: min(92vw, 760px);
  }

  .side-panel {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 18px 14px 26px;
  }

  .setup-card {
    padding: 22px;
    border-radius: 24px;
  }

  .hud__title,
  .hud__panel,
  .panel-card,
  .board-card {
    border-radius: 22px;
  }

  .board-stage {
    width: min(96vw, 620px);
  }

  .button-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .promotion-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .setup-actions .launch-button {
    width: 100%;
  }

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

  .battle-piece {
    width: min(52vw, 260px);
    top: 20%;
  }

  .battle-overlay__caption {
    width: calc(100% - 24px);
    text-align: center;
    bottom: 5%;
  }
}
