/* ============================================================
   THE CODEX — Stylesheet
   Aesthetic: Dark industrial gothic
   Fonts: Oswald (headers/labels) + Source Serif 4 (bio body)
   Colors: Near-black base | Red accents | Yellow warnings
           Purple dev game | Monochrome text hierarchy
============================================================ */


/* ============================================================
   CSS CUSTOM PROPERTIES
============================================================ */
:root {
  --bg:           #0a0a0a;
  --bg-sidebar:   #0c0c0c;
  --bg-card:      #121212;
  --bg-card-alt:  #161616;
  --bg-input:     #0e0e0e;
  --bg-hover:     #1a1a1a;
  --bg-section-alt: #0d0d0d; /* Alternating section tint */

  --red:          #c41e1e;
  --red-hover:    #e02424;
  --red-dim:      #5a0d0d;
  --red-glow:     rgba(196, 30, 30, 0.18);

  --yellow:       #b89020;
  --yellow-bright:#d4a83a;
  --yellow-dim:   rgba(184, 144, 32, 0.15);

  --purple:       #7c2d9e;
  --purple-hover: #9b3cc4;
  --purple-glow:  rgba(124, 45, 158, 0.2);

  --text:         #d8d8d8;
  --text-dim:     #888888;
  --text-label:   #aaaaaa;
  --text-faint:   #444444;
  --text-red:     #e04040;

  --border:       #1c1c1c;
  --border-light: #2a2a2a;
  --border-focus: #c41e1e;

  --font-display: 'Oswald', 'Impact', sans-serif;
  --font-body:    'Source Serif 4', Georgia, 'Times New Roman', serif;

  --sidebar-w:    265px;
  --topbar-h:     52px;

  --t:            140ms ease;
  --t-slow:       280ms ease;

  --radius:       2px;
  --scroll-color: #2a2a2a;
}


/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; font-size: 15px; -webkit-text-size-adjust: 100%; }

body {
  height: 100%;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
  overflow: hidden;
}

::-webkit-scrollbar           { width: 6px; height: 6px; }
::-webkit-scrollbar-track     { background: transparent; }
::-webkit-scrollbar-thumb     { background: var(--scroll-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover{ background: #3a3a3a; }

::selection { background: var(--red-dim); color: var(--text); }

.hidden { display: none !important; }


/* ============================================================
   TOP BAR
============================================================ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: #080808;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  z-index: 100;
  padding: 0 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  width: var(--sidebar-w);
  flex-shrink: 0;
}

.site-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.18em;
  color: var(--red);
  text-transform: uppercase;
  user-select: none;
}

.tabs {
  display: flex;
  align-items: center;
  flex: 1;
  height: 100%;
  padding-left: 8px;
}

.tab {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0 16px;
  height: 100%;
  cursor: pointer;
  transition: color var(--t), border-color var(--t);
  white-space: nowrap;
}
.tab:hover:not(.coming) { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--red); }
.tab.coming { cursor: default; opacity: 0.35; }

.topbar-right { margin-left: auto; display: flex; align-items: center; }
.char-count {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  text-transform: uppercase;
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text-dim);
  transition: background var(--t);
}
.hamburger:hover span { background: var(--text); }


/* ============================================================
   MAIN LAYOUT
============================================================ */
.layout {
  position: fixed;
  top: var(--topbar-h);
  left: 0; right: 0; bottom: 0;
  display: flex;
}


/* ============================================================
   SIDEBAR
============================================================ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 50;
}

.sidebar-header {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.05em;
  padding: 7px 10px;
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--t);
}
.search-input::placeholder { color: var(--text-faint); }
.search-input:focus { border-color: var(--red); }

.btn-new-char {
  width: 100%;
  background: transparent;
  border: 1px solid var(--red-dim);
  color: var(--red);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--t), border-color var(--t), color var(--t);
}
.btn-new-char:hover {
  background: var(--red-glow);
  border-color: var(--red);
  color: var(--red-hover);
}

.char-list { flex: 1; overflow-y: auto; padding: 6px 0; }

.char-list-empty {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
  padding: 32px 16px;
  letter-spacing: 0.05em;
}

.char-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: background var(--t), border-color var(--t);
  user-select: none;
  gap: 8px;
}
.char-item:hover         { background: var(--bg-hover); border-left-color: var(--red-dim); }
.char-item.active        { background: var(--bg-card); border-left-color: var(--red); }
.char-item-name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.dirty-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--yellow-bright);
  box-shadow: 0 0 5px var(--yellow);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 40;
}
.sidebar-overlay.visible { display: block; }


/* ============================================================
   CONTENT AREA
============================================================ */
.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}

.state-panel { min-height: 100%; padding: 0; }


/* ============================================================
   EMPTY STATE
============================================================ */
#stateEmpty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
}
.empty-inner { text-align: center; padding: 32px; }
.empty-title {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--text-faint);
  margin-bottom: 12px;
}
.empty-sub {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  text-transform: uppercase;
}


/* ============================================================
   UNSAVED BANNER
============================================================ */
.unsaved-banner {
  background: var(--yellow-dim);
  border-bottom: 1px solid var(--yellow);
  color: var(--yellow-bright);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 24px;
  text-align: center;
}


/* ============================================================
   BIO VIEW
============================================================ */
.bio-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 28px 20px;
  border-bottom: 2px solid var(--border);
  flex-wrap: wrap;
}

.bio-char-name {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.1;
}

.bio-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  flex-shrink: 0;
}

.bio-body {
  padding: 0 0 60px;
  display: flex;
  flex-direction: column;
}


/* ============================================================
   SECTION JUMP NAV
   Sticky horizontal nav inside the bio body for quick scrolling
   to any section. Appears just below the bio header.
============================================================ */
.section-jump-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #0b0b0b;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 0;
  padding: 0;
  flex-shrink: 0;
  scrollbar-width: none; /* Hide scrollbar on Firefox */
}
.section-jump-nav::-webkit-scrollbar { display: none; }

.section-nav-link {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-decoration: none;
  padding: 9px 14px;
  border-right: 1px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
  transition: color var(--t), background var(--t);
}
.section-nav-link:hover {
  color: var(--red);
  background: var(--red-glow);
}
.section-nav-link:last-child { border-right: none; }


/* ============================================================
   BIO SECTIONS
   Each section has a strong header bar so sections are easy
   to distinguish from one another visually.
============================================================ */
.bio-section {
  border-bottom: 1px solid var(--border);
  padding: 0;
}
.bio-section:last-child { border-bottom: none; }

/* Alternating section backgrounds for easier scanning */
.bio-section:nth-child(even) { background: var(--bg-section-alt); }

.section-header {
  /* Red left border bar + background to make section headers unmissable */
  display: flex;
  align-items: center;
  padding: 10px 28px 10px 24px;
  border-left: 3px solid var(--red);
  background: linear-gradient(90deg, rgba(196,30,30,0.08) 0%, transparent 60%);
  border-bottom: 1px solid #1a1a1a;
  margin-bottom: 0;
}

.section-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
}

/* Section content area */
.section-hori .section-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px 20px;
  padding: 18px 28px 20px;
}
.section-verti .section-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 28px 20px;
}


/* ============================================================
   BIO FIELDS
============================================================ */
.bio-field {}

.bio-field-empty { opacity: 0.55; }

.field-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-label);
  margin-bottom: 4px;
}

.field-value {
  font-family: var(--font-body);
  font-size: 14.5px;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Empty field dash */
.field-empty {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text-faint);
}


/* ============================================================
   FAMILY SECTION
============================================================ */
.family-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.family-entry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 5px 10px;
}
.family-type {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.family-num    { font-family: var(--font-display); font-size: 10px; color: var(--text-faint); }
.family-name   { font-family: var(--font-body); font-size: 13.5px; color: var(--text); }
.twin-marker   { font-family: var(--font-display); font-size: 10px; color: var(--text-dim); }

.family-full     { border-left: 2px solid var(--text-faint); }
.family-half     { border-left: 2px solid var(--text-faint); opacity: 0.75; }
.family-twin     { border-left: 2px solid var(--red-dim); }
.family-cousin   { border-left: 2px solid var(--border-light); }
.family-adoptive { border-left: 2px dashed var(--border-light); }
.family-unknown  { opacity: 0.6; }
.family-raw      { font-family: var(--font-body); font-size: 14px; color: var(--text-dim); white-space: pre-wrap; }


/* ============================================================
   SHARED BUTTON STYLES
============================================================ */
.btn-action {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-dim);
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--t), border-color var(--t), color var(--t);
  white-space: nowrap;
}
.btn-action:hover { background: var(--bg-hover); border-color: var(--text-faint); color: var(--text); }

.btn-save { border-color: #2a5c2a; color: #5aaa5a; }
.btn-save:hover { background: rgba(90,170,90,0.1); border-color: #5aaa5a; color: #7acc7a; }

.btn-hardsave { border-color: var(--yellow); color: var(--yellow-bright); }
.btn-hardsave:hover { background: var(--yellow-dim); border-color: var(--yellow-bright); }
.btn-hardsave.btn-success { background: var(--yellow-dim); border-color: var(--yellow-bright); color: var(--yellow-bright); }

.btn-danger { border-color: var(--red-dim); color: #884444; }
.btn-danger:hover { background: rgba(196,30,30,0.08); border-color: var(--red); color: var(--text-red); }

.btn-purple { border-color: #4a1a60; color: #aa66cc; }
.btn-purple:hover { background: var(--purple-glow); border-color: var(--purple); color: var(--purple-hover); }


/* ============================================================
   EDIT / CREATE FORM
============================================================ */
.edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.edit-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}
.edit-actions { display: flex; gap: 8px; }

.edit-body { padding: 16px 28px 60px; display: flex; flex-direction: column; gap: 0; }

.form-section { border-bottom: 1px solid var(--border); padding: 20px 0; }
.form-section:last-child { border-bottom: none; }

.form-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.form-section-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
}

.form-section-hori .form-section-body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px 16px;
}
.form-field-full { grid-column: 1 / -1; }

.form-section-verti .form-section-body { display: flex; flex-direction: column; gap: 12px; }

.form-label {
  display: block;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-label);
  margin-bottom: 5px;
}

.form-input,
.form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 8px 10px;
  border-radius: var(--radius);
  outline: none;
  resize: vertical;
  transition: border-color var(--t), box-shadow var(--t);
  line-height: 1.6;
}
.form-input:focus,
.form-textarea:focus { border-color: var(--red); box-shadow: 0 0 0 2px var(--red-glow); }
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-faint); font-style: italic; }

.form-field.randomizable .form-label::after { content: ' *'; color: var(--yellow); font-size: 9px; }

.form-hint {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-top: 5px;
  line-height: 1.5;
}

.btn-randomize {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--yellow);
  color: var(--yellow-bright);
  padding: 4px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--t);
}
.btn-randomize:hover { background: var(--yellow-dim); }


/* ============================================================
   DEV GAME
============================================================ */
.game-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 28px 60px;
  min-height: 100%;
}

.game-screen { display: flex; flex-direction: column; gap: 20px; }

.game-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--purple-hover);
}

.game-char-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.game-intro-text { font-family: var(--font-body); font-size: 15px; color: var(--text-dim); line-height: 1.7; }

.game-phase-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--purple-hover);
  border-bottom: 1px solid var(--purple);
  padding-bottom: 4px;
  display: inline-block;
}

.game-question-text { font-family: var(--font-body); font-size: 18px; color: var(--text); line-height: 1.65; }

.game-answer-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid #3a1a4a;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 12px;
  border-radius: var(--radius);
  outline: none;
  resize: vertical;
  line-height: 1.65;
  transition: border-color var(--t), box-shadow var(--t);
}
.game-answer-input:focus { border-color: var(--purple); box-shadow: 0 0 0 2px var(--purple-glow); }
.game-answer-input::placeholder { color: var(--text-faint); font-style: italic; }

/* Label + sub-text for word step fields */
.game-field { display: flex; flex-direction: column; gap: 6px; }
.game-field-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-label);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.game-field-sub {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-faint);
  font-style: italic;
}

/* Plain text input for the custom word */
.game-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid #3a1a4a;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 9px 12px;
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--t);
}
.game-input:focus { border-color: var(--purple); }
.game-input::placeholder { color: var(--text-faint); font-style: italic; }

/* Progress */
.game-progress-bar { width: 100%; height: 2px; background: var(--border-light); border-radius: 2px; overflow: hidden; }
.game-progress-fill { height: 100%; background: var(--purple); transition: width var(--t-slow); }
.game-progress-text {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}

.game-btns { display: flex; gap: 10px; align-items: center; margin-top: 4px; }

.btn-game {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--purple);
  border: none;
  color: #ffffff;
  padding: 9px 22px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--t);
}
.btn-game:hover { background: var(--purple-hover); }


/* ============================================================
   WORD STEP — Cards with Reroll buttons
============================================================ */
.word-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.word-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid #3a1a4a;
  border-left: 3px solid var(--purple);
  padding: 12px 16px;
  border-radius: var(--radius);
}

.word-card-text {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--purple-hover);
}

.word-reroll-btn {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid #4a1a60;
  color: var(--text-faint);
  padding: 4px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--t), color var(--t), background var(--t);
  flex-shrink: 0;
}
.word-reroll-btn:hover {
  border-color: var(--purple);
  color: var(--purple-hover);
  background: var(--purple-glow);
}


/* ============================================================
   INITIAL SPARK REFERENCE PANEL
   Collapsible panel visible during question + reflection phases
   so you can refer back to your words and interpretation.
============================================================ */
.game-reference {
  background: var(--bg-card);
  border: 1px solid #3a1a4a;
  border-radius: var(--radius);
  overflow: hidden;
}

.game-ref-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--t);
}
.game-ref-toggle:hover { background: var(--purple-glow); }

.ref-toggle-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--purple-hover);
  flex-shrink: 0;
}

.ref-toggle-words {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  flex: 1;
}

.ref-toggle-arrow {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text-faint);
  flex-shrink: 0;
  line-height: 1;
}

/* Reference body — shown when panel is expanded */
.game-ref-body {
  padding: 12px 14px 14px;
  border-top: 1px solid #3a1a4a;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ref-words-row { display: flex; flex-wrap: wrap; gap: 6px; }

.ref-word {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--purple-hover);
  background: rgba(124, 45, 158, 0.12);
  border: 1px solid #4a1a60;
  padding: 3px 10px;
  border-radius: var(--radius);
}

.ref-interp {
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.ref-interp-empty { color: var(--text-faint); font-style: italic; }


/* ============================================================
   DEV GAME SUMMARY
============================================================ */
.summary-list { display: flex; flex-direction: column; gap: 14px; }

.summary-item {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--purple-hover);
  padding: 12px 16px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.summary-category {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--purple-hover);
}
.summary-target {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 5px;
}
.summary-answers {
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.summary-interp {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-faint);
  line-height: 1.6;
  font-style: italic;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  white-space: pre-wrap;
  word-break: break-word;
}


/* ============================================================
   TOAST NOTIFICATION
============================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card-alt);
  border: 1px solid var(--border-light);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 24px;
  border-radius: var(--radius);
  z-index: 200;
  white-space: nowrap;
  box-shadow: 0 4px 24px rgba(0,0,0,0.6);
}
.toast.toast-yellow { border-color: var(--yellow); color: var(--yellow-bright); }
.toast.toast-red    { border-color: var(--red); color: var(--text-red); }


/* ============================================================
   RESPONSIVE — MOBILE (max-width: 768px)
============================================================ */
@media (max-width: 768px) {

  .hamburger { display: flex; }
  .topbar-left { width: auto; }

  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform var(--t-slow);
    z-index: 60;
    border-right-color: var(--border-light);
  }
  .sidebar.open { transform: translateX(0); }

  .sidebar-overlay { display: block; opacity: 0; pointer-events: none; transition: opacity var(--t-slow); }
  .sidebar-overlay.visible { opacity: 1; pointer-events: auto; }

  .content { width: 100%; }

  .bio-header         { padding: 20px 16px 16px; }
  .section-hori .section-content  { padding: 14px 16px 16px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .section-verti .section-content { padding: 14px 16px 16px; }
  .section-header     { padding: 9px 16px 9px 14px; }

  .edit-header        { padding: 18px 16px 14px; }
  .edit-body          { padding: 12px 16px 40px; }
  .game-container     { padding: 24px 16px 40px; }

  .bio-header { flex-direction: column; align-items: flex-start; }
  .bio-char-name { font-size: 24px; }

  .tab { padding: 0 10px; font-size: 11px; letter-spacing: 0.08em; }
  .tab.coming { display: none; }

  .form-section-hori .form-section-body { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

  .bio-actions { gap: 6px; }
  .game-title  { font-size: 22px; }
  .word-card-text { font-size: 15px; }
}

@media (max-width: 400px) {
  .tabs { display: none; }
  .bio-actions { flex-wrap: wrap; }
  .section-nav-link { font-size: 9px; padding: 8px 10px; }
}
