:root {
  font:
    16px/1.5 system-ui,
    sans-serif;
  color: #eef5e7;
  background: #112c32;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header,
main {
  max-width: 1120px;
  margin: auto;
  padding: 18px 22px;
}
header,
.heading,
#say {
  display: flex;
  align-items: center;
  gap: 16px;
}
header {
  border-bottom: 1px solid #446066;
}
header b,
small {
  letter-spacing: 0.16em;
  color: #ffd38d;
}
header button,
.heading strong {
  margin-left: auto;
}
h1,
h2,
p {
  margin: 0.35em 0 0.7em;
}
h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
}
h2 {
  font-size: 1.3rem;
}
h3 {
  font-size: 1rem;
  margin: 1.1rem 0 0.35rem;
  color: #ffd38d;
}
small {
  font-size: 0.75rem;
  font-weight: 700;
}
.panel,
#gate {
  padding: 20px;
  background: #1b3940;
  border: 1px solid #446066;
  border-radius: 16px;
}
#gate {
  max-width: 460px;
  margin: 8vh auto;
}
label {
  display: block;
  margin: 14px 0;
}
label input {
  display: block;
  width: 100%;
}
#registrationGender {
  margin: 14px 0;
  border: 1px solid #65807d;
  border-radius: 8px;
}
#registrationGender label {
  margin: 6px 0;
}
#registrationGender input {
  display: inline;
  width: auto;
  margin-right: 7px;
}
button,
input,
select {
  font: inherit;
  border: 1px solid #65807d;
  border-radius: 8px;
  padding: 7px 12px;
}
button {
  cursor: pointer;
  background: #35595b;
  color: #fff;
  margin: 2px;
}
button:hover,
button:focus-visible {
  background: #496d68;
}
:is(button, input, select, summary, #map):focus-visible {
  outline: 2px solid #ffd38d;
  outline-offset: 2px;
}
input,
select {
  background: #112b30;
  color: #fff;
  min-width: 0;
}
button:disabled {
  opacity: 0.55;
  cursor: default;
}
#game {
  position: fixed;
  inset: 0;
  overflow: hidden;
}
body:has(#game:not([hidden])) {
  overflow: hidden;
}
#map {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse, #385653, #172f39);
  cursor: crosshair;
}
#game:has(#map-tiles) {
  background: radial-gradient(ellipse, #385653, #172f39);
}
#game:has(#map-tiles) #map {
  opacity: 0;
}
#map-tiles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
#map-tiles canvas {
  position: absolute;
  display: block;
  pointer-events: none;
}
#actor-actions {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.actor-action {
  position: absolute;
  left: 0;
  top: 0;
  max-width: min(220px, 60vw);
  padding: 3px 9px;
  border: 1px solid #ffd38d;
  border-radius: 12px;
  background: #173940f2;
  color: #fff4d7;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  white-space: normal;
  box-shadow: 0 2px 8px #071c23a8;
}
button[data-tip] {
  position: relative;
}
button[data-tip]:is(:hover, :focus-visible, .tip-open)::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(260px, 80vw);
  white-space: normal;
  padding: 7px 9px;
  border: 1px solid #ffd38d;
  border-radius: 8px;
  background: #112b30;
  color: #fff4d7;
  font-size: 13px;
  font-weight: 400;
  text-align: left;
  line-height: 1.35;
  z-index: 10;
  pointer-events: none;
}
.heading,
.panels {
  position: absolute;
  left: 12px;
  max-width: calc(100% - 24px);
  background: #19363df5;
  border: 1px solid #446066;
  border-radius: 12px;
  padding: 6px;
  z-index: 2;
}
.heading {
  top: 12px;
  padding-left: 12px;
  flex-wrap: wrap;
}
.telemetry {
  display: inline-flex;
  gap: 10px;
  color: #c7d7ce;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.telemetry output {
  color: #ffd38d;
}
.heading .panel {
  top: calc(100% + 8px);
  bottom: auto;
  max-height: calc(100dvh - 120px);
}
#info a {
  color: #ffd38d;
}
.panels {
  bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.panels > details,
.heading > details {
  margin: 0;
}
.panels > details > summary,
.heading > details > summary {
  cursor: pointer;
  padding: 7px 9px;
  border-radius: 7px;
  white-space: nowrap;
}
.panels > details[open] > summary,
.heading > details[open] > summary {
  background: #496d68;
  color: #fff4d7;
}
.panel {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100dvh - 155px);
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: 0 12px 32px #071c23a8;
  overflow-wrap: anywhere;
}
.panel > h2:first-child {
  margin-top: 0;
}
.panel .subsection,
.settings-section {
  border-top: 1px solid #446066;
  padding-top: 8px;
  margin-top: 18px;
}
.settings-section h3 {
  margin-top: 0;
}
#places button {
  width: 100%;
  margin: 3px 0;
  text-align: left;
}
#game [hidden] {
  display: none !important;
}
.form-note {
  font-size: 0.875rem;
  border-left: 2px solid #65807d;
  padding-left: 10px;
}
#bankForm button,
#actions button,
#lodging button {
  max-width: 100%;
  white-space: normal;
  text-align: left;
}
#stats,
#bankStats {
  white-space: pre-line;
  line-height: 1.8;
}
#skills p {
  overflow-wrap: anywhere;
}
#skills select,
#actions select {
  display: block;
  width: 100%;
  margin: 6px 0;
}
hr {
  border: 0;
  border-top: 1px solid #446066;
  margin: 16px 0;
}
#notice,
#authError {
  color: #ffda92;
}
#notice:not(:empty) {
  position: absolute;
  top: 4.2rem;
  right: 12px;
  max-width: min(28rem, calc(100% - 24px));
  padding: 4px 10px;
  border-radius: 8px;
  background: #19363df5;
  pointer-events: none;
}
kbd {
  font-size: 0.75em;
  color: #ffd38d;
}
@media (max-width: 520px) {
  .panels {
    width: calc(100% - 24px);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
  }
  .panels > details > summary {
    padding: 8px 2px;
    font-size: 0.8rem;
    text-align: center;
    list-style: none;
    white-space: normal;
    line-height: 1.2;
  }
  .panels kbd {
    display: none;
  }
  .panels .panel {
    max-height: 55dvh;
  }
  .heading {
    gap: 5px 10px;
    font-size: 0.85rem;
  }
  .heading .panel {
    max-height: 55dvh;
  }
  .heading .telemetry {
    font-size: 0.72rem;
  }
}
#say input {
  flex: 1;
}
#messages {
  max-height: 180px;
  overflow: auto;
  padding-left: 20px;
  overflow-wrap: anywhere;
}
p {
  color: #c7d7ce;
}
@media (max-width: 720px) {
  .panel,
  main {
    padding: 12px;
  }
}
details {
  margin-top: 14px;
}
.panels > details,
.heading > details {
  margin-top: 0;
}
details input {
  display: inline;
  width: auto;
}
#game.dead #destinations,
#game.dead #bank,
#game.dead #neighbors,
#game.dead #chat,
#game.dead #eat,
#game.dead #actions,
#game.dead #social,
#game.dead #character .panel > small:not(:first-child) {
  display: none;
}
#leaderboard .panel {
  width: min(420px, calc(100vw - 24px));
}
#leaderboardCategory {
  display: block;
  width: 100%;
}
.leaderboard-list,
#leaderboardOwn ol {
  list-style: none;
  margin: 8px 0;
  padding: 0;
}
.leaderboard-list li,
#leaderboardOwn li {
  display: grid;
  grid-template-columns: 3ch minmax(0, 1fr) auto;
  gap: 10px;
  padding: 4px 8px;
  border-bottom: 1px solid #446066;
  font-variant-numeric: tabular-nums;
}
.leaderboard-list li span:nth-child(2),
#leaderboardOwn li span:nth-child(2) {
  overflow-wrap: anywhere;
}
.leaderboard-me {
  background: #496d68;
  color: #fff4d7;
  font-weight: 700;
  border-radius: 6px;
}
#transfer {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
#amount {
  width: 6rem;
}
.taxi-dialog {
  box-sizing: border-box;
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 18px;
  border: 2px solid #a9dac4;
  border-radius: 12px;
  background: #17353d;
  color: #fff4d7;
}
.taxi-dialog::backdrop { background: #08191bba; }
.taxi-dialog select,
.taxi-dialog button { display: block; box-sizing: border-box; width: 100%; margin: 10px 0; }
.taxi-dialog small { display: block; margin: -6px 0 12px; }
#taxiOffers button {
  display: block;
  box-sizing: border-box;
  width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  margin: 8px 0;
}
