:root {
  --bg: #f7f4ee;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --text: #182230;
  --muted: #5f6775;
  --line: rgba(24, 34, 48, 0.12);
  --red: #ee5a5a;
  --yellow: #f2d85d;
  --green: #53c693;
  --blue: #4a89e8;
  --disc-d: var(--yellow);
  --disc-i: var(--red);
  --disc-s: var(--green);
  --disc-c: var(--blue);
  --shadow: 0 18px 50px rgba(24, 34, 48, 0.08);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Noto Sans SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(74, 137, 232, 0.15), transparent 22%),
    radial-gradient(circle at top right, rgba(242, 216, 93, 0.2), transparent 24%),
    radial-gradient(circle at bottom left, rgba(83, 198, 147, 0.16), transparent 20%),
    radial-gradient(circle at 75% 75%, rgba(238, 90, 90, 0.14), transparent 18%),
    linear-gradient(180deg, #f7f4ee 0%, #f1ede6 100%);
  min-height: 100vh;
}

button,
a {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 80px;
}

.hero,
.quiz,
.result {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  min-height: min(88svh, 760px);
  border-radius: 36px;
  padding: clamp(28px, 4vw, 56px);
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.9fr);
  gap: 32px;
  align-items: center;
}

.eyebrow,
.section-label {
  margin: 0 0 14px;
  color: var(--blue);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.hero h1,
.quiz h2,
.result h2 {
  margin: 0;
  line-height: 1.06;
}

.hero h1 {
  max-width: 6ch;
  font-family: "DM Serif Display", serif;
  font-size: clamp(4.6rem, 11vw, 8.4rem);
  font-weight: 400;
  letter-spacing: -0.04em;
}

.poster-title {
  display: flex;
  flex-direction: column;
  gap: 0.02em;
}

.poster-title span {
  display: block;
}

.poster-title span:first-child {
  letter-spacing: -0.06em;
}

.hero-actions,
.quiz-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.primary-button {
  border: none;
  background: var(--text);
  color: #fff;
  box-shadow: 0 16px 34px rgba(24, 34, 48, 0.18);
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.hero-panel {
  position: relative;
  min-height: 420px;
  border-radius: var(--radius-lg);
  padding: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.58)),
    linear-gradient(135deg, rgba(74, 137, 232, 0.18), rgba(242, 216, 93, 0.16));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid rgba(24, 34, 48, 0.08);
}

.hero-panel::before,
.hero-panel::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  inset: auto;
}

.hero-panel::before {
  width: 280px;
  height: 280px;
  top: -40px;
  right: -60px;
  background: rgba(74, 137, 232, 0.14);
}

.hero-panel::after {
  width: 220px;
  height: 220px;
  bottom: -70px;
  left: -40px;
  background: rgba(238, 90, 90, 0.12);
}

.score-ring {
  width: min(100%, 320px);
  aspect-ratio: 1;
  margin: auto;
  border-radius: 50%;
  background:
    conic-gradient(
      from 0deg,
      var(--disc-i) 0 90deg,
      var(--disc-c) 90deg 180deg,
      var(--disc-s) 180deg 270deg,
      var(--disc-d) 270deg 360deg
    );
  padding: 22px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.score-ring span {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
}

.hero-panel p {
  position: relative;
  margin: 0;
  color: var(--muted);
}

.quiz,
.result {
  margin-top: 26px;
  border-radius: 30px;
  padding: clamp(24px, 3vw, 38px);
}
.quiz h2,
.result h2 {
  max-width: 22ch;
  font-size: clamp(1.8rem, 3.6vw, 3rem);
}

.chart-head h3,
.result-card h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}

.chart-head p,
.result-card p,
.result-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.hidden {
  display: none;
}

.quiz-topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.progress-meta {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--muted);
  white-space: nowrap;
}

.progress-meta strong {
  font-size: 2rem;
  line-height: 1;
  color: var(--text);
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(24, 34, 48, 0.08);
  margin: 22px 0 28px;
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--red));
  transition: width 220ms ease;
}

.question-list {
  display: grid;
  gap: 16px;
}

.question-card {
  padding: 20px;
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  border: 1px solid rgba(24, 34, 48, 0.08);
}

.question-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.question-number {
  color: var(--red);
  font-weight: 800;
  min-width: 2.5rem;
}

.question-text {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.option-list {
  display: grid;
  gap: 10px;
}

.option-item {
  position: relative;
}

.option-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-label {
  display: flex;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    transform 180ms ease;
}

.option-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(74, 137, 232, 0.1);
  color: var(--blue);
  display: grid;
  place-items: center;
  font-size: 0.92rem;
  font-weight: 700;
  flex: 0 0 auto;
}

.option-item input:checked + .option-label {
  background: rgba(74, 137, 232, 0.06);
  border-color: rgba(74, 137, 232, 0.45);
  transform: translateY(-1px);
}

.result-header {
  max-width: 700px;
}

.chart-card {
  margin-top: 28px;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(74, 137, 232, 0.08), rgba(242, 216, 93, 0.06));
  border: 1px solid rgba(24, 34, 48, 0.08);
}

.chart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.9fr);
  gap: 18px;
  align-items: center;
  margin-top: 18px;
}

.pie-chart-wrap {
  display: grid;
  place-items: center;
  min-height: 360px;
  padding: 12px;
}

.pie-chart {
  width: min(100%, 420px);
  height: auto;
  overflow: visible;
}

.pie-label {
  font-size: 14px;
  font-weight: 700;
  fill: var(--text);
}

.pie-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.pie-center-title {
  font-size: 18px;
  font-weight: 800;
  fill: var(--text);
}

.pie-center-subtitle {
  font-size: 12px;
  fill: var(--muted);
}

.chart-legend {
  display: grid;
  gap: 12px;
}

.legend-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(24, 34, 48, 0.06);
}

.legend-swatch {
  width: 18px;
  height: 18px;
  border-radius: 6px;
}

.legend-copy strong,
.legend-copy span {
  display: block;
}

.legend-copy strong {
  font-size: 0.98rem;
}

.legend-copy span,
.legend-score {
  color: var(--muted);
}

.legend-score {
  font-weight: 700;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.score-card {
  padding: 18px;
  border-radius: var(--radius-md);
  color: #fff;
}

.score-card strong {
  display: block;
  font-size: 2rem;
  margin-bottom: 8px;
}

.score-card span {
  display: block;
  opacity: 0.9;
}

.score-card[data-tone="D"] {
  background: linear-gradient(135deg, #f2d85d, #f0dd76);
  color: var(--text);
}

.score-card[data-tone="I"] {
  background: linear-gradient(135deg, #ee5a5a, #f17777);
}

.score-card[data-tone="S"] {
  background: linear-gradient(135deg, #53c693, #70d4a8);
}

.score-card[data-tone="C"] {
  background: linear-gradient(135deg, #4a89e8, #6ca1ef);
}

.result-card {
  margin-top: 18px;
  padding: 22px;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid rgba(24, 34, 48, 0.08);
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .chart-layout,
  .result-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 100%);
    padding-top: 12px;
  }

  .hero,
  .quiz,
  .result {
    border-radius: 22px;
  }

  .hero h1 {
    max-width: 5ch;
    font-size: clamp(3.8rem, 18vw, 5.8rem);
  }

  .quiz-topbar {
    flex-direction: column;
    align-items: start;
  }

  .chart-layout,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .pie-chart-wrap {
    min-height: auto;
    padding: 0;
  }

  .question-head {
    flex-direction: column;
    gap: 6px;
  }

  .progress-meta strong {
    font-size: 1.6rem;
  }
}
