:root {
  color-scheme: dark;
  --ink: #f2ede4;
  --ink-soft: rgba(242, 237, 228, 0.72);
  --ink-faint: rgba(242, 237, 228, 0.52);
  --panel: rgba(22, 33, 34, 0.52);
  --panel-soft: rgba(78, 92, 82, 0.26);
  --panel-strong: rgba(18, 25, 27, 0.76);
  --stroke: rgba(227, 214, 190, 0.14);
  --shadow: 0 28px 90px rgba(5, 9, 10, 0.35);
  --sage: #9eb59d;
  --moss: #6f8d73;
  --sand: #d5b38a;
  --clay: #c88867;
  --foam: #acc8c4;
  --rose: #d6a59a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
  background: #0f1818;
  color: var(--ink);
  overflow: hidden;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

#world {
  display: block;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(180deg, #59727d 0%, #9ab6b0 40%, #d4c7b0 100%);
}

.sky-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 247, 222, 0.18), transparent 28%),
    radial-gradient(circle at 50% 120%, rgba(13, 18, 19, 0.56), transparent 52%),
    linear-gradient(180deg, rgba(9, 12, 13, 0.12), transparent 18%, transparent 78%, rgba(4, 8, 8, 0.42));
}

.reticle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  margin-top: -9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 247, 234, 0.38);
  box-shadow: 0 0 0 1px rgba(12, 18, 19, 0.22);
  pointer-events: none;
}

.reticle::before,
.reticle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgba(255, 247, 234, 0.42);
  transform: translate(-50%, -50%);
}

.reticle::before {
  width: 1px;
  height: 26px;
}

.reticle::after {
  width: 26px;
  height: 1px;
}

.hud {
  position: absolute;
  z-index: 2;
}

.hud--top {
  top: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.hud--left,
.hud--right {
  top: 164px;
  width: min(320px, calc(50vw - 30px));
  display: grid;
  gap: 14px;
}

.hud--left {
  left: 20px;
}

.hud--right {
  right: 20px;
}

.hud--bottom {
  left: auto;
  right: 20px;
  bottom: 20px;
  width: min(360px, calc(100vw - 40px));
  pointer-events: none;
}

.brand {
  max-width: 640px;
}

.eyebrow,
.panel__eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.68rem;
  color: rgba(242, 237, 228, 0.7);
}

h1,
h2 {
  margin: 0;
  font-family: "Palatino Linotype", "Book Antiqua", "Iowan Old Style", serif;
  font-weight: 600;
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(2.3rem, 5vw, 4.4rem);
  line-height: 0.96;
}

h2 {
  font-size: 1.28rem;
}

.lede {
  margin: 12px 0 0;
  max-width: 62ch;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.5;
}

.stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.stat-pill,
.panel,
.modal__card {
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, var(--panel), rgba(14, 20, 21, 0.62));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.stat-pill {
  min-width: 114px;
  padding: 12px 14px;
  border-radius: 18px;
}

.stat-pill--wide {
  min-width: 170px;
}

.stat-pill span {
  display: block;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.68rem;
}

.stat-pill strong {
  display: block;
  margin-top: 4px;
  font-size: 1.18rem;
  color: var(--ink);
}

.panel {
  border-radius: 24px;
  padding: 18px 18px 16px;
}

.panel--soft {
  background: linear-gradient(180deg, var(--panel-soft), rgba(18, 25, 27, 0.58));
}

.panel__row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.metric-grid--compact {
  margin-top: 10px;
}

.metric {
  border-radius: 18px;
  padding: 12px 12px 11px;
  background: rgba(240, 233, 223, 0.06);
  border: 1px solid rgba(240, 233, 223, 0.08);
}

.metric span {
  display: block;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.64rem;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 1.02rem;
  line-height: 1.2;
}

.control-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  gap: 10px;
  color: var(--ink-soft);
}

.control-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

kbd {
  min-width: 28px;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid rgba(242, 237, 228, 0.15);
  background: rgba(242, 237, 228, 0.08);
  color: var(--ink);
  text-align: center;
  font-size: 0.74rem;
}

.meter-stack {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.meter-card__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--ink-soft);
}

.meter {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(242, 237, 228, 0.08);
}

.meter span {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sage), var(--sand));
  transition: width 0.18s ease;
}

.message-log {
  display: grid;
  gap: 8px;
}

.message-log p {
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(18, 26, 27, 0.24);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(242, 237, 228, 0.08);
  color: var(--ink-soft);
  line-height: 1.45;
}

.directory-link {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(242, 237, 228, 0.24);
}

.directory-link--top {
  display: inline-block;
  margin-top: 12px;
  color: var(--ink-soft);
}

.modal {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(6, 9, 10, 0.36);
  backdrop-filter: blur(8px);
}

.hidden {
  display: none;
}

.modal__card {
  width: min(660px, 100%);
  padding: 28px;
  border-radius: 32px;
  background:
    radial-gradient(circle at 10% 0%, rgba(213, 179, 138, 0.12), transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(158, 181, 157, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(19, 28, 29, 0.92), rgba(14, 19, 20, 0.9));
}

.modal__card p {
  color: var(--ink-soft);
  line-height: 1.6;
}

.modal__card--small {
  width: min(460px, 100%);
}

.modal__list {
  margin: 18px 0 0;
  padding-left: 20px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.modal__actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.modal__button {
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  color: #1c2322;
  background: linear-gradient(135deg, #d8c09e, #a8c0b3);
  box-shadow: 0 16px 40px rgba(5, 8, 8, 0.28);
}

.modal__small {
  margin-top: 14px;
  color: var(--ink-faint);
  font-size: 0.9rem;
}

@media (max-width: 1100px) {
  .hud--top {
    display: grid;
  }

  .stat-strip {
    justify-content: flex-start;
  }

  .hud--left,
  .hud--right {
    top: auto;
    bottom: 148px;
    width: min(320px, calc(50vw - 30px));
  }
}

@media (max-width: 860px) {
  body {
    overflow: auto;
  }

  .app-shell {
    min-height: 100svh;
  }

  #world,
  .sky-vignette,
  .reticle {
    position: fixed;
    inset: 0;
  }

  .hud--left,
  .hud--right {
    position: static;
    width: auto;
    margin: 12px 16px 0;
  }

  .hud--top,
  .hud--bottom {
    position: static;
    margin: 0 16px;
    padding-top: 16px;
  }

  .hud--bottom {
    padding-bottom: 20px;
    width: auto;
  }

  .reticle {
    display: none;
  }

  .modal {
    position: fixed;
  }
}
