/* ============================================================
   Hollowborne — Dark Atmospheric Landing Page
   Typography: Serif headers, clean sans body
   Palette: Deep blacks, muted golds, bone whites
   ============================================================ */

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

:root {
  --black:        #0a0908;
  --black-deep:   #050504;
  --gold:         #c9a84c;
  --gold-muted:   #8a7340;
  --gold-dim:     #4a3d28;
  --bone:         #e8e0d0;
  --bone-dim:     #b8b0a0;
  --bone-dark:    #6b6360;
  --cream:        #d4c8b8;
  --thread:        rgba(201,168,76,0.25);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--black);
  color: var(--bone);
  font-family: 'Georgia', 'Times New Roman', serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Typography ─────────────────────────────────────────── */

h1, h2, h3, h4 {
  font-family: 'Palatino Linotype', 'Palatino', 'Book Antiqua', Georgia, serif;
  font-weight: normal;
  letter-spacing: 0.03em;
}

p, li, input, button, label, a {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

/* ── Gold Thread Spine ─────────────────────────────────── */

.thread {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--thread) 10%,
    var(--gold) 40%,
    var(--thread) 70%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 1;
  opacity: 0.6;
}

/* ── Hero Section ───────────────────────────────────────── */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

/* Dreamcatcher atmospheric background — CSS-only */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, rgba(40,30,20,0.8) 0%, transparent 70%),
    radial-gradient(ellipse 60% 80% at 30% 70%, rgba(30,20,15,0.6) 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 70% 60%, rgba(35,25,18,0.5) 0%, transparent 65%),
    radial-gradient(ellipse 40% 40% at 50% 50%, rgba(201,168,76,0.04) 0%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

/* Web spiral overlay */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 50% 35%, transparent 18%, rgba(201,168,76,0.03) 19%, transparent 20%),
    radial-gradient(circle at 50% 35%, transparent 28%, rgba(201,168,76,0.02) 29%, transparent 30%),
    radial-gradient(circle at 50% 35%, transparent 38%, rgba(201,168,76,0.015) 39%, transparent 40%),
    radial-gradient(circle at 50% 35%, transparent 48%, rgba(201,168,76,0.01) 49%, transparent 50%),
    radial-gradient(circle at 50% 35%, transparent 58%, rgba(201,168,76,0.008) 59%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
}

/* Dreamcatcher SVG icon */
.hero-icon {
  width: 120px;
  height: 120px;
  margin: 0 auto 3rem;
  opacity: 0.55;
}

.hero-title {
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: var(--cream);
  margin-bottom: 1.5rem;
  line-height: 1.25;
}

.hero-tagline {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--bone-dim);
  font-style: italic;
  margin-bottom: 3.5rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.cta-button {
  display: inline-block;
  padding: 0.9rem 2.5rem;
  background: transparent;
  border: 1px solid var(--gold-muted);
  color: var(--gold);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.cta-button:hover {
  background: rgba(201,168,76,0.08);
  border-color: var(--gold);
  color: var(--gold);
}

/* ── Divider ─────────────────────────────────────────────── */

.divider {
  width: 60px;
  height: 1px;
  background: var(--gold-dim);
  margin: 0 auto 2rem;
}

/* ── About Section ───────────────────────────────────────── */

.about {
  padding: 6rem 2rem;
  text-align: center;
}

.about-content {
  max-width: 560px;
  margin: 0 auto;
}

.about h2 {
  font-size: 1.4rem;
  color: var(--gold);
  margin-bottom: 1.5rem;
}

.about p {
  color: var(--bone-dim);
  font-size: 0.95rem;
  line-height: 1.8;
}

/* ── Footer ─────────────────────────────────────────────── */

.footer {
  padding: 3rem 2rem;
  text-align: center;
  border-top: 1px solid rgba(201,168,76,0.1);
}

.footer-links {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--bone-dark);
  font-size: 0.8rem;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--bone-dim);
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--bone-dark);
}

/* ── Age Gate Overlay ───────────────────────────────────── */

.age-gate-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--black-deep);
  z-index: 100;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 2rem;
  text-align: center;
}

.age-gate-overlay.visible {
  display: flex;
}

.age-gate-title {
  font-size: 1.5rem;
  color: var(--cream);
  margin-bottom: 0.5rem;
}

.age-gate-sub {
  color: var(--bone-dim);
  font-size: 0.85rem;
  margin-bottom: 2.5rem;
}

.age-gate-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.age-gate-label {
  font-size: 0.8rem;
  color: var(--gold-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.age-inputs {
  display: flex;
  gap: 0.75rem;
}

.age-inputs input {
  width: 70px;
  padding: 0.7rem 0.5rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(201,168,76,0.3);
  color: var(--bone);
  text-align: center;
  font-size: 1.1rem;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

.age-inputs input:focus {
  border-color: var(--gold);
}

.age-inputs input::placeholder {
  color: var(--bone-dark);
}

.age-submit {
  margin-top: 0.5rem;
  padding: 0.75rem 2rem;
  background: transparent;
  border: 1px solid var(--gold-muted);
  color: var(--gold);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

.age-submit:hover {
  background: rgba(201,168,76,0.08);
  border-color: var(--gold);
}

.age-error {
  color: #c04040;
  font-size: 0.8rem;
  min-height: 1.2rem;
}

/* Under 18 redirect */
.underage-message {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.underage-message.visible {
  display: flex;
}

.underage-message p {
  color: var(--bone-dim);
  font-size: 0.9rem;
  font-style: italic;
  max-width: 320px;
}

/* ── Auth Section (Login / Signup) ───────────────────────── */

.auth-section {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--black-deep);
  z-index: 50;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 2rem;
}

.auth-section.visible {
  display: flex;
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-title {
  font-size: 1.3rem;
  color: var(--cream);
  text-align: center;
  margin-bottom: 0.5rem;
}

.auth-sub {
  text-align: center;
  color: var(--bone-dim);
  font-size: 0.85rem;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  color: var(--gold-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(201,168,76,0.25);
  color: var(--bone);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: var(--gold);
}

.form-group input::placeholder {
  color: var(--bone-dark);
}

.auth-submit {
  width: 100%;
  padding: 0.9rem;
  background: transparent;
  border: 1px solid var(--gold-muted);
  color: var(--gold);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.5rem;
}

.auth-submit:hover {
  background: rgba(201,168,76,0.1);
  border-color: var(--gold);
}

.auth-toggle {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--bone-dark);
}

.auth-toggle a {
  color: var(--gold-muted);
  text-decoration: none;
}

.auth-toggle a:hover {
  color: var(--gold);
}

.auth-error {
  text-align: center;
  color: #c04040;
  font-size: 0.8rem;
  min-height: 1.2rem;
  margin-bottom: 0.5rem;
}

.auth-redirect {
  text-align: center;
  margin-top: 1rem;
}

.auth-redirect a {
  color: var(--gold-muted);
  text-decoration: none;
  font-size: 0.8rem;
}

/* ── Game Shell ─────────────────────────────────────────── */

.game-shell {
  display: none;
  min-height: 100vh;
  background: var(--black);
  flex-direction: column;
}

.game-shell.visible {
  display: flex;
}

.game-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(201,168,76,0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0,0,0,0.5);
}

.game-header-name {
  font-family: 'Palatino Linotype', Georgia, serif;
  color: var(--gold);
  font-size: 1rem;
  letter-spacing: 0.05em;
}

.game-hud {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  min-height: 20px;
}

.game-hud-item {
  font-size: 0.75rem;
  color: var(--bone-dark);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

#health-bar {
  display: none;
  width: 120px;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}

#health-bar.visible {
  display: block;
}

#health-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #7a3c3c, #a05050);
  transition: width 0.5s;
  width: 100%;
}

#location-display {
  font-size: 0.7rem;
  color: var(--bone-dark);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  overflow-y: auto;
}

.narrative-output {
  flex: 1;
  margin-bottom: 1.5rem;
}

.narrative-block {
  font-family: 'Palatino Linotype', Georgia, serif;
  color: var(--bone);
  font-size: 1.05rem;
  line-height: 1.85;
  margin-bottom: 1.5rem;
}

.npc-dialogue {
  margin-bottom: 1.5rem;
}

.npc-speaker {
  font-size: 0.75rem;
  color: var(--gold-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.npc-text {
  font-family: 'Palatino Linotype', Georgia, serif;
  color: var(--bone);
  font-size: 1.05rem;
  line-height: 1.85;
  font-style: italic;
}

.game-input-area {
  border-top: 1px solid rgba(201,168,76,0.1);
  padding: 1rem 0 0;
}

.game-input-row {
  display: flex;
  gap: 0.75rem;
}

#player-input {
  flex: 1;
  padding: 0.85rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(201,168,76,0.2);
  color: var(--bone);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1rem;
  outline: none;
  resize: none;
  min-height: 48px;
  max-height: 150px;
  transition: border-color 0.2s;
}

#player-input:focus {
  border-color: var(--gold);
}

#player-input::placeholder {
  color: var(--bone-dark);
  font-style: italic;
}

.game-send {
  padding: 0.85rem 1.5rem;
  background: transparent;
  border: 1px solid var(--gold-muted);
  color: var(--gold);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  align-self: flex-end;
  transition: all 0.2s;
}

.game-send:hover {
  background: rgba(201,168,76,0.08);
  border-color: var(--gold);
}

.game-logout {
  font-size: 0.75rem;
  color: var(--bone-dark);
  text-decoration: none;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  transition: color 0.2s;
}

.game-logout:hover {
  color: var(--bone-dim);
}

/* ── Inventory ───────────────────────────────────────────── */

#inventory-display {
  display: none;
  margin-top: 0.75rem;
}

#inventory-display.visible {
  display: block;
}

.inventory-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.inventory-item {
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.2);
  color: var(--gold-muted);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ── Minimap ─────────────────────────────────────────────── */

#minimap-display {
  display: none;
}

#minimap-display.visible {
  display: block;
}

.minimap-locations {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.minimap-location {
  font-size: 0.65rem;
  color: var(--bone-dark);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.4rem;
  border: 1px solid rgba(201,168,76,0.1);
}

/* ── Loader ─────────────────────────────────────────────── */

.game-loader {
  font-size: 0.8rem;
  color: var(--bone-dark);
  font-style: italic;
  min-height: 1.5rem;
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 600px) {
  .hero-title { font-size: 1.7rem; }
  .hero-tagline { font-size: 0.95rem; }
  .about { padding: 4rem 1.5rem; }
  .footer-links { gap: 1rem; }
  .game-body { padding: 1.5rem 1rem; }
  .age-inputs input { width: 60px; }
}

/* ── Behavior History Panel ─────────────────────────────── */

.behavior-history-btn {
  background: transparent;
  border: 1px solid rgba(201,168,76,0.2);
  color: var(--bone-dark);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.25rem 0.75rem;
  transition: all 0.2s;
}

.behavior-history-btn:hover {
  border-color: var(--gold-muted);
  color: var(--gold-muted);
}

.behavior-history-panel {
  display: none;
  position: fixed;
  top: 56px;
  right: 0;
  bottom: 0;
  width: 280px;
  background: rgba(10,9,8,0.97);
  border-left: 1px solid rgba(201,168,76,0.15);
  z-index: 30;
  flex-direction: column;
  overflow-y: auto;
  padding: 1.25rem;
}

.behavior-history-panel.visible {
  display: flex;
  animation: slideInRight 0.2s ease-out;
}

@keyframes slideInRight {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.bh-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(201,168,76,0.1);
}

.bh-title {
  font-family: 'Palatino Linotype', Georgia, serif;
  color: var(--gold);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

.bh-close {
  background: none;
  border: none;
  color: var(--bone-dark);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color 0.2s;
}

.bh-close:hover { color: var(--bone-dim); }

.bh-section {
  margin-bottom: 1.5rem;
}

.bh-label {
  font-size: 0.65rem;
  color: var(--gold-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.bh-empty {
  font-size: 0.8rem;
  color: var(--bone-dark);
  font-style: italic;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.bh-virtue-list { display: flex; flex-direction: column; gap: 0.6rem; }

.bh-virtue-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bh-virtue-name {
  font-size: 0.72rem;
  color: var(--bone-dim);
  width: 80px;
  flex-shrink: 0;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  text-transform: capitalize;
}

.bh-virtue-bar {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.bh-virtue-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a3d28, var(--gold-muted));
  border-radius: 2px;
  transition: width 0.8s ease;
}

.bh-virtue-indicator {
  font-size: 0.7rem;
  color: var(--bone-dark);
  width: 16px;
  text-align: center;
}

.bh-npc-list { display: flex; flex-direction: column; gap: 0.5rem; }

.bh-npc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.6rem;
  border: 1px solid rgba(201,168,76,0.08);
  border-radius: 2px;
}

.bh-npc-name {
  font-size: 0.78rem;
  color: var(--bone-dim);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.bh-npc-warmth {
  font-size: 0.65rem;
  color: var(--bone-dark);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Typing Indicator ─────────────────────────────────── */

.typing-indicator {
  display: none;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
}

.typing-indicator.visible { display: flex; }

.typing-dots {
  display: flex;
  gap: 3px;
  align-items: center;
}

.typing-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--bone-dark);
  animation: typingDot 1.2s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.2; transform: scale(0.8); }
  30%             { opacity: 1;   transform: scale(1); }
}

.typing-label {
  font-size: 0.75rem;
  color: var(--bone-dark);
  font-style: italic;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ── Narrative Fade-In ────────────────────────────────── */

.narrative-fade {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* ── Input Hint ───────────────────────────────────────── */

.input-hint {
  font-size: 0.65rem;
  color: var(--bone-dark);
  margin-top: 0.4rem;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  letter-spacing: 0.04em;
}

.npc-portrait {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1px solid var(--gold-dim);
  object-fit: cover;
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

.location-header-art {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(201,168,76,0.1);
  opacity: 0.7;
}

.discoverable-art {
  max-width: 240px;
  display: block;
  margin: 1rem auto;
  border: 1px solid rgba(201,168,76,0.15);
  opacity: 0.65;
}