:root {
  --bg:        #F6F0E4;
  --card:      #FDFAF3;
  --text:      #2C1A0E;
  --muted:     #8A7A68;
  --accent:    #7B3F00;
  --accent-h:  #5C2E00;
  --border:    #D8CAB0;
  --selected:  #7B3F00;
  --error:     #B03030;
  --kofi:      #FF5E5B;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Space Mono', monospace;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  text-align: center;
}

.hidden { display: none !important; }

/* ── Hero ────────────────────────────────────── */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--text);
  color: var(--bg);
}

#hero .container { padding: 4rem 1.5rem; }

.hero-art {
  display: block;
  width: clamp(200px, 60vw, 280px);
  height: auto;
  margin: 0 auto 1.5rem;
  opacity: .88;
}

#hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(3.5rem, 12vw, 6.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.tagline {
  font-size: 0.95rem;
  line-height: 1.7;
  opacity: .7;
  margin-bottom: 2.5rem;
}

.uses-note {
  margin-top: 1rem;
  font-size: 0.75rem;
  opacity: .5;
}

/* ── Buttons ─────────────────────────────────── */
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 0.9rem 2.5rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-h); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }

#hero .btn-primary {
  background: var(--bg);
  color: var(--text);
}
#hero .btn-primary:hover { background: #EDE6D8; }

.btn-secondary {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--muted);
  padding: 0.75rem 2rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ── Quiz ────────────────────────────────────── */
#quiz h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  margin-bottom: .4rem;
}
.subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

.question-block {
  text-align: left;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2rem;
}

.question-text {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.15rem;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.answer-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.answer-list li label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  background: var(--card);
  border: 1.5px solid var(--border);
  cursor: pointer;
  font-size: 0.82rem;
  line-height: 1.5;
  transition: border-color 0.12s, background 0.12s;
}
.answer-list li label:hover { border-color: var(--accent); }

.answer-list input[type="radio"] { display: none; }

.answer-list input[type="radio"]:checked + label {
  border-color: var(--selected);
  background: #F0E8DA;
  font-weight: 700;
}

.radio-dot {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  transition: border-color 0.12s, background 0.12s;
}
.answer-list input[type="radio"]:checked + label .radio-dot {
  border-color: var(--selected);
  background: var(--selected);
}

.optional-tag {
  font-family: 'Space Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 2px 6px;
  vertical-align: middle;
  margin-left: 0.4rem;
}

/* ── Photo upload ─────────────────────────────── */
.photo-section {
  margin: 2rem 0;
  padding: 2rem;
  border: 2px dashed var(--border);
}
.photo-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  margin-bottom: .4rem;
}
.photo-note {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.upload-label {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 1rem 2rem;
  border: 1.5px solid var(--border);
  background: var(--card);
  transition: border-color 0.12s;
}
.upload-label:hover { border-color: var(--accent); }
.upload-label input { display: none; }

.upload-icon { font-size: 2rem; }

#upload-text {
  font-size: 0.78rem;
  color: var(--muted);
}

#photo-preview {
  width: 140px;
  height: 140px;
  object-fit: cover;
  margin-top: 1rem;
  border: 2px solid var(--border);
}

.error {
  color: var(--error);
  font-size: 0.82rem;
  margin-bottom: 1rem;
}

.remaining-note {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ── Loading ─────────────────────────────────── */
#loading {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--text);
  color: var(--bg);
}

.vinyl {
  font-size: 5rem;
  display: block;
  margin-bottom: 1.5rem;
  animation: spin 3s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

#loading h2 {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.6rem;
  margin-bottom: .75rem;
}

.loading-sub {
  font-size: 0.8rem;
  opacity: .5;
}

/* ── Results ─────────────────────────────────── */
#results { background: var(--bg); }

.score-ring {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  width: 180px;
  height: 180px;
  border: 5px solid var(--accent);
  border-radius: 50%;
  justify-content: center;
  margin-bottom: 1.5rem;
}

#score-num {
  font-family: 'Playfair Display', serif;
  font-size: 3.5rem;
  line-height: 1;
  color: var(--accent);
}

.score-pct {
  font-size: 1.1rem;
  color: var(--accent);
  margin-top: -4px;
}

.score-label {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

#results h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  margin-bottom: .6rem;
}

#tier-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 460px;
  margin: 0 auto 2rem;
}

.result-image-wrap {
  margin: 0 auto 2rem;
  max-width: 480px;
}

.result-image-wrap img {
  width: 100%;
  display: block;
  border: 3px solid var(--border);
}

/* ── Tip jar ─────────────────────────────────── */
.tip-jar {
  background: var(--card);
  border: 1.5px solid var(--border);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.tip-jar p {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.kofi-btn {
  display: inline-block;
  background: var(--kofi);
  color: #fff;
  text-decoration: none;
  padding: 0.75rem 1.75rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: opacity 0.15s;
}
.kofi-btn:hover { opacity: .85; }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 480px) {
  .answer-list li label { font-size: 0.78rem; }
  #hero h1 { font-size: 3.5rem; }
  .score-ring { width: 150px; height: 150px; }
  #score-num { font-size: 2.8rem; }
}
