@font-face {
  font-family: Atlas;
  src: url("fonts/serif.ttf") format("truetype");
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: Cabinet;
  src: url("fonts/sans.ttf") format("truetype");
  font-weight: 200 900;
  font-display: swap;
}
:root {
  --ink: #1a3140;
  --navy: #173549;
  --paper: #f5efdf;
  --muted: #6c7169;
  --line: #b6a585;
  --gold: #b48c45;
  --sea: #b9cfca;
  --p0: #456b83;
  --p1: #b5644e;
  --p2: #50796b;
  --p3: #b99448;
  font-family: Cabinet, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
html,
body,
#app {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 9px 14px;
  color: var(--ink);
  background: #f8f3e6;
  transition:
    background 0.13s,
    box-shadow 0.13s;
}
button:hover {
  background: #e8deca;
}
button:active {
  box-shadow: inset 0 1px 5px #18344030;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #185c85;
  outline-offset: 3px;
}
button.primary {
  background: var(--navy);
  color: var(--paper);
  border-color: var(--navy);
}
button.primary:hover {
  background: #244c61;
}
button.quiet {
  border-color: transparent;
  background: transparent;
}
button.danger {
  color: #9b362c;
}
input,
select {
  min-height: 44px;
  background: #fcf8ed;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 8px;
  max-width: 100%;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-family: Atlas, Georgia, serif;
  font-weight: 500;
}
h2 {
  font-size: 27px;
}
small {
  font-size: 12px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}
.app {
  height: 100%;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) 34px;
  background: var(--paper);
}
.masthead {
  background: var(--navy);
  color: var(--paper);
  display: flex;
  align-items: center;
  padding: 0 28px 0 50px;
  gap: 18px;
  border-bottom: 2px solid var(--gold);
  z-index: 2;
}
.wordmark {
  font-family: Atlas, serif;
  font-size: 29px;
  letter-spacing: 0.22em;
  font-weight: 500;
}
.masthead .tagline {
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #d5c8ac;
  border-left: 1px solid #6b7e82;
  padding-left: 20px;
}
.masthead .tools {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}
.masthead button {
  background: transparent;
  border-color: #718189;
  color: #f7efd9;
  min-width: 44px;
  padding: 6px;
}
.round {
  font:
    12px Atlas,
    serif;
  letter-spacing: 0.12em;
  white-space: nowrap;
}
.compass-small {
  font-size: 32px;
  color: #d6b46b;
}
.content {
  position: relative;
  min-height: 0;
  display: flex;
}
.map-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  background: var(--sea);
  touch-action: none;
}
.map-wrap:after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 35px #35544e25;
  border: 1px solid #7f988660;
}
.map {
  height: 100%;
  width: 100%;
  display: block;
  touch-action: none;
}
.grid-line {
  fill: none;
  stroke: #4b7571;
  opacity: 0.11;
  stroke-width: 0.7;
}
.land {
  stroke: #f5e8c9;
  stroke-width: 1.5;
  stroke-linejoin: round;
  filter: url(#coast);
}
.territory {
  cursor: pointer;
  outline: none;
}
.territory:hover .land,
.territory:focus-visible .land {
  stroke: #fff;
  stroke-width: 3;
  filter: brightness(1.1);
}
.territory.selected .land {
  stroke: #fffaf0;
  stroke-width: 4;
  filter: url(#selected);
}
.territory.target .land {
  stroke: #fff;
  stroke-width: 3;
  stroke-dasharray: 5 3;
}
.map .name {
  font:
    600 9.5px Atlas,
    serif;
  text-anchor: middle;
  fill: #172f38;
  paint-order: stroke;
  stroke: #f7eed6a0;
  stroke-width: 1.7;
  pointer-events: none;
}
.marker {
  fill: var(--ink);
  stroke: #f5e8cd;
  stroke-width: 1.5;
}
.army {
  fill: #fff7e5;
  font:
    600 14px Cabinet,
    sans-serif;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}
.emblem {
  fill: #fff7e5;
  font:
    8px Cabinet,
    sans-serif;
  text-anchor: middle;
  pointer-events: none;
}
.sea-label {
  font:
    italic 17px Atlas,
    serif;
  letter-spacing: 4px;
  fill: #4c6d68;
  opacity: 0.65;
  text-anchor: middle;
}
.sea-route {
  fill: none;
  stroke: #284e62;
  stroke-width: 1.6;
  stroke-dasharray: 3 6;
  opacity: 0.55;
}
.decor {
  fill: none;
  stroke: #4f6b5e;
  stroke-width: 1;
  opacity: 0.5;
}
.zoom {
  position: absolute;
  bottom: 15px;
  left: 15px;
  display: flex;
  gap: 3px;
  z-index: 1;
}
.zoom button {
  background: #f8f1dfec;
  padding: 4px 12px;
  box-shadow: 0 2px 8px #28423820;
}
.map-title {
  position: absolute;
  top: 18px;
  left: 22px;
  font:
    italic 14px Atlas,
    serif;
  letter-spacing: 0.08em;
  opacity: 0.75;
  pointer-events: none;
}
.map-coordinates {
  position: absolute;
  right: 18px;
  bottom: 18px;
  font-size: 10px;
  letter-spacing: 0.18em;
  opacity: 0.6;
}
.rail {
  width: 292px;
  flex-shrink: 0;
  padding: 22px;
  overflow: auto;
  border-left: 1px solid var(--line);
  background: linear-gradient(95deg, #e9ddc550, #faf5e9 13%);
  scrollbar-width: thin;
  display: flex;
  flex-direction: column;
  gap: 17px;
}
.ruled {
  display: flex;
  align-items: center;
  gap: 15px;
  text-transform: uppercase;
  font-size: 18px;
  letter-spacing: 0.16em;
}
.ruled:after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
}
.players {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.player {
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid #b6a58570;
  padding: 10px 3px;
}
.player.active {
  background: #e0e7e480;
  border-left: 3px solid var(--p);
  padding-left: 8px;
}
.shield {
  background: var(--p);
  color: #fff2ce;
  width: 32px;
  height: 39px;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 50% 100%, 0 72%);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}
.player-name {
  font:
    600 13px Atlas,
    serif;
  white-space: nowrap;
  max-width: 136px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-meta {
  font-size: 11px;
  color: var(--muted);
}
.player-total {
  margin-left: auto;
  font:
    25px Atlas,
    serif;
}
.phase-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.timer {
  font:
    20px Atlas,
    serif;
  tab-size: 2;
}
.timer.urgent {
  color: #a94435;
}
.phases {
  display: flex;
  gap: 9px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.phases span {
  opacity: 0.45;
}
.phases .current {
  opacity: 1;
  font-weight: 700;
  border-bottom: 1px solid var(--ink);
}
.actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 14px;
}
.actions .hint {
  color: #6a6b5e;
  font-size: 13px;
  line-height: 1.45;
}
.actions .selection {
  font:
    22px Atlas,
    serif;
}
.actions button {
  width: 100%;
}
.actions .row {
  display: flex;
  align-items: center;
  gap: 7px;
}
.actions .row button {
  width: auto;
  flex: 1;
}
.actions input[type="number"] {
  width: 72px;
  text-align: center;
}
.actions select {
  width: 100%;
}
.battle {
  border: 1px solid var(--line);
  padding: 14px 9px;
  border-radius: 4px;
  background: #eadfc537;
  text-align: center;
}
.battle-names {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.battle-armies {
  display: flex;
  align-items: center;
  justify-content: space-around;
  font:
    31px Atlas,
    serif;
  margin: 12px 0;
}
.battle-armies span {
  border-radius: 50%;
  background: var(--p);
  border: 2px solid #f8edcf;
  color: #fff4da;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
}
.battle-armies i {
  font:
    16px Atlas,
    serif;
}
.card-bar {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: auto;
}
.card-bar button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  font:
    18px Atlas,
    serif;
}
.footer {
  background: #f8f1e0;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  font-size: 12px;
  overflow: hidden;
}
.footer .notice {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.footer button {
  min-height: 30px;
  border: 0;
  border-left: 1px solid var(--line);
  padding: 3px 12px;
  background: transparent;
  font:
    12px Atlas,
    serif;
}
.home-panel {
  width: 34%;
  min-width: 290px;
  max-width: 440px;
  padding: clamp(20px, 4vw, 60px);
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 17px;
  background: linear-gradient(90deg, #f6efdc 93%, #f6efdc00);
  border-right: 1px solid #b6a58570;
}
.home-panel h1 {
  font-size: clamp(35px, 4.7vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}
.home-panel .intro {
  font:
    15px/1.55 Atlas,
    serif;
  color: #646a60;
  max-width: 250px;
}
.home-panel .cta {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 10px;
}
.home-panel .cta .primary {
  font:
    16px Atlas,
    serif;
  min-height: 50px;
}
.home-panel .fine {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-align: center;
}
.home .map-wrap {
  margin-left: 26%;
}
.home .map {
  width: 122%;
  max-width: none;
  margin-left: -9%;
}
.edition {
  position: absolute;
  right: 30px;
  bottom: 35px;
  text-align: center;
  line-height: 1.6;
  border-top: 1px solid #58726a;
  border-bottom: 1px solid #58726a;
  padding: 12px 24px;
  color: #3b5b52;
  font:
    italic 15px Atlas,
    serif;
}
.edition b {
  font:
    12px Cabinet,
    sans-serif;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}
.dialog-backdrop {
  position: absolute;
  inset: 0;
  background: #142b3f80;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.dialog {
  width: min(600px, 100%);
  max-height: 100%;
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--gold);
  box-shadow: 0 20px 90px #071f3650;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 17px;
}
.dialog .dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dialog .dialog-head button {
  font-size: 22px;
}
.dialog p {
  line-height: 1.6;
  font-size: 15px;
}
.dialog ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.6;
}
.dialog .row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.dialog label {
  display: flex;
  gap: 8px;
  align-items: center;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}
.card {
  min-height: 110px;
  border: 1px solid var(--line);
  background: linear-gradient(125deg, #eadab6, #fff9e9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
}
.card.selected {
  outline: 3px solid var(--navy);
  outline-offset: -4px;
}
.card .symbol {
  font:
    30px Atlas,
    serif;
}
.card small {
  font:
    11px Atlas,
    serif;
}
.continent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #b6a58560;
  padding: 8px 0;
}
.progress {
  height: 4px;
  background: #d5cbb5;
  margin-top: 7px;
  width: 160px;
}
.progress i {
  display: block;
  height: 100%;
  background: var(--navy);
}
.log {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.log button {
  background: transparent;
  text-align: left;
  font-size: 13px;
}
.queue-panel {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  width: min(470px, 90%);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 19px;
  box-shadow: 0 10px 45px #243f3633;
  z-index: 3;
}
.queue-panel .row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
}
.queue-panel .row button {
  flex: 1;
}
.queue-panel p {
  font-size: 13px;
  line-height: 1.4;
  margin-top: 8px;
}
.seat-dots {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}
.seat-dots span {
  height: 4px;
  flex: 1;
  background: #d4cbb7;
}
.seat-dots span.filled {
  background: var(--navy);
}
.waiting .home-panel {
  display: none;
}
.pending {
  font-size: 12px;
  color: #986535;
}
.pill {
  background: #dce5df;
  border: 1px solid #b6c7bf;
  border-radius: 30px;
  padding: 3px 8px;
  font-size: 11px;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.arrival {
  animation: appear 0.18s ease-out;
}
@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 900px) {
  .masthead {
    height: 50px;
    padding-right: 12px;
    gap: 10px;
  }
  .app {
    grid-template-rows: 50px minmax(0, 1fr) 32px;
  }
  .wordmark {
    font-size: 22px;
  }
  .masthead .tagline {
    display: none;
  }
  .rail {
    width: 235px;
    padding: 15px;
    gap: 12px;
  }
  .player {
    padding: 7px 2px;
  }
  .player-name {
    max-width: 105px;
  }
  .player-meta {
    font-size: 10px;
  }
  .home-panel {
    min-width: 250px;
    padding: 27px;
  }
  .home-panel h1 {
    font-size: 45px;
  }
  .home-panel .intro {
    font-size: 13px;
  }
  .home-panel {
    gap: 13px;
  }
}
@media (max-height: 500px) {
  .app {
    grid-template-rows: 43px minmax(0, 1fr) 28px;
  }
  .masthead {
    height: 43px;
  }
  .wordmark {
    font-size: 21px;
  }
  .home-panel {
    gap: 10px;
    padding: 22px;
    min-width: 230px;
  }
  .home-panel h1 {
    font-size: 37px;
  }
  .home-panel .intro,
  .home-panel .eyebrow {
    display: none;
  }
  .home-panel .cta {
    margin: 0;
  }
  .home-panel .cta .primary {
    min-height: 44px;
    font-size: 14px;
  }
  .home-panel .cta button {
    padding: 6px;
  }
  .edition {
    display: none;
  }
  .rail {
    width: 235px;
    padding: 12px;
    gap: 10px;
  }
  .players {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }
  .player {
    gap: 5px;
    position: relative;
  }
  .player-name {
    font-size: 10px;
    max-width: 65px;
  }
  .player-meta,
  .player-total {
    display: none;
  }
  .shield {
    width: 22px;
    height: 28px;
    font-size: 14px;
  }
  .ruled {
    font-size: 14px;
  }
  .dialog {
    padding: 16px;
    gap: 10px;
  }
  .dialog h2 {
    font-size: 24px;
  }
  .queue-panel {
    bottom: 12px;
    padding: 12px;
  }
  .queue-panel p {
    font-size: 12px;
  }
  .map-title {
    font-size: 11px;
    top: 10px;
    left: 12px;
  }
  .map-coordinates {
    display: none;
  }
}
@media (max-width: 600px) {
  .masthead {
    padding-left: 48px;
  }
  .wordmark {
    font-size: 17px;
    letter-spacing: 0.13em;
  }
  .compass-small,
  .round {
    display: none;
  }
  .home-panel {
    width: 53%;
    min-width: 0;
    padding: 15px;
    gap: 8px;
  }
  .home-panel h1 {
    font-size: 30px;
  }
  .home-panel .intro,
  .home-panel .eyebrow {
    display: none;
  }
  .home-panel .cta {
    gap: 4px;
  }
  .home-panel .fine {
    font-size: 8px;
  }
  .home-panel .cta .primary {
    font-size: 12px;
  }
  .home-panel .cta button {
    font-size: 11px;
    padding: 5px;
    min-height: 44px;
  }
  .home .map-wrap {
    margin-left: 38%;
  }
  .home .map {
    width: 190%;
    margin-left: -44%;
  }
  .home-panel .aux {
    display: none;
  }
  .home .footer .notice {
    font-size: 9px;
  }
  .content.playing {
    flex-direction: column;
  }
  .playing .map-wrap {
    min-height: 34%;
  }
  .rail {
    width: 100%;
    height: 45%;
    min-height: 145px;
    padding: 9px 12px;
    border-left: 0;
    border-top: 1px solid var(--line);
    display: block;
  }
  .rail .players,
  .rail > .ruled,
  .card-bar,
  .phases {
    display: none;
  }
  .phase-title {
    font-size: 13px;
    margin-bottom: 8px;
  }
  .actions {
    gap: 6px;
  }
  .actions .hint {
    font-size: 11px;
  }
  .actions .selection {
    font-size: 17px;
  }
  .actions .battle {
    padding: 7px;
  }
  .battle-armies {
    margin: 4px;
  }
  .battle-armies span {
    width: 33px;
    height: 33px;
    font-size: 23px;
  }
  .rail .actions .row {
    justify-content: flex-start;
  }
  .footer {
    padding: 0 7px;
    font-size: 10px;
  }
  .footer button {
    font-size: 10px;
    padding: 2px 6px;
  }
  .dialog-backdrop {
    padding: 8px;
  }
  .dialog p,
  .dialog ul {
    font-size: 13px;
  }
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
  .card {
    min-height: 80px;
  }
  .queue-panel {
    bottom: 7px;
    padding: 12px;
  }
  .queue-panel h2 {
    font-size: 21px;
  }
  .queue-panel p {
    font-size: 11px;
  }
  .queue-panel .row {
    margin-top: 8px;
  }
}
@media (max-height: 270px) {
  .app {
    grid-template-rows: 32px minmax(0, 1fr) 24px;
  }
  .masthead {
    height: 32px;
  }
  .masthead button {
    min-height: 28px;
    min-width: 32px;
    padding: 1px 5px;
  }
  .home-panel {
    padding: 9px 13px;
    gap: 4px;
  }
  .home-panel h1 {
    font-size: 26px;
  }
  .home-panel .fine {
    display: none;
  }
  .home-panel .cta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }
  .home-panel .cta .primary {
    grid-column: 1/-1;
  }
  .home-panel .cta button {
    min-height: 44px;
    font-size: 10px;
  }
  .home-panel .cta .aux {
    display: none;
  }
  .footer {
    font-size: 9px;
  }
  .queue-panel p,
  .queue-panel .seat-dots {
    display: none;
  }
  .queue-panel {
    padding: 10px;
  }
  .dialog {
    padding: 10px;
  }
  .dialog h2 {
    font-size: 20px;
  }
  .dialog-head button {
    min-height: 32px;
  }
  .zoom {
    bottom: 5px;
    left: 5px;
  }
  .zoom button {
    min-height: 35px;
    padding: 2px 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.queue-return {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
}
.queue-return button {
  background: var(--paper);
  font-size: 12px;
  box-shadow: 0 2px 12px #18344030;
}

.app > .masthead {
  grid-row: 1;
}
.app > .content {
  grid-row: 2;
}
.app > .footer {
  grid-row: 3;
}

.hide-hints .context-hint {
  display: none;
}

.last-roll {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.last-roll small {
  font-size: 10px;
  color: var(--muted);
}
.dice {
  display: flex;
  gap: 3px;
}
.dice i {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 3px;
  background: var(--navy);
  color: var(--paper);
  font-style: normal;
  font-size: 12px;
}
.dice.defense i {
  background: #a65343;
}

/* Waiting has no introduction panel, so the atlas should fill its vacated space. */
.waiting .map-wrap {
  margin-left: 0;
}
.waiting .map {
  width: 100%;
  margin-left: 0;
}

/* A short phone embed still exposes practice alongside invitations at touch size. */
@media (max-height: 270px) and (max-width: 600px) {
  .home-panel { width: 70%; padding: 6px 13px; }
  .home-panel h1 { font-size: 24px; line-height: 1; }
  .home .map-wrap { margin-left: 55%; }
  .waiting .map-wrap { margin-left: 0; }
}

/* A completed player's next action takes priority over the inactive turn controls. */
.rail:has([data-action="again"]) > .phase-title,
.rail:has([data-action="again"]) > .phases,
.rail:has([data-action="again"]) > .card-bar {
  display: none;
}
.rail:has([data-action="again"]) .player {
  padding-top: 6px;
  padding-bottom: 6px;
}
