:root {
  --mint: #31d8ad;
  --mint-dark: #06a97d;
  --ink: #101010;
  --paper: #fffdf2;
  --yellow: #ffe86c;
  --orange: #ff9f2c;
  --red: #ee4d4d;
  --shadow: 6px 6px 0 #101010;
  --radius: 8px;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
}

@font-face {
  font-family: "YoungK Cute";
  src: url("./assets/fonts/cute-title.ttf") format("truetype");
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: linear-gradient(145deg, #d9fff1 0%, #f7ffd6 43%, #d7f1ff 73%, #f7e6ff 100%);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.app {
  width: min(1180px, calc(100% - 32px));
  min-height: 100svh;
  margin: 0 auto;
  padding: 24px 0 40px;
}

.home-landing {
  display: grid;
  min-height: calc(100svh - 64px);
  place-items: center;
  align-content: center;
  gap: clamp(14px, 3vw, 22px);
  text-align: center;
}

.logo-stage {
  width: min(560px, 100%);
  margin: 0;
  animation: floatLogo 3.4s ease-in-out infinite;
  filter: drop-shadow(0 18px 26px rgba(16, 16, 16, 0.18));
}

.logo-stage img,
.result-photo,
.loading-screen img {
  display: block;
  width: 100%;
  height: auto;
}

.home-landing h1 {
  margin: 0;
  font-family: "YoungK Cute", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: clamp(1.45rem, 4.6vw, 2.9rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0;
  word-break: keep-all;
  text-shadow:
    3px 0 var(--paper),
    -3px 0 var(--paper),
    0 3px var(--paper),
    0 -3px var(--paper),
    3px 3px 0 rgba(49, 216, 173, 0.65);
}

.primary-button,
.secondary-button,
.ghost-button,
.option-button {
  min-height: 48px;
  cursor: pointer;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  font-weight: 900;
  letter-spacing: 0;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.primary-button,
.secondary-button,
.ghost-button {
  padding: 10px 16px;
  box-shadow: var(--shadow);
}

.primary-button {
  color: var(--ink);
  background: var(--mint);
}

.secondary-button {
  color: var(--ink);
  background: var(--yellow);
}

.ghost-button {
  color: var(--ink);
  background: var(--paper);
}

.start-button {
  min-width: min(220px, 76vw);
  padding: 12px 24px;
  font-size: clamp(1rem, 2.5vw, 1.16rem);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.option-button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--ink);
}

.primary-button:active,
.secondary-button:active,
.ghost-button:active,
.option-button:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

@keyframes floatLogo {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-12px) rotate(1deg);
  }
}

.quiz-layout,
.result-layout {
  display: grid;
  gap: 28px;
}

.quiz-layout {
  grid-template-columns: minmax(0, 820px);
  justify-content: center;
  align-items: start;
}

.result-layout {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
  align-items: start;
}

.step-panel,
.result-card,
.loading-screen {
  background: rgba(255, 253, 242, 0.95);
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 7px 7px 0 var(--ink);
}

.step-panel {
  padding: clamp(18px, 3.2vw, 34px);
}

.progress-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-weight: 900;
}

.progress-label {
  color: var(--mint-dark);
}

.progress-track {
  height: 18px;
  overflow: hidden;
  background: #ffffff;
  border: 3px solid var(--ink);
  border-radius: 999px;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: repeating-linear-gradient(
    -45deg,
    var(--mint) 0,
    var(--mint) 10px,
    var(--yellow) 10px,
    var(--yellow) 20px
  );
  transition: width 240ms ease;
}

.step-question {
  margin: 26px 0 20px;
  font-size: clamp(1.25rem, 3.2vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: 0;
  word-break: keep-all;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.option-button {
  display: flex;
  min-height: 60px;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  color: var(--ink);
  background: #ffffff;
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 0.92rem;
  line-height: 1.35;
  text-align: center;
  word-break: keep-all;
}

.option-button.is-selected {
  background: var(--mint);
  outline: 4px solid var(--yellow);
}

.select-warning {
  min-height: 25px;
  margin: 16px 0 0;
  color: var(--red);
  font-weight: 900;
}

.step-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.loading-screen img {
  filter: drop-shadow(0 10px 16px rgba(16, 16, 16, 0.12));
}

.result-picks {
  display: grid;
  gap: 8px;
  margin: 0;
}

.result-picks div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 2px dashed rgba(16, 16, 16, 0.22);
}

.result-picks dt {
  font-weight: 900;
}

.result-picks dd {
  min-width: 0;
  margin: 0;
  word-break: keep-all;
}

.loading-screen {
  width: min(620px, 100%);
  margin: 64px auto 0;
  padding: 24px;
  text-align: center;
}

.loading-screen img {
  width: min(280px, 72%);
  margin: 0 auto 20px;
}

.loader {
  width: 86px;
  height: 22px;
  margin: 0 auto 18px;
  background: repeating-linear-gradient(
    90deg,
    var(--mint) 0,
    var(--mint) 18px,
    var(--yellow) 18px,
    var(--yellow) 36px
  );
  border: 3px solid var(--ink);
  border-radius: 999px;
  animation: wiggle 700ms infinite alternate ease-in-out;
}

@keyframes wiggle {
  from {
    transform: translateX(-8px) rotate(-2deg);
  }
  to {
    transform: translateX(8px) rotate(2deg);
  }
}

.loading-message {
  margin: 0;
  font-size: clamp(1.05rem, 3vw, 1.55rem);
  letter-spacing: 0;
}

.eyebrow {
  font-weight: 900;
  letter-spacing: 0;
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 16px;
  padding: 7px 10px;
  color: var(--ink);
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--ink);
}

.result-card {
  position: relative;
  overflow: hidden;
  padding: clamp(18px, 3.6vw, 32px);
  background:
    linear-gradient(135deg, var(--result-bg, #dffaf1), #fffdf2 70%),
    var(--paper);
}

.result-card > * {
  position: relative;
}

.result-photo-frame {
  position: relative;
  display: grid;
  width: min(100%, 620px);
  aspect-ratio: 4 / 5;
  place-items: center;
  overflow: hidden;
  margin: 0 auto 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.66), rgba(255, 232, 108, 0.28)),
    var(--result-bg, #dffaf1);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
}

.result-photo {
  display: none;
  height: 100%;
  object-fit: cover;
}

.result-photo-frame.has-photo .result-photo {
  display: block;
}

.result-photo-placeholder {
  padding: 10px 12px;
  color: rgba(16, 16, 16, 0.54);
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0;
}

.result-photo-frame.has-photo .result-photo-placeholder {
  display: none;
}

.result-moodboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 460px);
  margin: -6px auto 18px;
}

.moodboard-item {
  position: relative;
  display: grid;
  min-height: 0;
  aspect-ratio: 4 / 3;
  place-items: center;
  overflow: hidden;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 232, 108, 0.22)),
    var(--result-bg, #dffaf1);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
}

.moodboard-image {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.moodboard-item.has-image .moodboard-image {
  display: block;
}

.moodboard-item figcaption {
  position: absolute;
  left: 5px;
  bottom: 5px;
  max-width: calc(100% - 10px);
  padding: 4px 6px;
  background: rgba(255, 253, 242, 0.9);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.moodboard-item:not(.has-image) figcaption {
  position: static;
  color: rgba(16, 16, 16, 0.56);
  background: transparent;
  border: 0;
  font-size: 0.9rem;
}

.result-heading {
  margin: 0;
  font-size: clamp(0.98rem, 2.5vw, 1.18rem);
  font-weight: 800;
  line-height: 1.55;
  text-align: center;
  word-break: keep-all;
}

.result-title {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-family: "YoungK Cute", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.8rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0;
  word-break: keep-all;
  text-shadow:
    2px 0 var(--paper),
    -2px 0 var(--paper),
    0 2px var(--paper),
    0 -2px var(--paper),
    3px 3px 0 var(--result-accent, var(--mint));
}

.result-picks {
  max-width: 620px;
  margin: 18px auto 0;
  padding: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
}

.keyword-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 620px;
  margin: 16px auto 0;
}

.keyword-strip span {
  padding: 7px 10px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-weight: 900;
}

.result-description {
  max-width: 620px;
  margin: 16px auto 0;
  color: var(--ink);
  font-size: clamp(0.95rem, 2.5vw, 1.08rem);
  font-weight: 800;
  line-height: 1.72;
  letter-spacing: 0;
  text-align: left;
  white-space: pre-line;
  word-break: keep-all;
}

.result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 620px;
  margin: 20px auto 0;
}

.result-actions button {
  width: 100%;
}

.share-status {
  max-width: 620px;
  min-height: 24px;
  margin: 14px auto 0;
  font-weight: 900;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .logo-stage,
  .loader {
    animation: none;
  }
}

@media (max-width: 900px) {
  .quiz-layout,
  .result-layout {
    grid-template-columns: 1fr;
  }
}

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

  .home-landing {
    min-height: calc(100svh - 24px);
  }

  .logo-stage {
    width: 100%;
  }

  .step-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .option-grid {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button,
  .ghost-button {
    width: 100%;
  }

  .result-actions {
    grid-template-columns: 1fr;
  }

  .result-moodboard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(100%, 360px);
  }

  .moodboard-item {
    aspect-ratio: 1 / 1;
  }

  .moodboard-item figcaption {
    font-size: 0.58rem;
  }

  .result-picks div {
    grid-template-columns: 58px minmax(0, 1fr);
  }
}
