:root {
  --bg-ink: #f7f2eb;
  --paper-ink: rgba(255, 255, 255, 0.25);
  --wood-1: #8d5c32;
  --wood-2: #6a4224;
  --wood-3: #b78752;
  --board-line: rgba(55, 35, 20, 0.84);
  --dark-panel: rgba(26, 20, 16, 0.75);
  --black-stone: #191919;
  --white-stone: #f7f4ef;
  --highlight: rgba(255, 255, 255, 0.35);
  --aura-glow: rgba(123, 181, 255, 0.4);
  --text-main: #2a1d12;
  --text-soft: rgba(42, 29, 18, 0.7);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", "Microsoft JhengHei", sans-serif;
  color: #efe2c7;
  background:
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.7), transparent 30%),
    radial-gradient(circle at 80% 10%, rgba(128, 160, 180, 0.24), transparent 25%),
    linear-gradient(180deg, #f0eadf 0%, #ede5d8 100%);
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(125, 145, 171, 0.06), transparent 25%, rgba(18, 21, 27, 0.04) 75%, transparent),
    radial-gradient(circle at 30% 30%, rgba(95, 96, 79, 0.1), transparent 35%),
    radial-gradient(circle at 70% 65%, rgba(125, 120, 98, 0.08), transparent 38%);
  pointer-events: none;
}

button {
  font: inherit;
}

.cover-screen {
  width: min(720px, 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.cover-screen.hidden {
  display: none;
}

.cover-card {
  width: 100%;
  text-align: center;
  padding: 54px 44px 42px;
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(35, 28, 23, 0.94), rgba(16, 18, 22, 0.92));
  border: 1px solid rgba(201, 160, 82, 0.28);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 70px rgba(154, 42, 34, 0.16);
  backdrop-filter: blur(10px);
}

.cover-screen::before {
  content: "漢末亂世 · 群雄逐鹿";
  position: fixed;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(222, 191, 126, 0.62);
  letter-spacing: 0.42em;
  font-size: 0.75rem;
  white-space: nowrap;
  pointer-events: none;
}

.cover-screen::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 25%, rgba(5, 7, 10, 0.62) 100%);
}

.cover-subtitle {
  margin: 0;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: rgba(220, 202, 172, 0.68);
  text-transform: uppercase;
}

.cover-card h1 {
  margin: 10px 0 22px;
  font-size: clamp(3rem, 8vw, 5.8rem);
  letter-spacing: 0.08em;
}

.menu-block {
  margin-top: 20px;
  text-align: left;
}

.menu-label {
  margin: 0 0 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mode-btn,
.difficulty-btn {
  flex: 1 1 140px;
  border-radius: 14px;
  border: 1px solid rgba(70, 52, 39, 0.14);
  background: linear-gradient(145deg, rgba(113, 82, 46, 0.5), rgba(38, 34, 31, 0.7));
  color: #f0e4ca;
  padding: 0.9rem 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-btn.active,
.difficulty-btn.active {
  background: linear-gradient(135deg, #8d342c, #421b1a);
  color: #fff7e6;
  box-shadow: 0 10px 22px rgba(120, 27, 22, 0.35), inset 0 1px 0 rgba(255,255,255,0.12);
}

.cover-start {
  width: 100%;
  margin-top: 28px;
}

.page-shell {
  position: relative;
  width: min(1280px, 100%);
  border-radius: 26px;
  background: rgba(248, 242, 234, 0.72);
  border: 1px solid rgba(80, 63, 43, 0.18);
  box-shadow: 0 22px 60px rgba(52, 38, 28, 0.12);
  backdrop-filter: blur(8px);
  padding: 28px 24px 20px;
}

.page-shell.hidden {
  display: none;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.subtitle {
  margin: 0;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--text-soft);
  text-transform: uppercase;
}

h1 {
  margin: 6px 0 0;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 0.08em;
  color: #2d2018;
  font-weight: 700;
}

.turn-indicator {
  min-width: 130px;
  text-align: center;
  padding: 0.8rem 1.1rem;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.08em;
  border: 1px solid rgba(28, 22, 15, 0.12);
  background: rgba(255, 255, 255, 0.26);
  transition: 0.25s ease;
}

.turn-indicator.black {
  background: linear-gradient(135deg, rgba(30, 30, 30, 0.9), rgba(10, 10, 10, 0.78));
  color: #f5f5f5;
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.15), 0 8px 18px rgba(20, 20, 20, 0.18);
}

.turn-indicator.white {
  background: linear-gradient(135deg, rgba(245, 242, 236, 0.96), rgba(228, 220, 206, 0.95));
  color: #2a1f18;
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.65), 0 8px 18px rgba(150, 138, 121, 0.14);
}

.game-panel {
  display: grid;
  grid-template-columns: minmax(120px, 150px) minmax(0, 1fr) minmax(180px, 220px);
  gap: 20px;
  align-items: center;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.right-panel {
  justify-content: center;
}

.metric-card {
  background: rgba(247, 238, 225, 0.7);
  border: 1px solid rgba(80, 63, 43, 0.12);
  border-radius: 18px;
  padding: 16px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.metric-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.92rem;
  color: var(--text-soft);
  margin-bottom: 10px;
}

.metric-card strong {
  font-size: clamp(1.4rem, 2vw, 2.2rem);
  display: block;
  text-align: center;
}

.stone-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: inset -2px -2px 4px rgba(0, 0, 0, 0.2), inset 3px 3px 5px rgba(255, 255, 255, 0.2);
}

.stone-dot.black {
  background: radial-gradient(circle at 30% 30%, #3d3d3d, #0c0c0c 58%, #000 100%);
}

.stone-dot.white {
  background: radial-gradient(circle at 30% 30%, #fff, #f0efea 58%, #dad5cf 100%);
  border: 1px solid rgba(70, 56, 40, 0.18);
}

.score-card {
  min-height: 174px;
  padding: 18px 16px;
}

.score-row {
  display: grid;
  grid-template-columns: 52px 1fr 28px;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.score-name {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.black-name {
  color: #1e1e1e;
}

.white-name {
  color: #5b5350;
}

.score-bar {
  position: relative;
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: rgba(117, 96, 71, 0.18);
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.12);
}

.score-fill {
  width: 50%;
  height: 100%;
  border-radius: inherit;
  transition: width 0.35s ease;
}

.black-fill {
  background: linear-gradient(90deg, #2e2e2e, #1a1a1a 75%, #050505);
}

.white-fill {
  background: linear-gradient(90deg, #fffefb, #efeae2 55%, #d8d0c9);
}

#score-value-black,
#score-value-white {
  margin: 0;
  text-align: center;
  font-size: 1.05rem;
}

.board-area {
  display: flex;
  justify-content: center;
}

.board-wrap {
  --aura: 0;
  position: relative;
  width: min(80vw, 760px);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 2vw, 20px);
  border-radius: 26px;
  background: linear-gradient(135deg, var(--wood-3), var(--wood-1), var(--wood-2));
  box-shadow:
    inset 0 0 0 4px rgba(58, 39, 21, 0.32),
    inset 0 10px 18px rgba(255, 255, 255, 0.12),
    0 22px 26px rgba(58, 37, 27, 0.25);
  overflow: hidden;
}

.board-wrap::before {
  content: "";
  position: absolute;
  inset: 10%;
  background: radial-gradient(circle at center, rgba(112, 183, 255, 0.18), transparent 58%);
  opacity: var(--aura);
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.board-wrap.charged {
  animation: auraPulse 1.2s ease-in-out infinite alternate;
}

.board {
  position: relative;
  width: 100%;
  height: 100%;
  border: 2px solid rgba(50, 34, 21, 0.85);
  background:
    linear-gradient(var(--board-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--board-line) 1px, transparent 1px);
  background-size: calc(100% / 18) calc(100% / 18);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.08),
    0 0 18px rgba(38, 25, 17, 0.4);
  overflow: hidden;
}

.board-cell {
  position: absolute;
  width: 4.35%;
  height: 4.35%;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  transform: translate(-50%, -50%);
  z-index: 4;
}

.board-cell::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(28, 19, 13, 0.56);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  z-index: 1;
}

.board-cell.star::before {
  opacity: 1;
}

.stone {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.2);
  transition: transform 0.18s ease, opacity 0.18s ease;
  pointer-events: none;
  z-index: 3;
  box-shadow:
    inset -10px -8px 12px rgba(0, 0, 0, 0.3),
    inset 10px 8px 12px rgba(255, 255, 255, 0.18),
    0 4px 10px rgba(20, 14, 9, 0.18);
}

.stone.show {
  opacity: 1;
  transform: scale(1);
  animation: stoneDrop 0.22s ease;
}

.stone.black {
  background: radial-gradient(circle at 32% 28%, rgba(110,110,110,0.9), #1f1f1f 34%, #050505 72%, #000 100%);
  box-shadow:
    inset -12px -9px 14px rgba(0, 0, 0, 0.34),
    inset 12px 9px 14px rgba(255, 255, 255, 0.12),
    0 5px 12px rgba(17, 12, 7, 0.2);
}

.stone.white {
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,1), #f4f1ec 36%, #ddd7d0 68%, #cec5bb 100%);
  border: 1px solid rgba(88, 78, 67, 0.18);
  box-shadow:
    inset -10px -8px 12px rgba(88, 76, 61, 0.12),
    inset 12px 9px 14px rgba(255, 255, 255, 0.72),
    0 5px 12px rgba(120, 111, 100, 0.12);
}

.stone.special {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.4),
    0 0 16px rgba(209, 238, 255, 0.7),
    inset -8px -6px 10px rgba(0, 0, 0, 0.28),
    inset 8px 6px 8px rgba(255, 255, 255, 0.18);
  animation: auraFlash 0.7s ease;
}

.board-cell:hover::after {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: rgba(50, 49, 45, 0.06);
  z-index: 2;
}

.control-panel {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
  padding-top: 8px;
}

.primary-btn,
.secondary-btn {
  border: none;
  border-radius: 999px;
  padding: 0.82rem 1.4rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn {
  background: linear-gradient(135deg, #a64232, #4a1717 58%, #17191e);
  color: #f3efe9;
  box-shadow: 0 10px 18px rgba(42, 34, 25, 0.2);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.3);
  color: var(--text-main);
  border: 1px solid rgba(60, 48, 37, 0.12);
}

.primary-btn:hover,
.secondary-btn:hover,
.mode-btn:hover,
.difficulty-btn:hover {
  transform: translateY(-1px);
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  background: rgba(25, 22, 17, 0.48);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.modal.hidden {
  display: none;
}

.modal-card {
  position: relative;
  width: min(520px, calc(100vw - 32px));
  border-radius: 24px;
  padding: 28px 26px 24px;
  background: rgba(246, 239, 230, 0.96);
  border: 1px solid rgba(77, 57, 36, 0.14);
  box-shadow: 0 18px 40px rgba(27, 22, 18, 0.18);
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(84, 67, 52, 0.08);
  font-size: 1.4rem;
  cursor: pointer;
}

.modal-card h2 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1.9rem;
}

.modal-card ul {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.8;
  color: rgba(42, 29, 18, 0.82);
}

.result-card {
  text-align: center;
}

#result-text {
  margin: 0 0 20px;
  font-size: 1.25rem;
  color: var(--text-soft);
}

@keyframes stoneDrop {
  0% {
    opacity: 0;
    transform: scale(0.18);
  }
  60% {
    opacity: 1;
    transform: scale(1.1);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes auraPulse {
  0% {
    box-shadow:
      inset 0 0 0 4px rgba(58, 39, 21, 0.32),
      inset 0 10px 18px rgba(255, 255, 255, 0.12),
      0 22px 26px rgba(58, 37, 27, 0.25);
  }
  100% {
    box-shadow:
      inset 0 0 0 4px rgba(58, 39, 21, 0.32),
      inset 0 10px 18px rgba(255, 255, 255, 0.12),
      0 28px 32px rgba(58, 37, 27, 0.3),
      0 0 28px rgba(130, 177, 255, 0.22);
  }
}

@keyframes auraFlash {
  0% {
    filter: brightness(1);
    transform: scale(0.92);
  }
  20% {
    filter: brightness(1.25);
    transform: scale(1.08);
  }
  100% {
    filter: brightness(1.1);
    transform: scale(1);
  }
}

@media (max-width: 820px) {
  body {
    padding: 16px;
  }

  .page-shell {
    padding: 18px 16px 16px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .game-panel {
    grid-template-columns: 1fr;
  }

  .side-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-wrap {
    width: min(84vw, 560px);
  }
}

@media (max-width: 420px) {
  .side-panel {
    grid-template-columns: 1fr;
  }

  .control-panel {
    flex-direction: column;
  }

  .primary-btn,
  .secondary-btn {
    width: 100%;
  }
}

@keyframes stoneDrop {
  0% {
    opacity: 0;
    transform: scale(0.18);
  }
  60% {
    opacity: 1;
    transform: scale(1.1);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes auraPulse {
  0% {
    box-shadow:
      inset 0 0 0 4px rgba(58, 39, 21, 0.32),
      inset 0 10px 18px rgba(255, 255, 255, 0.12),
      0 22px 26px rgba(58, 37, 27, 0.25);
  }
  100% {
    box-shadow:
      inset 0 0 0 4px rgba(58, 39, 21, 0.32),
      inset 0 10px 18px rgba(255, 255, 255, 0.12),
      0 28px 32px rgba(58, 37, 27, 0.3),
      0 0 28px rgba(130, 177, 255, 0.22);
  }
}

@keyframes auraFlash {
  0% {
    filter: brightness(1);
    transform: scale(0.92);
  }
  20% {
    filter: brightness(1.25);
    transform: scale(1.08);
  }
  100% {
    filter: brightness(1.1);
    transform: scale(1);
  }
}

@media (max-width: 820px) {
  body {
    padding: 16px;
  }

  .page-shell {
    padding: 18px 16px 16px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .game-panel {
    grid-template-columns: 1fr;
  }

  .side-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-wrap {
    width: min(84vw, 560px);
  }
}

@media (max-width: 420px) {
  .side-panel {
    grid-template-columns: 1fr;
  }

  .control-panel {
    flex-direction: column;
  }

  .primary-btn,
  .secondary-btn {
    width: 100%;
  }
}

/* Three Kingdoms battlefield atmosphere */
.cover-screen {
  min-height: 92vh;
}

.cover-screen::before {
  z-index: 1;
}

.cover-card {
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.cover-card::before {
  content: "魏     蜀     吳";
  display: block;
  margin-bottom: 14px;
  color: rgba(221, 181, 104, 0.5);
  font-size: 0.9rem;
  letter-spacing: 0.85em;
  text-shadow: 0 0 18px rgba(180, 80, 40, 0.3);
}

.cover-card h1 {
  color: #f3dfb7;
  text-shadow: 0 3px 0 rgba(0,0,0,0.4), 0 0 35px rgba(180, 55, 35, 0.25);
}

.cover-card .menu-label {
  color: rgba(226, 211, 184, 0.7);
}

.cover-card .mode-btn,
.cover-card .difficulty-btn {
  color: #eadfc9;
  border-color: rgba(202, 165, 95, 0.22);
}

.cover-card .cover-start {
  margin-top: 30px;
  padding: 1rem 1.5rem;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
}

@media (max-width: 600px) {
  .cover-screen::before { top: 3%; font-size: 0.62rem; }
  .cover-card { padding: 40px 22px 30px; }
}

/* Epic Three Kingdoms opening scene */
body {
  background:
    radial-gradient(circle at 50% 45%, rgba(126, 35, 27, 0.22), transparent 28%),
    radial-gradient(circle at 15% 80%, rgba(44, 65, 87, 0.3), transparent 30%),
    radial-gradient(circle at 85% 75%, rgba(102, 69, 29, 0.28), transparent 32%),
    linear-gradient(180deg, #090c12 0%, #161216 52%, #090b0f 100%);
}

.cover-screen {
  position: relative;
  min-height: 96vh;
  overflow: hidden;
}

.cover-screen::after {
  background:
    radial-gradient(ellipse at center, transparent 18%, rgba(3, 5, 8, 0.68) 100%),
    linear-gradient(90deg, rgba(20, 28, 40, 0.18), transparent 35%, transparent 65%, rgba(75, 28, 22, 0.18));
  z-index: 3;
}

.cover-screen::before {
  content: "漢末亂世  ·  群雄逐鹿";
  z-index: 4;
  top: 7%;
  text-shadow: 0 0 18px rgba(218, 166, 77, 0.35);
}

/* battlefield mist */
.cover-screen {
  isolation: isolate;
}
.cover-screen .cover-card::after {
  content: "";
  position: absolute;
  left: -15%;
  right: -15%;
  bottom: -10%;
  height: 42%;
  background:
    radial-gradient(ellipse at 20% 60%, rgba(210, 216, 219, 0.16), transparent 35%),
    radial-gradient(ellipse at 55% 45%, rgba(185, 193, 199, 0.13), transparent 34%),
    radial-gradient(ellipse at 85% 65%, rgba(205, 212, 214, 0.12), transparent 32%);
  filter: blur(18px);
  animation: battlefieldMist 7s ease-in-out infinite alternate;
  pointer-events: none;
}

/* war-banner silhouettes */
.cover-card::before {
  content: "⚑   魏        蜀        吳   ⚑";
  position: relative;
  display: block;
  margin-bottom: 18px;
  color: rgba(218, 181, 104, 0.72);
  font-size: clamp(0.85rem, 2vw, 1.05rem);
  letter-spacing: 0.48em;
  text-shadow: 0 0 14px rgba(178, 63, 37, 0.45);
}

/* weapon / spear silhouettes */
.cover-card h1::before,
.cover-card h1::after {
  content: "╾───────⚔───────╼";
  display: block;
  font-size: clamp(0.8rem, 2vw, 1.2rem);
  letter-spacing: 0.08em;
  color: rgba(193, 156, 88, 0.5);
  margin: 0 auto 12px;
}
.cover-card h1::after {
  content: "━━━━━━━━━━━━━━━━";
  margin: 12px auto 0;
  opacity: 0.38;
}

.cover-card h1 {
  letter-spacing: 0.14em;
  text-transform: none;
}

/* torch / fire glow */
.cover-card {
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.72),
    0 0 45px rgba(177, 52, 29, 0.2),
    inset 0 1px 0 rgba(255, 218, 150, 0.08);
}
.cover-card .cover-start {
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 24px rgba(186, 52, 29, 0.25),
    0 10px 22px rgba(0, 0, 0, 0.4);
}
.cover-card .cover-start::after {
  content: "";
  position: absolute;
  inset: -30% -10%;
  background: linear-gradient(110deg, transparent 38%, rgba(255, 208, 122, 0.28) 50%, transparent 62%);
  transform: translateX(-120%);
  animation: fireSweep 3.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes battlefieldMist {
  0% { transform: translateX(-4%) scale(1); opacity: 0.55; }
  100% { transform: translateX(4%) scale(1.08); opacity: 0.9; }
}

@keyframes fireSweep {
  0%, 65% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

@media (max-width: 600px) {
  .cover-screen::before { top: 3%; letter-spacing: 0.2em; }
  .cover-card h1::before,
  .cover-card h1::after { font-size: 0.7rem; }
}


/* Background battle scene - distant Three Kingdoms armies */
.cover-screen {
  background-image:
    linear-gradient(to top, rgba(5, 7, 10, 0.92) 0%, rgba(5, 7, 10, 0.28) 34%, transparent 58%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 520'%3E%3Cg fill='%2305080b' fill-opacity='.82'%3E%3Cpath d='M0 438 Q80 410 145 432 T290 430 T430 440 T570 425 T710 438 T850 428 T990 440 T1200 425 V520 H0Z'/%3E%3Cpath d='M95 420 l18-82 8 82z M160 425 l-10-92 12 92z M1035 425 l-15-94 12 94z M1110 430 l20-84 7 84z'/%3E%3C/g%3E%3Cg stroke='%2305080b' stroke-width='8' stroke-linecap='round' fill='none' opacity='.9'%3E%3Cpath d='M150 430 l18-55 M170 430 l-15-50 M205 438 l-12-58 M230 435 l18-54 M270 440 l-15-56 M310 438 l17-62 M880 438 l-18-58 M920 435 l16-62 M955 440 l-14-55 M1000 438 l18-64 M1045 440 l-12-58 M1080 438 l18-52'/%3E%3Cpath d='M135 376 l45-4 M200 382 l42-5 M295 370 l45-5 M850 378 l48-4 M935 372 l45-5 M1030 380 l45-5'/%3E%3C/g%3E%3Cg fill='%2305080b' opacity='.94'%3E%3Ccircle cx='155' cy='350' r='15'/%3E%3Cpath d='M137 368 Q155 350 173 368 L178 418 H132Z'/%3E%3Ccircle cx='225' cy='360' r='14'/%3E%3Cpath d='M208 376 Q225 358 242 376 L246 425 H204Z'/%3E%3Ccircle cx='300' cy='350' r='15'/%3E%3Cpath d='M282 368 Q300 350 318 368 L322 418 H278Z'/%3E%3Ccircle cx='895' cy='355' r='15'/%3E%3Cpath d='M877 373 Q895 355 913 373 L918 423 H872Z'/%3E%3Ccircle cx='970' cy='348' r='15'/%3E%3Cpath d='M952 366 Q970 348 988 366 L993 417 H947Z'/%3E%3Ccircle cx='1040' cy='360' r='14'/%3E%3Cpath d='M1023 376 Q1040 358 1057 376 L1062 425 H1019Z'/%3E%3C/g%3E%3Cg stroke='%2305080b' stroke-width='6' stroke-linecap='round'%3E%3Cpath d='M175 365 L115 285 M245 378 L305 285 M318 365 L375 295 M880 370 L820 290 M990 365 L1050 285 M1055 378 L1115 300'/%3E%3C/g%3E%3Cg fill='%2305080b' opacity='.92'%3E%3Cpath d='M420 420 q35-38 72 0 h45 q18 0 24 18 H400 q4-18 20-18Z'/%3E%3Ccircle cx='445' cy='405' r='11'/%3E%3Ccircle cx='490' cy='405' r='11'/%3E%3Cpath d='M705 420 q35-38 72 0 h45 q18 0 24 18 H685 q4-18 20-18Z'/%3E%3Ccircle cx='730' cy='405' r='11'/%3E%3Ccircle cx='775' cy='405' r='11'/%3E%3C/g%3E%3Cpath d='M525 410 V250 h78 v160' fill='none' stroke='%2305080b' stroke-width='7'/%3E%3Cpath d='M603 250 l-58 20 58 20z' fill='%238b2420' fill-opacity='.8'/%3E%3Cpath d='M675 410 V250 h78 v160' fill='none' stroke='%2305080b' stroke-width='7'/%3E%3Cpath d='M753 250 l58 20-58 20z' fill='%238b2420' fill-opacity='.8'/%3E%3C/g%3E%3Cg fill='%23c44a25' fill-opacity='.65'%3E%3Ccircle cx='370' cy='390' r='7'/%3E%3Ccircle cx='835' cy='390' r='8'/%3E%3Ccircle cx='1150' cy='400' r='6'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover, cover;
  background-position: center bottom, center bottom;
  background-repeat: no-repeat;
}

/* Keep the armies behind the menu while the mist passes in front */
.cover-screen .cover-card {
  background-color: rgba(14, 16, 20, 0.84);
}


/* Brighter battlefield: visible soldiers, firelight and smoke */
body {
  background:
    radial-gradient(circle at 50% 68%, rgba(214, 72, 28, 0.30), transparent 24%),
    radial-gradient(circle at 18% 72%, rgba(154, 43, 27, 0.22), transparent 28%),
    radial-gradient(circle at 82% 70%, rgba(236, 116, 37, 0.20), transparent 28%),
    linear-gradient(180deg, #26303a 0%, #4a3430 42%, #7b3f2b 72%, #261c1b 100%);
}

.cover-screen {
  background:
    linear-gradient(to top, rgba(32, 20, 17, 0.72) 0%, rgba(91, 46, 31, 0.30) 38%, rgba(34, 43, 52, 0.08) 70%, transparent 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 520'%3E%3Cg fill='%23151a20' fill-opacity='.78'%3E%3Cpath d='M0 438 Q80 410 145 432 T290 430 T430 440 T570 425 T710 438 T850 428 T990 440 T1200 425 V520 H0Z'/%3E%3C/g%3E%3Cg stroke='%23151a20' stroke-width='7' stroke-linecap='round' fill='none' opacity='.88'%3E%3Cpath d='M150 430 l18-55 M205 438 l-12-58 M270 440 l-15-56 M310 438 l17-62 M880 438 l-18-58 M920 435 l16-62 M955 440 l-14-55 M1000 438 l18-64 M1045 440 l-12-58'/%3E%3C/g%3E%3Cg fill='%23151a20' opacity='.92'%3E%3Ccircle cx='155' cy='350' r='15'/%3E%3Cpath d='M137 368 Q155 350 173 368 L178 418 H132Z'/%3E%3Ccircle cx='225' cy='360' r='14'/%3E%3Cpath d='M208 376 Q225 358 242 376 L246 425 H204Z'/%3E%3Ccircle cx='300' cy='350' r='15'/%3E%3Cpath d='M282 368 Q300 350 318 368 L322 418 H278Z'/%3E%3Ccircle cx='895' cy='355' r='15'/%3E%3Cpath d='M877 373 Q895 355 913 373 L918 423 H872Z'/%3E%3Ccircle cx='970' cy='348' r='15'/%3E%3Cpath d='M952 366 Q970 348 988 366 L993 417 H947Z'/%3E%3Ccircle cx='1040' cy='360' r='14'/%3E%3Cpath d='M1023 376 Q1040 358 1057 376 L1062 425 H1019Z'/%3E%3C/g%3E%3Cg stroke='%23151a20' stroke-width='6' stroke-linecap='round'%3E%3Cpath d='M175 365 L115 285 M245 378 L305 285 M318 365 L375 295 M880 370 L820 290 M990 365 L1050 285 M1055 378 L1115 300'/%3E%3C/g%3E%3Cg fill='%23151a20' opacity='.9'%3E%3Cpath d='M420 420 q35-38 72 0 h45 q18 0 24 18 H400 q4-18 20-18Z'/%3E%3Ccircle cx='445' cy='405' r='11'/%3E%3Ccircle cx='490' cy='405' r='11'/%3E%3Cpath d='M705 420 q35-38 72 0 h45 q18 0 24 18 H685 q4-18 20-18Z'/%3E%3Ccircle cx='730' cy='405' r='11'/%3E%3Ccircle cx='775' cy='405' r='11'/%3E%3C/g%3E%3Cg fill='%23d75a26' fill-opacity='.85'%3E%3Ccircle cx='370' cy='390' r='9'/%3E%3Ccircle cx='835' cy='390' r='10'/%3E%3Ccircle cx='1150' cy='400' r='8'/%3E%3C/g%3E%3Cg fill='%23f4a03a' fill-opacity='.48'%3E%3Ccircle cx='370' cy='390' r='24'/%3E%3Ccircle cx='835' cy='390' r='27'/%3E%3Ccircle cx='1150' cy='400' r='22'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover, cover;
  background-position: center, center bottom;
  background-repeat: no-repeat;
}

.cover-screen::after {
  background:
    radial-gradient(ellipse at center, transparent 20%, rgba(35, 22, 18, 0.34) 100%),
    linear-gradient(90deg, rgba(24, 39, 53, 0.08), transparent 35%, transparent 65%, rgba(92, 36, 20, 0.10));
}

.cover-card {
  background: linear-gradient(145deg, rgba(42, 31, 25, 0.88), rgba(24, 27, 31, 0.84));
}


/* Horse charge effect when a group is captured */
.capture-horse {
  position: absolute;
  left: 0;
  top: var(--horse-y);
  z-index: 25;
  font-size: clamp(28px, 5vw, 52px);
  line-height: 1;
  pointer-events: none;
  transform: translate(-130%, -50%) scaleX(-1);
  filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.42));
  animation: horseCharge 0.82s cubic-bezier(0.2, 0.72, 0.28, 1) forwards;
}

@keyframes horseCharge {
  0% {
    left: -8%;
    opacity: 0;
    transform: translate(-130%, -50%) scaleX(-1) scale(0.72);
  }
  12% {
    opacity: 1;
  }
  78% {
    opacity: 1;
    transform: translate(-50%, -50%) scaleX(-1) scale(1.08);
  }
  100% {
    left: var(--horse-x);
    opacity: 0;
    transform: translate(-50%, -50%) scaleX(-1) scale(0.92);
  }
}
