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

:root {
  --bg:       #0d0a0a;
  --bg2:      #131010;
  --bg3:      #1c1616;
  --border:   #2a1f1f;
  --text:     #e2cdb8;
  --dim:      #7a6558;
  --accent:   #c9789a;
  --accent2:  #89b4b4;
  --gold:     #d4a96a;
  --bar-bg:   #2a1a1a;
  --purple:   #a08dd4;
  --green:    #89d4a4;
}

html, body { height: 100%; overflow: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 15px;
  line-height: 1.8;
}

/* ─── Title Screen ───────────────────────────────────────────────────────── */
#title-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: var(--bg);
}
.title-wrap { max-width: 680px; width: 92%; text-align: center; }

.title-logo {
  font-family: 'Courier New', monospace;
  font-size: 2.2em;
  letter-spacing: 0.35em;
  color: var(--accent);
  margin-bottom: 0.3em;
  text-shadow: 0 0 60px rgba(201, 120, 154, 0.2);
}
.title-sub {
  font-family: 'Courier New', monospace;
  color: var(--dim);
  letter-spacing: 0.18em;
  margin-bottom: 2.5em;
  font-size: 0.78em;
}
.title-prompt {
  font-family: 'Courier New', monospace;
  color: var(--dim);
  margin-bottom: 1.4em;
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.scenario-list { display: flex; flex-direction: column; gap: 0.9em; }

.scen-btn {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 1.2em 1.5em;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-family: inherit;
  font-size: inherit;
  width: 100%;
}
.scen-btn:hover { border-color: var(--accent); background: var(--bg3); }
.continue-btn { border-color: var(--gold); }
.continue-btn:hover { border-color: var(--gold); background: var(--bg3); }

.scen-name {
  display: block;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 0.4em;
  font-size: 0.78em;
}
.scen-desc { display: block; color: var(--dim); font-size: 0.85em; line-height: 1.6; }

/* ─── Name Screen ────────────────────────────────────────────────────────── */
#name-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}
.name-prompt {
  color: var(--dim);
  margin-bottom: 1.5em;
  font-size: 0.95em;
}
.dim { color: var(--dim); }
.name-input-wrap {
  display: flex;
  gap: 0.8em;
  justify-content: center;
}
#name-input {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6em 1em;
  font-family: inherit;
  font-size: 1.1em;
  min-width: 200px;
  outline: none;
  caret-color: var(--accent);
}
#name-input:focus { border-color: var(--accent); }
.name-submit {
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.6em 1.2em;
  font-family: 'Courier New', monospace;
  font-size: 0.85em;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.15s;
}
.name-submit:hover { background: rgba(201, 120, 154, 0.1); }

/* ─── Game Screen ────────────────────────────────────────────────────────── */
#game-screen { display: flex; flex-direction: column; height: 100vh; }
.hidden { display: none !important; }

#topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45em 1.2em;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
  gap: 1em;
}
#loc-display {
  font-family: 'Courier New', monospace;
  color: var(--accent);
  letter-spacing: 0.1em;
  font-size: 0.72em;
  text-transform: uppercase;
  flex: 1;
}
#time-display {
  font-family: 'Courier New', monospace;
  color: var(--dim);
  font-size: 0.7em;
  white-space: nowrap;
}
#topbar-btns { display: flex; gap: 0.5em; align-items: center; }
.top-btn {
  font-family: 'Courier New', monospace;
  background: none;
  border: 1px solid var(--border);
  color: var(--dim);
  font-size: 0.68em;
  padding: 0.2em 0.6em;
  cursor: pointer;
  letter-spacing: 0.08em;
  position: relative;
  transition: border-color 0.12s, color 0.12s;
}
.top-btn:hover { border-color: var(--accent); color: var(--accent); }
.badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 50%;
  font-size: 0.8em;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* ─── Main Layout ────────────────────────────────────────────────────────── */
#main { display: flex; flex: 1; overflow: hidden; }

/* Out panel */
#out-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 2em 2.5em 3em;
  display: flex;
  flex-direction: column;
  gap: 1.5em;
}

#passage-title {
  font-family: 'Courier New', monospace;
  color: var(--dim);
  font-size: 0.7em;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding-bottom: 0.8em;
  border-bottom: 1px solid var(--border);
  min-height: 1.5em;
}

#output {
  max-width: 660px;
  font-size: 1em;
  color: var(--text);
}
#output p { margin-bottom: 1.1em; }
#output p:last-child { margin-bottom: 0; }

/* Event insertions (triggers) */
.event-insert {
  max-width: 660px;
  margin-top: 1em;
  color: var(--gold);
  font-style: italic;
}
.event-insert p { margin-bottom: 1em; color: var(--gold); }
.event-hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.2em 0;
}

/* Dialogue styling inline */
.dialogue { color: var(--gold); }

/* ─── Choices ────────────────────────────────────────────────────────────── */
#choice-area {
  max-width: 660px;
  display: flex;
  flex-direction: column;
  gap: 0.6em;
  padding-top: 0.5em;
  border-top: 1px solid var(--border);
}

.choice-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim, #9a7a6a);
  color: var(--dim);
  padding: 0.65em 1.1em;
  font-family: inherit;
  font-size: 0.9em;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  line-height: 1.5;
}
.choice-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(201, 120, 154, 0.05);
}
.choice-btn:before {
  content: '› ';
  color: var(--accent);
  font-family: 'Courier New', monospace;
}

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
#sidebar {
  width: 205px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  background: var(--bg2);
  overflow-y: auto;
  padding: 1em 0.9em;
  display: flex;
  flex-direction: column;
  gap: 1.5em;
}
.sb-title {
  font-family: 'Courier New', monospace;
  color: var(--dim);
  font-size: 0.62em;
  letter-spacing: 0.22em;
  margin-bottom: 0.9em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3em;
}

/* Stat bars */
.stat-row { margin-bottom: 0.9em; }
.stat-label {
  display: flex;
  justify-content: space-between;
  font-family: 'Courier New', monospace;
  font-size: 0.68em;
  color: var(--dim);
  margin-bottom: 0.25em;
}
.stat-label span:last-child { color: var(--text); }
.stat-bar { height: 3px; background: var(--bar-bg); border-radius: 2px; overflow: hidden; }
.stat-fill { height: 100%; border-radius: 2px; transition: width 0.5s ease; }
.stat-fill.estrogen      { background: var(--accent); }
.stat-fill.submission    { background: var(--purple); }
.stat-fill.suggestibility{ background: #b4a4e4; }
.stat-fill.clarity       { background: var(--accent2); }

/* Body dots */
.body-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6em;
  font-family: 'Courier New', monospace;
  font-size: 0.68em;
}
.body-label { color: var(--dim); }
.body-dots { display: flex; gap: 4px; }
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--bar-bg);
  border: 1px solid var(--border);
  transition: background 0.5s, border-color 0.5s;
}
.dot.filled { background: var(--accent); border-color: var(--accent); }

/* Wearing */
#wearing-list {
  font-size: 0.78em;
  color: var(--dim);
  line-height: 1.5;
  font-style: italic;
}

/* ─── Overlays ───────────────────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  z-index: 100;
}

.overlay-panel {
  background: var(--bg2);
  border-left: 1px solid var(--border);
  height: 100%;
  overflow-y: auto;
  padding: 1.5em;
  animation: slideIn 0.2s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.phone-panel { width: 360px; }
.stats-panel { width: 300px; }

.overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5em;
  padding-bottom: 0.8em;
  border-bottom: 1px solid var(--border);
  font-family: 'Courier New', monospace;
  font-size: 0.75em;
  letter-spacing: 0.1em;
  color: var(--dim);
  text-transform: uppercase;
}
.close-btn {
  background: none;
  border: none;
  color: var(--dim);
  cursor: pointer;
  font-size: 1em;
  padding: 0.2em 0.4em;
  transition: color 0.12s;
}
.close-btn:hover { color: var(--accent); }

/* Phone messages */
.phone-empty { color: var(--dim); font-size: 0.85em; font-style: italic; }
.phone-msg {
  margin-bottom: 1.5em;
  padding-bottom: 1.5em;
  border-bottom: 1px solid var(--border);
}
.phone-msg:last-child { border-bottom: none; }
.phone-msg.unread .phone-from { color: var(--accent); }
.phone-from {
  font-family: 'Courier New', monospace;
  font-size: 0.7em;
  letter-spacing: 0.1em;
  color: var(--dim);
  text-transform: uppercase;
  margin-bottom: 0.5em;
}
.phone-text {
  font-size: 0.88em;
  color: var(--text);
  line-height: 1.65;
}
.phone-choices {
  display: flex;
  flex-direction: column;
  gap: 0.4em;
  margin-top: 0.8em;
}
.phone-choice-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--dim);
  padding: 0.4em 0.8em;
  font-family: inherit;
  font-size: 0.82em;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.phone-choice-btn:hover { border-color: var(--accent2); color: var(--text); }
.phone-replied {
  margin-top: 0.5em;
  font-size: 0.78em;
  color: var(--dim);
  font-style: italic;
}

/* Stats overlay */
.stats-section { margin-bottom: 1.8em; }
.stats-section-title {
  font-family: 'Courier New', monospace;
  font-size: 0.65em;
  letter-spacing: 0.2em;
  color: var(--dim);
  text-transform: uppercase;
  margin-bottom: 0.9em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--border);
}
.wearing-text { font-size: 0.82em; color: var(--dim); font-style: italic; }

/* ─── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
