/* ROVA — Gene 0 */
/* The feeling before the architecture. */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: #0a0a0f;
  color: #c8c8d0;
  font-family: Georgia, 'Times New Roman', serif;
}

#game {
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* --- The Arrival --- */

.arrival {
  max-width: 480px;
  width: 100%;
  text-align: center;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.arrival.visible {
  opacity: 1;
}

.greeting {
  font-size: 1.1rem;
  color: #8a8a9a;
  margin-bottom: 48px;
  line-height: 1.6;
  letter-spacing: 0.02em;
}

.question {
  font-size: 1.4rem;
  color: #d0d0dc;
  margin-bottom: 40px;
  line-height: 1.5;
  font-style: italic;
}

.input-area {
  position: relative;
  margin-bottom: 32px;
}

.input-area textarea {
  width: 100%;
  min-height: 80px;
  max-height: 200px;
  padding: 16px 20px;
  background: transparent;
  border: 1px solid #2a2a3a;
  border-radius: 8px;
  color: #d0d0dc;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1rem;
  line-height: 1.5;
  resize: none;
  outline: none;
  transition: border-color 0.3s ease;
}

.input-area textarea:focus {
  border-color: #4a4a6a;
}

.input-area textarea::placeholder {
  color: #3a3a4a;
  font-style: italic;
}

.go-btn {
  display: none;
  margin: 0 auto;
  padding: 12px 48px;
  background: transparent;
  border: 1px solid #3a3a5a;
  border-radius: 24px;
  color: #8a8a9a;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.05em;
}

.go-btn.visible {
  display: block;
}

.go-btn:hover,
.go-btn:focus-visible {
  border-color: #6a6a8a;
  color: #c0c0d0;
  outline: none;
}

.go-btn:focus-visible {
  box-shadow: 0 0 0 2px #4a4a7a;
}

/* --- The Response --- */

.response {
  max-width: 480px;
  width: 100%;
  text-align: center;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.response.visible {
  opacity: 1;
}

.witness {
  font-size: 1.1rem;
  color: #9a9aaa;
  line-height: 1.7;
  margin-bottom: 40px;
}

.the-step {
  font-size: 1.15rem;
  color: #b0b0c0;
  line-height: 1.6;
  margin-bottom: 40px;
  padding: 20px 24px;
  border-left: 2px solid #2a2a4a;
}

.conditions-question {
  font-size: 1.1rem;
  color: #d0d0dc;
  font-style: italic;
  margin-bottom: 32px;
  line-height: 1.5;
}

.conditions-area {
  margin-bottom: 24px;
}

.conditions-area textarea {
  width: 100%;
  min-height: 60px;
  max-height: 160px;
  padding: 14px 18px;
  background: transparent;
  border: 1px solid #2a2a3a;
  border-radius: 8px;
  color: #d0d0dc;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1rem;
  line-height: 1.5;
  resize: none;
  outline: none;
  transition: border-color 0.3s ease;
}

.conditions-area textarea:focus {
  border-color: #4a4a6a;
}

.conditions-area textarea::placeholder {
  color: #3a3a4a;
  font-style: italic;
}

/* --- The Witness --- */

.final-witness {
  max-width: 480px;
  width: 100%;
  text-align: center;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.final-witness.visible {
  opacity: 1;
}

.held {
  font-size: 1.05rem;
  color: #8a8aaa;
  line-height: 1.7;
  margin-bottom: 32px;
}

.echo {
  font-size: 0.95rem;
  color: #6a6a80;
  line-height: 1.6;
  margin-bottom: 24px;
  font-style: italic;
}

.shape {
  font-size: 0.95rem;
  color: #7a7a98;
  line-height: 1.7;
  margin-bottom: 32px;
  padding: 14px 18px;
  border: 1px solid #1e1e30;
  border-radius: 6px;
  background: #0d0d15;
  /* pre-line: preserve the explicit line breaks in the crossing roll-call
     (one self + their own words per line). No effect on the return-witness
     readShape text, which never contains newlines. */
  white-space: pre-line;
}

.method {
  font-size: 1rem;
  color: #9090a8;
  line-height: 1.7;
  margin-bottom: 20px;
}

.method-offer {
  font-size: 1.05rem;
  color: #b0b0c8;
  line-height: 1.7;
  margin-bottom: 40px;
  padding: 16px 20px;
  border-left: 2px solid #2a2a4a;
  font-style: italic;
}

.return-note {
  font-size: 0.9rem;
  color: #8a8a9a;
  line-height: 1.5;
}

.reason {
  font-size: 1.2rem;
  color: #c0c0d8;
  letter-spacing: 0.03em;
  margin-top: 40px;
  text-align: center;
}

/* The door left ajar — a quiet afterbeat below the reason (the peak),
   never a competing second peak. Dimmer + italic = a soft closing aside. */
.return-invite {
  font-size: 0.9rem;
  color: #6a6a80;
  line-height: 1.6;
  margin-top: 36px;
  font-style: italic;
  text-align: center;
  scroll-margin-bottom: 24px; /* breathing room when scrolled into view on a short viewport */
}

/* --- The Door --- */

.door {
  margin-top: 40px;
  text-align: center;
}

.door-text {
  font-size: 1.05rem;
  color: #a0a0c0;
  line-height: 1.7;
  margin-bottom: 32px;
}

.door-btn {
  padding: 14px 56px;
  background: transparent;
  border: 1px solid #4a4a7a;
  border-radius: 24px;
  color: #b0b0d0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.4s ease;
  letter-spacing: 0.06em;
}

.door-btn:hover,
.door-btn:focus-visible {
  border-color: #7a7aaa;
  color: #d0d0e8;
  background: rgba(100, 100, 160, 0.08);
  outline: none;
}

.door-btn:focus-visible {
  box-shadow: 0 0 0 2px #5a5a8a;
}

/* --- Crisis --- */

.crisis {
  max-width: 480px;
  width: 100%;
  text-align: center;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.crisis.visible {
  opacity: 1;
}

.crisis-warmth {
  font-size: 1.15rem;
  color: #b0a0b8;
  line-height: 1.7;
  margin-bottom: 32px;
}

.crisis-resources {
  text-align: left;
  margin: 0 auto 32px;
  max-width: 360px;
}

.crisis-exit {
  position: fixed;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #5a5a6a;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 8px;
  z-index: 10;
}

.crisis-exit:hover,
.crisis-exit:focus-visible {
  color: #9a9aaa;
  outline: none;
}

.crisis-section-label {
  font-size: 0.85rem;
  color: #6a6a80;
  margin-top: 16px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.crisis-number {
  display: block;
  font-size: 0.9rem;
  color: #8a8a9a;
  margin-top: 4px;
}

.crisis-resources a {
  display: block;
  padding: 16px 20px;
  margin-bottom: 12px;
  color: #b0b0c8;
  text-decoration: none;
  border: 1px solid #2a2a3a;
  border-radius: 8px;
  transition: border-color 0.3s;
  min-height: 48px;
}

.crisis-resources a:hover,
.crisis-resources a:focus-visible {
  border-color: #5a5a7a;
  outline: none;
}

.crisis-grounding {
  margin: 24px auto;
  max-width: 320px;
  padding: 16px;
  border: 1px solid #1e1e30;
  border-radius: 8px;
  background: #0d0d15;
  font-size: 0.9rem;
  color: #8a8a9a;
  line-height: 1.6;
}

.crisis-ask {
  font-size: 1.1rem;
  color: #b0b0c8;
  margin-bottom: 24px;
  font-style: italic;
}

.crisis-choices {
  max-width: 360px;
  margin: 0 auto 24px;
}

.crisis-choice {
  display: block;
  width: 100%;
  padding: 14px 20px;
  margin-bottom: 10px;
  background: transparent;
  border: 1px solid #2a2a3a;
  border-radius: 8px;
  color: #b0b0c8;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.3s;
  min-height: 48px;
}

.crisis-choice:hover,
.crisis-choice:focus-visible {
  border-color: #4a4a6a;
  color: #d0d0e8;
  outline: none;
}

.crisis-choice[data-choice="safe"] {
  border-color: #1e1e30;
  color: #6a6a80;
  font-size: 0.85rem;
  margin-top: 16px;
}

.crisis-or {
  max-width: 360px;
  margin: 16px auto 0;
  text-align: center;
}

.crisis-or p {
  font-size: 0.85rem;
  color: #5a5a6a;
  margin-bottom: 12px;
}

.crisis-input-area textarea {
  width: 100%;
  min-height: 60px;
  padding: 12px 16px;
  background: transparent;
  border: 1px solid #1e1e30;
  border-radius: 8px;
  color: #c8c8d0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: none;
  outline: none;
}

.crisis-input-area textarea:focus {
  border-color: #3a3a5a;
}

.crisis-message-box {
  max-width: 360px;
  margin: 0 auto 20px;
}

.crisis-message {
  width: 100%;
  min-height: 80px;
  padding: 14px 18px;
  background: #0d0d15;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  color: #c8c8d0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
  outline: none;
}

.crisis-message:focus {
  border-color: #4a4a6a;
}

.crisis-send-options {
  max-width: 360px;
  margin: 0 auto 24px;
}

.crisis-for-them {
  max-width: 360px;
  margin: 24px auto;
  padding: 16px;
  border: 1px solid #1e1e30;
  border-radius: 8px;
  background: #0d0d15;
}

.crisis-them-text {
  font-size: 0.85rem;
  color: #8a8a9a;
  line-height: 1.6;
}

.crisis-here-is {
  font-size: 0.9rem;
  color: #6a6a80;
  margin-bottom: 16px;
}

.crisis-wish {
  max-width: 360px;
  margin: 24px auto;
}

.crisis-wish-q {
  font-size: 0.95rem;
  color: #8a8a9a;
  line-height: 1.6;
}

.crisis-wish .crisis-input-area {
  margin-top: 12px;
}

.crisis-wish-btn {
  margin-top: 10px;
}

.crisis-still-here {
  font-size: 0.95rem;
  color: #7a7a8a;
  line-height: 1.5;
  margin-top: 24px;
  font-style: italic;
}

.crisis-back {
  margin-top: 32px;
}

.crisis-back-btn {
  background: none;
  border: 1px solid #2a2a3a;
  color: #5a5a6a;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.85rem;
  padding: 10px 24px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s;
}

.crisis-back-btn:hover,
.crisis-back-btn:focus-visible {
  border-color: #4a4a6a;
  color: #8a8a9a;
  outline: none;
}

.crisis-heard a {
  color: #a0a0c0;
  text-decoration: none;
  border-bottom: 1px solid #3a3a5a;
}

/* --- Typing animation --- */

.typing-cursor::after {
  content: '\2502';
  animation: blink 1s step-end infinite;
  color: #5a5a7a;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* --- Mobile --- */

@media (max-width: 480px) {
  #game {
    padding: 20px 16px;
  }

  .greeting {
    font-size: 1rem;
    margin-bottom: 36px;
  }

  .question {
    font-size: 1.2rem;
    margin-bottom: 32px;
  }
}

/* --- Always-visible door (crisis-gate Layer A, 2026-06-24) --- */
/* The door is deliberately QUIET. It must read as ambient presence, not as a
   flag — a person with a healthy destination should barely notice it; a person
   who needs it should find it exactly where they expect a quiet exit to be.
   Understated by design: low contrast, small, bottom-centre, out of the
   journey's path. It brightens only on hover/focus. */
#safety-door {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: transparent;
  border: 1px solid #20202e;
  border-radius: 18px;
  color: #56566a;
  font-family: inherit;
  font-size: 0.82rem;
  padding: 9px 18px;
  min-height: 40px;
  cursor: pointer;
  z-index: 40;
  transition: color 0.3s, border-color 0.3s;
}

#safety-door[hidden] { display: none; }

#safety-door:hover,
#safety-door:focus-visible {
  color: #a0a0c0;
  border-color: #45455e;
  outline: none;
}

/* The panel is a REVERSIBLE overlay — it covers the journey but does not
   replace it (the engine in #game is untouched beneath). Closing returns the
   person exactly where they were. */
#safety-panel {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 6, 11, 0.82);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.4s ease;
}

#safety-panel[hidden] { display: none; }
#safety-panel.visible { opacity: 1; }

.safety-panel-inner {
  max-width: 380px;
  width: 100%;
  text-align: center;
}

#safety-back {
  display: block;
  margin: 0 auto 24px;
  background: transparent;
  border: none;
  color: #7a7a92;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 8px;
}

#safety-back:hover,
#safety-back:focus-visible {
  color: #b0b0d0;
  outline: none;
}

.safety-warmth {
  font-size: 1.1rem;
  color: #b0a0b8;
  line-height: 1.7;
  margin-bottom: 28px;
}

.safety-resources {
  text-align: left;
}

.safety-resources a {
  display: block;
  padding: 16px 20px;
  margin-bottom: 12px;
  color: #b0b0c8;
  text-decoration: none;
  border: 1px solid #2a2a3a;
  border-radius: 8px;
  transition: border-color 0.3s;
  min-height: 48px;
}

.safety-resources a:hover,
.safety-resources a:focus-visible {
  border-color: #5a5a7a;
  outline: none;
}

.safety-number {
  display: block;
  font-size: 0.9rem;
  color: #8a8a9a;
  margin-top: 4px;
}
