:root {
  --ink: #17212f;
  --muted: #6d7684;
  --paper: #fffdfa;
  --line: rgba(23, 33, 47, 0.1);
  --blue: #3157d5;
  --red: #d64d43;
  --green: #2f8064;
  --gold: #d79b34;
  --shadow: 0 20px 50px rgba(31, 37, 52, 0.16);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 12% 10%, rgba(220, 38, 38, 0.16), transparent 30%),
    radial-gradient(circle at 88% 12%, rgba(61, 109, 242, 0.18), transparent 28%),
    linear-gradient(145deg, #191b22 0%, #e8edf3 48%, #f7efe5 100%);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family:
    Pretendard,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

.app-shell {
  position: relative;
  width: min(100%, 390px);
  max-width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 253, 250, 0.95), rgba(255, 253, 250, 0.99)),
    repeating-linear-gradient(90deg, rgba(23, 33, 47, 0.04) 0 1px, transparent 1px 54px);
  box-shadow: 0 0 70px rgba(23, 33, 47, 0.16);
}

.screen {
  display: none;
  min-height: 100vh;
  padding: 20px;
  overflow-x: hidden;
}

.screen.is-active {
  display: flex;
  animation: screenIn 380ms ease both;
}

.screen-start {
  position: relative;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  padding: 22px 20px 26px;
}

.hero-media {
  position: relative;
  display: grid;
  min-height: 43vh;
  place-items: center;
  isolation: isolate;
}

.hero-media::before {
  position: absolute;
  inset: 10px 18px 0;
  z-index: -2;
  border: 1px solid rgba(23, 33, 47, 0.08);
  border-radius: 999px 999px 60px 60px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(246, 237, 221, 0.38)),
    linear-gradient(135deg, rgba(49, 87, 213, 0.12), transparent 45%);
  content: "";
}

.seal-ring {
  position: absolute;
  inset: 28px 44px 18px;
  z-index: -1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(49, 87, 213, 0.16);
  border-radius: 50%;
}

.seal-ring span {
  position: absolute;
  border: 1px solid rgba(23, 33, 47, 0.08);
  border-radius: 50%;
}

.seal-ring span:nth-child(1) {
  width: 76%;
  height: 76%;
}

.seal-ring span:nth-child(2) {
  width: 54%;
  height: 54%;
}

.seal-ring span:nth-child(3) {
  width: 30%;
  height: 30%;
  background: rgba(215, 155, 52, 0.16);
}

.candidate-fan {
  position: relative;
  width: min(88vw, 380px);
  height: min(69vw, 302px);
}

.candidate-fan img {
  position: absolute;
  width: 36%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center top;
  border: 4px solid #fffdfa;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  filter: saturate(1.04) contrast(1.02);
}

.candidate-fan img:nth-child(1) {
  left: 7%;
  bottom: 6%;
  transform: rotate(-10deg);
}

.candidate-fan img:nth-child(2) {
  left: 28%;
  top: 0;
  z-index: 3;
  width: 42%;
  transform: rotate(-2deg);
}

.candidate-fan img:nth-child(3) {
  right: 7%;
  bottom: 7%;
  transform: rotate(9deg);
}

.candidate-fan img:nth-child(4) {
  left: 37%;
  bottom: 1%;
  z-index: 2;
  width: 31%;
  transform: rotate(3deg);
}

.candidate-fan img:nth-child(5) {
  left: 0;
  top: 18%;
  z-index: 1;
  width: 30%;
  transform: rotate(-15deg);
}

.candidate-fan img:nth-child(6) {
  right: 0;
  top: 18%;
  z-index: 1;
  width: 30%;
  transform: rotate(15deg);
}

.start-copy {
  text-align: center;
}

.eyebrow,
.question-kicker,
.result-label {
  margin: 0;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  word-break: keep-all;
}

h1 {
  margin: 10px 0 12px;
  font-size: clamp(30px, 8vw, 36px);
  font-weight: 900;
  line-height: 1.08;
}

.lead {
  width: min(100%, 350px);
  margin: 0 auto;
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.55;
}

.start-panel {
  display: grid;
  gap: 14px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.meta-grid span {
  min-width: 0;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  color: #3d4654;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 22px;
  border-radius: var(--radius);
  font-weight: 900;
  letter-spacing: 0;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.primary-btn {
  width: 100%;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 14px 28px rgba(23, 33, 47, 0.2);
}

.secondary-btn {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

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

.primary-btn:active,
.secondary-btn:active,
.option-btn:active,
.icon-btn:active {
  transform: translateY(1px);
}

.primary-btn svg,
.secondary-btn svg {
  width: 19px;
  height: 19px;
  margin-right: 8px;
  stroke-width: 2.6;
}

.note {
  margin: 0;
  color: rgba(23, 33, 47, 0.55);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.screen-quiz {
  flex-direction: column;
  gap: 26px;
  padding: 20px;
}

.quiz-header {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
}

.icon-btn {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  transition: transform 160ms ease;
}

.icon-btn svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.5;
}

.progress-wrap {
  min-width: 0;
}

.progress-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #596272;
  font-size: 13px;
  font-weight: 800;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 33, 47, 0.1);
}

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

.question-card {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
}

.question-card h2 {
  margin: 0;
  font-size: clamp(27px, 8vw, 39px);
  font-weight: 900;
  line-height: 1.17;
}

.options {
  display: grid;
  gap: 10px;
}

.option-btn {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 13px;
  align-items: center;
  min-height: 76px;
  padding: 15px;
  border: 1px solid rgba(23, 33, 47, 0.11);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.82)),
    #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 20px rgba(23, 33, 47, 0.06);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.option-btn span:first-child {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: rgba(49, 87, 213, 0.1);
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.option-btn span:last-child {
  min-width: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
}

.option-btn.is-selected {
  border-color: rgba(49, 87, 213, 0.5);
  box-shadow: 0 14px 28px rgba(49, 87, 213, 0.15);
}

.screen-loading {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
}

.loading-mark {
  display: flex;
  gap: 8px;
  height: 42px;
  align-items: center;
}

.loading-mark span {
  width: 12px;
  height: 38px;
  border-radius: 999px;
  background: var(--ink);
  animation: pulseBar 760ms ease-in-out infinite;
}

.loading-mark span:nth-child(2) {
  background: var(--red);
  animation-delay: 120ms;
}

.loading-mark span:nth-child(3) {
  background: var(--gold);
  animation-delay: 240ms;
}

.screen-loading h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 900;
}

.screen-loading p {
  width: min(100%, 300px);
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
}

.screen-result {
  flex-direction: column;
  padding: 0;
  background: #fffdfa;
}

.result-hero {
  position: relative;
  display: flex;
  min-height: 56vh;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  padding: 24px 20px 30px;
  color: #fff;
  isolation: isolate;
}

.result-hero::before {
  position: absolute;
  inset: 0;
  z-index: -3;
  background: var(--result-bg, linear-gradient(145deg, #17212f, #3157d5));
  content: "";
}

.result-hero::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, transparent 12%, rgba(0, 0, 0, 0.18) 50%, rgba(0, 0, 0, 0.62) 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 56px);
  content: "";
}

.result-photo-wrap {
  position: absolute;
  top: 26px;
  right: 18px;
  z-index: -2;
  width: min(64vw, 290px);
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 5px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.28);
  transform: rotate(2deg);
}

.result-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.result-label {
  color: rgba(255, 255, 255, 0.78);
}

.result-hero h2 {
  width: min(100%, 350px);
  margin: 8px 0 10px;
  font-size: clamp(30px, 8.2vw, 42px);
  font-weight: 900;
  line-height: 1.08;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
}

.result-hero p:last-child {
  width: min(100%, 330px);
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.55;
}

.result-body {
  display: grid;
  gap: 14px;
  padding: 18px 20px 28px;
}

.result-section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 33, 47, 0.05);
}

.result-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 900;
}

.result-section p {
  margin: 0;
  color: #44505e;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.65;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list span {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(49, 87, 213, 0.09);
  color: #263244;
  font-size: 13px;
  font-weight: 850;
}

.score-list {
  display: grid;
  gap: 12px;
}

.score-row {
  display: grid;
  gap: 6px;
}

.score-label {
  display: flex;
  justify-content: space-between;
  color: #3a4554;
  font-size: 13px;
  font-weight: 850;
}

.score-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 33, 47, 0.08);
}

.score-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--bar-color, var(--blue));
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.credits {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.credits summary {
  cursor: pointer;
  font-weight: 850;
}

.credits ul {
  margin: 10px 0 0;
  padding-left: 18px;
  line-height: 1.8;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 20;
  width: min(calc(100% - 40px), 360px);
  padding: 13px 16px;
  border-radius: var(--radius);
  background: rgba(23, 33, 47, 0.94);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

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

@keyframes pulseBar {
  0%,
  100% {
    transform: scaleY(0.55);
  }
  50% {
    transform: scaleY(1);
  }
}

@media (min-width: 760px) {
  body {
    display: grid;
    place-items: center;
    padding: 28px;
  }

  .app-shell {
    min-height: min(900px, calc(100vh - 56px));
    border-radius: 16px;
  }

  .screen {
    min-height: min(900px, calc(100vh - 56px));
  }
}

@media (max-width: 360px) {
  .screen {
    padding-right: 16px;
    padding-left: 16px;
  }

  .hero-media {
    min-height: 39vh;
  }

  .option-btn {
    grid-template-columns: 30px 1fr;
    min-height: 70px;
    padding: 13px;
  }

  .option-btn span:first-child {
    width: 30px;
    height: 30px;
  }

  .action-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
