/* ==========================================================
   薰風雅聚｜2026 Curves 策略工作坊
   配色：薰風（Lavender Breeze）× 雅聚（Coral Peach）
   ========================================================== */

:root {
  /* 與主視覺一致的色票：粉 → 薰衣草 → 蜜桃 */
  --c-bg-pink:    #F5D5E0;
  --c-bg-lilac:   #C9B8DC;
  --c-bg-mauve:   #D5BAD0;
  --c-bg-peach:   #F5D0BC;
  --c-cream:      #FFFBF8;
  --c-coral:      #E96A7A;
  --c-coral-deep: #C94A60;
  --c-coral-light:#FFB6B6;
  --c-lilac:      #A88FBE;
  --c-lilac-deep: #7E62A0;
  --c-peach:      #F5C6A8;
  --c-gold:       #D4A574;
  --c-gold-deep:  #B68651;
  --c-plum:       #4A3756;
  --c-plum-soft:  #7E6A8A;
  --c-line:       rgba(74, 55, 86, 0.12);
  --c-shadow:     0 18px 40px -18px rgba(126, 98, 160, 0.35);
  --c-shadow-soft:0 8px 24px -10px rgba(74, 55, 86, 0.18);

  --font-serif: 'Noto Serif TC', 'Songti TC', 'PingFang TC', serif;
  --font-sans:  'Noto Sans TC', 'PingFang TC', system-ui, -apple-system, sans-serif;

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-pill: 999px;
}

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

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--c-plum);
  background:
    radial-gradient(ellipse at 0% 10%, rgba(245, 213, 224, 0.85) 0%, transparent 55%),
    radial-gradient(ellipse at 100% 20%, rgba(245, 208, 188, 0.75) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(201, 184, 220, 0.7) 0%, transparent 60%),
    linear-gradient(135deg, var(--c-bg-pink) 0%, var(--c-bg-lilac) 50%, var(--c-bg-peach) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ----- 背景花瓣裝飾 ----- */
.bg-decoration {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.petal {
  position: absolute;
  width: 18px;
  height: 18px;
  background: radial-gradient(circle at 30% 30%, #F5DCEB, #D4B8E0 70%, transparent 72%);
  border-radius: 60% 40% 60% 40% / 50% 60% 40% 50%;
  opacity: 0.55;
  filter: blur(0.3px);
  animation: float 14s ease-in-out infinite;
}
.petal-2, .petal-4 {
  background: radial-gradient(circle at 30% 30%, #FCE0D2, #F5C4A8 70%, transparent 72%);
}
.petal-3, .petal-6 {
  background: radial-gradient(circle at 30% 30%, #E8D4F0, #B89FD2 70%, transparent 72%);
}
.petal-1 { top: 8%;  left: 6%;  width: 22px; height: 22px; animation-delay: 0s; }
.petal-2 { top: 20%; right: 8%; width: 14px; height: 14px; animation-delay: 2.5s; opacity: .45; }
.petal-3 { top: 48%; left: 4%;  width: 16px; height: 16px; animation-delay: 5s; opacity: .5; }
.petal-4 { top: 60%; right: 10%; width: 24px; height: 24px; animation-delay: 7s; }
.petal-5 { top: 80%; left: 12%; width: 12px; height: 12px; animation-delay: 9s; opacity: .4; }
.petal-6 { top: 90%; right: 18%; width: 18px; height: 18px; animation-delay: 11s; }

@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0) rotate(0deg); }
  25%      { transform: translateY(-18px) translateX(10px) rotate(45deg); }
  50%      { transform: translateY(-6px) translateX(-12px) rotate(90deg); }
  75%      { transform: translateY(-24px) translateX(6px) rotate(135deg); }
}

/* ----- App 容器 ----- */
.app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

/* ----- Hero ----- */
.hero {
  text-align: center;
  padding: 8px 0 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  letter-spacing: 0.32em;
  font-size: 11px;
  color: var(--c-coral-deep);
  font-weight: 600;
}
.brand-line {
  width: 28px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-coral) 80%);
}
.brand-line:last-child {
  background: linear-gradient(90deg, var(--c-coral) 20%, transparent);
}

.title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.15;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.title-zh {
  font-size: 44px;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, #C94A60 0%, #B57AAA 45%, #7E62A0 75%, #C58866 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 14px rgba(126, 98, 160, 0.2);
}
.title-sub {
  font-size: 15px;
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--c-plum-soft);
}

.subtitle {
  margin: 14px 0 0;
  font-size: 13px;
  letter-spacing: 0.4em;
  color: var(--c-plum-soft);
  font-weight: 500;
}

/* ----- 步驟 ----- */
.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 8px auto 28px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-pill);
  box-shadow: var(--c-shadow-soft);
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.4;
  transition: opacity .3s ease;
}
.step.active   { opacity: 1; }
.step.complete { opacity: 1; }
.step-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  background: linear-gradient(135deg, var(--c-coral), var(--c-coral-deep));
  color: #fff;
  box-shadow: 0 4px 10px -4px var(--c-coral);
}
.step.complete .step-num {
  background: linear-gradient(135deg, var(--c-lilac), var(--c-lilac-deep));
  box-shadow: 0 4px 10px -4px var(--c-lilac-deep);
}
.step-label {
  font-size: 12px;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--c-plum);
}
.step-divider {
  width: 18px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-line), transparent);
}

/* ----- Card 通用 ----- */
.card {
  position: relative;
  background: var(--c-cream);
  border-radius: var(--radius-lg);
  padding: 32px 24px 26px;
  box-shadow: var(--c-shadow);
  border: 1px solid rgba(255, 255, 255, 0.9);
  margin-bottom: 22px;
  overflow: hidden;
  animation: cardIn .6s cubic-bezier(0.22, 1, 0.36, 1);
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 0% 0%, rgba(245, 213, 224, 0.45), transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(201, 184, 220, 0.35), transparent 45%);
  pointer-events: none;
}
@keyframes cardIn {
  0%   { opacity: 0; transform: translateY(20px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.card-icon {
  width: 56px; height: 56px;
  border-radius: 18px;
  display: grid; place-items: center;
  margin: 0 auto 18px;
  background: linear-gradient(135deg, #F5DCEB, #D4B8E0);
  color: var(--c-lilac-deep);
  box-shadow: 0 8px 18px -8px rgba(126, 98, 160, 0.45);
  position: relative;
}
.card-icon svg { width: 28px; height: 28px; }

.card-title {
  margin: 0 0 12px;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--c-plum);
}
.card-desc {
  margin: 0 0 22px;
  text-align: center;
  font-size: 14px;
  line-height: 1.85;
  color: var(--c-plum-soft);
  letter-spacing: 0.02em;
}
.card-desc strong {
  color: var(--c-coral-deep);
  font-weight: 700;
}

/* ----- 表單欄位 ----- */
.field {
  position: relative;
  z-index: 1;
  margin-bottom: 18px;
}
.field-label {
  display: block;
  margin-bottom: 8px;
  padding-left: 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--c-plum);
}
.field-label .required {
  color: var(--c-coral);
  margin-left: 2px;
}
.field-input {
  display: block;
  width: 100%;
  padding: 14px 18px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  color: var(--c-plum);
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid var(--c-line);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
  -webkit-appearance: none;
  appearance: none;
  letter-spacing: 0.04em;
}
.field-input::placeholder {
  color: rgba(139, 107, 122, 0.5);
  font-weight: 400;
}
.field-input:hover {
  border-color: var(--c-coral-light);
}
.field-input:focus {
  border-color: var(--c-coral);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(233, 106, 122, 0.12);
}
.field-input.is-valid {
  border-color: var(--c-gold);
  background: linear-gradient(135deg, #fff, #FFF8EE);
}
.field-hint {
  margin: 8px 4px 0;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--c-plum-soft);
}
.field-input.shake {
  animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
  border-color: var(--c-coral);
}
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}

/* ----- 按鈕 ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 20px;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .25s ease, opacity .2s ease;
  position: relative;
  z-index: 1;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #E96A7A 0%, #C94A60 100%);
  box-shadow: 0 12px 24px -10px rgba(201, 74, 96, 0.6),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-primary:hover { box-shadow: 0 16px 30px -10px rgba(201, 74, 96, 0.7); }

.btn-secondary {
  color: var(--c-coral-deep);
  background: rgba(255, 255, 255, 0.8);
  border: 1.5px solid var(--c-coral-light);
  box-shadow: var(--c-shadow-soft);
  margin-top: 14px;
}

.btn-ghost {
  color: var(--c-plum-soft);
  background: transparent;
  border: 1.5px dashed var(--c-line);
  margin-top: 14px;
}
.btn-ghost:not(:disabled) {
  color: var(--c-coral-deep);
  border-color: var(--c-coral-light);
  border-style: solid;
  background: rgba(255, 235, 235, 0.5);
}
.btn:disabled,
.btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  pointer-events: none;
}

.form-hint {
  margin: 12px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--c-plum-soft);
  letter-spacing: 0.05em;
}

/* ----- 刮刮卡 ----- */
.card-scratch { padding-top: 38px; }

.ribbon {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--c-lilac), var(--c-lilac-deep));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3em;
  padding: 6px 22px;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 6px 14px -6px rgba(126, 98, 160, 0.6);
}

.scratch-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1.6 / 1;
  margin: 18px 0 8px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(135deg, #FFFBF8, #F8EFF5);
  box-shadow:
    inset 0 0 0 2px rgba(168, 143, 190, 0.35),
    inset 0 0 0 6px rgba(255, 255, 255, 0.85),
    inset 0 0 0 7px rgba(168, 143, 190, 0.25),
    0 8px 18px -8px rgba(74, 55, 86, 0.18);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.scratch-result {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  gap: 8px;
}

.scratch-result .result-emoji {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 4px;
  filter: drop-shadow(0 4px 10px rgba(201, 74, 96, 0.25));
}
.scratch-result .result-title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.15em;
  color: var(--c-coral-deep);
}
.scratch-result .result-title.is-lose {
  color: var(--c-plum-soft);
  letter-spacing: 0.2em;
}
.scratch-result .result-sub {
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--c-plum-soft);
}

.scratch-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}
.scratch-canvas:active { cursor: grabbing; }

.scratch-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-pill);
  color: var(--c-plum-soft);
  font-size: 12px;
  letter-spacing: 0.1em;
  font-weight: 600;
  pointer-events: none;
  box-shadow: 0 4px 12px -4px rgba(90, 58, 77, 0.2);
  animation: hintPulse 2s ease-in-out infinite;
  z-index: 2;
}
@keyframes hintPulse {
  0%, 100% { opacity: 0.85; transform: translate(-50%, 0); }
  50%      { opacity: 1; transform: translate(-50%, -3px); }
}
.scratch-hint.hidden { display: none; }

/* ----- Modal ----- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal.hidden { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(74, 44, 64, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: var(--c-cream);
  border-radius: var(--radius-lg);
  padding: 32px 26px 28px;
  text-align: center;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.4);
  animation: modalIn .5s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}
@keyframes modalIn {
  0%   { opacity: 0; transform: translateY(20px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-decor {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(245, 198, 168, 0.14) 30deg,
    transparent 60deg,
    rgba(232, 164, 189, 0.14) 90deg,
    transparent 120deg,
    rgba(168, 143, 190, 0.14) 150deg,
    transparent 180deg,
    rgba(245, 198, 168, 0.14) 210deg,
    transparent 240deg,
    rgba(232, 164, 189, 0.14) 270deg,
    transparent 300deg,
    rgba(168, 143, 190, 0.14) 330deg,
    transparent 360deg
  );
  animation: spin 12s linear infinite;
  pointer-events: none;
}
.modal-card.is-lose .modal-decor { display: none; }
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.modal-icon {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 12px;
  filter: drop-shadow(0 8px 16px rgba(201, 74, 96, 0.3));
  position: relative;
}

.modal-title {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: var(--c-coral-deep);
  position: relative;
  line-height: 1.4;
}
.modal-card.is-lose .modal-title {
  color: var(--c-plum-soft);
  letter-spacing: 0.2em;
}
.modal-title .modal-name {
  display: inline-block;
  margin: 0 4px;
  padding: 2px 12px;
  background: linear-gradient(135deg, #F5DCEB, #E8C4D8 50%, #FCE0D2);
  border-radius: var(--radius-pill);
  font-size: 22px;
  letter-spacing: 0.08em;
  color: var(--c-lilac-deep);
  box-shadow: inset 0 -2px 0 rgba(126, 98, 160, 0.3);
  vertical-align: 0;
  max-width: 100%;
  word-break: break-all;
}
.modal-card.is-lose .modal-title .modal-name {
  background: linear-gradient(135deg, #F0E6EE, #E5D5E0);
  color: var(--c-plum);
  box-shadow: inset 0 -2px 0 rgba(126, 106, 138, 0.3);
}

.modal-desc {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--c-plum-soft);
  position: relative;
  letter-spacing: 0.04em;
}

.modal-serial {
  display: inline-block;
  margin: 0 auto 20px;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #F5E5F0, #EAD5DA);
  border: 1px dashed var(--c-lilac);
  color: var(--c-lilac-deep);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  position: relative;
}
.modal-serial.hidden { display: none; }

.modal-btn { position: relative; }

/* ----- Confetti ----- */
.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99;
}

/* ----- 共用 ----- */
.hidden { display: none !important; }

/* ----- Footer ----- */
.footer {
  text-align: center;
  margin-top: 36px;
  padding: 20px 0 10px;
  border-top: 1px dashed var(--c-line);
}
.footer-brand {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4em;
  color: var(--c-coral-deep);
}
.footer-text {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--c-plum-soft);
}

/* ----- 響應式微調 ----- */
@media (max-width: 360px) {
  .title-zh { font-size: 38px; }
  .title-sub { font-size: 13px; letter-spacing: 0.16em; }
  .card { padding: 28px 20px 22px; }
  .step-label { font-size: 11px; }
  .scratch-result .result-title { font-size: 22px; }
}

@media (min-width: 481px) {
  .app { padding-top: 40px; }
}

/* ----- Reduce motion ----- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
