:root {
  --bg: #09090f;
  --bg-soft: rgba(17, 18, 27, 0.92);
  --panel: rgba(21, 22, 34, 0.9);
  --panel-strong: rgba(26, 27, 42, 0.96);
  --text: #f2eee8;
  --muted: #b8afb1;
  --muted-strong: #d5cbcd;
  --accent: #a22f41;
  --accent-2: #e2b678;
  --accent-3: #6f2230;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --transition: 220ms ease;
  --safe-bottom: max(20px, env(safe-area-inset-bottom));
  --safe-top: max(16px, env(safe-area-inset-top));
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at top, rgba(123, 28, 44, 0.14), transparent 36%),
              radial-gradient(circle at bottom, rgba(179, 130, 70, 0.08), transparent 24%),
              linear-gradient(180deg, #0a0b12 0%, #09090f 100%);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  overflow-x: hidden;
}

button {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
}

.background-glow {
  position: absolute;
  inset-inline: auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  filter: blur(36px);
  pointer-events: none;
  opacity: 0.5;
}

.background-glow--top {
  top: -80px;
  right: -60px;
  background: rgba(162, 47, 65, 0.28);
}

.background-glow--bottom {
  bottom: -120px;
  left: -80px;
  background: rgba(226, 182, 120, 0.16);
}

.app {
  width: min(100%, 560px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: var(--safe-top) clamp(12px, 4vw, 24px) var(--safe-bottom);
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
}

.screen {
  width: 100%;
  animation: fadeInUp 280ms ease;
}

.card {
  background: linear-gradient(180deg, rgba(31, 32, 47, 0.95), rgba(18, 18, 28, 0.96));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card,
.result-card,
.question-card,
.loading-card {
  padding: clamp(18px, 4.8vw, 28px) clamp(16px, 4.5vw, 24px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(162, 47, 65, 0.14);
  color: #f4dfe3;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.title {
  margin: 0;
  font-size: clamp(34px, 7.5vw, 46px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.subtitle,
.body-text,
.scale-text,
.result-text,
.meta-text,
.loading-text,
.legend {
  color: var(--muted);
  line-height: 1.56;
}

.subtitle {
  font-size: 16px;
  margin: 16px 0 0;
}


.hero-visual {
  display: grid;
  place-items: center;
  margin: 2px 0 20px;
}

.hero-visual__frame {
  width: min(100%, 320px);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3.2vw, 18px);
  border-radius: clamp(22px, 5vw, 28px);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.015));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.hero-visual__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: clamp(16px, 4vw, 22px);
  background: #f6f5f3;
}

.hero-stack {
  display: grid;
  gap: clamp(12px, 3.5vw, 18px);
  margin-top: clamp(18px, 5vw, 24px);
}

.hero-panel {
  padding: clamp(14px, 3.8vw, 18px);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.hero-panel strong {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  color: var(--muted-strong);
}

.primary-button,
.secondary-button,
.answer-button {
  width: 100%;
  border: 0;
  border-radius: 20px;
  transition: transform var(--transition), opacity var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.primary-button {
  margin-top: clamp(18px, 4.8vw, 24px);
  padding: 16px 18px;
  min-height: 56px;
  background: linear-gradient(135deg, var(--accent), #7d2634 55%, #4d1520 100%);
  color: #fff7f7;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 16px 36px rgba(125, 38, 52, 0.34);
}

.secondary-button {
  min-height: 52px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted-strong);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.primary-button:active,
.secondary-button:active,
.answer-button:active {
  transform: scale(0.98);
}

.progress-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.progress-label {
  font-size: 14px;
  color: var(--muted-strong);
}

.progress-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-value {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 18px rgba(226, 182, 120, 0.3);
}

.question-title {
  margin: 0 0 18px;
  font-size: clamp(24px, 5.5vw, 30px);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.image-frame {
  display: grid;
  place-items: center;
  padding: clamp(10px, 2.8vw, 14px);
  border-radius: clamp(18px, 4.8vw, 24px);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.08);
  min-height: clamp(200px, 44vw, 260px);
  margin-bottom: clamp(14px, 4vw, 18px);
}

.image-frame img {
  width: 100%;
  max-height: min(56vh, 360px);
  object-fit: contain;
  border-radius: clamp(14px, 3.8vw, 18px);
  background: #f6f5f3;
}

.answers {
  display: grid;
  gap: clamp(10px, 3vw, 12px);
}

.answer-button {
  padding: clamp(14px, 3.8vw, 16px);
  min-height: 58px;
  text-align: left;
  color: #f6edef;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
}

.answer-button strong {
  display: inline-block;
  margin-right: 10px;
  color: var(--accent-2);
}

.answer-button.selected {
  border-color: rgba(226, 182, 120, 0.45);
  background: linear-gradient(180deg, rgba(162,47,65,0.28), rgba(255,255,255,0.04));
  box-shadow: 0 16px 30px rgba(83, 21, 31, 0.26);
}

.question-footer {
  margin-top: 14px;
}

.legend {
  font-size: 13px;
}

.loading-card {
  text-align: center;
}

.loading-orbit {
  width: 120px;
  height: 120px;
  margin: 8px auto 20px;
  position: relative;
}

.loading-orbit::before,
.loading-orbit::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.08);
}

.loading-orbit::after {
  inset: 12px;
  border-color: rgba(226, 182, 120, 0.24);
}

.loading-core,
.loading-dot {
  position: absolute;
  inset: 0;
}

.loading-core::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, #f7d6b3 0%, #b43e52 68%, #681b28 100%);
  box-shadow: 0 0 24px rgba(180, 62, 82, 0.55);
}

.loading-dot {
  animation: orbit 1.6s linear infinite;
}

.loading-dot::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 18px rgba(226, 182, 120, 0.4);
}

.loading-title {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.03em;
}

.loading-text {
  min-height: 52px;
  margin: 16px 0 0;
  font-size: 16px;
}

.result-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-arch-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #e2c6ac;
}

.result-title {
  margin: 0;
  font-size: clamp(30px, 7vw, 40px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.result-text {
  font-size: 16px;
  margin: 0;
}

.result-grid {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.scale-card {
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.scale-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.scale-name {
  font-size: 15px;
  font-weight: 700;
}

.scale-score {
  font-size: 14px;
  color: #efd8bc;
}

.scale-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  overflow: hidden;
}

.scale-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(162,47,65,0.92), rgba(226,182,120,0.92));
}

.scale-text {
  margin: 10px 0 0;
  font-size: 14px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.tag {
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--muted-strong);
  font-size: 13px;
}

.result-final {
  margin-top: 20px;
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(111, 34, 48, 0.28), rgba(255,255,255,0.02));
  border: 1px solid rgba(226,182,120,0.14);
}

.result-actions {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.footer-note {
  margin-top: 18px;
  color: rgba(255,255,255,0.45);
  font-size: 12px;
  text-align: center;
}

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

@keyframes orbit {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}



@media (max-width: 380px) {
  .app {
    padding-inline: 10px;
  }

  .eyebrow {
    font-size: 12px;
    padding: 7px 10px;
    margin-bottom: 14px;
  }

  .subtitle,
  .body-text,
  .result-text,
  .loading-text {
    font-size: 15px;
  }

  .question-title {
    font-size: 22px;
  }

  .progress-wrap {
    gap: 10px;
  }
}

@media (max-height: 720px) {
  .app {
    align-items: flex-start;
  }

  .hero-visual__frame {
    width: min(100%, 250px);
  }

  .image-frame {
    min-height: 180px;
  }

  .image-frame img {
    max-height: min(42vh, 280px);
  }
}

@media (min-width: 480px) {
  .hero-visual__frame {
    width: min(100%, 360px);
  }

  .hero-card,
  .result-card,
  .question-card,
  .loading-card {
    padding: 28px 24px;
  }
}
