:root {
  --bg: #150b08;
  --bg-2: #27120d;
  --card: rgba(48, 25, 17, 0.92);
  --paper: #e9d2a1;
  --paper-deep: #c69b55;
  --gold: #d8ad55;
  --gold-bright: #ffd98a;
  --red: #8f1e19;
  --red-bright: #c43a2d;
  --ink: #2a150d;
  --text: #f6e5bd;
  --muted: #cdb98b;
  --shadow: rgba(0, 0, 0, 0.45);
  --radius: 26px;
  font-family: "Songti SC", "STSong", "Noto Serif SC", "Microsoft YaHei", serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 10%, rgba(196, 58, 45, 0.32), transparent 28%),
    radial-gradient(circle at 80% 20%, rgba(216, 173, 85, 0.2), transparent 26%),
    linear-gradient(135deg, #100704 0%, #2a0f0b 52%, #130806 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
  mask-image: radial-gradient(circle, black, transparent 78%);
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .25;
  background-image: repeating-radial-gradient(circle at 0 0, rgba(255,255,255,.08) 0 1px, transparent 1px 4px);
  mix-blend-mode: overlay;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.screen { display: none; min-height: 100vh; padding: 42px 0; }
.screen.active { display: block; }
.hero-screen.active, .quiz-screen.active { display: grid; place-items: center; }

.ornate-card {
  position: relative;
  border: 1px solid rgba(255, 217, 138, 0.44);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(76, 34, 24, .96), rgba(30, 15, 11, .96));
  box-shadow: 0 24px 80px var(--shadow), inset 0 0 0 1px rgba(255,255,255,.06);
}

.ornate-card::before,
.ornate-card::after {
  content: "";
  position: absolute;
  width: 78px;
  height: 78px;
  border-color: var(--gold);
  opacity: .75;
  pointer-events: none;
}
.ornate-card::before { top: 14px; left: 14px; border-top: 2px solid; border-left: 2px solid; border-radius: 18px 0 0 0; }
.ornate-card::after { right: 14px; bottom: 14px; border-right: 2px solid; border-bottom: 2px solid; border-radius: 0 0 18px 0; }

.seal {
  position: fixed;
  top: 34px;
  left: 34px;
  writing-mode: vertical-rl;
  letter-spacing: 6px;
  color: var(--gold-bright);
  border: 1px solid rgba(255,217,138,.45);
  padding: 16px 9px;
  border-radius: 999px;
  background: rgba(91, 22, 18, .5);
}

.hero-card {
  width: min(780px, 100%);
  padding: 58px clamp(24px, 7vw, 76px);
  text-align: center;
}

.eyebrow, .event-name {
  margin: 0 0 14px;
  color: var(--gold-bright);
  letter-spacing: 4px;
  text-transform: uppercase;
  font-size: 14px;
}

h1, h2, h3, p { margin-top: 0; }
.hero-card h1 {
  font-size: clamp(38px, 7vw, 76px);
  line-height: 1.02;
  margin-bottom: 24px;
  text-shadow: 0 8px 26px rgba(0,0,0,.45);
}
.hero-copy {
  font-size: 18px;
  line-height: 1.9;
  color: var(--muted);
  margin-bottom: 28px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 28px 0 34px;
}
.hero-stats span {
  padding: 14px 10px;
  border: 1px solid rgba(216,173,85,.3);
  border-radius: 16px;
  background: rgba(0,0,0,.18);
  color: var(--muted);
}
.hero-stats strong { display: block; color: var(--gold-bright); font-size: 28px; }

button {
  font: inherit;
  cursor: pointer;
  border: none;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
button:hover { transform: translateY(-2px); }

.primary-btn {
  color: #2b1309;
  font-weight: 800;
  padding: 15px 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffe2a0, #c98d30 48%, #fff0bd);
  box-shadow: 0 12px 30px rgba(216, 137, 42, .25);
}

.ghost-btn {
  color: var(--text);
  padding: 12px 18px;
  border: 1px solid rgba(216,173,85,.46);
  border-radius: 999px;
  background: rgba(0,0,0,.16);
}

.notice { margin: 22px 0 0; color: rgba(246,229,189,.65); font-size: 13px; }

.topbar {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1050px, calc(100% - 28px));
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  z-index: 10;
}
.progress-wrap {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(216,173,85,.35);
  background: rgba(0,0,0,.32);
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red-bright), var(--gold-bright));
  transition: width .25s ease;
}
.progress-text { color: var(--gold-bright); font-weight: 700; }

.question-card {
  width: min(920px, 100%);
  padding: clamp(26px, 5vw, 58px);
  margin-top: 42px;
}
.question-card h2 {
  font-size: clamp(24px, 4vw, 40px);
  line-height: 1.45;
  margin-bottom: 28px;
}
.options { display: grid; gap: 14px; }
.option-btn {
  width: 100%;
  text-align: left;
  color: var(--text);
  padding: 18px 20px;
  border: 1px solid rgba(216,173,85,.28);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(105, 40, 28, .78), rgba(21, 11, 8, .72));
  line-height: 1.65;
}
.option-btn:hover {
  border-color: var(--gold-bright);
  box-shadow: 0 12px 30px rgba(0,0,0,.24);
  background: linear-gradient(135deg, rgba(143, 30, 25, .86), rgba(50, 22, 14, .9));
}
.option-key {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-right: 10px;
  border-radius: 50%;
  color: #2b1309;
  background: var(--gold-bright);
  font-weight: 900;
}

.result-screen { padding: 40px 0; }
.result-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 22px;
  align-items: start;
}
.general-card, .analysis-card { padding: 30px; }
.general-card { position: sticky; top: 24px; text-align: center; }
.faction-badge {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin-bottom: 16px;
  color: #2b1309;
  background: radial-gradient(circle, #fff2bd, #d29a35);
  font-size: 28px;
  font-weight: 900;
}
.general-card h2 { font-size: 48px; margin-bottom: 4px; }
.title-line { color: var(--gold-bright); font-size: 18px; }
.match-ring {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  margin: 24px auto;
  display: grid;
  place-items: center;
  align-content: center;
  border: 2px solid var(--gold);
  background: radial-gradient(circle, rgba(255,217,138,.16), rgba(143,30,25,.22));
}
.match-ring span { font-size: 38px; font-weight: 900; color: var(--gold-bright); }
.match-ring small { color: var(--muted); }
.keyword-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 20px; }
.keyword-list span {
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--paper);
  border: 1px solid rgba(216,173,85,.34);
  background: rgba(0,0,0,.18);
}
.scene-list { color: var(--muted); line-height: 1.75; }
.analysis-card h1 { font-size: clamp(32px, 4vw, 56px); margin-bottom: 28px; }
.analysis-section {
  padding: 22px 0;
  border-top: 1px solid rgba(216,173,85,.22);
}
.analysis-section h3 {
  color: var(--gold-bright);
  font-size: 22px;
  margin-bottom: 10px;
}
.analysis-section p {
  color: #ead9af;
  line-height: 2;
  font-size: 17px;
  margin-bottom: 0;
}
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.action-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  opacity: 0;
  padding: 12px 18px;
  border-radius: 999px;
  color: #2b1309;
  background: var(--gold-bright);
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
  transition: .2s ease;
  z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 820px) {
  .screen { padding: 28px 0; }
  .seal { display: none; }
  .hero-stats { grid-template-columns: 1fr; }
  .topbar { grid-template-columns: 1fr auto; }
  .topbar .ghost-btn { grid-column: 1 / -1; justify-self: start; }
  .question-card { margin-top: 98px; }
  .result-layout { grid-template-columns: 1fr; }
  .general-card { position: relative; top: auto; }
  .split { grid-template-columns: 1fr; }
}
