:root {
  --bg1: #ffe3f1;
  --bg2: #e6e0ff;
  --bg3: #d7f4ff;
  --card: #ffffff;
  --text: #6b4e7a;
  --muted: #a68fb5;
  --pink: #ff8fc7;
  --purple: #b399ff;
  --mint: #7fe3c9;
  --yellow: #ffd77a;
  --radius: 26px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

button {
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg1) 0%, var(--bg2) 50%, var(--bg3) 100%);
  background-size: 200% 200%;
  animation: bg-drift 12s ease infinite;
  color: var(--text);
  font-family: "Gaegu", "Apple SD Gothic Neo", "Pretendard", "Malgun Gothic", sans-serif;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

@keyframes bg-drift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.sparkles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.sparkles span {
  position: absolute;
  font-size: 26px;
  opacity: 0.55;
  animation: float-up 9s linear infinite;
}

.sparkles span:nth-child(1) { left: 8%;  animation-duration: 8s;  animation-delay: 0s; }
.sparkles span:nth-child(2) { left: 22%; animation-duration: 11s; animation-delay: 1.5s; }
.sparkles span:nth-child(3) { left: 40%; animation-duration: 9s;  animation-delay: 3s; }
.sparkles span:nth-child(4) { left: 62%; animation-duration: 12s; animation-delay: 0.5s; }
.sparkles span:nth-child(5) { left: 78%; animation-duration: 10s; animation-delay: 2s; }
.sparkles span:nth-child(6) { left: 90%; animation-duration: 8.5s; animation-delay: 4s; }

@keyframes float-up {
  0%   { transform: translateY(110vh) rotate(0deg);   opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.6; }
  100% { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

.app {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
}

.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.screen.active {
  display: flex;
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 시작 화면 */
.badge {
  font-family: "Jua", sans-serif;
  font-size: 14px;
  color: var(--pink);
  background: #fff;
  border: 2px dashed var(--pink);
  padding: 8px 18px;
  border-radius: 999px;
  margin-bottom: 20px;
  box-shadow: 0 4px 0 rgba(255, 143, 199, 0.25);
}

h1 {
  font-family: "Jua", sans-serif;
  font-size: 34px;
  margin: 0 0 14px;
  color: var(--purple);
  text-shadow: 2px 2px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff;
}

.deco {
  display: inline-block;
  margin-left: 6px;
  animation: wiggle 2s ease-in-out infinite;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(10deg); }
}

.desc {
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 32px;
  font-size: 17px;
}

.btn-primary, .btn-secondary {
  border: none;
  cursor: pointer;
  font-family: "Jua", sans-serif;
  font-size: 17px;
  padding: 16px 30px;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: 0 6px 0 #d977b3, 0 10px 20px rgba(179, 153, 255, 0.35);
}

.btn-secondary {
  color: var(--purple);
  background: #fff;
  border: 2px solid var(--purple);
  box-shadow: 0 4px 0 rgba(179, 153, 255, 0.35);
}

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

.btn-primary:active, .btn-secondary:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 rgba(179, 153, 255, 0.35);
}

/* 퀴즈 화면 */
.progress-wrap {
  width: 100%;
  margin-bottom: 22px;
}

.progress-bar {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid #f4d9ea;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 10%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink), var(--purple), var(--mint));
  transition: width 0.35s ease;
}

.progress-text {
  margin-top: 8px;
  font-family: "Jua", sans-serif;
  font-size: 14px;
  color: var(--purple);
}

.question-card {
  width: 100%;
  background: var(--card);
  border-radius: var(--radius);
  padding: 30px 24px;
  box-shadow: 0 10px 0 #f4d9ea, 0 16px 30px rgba(179, 153, 255, 0.25);
  border: 2px solid #ffeaf5;
}

.term-wrap {
  display: inline-block;
  margin-bottom: 14px;
}

.term {
  font-family: "Jua", sans-serif;
  font-size: 28px;
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  padding: 10px 22px;
  border-radius: 18px;
  display: inline-block;
}

.question {
  color: var(--muted);
  font-size: 16px;
  margin: 0 0 22px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.option-btn {
  text-align: left;
  padding: 14px 18px;
  border-radius: 16px;
  border: 2px solid #f4e3f0;
  background: #fff8fc;
  color: var(--text);
  font-family: "Gaegu", sans-serif;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

@media (hover: hover) {
  .option-btn:hover:not(:disabled) {
    border-color: var(--purple);
    background: #f5f0ff;
    transform: translateX(3px) scale(1.01);
  }
}

.option-btn:active:not(:disabled) {
  border-color: var(--purple);
  background: #f5f0ff;
  transform: scale(0.98);
}

.option-btn:disabled {
  cursor: default;
  border-color: #f4e3f0;
  background: #fff8fc;
  transform: none;
}

/* 결과 화면 */
.result-emoji {
  font-size: 64px;
  margin-bottom: 6px;
  animation: bounce-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bounce-in {
  0%   { transform: scale(0); }
  70%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.result-grade {
  font-family: "Jua", sans-serif;
  font-size: 28px;
  margin: 0 0 8px;
  color: var(--purple);
}

.result-score {
  font-family: "Jua", sans-serif;
  color: var(--pink);
  margin: 0 0 16px;
  font-size: 16px;
}

.result-desc {
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 30px;
  font-size: 16px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* 토스트 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translate(-50%, 20px);
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  font-family: "Jua", sans-serif;
  font-size: 14px;
  padding: 12px 22px;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(179, 153, 255, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 10;
  max-width: 90vw;
  text-align: center;
}

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