* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;

  background:
    radial-gradient(circle at top, #1b2230 0%, #0c1017 42%, #07090d 100%);

  color: #f3f4f6;

  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app {
  width: 100%;
  max-width: 680px;

  margin: 0 auto;

  padding:
    max(24px, env(safe-area-inset-top))
    18px
    max(40px, env(safe-area-inset-bottom));
}

/* =========================
   HEADER
   ========================= */

.brand {
  margin-bottom: 5px;

  color: #aeb8c8;

  font-size: 12px;
  letter-spacing: 0.24em;

  text-transform: uppercase;
}

.title {
  margin: 0;

  font-size: 28px;
  font-weight: 750;
}

.subtitle {
  margin-top: 6px;

  color: #919bab;

  font-size: 14px;
}

/* =========================
   HUD
   ========================= */

.hud {
  margin-top: 22px;

  padding: 14px 15px;

  border: 1px solid #28303d;
  border-radius: 14px;

  background: rgba(16, 21, 30, 0.8);
}

.hud-row {
  display: flex;
  justify-content: space-between;

  gap: 10px;

  margin: 5px 0;

  font-size: 13px;
}

.hud-label {
  color: #778292;
}

.hud-value {
  max-width: 70%;

  color: #e8ebef;

  text-align: right;
}

/* =========================
   SCENE
   ========================= */

.scene-card {
  margin-top: 18px;

  padding: 20px;

  border: 1px solid #282f3b;
  border-radius: 18px;

  background: rgba(17, 22, 31, 0.9);
}

.scene-label {
  margin-bottom: 14px;

  color: #818b9b;

  font-size: 11px;
  letter-spacing: 0.16em;

  text-transform: uppercase;
}

.scene-text {
  font-size: 17px;
  line-height: 1.66;

  white-space: pre-wrap;
}

/* =========================
   CHOICES
   ========================= */

.choices {
  display: grid;

  gap: 10px;

  margin-top: 18px;
}

.choice {
  width: 100%;
  min-height: 52px;

  padding: 14px 16px;

  border: 1px solid #313a48;
  border-radius: 14px;

  background: #151b25;

  color: #f5f7fa;

  font-size: 16px;
  line-height: 1.35;

  text-align: left;

  cursor: pointer;
}

.choice:hover {
  border-color: #465263;
  background: #1a222e;
}

.choice:active {
  transform: scale(0.985);
}

.choice:disabled {
  opacity: 0.45;

  cursor: default;
}

/* =========================
   FREEFORM ACTION
   ========================= */

.freeform {
  margin-top: 22px;
  padding-top: 18px;

  border-top: 1px solid #242b35;
}

.freeform-label {
  margin-bottom: 8px;

  color: #9ba5b5;

  font-size: 13px;
}

textarea {
  width: 100%;
  min-height: 92px;

  padding: 14px;

  resize: vertical;

  border: 1px solid #303846;
  border-radius: 14px;

  outline: none;

  background: #0e131b;

  color: #f4f5f7;

  font-size: 16px;
  line-height: 1.4;
}

textarea:focus {
  border-color: #68778b;
}

textarea::placeholder {
  color: #616c7a;
}

/* =========================
   BUTTONS
   ========================= */

.primary {
  width: 100%;
  min-height: 50px;

  margin-top: 10px;

  border: none;
  border-radius: 14px;

  background: #e4e8ed;

  color: #10151c;

  font-size: 16px;
  font-weight: 700;

  cursor: pointer;
}

.primary:hover {
  background: #ffffff;
}

.primary:active {
  transform: scale(0.985);
}

.primary:disabled {
  opacity: 0.45;

  cursor: default;
}

/* =========================
   START SCREEN
   ========================= */

.start-card {
  margin-top: 28px;

  padding: 24px 20px;

  border: 1px solid #2b3340;
  border-radius: 18px;

  background: rgba(17, 22, 31, 0.92);
}

.start-card h2 {
  margin-top: 0;

  font-size: 22px;
}

.start-card p {
  color: #aab2bf;

  line-height: 1.55;
}

/* =========================
   SYSTEM FEEDBACK
   ========================= */

.loading {
  display: none;

  margin-top: 18px;

  color: #aab3c1;

  font-size: 14px;
}

.error {
  display: none;

  margin-top: 16px;
  padding: 12px;

  border: 1px solid #6a3535;
  border-radius: 12px;

  background: #271515;

  color: #ffcaca;

  font-size: 14px;
  line-height: 1.4;
}

.small-action {
  margin-top: 18px;

  padding: 10px 12px;

  border: 1px solid #2d3541;
  border-radius: 10px;

  background: transparent;

  color: #8994a4;

  font-size: 12px;

  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* =========================
   DESKTOP
   ========================= */

@media (min-width: 700px) {
  .app {
    padding-top: 42px;
  }

  .scene-card {
    padding: 26px;
  }
}
