:root {
  color-scheme: light;
  --bg: #efe4cd;
  --ink: #24170f;
  --muted: #6f5843;
  --line: rgba(95, 67, 33, 0.2);
  --player: #215f80;
  --enemy: #9c3f2f;
  --accent: #a8782f;
  --highlight: #ffd66c;
  font-family: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(168, 120, 47, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(255, 250, 239, 0.92) 0%, rgba(239, 228, 205, 0.96) 100%),
    repeating-linear-gradient(
      0deg,
      rgba(80, 55, 23, 0.02) 0,
      rgba(80, 55, 23, 0.02) 1px,
      transparent 1px,
      transparent 6px
    );
  color: var(--ink);
}

[hidden] {
  display: none !important;
}

button {
  font: inherit;
  cursor: pointer;
}

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  padding: 10px 18px 12px;
  overflow: hidden;
}

.splash-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.splash-panel {
  width: min(520px, calc(100vw - 40px));
  display: grid;
  gap: 18px;
  padding: 28px 28px 24px;
  border: 1px solid rgba(95, 67, 33, 0.18);
  border-radius: 22px;
  background:
    radial-gradient(circle at top, rgba(255, 214, 108, 0.15), transparent 30%),
    linear-gradient(180deg, rgba(255, 251, 243, 0.97), rgba(239, 228, 205, 0.98));
  box-shadow: 0 18px 42px rgba(29, 20, 14, 0.18);
}

.splash-logo {
  width: min(100%, 360px);
  justify-self: center;
  display: block;
}

.splash-picker {
  display: grid;
  gap: 8px;
}

.splash-label {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.splash-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(95, 67, 33, 0.2);
  border-radius: 14px;
  background: rgba(255, 249, 237, 0.82);
  color: var(--ink);
  font: inherit;
}

.splash-start {
  justify-self: center;
  min-width: 180px;
}

.status-bar {
  display: grid;
  grid-template-columns: minmax(210px, 250px) minmax(0, 1fr) minmax(270px, 320px);
  align-items: center;
  gap: 14px;
}

.app-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-spacer {
  min-width: 0;
}

.play-area {
  display: grid;
  grid-template-columns: minmax(210px, 250px) minmax(0, 1fr) minmax(270px, 320px);
  gap: 14px;
  min-height: 0;
  align-items: stretch;
  overflow: hidden;
}

.log-column,
.board-column,
.enemy-column {
  min-height: 0;
  overflow: hidden;
}

.log-column {
  padding: 8px 10px 8px 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.left-panel-toggle {
  display: flex;
  gap: 8px;
}

.panel-toggle-button {
  min-width: 68px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 249, 237, 0.78);
  color: var(--muted);
  transition: transform 140ms ease, background 140ms ease, color 140ms ease;
}

.panel-toggle-button.active {
  background: rgba(181, 138, 53, 0.16);
  color: var(--ink);
  border-color: rgba(145, 115, 62, 0.34);
}

.left-panel-body {
  min-height: 0;
  height: 100%;
  overflow: auto;
}

.battle-log {
  margin: 0;
  padding: 12px 14px;
  height: 100%;
  overflow: auto;
  display: grid;
  gap: 10px;
  align-content: start;
  list-style: none;
  border: 1px solid rgba(145, 115, 62, 0.22);
  background: rgba(246, 238, 221, 0.88);
}

.battle-log li {
  line-height: 1.32;
  color: var(--muted);
}

.log-inline-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  vertical-align: middle;
  white-space: nowrap;
}

.log-inline-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}

.player-roster {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-content: start;
}

.update-panel {
  display: none;
  align-content: start;
  gap: 12px;
}

.player-card {
  display: grid;
  gap: 10px;
  align-content: start;
  justify-items: center;
}

.player-card-icon-wrap {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
}

.player-card-icon {
  width: 88px;
  height: 88px;
  object-fit: contain;
  display: block;
}

.board-column {
  display: grid;
  grid-template-rows: 1fr;
  min-width: 0;
}

.board-status {
  display: grid;
  justify-items: center;
  gap: 2px;
}

.board-status-line {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  font-size: 0.96rem;
  color: var(--muted);
}

.board-status-summary {
  white-space: nowrap;
}

.board-status-speed {
  white-space: nowrap;
}

.board-status-line strong {
  color: var(--ink);
}

.initiative-label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.initiative-track {
  display: flex;
  gap: 5px;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
}

.initiative-chip {
  min-width: 28px;
  padding: 4px 7px;
  border-radius: 999px;
  border: 1px solid rgba(145, 115, 62, 0.18);
  background: rgba(255, 249, 237, 0.65);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  box-shadow: inset 0 -1px 0 rgba(95, 67, 33, 0.08);
}

.initiative-chip.active {
  background: rgba(181, 138, 53, 0.2);
  border-color: rgba(145, 115, 62, 0.42);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255, 214, 108, 0.4);
}

.board-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.board-toolbar-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.map-tool-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 249, 237, 0.82);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1;
  transition: transform 140ms ease, background 140ms ease, opacity 140ms ease;
}

.map-tool-button:hover {
  transform: translateY(-1px);
}

.map-tool-fit {
  width: 46px;
  font-size: 0.85rem;
  font-weight: 700;
}

.board-viewport {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: auto;
  border: 1px solid rgba(145, 115, 62, 0.3);
  display: flex;
  background:
    radial-gradient(circle at top, rgba(255, 214, 108, 0.12), transparent 25%),
    linear-gradient(180deg, #efe1c6 0%, #d5ba8d 100%);
}

.board-stage {
  --board-zoom: 1;
  --board-base-width: 960px;
  --board-base-height: 960px;
  flex: 0 0 auto;
  width: calc(var(--board-base-width) * var(--board-zoom));
  height: calc(var(--board-base-height) * var(--board-zoom));
  min-width: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#board {
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  min-height: 0;
  max-height: 100%;
}

.enemy-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 0;
}

.enemy-header {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  gap: 10px;
  align-items: center;
}

.enemy-title {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
}

.nav-button,
.action-button,
.mini-button {
  border: 1px solid var(--line);
  background: rgba(255, 249, 237, 0.78);
  color: var(--ink);
  border-radius: 999px;
  transition: transform 140ms ease, background 140ms ease, opacity 140ms ease;
}

.nav-button:hover,
.action-button:hover,
.mini-button:hover {
  transform: translateY(-1px);
}

.nav-button {
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 1.2rem;
}

.enemy-viewer {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 10px;
  min-height: 0;
  align-content: stretch;
  overflow: hidden;
}

.console-art,
.enemy-card,
.enemy-card-inner,
.card-face,
.card-art {
  min-height: 0;
}

.console-art,
.card-art {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top, rgba(255, 214, 108, 0.18), transparent 30%),
    linear-gradient(160deg, rgba(61, 52, 44, 0.2), rgba(255, 255, 255, 0.06));
}

.console-art {
  display: block;
  max-height: 34vh;
}

.card-art {
  aspect-ratio: 0.7;
}

.console-art img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  object-position: center;
  background: rgba(255, 255, 255, 0.05);
}

.card-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  background: rgba(255, 255, 255, 0.05);
}

.console-art.fallback::before,
.card-art.fallback::before {
  content: attr(data-fallback-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
}

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

.stance-overlay-token {
  position: absolute;
  transform: translate(-50%, -50%);
  height: auto;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.28));
}

.stance-overlay-token-circle {
  z-index: 2;
}

.stance-overlay-token-hex {
  z-index: 1;
}

.stance-badge,
.approach-badge {
  padding: 6px 10px;
  border-radius: 999px;
  color: white;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
}

.stance-badge.offensive {
  background: rgba(156, 63, 47, 0.92);
}

.stance-badge.defensive {
  background: rgba(33, 95, 128, 0.92);
}

.approach-badge {
  background: rgba(181, 138, 53, 0.92);
}

.enemy-card {
  perspective: 1200px;
  aspect-ratio: 0.7;
  max-height: 38vh;
  cursor: pointer;
}

.enemy-card-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 14px;
  align-items: start;
}

.enemy-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 500ms ease;
}

.enemy-card.flipped .enemy-card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  backface-visibility: hidden;
  overflow: hidden;
}

.card-art {
  border-radius: 18px;
}

.card-front {
  background:
    radial-gradient(circle at top, rgba(255, 214, 108, 0.16), transparent 28%),
    linear-gradient(160deg, #4f211a 0%, #7d3123 100%);
}

.card-back {
  background:
    radial-gradient(circle at top, rgba(255, 214, 108, 0.18), transparent 30%),
    linear-gradient(160deg, #2b2f46 0%, #48506d 100%);
  transform: rotateY(180deg);
}

.enemy-stat-block {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  padding: 2px 2px 0;
}

.enemy-card-stat-block {
  padding-top: 0;
}

.enemy-stat-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(95, 67, 33, 0.1);
}

.enemy-stat-label {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.enemy-stat-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  text-align: right;
}

.enemy-stat-item-wide {
  grid-column: 1 / -1;
}

.enemy-stat-item-wide .enemy-stat-value {
  max-width: 70%;
}

.enemy-card-summary {
  line-height: 1.3;
  font-size: 0.82rem;
  color: var(--muted);
  padding: 2px 2px 0;
}

.wound-panel {
  display: grid;
  gap: 10px;
  align-content: start;
  padding-top: 6px;
}

.wound-panel-title {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.player-roster .wound-panel-title {
  font-size: 0.76rem;
  text-align: center;
}

.player-roster .wound-panel {
  justify-items: center;
  width: 100%;
}

.player-roster .wound-track {
  justify-items: center;
}

.left-panel-body.show-log .battle-log {
  display: grid;
}

.left-panel-body.show-log .player-roster {
  display: none;
}

.left-panel-body.show-log .update-panel {
  display: none;
}

.left-panel-body.show-stats .battle-log {
  display: none;
}

.left-panel-body.show-stats .player-roster {
  display: grid;
}

.left-panel-body.show-stats .update-panel {
  display: none;
}

.left-panel-body.show-update .battle-log,
.left-panel-body.show-update .player-roster {
  display: none;
}

.left-panel-body.show-update .update-panel {
  display: grid;
}

.player-card-panel {
  display: grid;
  gap: 10px;
}

.player-card-chooser {
  display: grid;
  gap: 10px;
}

.player-card-panel-header {
  display: flex;
  justify-content: center;
  gap: 8px;
  align-items: center;
}

.player-card-panel-title,
.player-card-panel-speed {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.player-card-list {
  display: grid;
  gap: 8px;
}

.player-speed-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.player-speed-button {
  padding: 8px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 249, 237, 0.72);
  color: var(--ink);
  text-align: center;
}

.player-speed-button.active {
  background: rgba(168, 120, 47, 0.16);
  border-color: rgba(145, 115, 62, 0.38);
}

.card-modal[hidden] {
  display: none;
}

.card-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.card-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(27, 19, 13, 0.42);
  backdrop-filter: blur(2px);
}

.card-modal-panel {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100vw - 40px));
  max-height: calc(100vh - 60px);
  overflow: hidden;
  margin: 30px auto;
  padding: 16px 18px 18px;
  border: 1px solid rgba(95, 67, 33, 0.22);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 251, 243, 0.98) 0%, rgba(239, 228, 205, 0.98) 100%);
  box-shadow: 0 20px 40px rgba(29, 20, 14, 0.22);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.card-modal-panel .player-card-panel {
  max-height: calc(100vh - 150px);
  overflow: auto;
  padding-right: 4px;
}

.resolution-modal {
  z-index: 38;
  pointer-events: none;
}

.resolution-modal.scenario-end {
  pointer-events: auto;
}

.resolution-backdrop {
  background: transparent;
  backdrop-filter: none;
}

.resolution-modal.scenario-end .resolution-backdrop {
  background: rgba(41, 28, 16, 0.28);
  backdrop-filter: blur(2px);
}

.resolution-panel {
  width: min(980px, calc(100vw - 40px));
  margin: 18px auto 0;
  pointer-events: auto;
  max-height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.resolution-modal-body {
  display: grid;
  gap: 14px;
  color: var(--muted);
  line-height: 1.35;
  min-height: 0;
  overflow: auto;
  padding-right: 8px;
}

.resolution-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 0;
  padding-top: 14px;
  border-top: 1px solid rgba(145, 115, 62, 0.18);
  background:
    linear-gradient(180deg, rgba(247, 239, 220, 0.75), rgba(247, 239, 220, 0.96));
}

.resolution-copy {
  color: var(--muted);
}

.resolution-callout {
  padding: 10px 12px;
  border: 1px solid rgba(145, 115, 62, 0.24);
  border-radius: 14px;
  background: rgba(255, 249, 237, 0.7);
  color: var(--ink);
}

.resolution-checklist {
  display: grid;
  gap: 8px;
}

.resolution-check-item {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.4;
}

.resolution-check-item::before {
  content: "•";
  position: absolute;
  left: 3px;
  top: 0;
  color: var(--ink-strong);
}

.resolution-adjust-grid {
  display: grid;
  gap: 10px;
}

.resolution-unit-row {
  display: grid;
  grid-template-columns: 90px repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}

.resolution-unit-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
}

.resolution-stat-box {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 8px 6px;
  border: 1px solid rgba(145, 115, 62, 0.18);
  border-radius: 12px;
  background: rgba(255, 249, 237, 0.64);
}

.resolution-stat-label {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.resolution-stat-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}

.resolution-stat-button {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 249, 237, 0.84);
  color: var(--ink);
}

.resolution-stat-value {
  min-width: 18px;
  text-align: center;
  font-weight: 700;
  color: var(--ink);
}

.resolution-move-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.resolution-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.resolution-preview-card {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.resolution-preview-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

.resolution-preview-flip {
  perspective: 1200px;
}

.resolution-preview-inner {
  position: relative;
  transform-style: preserve-3d;
  animation: preview-card-flip 900ms ease forwards;
}

.resolution-preview-face {
  grid-area: 1 / 1;
  backface-visibility: hidden;
}

.resolution-preview-front {
  transform: rotateY(0deg);
}

.resolution-preview-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
}

.resolution-preview-image {
  aspect-ratio: 0.72;
  max-height: min(40vh, 440px);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(95, 67, 33, 0.16);
  background:
    radial-gradient(circle at top, rgba(255, 214, 108, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(255, 251, 243, 0.96), rgba(239, 228, 205, 0.96));
}

.resolution-preview-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

@media (max-width: 780px) {
  .resolution-preview-grid {
    grid-template-columns: 1fr;
  }
}

.resolution-result-strip {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  min-height: 72px;
}

.resolution-result-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(95, 67, 33, 0.16);
  border-radius: 12px;
  background: rgba(255, 249, 237, 0.72);
}

.resolution-result-item img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.resolution-result-item span {
  min-width: 10px;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--ink);
}

@keyframes preview-card-flip {
  0% {
    transform: rotateY(180deg);
  }

  100% {
    transform: rotateY(360deg);
  }
}

.update-panel .resolution-unit-row {
  grid-template-columns: 1fr;
  justify-items: stretch;
}

.update-panel .resolution-unit-name {
  text-align: left;
}

.update-panel .resolution-adjust-grid {
  gap: 14px;
}

.update-panel .resolution-callout,
.update-panel .resolution-copy {
  line-height: 1.35;
}

.card-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-modal-title {
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.player-card-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 249, 237, 0.72);
  color: var(--ink);
  text-align: left;
}

.player-card-button.active {
  background: rgba(168, 120, 47, 0.16);
  border-color: rgba(145, 115, 62, 0.38);
}

.player-card-button strong {
  font-size: 0.8rem;
}

.wound-track {
  display: grid;
  gap: 12px;
}

.wound-slot {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: rgba(130, 130, 130, 0.34);
  border: 2px solid rgba(88, 76, 58, 0.2);
  display: grid;
  place-items: center;
}

.wound-slot img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  display: block;
}

.enemy-status-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.84rem;
  padding: 2px 2px 0;
}

.action-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding-top: 4px;
  overflow: hidden;
}

.action-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.action-bar-spacer {
  min-width: 0;
}

.enemy-scenario-title {
  display: grid;
  justify-items: center;
  align-self: end;
  gap: 2px;
  padding-top: 6px;
  min-width: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.05;
  text-align: center;
}

.action-button,
.mini-button {
  padding: 10px 16px;
}

.accent-button {
  background: linear-gradient(135deg, #914334 0%, #b24d3a 100%);
  border-color: transparent;
  color: white;
}

.ghost-button {
  background: rgba(239, 226, 199, 0.68);
}

.action-button[hidden],
.mini-button[hidden] {
  display: none;
}

.hex {
  fill: rgba(255, 248, 231, 0.28);
  stroke: rgba(82, 58, 24, 0.28);
  stroke-width: 2;
  transition: fill 140ms ease, stroke 140ms ease;
}

.hex.odd {
  fill: rgba(205, 180, 137, 0.42);
}

.hex:hover,
.hex.valid-target {
  fill: rgba(255, 214, 108, 0.55);
  stroke: rgba(112, 75, 14, 0.8);
}

.hex.selected {
  fill: rgba(103, 176, 214, 0.5);
  stroke: rgba(28, 79, 106, 0.95);
}

.hex.enemy-destination {
  fill: rgba(201, 95, 75, 0.5);
  stroke: rgba(115, 30, 20, 0.95);
}

.hex.enemy-blue-hex {
  fill: rgba(116, 156, 232, 0.34);
  stroke: rgba(73, 110, 191, 0.72);
}

.hex.enemy-yellow-hex {
  fill: rgba(244, 225, 146, 0.42);
  stroke: rgba(214, 178, 50, 0.76);
}

.hex-label {
  font-size: 12px;
  text-anchor: middle;
  fill: rgba(38, 29, 20, 0.48);
  pointer-events: none;
}

.enemy-trail {
  pointer-events: none;
}

.enemy-trail-hex {
  stroke: rgba(82, 58, 24, 0.2);
  stroke-width: 1.5;
}

.enemy-trail-start {
  stroke: rgba(61, 47, 26, 0.82);
  stroke-width: 3.2;
  stroke-dasharray: 10 6;
}

.enemy-trail-ghost {
  pointer-events: none;
  opacity: 0.34;
  filter: grayscale(0.1) drop-shadow(0 1px 2px rgba(61, 47, 26, 0.28));
}

.enemy-trail-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-anchor: middle;
  fill: rgba(61, 47, 26, 0.82);
  pointer-events: none;
}

.terrain {
  pointer-events: none;
}

.unit {
  cursor: pointer;
}

.unit-icon {
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.22));
}

.facing-indicator {
  fill: rgba(255, 255, 255, 0.96);
  stroke: rgba(61, 47, 26, 0.65);
  stroke-width: 2.2;
  pointer-events: none;
  filter: drop-shadow(0 0 2px rgba(61, 47, 26, 0.4));
}

.facing-selector {
  cursor: pointer;
}

.facing-selector-ring {
  fill: rgba(255, 249, 237, 0.92);
  stroke: rgba(145, 115, 62, 0.7);
  stroke-width: 2;
  transition: fill 140ms ease, transform 140ms ease;
}

.facing-selector:hover .facing-selector-ring {
  fill: rgba(255, 214, 108, 0.95);
}

.facing-selector-arrow {
  fill: rgba(61, 47, 26, 0.92);
  pointer-events: none;
}

.unit.selected .unit-icon {
  filter:
    drop-shadow(0 0 0.5px rgba(0, 0, 0, 0.4))
    drop-shadow(0 0 8px rgba(255, 214, 108, 0.9));
}

@media (max-width: 1200px) {
  .play-area {
    grid-template-columns: 170px minmax(0, 1fr) 230px;
  }

  .status-bar {
    grid-template-columns: 170px minmax(0, 1fr) 230px;
  }

  .status-line {
    gap: 12px;
    font-size: 0.9rem;
  }
}

@media (max-width: 900px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .app-shell {
    height: auto;
    grid-template-rows: auto auto auto;
  }

  .play-area {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    overflow: visible;
  }

  .status-bar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .app-title,
  .board-status {
    justify-content: center;
  }

  .status-spacer {
    display: none;
  }

  .log-column {
    order: 3;
    padding: 0;
  }

  .battle-log {
    max-height: 180px;
  }

  #board {
    min-height: 420px;
    max-height: none;
    width: 100%;
    height: auto;
    transform: none;
  }

  .board-stage {
    width: 100%;
    min-height: 420px;
    height: auto;
    --board-base-width: 100%;
    --board-base-height: 100%;
  }

  .enemy-viewer {
    grid-template-rows: auto auto auto auto;
    overflow: visible;
  }

  .enemy-card-row {
    grid-template-columns: 1fr;
  }

  .wound-panel {
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .wound-track {
    grid-auto-flow: column;
    justify-content: start;
  }

  .action-bar {
    grid-template-columns: 1fr;
  }

  .action-group,
  .board-toolbar {
    justify-content: center;
  }

  .action-bar-spacer {
    display: none;
  }

  .console-art,
  .enemy-card {
    max-height: none;
  }
}
