:root {
  --bg: #f6f3ee;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-border: rgba(41, 34, 27, 0.08);
  --text: #211c16;
  --muted: #6a6057;
  --title-soft: #8b7d70;
  --line: rgba(41, 34, 27, 0.12);
  --accent: #211c16;
  --accent-soft: #ece4d9;
  --danger: #9a4e42;
  --shadow: 0 28px 60px rgba(44, 31, 18, 0.08);
  --radius-lg: 30px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at center 118%, rgba(255, 255, 255, 0.96), transparent 52%),
    linear-gradient(180deg, #fcfbf8 0%, var(--bg) 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  background:
    radial-gradient(circle at center 115%, rgba(230, 221, 209, 0.72), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.16));
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  width: min(100%, 880px);
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
}

.shell--quiz {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.panel {
  position: relative;
  overflow: hidden;
  width: 100%;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.quiz-panel {
  padding: 44px 30px 34px;
}

.panel__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.9), transparent 40%),
    radial-gradient(circle at 50% 118%, rgba(236, 228, 217, 0.82), transparent 54%);
}

.hero,
.question-card,
.result-card,
.app-footer {
  position: relative;
  z-index: 1;
}

.hero {
  padding: 8px 4px 18px;
  text-align: center;
}

.hero--minimal {
  padding-bottom: 28px;
}

.hero h1,
.result-card__title {
  margin: 0;
  font-family: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(2.6rem, 8vw, 4.5rem);
  line-height: 0.96;
  max-width: 10ch;
  margin-left: auto;
  margin-right: auto;
}

.hero--minimal h1 {
  color: var(--title-soft);
}

.eyebrow,
.question-card__index {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero__copy,
.question-card__hint,
.result-card__message,
.app-footer {
  color: var(--muted);
  line-height: 1.6;
}

.hero__copy {
  margin: 12px 0 0;
  max-width: 36ch;
  font-size: 1rem;
}

.debug-bar {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.debug-bar__item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.debug-bar__label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-family: "Manrope", "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.debug-bar__value {
  display: block;
  font-family: "Manrope", "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.progress-block {
  padding: 18px 2px 0;
}

.progress-block--inline {
  margin-top: 34px;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(33, 28, 22, 0.08);
}

.progress-bar {
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c5b6a3 0%, #96836f 100%);
  transition: width 280ms ease;
}

.question-card,
.result-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.question-card,
.result-card {
  padding: 12px 2px 2px;
  transition:
    transform 420ms ease,
    opacity 420ms ease,
    filter 420ms ease;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.question-card.is-entering,
.result-card.is-entering {
  opacity: 0;
  transform: translateY(10px);
  filter: blur(6px);
}

.question-card.is-exiting {
  opacity: 0;
  transform: translateY(-8px);
  filter: blur(6px);
}

.question-card__title {
  margin: 0 auto 36px;
  font-size: clamp(2.2rem, 8vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  max-width: 13ch;
}

#question-prompt {
  display: grid;
  gap: 18px;
}

.inline-question {
  display: grid;
  justify-items: center;
  gap: 16px;
}

.inline-question__text {
  margin: 0;
  font-size: clamp(2.1rem, 8vw, 3.5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.inline-question .select-field {
  max-width: 240px;
  margin: 0;
}

.select-field {
  display: block;
  max-width: 520px;
  margin: 0 auto;
}

.select-field__label {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  width: 100%;
  border: 1px solid rgba(33, 28, 22, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
}

.select-wrap select {
  appearance: none;
  padding: 20px 52px 20px 20px;
  font-size: clamp(1.35rem, 5vw, 1.9rem);
  line-height: 1.08;
  font-family: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  text-align: center;
  text-align-last: center;
}

.select-wrap__icon {
  position: absolute;
  top: 50%;
  right: 18px;
  translate: 0 -50%;
  color: var(--muted);
  font-size: 1.5rem;
  pointer-events: none;
}

.question-card__hint {
  margin: 16px 0 0;
  font-size: 0.95rem;
}

.result-card__title {
  font-size: clamp(1.2rem, 3.8vw, 1.8rem);
  line-height: 1.15;
  max-width: 20ch;
  margin: 0 auto 12px;
  color: var(--muted);
}

.result-card__score {
  margin: 0 auto 18px;
  font-family: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  font-size: clamp(2rem, 7vw, 3.2rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--text);
}

.result-card--special .result-card__title {
  font-family: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  font-size: clamp(2rem, 7vw, 3.2rem);
  line-height: 1.04;
  max-width: 13ch;
  margin: 0 auto 18px;
  color: var(--text);
}

.result-card__message {
  max-width: 34ch;
  margin: 0 auto 28px;
}

.button,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    transform 180ms ease,
    border-color 180ms ease;
}

.button {
  min-height: 48px;
  padding: 0 18px;
}

.button:hover,
.chip:hover {
  transform: translateY(-1px);
  background: #fff;
}

.button--primary {
  border-color: transparent;
  background: var(--accent);
  color: #fffdf9;
}

.button--ghost {
  background: rgba(255, 255, 255, 0.6);
}

.button--small {
  min-height: 38px;
  padding: 0 14px;
}

.chip {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.86rem;
}

.chip--danger {
  color: var(--danger);
}

.app-footer {
  padding: 20px 4px 6px;
  font-size: 0.9rem;
}

.app-footer p {
  margin: 0 0 10px;
}

.app-footer a {
  color: var(--text);
}

.hidden {
  display: none;
}

@media (max-width: 640px) {
  .quiz-panel {
    padding-left: 18px;
    padding-right: 18px;
  }

  .debug-bar {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    max-width: 9ch;
  }

  .question-card__title,
  .result-card__title {
    max-width: 11ch;
  }

}
