:root {
  --red: #e8365d;
  --red-deep: #b81e45;
  --pink: #ff8fab;
  --blush: #ffe3ea;
  --cream: #fff8f3;
  --gold: #ffb84d;
  --ink: #3d2230;
  --muted: #8a6573;
  --card: #ffffff;
  --line: #f5cfd9;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(184, 30, 69, .12);
  --font-title: "ZCOOL KuaiLe", "Quicksand", sans-serif;
  --font-body: "Quicksand", "Noto Sans TC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.7;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--font-title); font-weight: 400; line-height: 1.25; margin: 0 0 .5em; }
h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); color: var(--red-deep); }
h2::after {
  content: ""; display: block; width: 64px; height: 4px; margin-top: 10px;
  background: repeating-linear-gradient(90deg, var(--red) 0 10px, transparent 10px 16px);
  border-radius: 2px;
}
a { color: var(--red-deep); }
button, input, select, textarea { font: inherit; color: inherit; }

/* Top bar */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  padding: 10px clamp(16px, 4vw, 40px);
  background: rgba(255, 248, 243, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-family: var(--font-title); font-size: 1.3rem; color: var(--red-deep); white-space: nowrap; }
.brand-knot { color: var(--red); animation: beat 1.6s infinite; display: inline-block; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--ink); padding: 6px 12px; border-radius: 99px; font-weight: 500; white-space: nowrap; }
.nav a:hover { background: var(--blush); color: var(--red-deep); }
.lang-btn {
  border: 2px solid var(--red); background: #fff; color: var(--red-deep);
  border-radius: 99px; padding: 4px 14px; font-weight: 700; cursor: pointer;
}
.lang-btn:hover { background: var(--red); color: #fff; }
.menu-btn { display: none; margin-left: auto; background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--red-deep); }

/* Hero */
.hero { position: relative; min-height: 100svh; display: grid; align-items: end; overflow: hidden;
  background: linear-gradient(180deg, #2b1640 0%, #7a2f5e 45%, #ff9aa8 80%, #ffd6c9 100%); }
.scene { position: absolute; inset: 0; }
.scene canvas { display: block; width: 100% !important; height: 100% !important; cursor: grab; }
.scene canvas:active { cursor: grabbing; }
.scene.fallback {
  background:
    radial-gradient(circle at 75% 22%, #fff6d8 0 60px, transparent 62px),
    conic-gradient(from 200deg at 50% 100%, #ff6f91, #e8365d, #ff8fab, #e8365d, #ff6f91);
  clip-path: none;
}
.hero::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgba(43,22,64,.55) 0%, rgba(43,22,64,.2) 40%, transparent 60%); }
@media (max-width: 900px) { .hero::after { background: linear-gradient(0deg, rgba(43,22,64,.6) 0%, rgba(43,22,64,.15) 55%, transparent 70%); } }
.hero-text {
  position: relative; z-index: 2; pointer-events: none;
  padding: 0 clamp(16px, 6vw, 80px) clamp(40px, 9vh, 90px);
  max-width: 640px; color: #fff;
  text-shadow: 0 2px 16px rgba(60, 10, 40, .45);
}
.hero-text a, .hero-text button { pointer-events: auto; }
.hero h1 { font-size: clamp(2.6rem, 8vw, 4.6rem); margin-bottom: .2em; }
.eyebrow { display: inline-block; margin: 0 0 8px; padding: 4px 14px; border-radius: 99px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.4); font-weight: 700; letter-spacing: .1em; }
.lead { font-size: 1.15rem; margin: 0 0 24px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hint { font-size: .85rem; opacity: .85; margin-top: 18px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 26px; border-radius: 99px; border: 0; cursor: pointer;
  font-weight: 700; text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: linear-gradient(135deg, var(--red), #ff6f91); color: #fff; box-shadow: 0 6px 18px rgba(232, 54, 93, .35); }
.btn-primary:hover { box-shadow: 0 8px 24px rgba(232, 54, 93, .5); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.btn-ghost { background: rgba(255,255,255,.2); color: #fff; border: 2px solid #fff; }
.btn-ghost:hover { background: #fff; color: var(--red-deep); text-shadow: none; }
.btn-small { padding: 6px 14px; font-size: .9rem; }

/* Sections */
.section { padding: clamp(64px, 10vw, 110px) 16px; position: relative; }
.section-alt { background: var(--blush);
  background-image: radial-gradient(rgba(232,54,93,.08) 1.5px, transparent 1.5px);
  background-size: 22px 22px; }
.wrap { max-width: 1100px; margin: 0 auto; }
.sub { color: var(--muted); max-width: 680px; margin: 0 0 32px; }
.two-col { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }

/* About facts */
.facts { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.facts li {
  background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 2px;
  clip-path: polygon(0 8%, 8% 0, 100% 0, 100% 92%, 92% 100%, 0 100%);
}
.facts li span:last-child { color: var(--muted); font-size: .92rem; }
.fact-ico { font-size: 1.8rem; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: s; }
.steps li { background: var(--card); border-radius: var(--radius); padding: 24px 20px 20px; box-shadow: var(--shadow); position: relative; transition: transform .2s; }
.steps li:hover { transform: translateY(-4px) rotate(-.5deg); }
.steps h3 { color: var(--red-deep); font-size: 1.35rem; margin-top: 8px; }
.steps p { margin: 0; color: var(--muted); }
.step-n {
  display: grid; place-items: center; width: 42px; height: 42px; color: #fff; font-weight: 700;
  background: linear-gradient(135deg, var(--red), var(--gold));
  clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%);
}
.note { margin-top: 26px; padding: 16px 20px; border-radius: var(--radius); background: #fff; border: 2px dashed var(--pink); display: flex; gap: 10px; flex-wrap: wrap; }

/* Fortune */
.fortune { display: grid; grid-template-columns: 280px 1fr; gap: 32px; align-items: center; }
.fortune-stage { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.tube { width: 180px; height: auto; filter: drop-shadow(0 12px 18px rgba(184,30,69,.25)); transform-origin: 50% 90%; }
.tube.shaking { animation: shake .12s linear infinite alternate; }
.tube.picked #pickedStick { opacity: 1; animation: rise .6s ease-out forwards; }
.fortune-result {
  min-height: 300px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 28px; position: relative; overflow: hidden;
  border: 2px solid var(--line);
}
.fortune-result::before {
  content: ""; position: absolute; inset: 10px; border: 1px dashed var(--pink); border-radius: 12px; pointer-events: none;
}
.placeholder { color: var(--muted); text-align: center; margin-top: 100px; }
.lot-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.lot-no { font-family: var(--font-title); font-size: 1.6rem; color: var(--red-deep); }
.lot-badge { padding: 2px 12px; border-radius: 99px; color: #fff; font-weight: 700; font-size: .9rem; }
.lot-badge.great { background: var(--red); }
.lot-badge.good { background: #ff7a59; }
.lot-badge.mid { background: #d79a2b; }
.lot-poem { font-family: var(--font-title); font-size: 1.35rem; color: var(--ink); line-height: 1.9; margin: 0 0 6px; white-space: pre-line; }
.lot-poem-en { font-style: italic; color: var(--muted); margin: 0 0 14px; white-space: pre-line; }
.lot-meaning { margin: 0 0 8px; }
.lot-meaning b { color: var(--red-deep); }
.jiao { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; margin-top: 10px; }
.jiao-blocks { display: flex; gap: 14px; font-size: 2.2rem; height: 50px; }
.jiao-block { display: inline-block; width: 46px; height: 26px; border-radius: 50% 50% 8px 8px; background: var(--red); position: relative; }
.jiao-block.flat { border-radius: 8px 8px 50% 50%; background: #ff9aa8; }
.jiao-block.toss { animation: toss .6s ease-out; }
.jiao-msg { font-weight: 700; color: var(--red-deep); }

/* Forms */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.form { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: .92rem; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
input:not([type=checkbox]), select, textarea {
  border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--cream); font-weight: 500; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pink); background: #fff; }
textarea { resize: vertical; }
.form .check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--red); }
.socials { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 14px; border-radius: 14px; background: var(--blush); }
.socials[hidden] { display: none; }
.socials-label { grid-column: 1 / -1; margin: 0; font-weight: 700; font-size: .9rem; color: var(--red-deep); }
.form .social { flex-direction: row; align-items: center; gap: 8px; }
.sico { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: #fff; font-weight: 700; font-family: system-ui, sans-serif; }
.sico.fb { background: #1877f2; }
.sico.ig { background: linear-gradient(45deg, #f9a03f, #d62976, #962fbf); }
.sico.x { background: #111; }
.form-wrap { padding: 0; margin-bottom: 8px; }
.form-wrap summary { list-style: none; margin: 20px; }
.form-wrap summary::-webkit-details-marker { display: none; }
.form-wrap[open] summary { background: var(--blush); color: var(--red-deep); box-shadow: none; }
.form-wrap form { padding-top: 0; }

/* Toolbar */
.toolbar { margin: 28px 0 18px; display: flex; gap: 12px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 2px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 14px; cursor: pointer; font-weight: 700; font-size: .9rem; }
.chip.active, .chip:hover { border-color: var(--red); background: var(--red); color: #fff; }
.search { max-width: 360px; }

/* Wish cards (hanging plaques) */
.wish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 28px 18px; padding-top: 18px; }
.wish {
  position: relative; background: #fff; padding: 22px 18px 16px; border-radius: 14px;
  box-shadow: var(--shadow); transform: rotate(var(--tilt, 0deg)); transform-origin: 50% -18px;
  transition: transform .3s;
  border-top: 6px solid var(--c, var(--red));
  animation: drop .5s ease-out both;
}
.wish:hover { transform: rotate(0deg) scale(1.02); }
.wish::before { /* thread */
  content: ""; position: absolute; left: 50%; top: -26px; width: 2px; height: 22px; background: var(--red);
}
.wish::after { /* knot */
  content: ""; position: absolute; left: calc(50% - 5px); top: -30px; width: 10px; height: 10px; border-radius: 50%; background: var(--red);
}
.wish[data-cat=together] { --c: #ff7a59; }
.wish[data-cat=reunite] { --c: #a66cff; }
.wish[data-cat=thanks] { --c: var(--gold); }
.wish-tag { font-size: .78rem; font-weight: 700; color: var(--c, var(--red)); }
.wish-text { margin: 6px 0 10px; word-break: break-word; }
.wish-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.wish-name { font-weight: 700; color: var(--ink); }
.thread-badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--blush); color: var(--red-deep); }
.links { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.links a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: .82rem; font-weight: 700;
  padding: 3px 10px 3px 3px; border-radius: 99px; background: var(--cream); color: var(--ink); border: 1px solid var(--line); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.links a:hover { border-color: var(--red); }
.links .sico { width: 22px; height: 22px; border-radius: 50%; font-size: .72rem; }
.actions { display: flex; gap: 4px; }
.icon-btn { background: none; border: 0; cursor: pointer; padding: 2px 6px; border-radius: 8px; font-size: .85rem; color: var(--muted); }
.icon-btn:hover { background: var(--blush); color: var(--red-deep); }
.icon-btn.liked { color: var(--red); }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 30px; }

/* Match cards */
.match-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.mcard { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; animation: drop .5s ease-out both; display: flex; flex-direction: column; }
.mcard-top { height: 74px; position: relative; background: linear-gradient(135deg, var(--h1, #ff8fab), var(--h2, #e8365d)); }
.mcard-top::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,.25) 0 30%, transparent 30% 55%, rgba(0,0,0,.08) 55% 70%, transparent 70%); }
.avatar { position: absolute; left: 18px; bottom: -26px; z-index: 1; width: 56px; height: 56px; display: grid; place-items: center;
  font-family: var(--font-title); font-size: 1.5rem; color: #fff; background: var(--red-deep); border: 4px solid #fff;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.mcard-body { padding: 32px 18px 16px; flex: 1; display: flex; flex-direction: column; }
.mcard h3 { font-size: 1.25rem; margin: 0; color: var(--ink); }
.mcard .city { font-size: .85rem; color: var(--muted); }
.mcard p { margin: 8px 0; word-break: break-word; }
.mcard .looking { font-size: .9rem; color: var(--muted); }
.mcard .wish-foot { margin-top: auto; }

.safety { margin-top: 28px; font-size: .9rem; color: var(--muted); background: #fff; padding: 14px 18px; border-radius: 14px; border-left: 4px solid var(--gold); }

/* Visit */
.info { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; margin: 0; }
.info dt { font-weight: 700; color: var(--red-deep); }
.info dd { margin: 0; }
.moon-card { text-align: center; padding: 40px 20px; border-radius: var(--radius);
  background: linear-gradient(180deg, #2b1640, #7a2f5e); color: #fff; font-family: var(--font-title); font-size: 1.4rem; box-shadow: var(--shadow); }
.moon { width: 120px; height: 120px; margin: 0 auto 20px; background: #fff3c4;
  clip-path: polygon(50% 0, 80% 10%, 100% 38%, 95% 72%, 72% 96%, 35% 98%, 8% 78%, 0 45%, 15% 14%);
  box-shadow: 0 0 60px #fff3c4; animation: float 5s ease-in-out infinite; }

.footer { text-align: center; padding: 30px 16px; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 120px); background: var(--ink); color: #fff;
  padding: 10px 22px; border-radius: 99px; z-index: 100; transition: transform .3s; max-width: calc(100% - 32px); text-align: center; }
.toast.show { transform: translate(-50%, 0); }

/* Floating hearts when posting */
.heart-pop { position: fixed; pointer-events: none; z-index: 90; font-size: 1.4rem; animation: popUp 1.2s ease-out forwards; }

@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.25); } 30% { transform: scale(1); } }
@keyframes shake { from { transform: rotate(-9deg); } to { transform: rotate(9deg); } }
@keyframes rise { from { transform: translateY(0); } to { transform: translateY(-34px); } }
@keyframes toss { 0% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-40px) rotate(360deg); } 100% { transform: translateY(0) rotate(720deg); } }
@keyframes drop { from { opacity: 0; transform: translateY(-14px) rotate(var(--tilt, 0deg)); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes popUp { to { transform: translateY(-120px) scale(1.4); opacity: 0; } }

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

/* Responsive */
@media (max-width: 900px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .two-col, .fortune { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; padding: 10px 16px 16px;
    background: var(--cream); border-bottom: 1px solid var(--line); }
  .nav.open { display: flex; }
  .lang-btn { margin-left: 0; }
}
@media (max-width: 560px) {
  .steps, .facts, .form .row, .socials { grid-template-columns: 1fr; }
  .form { padding: 18px; }
  .brand span:last-child { font-size: 1.1rem; }
}
