:root {
  --cream: #fff0c9;
  --gold: #f1c56a;
  --ink: #0b211e;
  --muted: #acc1af;
}
.app-screen:not([open]),
.arcade-select:not([open]) {
  display: none !important;
}
.app-screen h1,
.app-screen h2,
.arcade-select h2 {
  font-family: system-ui, sans-serif;
  font-weight: 900;
}
.in-menus .game-hud,
.in-menus .thumb-controls,
.in-menus .turn-status,
.in-menus .map-hint {
  visibility: hidden;
}
.app-screen,
.arcade-select {
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  box-sizing: border-box;
  border: 0;
  border-radius: 0;
  padding: clamp(20px, 5vh, 48px) max(28px, env(safe-area-inset-left));
  overflow: auto;
  color: var(--cream);
  background:
    radial-gradient(ellipse at 80% 15%, #3a665641, transparent 60%),
    linear-gradient(100deg, #071c19f5, #0d2927ed),
    url("../assets/limestone-v4.png") center/cover;
  font-family: system-ui, sans-serif;
}
.app-screen::backdrop,
.arcade-select::backdrop {
  background: #071c19;
}
.app-screen button,
.arcade-select button {
  font-family: inherit;
}
.app-screen [hidden],
.arcade-select [hidden] {
  display: none !important;
}
.screen-header {
  max-width: 880px;
}
.screen-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--gold);
  margin: 0 0 8px;
}
.screen-header h1 {
  font-size: clamp(32px, 7vw, 76px);
  line-height: 1;
  letter-spacing: -2px;
  margin: 0 0 14px;
  font-weight: 950;
}
.screen-copy {
  font-size: clamp(12px, 1.6vw, 17px);
  color: #bacabd;
  margin: 8px 0 20px;
  line-height: 1.5;
}
.screen-status {
  font-size: 13px;
  min-height: 20px;
  color: #f4ce91;
  margin: 12px 0;
}
.screen-button {
  cursor: pointer;
  border: 1px solid #9ab29b66;
  border-radius: 11px;
  background: #27483d;
  color: var(--cream);
  padding: 12px 22px;
  font-weight: 800;
  min-height: 48px;
  font-size: 13px;
  transition:
    background 0.15s,
    transform 0.15s;
}
.screen-button:hover:enabled {
  background: #3b6350;
}
.screen-button:active:enabled {
  transform: translateY(2px);
}
.screen-button:focus-visible {
  outline: 3px solid #fff1c9;
  outline-offset: 4px;
}
.screen-button.gold {
  background: var(--gold);
  color: #172a20;
  border-color: #ffe5aa;
  box-shadow: 0 4px 0 #8a6536;
}
.screen-button.quiet {
  background: #183a30;
  border-color: #82967b66;
}
.screen-button:disabled {
  opacity: 0.45;
  cursor: default;
}
.screen-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.screen-actions p {
  font-size: 13px;
  color: var(--muted);
}
.mode-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 1000px;
}
.mode-card {
  display: flex;
  flex-direction: column;
  align-items: start;
  text-align: left;
  padding: 28px;
  min-height: 160px;
  background: linear-gradient(140deg, #294d3f, #122e29);
  border: 1px solid #d4b66b66;
  box-shadow: 0 10px 40px #0003;
}
.mode-card small {
  color: #edc478;
  letter-spacing: 2px;
  font-size: 10px;
}
.mode-card strong {
  font-size: clamp(24px, 3vw, 40px);
  margin: 14px 0 8px;
}
.mode-card span {
  font-weight: 400;
  color: #b8c9bc;
  font-size: 13px;
}
.splash-screen {
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: radial-gradient(ellipse, #2d5541, #071b19 75%);
}
.splash-screen h1 {
  font-size: clamp(54px, 12vw, 150px);
  color: var(--gold);
  letter-spacing: -5px;
  text-shadow:
    0 6px #51451e,
    0 16px 50px #0009;
}
.splash-screen .screen-copy {
  letter-spacing: 5px;
  font-size: 12px;
}
.splash-start {
  margin-top: 25px;
  min-width: 250px;
}
.arcade-select {
  display: grid;
  grid-template-columns: minmax(180px, 34%) 1fr;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 8px 26px;
}
.arcade-select > .eyebrow,
.arcade-select > h2,
.arcade-select > .dialog-intro {
  grid-column: 1/-1;
}
.arcade-select > .eyebrow {
  color: var(--gold);
  letter-spacing: 4px;
  margin: 0;
}
.arcade-select > h2 {
  font-size: clamp(24px, 4vw, 48px);
  margin: 0;
  letter-spacing: 1px;
}
.arcade-select > .dialog-intro {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}
.arcade-select .setup-note,
.arcade-select > form {
  display: none;
}
.select-feature {
  grid-column: 1;
  grid-row: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  background: radial-gradient(ellipse at bottom, #697b3c44, transparent 70%);
}
.select-feature > canvas {
  width: auto;
  max-width: 100%;
  height: min(42vh, 330px);
  object-fit: contain;
  filter: drop-shadow(0 12px 15px #0005);
}
.select-biography {
  text-align: center;
}
.select-biography small {
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--gold);
}
.select-biography h2 {
  font-size: 32px;
  margin: 4px 0;
  color: var(--explorer);
}
.select-biography p {
  font-size: 12px;
  color: var(--muted);
  margin: 4px;
}
.arcade-select #characterGrid {
  grid-column: 2;
  grid-row: 4;
  align-self: center;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 8px 0;
}
.arcade-select .character {
  border-radius: 8px;
  border: 2px solid #9aaf8344;
  background: linear-gradient(150deg, #304438, #102b27);
  padding: 6px;
  overflow: hidden;
  min-width: 0;
  position: relative;
  box-shadow: 0 7px 0 #071d17;
}
.arcade-select .character.selected {
  border-color: var(--gold);
  background: linear-gradient(140deg, #6c6733, #234635);
  box-shadow:
    0 0 0 2px #ebc36c,
    0 8px 0 #5e4827;
}
.arcade-select .character canvas {
  height: clamp(60px, 18vh, 140px);
  width: 100%;
  object-fit: contain;
}
.arcade-select .character strong {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.arcade-select .character p {
  display: none;
}
.arcade-select .screen-actions {
  grid-column: 1/-1;
  justify-content: space-between;
  margin: 8px 0 0;
}
.lobby-topline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.room-code {
  font-size: 30px;
  letter-spacing: 5px;
  color: var(--gold);
  margin-right: 15px;
}
.lobby-seats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin: 16px 0;
  max-width: 1050px;
}
.lobby-seat {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 110px;
  border: 1px solid #6c8b6f66;
  border-radius: 12px;
  background: #183b3055;
}
.lobby-seat canvas {
  width: 100%;
  height: 110px;
  object-fit: contain;
}
.lobby-seat b {
  font-size: 11px;
  padding: 4px;
}
.lobby-seat > span {
  font-size: 30px;
  color: #809b7b;
}
.lobby-seat small {
  font-size: 8px;
  color: #94ad96;
  letter-spacing: 1px;
}
.code-entry,
.friend-search {
  display: flex;
  gap: 10px;
  max-width: 650px;
  margin: 12px 0;
}
.app-screen input {
  min-width: 0;
  flex: 1;
  min-height: 45px;
  box-sizing: border-box;
  background: #081f1b;
  color: var(--cream);
  border: 1px solid #82997e88;
  border-radius: 9px;
  font: 14px system-ui;
  padding: 12px;
}
.code-entry input {
  letter-spacing: 3px;
  text-transform: uppercase;
}
.archipelago-panel {
  border-top: 1px solid #98af7a44;
  margin-top: 20px;
  padding-top: 14px;
  max-width: 1050px;
}
.archipelago-panel h2 {
  font-size: 20px;
  margin: 0 0 7px;
}
.social-identity {
  font-size: 12px;
  color: var(--muted);
}
.social-identity a {
  color: var(--gold);
}
.social-identity .screen-button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 10px;
  margin-left: 8px;
}
.social-players {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px;
}
.social-player {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: #23433477;
  font-size: 13px;
}
.social-player > span {
  font-weight: 700;
}
.social-player small {
  font-size: 10px;
  color: #abc0aa;
}
.social-player button {
  margin-left: auto;
  padding: 8px 12px;
  min-height: 40px;
  font-size: 11px;
}
.invite-inbox {
  display: grid;
  gap: 7px;
  margin: 12px 0;
}
@media (max-height: 500px) {
  .app-screen,
  .arcade-select {
    padding: 16px max(24px, env(safe-area-inset-left));
  }
  .screen-header h1 {
    font-size: 36px;
  }
  .screen-copy {
    margin: 5px 0 12px;
  }
  .mode-card {
    min-height: 115px;
    padding: 18px;
  }
  .mode-card strong {
    font-size: 27px;
    margin: 8px 0;
  }
  .mode-cards {
    gap: 14px;
  }
  .screen-actions {
    margin: 10px 0;
  }
  .screen-button {
    min-height: 43px;
    padding: 10px 17px;
  }
  .splash-screen h1 {
    font-size: 80px;
  }
  .arcade-select {
    grid-template-columns: 30% 1fr;
    grid-template-rows: auto auto auto 1fr auto;
    gap: 3px 20px;
  }
  .arcade-select > .eyebrow {
    font-size: 9px;
  }
  .arcade-select > h2 {
    font-size: 23px;
  }
  .arcade-select > .dialog-intro {
    font-size: 10px;
  }
  .arcade-select .character canvas {
    height: 64px;
  }
  .arcade-select .character strong {
    font-size: 9px;
  }
  .select-feature > canvas {
    height: 140px;
  }
  .select-biography h2 {
    font-size: 23px;
  }
  .select-biography small,
  .select-biography p {
    font-size: 9px;
  }
  .arcade-select #characterGrid {
    gap: 7px;
    margin: 0;
  }
  .arcade-select .screen-actions {
    grid-row: 5;
  }
  .lobby-seat {
    min-height: 85px;
  }
  .lobby-seat canvas {
    height: 70px;
  }
  .lobby-seats {
    margin: 10px 0;
  }
  .archipelago-panel {
    margin-top: 12px;
  }
}
