:root {
  --ink: #e9f0da;
  --ink-dim: rgba(233, 240, 218, 0.62);
  --ink-faint: rgba(233, 240, 218, 0.34);
  --glow: #d4ff6a;
  --gold: #ffd88a;
  --ember: #ff7a3c;
  --panel: rgba(6, 12, 14, 0.62);
  --panel-edge: rgba(212, 255, 106, 0.16);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #030605;
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

#root {
  position: fixed;
  inset: 0;
  background: #030605;
  touch-action: none;
}

#root > p {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  margin: 0;
}

canvas {
  display: block;
  cursor: none;
}

* {
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

#hud button {
  pointer-events: auto;
  font-family: var(--serif);
  cursor: pointer;
}

/* ---------------------------------------------------------------- corners */

.hud-corner {
  position: absolute;
  transition: opacity 0.8s ease;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.9);
}

#hud:not(.in-night) .hud-corner {
  opacity: 0;
}

.hud-top-left {
  top: 18px;
  left: 22px;
}

.night-numeral {
  font-size: 13px;
  letter-spacing: 0.35em;
  color: var(--glow);
  text-transform: uppercase;
  opacity: 0.8;
}

.night-name {
  font-size: 22px;
  font-style: italic;
  margin-top: 2px;
}

.night-keys {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 6px;
  letter-spacing: 0.04em;
}

.hud-top-center {
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(360px, 44vw);
  text-align: center;
}

.dawn-track {
  position: relative;
  height: 2px;
  margin-top: 10px;
  background: linear-gradient(90deg, rgba(120, 150, 220, 0.25), rgba(255, 190, 150, 0.45));
  border-radius: 2px;
}

.dawn-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, rgba(160, 190, 255, 0.5), rgba(255, 200, 150, 0.9));
  border-radius: 2px;
}

.dawn-sun {
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: #fff3d8;
  box-shadow: 0 0 10px 3px rgba(255, 210, 160, 0.6);
}

.dawn-label {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-dim);
  margin-top: 9px;
  text-transform: uppercase;
}

.dawn-label.urgent {
  color: #ffc6a0;
}

.hud-top-right {
  top: 12px;
  right: 18px;
  text-align: center;
}

.moon {
  width: 84px;
  height: 84px;
}

.moon-label {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
  text-transform: uppercase;
  margin-top: -2px;
}

.moon-label b {
  color: var(--ink);
  font-weight: 600;
}

.moon-label.rising b {
  color: var(--gold);
}

.hud-bottom-left {
  bottom: 18px;
  left: 22px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
}

.population b {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--glow);
  font-weight: normal;
  letter-spacing: 0;
  margin-right: 4px;
}

.population.hurt b {
  animation: hurt 0.6s ease;
}

@keyframes hurt {
  30% {
    color: #ff8a6a;
    text-shadow: 0 0 12px rgba(255, 110, 80, 0.8);
  }
}

.veil {
  position: absolute;
  inset: 0;
  background: #020403;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.veil.show {
  opacity: 1;
  pointer-events: auto;
}

.eaten {
  margin-top: 3px;
  color: var(--ink-faint);
}

.hud-bottom-center {
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

.wheel {
  width: 132px;
  height: 132px;
}

.hud-bottom-right {
  bottom: 18px;
  right: 18px;
  display: flex;
  gap: 8px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--panel-edge);
  background: var(--panel);
  color: var(--ink-dim);
  font-size: 14px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: color 0.2s, border-color 0.2s;
}

.icon-button:hover {
  color: var(--ink);
  border-color: rgba(212, 255, 106, 0.45);
}

.icon-button.off {
  color: var(--ink-faint);
  text-decoration: line-through;
}

/* ---------------------------------------------------------------- toasts */

.toasts {
  position: absolute;
  top: 92px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(560px, 90vw);
}

.toast {
  font-size: 17px;
  font-style: italic;
  text-align: center;
  padding: 7px 18px;
  border-radius: 999px;
  background: rgba(4, 9, 10, 0.5);
  border: 1px solid rgba(212, 255, 106, 0.1);
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
  animation: toast-in 0.6s ease both;
}

.toast.warn {
  color: #ffd0b0;
  border-color: rgba(255, 140, 90, 0.25);
}

.toast.leaving {
  animation: toast-out 0.8s ease both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.popups {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.popup {
  position: absolute;
  transform: translate(-50%, -100%);
  font-size: 16px;
  font-style: italic;
  white-space: nowrap;
  animation: popup 1s ease-out both;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
}

.popup.perfect {
  color: var(--gold);
  font-size: 19px;
}

.popup.good {
  color: #d9ecff;
}

.popup.off {
  color: rgba(255, 150, 130, 0.8);
  font-size: 14px;
}

@keyframes popup {
  from {
    opacity: 0;
    margin-top: 0;
  }
  15% {
    opacity: 1;
  }
  to {
    opacity: 0;
    margin-top: -38px;
  }
}

/* ---------------------------------------------------------------- intro card */

.intro-card {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  opacity: 0;
  transition: opacity 0.9s ease;
  text-shadow: 0 0 18px rgba(0, 0, 0, 0.95);
  width: min(640px, 92vw);
}

.intro-card.show {
  opacity: 1;
}

.intro-card .numeral {
  font-size: 15px;
  letter-spacing: 0.6em;
  color: var(--glow);
  text-transform: uppercase;
}

.intro-card .name {
  font-size: clamp(40px, 7vw, 68px);
  font-style: italic;
  margin: 6px 0 10px;
}

.intro-card .lore {
  font-size: 18px;
  color: var(--ink-dim);
}

/* ---------------------------------------------------------------- screens */

.screen {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.7s ease,
    visibility 0s linear 0.7s;
}

.screen.show {
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.7s ease,
    visibility 0s;
}

.screen.dim {
  background: radial-gradient(ellipse at center, rgba(2, 6, 6, 0.55), rgba(2, 5, 5, 0.82));
}

.screen-inner {
  text-align: center;
  padding: 24px;
  width: min(720px, 94vw);
}

.title-screen .screen-inner {
  pointer-events: none;
}

.wordmark {
  font-size: clamp(38px, 10.5vw, 124px);
  letter-spacing: 0.16em;
  font-weight: normal;
  margin: 0;
  padding-left: 0.16em;
  color: #f3f8e6;
  text-shadow:
    0 0 24px rgba(212, 255, 106, 0.55),
    0 0 70px rgba(212, 255, 106, 0.25);
  animation: breathe 3.2s ease-in-out infinite;
}

@keyframes breathe {
  50% {
    text-shadow:
      0 0 34px rgba(212, 255, 106, 0.8),
      0 0 90px rgba(212, 255, 106, 0.4);
  }
}

.subtitle {
  font-size: clamp(17px, 2.4vw, 23px);
  font-style: italic;
  color: var(--ink-dim);
  margin-top: 4px;
  letter-spacing: 0.08em;
}

.primary {
  margin-top: 34px;
  padding: 13px 38px;
  font-size: 19px;
  letter-spacing: 0.12em;
  color: #0b1406;
  background: linear-gradient(180deg, #e6ff9a, #b8e657);
  border: none;
  border-radius: 999px;
  box-shadow:
    0 0 26px rgba(212, 255, 106, 0.45),
    inset 0 -2px 0 rgba(0, 0, 0, 0.15);
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease;
}

.primary:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow:
    0 0 38px rgba(212, 255, 106, 0.7),
    inset 0 -2px 0 rgba(0, 0, 0, 0.15);
}

.secondary {
  margin: 10px 6px 0;
  padding: 9px 22px;
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--ink);
  background: rgba(10, 18, 16, 0.6);
  border: 1px solid rgba(233, 240, 218, 0.22);
  border-radius: 999px;
  transition: border-color 0.2s ease;
}

.secondary:hover {
  border-color: rgba(212, 255, 106, 0.6);
}

.night-list {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
  flex-wrap: wrap;
}

.night-chip {
  width: 64px;
  padding: 8px 0 6px;
  border-radius: 12px;
  border: 1px solid rgba(233, 240, 218, 0.16);
  background: rgba(6, 12, 12, 0.55);
  color: var(--ink);
  font-size: 18px;
}

.night-chip small {
  display: block;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-top: 3px;
  min-height: 13px;
}

.night-chip:hover:not(:disabled) {
  border-color: rgba(212, 255, 106, 0.6);
}

.night-chip:disabled {
  opacity: 0.32;
  cursor: default;
}

.controls {
  margin-top: 30px;
  font-family: var(--sans);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
  line-height: 1.9;
}

.controls kbd {
  font-family: var(--sans);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(233, 240, 218, 0.25);
  color: var(--ink);
  margin: 0 2px;
}

.blurb {
  margin: 26px auto 0;
  max-width: 520px;
  font-size: 15px;
  font-style: italic;
  color: var(--ink-faint);
  line-height: 1.55;
}

.card-title {
  font-size: clamp(38px, 6.5vw, 64px);
  font-style: italic;
  margin: 0 0 4px;
  text-shadow: 0 0 30px rgba(212, 255, 106, 0.35);
}

.card-title.dawn {
  text-shadow: 0 0 30px rgba(255, 190, 140, 0.4);
}

.card-sub {
  font-size: 18px;
  color: var(--ink-dim);
  font-style: italic;
}

.stars {
  margin: 20px 0 8px;
  font-size: 42px;
  letter-spacing: 0.25em;
  padding-left: 0.25em;
}

.stars span {
  display: inline-block;
  color: rgba(233, 240, 218, 0.15);
  transform: scale(0.6);
  transition:
    transform 0.5s cubic-bezier(0.3, 1.8, 0.5, 1),
    color 0.4s ease;
}

.stars span.lit {
  color: var(--gold);
  text-shadow: 0 0 18px rgba(255, 216, 138, 0.8);
  transform: scale(1);
}

.stats {
  margin: 14px auto 8px;
  display: grid;
  grid-template-columns: auto auto;
  gap: 6px 22px;
  justify-content: center;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-align: left;
  color: var(--ink-dim);
}

.stats b {
  color: var(--ink);
  font-weight: 600;
}

.star-notes {
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--ink-faint);
  margin-top: 8px;
  line-height: 1.7;
}

.star-notes .got {
  color: var(--gold);
}

.pause-hint {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 18px;
}

@media (max-width: 640px) {
  .hud-top-center {
    top: 118px;
    width: 64vw;
  }
  .toasts {
    top: 160px;
  }
  .toast {
    font-size: 15px;
  }
  .wheel {
    width: 104px;
    height: 104px;
  }
  .moon {
    width: 64px;
    height: 64px;
  }
  .night-keys {
    display: none;
  }
}
/*$vite$:1*/