:root {
  --ink: #f4efe3;
  --muted: #bdb4a4;
  --panel: #1b1f22;
  --panel-2: #242923;
  --line: #3b4038;
  --accent: #d7ae35;
  --accent-2: #55b085;
  --danger: #dc6658;
  --shadow: rgba(0, 0, 0, 0.35);
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #171916;
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid #4a503f;
  border-radius: 6px;
  background: #2b3128;
  color: var(--ink);
  padding: 0 12px;
  cursor: pointer;
}

button:hover {
  border-color: #6d755d;
  background: #343b30;
}

button:disabled {
  cursor: default;
  opacity: 0.45;
}

button.primary {
  background: #896f1f;
  border-color: #c9a734;
}

button.primary:hover {
  background: #9f8127;
}

button.ghost {
  background: transparent;
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid #4a503f;
  border-radius: 6px;
  background: #121411;
  color: var(--ink);
  padding: 0 10px;
}

input[type="checkbox"] {
  width: auto;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--accent);
}

.hidden {
  display: none !important;
}

.lobby {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 430px) minmax(280px, 460px);
  grid-template-areas:
    "brand setup"
    "side side";
  align-content: center;
  align-items: center;
  justify-content: center;
  gap: 24px 32px;
  padding: 32px;
  overflow: auto;
  background:
    linear-gradient(rgba(23, 25, 22, 0.52), rgba(23, 25, 22, 0.9)),
    repeating-linear-gradient(135deg, #22271f 0 12px, #1b1f1b 12px 24px);
}

.brand {
  grid-area: brand;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 74px);
  line-height: 0.92;
  letter-spacing: 0;
}

.brand p {
  margin: 14px 0 0;
  color: var(--muted);
}

.mark {
  width: 54px;
  height: 54px;
  display: inline-block;
  border: 2px solid #d7ae35;
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 44%, #d7ae35 44% 56%, transparent 56%),
    linear-gradient(0deg, transparent 44%, #d7ae35 44% 56%, transparent 56%),
    #283027;
  box-shadow: 0 10px 24px var(--shadow);
}

.mark.small {
  width: 24px;
  height: 24px;
  border-width: 1px;
}

.setup,
.roster,
.leaderboardPanel,
.commandPanel {
  border-left: 1px solid var(--line);
  background: rgba(27, 31, 34, 0.96);
  box-shadow: 0 20px 50px var(--shadow);
}

.setup {
  grid-area: setup;
  width: min(100%, 420px);
  padding: 22px;
  border-radius: 8px;
}

.mainLobbyControls,
.roomLobbyControls {
  display: grid;
  gap: 16px;
}

.setup label {
  position: relative;
  display: grid;
  gap: 7px;
  color: var(--muted);
}

.helpLabel::after {
  content: attr(data-help);
  position: absolute;
  z-index: 12;
  left: 0;
  bottom: calc(100% + 8px);
  width: min(320px, 86vw);
  padding: 10px 12px;
  border: 1px solid rgba(245, 223, 141, 0.52);
  border-radius: 6px;
  background: rgba(18, 20, 17, 0.98);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.42);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.helpLabel::before {
  content: "";
  position: absolute;
  z-index: 13;
  left: 18px;
  bottom: calc(100% + 3px);
  width: 10px;
  height: 10px;
  border-right: 1px solid rgba(245, 223, 141, 0.52);
  border-bottom: 1px solid rgba(245, 223, 141, 0.52);
  background: rgba(18, 20, 17, 0.98);
  opacity: 0;
  pointer-events: none;
  transform: rotate(45deg) translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.helpLabel:hover::after,
.helpLabel:hover::before,
.helpLabel:focus-within::after,
.helpLabel:focus-within::before {
  opacity: 1;
  transform: translateY(0);
}

.helpLabel:hover::before,
.helpLabel:focus-within::before {
  transform: rotate(45deg) translateY(0);
}

.setupGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.checkField {
  gap: 8px;
}

.checkRow {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid #4a503f;
  border-radius: 6px;
  background: #121411;
  color: var(--ink);
}

.roomMeta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.roomMeta strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roomMeta span {
  color: var(--accent);
  font-weight: 800;
}

.roomsList {
  display: grid;
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
}

.roomRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #151814;
}

.roomRow strong,
.roomRow small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roomRow small {
  color: var(--muted);
  margin-top: 2px;
}

.nameRow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.nameRow button {
  white-space: nowrap;
}

.localPlayers {
  display: grid;
  gap: 8px;
}

.localPlayerRow {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
}

.localPlayerRow input {
  min-height: 36px;
}

.localPlayerRow button {
  min-height: 36px;
}

.memberList {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border-radius: 8px;
}

.memberRow {
  min-height: 54px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #20251f;
}

.memberRow strong,
.memberRow small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memberRow small {
  color: var(--muted);
}

.lobbySide {
  grid-area: side;
  width: min(920px, 100%);
  min-height: 0;
  justify-self: center;
  display: grid;
  gap: 14px;
}

.roster {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  overflow: hidden;
  border-radius: 8px;
}

.slot {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #20251f;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45);
  flex: 0 0 auto;
}

.swatch.muted {
  background: #60685d;
}

.slot small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.leaderboardPanel {
  width: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 14px;
  border-radius: 8px;
}

.leaderboardHeader {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.leaderboardHeader h2 {
  margin: 4px 0 0;
  font-size: 22px;
  letter-spacing: 0;
}

.leaderboardHeader small {
  color: var(--muted);
  text-align: right;
}

.leaderboard {
  display: grid;
  gap: 6px;
  overflow-y: auto;
  padding-right: 2px;
}

.leaderboardRow {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 34px auto minmax(0, 1fr) minmax(110px, auto);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-color: #3e4538;
  background: #20251f;
  text-align: left;
}

.leaderboardRow:hover {
  border-color: rgba(245, 223, 141, 0.58);
}

.leaderboardRow.hasReplay {
  cursor: pointer;
}

.leaderboardRow.noReplay {
  cursor: help;
}

.leaderboardRank {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(245, 223, 141, 0.34);
  border-radius: 50%;
  background: #151814;
  color: var(--accent);
  font-weight: 800;
}

.leaderboardName,
.leaderboardScore {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.leaderboardName strong,
.leaderboardScore strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboardName small,
.leaderboardScore small,
.emptyLeaderboard {
  color: var(--muted);
  font-size: 12px;
}

.leaderboardScore {
  text-align: right;
}

.leaderboardScore strong {
  color: var(--accent);
}

.emptyLeaderboard {
  padding: 8px 2px;
  line-height: 1.4;
}

.game {
  position: relative;
  width: 100%;
  height: 100%;
}

.topbar {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  right: 320px;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 12px;
  background: rgba(20, 23, 20, 0.92);
  border-bottom: 1px solid var(--line);
}

.titleBlock {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 172px;
}

.soundToggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  white-space: nowrap;
  font-size: 13px;
}

.resourceBar {
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, minmax(66px, 1fr));
  gap: 8px;
}

.resource {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 9px;
  border: 1px solid #3e4538;
  border-radius: 6px;
  background: #20251f;
  color: var(--muted);
  overflow: hidden;
}

.resource span,
.resource strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource strong {
  color: var(--ink);
  flex: 0 0 auto;
}

#battlefield {
  position: absolute;
  inset: 0 320px 0 0;
  width: calc(100% - 320px);
  height: 100%;
  display: block;
  background: #202b1e;
  cursor: crosshair;
  touch-action: none;
}

.pauseBanner {
  position: absolute;
  z-index: 7;
  inset: 0 320px 0 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  background: rgba(8, 10, 8, 0.38);
  pointer-events: none;
  text-align: center;
}

.pauseBanner strong {
  padding: 8px 18px;
  border: 1px solid rgba(245, 223, 141, 0.58);
  border-radius: 6px;
  background: rgba(18, 20, 17, 0.92);
  color: var(--accent);
  font-size: 30px;
  letter-spacing: 0;
}

.pauseBanner span {
  color: var(--ink);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

.replayControls {
  position: absolute;
  z-index: 7;
  left: 18px;
  right: 338px;
  bottom: 18px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(5, auto) minmax(160px, 260px) auto auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(245, 223, 141, 0.45);
  border-radius: 8px;
  background: rgba(18, 20, 17, 0.94);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.46);
}

.replayMeta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.replayMeta strong,
.replayMeta span,
#replaySpeedText {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.replayMeta span,
#replaySpeedText {
  color: var(--muted);
  font-size: 12px;
}

.replayControls button {
  min-height: 34px;
  padding: 0 10px;
}

#replayScrubber {
  min-height: 28px;
  padding: 0;
}

.commandPanel {
  position: absolute;
  z-index: 5;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  overflow: auto;
  border-left-color: var(--player-color, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--player-color, #242923) 20%, rgba(27, 31, 34, 0.96)), rgba(27, 31, 34, 0.96) 260px),
    rgba(27, 31, 34, 0.96);
}

.commandPanel.localTurn {
  box-shadow:
    inset 4px 0 0 var(--player-color, var(--accent)),
    0 20px 50px var(--shadow);
}

.panelBlock {
  display: grid;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.panelBlock h2,
.panelBlock h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
}

.statLine {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.actions button {
  min-height: 44px;
  padding: 7px 8px;
}

.actions button.primaryAction {
  grid-column: span 2;
  background: #896f1f;
  border-color: #c9a734;
}

.actions button.dangerAction {
  border-color: #8d4f49;
  background: #512a27;
}

.actions button.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.events {
  display: grid;
  align-content: start;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  min-height: 120px;
  max-height: 220px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #151814;
}

.commandPanel.spectatorMode .events {
  max-height: none;
  flex: 1 1 auto;
}

.countryList {
  min-height: 120px;
  max-height: 210px;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #151814;
  font-size: 12px;
  color: var(--muted);
}

.chatBox {
  display: grid;
  gap: 8px;
  min-height: 160px;
  margin-top: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #151814;
}

.lobbyChat {
  width: 100%;
  min-height: 140px;
  margin-top: 0;
}

.chatMessages {
  min-height: 92px;
  max-height: 150px;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.chatMessage {
  display: grid;
  gap: 2px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.chatMessage strong {
  font-size: 12px;
}

.chatInputRow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.chatInputRow input {
  min-height: 34px;
}

.chatInputRow button {
  min-height: 34px;
}

.countryGroup strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.countryGroup span {
  display: inline-block;
  margin: 0 6px 4px 0;
  padding: 2px 5px;
  border-radius: 4px;
  background: #252b24;
}

.event {
  border-left: 3px solid #6e765b;
  padding-left: 8px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.smallText {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.defeat {
  color: var(--danger);
}

.victory {
  color: var(--accent-2);
}

.victoryOverlay {
  position: absolute;
  z-index: 8;
  inset: 0 320px 0 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(12, 14, 12, 0.74), rgba(10, 12, 10, 0.9)),
    repeating-linear-gradient(100deg, rgba(245, 223, 141, 0.1) 0 2px, transparent 2px 22px);
}

.victoryPanel {
  position: relative;
  width: min(540px, 100%);
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 28px;
  border: 1px solid rgba(245, 223, 141, 0.58);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(37, 43, 35, 0.98), rgba(18, 21, 17, 0.98)),
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--winner-color, #d7ae35) 30%, transparent), transparent);
  box-shadow:
    0 26px 80px rgba(0, 0, 0, 0.58),
    0 0 0 4px rgba(245, 223, 141, 0.08);
  text-align: center;
  overflow: hidden;
  animation: victoryPanelIn 560ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.victoryPanel::before,
.victoryPanel::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 223, 141, 0.82), transparent);
}

.victoryPanel::before {
  top: 14px;
}

.victoryPanel::after {
  bottom: 14px;
}

.victoryStage {
  position: relative;
  width: min(240px, 68vw);
  height: 132px;
  display: grid;
  place-items: center;
}

.victoryRay {
  position: absolute;
  width: 212px;
  height: 212px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(245, 223, 141, 0.04),
    rgba(245, 223, 141, 0.42),
    rgba(85, 176, 133, 0.08),
    rgba(245, 223, 141, 0.38),
    rgba(245, 223, 141, 0.04)
  );
  animation: victorySpin 7s linear infinite;
}

.victoryMedal {
  position: relative;
  z-index: 1;
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  border: 3px solid rgba(255, 246, 190, 0.9);
  border-radius: 50%;
  background:
    linear-gradient(145deg, #ffe48a, #b88928 54%, #6b4b13);
  box-shadow:
    inset 0 0 0 7px rgba(89, 62, 15, 0.25),
    0 16px 32px rgba(0, 0, 0, 0.38),
    0 0 34px color-mix(in srgb, var(--winner-color, #d7ae35) 46%, transparent);
  color: #2b2011;
  font-weight: 900;
  font-size: 24px;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
  animation: victoryMedalPop 900ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.victoryRibbon {
  position: absolute;
  z-index: 0;
  bottom: 8px;
  width: 58px;
  height: 84px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--winner-color, #55b085) 72%, #f5df8d), #5f4120);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%);
}

.victoryRibbon.left {
  transform: translateX(-36px) rotate(18deg);
}

.victoryRibbon.right {
  transform: translateX(36px) rotate(-18deg);
}

.victorySpark {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #f5df8d;
  transform: rotate(45deg);
  box-shadow: 0 0 16px rgba(245, 223, 141, 0.86);
  animation: victorySpark 1200ms ease-in-out infinite;
}

.victorySpark.one {
  top: 20px;
  left: 28px;
}

.victorySpark.two {
  top: 34px;
  right: 22px;
  animation-delay: 180ms;
}

.victorySpark.three {
  right: 54px;
  bottom: 18px;
  animation-delay: 360ms;
}

.victorySpark.four {
  left: 58px;
  bottom: 26px;
  animation-delay: 540ms;
}

.victoryKicker {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}

.victoryPanel h2 {
  margin: 0;
  font-size: clamp(34px, 7vw, 58px);
  line-height: 0.96;
  letter-spacing: 0;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.25),
    0 0 28px color-mix(in srgb, var(--winner-color, #d7ae35) 38%, transparent);
}

.victoryPanel p {
  margin: 0;
  color: var(--muted);
  max-width: 410px;
  line-height: 1.45;
}

.victoryStats {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.victoryStats div {
  display: grid;
  gap: 4px;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(21, 24, 20, 0.9);
  box-shadow: inset 0 0 0 1px rgba(245, 223, 141, 0.04);
}

.victoryStats strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.victoryStats span {
  color: var(--muted);
  font-size: 12px;
}

.victoryButtons {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@keyframes victoryPanelIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes victorySpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes victoryMedalPop {
  0% {
    transform: scale(0.55) rotate(-12deg);
  }
  70% {
    transform: scale(1.08) rotate(3deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

@keyframes victorySpark {
  0%,
  100% {
    opacity: 0.35;
    transform: rotate(45deg) scale(0.72);
  }
  50% {
    opacity: 1;
    transform: rotate(45deg) scale(1.35);
  }
}

.instructionsOverlay {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 10, 8, 0.76);
}

.instructionsPanel {
  width: min(860px, 100%);
  max-height: min(86vh, 760px);
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid rgba(245, 223, 141, 0.5);
  border-radius: 8px;
  background: rgba(22, 25, 20, 0.98);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.58);
  overflow: hidden;
}

.instructionsPanel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.instructionsPanel h2,
.instructionsPanel h3 {
  margin: 0;
  letter-spacing: 0;
}

.instructionsPanel h2 {
  margin-top: 4px;
  font-size: 26px;
}

.instructionsBody {
  overflow-y: auto;
  padding: 18px 22px 24px;
  color: var(--muted);
}

.instructionsBody h3 {
  margin: 18px 0 8px;
  color: var(--ink);
  font-size: 16px;
}

.instructionsBody h3:first-child {
  margin-top: 0;
}

.instructionsBody p {
  margin: 0 0 12px;
  line-height: 1.5;
}

.instructionsBody ul {
  margin: 0;
  padding-left: 20px;
}

.instructionsBody li {
  margin: 0 0 8px;
  line-height: 1.45;
}

.instructionsBody strong {
  color: var(--ink);
}

@media (min-width: 1180px) {
  .lobby {
    grid-template-columns: minmax(260px, 0.75fr) minmax(360px, 450px) minmax(360px, 560px);
    grid-template-areas: "brand setup side";
    align-content: center;
  }

  .lobbySide {
    align-self: stretch;
    max-height: calc(100vh - 64px);
    grid-template-rows: auto minmax(0, 1fr) minmax(140px, 0.46fr);
    overflow-y: auto;
    padding-right: 4px;
  }

  .lobbySide .chatMessages {
    max-height: none;
  }
}

@media (max-width: 860px) {
  .lobby {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "setup"
      "side";
    align-content: center;
    justify-content: stretch;
    padding: 18px;
  }

  .brand {
    justify-self: start;
  }

  .setup,
  .lobbySide {
    width: 100%;
  }

  .brand h1 {
    font-size: 44px;
  }

  .leaderboardHeader {
    align-items: start;
    flex-direction: column;
  }

  .leaderboardHeader small {
    text-align: left;
  }

  .leaderboardRow {
    grid-template-columns: 30px auto minmax(0, 1fr);
  }

  .leaderboardScore {
    grid-column: 3;
    text-align: left;
  }

  .topbar {
    right: 0;
    flex-wrap: wrap;
  }

  .resourceBar {
    grid-template-columns: repeat(4, minmax(76px, 1fr));
    order: 3;
    flex-basis: 100%;
  }

  #battlefield {
    inset: 94px 0 220px 0;
    width: 100%;
    height: calc(100% - 314px);
  }

  .victoryOverlay {
    inset: 94px 0 220px 0;
    padding: 12px;
  }

  .pauseBanner {
    inset: 94px 0 220px 0;
  }

  .replayControls {
    left: 8px;
    right: 8px;
    bottom: 228px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .replayMeta {
    grid-column: 1 / -1;
  }

  #replayScrubber {
    grid-column: 1 / 4;
  }

  #replaySpeedText {
    text-align: center;
  }

  .victoryPanel {
    padding: 22px 16px;
  }

  .victoryStage {
    height: 110px;
  }

  .victoryStats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .instructionsOverlay {
    padding: 12px;
  }

  .instructionsPanel {
    max-height: 92vh;
  }

  .instructionsPanel header {
    align-items: start;
  }

  .commandPanel {
    top: auto;
    left: 0;
    width: 100%;
    height: 220px;
    flex-direction: row;
    overflow-x: auto;
  }

  .panelBlock,
  .actions,
  .events,
  .countryList,
  .chatBox {
    min-width: 230px;
  }

  .events {
    max-height: 190px;
    margin-top: 0;
  }

  .countryList {
    max-height: 190px;
  }

  .chatBox {
    margin-top: 0;
  }
}
