:root {
  --bg0: #1c211a; /* Dark olive green/grey shadow */
  --bg1: #0f120e;
  --paper: #e4d3a6; /* Warm sand/weathered military paper */
  --paper-hi: #f1e4c7;
  --paper-lo: #cfba8d;
  --wood: #614022;  /* Wood border for command table */
  --wood-hi: #7b5531;
  --wood-dark: #331e0f;
  --ink: #2b1f15;   /* Ink lines on military map */
  --line: #4a3721;
  --ver: #c0392b;   /* Red Army Red */
  --ver-hi: #e74c3c;
  --ver-deep: #78281f;
  --bone: #f6eed8;
  --bone-lo: #d9c69c;
  --gold: #d4ac0d;  /* Golden star yellow */
  --tx: #e6dfcc;
  --tx-dim: #99907c;
  --font-brush: "Ma Shan Zheng", "Xingkai SC", "Kaiti SC", "STKaiti", "KaiTi", serif;
  --font-serif: "Noto Serif SC", "Songti SC", "STSong", serif;
}

* {
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  font-family: var(--font-serif);
  color: var(--tx);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(93, 109, 75, 0.22), transparent 60%),
    radial-gradient(90% 70% at 85% 100%, rgba(192, 57, 43, 0.08), transparent 55%),
    linear-gradient(160deg, var(--bg0), var(--bg1) 70%);
  background-attachment: fixed;
  position: relative;
}

/* Subtle sand/map paper grain noise */
body::before {
  content: "";
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  position: fixed;
  inset: 0;
}

.stage {
  z-index: 1;
  flex-direction: column;
  max-width: 1060px;
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(14px, 3vw, 36px) clamp(14px, 3vw, 32px) 18px;
  display: flex;
  position: relative;
}

/* Calligraphy background character watermark (軍 represents military sand table) */
.stage::before {
  content: "軍";
  z-index: -1;
  font-family: var(--font-brush);
  color: #e6dfcc05;
  pointer-events: none;
  user-select: none;
  font-size: min(72vh, 680px);
  line-height: 1;
  position: fixed;
  bottom: -0.15em;
  right: -0.1em;
}

.masthead {
  margin-bottom: clamp(12px, 2.5vw, 24px);
  position: relative;
  z-index: 2;
}

.title {
  font-family: var(--font-brush);
  letter-spacing: 0.06em;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.6);
  align-items: center;
  gap: 0.18em;
  margin: 0;
  font-size: clamp(2.4rem, 5.4vw, 3.8rem);
  font-weight: 400;
  line-height: 1.1;
  display: flex;
}

.title-boom {
  color: var(--ver-hi);
  text-shadow:
    0 0 22px rgba(231, 76, 60, 0.35),
    0 2px 10px rgba(0, 0, 0, 0.6);
  font-size: 1.22em;
  display: inline-block;
  transform: rotate(-6deg) translateY(-0.04em);
}

.title-seal {
  font-family: var(--font-serif);
  color: #f5e9d8;
  background: linear-gradient(150deg, var(--ver), var(--ver-deep));
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  border-radius: 3px;
  align-self: flex-start;
  margin-left: 0.4em;
  padding: 0.34em 0.4em;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.25;
  transform: rotate(6deg) translateY(-0.1em);
  box-shadow:
    inset 0 0 0 1px rgba(255, 235, 200, 0.35),
    0 3px 8px rgba(0, 0, 0, 0.45);
}

.subtitle {
  color: var(--tx-dim);
  letter-spacing: 0.28em;
  margin: 0.5em 0 0;
  font-size: clamp(0.78rem, 1.6vw, 0.95rem);
}

/* Layout Arena */
.arena {
  flex: 1;
  align-items: flex-start;
  gap: clamp(16px, 3vw, 36px);
  display: flex;
  flex-direction: row;
  position: relative;
  z-index: 2;
}

@media (max-width: 820px) {
  .arena {
    flex-direction: column;
    align-items: center;
  }
}

.board-wrap {
  flex: none;
  position: relative;
}

/* Sandbox Wooden Border */
.board {
  aspect-ratio: 1;
  background: radial-gradient(
    120% 120% at 30% 20%,
    #5c4125,
    #4a331c 60%,
    #332111
  );
  border-radius: 12px;
  width: min(88vw, 60vh, 560px);
  padding: 4%;
  position: relative;
  box-shadow:
    0 26px 60px rgba(0, 0, 0, 0.6),
    0 6px 16px rgba(0, 0, 0, 0.5),
    inset 0 2px 3px rgba(255, 235, 180, 0.15),
    inset 0 -6px 14px rgba(0, 0, 0, 0.5);
}

.board::before {
  content: "";
  z-index: -1;
  filter: blur(8px);
  background: radial-gradient(circle, rgba(0, 0, 0, 0.45), transparent 70%);
  border-radius: 50%;
  height: 26%;
  position: absolute;
  inset: auto -3% -7%;
}

/* Tactical Map Paper */
.board-inner {
  background:
    linear-gradient(135deg, rgba(120, 92, 52, 0.08), rgba(40, 28, 12, 0.15)),
    radial-gradient(ellipse at 40% 30%, var(--paper-hi) 0%, var(--paper-lo) 100%);
  border-radius: 6px;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 4px 12px rgba(50, 30, 10, 0.32),
    inset 0 0 40px rgba(70, 50, 20, 0.22);
}

/* Vignette shading on tactical map */
.board-inner::after {
  content: "";
  pointer-events: none;
  background: radial-gradient(120% 110% at 40% 30%, transparent 60%, rgba(65, 45, 20, 0.25));
  position: absolute;
  inset: 0;
  z-index: 10;
}

.grid {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Map Pencil Lines */
.grid-groove line {
  stroke: rgba(43, 31, 21, 0.75);
  stroke-width: 1.1px;
  stroke-linecap: round;
}

.grid-glow line {
  stroke: rgba(255, 255, 255, 0.42);
  stroke-width: 0.8px;
  stroke-linecap: round;
}

.camp-tag {
  writing-mode: vertical-rl;
  font-family: var(--font-serif);
  letter-spacing: 0.32em;
  color: rgba(43, 31, 21, 0.42);
  user-select: none;
  font-size: clamp(0.6rem, 1.25vw, 0.78rem);
  position: absolute;
  right: -0.8em;
  font-weight: 600;
  text-shadow: 0 1px 0 rgba(255,255,255,0.2);
}

.camp-top {
  top: 8%;
}

.camp-bottom {
  bottom: 8%;
}

/* Game Pieces */
.piece {
  aspect-ratio: 1;
  pointer-events: none;
  z-index: 4;
  position: absolute;
  transform: translate(-50%, -50%);
  transition:
    left 0.32s cubic-bezier(0.25, 1, 0.4, 1),
    top 0.32s cubic-bezier(0.25, 1, 0.4, 1);
}

.piece .body {
  transform: rotate(var(--rot, 0deg));
  transition: transform 0.2s, filter 0.2s, translate 0.2s;
  position: absolute;
  inset: 0;
}

/* Red Army Piece: Red badge with gold star */
.stone {
  width: 9%;
}

.stone .body {
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--ver-hi), var(--ver) 75%, var(--ver-deep));
  filter: drop-shadow(0 0.15em 0.19em rgba(40, 20, 10, 0.65));
  border: 0.08em solid var(--gold);
  box-shadow: 
    inset 0 2px 4px rgba(255, 255, 255, 0.25),
    inset 0 -2px 6px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Golden Star Emblem */
.stone .body::after {
  content: "★";
  color: var(--gold);
  font-size: 0.9em;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  line-height: 1;
}

/* Japanese Invaders: Green military steel helmet */
.twig {
  width: 9%;
}

.twig .body {
  border-radius: 50% 50% 40% 40% / 60% 60% 30% 30%;
  background: radial-gradient(circle at 35% 35%, #6e7e5c, #48543a 75%, #2a3122);
  filter: drop-shadow(0 0.15em 0.19em rgba(10, 8, 5, 0.65));
  box-shadow: 
    inset 0 2px 3px rgba(255,255,255,0.18),
    inset 0 -2px 4px rgba(0,0,0,0.3);
}

/* Helmet Brim */
.twig .body::before {
  content: "";
  position: absolute;
  bottom: 3%;
  left: -8%;
  right: -8%;
  height: 16%;
  background: #39422e;
  border-radius: 50%;
  box-shadow: 0 1.5px 2px rgba(0,0,0,0.4);
}

/* Japanese helmet small yellow star badge */
.twig .body::after {
  content: "★";
  position: absolute;
  top: 32%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  color: var(--gold);
  font-size: 0.6em;
  font-weight: bold;
  text-shadow: 0 0.5px 1px rgba(0,0,0,0.6);
}

.piece.selected {
  z-index: 6;
}

.piece.selected .body {
  filter: brightness(1.1) drop-shadow(0 0.24em 0.36em rgba(20, 14, 4, 0.6));
  translate: 0 -8%;
}

/* Pulsing selection aura */
.piece.selected::after {
  content: "";
  border-radius: 50%;
  animation: 1.3s ease-in-out infinite sel-pulse;
  position: absolute;
  inset: -22%;
  box-shadow:
    0 0 0 0.14em rgba(230, 92, 92, 0.8),
    0 0 1.2em rgba(230, 92, 92, 0.5);
}

@keyframes sel-pulse {
  50% {
    opacity: 0.5;
    inset: -28%;
  }
}

/* Indicators */
.target-dot,
.target-cap,
.mark-from,
.mark-to,
.boom-fx {
  pointer-events: none;
  position: absolute;
  transform: translate(-50%, -50%);
}

.target-dot {
  aspect-ratio: 1;
  z-index: 3;
  background: radial-gradient(circle at 50% 38%, rgba(206, 57, 43, 0.52), rgba(206, 57, 43, 0.12) 70%);
  border-radius: 50%;
  width: 7.5%;
  animation: 1.5s ease-in-out infinite dot-breathe;
  box-shadow:
    0 0 6px rgba(206, 57, 43, 0.25),
    inset 0 0.08em 0.1em rgba(255, 255, 255, 0.3);
}

@keyframes dot-breathe {
  50% {
    opacity: 0.7;
    scale: 1.35;
  }
}

/* Placement zone indicator dot — golden ring pulsing */
.target-place {
  aspect-ratio: 1;
  z-index: 3;
  pointer-events: none;
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  width: 9%;
  border: 2px solid rgba(212, 172, 13, 0.75);
  background: radial-gradient(circle at 50% 38%, rgba(212, 172, 13, 0.18), transparent 70%);
  animation: 1.2s ease-in-out infinite place-pulse;
  box-shadow: 0 0 8px rgba(212, 172, 13, 0.3);
}

@keyframes place-pulse {
  0%, 100% { opacity: 0.55; scale: 1; }
  50%       { opacity: 1;    scale: 1.25; }
}

/* Confirm placement button — prominent full-width CTA */
.btn-confirm-place {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  background: linear-gradient(135deg, #9e2a1a 0%, #c0392b 50%, #9e2a1a 100%);
  border: 1px solid rgba(255, 120, 80, 0.55);
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 0 18px rgba(192, 57, 43, 0.45);
  animation: confirm-glow 2s ease-in-out infinite;
}

.btn-confirm-place:disabled {
  opacity: 0.32;
  cursor: not-allowed;
  animation: none;
  box-shadow: none;
}

.btn-confirm-place:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 0 28px rgba(192, 57, 43, 0.7);
}

.btn-confirm-place:not(:disabled):active {
  transform: translateY(0);
}

@keyframes confirm-glow {
  0%, 100% { box-shadow: 0 0 14px rgba(192, 57, 43, 0.4); }
  50%       { box-shadow: 0 0 26px rgba(192, 57, 43, 0.75); }
}


.target-cap {
  aspect-ratio: 1;
  z-index: 5;
  border: 0.18em solid #c0392b;
  border-radius: 50%;
  width: 14.5%;
  animation: 0.85s ease-in-out infinite cap-pulse;
  box-shadow:
    0 0 0.8em rgba(192, 57, 43, 0.6),
    inset 0 0 0.5em rgba(192, 57, 43, 0.4);
}

@keyframes cap-pulse {
  50% {
    border-color: #e05a3a;
    scale: 1.15;
  }
}

.mark-from {
  aspect-ratio: 1;
  z-index: 2;
  background: radial-gradient(circle, rgba(65, 45, 20, 0.28), transparent 72%);
  border-radius: 50%;
  width: 5%;
}

.mark-to {
  aspect-ratio: 1;
  z-index: 2;
  border: 0.12em dashed rgba(206, 57, 43, 0.42);
  border-radius: 50%;
  width: 13%;
}

/* Explosion Effects (JianDi cloud burst) */
.boom-fx {
  aspect-ratio: 1;
  z-index: 7;
  width: 28%;
}

.boom-fx .ring {
  background: radial-gradient(circle, rgba(231, 76, 60, 0.5), rgba(192, 57, 43, 0.15) 58%, transparent 72%);
  border-radius: 50%;
  animation: 0.6s ease-out forwards dust-ring;
  position: absolute;
  inset: 16%;
}

.boom-fx .d {
  background: #48543a;
  border-radius: 50%;
  width: 12%;
  height: 12%;
  animation: 0.62s ease-out forwards dust-fly;
  position: absolute;
  top: 50%;
  left: 50%;
}

.boom-fx .d2 { background: #b2584d; }
.boom-fx .d4 { background: #39422e; }

.d1 { --dx: -130%; --dy: -80%; }
.d2 { --dx: 135%; --dy: -55%; }
.d3 { --dx: -90%; --dy: 110%; }
.d4 { --dx: 105%; --dy: 125%; }
.d5 { --dx: 10%; --dy: -150%; }

@keyframes dust-fly {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.5);
  }
  100% {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0);
    opacity: 0;
  }
}

@keyframes dust-ring {
  0% {
    opacity: 0.9;
    transform: scale(0.3);
  }
  100% {
    opacity: 0;
    transform: scale(1.9);
  }
}

/* Click Hotspots */
.hotspot {
  aspect-ratio: 1;
  z-index: 8;
  cursor: default;
  background: transparent;
  border: none;
  border-radius: 50%;
  width: 13.5%;
  padding: 0;
  position: absolute;
  transform: translate(-50%, -50%);
  outline: none;
  touch-action: manipulation;
}

.hotspot.can {
  cursor: pointer;
}

.hotspot.can:hover {
  background: radial-gradient(circle, rgba(206, 57, 43, 0.12), transparent 70%);
}

/* Control Panel */
.panel {
  flex-direction: column;
  flex: 1 1 0;
  gap: 16px;
  min-width: 260px;
  display: flex;
}

.card {
  background: linear-gradient(165deg, #24221d, #161512);
  border: 1px solid rgba(217, 164, 65, 0.15);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.card-title {
  font-family: var(--font-serif);
  letter-spacing: 0.32em;
  color: var(--tx-dim);
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.card-title::before {
  content: "◆ ";
  color: var(--ver);
  vertical-align: 0.1em;
  font-size: 0.75em;
}

/* Faction turn indicator */
.faction-row {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}

.faction {
  flex: 1;
  border-left: 3px solid transparent;
  border-radius: 6px;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  display: flex;
  background: rgba(0, 0, 0, 0.18);
  transition: border-color 0.22s, background 0.22s;
}

.faction-indicator {
  border-radius: 50%;
  width: 9px;
  height: 9px;
  display: inline-block;
  background: #555;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
}

#faction-cannon .faction-indicator {
  background: var(--ver);
  border: 1px solid var(--gold);
}

#faction-soldier .faction-indicator {
  background: #48543a;
  border: 1px solid #333;
}

.faction-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.faction-detail {
  margin-left: auto;
  color: var(--tx-dim);
  font-size: 0.76rem;
}

.faction.active {
  background: rgba(206, 57, 43, 0.08);
  border-left-color: var(--ver-hi);
}

.faction.active #faction-cannon .faction-indicator {
  box-shadow: 0 0 8px var(--ver-hi);
}

.faction.active #faction-soldier .faction-indicator {
  box-shadow: 0 0 8px #6e7e5c;
}

.game-message {
  border-radius: 8px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--tx);
  background: rgba(12, 10, 8, 0.35);
  padding: 10px 12px;
  min-height: 48px;
  display: flex;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

/* Settings Group */
.settings-group {
  margin-bottom: 14px;
}

.settings-group:last-child {
  margin-bottom: 0;
}

.setting-label {
  display: block;
  font-size: 0.72rem;
  color: var(--tx-dim);
  margin-bottom: 6px;
  letter-spacing: 0.15em;
}

/* Button general style */
.btn {
  background: linear-gradient(to bottom, #2d2a23, #22201b);
  border: 1px solid rgba(217, 164, 65, 0.22);
  color: var(--tx);
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  font-size: 0.84rem;
  padding: 8px 12px;
  transition: all 0.18s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  touch-action: manipulation;
}

.btn:hover:not(:disabled) {
  border-color: rgba(217, 164, 65, 0.55);
  background: linear-gradient(to bottom, #3b362e, #2d2923);
}

.btn:active:not(:disabled) {
  background: #1e1b17;
}

.btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

/* Button groups */
.btn-group {
  display: flex;
  gap: 8px;
}

.btn-group .btn {
  flex: 1;
}

.btn-group .btn.active {
  background: linear-gradient(to bottom, #b38632, #946c24);
  border-color: #d9a441;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 10px rgba(217, 164, 65, 0.25);
}

/* Difficulty Selector Options */
.difficulty-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-diff {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 10px;
  text-align: left;
  gap: 2px;
}

.btn-diff strong {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--tx);
}

.btn-diff span {
  font-size: 0.64rem;
  color: var(--tx-dim);
}

.btn-diff.active {
  background: linear-gradient(to bottom, #b38632, #946c24);
  border-color: #d9a441;
  box-shadow: 0 0 10px rgba(217, 164, 65, 0.25);
}

.btn-diff.active strong,
.btn-diff.active span {
  color: #fff;
}

/* Controls Grid */
.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-control {
  font-weight: 600;
  padding: 10px;
}

/* Colophon footer */
.colophon {
  margin-top: 24px;
  text-align: center;
  color: rgba(233, 223, 200, 0.22);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  line-height: 1.5;
  user-select: none;
}

/* Modal Overlay Rules */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 7, 0.85);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.26s ease;
  padding: 16px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: linear-gradient(160deg, #24221d, #161512);
  border: 1px solid rgba(217, 164, 65, 0.32);
  border-radius: 16px;
  width: min(100%, 540px);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,0.8);
  transform: translateY(20px);
  transition: transform 0.28s cubic-bezier(0.25, 1, 0.4, 1);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-title {
  font-family: var(--font-brush);
  font-size: 1.6rem;
  font-weight: 400;
  margin: 0;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(217, 164, 65, 0.15);
  color: var(--gold);
  letter-spacing: 0.12em;
}

.modal-body {
  overflow-y: auto;
  padding: 20px 24px;
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--tx);
}

.modal-body h3 {
  color: var(--gold);
  font-size: 0.95rem;
  margin: 1.2em 0 0.5em;
  font-weight: 600;
  border-bottom: 1px solid rgba(217, 164, 65, 0.08);
  padding-bottom: 4px;
}

.modal-body ul, .modal-body ol {
  margin: 0 0 1em;
  padding-left: 20px;
}

.modal-body li {
  margin-bottom: 4px;
}

.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid rgba(217, 164, 65, 0.15);
  display: flex;
  justify-content: flex-end;
}

.btn-primary {
  background: linear-gradient(to bottom, #d9a441, #ab7925);
  border-color: #d9a441;
  color: #1a1612;
  font-weight: 700;
  padding: 8px 22px;
}

.btn-primary:hover {
  background: linear-gradient(to bottom, #ebd193, #d9a441);
  border-color: #ebd193;
}

/* Game Over Modal Styling */
.game-over-content {
  border-color: var(--ver) !important;
  text-align: center;
}

.game-over-content .modal-title {
  color: var(--ver-hi) !important;
  font-size: 1.8rem;
  letter-spacing: 0.15em;
  text-shadow: 0 0 10px rgba(206, 57, 43, 0.4);
}

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

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

/* Stamp design */
.stamp {
  width: 120px;
  height: 120px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-brush);
  font-size: 2.2rem;
  font-weight: bold;
  border: 0.15em dashed;
  transform: rotate(-10deg);
}

.modal-overlay.active .stamp {
  animation: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) stamp-slam forwards;
}

@keyframes stamp-slam {
  0% {
    transform: scale(3) rotate(-45deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotate(-10deg);
    opacity: 1;
  }
}

.stamp.win {
  color: var(--ver-hi);
  border-color: var(--ver-hi);
  background: rgba(231, 76, 60, 0.08);
  box-shadow: 0 0 15px rgba(231, 76, 60, 0.2);
}

.stamp.lose {
  color: #555;
  border-color: #555;
  background: rgba(85, 85, 85, 0.08);
  box-shadow: 0 0 15px rgba(85, 85, 85, 0.2);
}

.game-over-desc {
  font-size: 1.15rem;
  font-weight: 600;
  color: #2b1f15; /* Dark ink color to look like stamped text on tactical map */
  margin-bottom: 12px;
  letter-spacing: 0.05em;
  padding: 0 10px;
}

.game-over-details {
  font-size: 0.88rem;
  color: var(--tx);
  background: rgba(0, 0, 0, 0.55);
  border-radius: 8px;
  padding: 12px 16px;
  display: inline-block;
  text-align: left;
  line-height: 1.6;
  border-top: 1px solid rgba(255,255,255,0.03);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.btn-lg {
  padding: 10px 28px;
  font-size: 0.95rem;
}

/* Hint Button Special Styling */
.btn-hint {
  grid-column: span 2;
  border-color: rgba(212, 172, 13, 0.45) !important;
  color: var(--gold) !important;
  font-weight: 700;
  letter-spacing: 0.12em;
  transition: all 0.22s;
}

.btn-hint:hover:not(:disabled) {
  border-color: var(--gold) !important;
  background: linear-gradient(to bottom, #3b331a, #2d2511) !important;
  box-shadow: 0 0 12px rgba(212, 172, 13, 0.25);
}

.btn-hint:disabled {
  border-color: rgba(217, 164, 65, 0.1) !important;
  color: var(--tx-dim) !important;
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

/* Hint Markers on the board */
.mark-hint-from, .mark-hint-to {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 5;
}

.mark-hint-from {
  width: 11%;
  height: 11%;
  border: 3px dotted var(--gold);
  animation: hint-glow 1.5s ease-in-out infinite alternate;
}

.mark-hint-to {
  width: 9%;
  height: 9%;
  border: 3px dashed var(--gold);
  background: rgba(212, 172, 13, 0.15);
  animation: hint-pulse 1.5s ease-in-out infinite;
}

@keyframes hint-glow {
  0% {
    box-shadow: 0 0 4px rgba(214, 172, 13, 0.4);
    border-color: rgba(214, 172, 13, 0.5);
  }
  100% {
    box-shadow: 0 0 16px var(--gold);
    border-color: var(--gold);
  }
}

@keyframes hint-pulse {
  0% {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0.6;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0.6;
  }
}

