/* ============================================================
   HADES — carved obsidian theme
   ============================================================
   The palette, named:
     --styx      near-black ground with a violet undertone
     --obsidian  raised surfaces (cards, inputs)
     --bone      ivory text, like inscription on dark stone
     --gold      obol gold — the accent, spent sparingly
     --pome      pomegranate red — errors and warnings
     --ash       muted violet-grey for secondary text
   ============================================================ */

:root {
  --styx: #0e0b12;
  --obsidian: #191320;
  --obsidian-edge: #2a2133;
  --bone: #e9e1d3;
  --gold: #c9a35c;
  --gold-dim: #8a7344;
  --pome: #c4515d;
  --laurel: #7fae85;
  --ash: #8b8095;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
}

/* HADES commits to darkness — the theme is the same in light and dark mode. */

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

html { height: 100%; }

body {
  min-height: 100%;
  background: var(--styx);
  background-image: radial-gradient(ellipse 120% 60% at 50% -10%, #1c1226 0%, var(--styx) 60%);
  background-attachment: fixed;
  color: var(--bone);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

main#app {
  max-width: 430px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- inscription typography ---------- */

.wordmark {
  font-family: var(--serif);
  font-size: 3rem;
  letter-spacing: 0.35em;
  text-indent: 0.35em;      /* re-centers letterspaced text */
  text-align: center;
  color: var(--gold);
  margin-top: 2.5rem;
  text-shadow: 0 0 30px rgba(201, 163, 92, 0.25);
}
.wordmark.small { font-size: 1.5rem; margin-top: 0; }

.screen-title {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  color: var(--gold);
  text-wrap: balance;
}

/* The Greek-key band — a meander drawn with pure CSS gradients. */
.meander {
  height: 10px;
  margin: 0.9rem auto 1.6rem;
  width: 60%;
  background:
    repeating-linear-gradient(90deg,
      var(--gold-dim) 0 2px, transparent 2px 8px,
      var(--gold-dim) 8px 10px, transparent 10px 16px);
  border-top: 1px solid var(--gold-dim);
  border-bottom: 1px solid var(--gold-dim);
  opacity: 0.8;
}

/* ---------- shared bits ---------- */

.screen { display: flex; flex-direction: column; gap: 0.9rem; flex: 1; }
.center { text-align: center; align-items: center; }
.muted { color: var(--ash); }

.btn {
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  padding: 0.85rem 1.2rem;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  width: 100%;
  transition: transform 0.06s ease, filter 0.15s ease;
}
.btn:active { transform: scale(0.98); }

.btn-gold {
  background: linear-gradient(180deg, #d8b26b, var(--gold));
  color: #1a1206;
  font-weight: 600;
}
.btn-gold:hover { filter: brightness(1.08); }

.btn-outline {
  background: transparent;
  color: var(--bone);
  border-color: var(--obsidian-edge);
}
.btn-outline:hover { border-color: var(--gold-dim); }

.btn-big { padding: 1.1rem; font-size: 1.2rem; }

.link-btn {
  background: none; border: none; color: var(--ash);
  font: inherit; font-size: 0.9rem; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--gold); }

input[type="text"], input[type="password"] {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1.05rem;
  color: var(--bone);
  background: var(--obsidian);
  border: 1px solid var(--obsidian-edge);
  border-radius: 4px;
  outline: none;
}
input:focus { border-color: var(--gold); }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- shared form bits ---------- */

/* The kind red line under a form when something goes wrong
   (a cracked soul stone, a name that won't do). */
.form-error { color: var(--pome); text-align: center; min-height: 1.5em; font-style: italic; }

/* ---------- profiles ---------- */

.soul-row {
  display: flex; align-items: center; gap: 0.9rem;
  width: 100%; padding: 0.9rem 1rem;
  background: var(--obsidian);
  border: 1px solid var(--obsidian-edge);
  border-radius: 6px;
  color: var(--bone); font: inherit; cursor: pointer;
  text-align: left;
}
.soul-row:hover { border-color: var(--gold-dim); }
.soul-emblem { font-size: 1.6rem; }
.soul-name { flex: 1; font-family: var(--serif); font-size: 1.15rem; letter-spacing: 0.03em; }
.soul-obols { color: var(--gold); font-size: 0.95rem; font-variant-numeric: tabular-nums; }

.field-label {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--ash); margin-top: 0.6rem; display: block;
}
#create-form { display: flex; flex-direction: column; gap: 0.6rem; }

.emblem-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; }
.emblem {
  font-size: 1.8rem; padding: 0.7rem 0;
  background: var(--obsidian); border: 1px solid var(--obsidian-edge);
  border-radius: 6px; cursor: pointer;
}
.emblem.selected { border-color: var(--gold); background: #221a2b; box-shadow: 0 0 12px rgba(201,163,92,0.2); }

/* ---------- home ---------- */

.hail { display: flex; align-items: center; gap: 1rem; justify-content: center; margin: 0.4rem 0; }
.hail-emblem { font-size: 2.6rem; }
.hail-name { font-family: var(--serif); font-size: 1.5rem; letter-spacing: 0.05em; }
.hail-rank { color: var(--gold); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.15em; }

.stat-row {
  display: flex; justify-content: space-around;
  background: var(--obsidian); border: 1px solid var(--obsidian-edge);
  border-radius: 6px; padding: 0.9rem 0.5rem; margin: 0.4rem 0 1rem;
}
.stat { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; }
.stat-num { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ash); }

.home-footer { text-align: center; margin-top: auto; padding-top: 1.5rem; }
.dot { color: var(--ash); margin: 0 0.5rem; }

/* ---------- session ---------- */

.session-top { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.flee {
  background: none; border: 1px solid var(--obsidian-edge); border-radius: 4px;
  color: var(--ash); font-size: 1rem; line-height: 1;
  padding: 0.45rem 0.6rem; cursor: pointer;
}
.flee:hover { color: var(--pome); border-color: var(--pome); }
.session-top .topic-chip { margin-right: auto; }
.topic-chip {
  background: var(--obsidian); border: 1px solid var(--obsidian-edge);
  border-radius: 99px; padding: 0.3rem 0.85rem; font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.progress { color: var(--ash); font-variant-numeric: tabular-nums; font-size: 0.9rem; }

.question { font-size: 1.15rem; line-height: 1.5; text-wrap: balance; }

.code {
  background: #0a0810;
  border: 1px solid var(--obsidian-edge);
  border-left: 3px solid var(--gold-dim);
  border-radius: 4px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 1.6;
  color: #d9d2e8;
}

.choices { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.4rem; }
.choice {
  text-align: left; padding: 0.85rem 1rem;
  background: var(--obsidian); border: 1px solid var(--obsidian-edge);
  border-radius: 6px; color: var(--bone);
  font: inherit; font-size: 1rem; line-height: 1.45; cursor: pointer;
}
.choice:hover:not(:disabled) { border-color: var(--gold-dim); }
.choice:disabled { cursor: default; opacity: 0.75; }
.choice.right { border-color: var(--laurel); background: #14201a; opacity: 1; }
.choice.wrong { border-color: var(--pome); background: #251317; opacity: 1; }

.verdict {
  margin-top: 0.8rem; padding: 1rem;
  border-radius: 6px; border: 1px solid var(--obsidian-edge);
  background: var(--obsidian);
  display: flex; flex-direction: column; gap: 0.7rem;
  animation: rise 0.25s ease;
}
.v-right { border-left: 3px solid var(--laurel); }
.v-wrong { border-left: 3px solid var(--pome); }
.verdict-word { font-family: var(--serif); font-style: italic; font-size: 1.05rem; }
.v-right .verdict-word { color: var(--laurel); }
.v-wrong .verdict-word { color: var(--pome); }
.verdict-explain { font-size: 0.95rem; color: var(--bone); }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .verdict { animation: none; }
  * { transition: none !important; }
}

/* ---------- reviewing memories (earlier items in a descent) ---------- */

.review-nav { display: flex; gap: 0.6rem; margin-top: 0.6rem; }
.review-nav .btn { flex: 1; }
.review-note {
  text-align: center; color: var(--ash);
  font-family: var(--serif); font-style: italic; font-size: 0.92rem;
}

/* ---------- fact cards ---------- */

.fact-card {
  background: var(--obsidian);
  border: 1px solid var(--gold-dim);
  border-radius: 6px;
  padding: 1.3rem 1.2rem;
  margin-top: 0.5rem;
}
.fact-label {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.2em;
  color: var(--gold); margin-bottom: 0.7rem;
}
.fact-text { font-family: var(--serif); font-size: 1.12rem; line-height: 1.6; }
.fact-extra { margin-top: 0.8rem; font-size: 0.95rem; color: var(--ash); }
.fact-actions { display: flex; gap: 0.6rem; margin-top: 0.6rem; }

/* ---------- the "huh?" glossary ---------- */

.huh { margin-top: 0.2rem; }
.huh-btn {
  background: none; border: none; cursor: pointer;
  font: inherit; font-size: 0.88rem; font-style: italic;
  color: var(--gold-dim);
  text-decoration: underline dotted; text-underline-offset: 4px;
  padding: 0.2rem 0;
}
.huh-btn:hover { color: var(--gold); }

.huh-panel {
  margin-top: 0.6rem; padding: 0.9rem 1rem;
  background: #0a0810;
  border: 1px solid var(--obsidian-edge);
  border-radius: 6px;
  animation: rise 0.25s ease;
}
.huh-panel dt {
  color: var(--gold); font-size: 0.82rem;
  text-transform: uppercase; letter-spacing: 0.12em;
}
.huh-panel dd {
  color: var(--bone); font-size: 0.92rem; line-height: 1.5;
  margin: 0.25rem 0 0.8rem;
}
.huh-panel dd:last-child { margin-bottom: 0; }

/* ---------- session end ---------- */

.summary {
  display: flex; flex-direction: column; gap: 0.5rem;
  background: var(--obsidian); border: 1px solid var(--obsidian-edge);
  border-radius: 6px; padding: 1.2rem; width: 100%;
  font-variant-numeric: tabular-nums;
}
.rank-line { color: var(--gold); font-family: var(--serif); }

/* ---------- stats ---------- */

.prophecy {
  font-family: var(--serif); font-style: italic; text-align: center;
  color: var(--bone); padding: 0 0.5rem 0.5rem;
}
.prophecy b { color: var(--gold); font-weight: 600; }

.path-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.8rem;
  padding: 0.75rem 0.2rem;
  border-bottom: 1px solid var(--obsidian-edge);
}
.path-topic { font-size: 1rem; }
.path-nums { color: var(--ash); font-size: 0.88rem; white-space: nowrap; font-variant-numeric: tabular-nums; }

.about-text { color: var(--bone); }
.about-text.muted { color: var(--ash); font-size: 0.92rem; }

/* ---------- soul stones ---------- */

.stone-code {
  width: 100%;
  padding: 0.8rem 0.9rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--gold);
  background: #0a0810;
  border: 1px solid var(--gold-dim);
  border-radius: 6px;
  word-break: break-all;
  resize: vertical;
}
.stone-code:focus { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- appeals — feedback on an item ---------- */
/* A quiet link under the verdict; opens into a small letter to the
   Judges. Muted on purpose — it should never compete with Continue. */
.appeal { margin-top: 14px; text-align: center; }
.appeal-open { color: var(--ash); font-size: 14px; }
.appeal-form { text-align: left; margin-top: 10px; }
.appeal-text {
  width: 100%;
  box-sizing: border-box;
  min-height: 74px;
  resize: vertical;
  padding: 10px 12px;
  font: 15px/1.45 var(--sans);
  color: var(--bone);
  background: var(--obsidian);
  border: 1px solid var(--obsidian-edge);
  border-radius: 10px;
}
.appeal-text:focus { outline: none; border-color: var(--gold-dim); }
.appeal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}
.appeal-done { color: var(--laurel); text-align: center; margin: 12px 0 0; }
