:root {
  --bg-0: #03040a;
  --bg-1: #0a0c1e;
  --bg-2: #15172e;
  --fg: #f3efe0;
  --muted: #8c8eaa;
  --sw: #f5c518;
  --sw-dim: #c79b00;
  --sw-glow: rgba(245, 197, 24, 0.4);
  --scripture: #d9b779;
  --scripture-dim: #a88848;
  --scripture-glow: rgba(217, 183, 121, 0.4);
  --correct: #6ad27b;
  --wrong: #e85a5a;
  --card: rgba(18, 20, 38, 0.85);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
}

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

html, body {
  min-height: 100%;
  background: radial-gradient(ellipse at 50% 100%, #1f2447 0%, #07091a 55%, #02030a 100%);
  color: var(--fg);
  font-family: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

.starfield {
  position: fixed;
  inset: -200px;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1px 1px at 13% 18%, #ffffff, transparent 60%),
    radial-gradient(1.5px 1.5px at 27% 73%, #cfd6ff, transparent 60%),
    radial-gradient(1px 1px at 41% 32%, #ffffff, transparent 60%),
    radial-gradient(2px 2px at 56% 11%, #ffffff, transparent 60%),
    radial-gradient(1px 1px at 64% 55%, #ffdfa8, transparent 60%),
    radial-gradient(1.5px 1.5px at 78% 87%, #ffffff, transparent 60%),
    radial-gradient(1px 1px at 88% 41%, #ffffff, transparent 60%),
    radial-gradient(1px 1px at 7% 64%, #b8c2ff, transparent 60%),
    radial-gradient(1px 1px at 33% 5%, #ffffff, transparent 60%),
    radial-gradient(1px 1px at 49% 92%, #ffffff, transparent 60%),
    radial-gradient(2px 2px at 92% 7%, #fff5d0, transparent 60%),
    radial-gradient(1px 1px at 18% 47%, #ffffff, transparent 60%);
  background-size: 600px 600px;
  background-repeat: repeat;
  animation: drift 180s linear infinite;
  opacity: 0.85;
}

@keyframes drift {
  to { transform: translate3d(-120px, -260px, 0); }
}

.game {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 24px 56px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.title {
  font-family: 'Cinzel', 'Optima', 'Iowan Old Style', Georgia, serif;
  font-size: clamp(1.35rem, 4.2vw, 2.15rem);
  font-weight: 700;
  letter-spacing: 1.5px;
  line-height: 1.1;
  text-transform: uppercase;
}

.title-sw {
  color: var(--sw);
  text-shadow: 0 0 14px var(--sw-glow);
}

.title-or {
  color: var(--muted);
  font-style: italic;
  font-weight: 300;
  text-transform: lowercase;
  letter-spacing: 0;
  font-family: 'Iowan Old Style', Georgia, serif;
  font-size: 0.7em;
  margin: 0 4px;
}

.title-scripture {
  color: var(--scripture);
  text-shadow: 0 0 14px var(--scripture-glow);
}

.title .qmark { color: var(--muted); margin-left: 2px; }

.score {
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 90px;
}

.score-label {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 3px;
}

.score-value {
  color: var(--fg);
  font-size: 1.3rem;
  font-weight: 600;
}

/* Card */
.quote-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 36px 30px 32px;
  flex: 1;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
  position: relative;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.progress {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px 6px 0 0;
  overflow: hidden;
}

#progress-bar {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--sw) 0%, var(--scripture) 100%);
  box-shadow: 0 0 12px var(--sw-glow);
  transition: width 0.4s ease;
}

.quote-num {
  font-family: 'SF Mono', 'Menlo', monospace;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 28px;
  text-align: center;
}

.quote {
  flex: 1;
  font-size: clamp(1.3rem, 3vw, 1.85rem);
  font-style: italic;
  line-height: 1.55;
  padding: 28px 18px 32px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  position: relative;
  color: #fbf6e8;
  text-wrap: pretty;
}

.quote::before,
.quote::after {
  font-family: 'Iowan Old Style', Georgia, serif;
  font-style: normal;
  font-size: 4.5rem;
  color: var(--muted);
  opacity: 0.25;
  line-height: 1;
  position: absolute;
}

.quote::before { content: '\201C'; left: 4px; top: 0; }
.quote::after  { content: '\201D'; right: 4px; bottom: -10px; }

/* Answers */
.answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
}

.btn {
  font-family: inherit;
  font-size: 1.05rem;
  padding: 16px 18px;
  border-radius: 4px;
  border: 1px solid;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease, box-shadow 0.2s ease, border-color 0.18s ease, color 0.18s ease;
  letter-spacing: 1.5px;
  font-weight: 600;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  user-select: none;
}

.btn:active { transform: translateY(1px); }

.btn-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid currentColor;
  border-radius: 3px;
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 0.7rem;
  opacity: 0.65;
}

.btn-sw {
  color: var(--sw);
  border-color: var(--sw-dim);
  background: rgba(245, 197, 24, 0.04);
  text-transform: uppercase;
  font-family: 'Cinzel', 'Optima', serif;
}

.btn-sw:hover:not(:disabled) {
  background: rgba(245, 197, 24, 0.14);
  box-shadow: 0 0 24px var(--sw-glow);
  border-color: var(--sw);
}

.btn-scripture {
  color: var(--scripture);
  border-color: var(--scripture-dim);
  background: rgba(217, 183, 121, 0.04);
  font-family: 'Iowan Old Style', Georgia, serif;
  font-style: italic;
  letter-spacing: 0.5px;
  font-size: 1.15rem;
}

.btn-scripture:hover:not(:disabled) {
  background: rgba(217, 183, 121, 0.14);
  box-shadow: 0 0 24px var(--scripture-glow);
  border-color: var(--scripture);
}

.btn:disabled {
  cursor: default;
  opacity: 0.55;
}

.btn.correct {
  background: rgba(106, 210, 123, 0.18) !important;
  border-color: var(--correct) !important;
  color: var(--correct) !important;
  box-shadow: 0 0 26px rgba(106, 210, 123, 0.35);
  opacity: 1;
}

.btn.wrong {
  background: rgba(232, 90, 90, 0.18) !important;
  border-color: var(--wrong) !important;
  color: var(--wrong) !important;
  opacity: 1;
}

/* Result */
.result {
  margin-top: 26px;
  text-align: center;
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-verdict {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.result-verdict.correct { color: var(--correct); text-shadow: 0 0 16px rgba(106,210,123,0.35); }
.result-verdict.wrong   { color: var(--wrong);   text-shadow: 0 0 16px rgba(232,90,90,0.3); }

.result-source {
  color: var(--fg);
  font-size: 1.05rem;
  margin-bottom: 24px;
  font-style: italic;
  opacity: 0.92;
}

.btn-next {
  color: var(--fg);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  font-family: 'SF Mono', 'Menlo', monospace;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 0.85rem;
  padding: 14px 28px;
}

.btn-next:hover { background: rgba(255, 255, 255, 0.1); }

/* Footer */
.footer {
  margin-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.hint {
  font-family: 'SF Mono', 'Menlo', monospace;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.5px;
}

.hint kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg);
  font-family: inherit;
  font-size: 0.7rem;
  margin: 0 2px;
}

.btn-text {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 0;
}
.btn-text:hover { color: var(--fg); }

/* Summary */
.summary {
  text-align: center;
  padding: 30px 10px 10px;
  animation: fadeIn 0.5s ease;
}

.summary-title {
  font-family: 'Cinzel', Georgia, serif;
  color: var(--sw);
  font-size: clamp(1.3rem, 3.4vw, 1.9rem);
  margin-bottom: 28px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 0 16px var(--sw-glow);
  line-height: 1.25;
}

.summary-score-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 28px;
}

.summary-score {
  font-family: 'Cinzel', Georgia, serif;
  font-size: clamp(2.5rem, 8vw, 3.6rem);
  color: var(--fg);
  font-weight: 700;
}

.summary-pct {
  font-family: 'SF Mono', monospace;
  color: var(--muted);
  font-size: 1rem;
  letter-spacing: 2px;
}

.summary-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 auto 28px;
  max-width: 460px;
}

.summary-breakdown .stat {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px 12px;
  background: rgba(255, 255, 255, 0.02);
}

.summary-breakdown .stat-label {
  font-family: 'SF Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 6px;
}

.summary-breakdown .stat-sw      { border-color: var(--sw-dim); }
.summary-breakdown .stat-sw .stat-label      { color: var(--sw); }
.summary-breakdown .stat-scripture { border-color: var(--scripture-dim); }
.summary-breakdown .stat-scripture .stat-label { color: var(--scripture); }

.summary-breakdown .stat-value {
  font-size: 1.4rem;
  font-weight: 600;
}

.summary-msg {
  color: var(--muted);
  margin-bottom: 26px;
  font-style: italic;
  font-size: 1rem;
  line-height: 1.5;
}

/* Mobile */
@media (max-width: 540px) {
  .game { padding: 24px 16px 32px; }
  .topbar { margin-bottom: 24px; }
  .quote-card { padding: 28px 18px 24px; }
  .quote { padding: 20px 8px 24px; min-height: 160px; }
  .answers { grid-template-columns: 1fr; }
  .footer { justify-content: center; flex-direction: column-reverse; gap: 16px; }
  .summary-breakdown { grid-template-columns: 1fr; }
}
