* {
  box-sizing: border-box;
}
:root {
  --bg: #10211f;
  --panel: #172b28;
  --panel2: #1b302d;
  --border: #ffffff14;
  --ink: #eee6d3;
  --muted: #9cafa4;
  --gold: #e8c78b;
  --accent: #86bfae;
  --faction: #79bff3;
  color-scheme: dark;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  overflow: hidden;
}
button,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--border);
  background: #ffffff05;
  border-radius: 5px;
  transition:
    background 0.14s,
    border-color 0.14s;
}
button:hover {
  background: #ffffff0b;
  border-color: #e8c78b66;
}
button:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
button:disabled {
  cursor: default;
  opacity: 0.45;
}
button:disabled:hover {
  border-color: var(--border);
}
button.active {
  color: var(--gold);
}
kbd {
  font:
    10px ui-monospace,
    monospace;
  padding: 2px 5px;
  border: 1px solid #ffffff20;
  border-radius: 3px;
  color: #b6c5b8;
  background: #ffffff04;
}
button[hidden],
[hidden] {
  display: none !important;
}
#topbar {
  height: 74px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(110deg, #1b302a, #10211f);
  position: relative;
  z-index: 2;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: Georgia, serif;
  font-size: 20px;
  letter-spacing: 2px;
  background: none;
  border: 0;
  text-align: left;
  padding: 0;
  white-space: nowrap;
}
.brand-mark {
  font-size: 39px;
  color: var(--gold);
}
.brand small {
  display: block;
  font:
    8px -apple-system,
    sans-serif;
  letter-spacing: 2.1px;
  color: #a0b5a7;
  margin-top: 5px;
}
.tiny-label,
.eyebrow {
  font-size: 9px;
  letter-spacing: 1.8px;
  color: var(--muted);
  font-weight: 600;
}
#match-label {
  border-left: 1px solid var(--border);
  padding-left: 24px;
  display: grid;
  gap: 6px;
  min-width: 126px;
}
#faction-label {
  color: #d3d8c6;
  font-size: 11px;
}
.economy {
  margin-left: auto;
  display: flex;
  gap: 28px;
}
.economy > div {
  display: grid;
  grid-template-columns: 22px auto;
  align-items: center;
  column-gap: 6px;
}
.resource-icon {
  grid-row: span 2;
  color: var(--gold);
  font-size: 23px;
}
.resource-icon.shakti {
  color: #c7acff;
}
.economy strong {
  font-variant-numeric: tabular-nums;
  font-size: 18px;
  font-weight: 500;
}
.economy small {
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--muted);
  margin-top: 3px;
}
.low-power {
  color: #ffac8c;
}
.match-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
}
.match-tools button {
  height: 29px;
  min-width: 29px;
}
.match-tools #clock {
  font:
    12px ui-monospace,
    monospace;
  color: #cfddcf;
  margin-right: 7px;
}
#game-layout {
  display: flex;
  height: calc(100dvh - 103px);
}
#battlefield {
  flex: 1;
  position: relative;
  min-width: 0;
  overflow: hidden;
}
#game {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  cursor: default;
  touch-action: none;
}
#map-heading {
  position: absolute;
  left: 26px;
  top: 22px;
  pointer-events: none;
  text-shadow: 0 2px 5px #0009;
}
#map-heading .tiny-label {
  color: #d4d3ae;
  font-size: 8px;
}
#map-heading h2 {
  font:
    22px Georgia,
    serif;
  font-weight: 400;
  margin: 8px 0 7px;
}
#field-tip {
  font-size: 11px;
  color: #d2d9c3;
  max-width: 490px;
  margin: 0;
  line-height: 1.6;
}
#notification {
  position: absolute;
  top: 112px;
  left: 26px;
  background: #142a24eb;
  border-left: 2px solid var(--gold);
  padding: 11px 16px;
  max-width: 480px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  font-size: 12px;
}
#notification.show {
  opacity: 1;
}
#notification.error {
  border-color: #f59c85;
}
#mode-banner {
  position: absolute;
  bottom: 54px;
  left: 50%;
  transform: translateX(-50%);
  padding: 11px 18px;
  background: #2d2821e8;
  border: 1px solid #d5ad6b66;
  border-radius: 5px;
  color: #efd3a1;
  white-space: nowrap;
  font-size: 11px;
}
#world-controls {
  position: absolute;
  bottom: 43px;
  left: 22px;
  display: flex;
  gap: 4px;
}
#world-controls button {
  width: 31px;
  height: 30px;
  background: #142822d9;
  border-color: #e1ddbc33;
  font-size: 18px;
  color: #dfddc5;
}
#field-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 20px;
  background: linear-gradient(0deg, #14261fdc, #14261f00);
  font-size: 8px;
  letter-spacing: 1.4px;
  color: #bcc9b8;
  pointer-events: none;
}
.live-dot {
  width: 5px;
  height: 5px;
  background: #95c9b2;
  border-radius: 50%;
  box-shadow: 0 0 8px #95c9b255;
}
.field-key {
  margin-left: auto;
  font-size: 8px;
  letter-spacing: 1px;
  color: #a9bda9;
}
.field-key b {
  font-weight: 400;
  color: #e5e9d7;
  letter-spacing: 0;
}
#sidebar {
  width: 300px;
  flex-shrink: 0;
  border-left: 1px solid #d5ceaa26;
  background: linear-gradient(135deg, #20352e, #152a26 70%);
  display: flex;
  flex-direction: column;
  padding: 0 16px 13px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #536357 transparent;
}
.commander {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 0 15px;
}
.commander > span:first-child {
  font-size: 29px;
  color: var(--faction);
}
.commander small {
  font-size: 8px;
  letter-spacing: 1.3px;
  color: var(--muted);
}
.commander h2 {
  font:
    22px Georgia,
    serif;
  font-weight: 400;
  margin: 3px 0 0;
}
.commander #army-count {
  margin-left: auto;
  color: #b8c8b8;
  font-size: 10px;
}
.tabs {
  display: flex;
  border-bottom: 1px solid #ffffff1c;
  margin-bottom: 10px;
}
.tabs button {
  flex: 1;
  border: 0;
  border-radius: 0;
  background: none;
  text-align: left;
  padding: 9px 6px;
  color: #9db3a4;
  font-size: 12px;
}
.tabs button.active {
  border-bottom: 2px solid var(--gold);
  color: var(--gold);
}
.tabs kbd {
  float: right;
}
#production-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.production-card {
  position: relative;
  text-align: left;
  background: linear-gradient(140deg, #ffffff05, #ffffff00);
  min-height: 101px;
  padding: 8px 9px;
  border-color: #c5d0b721;
  overflow: hidden;
}
.production-card img {
  width: 73px;
  height: 53px;
  object-fit: contain;
  position: absolute;
  right: 0;
  top: 0;
  image-rendering: pixelated;
  pointer-events: none;
}
.production-card .cost {
  font-size: 11px;
  color: var(--gold);
  display: block;
  position: relative;
  z-index: 1;
}
.production-card .time {
  display: block;
  font-size: 9px;
  color: #a1b39f;
  margin-top: 3px;
}
.production-card strong {
  display: block;
  font-size: 10px;
  line-height: 1.3;
  font-weight: 500;
  margin-top: 24px;
  padding-right: 2px;
  color: #e1e5d3;
}
.production-card .lock {
  font-size: 8px;
  display: block;
  line-height: 1.3;
  color: #acb8a6;
  margin-top: 3px;
}
.production-card .count {
  position: absolute;
  right: 6px;
  bottom: 7px;
  padding: 1px 5px;
  border: 1px solid #a8c2ab44;
  border-radius: 3px;
  font:
    10px ui-monospace,
    monospace;
}
.production-card:disabled {
  opacity: 0.52;
}
.section-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 1.4px;
  color: #b8c7b5;
  margin: 0 0 9px;
}
.section-label span {
  color: #8fa58f;
  font-weight: 400;
  letter-spacing: 0;
  font-size: 8px;
}
#queue-panel {
  margin-top: 17px;
}
.queue-row {
  border: 1px solid #ffffff14;
  border-radius: 4px;
  margin: 5px 0;
  position: relative;
  overflow: hidden;
  min-height: 35px;
  background: #11282055;
}
.queue-row .progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  background: #b8ca9b;
  transition: width 0.1s linear;
}
.queue-row button {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  width: 100%;
  min-height: 35px;
  text-align: left;
  padding: 7px 9px;
  font-size: 10px;
  align-items: center;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 5px;
}
.queue-row.ready {
  border-color: #d5be7166;
  background: #d5be7110;
  color: #ebd69e;
}
.queue-empty {
  color: #819b88;
  font-size: 10px;
  padding: 5px 0 0;
}
#selection-panel {
  border-top: 1px solid var(--border);
  padding-top: 13px;
  margin-top: 15px;
}
#selection {
  min-height: 67px;
}
.empty-selection {
  font:
    15px Georgia,
    serif;
  color: #c8d4bf;
  padding: 4px 0;
}
.empty-selection small {
  display: block;
  font:
    10px -apple-system,
    sans-serif;
  color: #829c87;
  margin-top: 7px;
}
.selected-info {
  position: relative;
  min-height: 71px;
  padding-left: 63px;
}
.selected-info img {
  position: absolute;
  left: 0;
  top: -7px;
  width: 62px;
  height: 67px;
  object-fit: contain;
  image-rendering: pixelated;
}
.selected-info strong {
  display: block;
  font:
    16px Georgia,
    serif;
  line-height: 1.2;
}
.selected-info .role {
  display: block;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 8px;
  color: var(--gold);
  margin: 5px 0 7px;
}
.selected-info .details {
  font-size: 10px;
  color: #a8c0ab;
  line-height: 1.5;
}
.selection-chips {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.selection-chips button {
  padding: 3px 6px;
  font-size: 9px;
}
.selection-chips img {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  image-rendering: pixelated;
}
#commands {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
#commands button {
  padding: 7px 9px;
  font-size: 10px;
  background: #b7cfb309;
}
#commands .ability {
  width: 100%;
  background: #d1b68d12;
  border-color: #d1b68d44;
  color: var(--gold);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
}
#minimap-wrap {
  margin-top: auto;
  padding-top: 17px;
}
#minimap {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #bfc4a63d;
  border-radius: 3px;
  cursor: crosshair;
}
footer {
  height: 29px;
  border-top: 1px solid var(--border);
  background: #0f201e;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 19px;
  color: #8da595;
  font-size: 8px;
  letter-spacing: 1px;
}
footer > span:first-child {
  color: #b9b995;
  font-size: 8px;
}
footer > span:nth-child(2) {
  letter-spacing: 0.4px;
}
footer button {
  margin-left: auto;
  border: 0;
  background: none;
  padding: 3px 6px;
  color: #bdc8b4;
  font-size: 9px;
}
#pause-shade {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: #0d221e55;
  backdrop-filter: blur(1px);
  cursor: pointer;
}
#pause-shade span {
  font:
    36px Georgia,
    serif;
  letter-spacing: 6px;
  color: #f2e3c1;
}
#pause-shade small {
  margin-top: 13px;
  color: #d0d6c2;
}
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #091b18dc;
  backdrop-filter: blur(8px);
  padding: 24px;
  overflow: auto;
}
.eyebrow {
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 2px;
}
.primary,
.secondary {
  padding: 12px 22px;
  font-size: 12px;
  border-radius: 4px;
}
.primary {
  background: var(--gold);
  color: #263329;
  border: 1px solid var(--gold);
  font-weight: 600;
}
.primary:hover {
  background: #f4d9a5;
  border-color: #f4d9a5;
}
.secondary {
  background: #acc69d08;
  border-color: #b5bf9844;
  color: #d2d9bf;
}
.text-button {
  border: 0;
  background: none;
  margin-left: auto;
  color: #b0c1a7;
  font-size: 10px;
}
.dialog {
  max-width: 800px;
  border: 1px solid #afbd9255;
  background: linear-gradient(140deg, #243d32, #142b27);
  box-shadow: 0 25px 90px #0008;
  border-radius: 8px;
  padding: 34px;
}
.dialog h2 {
  font:
    32px Georgia,
    serif;
  margin: 12px 0 24px;
  font-weight: 400;
}
.help-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.help-columns h3 {
  font-size: 11px;
  color: var(--gold);
  margin: 0 0 14px;
}
.help-columns p {
  color: #bdcfba;
  line-height: 1.6;
  font-size: 11px;
}
.help-columns kbd {
  font-size: 10px;
  color: #e0dfc9;
}
.help-note {
  padding: 16px 0;
  border-top: 1px solid var(--border);
  font-size: 11px;
  line-height: 1.8;
  color: #a8bfa6;
  margin-top: 20px;
}
.result-card {
  text-align: center;
  width: 500px;
}
.result-card h1 {
  font:
    62px Georgia,
    serif;
  color: #efd9a6;
  margin: 20px 0 14px;
  font-weight: 400;
}
.result-card p {
  color: #b9cdb3;
  line-height: 1.8;
}
.result-card .primary,
.result-card .secondary {
  display: block;
  width: 100%;
  margin-top: 10px;
}
#result-stats {
  display: flex;
  justify-content: space-around;
  padding: 20px 0;
  margin-bottom: 12px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
#result-stats strong {
  display: block;
  font:
    25px Georgia,
    serif;
  margin-bottom: 7px;
}
#result-stats small {
  font-size: 8px;
  letter-spacing: 1.4px;
  color: #99b099;
}
@media (max-height: 800px) {
  #topbar {
    height: 62px;
  }
  #game-layout {
    height: calc(100dvh - 91px);
  }
  .commander {
    padding: 12px 0;
  }
  .production-card {
    min-height: 87px;
  }
  .production-card strong {
    margin-top: 17px;
  }
  .production-card img {
    height: 45px;
  }
  #minimap {
    max-height: 150px;
  }
  .section-label {
    margin-bottom: 7px;
  }
  #selection-panel {
    margin-top: 11px;
    padding-top: 10px;
  }
  #queue-panel {
    margin-top: 12px;
  }
}
@media (max-width: 1150px) {
  #topbar {
    gap: 15px;
    padding: 0 15px;
  }
  .economy {
    gap: 17px;
  }
  #match-label {
    display: none;
  }
  #sidebar {
    width: 274px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .field-key {
    display: none;
  }
  #map-heading {
    left: 19px;
  }
}
@media (max-width: 760px) {
  body {
    min-width: 650px;
  }
  .overlay {
    padding: 15px;
  }
  .brand small {
    font-size: 7px;
  }
  .brand {
    font-size: 17px;
  }
  .economy {
    gap: 11px;
  }
  .match-tools {
    gap: 3px;
  }
  .match-tools button {
    min-width: 25px;
  }
  #topbar {
    gap: 9px;
  }
  .dialog {
    padding: 23px;
  }
  .help-columns {
    gap: 18px;
  }
}
/* Keep the map and command controls visible; scroll production choices when space is tight. */
#sidebar {
  overflow: hidden;
}
.commander,
.tabs,
#queue-panel,
#selection-panel,
#minimap-wrap {
  flex-shrink: 0;
}
#production-list {
  flex: 1;
  min-height: 90px;
  overflow-y: auto;
  grid-auto-rows: 101px;
  align-content: start;
  scrollbar-width: thin;
  scrollbar-color: #536357 transparent;
  padding-right: 3px;
}
#queue-panel {
  max-height: 115px;
  overflow-y: auto;
  scrollbar-width: thin;
}
#minimap-wrap {
  margin-top: 0;
}
#minimap {
  height: auto;
  max-height: 155px;
}
@media (max-height: 800px) {
  #production-list {
    grid-auto-rows: 87px;
  }
  #minimap {
    max-height: 122px;
  }
  #minimap-wrap {
    padding-top: 12px;
  }
  #queue-panel {
    max-height: 91px;
  }
  .commander {
    padding: 11px 0;
  }
  .tabs {
    margin-bottom: 8px;
  }
  #selection {
    min-height: 58px;
  }
  .selected-info {
    min-height: 62px;
  }
}
/* Title screen */
.title-screen {
  align-items: flex-start;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  background: radial-gradient(
      circle at 72% 42%,
      color-mix(in srgb, var(--faction) 18%, transparent),
      transparent 38%
    ),
    radial-gradient(ellipse at 50% 120%, #c9772a40, transparent 55%),
    radial-gradient(ellipse at 50% -20%, #1e4a4166, transparent 60%), #07120fee;
  backdrop-filter: blur(10px);
  overflow-x: hidden;
}
.mandala {
  position: fixed;
  width: min(130vmax, 1500px);
  aspect-ratio: 1;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  fill: none;
  stroke: #e8c78b;
  stroke-width: 0.35;
  opacity: 0.09;
  pointer-events: none;
  animation: mandala-turn 240s linear infinite;
}
.mandala use {
  fill: #e8c78b0c;
}
@keyframes mandala-turn {
  to {
    rotate: 360deg;
  }
}
.embers {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.embers i {
  position: absolute;
  bottom: -10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffcf7a;
  box-shadow: 0 0 8px 2px #ff9d3c88;
  opacity: 0;
  animation: ember-rise 11s linear infinite;
}
.embers i:nth-child(1) {
  left: 8%;
  animation-delay: 0s;
}
.embers i:nth-child(2) {
  left: 21%;
  animation-delay: 4s;
  animation-duration: 14s;
}
.embers i:nth-child(3) {
  left: 34%;
  animation-delay: 7s;
}
.embers i:nth-child(4) {
  left: 49%;
  animation-delay: 2s;
  animation-duration: 13s;
}
.embers i:nth-child(5) {
  left: 63%;
  animation-delay: 9s;
}
.embers i:nth-child(6) {
  left: 76%;
  animation-delay: 5s;
  animation-duration: 15s;
}
.embers i:nth-child(7) {
  left: 88%;
  animation-delay: 1s;
}
.embers i:nth-child(8) {
  left: 95%;
  animation-delay: 6s;
  animation-duration: 12s;
}
@keyframes ember-rise {
  10% {
    opacity: 0.8;
  }
  80% {
    opacity: 0.5;
  }
  to {
    opacity: 0;
    transform: translate(30px, -105vh) scale(0.4);
  }
}
.title-screen .menu-card {
  margin: auto;
  width: 980px;
  max-width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-areas:
    'top top'
    'title hero'
    'choose hero'
    'settings hero'
    'actions actions'
    'foot foot';
  column-gap: 36px;
  padding: 26px 36px 22px;
  border: 1px solid #e8c78b40;
  border-radius: 14px;
  background:
    linear-gradient(#0000, #0000) padding-box,
    linear-gradient(160deg, #1d3a33f2, #0f241ff5 60%, #1a1a14f5);
  box-shadow:
    0 30px 120px #000a,
    inset 0 1px 0 #ffffff12,
    inset 0 0 0 6px #0b1a17,
    inset 0 0 0 7px #e8c78b1c;
  position: relative;
  animation: card-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
}
.menu-topline {
  grid-area: top;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 9px;
  letter-spacing: 2px;
  color: #b7c5a7;
  padding-bottom: 14px;
  border-bottom: 1px solid #e8c78b22;
}
.menu-topline > span:last-child {
  color: #809d88;
}
.menu-title {
  grid-area: title;
  padding-top: 26px;
}
.menu-title .eyebrow {
  font-size: 10px;
  letter-spacing: 3px;
}
.menu-title h1 {
  font:
    400 76px/0.95 Georgia,
    'Times New Roman',
    serif;
  letter-spacing: -1px;
  margin: 12px 0 10px;
  background: linear-gradient(180deg, #fff3d4 10%, #f0cf86 55%, #c98d3e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 #0006) drop-shadow(0 0 22px #e8a84a33);
}
.title-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
  font-size: 12px;
  max-width: 330px;
}
.title-rule span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e8c78b99);
}
.title-rule span:last-child {
  background: linear-gradient(90deg, #e8c78b99, transparent);
}
.menu-title p {
  color: #c5d2bf;
  font-size: 14px;
  line-height: 1.6;
  margin: 14px 0 0;
}
.hero-art {
  grid-area: hero;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-top: 18px;
  pointer-events: none;
}
.hero-art .halo {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 300px;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--faction) 45%, transparent);
  background: radial-gradient(circle, color-mix(in srgb, var(--faction) 30%, transparent), transparent 66%);
  transition:
    background 0.4s,
    border-color 0.4s;
}
.halo:before,
.halo:after {
  content: '';
  position: absolute;
  border-radius: 50%;
}
.halo:before {
  inset: 14px;
  border: 1px dashed #e8c78b40;
  animation: mandala-turn 60s linear infinite reverse;
}
.halo:after {
  inset: -16px;
  border: 1px solid #e8c78b18;
}
.hero-art img {
  position: relative;
  width: 300px;
  height: 300px;
  object-fit: contain;
  filter: drop-shadow(0 14px 14px #0008);
  animation: hero-float 5s ease-in-out infinite;
}
@keyframes hero-float {
  50% {
    translate: 0 -7px;
  }
}
.hero-caption {
  position: relative;
  text-align: center;
  margin-top: 6px;
  display: grid;
  gap: 4px;
}
.hero-caption small {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--faction);
}
.hero-caption strong {
  font:
    italic 400 15px Georgia,
    serif;
  color: #e6e1cc;
}
.menu-choose {
  grid-area: choose;
  margin-top: 26px;
}
.menu-choose .section-label {
  font-size: 9px;
  letter-spacing: 2px;
  color: #c8d2bd;
}
.faction-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.faction-choice {
  --c: var(--faction);
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 16px 8px 14px;
  min-height: 112px;
  border-radius: 10px;
  border: 1px solid #ffffff1a;
  background: linear-gradient(180deg, #ffffff08, #ffffff02);
  text-align: center;
  transition:
    transform 0.15s,
    border-color 0.15s,
    background 0.15s,
    box-shadow 0.15s;
}
.faction-choice:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--c) 60%, transparent);
}
.faction-choice.selected {
  border-color: var(--c);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 22%, transparent), #ffffff03);
  box-shadow:
    0 0 0 1px var(--c),
    0 8px 28px color-mix(in srgb, var(--c) 30%, transparent);
}
.faction-choice.selected:after {
  content: '✓';
  position: absolute;
  top: 7px;
  right: 9px;
  font-size: 11px;
  color: var(--c);
}
.faction-choice .symbol {
  font-size: 28px;
  line-height: 1;
  color: var(--c);
  text-shadow: 0 0 16px color-mix(in srgb, var(--c) 70%, transparent);
}
.faction-choice strong {
  font:
    400 22px Georgia,
    serif;
  color: #f0ead6;
}
.faction-choice small {
  font-size: 9px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #a9bba5;
}
.menu-settings {
  grid-area: settings;
  display: flex;
  gap: 24px;
  margin-top: 20px;
  align-items: end;
}
.menu-settings label {
  font-size: 9px;
  letter-spacing: 1.6px;
  color: #a6bba3;
  display: grid;
  gap: 7px;
  flex: 1;
  max-width: 240px;
}
.menu-settings select {
  padding: 11px 12px;
  min-height: 44px;
  background: #0c1f1a;
  border: 1px solid #e8c78b33;
  border-radius: 8px;
  color: #e3e6d3;
  font-size: 13px;
}
.map-info {
  display: grid;
  gap: 4px;
  padding-bottom: 3px;
}
.map-info strong {
  font-size: 14px;
  font-weight: 500;
}
.map-info small {
  font-size: 11px;
  color: #93ab93;
}
.menu-actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e8c78b22;
}
.menu-actions .primary,
.menu-actions .secondary {
  min-height: 50px;
  padding: 0 26px;
  border-radius: 10px;
  font-size: 14px;
}
.menu-actions .primary {
  min-width: 220px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #2b1d0b;
  border: 1px solid #ffe2a6;
  background: linear-gradient(180deg, #ffe3a8, #e9b75e 60%, #d79a3f);
  box-shadow:
    0 6px 22px #e8a84a44,
    inset 0 1px 0 #fff8;
}
.menu-actions .primary:not(:disabled):hover {
  background: linear-gradient(180deg, #fff0c8, #f2c672 60%, #e0a64c);
  transform: translateY(-1px);
}
.menu-actions .text-button {
  margin-left: auto;
  border: 0;
  background: none;
  color: #b8c8ae;
  font-size: 12px;
  min-height: 44px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #b8c8ae55;
}
.menu-footnote {
  grid-area: foot;
  font-size: 11px;
  color: #8fa38e;
  margin: 14px 0 0;
}
@media (max-width: 900px) {
  .title-screen .menu-card {
    grid-template-columns: 1fr;
    grid-template-areas: 'top' 'title' 'hero' 'choose' 'settings' 'actions' 'foot';
    padding: 18px 18px 16px;
    text-align: center;
  }
  .menu-title {
    padding-top: 18px;
  }
  .menu-title h1 {
    font-size: clamp(46px, 14vw, 68px);
  }
  .title-rule {
    margin: 0 auto;
  }
  .menu-title p {
    font-size: 13px;
  }
  .hero-art {
    padding-top: 6px;
  }
  .hero-art .halo {
    width: 190px;
  }
  .hero-art img {
    width: 200px;
    height: 200px;
  }
  .menu-choose {
    margin-top: 18px;
  }
  .menu-choose .section-label {
    justify-content: center;
  }
  .faction-choice {
    min-height: 0;
    padding: 12px 4px 10px;
  }
  .faction-choice strong {
    font-size: 19px;
  }
  .faction-choice small {
    font-size: 8px;
    letter-spacing: 0.8px;
  }
  .menu-settings {
    justify-content: center;
    text-align: left;
  }
  .menu-actions {
    flex-direction: column;
    align-items: stretch;
    margin-top: 18px;
    padding-top: 16px;
  }
  .menu-actions .text-button {
    margin: 0 auto;
  }
}
/* Short landscape screens, such as a phone on its side. */
@media (max-height: 520px) and (min-width: 600px) {
  .title-screen .menu-card {
    grid-template-columns: minmax(0, 1fr) 220px;
    grid-template-areas: 'title hero' 'choose hero' 'settings hero' 'actions actions';
    padding: 14px 20px;
    text-align: left;
  }
  .menu-topline,
  .menu-footnote,
  .menu-title .eyebrow,
  .menu-title p {
    display: none;
  }
  .menu-title {
    padding-top: 0;
  }
  .menu-title h1 {
    font-size: 40px;
    margin: 0 0 4px;
  }
  .title-rule {
    margin: 0;
  }
  .hero-art .halo {
    width: 170px;
  }
  .hero-art img {
    width: 180px;
    height: 180px;
  }
  .menu-choose {
    margin-top: 10px;
  }
  .menu-choose .section-label {
    justify-content: flex-start;
  }
  .faction-choice {
    padding: 8px 4px;
  }
  .faction-choice .symbol {
    font-size: 20px;
  }
  .faction-choice small {
    display: none;
  }
  .menu-settings {
    margin-top: 10px;
    justify-content: flex-start;
  }
  .menu-actions {
    flex-direction: row;
    margin-top: 12px;
    padding-top: 12px;
  }
  .menu-actions .text-button {
    margin-left: auto;
    margin-right: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mandala,
  .embers,
  .halo:before,
  .hero-art img,
  .title-screen .menu-card {
    animation: none;
  }
  .embers {
    display: none;
  }
}
/* The match HUD needs 650px, but the title screen fits any phone width. */
@media (max-width: 760px) {
  body:has(#menu:not([hidden])) {
    min-width: 0;
  }
  body:has(#menu:not([hidden])) > :not(.overlay) {
    overflow: hidden;
  }
}
@media (max-width: 480px) {
  .menu-topline {
    display: none;
  }
}
