:root {
  color-scheme: dark;
  --bg: #0d1013;
  --panel: #15191e;
  --panel-light: #1b2026;
  --line: #2a3037;
  --text: #edf0ed;
  --muted: #899398;
  --amber: #e9b661;
  --teal: #65c8bd;
  --violet: #af94e5;
  --danger: #ee8179;
  --radius: 12px;
  font-family: Arial, Helvetica, sans-serif;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  background-image: radial-gradient(
    ellipse at 25% 0,
    rgba(77, 85, 69, 0.08),
    transparent 50%
  );
}
button,
input {
  font: inherit;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}
button {
  transition:
    background 0.15s,
    border-color 0.15s,
    opacity 0.15s,
    transform 0.15s;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 4px;
}
button:not(:disabled):active {
  transform: translateY(1px);
}
input {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #101418;
  color: var(--text);
  padding: 13px 14px;
  width: 100%;
  outline: none;
}
input:focus {
  border-color: var(--amber);
}
input::placeholder {
  color: #606d74;
}
input[type="number"] {
  padding: 8px;
  width: 60px;
}
a {
  color: inherit;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h2 {
  font-size: 23px;
  line-height: 1.25;
  letter-spacing: -0.6px;
}
h3 {
  font-size: 15px;
  line-height: 1.4;
}
button svg {
  pointer-events: none;
}
[hidden] {
  display: none !important;
}
.site-shell {
  max-width: 1600px;
  margin: auto;
  padding: 0 44px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 105px;
  border-bottom: 1px solid var(--line);
  gap: 20px;
}
.brand {
  display: flex;
  gap: 13px;
  align-items: center;
  text-decoration: none;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1.8px;
  white-space: nowrap;
}
.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  width: 42px;
  border: 1px solid #5c513b;
  background: #252218;
  color: var(--amber);
  font-size: 30px;
  border-radius: 7px;
}
.brand-amp {
  color: var(--amber);
  font-weight: 400;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 2.3px;
  margin-top: 3px;
  font-weight: 400;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 22px;
}
.prototype-label {
  font-size: 9px;
  letter-spacing: 1.8px;
  color: var(--muted);
}
.connection-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 10px;
  color: var(--muted);
}
.connection-pill span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
}
.connection-pill.online span {
  background: var(--teal);
  box-shadow: 0 0 7px #65c8bd66;
}
.connection-pill b {
  font-weight: 400;
}
.icon-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 50%;
  width: 29px;
  height: 29px;
  font-size: 15px;
}
.icon-button:hover {
  color: var(--text);
  border-color: var(--muted);
}
.entrance {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 35px 80px;
  padding: 70px 25px 35px;
}
.eyebrow,
.section-overline {
  font-size: 9px;
  letter-spacing: 1.7px;
  font-weight: 700;
  color: var(--muted);
}
.eyebrow {
  color: var(--amber);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.tiny-line {
  display: inline-block;
  width: 24px;
  height: 1px;
  background: currentColor;
}
.hero h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(45px, 4.4vw, 70px);
  line-height: 1.05;
  letter-spacing: -3px;
  font-weight: 400;
}
.hero h1 > span {
  color: var(--amber);
}
.hero-copy {
  max-width: 420px;
  margin-top: 23px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--muted);
}
.hero-art {
  height: 290px;
  position: relative;
  margin-top: 18px;
  overflow: hidden;
}
.art-grid {
  position: absolute;
  inset: 5px 0;
  background-image:
    linear-gradient(#27302966 1px, transparent 1px),
    linear-gradient(90deg, #27302966 1px, transparent 1px);
  background-size: 35px 35px;
  transform: perspective(400px) rotateX(45deg) rotateZ(-18deg) scale(0.9);
  mask-image: radial-gradient(ellipse, #000 15%, transparent 67%);
}
.art-orbit {
  position: absolute;
  border: 1px solid #343b36;
  border-radius: 50%;
  transform: rotate(-17deg);
  width: 310px;
  height: 122px;
  left: 10%;
  top: 95px;
}
.orbit-two {
  width: 390px;
  height: 170px;
  left: 3%;
  top: 70px;
  border-style: dashed;
  opacity: 0.45;
}
.art-piece {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(140deg, #34301e, #1a1c18);
  color: var(--amber);
  box-shadow:
    0 18px 40px #0007,
    inset 0 0 0 1px #d9ac5144;
  transform: rotate(-12deg);
  border-radius: 16px;
}
.piece-amber {
  left: 36%;
  top: 24px;
  width: 112px;
  height: 142px;
}
.piece-amber > span {
  font-size: 80px;
  line-height: 1;
}
.art-piece > small {
  font-size: 7px;
  letter-spacing: 2px;
  margin-top: 9px;
}
.piece-teal {
  left: 13%;
  top: 117px;
  height: 74px;
  width: 68px;
  background: linear-gradient(140deg, #223631, #132622);
  color: var(--teal);
  box-shadow:
    0 18px 40px #0007,
    inset 0 0 0 1px #65c8bd44;
  font-size: 48px;
}
.piece-violet {
  left: 68%;
  top: 127px;
  height: 68px;
  width: 62px;
  background: linear-gradient(140deg, #31263e, #20182e);
  color: var(--violet);
  box-shadow:
    0 18px 40px #0007,
    inset 0 0 0 1px #af94e544;
  font-size: 43px;
  transform: rotate(8deg);
}
.art-resource {
  position: absolute;
  font-size: 16px;
  color: var(--teal);
  text-shadow: 0 0 18px #65c8bd66;
}
.resource-one {
  top: 185px;
  left: 42%;
}
.resource-two {
  top: 73px;
  left: 23%;
  font-size: 10px;
}
.resource-three {
  top: 111px;
  left: 61%;
  font-size: 11px;
}
.art-caption {
  position: absolute;
  bottom: 18px;
  left: 0;
  font-size: 8px;
  color: #64716d;
  letter-spacing: 1.6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.art-caption > span {
  height: 5px;
  width: 5px;
  border-radius: 50%;
  background: #64716d;
}
.entry-card {
  align-self: start;
  background: linear-gradient(145deg, #1b2024, #13171b);
  border: 1px solid #353b40;
  border-radius: 16px;
  padding: 32px 33px;
  box-shadow: 0 16px 50px #0003;
}
.entry-card h2 {
  margin: 9px 0;
  font-size: 29px;
  letter-spacing: -0.8px;
  font-family: Georgia, serif;
  font-weight: 400;
}
.muted {
  color: var(--muted);
  font-size: 12px;
}
.field-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.25px;
  color: #a8b0b4;
  margin: 25px 0 9px;
}
.team-choice {
  padding: 0;
  margin: 0;
  border: 0;
  min-width: 0;
}
.team-choice legend {
  padding: 0;
}
.team-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.team-option {
  position: relative;
  cursor: pointer;
}
.team-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.team-option > span {
  display: block;
  border: 1px solid var(--line);
  padding: 14px 8px 12px;
  border-radius: 7px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  transition: all 0.15s;
}
.team-option i {
  display: block;
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  margin: 0 auto 7px;
  background: var(--team-color);
}
.team-option small {
  display: block;
  font-size: 5.5px;
  letter-spacing: 0.7px;
  margin-top: 5px;
}
.team-option input:checked + span {
  border-color: var(--team-color);
  background: color-mix(in srgb, var(--team-color) 10%, transparent);
  color: var(--team-color);
}
.team-option input:focus-visible + span {
  outline: 2px solid var(--team-color);
  outline-offset: 3px;
}
.amber {
  --team-color: var(--amber);
}
.teal {
  --team-color: var(--teal);
}
.violet {
  --team-color: var(--violet);
}
.entry-tabs {
  display: flex;
  background: #0e1316;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px;
  margin: 24px 0 14px;
}
.entry-tabs > button {
  width: 50%;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px;
  border-radius: 4px;
  font-size: 11px;
}
.entry-tabs > [aria-selected="true"] {
  background: #2a3036;
  color: var(--text);
}
#code-field .field-label {
  margin-top: 12px;
}
#room-code {
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 14px;
}
.button {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 11px 15px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}
.button-primary {
  background: var(--amber);
  color: #242217;
}
.button-primary:not(:disabled):hover {
  background: #f4ca85;
}
.button-primary > span {
  font-size: 17px;
  line-height: 1;
}
.entry-submit {
  width: 100%;
  justify-content: space-between;
  padding: 13px 17px;
}
.entry-feedback {
  font-size: 10px;
  text-align: center;
  color: #6e7a80;
  margin: 11px 0 0;
  min-height: 15px;
}
.entry-feedback.error {
  color: var(--danger);
}
.entry-footnote {
  margin-top: 24px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  color: #727d83;
  font-size: 7px;
  letter-spacing: 0.8px;
}
.small-dot {
  display: inline-block;
  height: 4px;
  width: 4px;
  border-radius: 50%;
  background: var(--teal);
}
.principles {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 35px;
  border-top: 1px solid var(--line);
  padding-top: 30px;
}
.principles article {
  display: flex;
  gap: 15px;
}
.principle-number {
  font-family: Georgia, serif;
  color: var(--amber);
  font-size: 15px;
}
.principles h3 {
  font-size: 13px;
  font-weight: 500;
}
.principles p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 7px;
  line-height: 1.65;
  max-width: 270px;
}
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 27px 0 22px;
  color: #59656c;
  font-size: 9px;
}
.footer > span:first-child {
  font-size: 8px;
  letter-spacing: 1.2px;
}
.text-button {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 10px;
  padding: 4px 0;
}
.text-button:hover {
  color: var(--text);
}
.text-button > span {
  margin-left: 10px;
}
.game {
  padding-top: 22px;
}
.room-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}
.room-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 9px;
  letter-spacing: 1.4px;
  color: #b4bdc0;
}
.live-dot,
.tiny-live-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 10px #65c8bd44;
}
.room-id {
  color: #69777d;
  margin-left: 15px;
  border-left: 1px solid var(--line);
  padding-left: 20px;
}
.room-id > b {
  color: var(--text);
  letter-spacing: 2px;
  margin-left: 6px;
}
.room-buttons {
  display: flex;
  gap: 22px;
}
.team-scoreboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
  margin-bottom: 22px;
}
.team-score {
  border: 1px solid var(--line);
  border-top: 2px solid color-mix(in srgb, var(--team-color) 70%, transparent);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--team-color) 7%, var(--panel)),
    var(--panel)
  );
  border-radius: 8px;
  padding: 16px 18px;
  display: flex;
  gap: 15px;
  align-items: center;
}
.team-score.defeated {
  opacity: 0.4;
  filter: grayscale(0.5);
}
.team-score-symbol {
  font-size: 26px;
  color: var(--team-color);
  line-height: 1;
}
.team-score-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--team-color);
}
.team-score-subtitle {
  font-size: 9px;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.team-score-vault {
  margin-left: auto;
  text-align: right;
}
.team-score-vault strong {
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 400;
}
.team-score-vault span {
  font-size: 9px;
  color: var(--team-color);
  margin-left: 4px;
}
.team-score-vault small {
  display: block;
  font-size: 7px;
  color: var(--muted);
  letter-spacing: 1px;
}
.battle-layout {
  display: grid;
  grid-template-columns: 220px minmax(350px, 1fr) 235px;
  gap: 20px;
  align-items: start;
}
.left-sidebar,
.right-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  padding: 18px;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 17px;
}
.panel-heading .section-overline {
  font-size: 8px;
  letter-spacing: 1.25px;
}
.role-badge {
  font-size: 6px;
  letter-spacing: 0.7px;
  padding: 3px 5px;
  border: 1px solid #41464a;
  border-radius: 3px;
  color: var(--muted);
}
.role-badge.leader {
  color: var(--amber);
  border-color: #6c5734;
  background: #292319;
}
.identity {
  display: flex;
  align-items: center;
  gap: 11px;
}
.avatar {
  height: 39px;
  width: 39px;
  border-radius: 7px;
  color: var(--team-color, var(--amber));
  background: color-mix(
    in srgb,
    var(--team-color, var(--amber)) 10%,
    transparent
  );
  border: 1px solid
    color-mix(in srgb, var(--team-color, var(--amber)) 40%, transparent);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.identity h2 {
  font-size: 16px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.2px;
}
.identity p {
  font-size: 9px;
  margin-top: 2px;
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 20px;
  gap: 8px;
}
.stats-row > div {
  position: relative;
}
.stats-row strong {
  font-size: 22px;
  font-weight: 500;
}
.stat-icon {
  font-size: 10px;
  color: var(--danger);
  margin-right: 4px;
}
.stats-row small {
  display: block;
  font-size: 6px;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-top: 3px;
}
.amber-text {
  color: var(--amber) !important;
}
.teal-text {
  color: var(--teal) !important;
}
.energy-track,
.election-progress {
  height: 3px;
  background: #2b3034;
  overflow: hidden;
  border-radius: 4px;
}
.energy-track {
  margin: 17px 0 10px;
}
.energy-track i,
.election-progress i {
  height: 100%;
  width: 100%;
  display: block;
  background: var(--amber);
  transition: width 0.3s;
}
.status-copy {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}
.key-badge {
  font-size: 6px;
  color: #65747b;
  white-space: nowrap;
}
.movement-controls {
  display: grid;
  grid-template-columns: repeat(3, 37px);
  grid-template-rows: repeat(3, 31px);
  gap: 5px;
  justify-content: center;
  padding: 1px 0 20px;
}
.movement-controls > button {
  background: #20272d;
  border: 1px solid #343d43;
  color: #bdc6c9;
  border-radius: 5px;
  font-size: 18px;
  line-height: 1;
}
.movement-controls > button:not(:disabled):hover {
  background: #333c43;
  color: #fff;
}
.move-up {
  grid-area: 1/2;
}
.move-left {
  grid-area: 2/1;
}
.move-center {
  grid-area: 2/2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #556369;
}
.move-right {
  grid-area: 2/3;
}
.move-down {
  grid-area: 3/2;
}
.command-buttons {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.action-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  background: #1c2329;
  border: 1px solid #313a42;
  padding: 9px 10px;
  border-radius: 5px;
  color: #c6ced0;
  font-size: 10px;
}
.action-button > span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.action-button b {
  color: var(--teal);
  font-size: 13px;
  min-width: 12px;
  text-align: center;
  font-weight: 400;
}
.action-button small {
  color: #77888e;
  font-size: 8px;
}
.action-button:not(:disabled):hover {
  background: #2a3339;
  border-color: #52636c;
}
.capture-button b {
  color: var(--amber);
}
.capture-button:not(:disabled) {
  border-color: #71603c;
  color: var(--amber);
  background: #2b281e;
}
.micro-copy {
  color: #7e8c93;
  font-size: 9px;
  line-height: 1.65;
  margin-top: 13px;
}
.battlefield-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
}
.battlefield-heading .section-overline {
  font-size: 7px;
  letter-spacing: 1.35px;
}
.battlefield-heading h2 {
  font-family: Georgia, serif;
  font-size: 23px;
  font-weight: 400;
  letter-spacing: -0.5px;
  margin-top: 3px;
}
.coordinates {
  font-size: 9px;
  color: #617179;
  font-family: monospace;
}
.board-frame {
  padding: 9px;
  background: #11171a;
  border: 1px solid #39423f;
  position: relative;
  border-radius: 8px;
  box-shadow: 0 16px 35px #0002;
}
.board {
  display: grid;
  grid-template-columns: repeat(15, minmax(0, 1fr));
  gap: 2px;
  aspect-ratio: 15/11;
  background: #131b1b;
  position: relative;
  overflow: hidden;
  border-radius: 3px;
}
.cell {
  position: relative;
  min-width: 0;
  padding: 0;
  background: #1b2422;
  border: 1px solid transparent;
  border-radius: 2px;
  overflow: visible;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #74857b;
  outline-offset: 0 !important;
}
.cell:nth-child(3n) {
  background: #1d2724;
}
.cell:nth-child(7n) {
  background: #202a25;
}
.cell:nth-child(13n) {
  background: #222b26;
}
.cell:hover {
  border-color: #59694f;
  z-index: 1;
}
.cell.resource-cell {
  background: #20352e;
}
.cell.base-cell {
  background: color-mix(in srgb, var(--team-color) 20%, #192123);
  border-color: color-mix(in srgb, var(--team-color) 45%, transparent);
}
.cell.king-cell {
  background: color-mix(in srgb, var(--team-color) 11%, #192123);
}
.cell.adjacent-cell {
  box-shadow: inset 0 0 0 1px #bca36740;
}
.cell.selected-cell {
  border-color: var(--text);
  z-index: 2;
}
.cell.own-cell {
  border-color: var(--amber);
  z-index: 2;
  box-shadow: 0 0 9px #e9b66133;
}
.resource-marker {
  color: #5fc4b0;
  font-size: clamp(10px, 1.4vw, 20px);
  line-height: 1;
  text-shadow: 0 0 12px #65c8bd33;
}
.tile-amount {
  position: absolute;
  bottom: 1px;
  right: 2px;
  font-size: 6px;
  color: #7e9f90;
}
.king-marker {
  font-size: clamp(17px, 2vw, 30px);
  color: var(--team-color);
  line-height: 1;
  text-shadow: 0 0 10px color-mix(in srgb, var(--team-color) 25%, transparent);
}
.base-marker {
  font-size: clamp(10px, 1.5vw, 21px);
  line-height: 1;
  color: var(--team-color);
  opacity: 0.85;
}
.unit-marker {
  background: var(--team-color);
  color: #14211e;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  width: 66%;
  height: 68%;
  max-width: 30px;
  max-height: 30px;
  font-size: clamp(6px, 0.8vw, 12px);
  font-weight: 700;
  line-height: 1;
  position: relative;
  z-index: 3;
  box-shadow:
    0 2px 6px #0007,
    inset 0 0 0 1px #fff3;
}
.unit-marker.own-unit {
  outline: 2px solid #e8efe9;
  outline-offset: 2px;
}
.unit-marker.leader-unit:before {
  content: "♛";
  position: absolute;
  top: -9px;
  right: -5px;
  color: #fff;
  font-size: 12px;
  text-shadow: 0 1px 3px #000;
}
.unit-marker.offline-unit {
  opacity: 0.45;
}
.unit-count {
  position: absolute;
  top: 0;
  right: 1px;
  z-index: 4;
  color: white;
  font-size: 6px;
  background: #1d292d;
  line-height: 1;
  padding: 2px;
  border-radius: 2px;
}
.cell .unit-marker ~ .king-marker,
.cell .unit-marker ~ .base-marker {
  position: absolute;
  bottom: 0;
  left: 1px;
  font-size: 10px;
  opacity: 0.8;
  z-index: 4;
}
.board-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 6;
  width: min(88%, 350px);
  padding: 27px 24px;
  border: 1px solid #53574b;
  border-radius: 10px;
  background: #151c1bf5;
  box-shadow: 0 10px 50px #0009;
  text-align: center;
  backdrop-filter: blur(7px);
}
.board-overlay .section-overline {
  font-size: 7px;
  color: var(--amber);
}
.board-overlay h3 {
  font-family: Georgia, serif;
  font-size: 30px;
  letter-spacing: -1px;
  font-weight: 400;
  margin-top: 9px;
}
.board-overlay p {
  font-size: 11px;
  color: #9daaa8;
  line-height: 1.7;
  margin: 9px 0 17px;
}
.board-overlay .button {
  width: 100%;
  justify-content: space-between;
}
.board-legend {
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 12px 1px;
  font-size: 8px;
  color: #798b90;
}
.board-legend > span {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.board-legend b {
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  color: #abbaa7;
}
.legend-player {
  width: 8px;
  height: 8px;
  background: var(--amber);
  border: 1px solid white;
  outline: 1px solid var(--amber);
  outline-offset: 1px;
  border-radius: 1px;
  margin-right: 2px;
}
.legend-tip {
  margin-left: auto;
  color: #51636b;
  font-size: 7px;
}
.selected-panel {
  padding: 17px 18px;
  min-height: 104px;
}
.selected-empty {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
}
.selection-cross {
  font-size: 32px;
  color: #52656d;
}
.selected-empty h3 {
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: 17px;
  letter-spacing: -0.1px;
}
.selected-empty p {
  font-size: 9px;
  color: var(--muted);
  margin-top: 5px;
}
.selection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.selection-heading .section-overline {
  font-size: 7px;
}
.selection-heading h3 {
  font-size: 15px;
  margin-top: 3px;
}
.selection-stats {
  font-size: 10px;
  color: #9bafb1;
  text-align: right;
}
.selection-actions {
  display: flex;
  gap: 8px;
  margin-top: 13px;
  flex-wrap: wrap;
}
.button-subtle {
  background: #273129;
  color: #c2d5c6;
  border-color: #445546;
}
.button-subtle:not(:disabled):hover {
  background: #3b4a3e;
}
.button-danger {
  background: #362825;
  border-color: #66463d;
  color: #e5a299;
}
.button-danger:not(:disabled):hover {
  background: #51322d;
}
.selection-actions .button {
  padding: 8px 10px;
  font-size: 9px;
}
.distribution-controls {
  display: flex;
  gap: 5px;
}
.distribution-controls > input {
  font-size: 10px;
  width: 46px;
  padding: 6px;
}
.ballot-icon {
  color: #768984;
  font-size: 15px;
}
.election-countdown {
  display: flex;
  gap: 15px;
  align-items: center;
}
.election-countdown h2 {
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: 39px;
  line-height: 1.1;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.election-countdown > span {
  font-size: 7px;
  letter-spacing: 1px;
  color: #7f8c91;
  line-height: 1.7;
}
.election-progress {
  margin-top: 16px;
}
.election-progress i {
  background: #7b9385;
}
.election-panel .micro-copy {
  font-size: 8px;
}
.count-badge {
  background: #263138;
  border-radius: 3px;
  font-size: 8px;
  color: #98acb3;
  padding: 1px 5px;
}
.roster-panel {
  padding-bottom: 9px;
}
.roster {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 275px;
  overflow: auto;
}
.roster-team-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--team-color);
  font-size: 7px;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  padding: 8px 0 4px;
}
.roster-team-label > span:last-child {
  color: #64777e;
  font-size: 6px;
}
.roster-player {
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  width: 100%;
}
.roster-player:hover,
.roster-player.selected {
  background: #232d31;
  border-color: #354349;
}
.roster-avatar {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--team-color) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--team-color) 40%, transparent);
  color: var(--team-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  flex-shrink: 0;
}
.roster-player-name {
  font-size: 10px;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.roster-player-desc {
  font-size: 7px;
  color: #6f858b;
  margin-top: 2px;
}
.roster-player-meta {
  margin-left: auto;
  font-size: 9px;
  color: var(--team-color);
  display: flex;
  align-items: center;
  gap: 5px;
}
.vote-count {
  font-size: 7px;
  background: #303d39;
  padding: 1px 4px;
  border-radius: 3px;
  color: #bfd2c4;
}
.roster-player.dead {
  opacity: 0.35;
}
.activity-log {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 176px;
  overflow: auto;
}
.activity-log > li {
  position: relative;
  color: #7d9298;
  font-size: 8px;
  line-height: 1.6;
  padding: 0 0 12px 12px;
  border-left: 1px solid #2b3d3f;
  margin-left: 2px;
}
.activity-log > li:before {
  content: "";
  position: absolute;
  left: -3px;
  top: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #445c5e;
}
.activity-log > li:first-child {
  color: #c1d2ce;
}
.activity-log > li:first-child:before {
  background: var(--teal);
}
.activity-log > li:last-child {
  padding-bottom: 3px;
  border-color: transparent;
}
.defeat-panel {
  border-color: #73603b;
  margin-top: 20px;
  background: #29251b;
}
.defeat-panel h2 {
  margin-top: 8px;
}
.defeat-panel p {
  color: #c0b497;
  font-size: 12px;
  margin-top: 10px;
}
.defeat-teams {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}
.defeat-teams .button {
  color: var(--team-color);
  border-color: color-mix(in srgb, var(--team-color) 40%, transparent);
  background: color-mix(in srgb, var(--team-color) 10%, transparent);
}
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid #5c6c61;
  background: #24312bf5;
  box-shadow: 0 10px 40px #0008;
  border-radius: 8px;
  padding: 13px 23px;
  color: #dce9df;
  font-size: 12px;
  max-width: min(500px, 90vw);
  text-align: center;
  z-index: 30;
}
.toast.error {
  border-color: #98584b;
  background: #3a2522;
  color: #ffd5ca;
}
dialog {
  background: #171e22;
  color: var(--text);
  border: 1px solid #46514f;
  border-radius: 15px;
  padding: 30px;
  width: min(550px, calc(100vw - 30px));
  max-height: 90vh;
  box-shadow: 0 30px 100px #000a;
}
dialog::backdrop {
  background: #080d11c9;
  backdrop-filter: blur(5px);
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  gap: 25px;
  align-items: flex-start;
}
.dialog-heading h2 {
  font-family: Georgia, serif;
  font-size: 31px;
  font-weight: 400;
  letter-spacing: -1px;
  margin: 8px 0 13px;
}
.help-intro {
  font-size: 12px;
  color: #9cadae;
  line-height: 1.7;
}
.help-rules {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.help-rules article {
  display: flex;
  gap: 15px;
}
.help-rules article > b {
  font-size: 11px;
  font-family: Georgia, serif;
  color: var(--amber);
  padding-top: 2px;
}
.help-rules h3 {
  font-size: 12px;
  font-weight: 500;
}
.help-rules p {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.7;
}
.help-note {
  font-size: 9px;
  line-height: 1.7;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 24px;
  color: #627a83;
}
#help-done {
  width: 100%;
  justify-content: space-between;
  margin-top: 18px;
}
@media (min-width: 1500px) {
  .entrance {
    gap: 35px 120px;
    padding-left: 65px;
    padding-right: 65px;
  }
  .hero h1 {
    font-size: 75px;
  }
  .battle-layout {
    grid-template-columns: 235px minmax(350px, 1fr) 260px;
  }
  .board {
    gap: 3px;
  }
}
@media (max-width: 1200px) {
  .site-shell {
    padding: 0 26px;
  }
  .entrance {
    gap: 35px 45px;
    padding: 50px 5px 30px;
  }
  .entry-card {
    padding: 26px;
  }
  .battle-layout {
    grid-template-columns: 190px minmax(320px, 1fr) 200px;
    gap: 13px;
  }
  .panel {
    padding: 14px;
  }
  .panel-heading .section-overline {
    font-size: 7px;
  }
  .key-badge {
    font-size: 5px;
  }
  .role-badge {
    font-size: 5px;
  }
  .identity h2 {
    font-size: 14px;
    max-width: 100px;
  }
  .identity {
    gap: 8px;
  }
  .avatar {
    width: 32px;
    height: 35px;
  }
  .team-score {
    padding: 13px;
  }
  .team-score-subtitle {
    max-width: 140px;
  }
  .legend-tip {
    display: none;
  }
  .election-countdown h2 {
    font-size: 33px;
  }
  .election-countdown {
    gap: 11px;
  }
}
@media (max-width: 990px) {
  .site-shell {
    padding: 0 20px;
  }
  .topbar {
    min-height: 85px;
  }
  .prototype-label {
    display: none;
  }
  .topbar-right {
    gap: 12px;
  }
  .entrance {
    gap: 30px;
    padding-top: 40px;
  }
  .hero h1 {
    font-size: 49px;
  }
  .hero-copy {
    font-size: 13px;
  }
  .entry-card {
    padding: 23px;
  }
  .team-option > span {
    padding: 12px 5px;
  }
  .team-option small {
    font-size: 5px;
    letter-spacing: 0.3px;
  }
  .battle-layout {
    grid-template-columns: 190px minmax(300px, 1fr);
    gap: 16px;
  }
  .right-sidebar {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: 190px 1fr 1fr;
    gap: 16px;
  }
  .roster {
    max-height: 190px;
  }
  .activity-log {
    max-height: 180px;
  }
  .unit-marker {
    font-size: 10px;
  }
  .king-marker {
    font-size: 26px;
  }
  .resource-marker {
    font-size: 17px;
  }
  .battlefield-heading {
    height: 44px;
  }
  .left-sidebar {
    padding-top: 57px;
  }
  .team-score-subtitle {
    max-width: 100px;
  }
  .team-score-title {
    font-size: 11px;
  }
  .team-score-symbol {
    font-size: 24px;
  }
  .team-score {
    gap: 10px;
  }
  .team-score-vault strong {
    font-size: 22px;
  }
  .hero-art {
    height: 245px;
  }
  .principles {
    gap: 20px;
  }
  .entry-footnote {
    font-size: 6px;
    gap: 8px;
  }
}
@media (max-width: 750px) {
  .site-shell {
    padding: 0 16px;
  }
  .topbar {
    min-height: 78px;
  }
  .brand {
    font-size: 12px;
    letter-spacing: 1.1px;
    gap: 9px;
  }
  .brand-mark {
    width: 34px;
    height: 37px;
    font-size: 24px;
  }
  .brand small {
    font-size: 6px;
    letter-spacing: 1.4px;
  }
  .connection-pill {
    padding: 5px 8px;
    font-size: 8px;
  }
  .topbar-right {
    gap: 8px;
  }
  .topbar-right .icon-button {
    display: none;
  }
  .entrance {
    grid-template-columns: 1fr;
    padding: 33px 4px 20px;
    gap: 28px;
    max-width: 500px;
    margin: auto;
  }
  .hero .eyebrow {
    font-size: 8px;
    margin-bottom: 15px;
  }
  .hero h1 {
    font-size: 52px;
    letter-spacing: -2px;
  }
  .hero-copy {
    max-width: 360px;
    margin-top: 15px;
    font-size: 12px;
  }
  .hero-art {
    display: none;
  }
  .entry-card {
    padding: 25px;
  }
  .entry-card h2 {
    font-size: 27px;
  }
  .principles {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 25px;
  }
  .principles p {
    max-width: none;
    font-size: 10px;
    margin-top: 4px;
  }
  .principles h3 {
    font-size: 12px;
  }
  .footer {
    font-size: 8px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .footer > span:nth-child(2) {
    order: 3;
    width: 100%;
    font-size: 7px;
  }
  .footer > .text-button {
    font-size: 8px;
  }
  .room-strip {
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
  }
  .room-heading {
    font-size: 7px;
    letter-spacing: 0.8px;
    flex-wrap: wrap;
    gap: 7px;
  }
  .room-id {
    margin-left: 0;
    padding-left: 0;
    border: 0;
    flex-basis: 100%;
    font-size: 8px;
    padding-top: 3px;
  }
  .room-buttons {
    gap: 12px;
    flex-shrink: 0;
  }
  .room-buttons .text-button {
    font-size: 8px;
  }
  .team-scoreboard {
    gap: 7px;
    margin-bottom: 14px;
  }
  .team-score {
    padding: 10px 9px;
    gap: 5px;
    flex-wrap: wrap;
    border-radius: 6px;
  }
  .team-score-symbol {
    font-size: 20px;
  }
  .team-score-title {
    font-size: 9px;
  }
  .team-score-subtitle {
    font-size: 6px;
    max-width: 70px;
  }
  .team-score-vault {
    width: 100%;
    margin: 0;
    padding-left: 0;
    display: flex;
    align-items: baseline;
    gap: 3px;
    text-align: left;
    padding-top: 4px;
    border-top: 1px solid #ffffff0c;
  }
  .team-score-vault strong {
    font-size: 20px;
    line-height: 1.1;
  }
  .team-score-vault small {
    font-size: 6px;
    margin-left: auto;
    letter-spacing: 0.5px;
  }
  .team-score-vault span {
    font-size: 7px;
    margin-left: 0;
  }
  .battle-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .battlefield-section {
    order: 1;
    width: 100%;
  }
  .left-sidebar {
    order: 2;
    width: 100%;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 11px;
  }
  .right-sidebar {
    order: 3;
    display: grid;
    width: 100%;
    grid-template-columns: 1fr 1fr;
    gap: 11px;
  }
  .activity-panel {
    grid-column: 1/-1;
  }
  .activity-log {
    max-height: 105px;
  }
  .battlefield-heading {
    height: auto;
    margin-bottom: 10px;
  }
  .battlefield-heading h2 {
    font-size: 22px;
  }
  .board-frame {
    padding: 6px;
  }
  .board {
    gap: 2px;
  }
  .unit-marker {
    font-size: clamp(6px, 2vw, 10px);
    border-radius: 3px;
  }
  .unit-marker.own-unit {
    outline-width: 1px;
    outline-offset: 1px;
  }
  .unit-marker.leader-unit:before {
    font-size: 9px;
    top: -6px;
    right: -3px;
  }
  .king-marker {
    font-size: clamp(15px, 4vw, 24px);
  }
  .resource-marker {
    font-size: clamp(10px, 3vw, 17px);
  }
  .base-marker {
    font-size: clamp(12px, 3.5vw, 20px);
  }
  .tile-amount {
    font-size: 5px;
  }
  .board-legend {
    font-size: 7px;
    gap: 13px;
    padding: 10px 1px;
  }
  .board-overlay {
    padding: 18px;
  }
  .board-overlay h3 {
    font-size: 25px;
  }
  .board-overlay p {
    font-size: 10px;
    margin: 6px 0 12px;
  }
  .board-overlay .section-overline {
    font-size: 6px;
  }
  .board-overlay .button {
    font-size: 10px;
    padding: 9px 12px;
  }
  .selected-panel {
    padding: 13px 14px;
    min-height: 83px;
  }
  .selected-empty {
    min-height: 55px;
    gap: 10px;
  }
  .selected-empty h3 {
    font-size: 16px;
  }
  .selected-empty p {
    font-size: 8px;
  }
  .selection-heading h3 {
    font-size: 14px;
  }
  .selection-stats {
    font-size: 9px;
  }
  .player-panel .panel-heading {
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
  }
  .identity {
    align-items: flex-start;
  }
  .identity h2 {
    font-size: 15px;
    max-width: 105px;
  }
  .identity p {
    font-size: 8px;
  }
  .stats-row {
    gap: 5px;
    margin-top: 25px;
  }
  .stats-row strong {
    font-size: 21px;
  }
  .stats-row small {
    font-size: 5px;
    letter-spacing: 0.5px;
  }
  .stat-icon {
    font-size: 9px;
    margin-right: 2px;
  }
  .status-copy {
    font-size: 8px;
    line-height: 1.8;
  }
  .command-panel .key-badge {
    display: none;
  }
  .command-panel .panel-heading {
    margin-bottom: 10px;
  }
  .movement-controls {
    grid-template-columns: repeat(3, 30px);
    grid-template-rows: repeat(3, 24px);
    gap: 4px;
    padding-bottom: 13px;
  }
  .movement-controls > button {
    font-size: 14px;
  }
  .action-button {
    font-size: 8px;
    padding: 7px;
  }
  .action-button > span {
    gap: 5px;
  }
  .action-button b {
    font-size: 10px;
    min-width: 10px;
  }
  .action-button small {
    font-size: 6px;
  }
  .command-buttons {
    gap: 5px;
  }
  .command-panel .micro-copy {
    font-size: 7px;
    margin-top: 9px;
  }
  .panel {
    padding: 13px;
  }
  .election-countdown h2 {
    font-size: 34px;
  }
  .election-countdown > span {
    font-size: 6px;
  }
  .election-countdown {
    gap: 10px;
  }
  .roster-panel .panel-heading {
    margin-bottom: 7px;
  }
  .roster {
    max-height: 175px;
  }
  .roster-player {
    padding: 4px;
    gap: 6px;
  }
  .roster-player-name {
    font-size: 9px;
    max-width: 75px;
  }
  .roster-avatar {
    width: 24px;
    height: 24px;
    font-size: 8px;
  }
  .roster-player-meta {
    font-size: 8px;
  }
  .roster-player-desc {
    font-size: 6px;
  }
  .defeat-panel h2 {
    font-size: 21px;
  }
  .defeat-panel p {
    font-size: 10px;
  }
  .defeat-teams {
    flex-wrap: wrap;
  }
  dialog {
    padding: 22px;
  }
  .dialog-heading h2 {
    font-size: 27px;
  }
  .help-intro {
    font-size: 11px;
  }
  .help-rules {
    gap: 15px;
    margin-top: 20px;
  }
  .help-rules p {
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.button-ghost {
  background: transparent;
  border-color: #3e4a42;
  color: #a7b6ad;
  margin-top: 8px;
}
.button-ghost:not(:disabled):hover {
  background: #25352c;
}
.warning-text {
  color: var(--danger);
}
.self-refill-button {
  width: 100%;
  margin-top: 12px;
  color: var(--amber);
  border-color: #665639;
  background: #2b261c;
  justify-content: center;
  font-size: 10px;
}
@media (max-width: 750px) {
  .left-sidebar {
    display: flex;
    flex-direction: column;
  }
  .player-panel .panel-heading {
    flex-wrap: nowrap;
  }
  .player-panel .identity {
    align-items: center;
  }
  .avatar {
    width: 42px;
    height: 42px;
  }
  .identity h2 {
    font-size: 18px;
    max-width: none;
  }
  .identity p {
    font-size: 12px;
  }
  .stats-row {
    margin-top: 18px;
    gap: 16px;
  }
  .stats-row strong {
    font-size: 27px;
  }
  .stats-row small {
    font-size: 9px;
    letter-spacing: 0.7px;
  }
  .stat-icon {
    font-size: 14px;
    margin-right: 5px;
  }
  .status-copy,
  .micro-copy,
  .command-panel .micro-copy {
    font-size: 12px;
    line-height: 1.65;
  }
  .panel {
    padding: 18px;
  }
  .panel-heading .section-overline {
    font-size: 10px;
  }
  .role-badge {
    font-size: 9px;
    padding: 4px 7px;
  }
  .self-refill-button {
    min-height: 44px;
    font-size: 13px;
  }
  .command-panel {
    display: grid;
    grid-template-columns: 148px 1fr;
    gap: 12px;
  }
  .command-panel .panel-heading {
    grid-column: 1/-1;
  }
  .movement-controls {
    grid-template-columns: repeat(3, 44px);
    grid-template-rows: repeat(3, 44px);
    gap: 5px;
    padding: 0;
    align-self: center;
  }
  .movement-controls > button {
    font-size: 22px;
  }
  .command-buttons {
    gap: 7px;
  }
  .action-button {
    min-height: 44px;
    font-size: 12px;
    padding: 10px;
  }
  .action-button b {
    font-size: 16px;
    min-width: 16px;
  }
  .action-button small {
    font-size: 10px;
  }
  .command-panel .micro-copy {
    grid-column: 1/-1;
    margin-top: 0;
  }
  .right-sidebar {
    grid-template-columns: 1fr;
  }
  .activity-panel {
    grid-column: auto;
  }
  .roster {
    max-height: 300px;
  }
  .roster-player {
    padding: 9px;
    gap: 10px;
    min-height: 48px;
  }
  .roster-player-name {
    font-size: 14px;
    max-width: 180px;
  }
  .roster-player-desc {
    font-size: 11px;
  }
  .roster-avatar {
    height: 34px;
    width: 34px;
    font-size: 12px;
  }
  .roster-player-meta {
    font-size: 16px;
  }
  .roster-team-label {
    font-size: 10px;
    padding: 12px 0 5px;
  }
  .roster-team-label > span:last-child {
    font-size: 9px;
  }
  .vote-count {
    font-size: 10px;
    padding: 2px 6px;
  }
  .election-countdown h2 {
    font-size: 42px;
  }
  .election-countdown > span {
    font-size: 10px;
  }
  .election-panel .micro-copy {
    font-size: 12px;
  }
  .activity-log {
    max-height: 175px;
  }
  .activity-log > li {
    font-size: 12px;
  }
  .selection-heading h3 {
    font-size: 17px;
  }
  .selection-heading .section-overline {
    font-size: 9px;
  }
  .selection-stats {
    font-size: 12px;
  }
  .selection-actions .button {
    min-height: 44px;
    font-size: 12px;
    padding: 10px 12px;
  }
  .distribution-controls > input {
    font-size: 14px;
    width: 60px;
  }
  .board-legend {
    font-size: 10px;
  }
  .selected-empty h3 {
    font-size: 18px;
  }
  .selected-empty p {
    font-size: 12px;
  }
  .room-buttons .text-button {
    font-size: 11px;
    min-height: 36px;
  }
  .team-score-title {
    font-size: 11px;
  }
  .team-score-subtitle {
    font-size: 9px;
    max-width: 80px;
  }
  .team-score-vault small {
    font-size: 8px;
  }
  .team-score-symbol {
    display: none;
  }
  .room-heading {
    font-size: 9px;
  }
  .room-id {
    font-size: 11px;
  }
  .battlefield-heading .section-overline {
    font-size: 9px;
  }
  .coordinates {
    font-size: 10px;
  }
  .field-label {
    font-size: 11px;
  }
  .team-option > span {
    font-size: 14px;
  }
  .team-option small {
    font-size: 8px;
    letter-spacing: 0;
  }
  .entry-tabs > button {
    font-size: 13px;
    min-height: 42px;
  }
  .entry-submit {
    font-size: 14px;
    min-height: 48px;
  }
  .entry-feedback {
    font-size: 12px;
  }
  .entry-footnote {
    font-size: 8px;
  }
  .button-primary {
    min-height: 44px;
  }
  .board-overlay .button {
    font-size: 12px;
  }
  .board-overlay p {
    font-size: 12px;
  }
  .board-overlay .section-overline {
    font-size: 8px;
  }
  .text-button.help-trigger {
    min-height: 40px;
  }
  .help-rules p {
    font-size: 12px;
  }
  .help-rules h3 {
    font-size: 14px;
  }
  .help-intro {
    font-size: 13px;
  }
  .help-note {
    font-size: 11px;
  }
  .icon-button {
    min-height: 36px;
    min-width: 36px;
  }
  .defeat-panel p {
    font-size: 13px;
  }
  .defeat-teams .button {
    font-size: 13px;
    min-height: 44px;
  }
}
@media (max-width: 380px) {
  .command-panel {
    grid-template-columns: 1fr;
  }
  .command-panel .command-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .command-panel .micro-copy {
    grid-column: 1;
  }
  .command-panel .movement-controls {
    padding-bottom: 6px;
  }
  .team-score-title {
    font-size: 10px;
  }
  .team-score-subtitle {
    font-size: 8px;
  }
  .team-score-vault small {
    font-size: 7px;
  }
  .room-buttons {
    gap: 10px;
  }
  .room-buttons .text-button {
    font-size: 10px;
  }
  .board-legend {
    gap: 11px;
    font-size: 9px;
  }
  .selection-actions {
    gap: 6px;
  }
  .team-option small {
    font-size: 7px;
  }
}

.backend-notice {
  border: 1px solid #466459;
  background: #16251f;
  border-radius: 8px;
  padding: 16px;
  margin: 18px 0;
  color: var(--text);
}
.backend-notice strong {
  color: var(--teal);
  display: block;
  margin-bottom: 7px;
}
.backend-notice p {
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.6;
}
.backend-notice .micro-copy {
  font-size: 12px;
  color: var(--muted);
}

/* Pick-up-and-play controls: primary movement stays beside the battlefield. */
select {
  width: 100%;
  padding: 13px 12px;
  border: 1px solid #435149;
  border-radius: 7px;
  background: #101816;
  color: var(--text);
  font: inherit;
  min-height: 46px;
}
select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}
.mode-field { margin: 20px 0 14px; }
.mode-field .micro-copy { margin: 8px 0 14px; font-size: 12px; }
.map-seed-options { margin: 0 0 12px; border: 1px solid var(--line); border-radius: 7px; padding: 0 12px; }
.map-seed-options > summary { min-height: 44px; padding: 13px 0; color: #bac4bd; font-size: 12px; cursor: pointer; }
.map-seed-options > summary small { float: right; color: var(--muted); }
.map-seed-options .field-label { margin-top: 4px; }
#map-seed { min-height: 44px; min-width: 0; font-size: 16px; letter-spacing: 1px; }
#map-seed:disabled { opacity: .55; cursor: not-allowed; }
#clear-map-seed { min-height: 44px; margin-bottom: 4px; }
.room-map-seed { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: -6px 0 12px; color: var(--muted); font-size: 10px; }
.room-map-seed > span { min-width: 0; }
#map-seed-label { margin-left: 6px; color: #bac4bd; font-size: 12px; letter-spacing: .8px; overflow-wrap: anywhere; user-select: all; }
#copy-map-seed { min-height: 44px; padding: 8px 4px; font-size: 12px; }
.practice-button { width: 100%; min-height: 50px; justify-content: space-between; font-size: 15px; }
.practice-caption { margin-top: 7px; text-align: center; font-size: 11px; color: var(--muted); }
.lobby-customize { border-top: 1px solid var(--line); padding-top: 7px; }
.lobby-customize > summary { padding: 10px 0; color: #bac4bd; font-size: 12px; cursor: pointer; }
.lobby-customize > summary small { float: right; color: var(--muted); }
.lobby-customize[open] > summary { margin-bottom: 8px; }
.entry-tabs { margin-top: 12px; }
.entry-submit { min-height: 44px; }
.mode-pill { border: 1px solid #405447; border-radius: 20px; padding: 3px 7px; font-size: 8px; color: #a7cbb9; white-space: nowrap; }
.lobby-settings { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 18px; margin-bottom: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #141c18; }
.lobby-faction-field { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; flex: 0 1 320px; }
.lobby-faction-field label { font-size: 12px; color: #bac4bd; white-space: nowrap; }
.lobby-faction-field select { flex: 1 1 195px; width: auto; min-width: 0; min-height: 44px; padding: 10px; font-size: 13px; }
.lobby-faction-field select:disabled { opacity: .65; cursor: wait; }
.lobby-settings-copy { flex: 1 1 230px; font-size: 11px; line-height: 1.5; color: #a0b1a6; }
#lobby-balance-copy { margin-top: 4px; color: #a7cbb9; }
.match-goal { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; color: #b7c1b9; font-size: 13px; }
.match-goal > span { color: var(--amber); font-size: 28px; line-height: 1; }
.match-goal strong { color: var(--text); }
.turn-strip { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: #18221f; border: 1px solid #3a4d40; border-radius: 8px; padding: 11px 13px; margin-bottom: 10px; }
.turn-strip > div:first-child { min-width: 0; }
.turn-strip strong { display: block; font-size: 14px; color: #d6e7d8; }
.turn-strip #turn-description { display: block; color: #a0b1a6; font-size: 11px; margin-top: 2px; }
.turn-strip.your-turn { border-color: #b69757; background: #26261b; }
.turn-strip.your-turn strong { color: var(--amber); }
.turn-strip.waiting-turn { background: #1a1d25; border-color: #414554; }
.turn-controls { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.turn-points { color: var(--amber); font-size: 11px; white-space: nowrap; }
.turn-controls .button { padding: 8px 11px; min-height: 42px; font-size: 11px; white-space: nowrap; }
.bot-warmup { color: #97b5a2; font-size: 11px; margin: 2px 0 10px; padding-left: 2px; }
.bot-move-recap { margin: 8px 0; padding: 9px 11px; background: #171d20; border: 1px solid var(--line); border-radius: 8px; font-size: 11px; line-height: 1.5; }
.bot-move-recap > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; }
.bot-move-recap strong { color: #c6d2cb; }
.bot-move-recap > div > span { color: var(--muted); }
.bot-move-recap ul { display: flex; flex-wrap: wrap; gap: 4px 12px; list-style: none; margin: 5px 0 0; padding: 0; }
.bot-move { min-width: 0; max-width: 100%; overflow-wrap: anywhere; color: #c4cdd0; }
.bot-move::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: var(--teal); vertical-align: middle; }
.bot-move.amber::before { background: var(--amber); }
.bot-move.violet::before { background: var(--violet); }
.resource-hud { display: flex; flex-wrap: wrap; gap: 7px 16px; padding: 6px 2px 12px; font-size: 11px; color: #a3b3aa; }
.resource-hud span { white-space: nowrap; }
.resource-hud strong { color: #edf0ed; font-size: 16px; }
.resource-hud b { color: var(--teal); }
.resource-hud span:first-child b { color: var(--amber); }
.resource-hud span:nth-child(2) b { color: var(--danger); }
/* Read-only supply guidance stays beside fuel, without adding an action. */
.territory-refill { min-width: 0; margin: -3px 0 10px; padding: 8px 10px; border: 1px solid #526a5c; border-radius: 8px; background: #1d2922; overflow-wrap: anywhere; }
.territory-refill > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; }
.territory-refill strong { color: #c7dfcd; font-size: 12px; }
#territory-refill-timing { color: #e9d29b; font-size: 11px; font-variant-numeric: tabular-nums; }
.territory-refill p { margin: 5px 0 0; color: #b9c6bc; font-size: 11px; line-height: 1.45; }
.territory-refill.refill-unavailable { border-color: #796a4a; }
.territory-refill.refill-unavailable strong { color: #e3c999; }
.dock-refill-status { margin: 4px 0 6px; color: #d4c79e; font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
.action-dock.reaction-pending #dock-refill-status { display: none; }
.next-move { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 11px 12px; background: #191f20; border-radius: 8px; border-left: 3px solid var(--teal); }
.next-move .hint-symbol { color: var(--teal); font-size: 24px; }
.next-move p { font-size: 12px; color: #bec9c1; flex: 1; }
.next-move .button { min-height: 44px; padding: 9px 12px; font-size: 11px; flex-shrink: 0; }
.cell.reachable-resource { background: #2a5542; box-shadow: inset 0 0 0 2px #70dbb1; }
.cell.suggested-resource .resource-marker { color: #acffdc; text-shadow: 0 0 10px #7ce9b9; }
.cell.path-cell { background: #4a4930; box-shadow: inset 0 0 0 1px #c7b76c; }
.cell.paused-path-cell { background: #303647; box-shadow: inset 0 0 0 1px #a7afd1; }
.cell.path-cell::after { content: ""; width: 5px; height: 5px; background: #f0d27f; border-radius: 50%; position: absolute; z-index: 2; }
.cell.paused-path-cell::after { background: #c8d4ff; }
.board-instruction { color: #e6dac0; font-size: 13px; font-weight: 600; margin: 0 0 9px; }
.board-instruction span { color: #a4b2aa; font-size: 11px; font-weight: 400; }
.cell { touch-action: manipulation; }
.cell.target-cell { outline: 2px solid #e9d58a; outline-offset: -2px !important; }
.cell.home-cell { box-shadow: inset 0 0 0 2px #d6c291; }
.cell.own-cell { border: 2px solid #f4fff6; box-shadow: 0 0 14px #bfffbe50; z-index: 5; }
.you-tag { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); background: #effcf0; color: #162019; padding: 1px 3px; border-radius: 2px; font-weight: 800; font-size: 8px; line-height: 1; z-index: 7; }
.home-tag { position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%); color: #fff0b9; background: #252d1df2; font-size: 7px; font-weight: 700; padding: 0 1px; z-index: 6; }
.tile-amount { color: #c1e7cb; font-size: 8px; font-weight: 700; background: #10231ddd; border-radius: 2px; padding: 0 1px; z-index: 4; }
.route-line { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin: 0 0 9px; }
#tile-details { font-size: 11px; line-height: 1.5; color: #9dac9f; }
#cancel-route { flex-shrink: 0; min-height: 44px; font-size: 11px; color: var(--amber); }
.action-feedback { color: #b3e6c8; border: 1px solid #314f3e; background: #17251d; padding: 9px 12px; border-radius: 6px; font-size: 12px; margin-bottom: 13px; min-height: 38px; }
.action-feedback.error { color: #ffb0a6; border-color: #734039; background: #30201e; }
.command-panel { display: grid; grid-template-columns: 140px minmax(0,1fr); gap: 10px 18px; padding: 16px; }
.command-panel .panel-heading { grid-column: 1/-1; margin-bottom: 2px; }
.command-panel .movement-controls { grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(3, 44px); gap: 4px; padding: 0; align-self: start; }
.command-panel .movement-controls > button { font-size: 21px; }
.command-panel .command-buttons { gap: 9px; align-self: start; }
.command-item { min-width: 0; }
.command-panel .action-button { min-height: 44px; width: 100%; font-size: 12px; padding: 9px 11px; }
.command-panel .action-button small { font-size: 10px; }
.control-reason { color: #99a59c; font-size: 10px; line-height: 1.45; padding: 4px 2px 0; }
.command-panel .micro-copy { grid-column: 1/-1; font-size: 11px; line-height: 1.55; margin: 0; }
.extra-actions { grid-column: 1/-1; border-top: 1px solid var(--line); padding-top: 6px; }
.extra-actions > summary { cursor: pointer; color: #a2b1a7; font-size: 11px; padding: 7px 0; }
.extra-actions[open] { display: grid; gap: 8px; }
button:disabled { opacity: .52; }
.team-disclosure { border: 1px solid var(--line); border-radius: 9px; background: #151b1a; overflow: hidden; }
.team-disclosure > summary { padding: 16px 12px; cursor: pointer; font-size: 13px; color: #ced7cf; }
.team-disclosure > summary > span { color: var(--amber); padding-right: 3px; }
.team-disclosure > summary > small { display: block; margin: 4px 0 0 14px; color: var(--muted); font-size: 10px; }
.team-disclosure .panel { border: 0; border-radius: 0; border-top: 1px solid var(--line); padding: 14px; background: transparent; }
.team-disclosure .selection-heading { display: block; }
.team-disclosure .selection-stats { margin-top: 9px; font-size: 11px; }
.team-disclosure .selection-heading h3 { overflow-wrap: anywhere; font-size: 15px; }
.team-disclosure .selection-actions { flex-direction: column; align-items: stretch; }
.team-disclosure .selection-actions > .button { min-height: 42px; font-size: 11px; }
.team-disclosure .distribution-controls { width: 100%; }
.team-disclosure #distribute-button { min-width: 0; flex: 1; font-size: 10px; padding: 8px; }
.team-disclosure .micro-copy { font-size: 11px; line-height: 1.6; }
.team-disclosure .election-countdown h2 { font-size: 27px; }
.team-disclosure .election-countdown > span { font-size: 8px; }
.team-disclosure .election-countdown { gap: 12px; }
.team-disclosure .roster-player-name { font-size: 11px; }
.resource-timing { padding: 0 3px; line-height: 1.7; }
.supply-explainer { border-top: 1px solid var(--line); margin-top: 15px; padding-top: 7px; }
.supply-explainer > summary { font-size: 11px; padding: 7px 0; cursor: pointer; color: #afbbb2; }
.supply-explainer dl { margin: 7px 0 0; font-size: 11px; }
.supply-explainer dt { color: var(--teal); margin-top: 10px; font-weight: 700; }
.supply-explainer dd { margin: 3px 0 0; color: #a2b0a6; line-height: 1.6; }
.stats-row small { font-size: 7px; letter-spacing: .3px; }
.left-sidebar { padding-top: 0; }
@media (min-width: 751px) and (max-width: 1200px) {
  .battle-layout { grid-template-columns: 210px minmax(0,1fr); }
  .battlefield-section { grid-column: 2; grid-row: 1 / span 2; }
  .left-sidebar { grid-column: 1; grid-row: 1; }
  .right-sidebar { grid-column: 1; grid-row: 2; display: flex; }
  .next-move { flex-wrap: wrap; }
  .next-move .button { width: 100%; }
  .turn-strip { flex-wrap: wrap; }
  .turn-controls { width: 100%; justify-content: space-between; }
}
@media (max-width: 750px) {
  .site-shell { padding: 0 14px; }
  .topbar { min-height: 62px; }
  .entrance { padding-top: 22px; gap: 22px; }
  .hero { order: 0; }
  .hero-art, .hero .eyebrow, .principles { display: none; }
  .hero h1 { font-size: 37px; line-height: 1.08; }
  .hero-copy { font-size: 13px; line-height: 1.6; max-width: 370px; margin-top: 12px; }
  .entry-card { order: 1; padding: 20px; }
  .entry-card > .section-overline { display: none; }
  .entry-card h2 { font-size: 23px; }
  .entry-card > .muted { font-size: 12px; margin-top: 5px; }
  .mode-field { margin-top: 14px; }
  .mode-field .micro-copy { font-size: 11px; }
  .entry-footnote { flex-wrap: wrap; }
  .game { padding-top: 14px; }
  .room-strip { gap: 8px; margin-bottom: 10px; }
  .room-heading { flex-wrap: wrap; gap: 5px 8px; font-size: 8px; }
  .room-id { font-size: 10px; }
  .mode-pill { font-size: 8px; }
  .match-goal { font-size: 11px; gap: 8px; margin-bottom: 11px; }
  .match-goal > span { font-size: 25px; }
  .team-scoreboard { gap: 7px; margin-bottom: 14px; }
  .team-score { padding: 9px 7px; gap: 3px; }
  .team-score-title { font-size: 10px; }
  .team-score-subtitle { display: none; }
  .team-score-vault { padding-top: 3px; margin-top: 3px; }
  .team-score-vault strong { font-size: 19px; }
  .team-score-vault small { font-size: 7px; }
  .battlefield-heading { margin-bottom: 8px; }
  .battlefield-heading h2 { font-size: 20px; }
  .battlefield-heading .section-overline { font-size: 8px; }
  .turn-strip { padding: 9px 10px; gap: 7px; flex-wrap: wrap; margin-bottom: 6px; }
  .turn-strip strong { font-size: 13px; }
  .turn-strip #turn-description { font-size: 10px; line-height: 1.45; }
  .turn-controls { flex: 1; justify-content: space-between; }
  .turn-controls .button { min-height: 44px; font-size: 12px; }
  .bot-warmup { font-size: 10px; margin-bottom: 4px; }
  .resource-hud { gap: 4px 12px; font-size: 10px; padding: 6px 0 8px; }
  .resource-hud strong { font-size: 15px; }
  .next-move { gap: 8px; padding: 9px 10px; margin-bottom: 10px; flex-wrap: wrap; }
  .next-move .hint-symbol { display: none; }
  .next-move p { font-size: 11px; flex-basis: 150px; }
  .next-move .button { font-size: 11px; min-height: 44px; flex: 1 0 auto; }
  .board { gap: 2px; }
  .board-instruction { font-size: 12px; margin-bottom: 8px; }
  .board-instruction span { display: block; margin-top: 2px; font-size: 10px; }
  .board-frame { padding: 7px 4px 4px; }
  .cell.own-cell { border-width: 1px; }
  .you-tag { font-size: 7px; padding: 1px 2px; top: -7px; }
  .home-tag { font-size: 6px; }
  .tile-amount { font-size: 7px; bottom: 0; right: 0; }
  .resource-marker { font-size: clamp(12px, 3.3vw, 20px); }
  .board-legend { font-size: 9px; gap: 5px 12px; flex-wrap: wrap; padding: 10px 0; }
  .board-legend .legend-tip { display: none; }
  .route-line { gap: 6px; flex-wrap: wrap; }
  #tile-details { font-size: 10px; }
  #cancel-route { font-size: 12px; min-height: 44px; }
  .action-feedback { padding: 9px 10px; font-size: 12px; margin-bottom: 10px; }
  .command-panel { grid-template-columns: 140px minmax(0,1fr); padding: 13px; gap: 8px 12px; }
  .command-panel .command-buttons { display: flex; flex-direction: column; }
  .command-panel .action-button { font-size: 11px; padding: 8px; }
  .command-panel .action-button b { font-size: 13px; min-width: 13px; }
  .control-reason { font-size: 10px; }
  .command-panel .movement-controls { padding: 0; }
  .command-panel .micro-copy { font-size: 11px; }
  .extra-actions > summary { font-size: 12px; min-height: 44px; padding-top: 12px; }
  .stats-row small { font-size: 9px; }
  .left-sidebar, .right-sidebar { display: flex; flex-direction: column; width: 100%; }
  .team-disclosure > summary { min-height: 58px; font-size: 14px; }
  .team-disclosure > summary > small { font-size: 11px; }
  .team-disclosure .selection-actions { flex-direction: row; flex-wrap: wrap; }
  .team-disclosure .selection-actions > .button { min-height: 44px; font-size: 12px; flex: 1; }
  .team-disclosure .distribution-controls { width: auto; flex: 1 1 100%; }
  .team-disclosure #distribute-button { font-size: 12px; min-height: 44px; }
  .team-disclosure .selection-stats, .team-disclosure .micro-copy { font-size: 12px; }
  .team-disclosure .roster-player-name { font-size: 14px; }
  .supply-explainer > summary { min-height: 44px; font-size: 12px; padding-top: 12px; }
  .supply-explainer dl { font-size: 12px; }
  .footer { margin-top: 28px; }
}
@media (max-width: 380px) {
  .site-shell { padding: 0 10px; }
  .next-move p { flex-basis: 100%; }
  .next-move .button { width: 100%; }
  .command-panel { padding: 10px; gap: 10px; grid-template-columns: minmax(0,1fr); }
  .command-panel .movement-controls { justify-self: center; }
  .command-panel .command-buttons { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .command-panel .action-button { font-size: 10px; }
  .command-panel .action-button span { gap: 3px; }
  .command-panel .action-button small { display: none; }
  .resource-hud { gap: 4px 9px; }
}


/* The battlefield scrolls in the space ABOVE the dock. Measuring its actual
   height also handles wrapping, zoom, safe areas and the expanded move panel. */
#app-scroll.dock-active {
  height: calc(100dvh - var(--action-dock-height, 222px));
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  padding-bottom: 24px;
  scroll-padding-block: 12px 24px;
}
.action-dock {
  position: fixed;
  inset: auto 0 0;
  z-index: 30;
  max-height: 54dvh;
  overflow-y: auto;
  padding: 10px max(12px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: #121b19;
  border-top: 1px solid #4b6251;
  box-shadow: 0 -8px 28px #0006;
}
.action-dock.guide-open { visibility: hidden; }
.action-dock-inner { max-width: 1260px; margin-inline: auto; min-width: 0; }
.action-dock-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.action-dock-heading > div { min-width: 0; }
.action-dock-heading strong { display: block; color: #f0e5ca; font-size: 14px; overflow-wrap: anywhere; }
.action-dock.your-turn .action-dock-heading strong { color: var(--amber); }
#dock-budget { display: block; color: #c4d4c8; font-size: 12px; margin-top: 3px; }
.action-dock #end-turn-button { min-height: 44px; padding: 8px 12px; flex-shrink: 0; font-size: 12px; }
.dock-status { color: #c4d0c6; font-size: 11px; line-height: 1.4; margin: 6px 0; overflow-wrap: anywhere; }
.dock-scroll-hint { display: flex; justify-content: space-between; color: #cad9ce; font-size: 10px; margin: 4px 0 6px; }
.dock-scroll-hint span { color: #9aafa2; }
.dock-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(145px, 1fr); overflow-x: auto; gap: 9px; padding-bottom: 8px; scrollbar-width: thin; scrollbar-color: #68856c #18211c; scroll-snap-type: x proximity; }
.dock-action { min-width: 0; scroll-snap-align: start; }
.action-dock .action-button { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; width: 100%; min-height: 48px; padding: 8px 10px; font-size: 12px; color: #f1f5ee; }
.action-dock .action-button > span { display: block; }
.action-dock .action-button small { display: block; color: #c5d1c7; font-size: 10px; }
.action-dock .action-button.available-action { background: #294234; border-color: #6c956f; box-shadow: inset 0 0 0 1px #577e5b25; }
.action-dock .action-button:disabled { opacity: 1; color: #9ca99f; border-color: #39463e; background: #1a211d; }
.action-dock .action-button:disabled small { color: #9ca99f; }
.action-dock .control-reason { font-size: 10px; line-height: 1.45; color: #b1beb4; padding: 5px 1px 0; overflow-wrap: anywhere; }
.action-dock button:focus-visible, .dock-actions:focus-visible { outline: 3px solid #e9d58a; outline-offset: -3px; }
.dock-movement { display: flex; align-items: center; gap: 16px; border-top: 1px solid #34463a; padding-top: 10px; margin-top: 2px; }
.dock-movement .movement-controls { display: grid; grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(3, 44px); gap: 4px; padding: 0; flex-shrink: 0; }
.dock-movement .movement-controls button { min-height: 44px; min-width: 44px; }
.dock-movement-copy { min-width: 0; }
.dock-movement-copy .micro-copy { margin: 0 0 8px; font-size: 11px; color: #bac8bc; }
#return-home-button { min-height: 44px; font-size: 12px; padding: 8px 12px; }
#help-dialog { max-height: 90dvh; overflow-y: auto; }
body:has(.dock-active) > .toast { bottom: auto; top: 12px; z-index: 40; }
@media (max-width: 750px) {
  .action-dock { padding-top: 8px; }
  .dock-actions { grid-auto-columns: 145px; gap: 8px; }
  .action-dock-heading strong { font-size: 13px; }
  .dock-status { font-size: 10px; }
}
@media (max-width: 380px) {
  .action-dock { padding-inline: 10px; }
  .dock-actions { grid-auto-columns: 138px; }
  .dock-movement { gap: 10px; }
  .dock-movement-copy .micro-copy { font-size: 10px; }
  #return-home-button { white-space: normal; }
}


/* Reaction decisions replace the normal cards in the measured bottom dock.
   Two equal columns fit 320px screens; descriptions wrap without hover. */
.combat-reaction { min-width: 0; border: 1px solid #bb9470; border-radius: 10px; padding: 10px; background: #2b241e; }
.reaction-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.reaction-heading strong { min-width: 0; color: #ffdeaa; font-size: 14px; overflow-wrap: anywhere; }
.reaction-countdown { flex-shrink: 0; font-size: 15px; font-variant-numeric: tabular-nums; color: #ffeac9; }
.reaction-copy { color: #e3d5c1; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; margin: 6px 0; }
.reaction-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.reaction-choices > div { min-width: 0; }
.reaction-choices .action-button { min-height: 48px; white-space: normal; overflow-wrap: anywhere; }
.reaction-choices .action-button:not(:disabled) { background: #384b37; border-color: #94aa80; }
.action-dock .reaction-choices .control-reason { color: #e0d2be; }
.combat-result { color: #dec99c; font-size: 12px; line-height: 1.45; margin: 6px 0; overflow-wrap: anywhere; }
.dock-combat-result { color: #dec99c; font-size: 11px; line-height: 1.4; margin: 6px 0; overflow-wrap: anywhere; }
.action-dock.reaction-pending { border-top-color: #c6a379; }
@media (max-width: 380px) {
  .combat-reaction { padding: 8px; }
  .reaction-copy, .reaction-heading strong { font-size: 12px; }
}

/* A 320 × 432 viewport has only ~234px for the dock. Put the timed
   decision first and remove duplicate summary rows while it is pending. */
.action-dock.reaction-pending .action-dock-heading,
.action-dock.reaction-pending #dock-status,
.action-dock.reaction-pending #dock-combat-result { display: none; }
.action-dock.reaction-pending .reaction-heading strong { font-size: 12px; line-height: 1.3; }
.action-dock.reaction-pending .reaction-copy { font-size: 11px; line-height: 1.35; margin: 5px 0; }
.action-dock.reaction-pending .reaction-choices .control-reason { line-height: 1.3; }


/* Preparation uses the existing board: each home zone has thirteen tiles.
   Cardinal edge marks trace its diamond without covering pawn markers. */
.preparation-banner { border: 1px solid #64877b; border-radius: 8px; background: #1d302a; padding: 9px 11px; margin: 0 0 8px; color: #d5e6da; }
.preparation-banner > div { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.preparation-banner strong { font-size: 13px; }
#preparation-countdown { font-size: 12px; font-variant-numeric: tabular-nums; color: #ffe2a6; }
.preparation-banner p { font-size: 11px; line-height: 1.4; margin: 4px 0 0; }
.preparation-banner.battle-open { background: #233326; border-color: #73875d; }
.cell.preparation-zone { background-image: linear-gradient(#d6ddad12, #d6ddad12); }
.cell.preparation-own-zone { background-image: linear-gradient(#f4e5a521, #f4e5a521); }
/* Ownership covers every square and stays visible after preparation. Boundary
   widths are preserved on small screens, with a dashed style when open. */
.cell.territory-cell { background-image: linear-gradient(color-mix(in srgb, var(--zone-color) 18%, transparent), color-mix(in srgb, var(--zone-color) 18%, transparent)); }
.cell.territory-own.preparation-own-zone { background-image: linear-gradient(color-mix(in srgb, var(--zone-color) 25%, transparent), color-mix(in srgb, var(--zone-color) 25%, transparent)); }
.cell.preparation-locked { cursor: help; }
.cell.zone-border-north { border-top: 2px solid var(--zone-color); }
.cell.zone-border-south { border-bottom: 2px solid var(--zone-color); }
.cell.zone-border-west { border-left: 2px solid var(--zone-color); }
.cell.zone-border-east { border-right: 2px solid var(--zone-color); }
.cell.territory-open.zone-border-north { border-top-style: dashed; }
.cell.territory-open.zone-border-south { border-bottom-style: dashed; }
.cell.territory-open.zone-border-west { border-left-style: dashed; }
.cell.territory-open.zone-border-east { border-right-style: dashed; }
.territory-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 12px; margin: -3px 0 9px; color: #cad2cb; font-size: 10px; }
.territory-legend span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.territory-legend i { width: 9px; height: 9px; border: 2px solid var(--team-color); background: color-mix(in srgb, var(--team-color) 25%, transparent); }
.territory-legend strong { font-size: 10px; font-weight: 500; color: #c3cbbf; }
.recruitment-status { font-size: 13px; color: #e4d6ab; line-height: 1.5; margin: 4px 0 8px; }
.energy-gift-panel { min-width: 0; overflow-wrap: anywhere; }
.energy-gift-panel label { display: block; font-size: 12px; color: #d5dfd6; margin: 12px 0 5px; }
.energy-gift-panel select { width: 100%; max-width: 100%; min-width: 0; min-height: 48px; font-size: 16px; padding: 8px; }
.gift-amount-controls { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; gap: 8px; }
.gift-amount-controls .button { min-width: 48px; min-height: 48px; padding: 8px; font-size: 20px; }
.gift-amount-controls input { width: 100%; min-width: 0; min-height: 48px; font-size: 16px; text-align: center; padding: 8px; }
.gift-amount-controls input[aria-invalid="true"] { border-color: #ee8179; }
.gift-overflow { margin: 12px 0; padding: 10px; border: 1px solid #665f43; border-radius: 6px; background: #29291f; color: #e5d7a7; font-size: 12px; line-height: 1.5; }
#gift-energy-button { width: 100%; min-height: 48px; white-space: normal; overflow-wrap: anywhere; }
.gift-receipt { margin-top: 10px; color: #9dd1ad; font-size: 12px; line-height: 1.5; }
.energy-gift-panel .control-reason { line-height: 1.5; overflow-wrap: anywhere; }
.recruitment-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.recruitment-actions > div { min-width: 0; }
.recruitment-actions .button { min-height: 48px; width: 100%; font-size: 12px; padding: 8px; white-space: normal; overflow-wrap: anywhere; }
.recruitment-actions .control-reason { line-height: 1.45; overflow-wrap: anywhere; }
.bot-intent { font-size: 11px; line-height: 1.4; color: #b8cdbb; margin-top: 4px; overflow-wrap: anywhere; }
.selection-intent { padding: 8px 10px; background: #223025; border-radius: 6px; }
@media (max-width: 380px) {
  .preparation-banner { padding: 8px; }
  .preparation-banner p { font-size: 10px; }
  .recruitment-actions { gap: 8px; }
  .recruitment-actions .button { font-size: 11px; }
}

#dock-preparation { display: block; color: #f1d7a2; font-size: 11px; line-height: 1.3; margin-top: 3px; font-variant-numeric: tabular-nums; }

/* Deposits persist independently of collectible crystal piles and ownership. */
.deposit-marker { position: absolute; top: 0; left: 1px; z-index: 6; color: #fff0b0; font-size: clamp(9px, 1.15vw, 15px); line-height: 1; text-shadow: 0 1px 2px #000; pointer-events: none; }
.cell.territory-deposit { box-shadow: inset 0 0 0 1px #ffe8a066; }
.cell.territory-deposit.own-cell { box-shadow: inset 0 0 0 1px #ffe8a066, 0 0 14px #bfffbe50; }
.territory-income { margin: 0 0 8px; color: #decfa7; font-size: 11px; line-height: 1.45; }
@media (max-width: 750px) {
  .deposit-marker { font-size: 9px; left: 0; }
  .territory-income { font-size: 10px; }
}

/* Public health remains legible over every faction tint, without revealing fuel. */
.unit-health { position: absolute; bottom: -3px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; padding: 2px; background: #10191c; border-radius: 3px; z-index: 8; pointer-events: none; }
.health-pip { display: block; flex: 0 0 auto; width: 5px; height: 5px; border: 1px solid #e6f2ec; border-radius: 50%; box-sizing: border-box; }
.health-pip.filled { background: #f4fff8; }
.health-pip.empty { background: #10191c; }
.unit-marker.offline-unit { opacity: 1; filter: saturate(.55); }
.unit-count { font-size: 8px; z-index: 9; min-width: 10px; text-align: center; }
.cell.deposit-exhausted .deposit-marker { color: #bdc4c0; text-decoration: line-through; }
.harvest-panel { min-width: 0; margin: 10px 0; padding: 12px; border: 1px solid #a49b66; border-radius: 8px; background: #182522; overflow-wrap: anywhere; }
.harvest-panel h3 { margin: 0 0 6px; font-size: 14px; color: #fff0ba; }
.deposit-reserve { margin: 6px 0; font-size: 15px; font-weight: 700; color: #f4f7ed; }
.harvest-panel .micro-copy { color: #c5d2cd; margin-bottom: 10px; }
.harvest-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.harvest-actions > div { min-width: 0; }
.harvest-actions .button { width: 100%; min-height: 48px; white-space: normal; line-height: 1.4; padding: 8px; }
.harvest-panel .control-reason { color: #d2ddd6; font-size: 11px; line-height: 1.45; }
.exhaust-confirmation { padding: 10px; margin-top: 10px; border: 1px solid #ebac94; border-radius: 6px; background: #3b2320; color: #fff0e9; }
#exhaust-warning { font-size: 13px; line-height: 1.5; margin: 0 0 10px; }
#walk-deposit-button { min-height: 44px; white-space: normal; }
@media (max-width: 600px) {
  .unit-health { bottom: -3px; gap: 1px; padding: 1px; }
  .health-pip { width: 3px; height: 3px; }
  .unit-count { font-size: 7px; min-width: 8px; padding: 1px; }
  .harvest-panel { padding: 10px; }
}

/* Public lobby and explicit room access. No horizontal scrolling on phones. */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.public-lobby { grid-column: 1 / -1; min-width: 0; padding: 26px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(140deg, #17201d, #13181c); }
.public-lobby-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.public-lobby h2 { margin: 8px 0; font: 400 28px/1.15 Georgia, serif; }
.public-lobby-heading > div:first-child { max-width: 580px; }
.public-lobby-tools { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.public-lobby-tools select { width: auto; min-width: 140px; }
.public-lobby-tools button { min-height: 46px; padding: 10px 16px; }
.lobby-capability-notice { margin-top: 18px; padding: 14px 16px; border: 1px solid #665333; border-radius: 8px; color: #dfc69e; background: #2d261a; font-size: 12px; }
.room-list-status { min-height: 22px; margin-top: 20px; color: #a1ada5; font-size: 12px; }
.room-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 8px; }
.public-room { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 17px; border: 1px solid #334238; border-radius: 9px; background: #131a18; min-width: 0; }
.public-room-detail { min-width: 0; }
.public-room-heading { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.public-room-heading strong { font-size: 13px; letter-spacing: .4px; }
.room-status { display: inline-block; padding: 3px 8px; border: 1px solid #475256; border-radius: 20px; font-size: 10px; color: #a6b4ba; }
.room-status.waiting { border-color: #3f6654; color: #8bd3ae; background: #1b2e23; }
.public-room-host { font-size: 12px; color: #b8c2ba; margin-top: 8px; overflow-wrap: anywhere; }
.public-room-seats { font-size: 11px; color: var(--muted); margin-top: 4px; }
.public-room .button { flex-shrink: 0; font-size: 12px; min-height: 44px; padding: 10px 13px; }
.public-room .button:disabled { opacity: .65; }
.visibility-field .field-label { margin-top: 15px; }
.visibility-field .micro-copy { margin: 8px 0 10px; font-size: 11px; color: #a6b2aa; }
.quickmatch-progress { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 15px; margin: 12px 0; padding: 12px; border: 1px solid #4b6552; border-radius: 8px; font-size: 12px; color: #b9d5c2; }
.quickmatch-progress .text-button { min-height: 44px; }
.room-access-panel { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 14px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 8px; background: #151b18; min-width: 0; }
.room-access-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.room-access-heading strong { color: #d1dcd3; font-size: 12px; }
.host-access-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.host-access-controls label, .invite-link-panel label { font-size: 11px; color: #a9b9af; }
.host-access-controls select { width: auto; min-height: 44px; padding: 9px 12px; font-size: 12px; }
.host-access-controls .text-button { min-height: 44px; }
#room-access-hint { flex-basis: 100%; color: var(--muted); font-size: 11px; }
.invite-link-panel { flex-basis: 100%; min-width: 0; }
.invite-link-panel input { min-width: 0; margin: 6px 0; font-size: 13px; }
.invite-link-panel .micro-copy { color: #c6b58f; font-size: 11px; }
.quickmatch-waiting { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 0 0 16px; padding: 12px 16px; border: 1px solid #3e634b; border-radius: 8px; background: #14281d; color: #c2dcc9; font-size: 12px; }
.quickmatch-waiting .button { flex-shrink: 0; min-height: 44px; font-size: 12px; }
@media (max-width: 1000px) { .room-list { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .public-lobby { padding: 18px 14px; }
  .public-lobby-heading { flex-direction: column; align-items: stretch; gap: 16px; }
  .public-lobby-tools { width: 100%; }
  .public-lobby-tools select { flex: 1; min-width: 0; }
  .public-room { padding: 13px; gap: 10px; flex-wrap: wrap; }
  .public-room-detail { flex: 1 1 180px; }
  .public-room .button { margin-left: auto; }
  .room-access-panel { padding: 12px; }
  .host-access-controls { margin-left: 0; flex-basis: 100%; }
  .quickmatch-waiting { flex-wrap: wrap; gap: 9px; }
  .quickmatch-waiting .button { margin-left: auto; }
}
