/* 禮尚網來・聖誕交換禮物趴｜白銀主題
   參考：留白多、柔和陰影、膠囊按鈕、襯線大標、積雪邊。紅綠金只當點綴色 */
:root {
  /* 銀白 */
  --white: #ffffff;
  --snow: #f7f8fa;
  --silver-50: #f2f4f7;
  --silver-100: #e8ebf0;
  --silver-200: #d9dee6;
  --silver-300: #c3cad6;
  --silver-500: #8a94a6;
  --silver-700: #5b6475;
  --ink: #1f2430;
  /* 點綴 */
  --red: #d93a47;
  --red-dark: #b42634;
  --red-soft: #fbe9eb;
  --pine: #2c6b4e;
  --pine-soft: #e6f1ec;
  --gold: #c9a961;
  --gold-soft: #f7f0de;
  /* 舊名稱沿用，其他頁面還在用 */
  --green: var(--pine);
  --pine-dark: #1e4d38;
  --gold-dark: #a8873f;
  --cream: var(--snow);
  --night: #1d3557;
  --silver: var(--silver-300);
  --silver-light: var(--silver-50);
  --silver-dark: var(--silver-500);
  --frost: linear-gradient(145deg, #ffffff 0%, #eef1f5 55%, #ffffff 100%);
  --metal: linear-gradient(135deg, #fdfdfe 0%, #e3e7ee 38%, #f7f8fa 62%, #d6dbe4 100%);
  --muted: var(--silver-700);
  --radius: 22px;
  --shadow: 0 10px 30px rgba(31, 36, 48, 0.07), 0 2px 6px rgba(31, 36, 48, 0.04);
  --shadow-lg: 0 20px 50px rgba(31, 36, 48, 0.12);
  --font: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", "Heiti TC", system-ui, sans-serif;
  --serif: "Noto Serif TC", "Source Han Serif TC", "Songti TC", "PMingLiU", "MingLiU", Georgia, serif;
  --snowcap: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 30' preserveAspectRatio='none'%3E%3Cpath fill='white' d='M0 0h600v10c-14 0-16 14-30 14s-12-9-26-9-14 13-30 13-12-11-26-11-16 15-32 15-13-10-28-10-14 8-28 8-15-12-30-12-16 16-32 16-12-13-27-13-14 10-29 10-15-9-30-9-14 14-30 14-14-11-28-11-15 9-30 9-14-13-29-13-15 15-31 15-13-8-27-8-15 12-30 12-15-10-30-10-16 13-31 13-13-12-28-12-13 8-28 8Z'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  line-height: 1.6;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(201, 169, 97, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(195, 202, 214, 0.35), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, var(--snow) 40%, #eef1f5 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

#snow { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.page { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 0 16px 72px; }

h1, h2, h3, .serif { font-family: var(--serif); letter-spacing: 0.02em; }

/* 燈串：細一點、低調一點 */
.lights { display: flex; justify-content: space-around; height: 22px; position: relative; z-index: 2; pointer-events: none; }
.lights::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; border-top: 1.5px solid var(--silver-300); }
.lights i { width: 8px; height: 12px; border-radius: 50%; margin-top: 4px; animation: twinkle 2.2s infinite; }
.lights i:nth-child(4n + 1) { background: var(--red); color: var(--red); }
.lights i:nth-child(4n + 2) { background: var(--gold); color: var(--gold); animation-delay: 0.5s; }
.lights i:nth-child(4n + 3) { background: #b8c6dc; color: #b8c6dc; animation-delay: 1s; }
.lights i:nth-child(4n + 4) { background: var(--pine); color: var(--pine); animation-delay: 1.5s; }
@keyframes twinkle { 0%, 100% { opacity: 1; box-shadow: 0 0 8px 1px currentColor; } 50% { opacity: 0.4; box-shadow: none; } }

/* 頂部列：半透明毛玻璃 */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; margin: 0 -16px; background: rgba(255, 255, 255, 0.78); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(195, 202, 214, 0.5); flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--serif); font-weight: 700; font-size: 20px; text-decoration: none; color: var(--ink); letter-spacing: 0.04em; }
.brand em { font-style: normal; color: var(--red); }
.brand .sub { font-family: var(--font); font-size: 13px; font-weight: 600; color: var(--silver-700); letter-spacing: .06em; padding-left: 10px; margin-left: 2px; border-left: 1px solid var(--silver-200); }
@media (max-width: 420px) { .brand .sub { display: none; } }
.brand svg { flex: none; }
.who { font-size: 14px; color: var(--silver-700); display: flex; gap: 12px; align-items: center; }
.who .linkbtn { color: var(--silver-500); text-decoration: none; border: 1px solid var(--silver-200); padding: 4px 12px; border-radius: 999px; font-size: 13px; }
.who .linkbtn:hover { color: var(--red); border-color: var(--red); }
.nav { display: flex; gap: 6px; margin: 18px 0 8px; padding: 5px; background: var(--white); border: 1px solid var(--silver-100); border-radius: 999px; box-shadow: var(--shadow); }
.nav a {
  flex: 1; text-align: center; padding: 10px 8px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 15px;
  color: var(--silver-700); transition: 0.2s; min-width: 0; white-space: nowrap;
}
.nav a:hover { color: var(--ink); background: var(--silver-50); }
.nav a.active { background: var(--red); color: #fff; box-shadow: 0 6px 16px rgba(217, 58, 71, 0.28); }
.nav a.disabled { opacity: 0.4; pointer-events: none; }

/* 卡片 */
.card {
  position: relative; background: var(--white); border-radius: var(--radius); padding: 28px 24px; margin: 18px 0;
  box-shadow: var(--shadow); border: 1px solid var(--silver-100);
}
/* 主卡片：頂端一條金屬緞帶，取代原本的拐杖糖邊框 */
.card.candy { padding-top: 34px; overflow: hidden; }
.card.candy::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px;
  background: linear-gradient(90deg, var(--red) 0 33%, var(--gold) 33% 66%, var(--pine) 66% 100%);
}
.card.candy::after { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 12px; background: var(--snowcap) top / 100% 100% no-repeat; filter: drop-shadow(0 1px 0 var(--silver-100)); }
.card h2 { margin: 0 0 10px; font-size: 26px; font-weight: 700; color: var(--ink); line-height: 1.35; }
.card h2 em { font-style: normal; color: var(--red); }
.card p { line-height: 1.75; margin: 6px 0; }
.muted { color: var(--silver-700); font-size: 14px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.18em; color: var(--gold-dark); text-transform: uppercase; }
.eyebrow::before { content: ""; width: 24px; height: 1.5px; background: currentColor; }

.reindeer svg { display: block; filter: drop-shadow(0 6px 10px rgba(31, 36, 48, 0.12)); }
.reindeer .nose { animation: nose 1.6s ease-in-out infinite; }
@keyframes nose { 0%, 100% { filter: drop-shadow(0 0 2px #ff4d5a); } 50% { filter: drop-shadow(0 0 9px #ff4d5a); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-8px) rotate(3deg); } }

/* 表單 */
label { display: block; font-weight: 700; font-size: 14px; color: var(--silver-700); margin: 16px 0 6px; }
input[type="text"], input[type="password"], input[type="datetime-local"], select {
  width: 100%; font: inherit; font-size: 16px; padding: 13px 16px; border-radius: 14px; border: 1px solid var(--silver-200); background: var(--silver-50);
  color: var(--ink); outline: none; transition: 0.15s;
}
input::placeholder { color: var(--silver-500); }
input:focus, select:focus { border-color: var(--silver-500); background: #fff; box-shadow: 0 0 0 4px rgba(195, 202, 214, 0.45); }

/* 按鈕：膠囊、柔和陰影 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; font-size: 16px; letter-spacing: 0.03em;
  padding: 14px 30px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; color: #fff; background: var(--red);
  box-shadow: 0 10px 22px rgba(217, 58, 71, 0.25); transition: transform 0.15s, box-shadow 0.15s, background 0.15s; text-decoration: none;
}
.btn:hover { transform: translateY(-2px); background: var(--red-dark); box-shadow: 0 14px 28px rgba(217, 58, 71, 0.3); }
.btn:active { transform: translateY(1px); box-shadow: 0 4px 10px rgba(217, 58, 71, 0.25); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.block { width: 100%; }
.btn.green { background: var(--pine); box-shadow: 0 10px 22px rgba(44, 107, 78, 0.22); }
.btn.green:hover { background: var(--pine-dark); }
.btn.gold { background: linear-gradient(135deg, #e3cb8d, var(--gold) 55%, #b8964c); color: #3a2d0c; box-shadow: 0 10px 22px rgba(169, 135, 63, 0.28); }
.btn.gold:hover { background: linear-gradient(135deg, #d9bf7d, #b8964c); }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--silver-200); box-shadow: 0 4px 12px rgba(31, 36, 48, 0.05); }
.btn.ghost:hover { border-color: var(--red); color: var(--red); background: #fff; }
.btn.silver { background: var(--metal); color: var(--ink); border-color: var(--silver-200); box-shadow: 0 8px 18px rgba(31, 36, 48, 0.08); }
.btn.small { font-size: 14px; padding: 8px 16px; box-shadow: 0 4px 10px rgba(217, 58, 71, 0.18); }
.btn.small.green { box-shadow: 0 4px 10px rgba(44, 107, 78, 0.18); }
.btn.small.ghost { box-shadow: none; }
.linkbtn { background: none; border: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }

.error { color: var(--red-dark); font-weight: 600; font-size: 14px; min-height: 1.4em; margin: 10px 0 0; }
.badge { display: inline-flex; align-items: center; gap: 4px; background: var(--gold-soft); color: #7a5f1f; font-weight: 700; padding: 6px 14px; border-radius: 999px; font-size: 14px; border: 1px solid #ecdfba; }
.badge.red { background: var(--red-soft); color: var(--red-dark); border-color: #f4cdd1; }
.badge.green { background: var(--pine-soft); color: var(--pine); border-color: #cfe3d9; }

/* 分頁切換 */
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--silver-50); border: 1px solid var(--silver-100); border-radius: 999px; padding: 5px; margin: 16px 0; }
.tabs button { font: inherit; font-weight: 700; font-size: 15px; padding: 11px 8px; border: none; border-radius: 999px; background: transparent; cursor: pointer; color: var(--silver-700); transition: 0.2s; }
.tabs button.active { background: #fff; color: var(--red); box-shadow: 0 4px 14px rgba(31, 36, 48, 0.1); }

/* 畫板 */
.canvas-wrap { position: relative; width: 100%; aspect-ratio: 1; border-radius: 18px; overflow: hidden; border: 1.5px dashed var(--silver-300); background: #fff; touch-action: none; }
.canvas-wrap canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--silver-200); cursor: pointer; padding: 0; transition: 0.15s; }
.swatch.active { box-shadow: 0 0 0 2px var(--ink); transform: scale(1.1); }
.tool { font: inherit; font-size: 13px; font-weight: 700; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--silver-200); background: #fff; cursor: pointer; color: var(--silver-700); }
.tool.active { border-color: var(--ink); background: var(--ink); color: #fff; }
.sizes { display: flex; gap: 6px; }

.kw-grid { display: grid; gap: 10px; }
.kw-grid .kw { position: relative; }
.kw-grid .kw span { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-family: var(--serif); font-weight: 700; color: var(--gold-dark); }
.kw-grid .kw input { padding-left: 42px; }

/* 願望展示 */
.wish-view { text-align: center; }
.wish-view img { width: min(100%, 360px); border-radius: 18px; border: 1px solid var(--silver-100); background: #fff; box-shadow: var(--shadow); }
.wish-no { font-family: var(--serif); font-size: 46px; font-weight: 700; color: var(--red); letter-spacing: 0.06em; }
.kw-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 12px 0; }
.kw-chips span { background: var(--pine-soft); color: var(--pine); border: 1px solid #cfe3d9; font-weight: 700; font-size: 19px; padding: 9px 20px; border-radius: 999px; }
.kw-chips span:nth-child(2) { background: var(--red-soft); color: var(--red-dark); border-color: #f4cdd1; }
.kw-chips span:nth-child(3) { background: var(--gold-soft); color: #7a5f1f; border-color: #ecdfba; }

/* 輪盤 */
.wheel-box { position: relative; width: min(100%, 440px); margin: 14px auto; aspect-ratio: 1; }
.wheel-box canvas { width: 100%; height: 100%; display: block; filter: drop-shadow(0 18px 30px rgba(31, 36, 48, 0.18)); }
.wheel-pointer { position: absolute; left: 50%; top: -8px; transform: translateX(-50%); width: 0; height: 0;
  border-left: 18px solid transparent; border-right: 18px solid transparent; border-top: 36px solid var(--red); filter: drop-shadow(0 3px 3px rgba(0,0,0,.2)); z-index: 2; }
.wheel-hub { position: absolute; left: 50%; top: 50%; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: var(--metal); display: grid; place-items: center; font-size: clamp(26px, 7vw, 40px); box-shadow: 0 6px 16px rgba(31,36,48,.2), inset 0 2px 0 #fff; border: 4px solid #fff; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120px); background: var(--ink); color: #fff;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; z-index: 50; transition: 0.3s; max-width: calc(100% - 32px); text-align: center; box-shadow: var(--shadow-lg); }
.toast.show { transform: translateX(-50%) translateY(0); }

/* 倒數：吊掛的聖誕球（參考 ThemeForest 的倒數造型） */
.countdown { display: flex; gap: 10px; justify-content: center; margin: 12px 0; padding-top: 18px; }
.countdown div { position: relative; width: 66px; aspect-ratio: 1; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(circle at 32% 28%, #ffffff 0%, #f2f4f7 45%, #d9dee6 100%); border: 1px solid var(--silver-200);
  box-shadow: inset 0 -6px 12px rgba(138, 148, 166, .25), 0 8px 16px rgba(31, 36, 48, .08); }
.countdown div::before { content: ""; position: absolute; left: 50%; top: -18px; width: 1.5px; height: 14px; background: var(--silver-300); transform: translateX(-50%); }
.countdown div::after { content: ""; position: absolute; left: 50%; top: -6px; width: 14px; height: 7px; border-radius: 3px 3px 1px 1px; transform: translateX(-50%);
  background: linear-gradient(180deg, #e3cb8d, var(--gold)); }
.countdown div:nth-child(even) { margin-top: 8px; }
.countdown b { display: block; font-family: var(--serif); font-size: 24px; line-height: 1.1; color: var(--red); font-variant-numeric: tabular-nums; }
.countdown small { font-size: 10px; color: var(--silver-500); letter-spacing: 0.1em; }

/* 許願聖誕樹卡 */
.tree-card { text-align: center; }
.tree-card .tree-box { width: min(100%, 460px); aspect-ratio: 0.86; margin: 6px auto 0; }
.tree-card .tree-count { font-weight: 700; font-size: 16px; margin: 6px 0 0; color: var(--silver-700); }
.tree-card .tree-count b { font-family: var(--serif); color: var(--red); font-size: 34px; }

/* 卡片小語 */
.santa-line { display: inline-block; margin: 4px 0 12px; padding: 8px 18px; border-radius: 999px; background: var(--gold-soft); color: #7a5f1f; border: 1px solid #ecdfba; font-weight: 600; font-size: 15px; }
.card-note { position: relative; margin: 20px auto 6px; max-width: 420px; padding: 22px 20px 16px; border-radius: 18px; text-align: center;
  background: repeating-linear-gradient(0deg, #fff 0 30px, #eef1f5 30px 31px); border: 1px solid var(--silver-200); box-shadow: var(--shadow); transform: rotate(-.6deg); }
.card-note::before { content: "🎀"; position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 26px; }
.card-note small { display: block; color: var(--gold-dark); font-weight: 700; font-size: 13px; letter-spacing: 0.05em; }
.card-note .line { font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--red-dark); line-height: 1.65; margin: 10px 0 14px; min-height: 1.6em; }
.card-note .line.flip { animation: note-in .45s ease-out; }
@keyframes note-in { from { opacity: 0; transform: translateY(6px); } }
.card-note .acts { display: flex; gap: 8px; justify-content: center; }
.card-note .acts button { font: inherit; font-size: 13px; font-weight: 700; border: 1px solid var(--silver-200); background: #fff; border-radius: 999px; padding: 6px 16px; cursor: pointer; color: var(--silver-700); }
.card-note .acts button:hover { border-color: var(--red); color: var(--red); }

/* 積雪分隔線 */
.snow-divider { height: 26px; background: var(--snowcap) top / 100% 100% no-repeat; filter: drop-shadow(0 4px 4px rgba(31, 36, 48, 0.06)); }

/* 參加者頁面頂部的 Q 版人物卡 */
.me-card { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: center; margin: 16px 0 4px; padding: 14px 22px 10px;
  background: var(--metal); border: 1px solid var(--silver-200); border-radius: var(--radius); box-shadow: var(--shadow); overflow: visible; }
.me-card .me-ava { width: 120px; margin-top: -26px; }
.me-card h2 { margin: 2px 0 4px; font-size: 24px; }
.me-card p { margin: 0; color: var(--silver-700); line-height: 1.7; font-size: 15px; }
.me-card p b { color: var(--red); }
@media (max-width: 480px) { .me-card { grid-template-columns: 96px 1fr; padding: 12px 16px 8px; } .me-card .me-ava { width: 96px; } .me-card h2 { font-size: 20px; } }
.sound-btn { position: absolute; top: 18px; right: 18px; z-index: 3; font: inherit; font-size: 13px; font-weight: 700; color: var(--silver-700);
  background: #fff; border: 1px solid var(--silver-200); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.sound-btn:hover { border-color: var(--red); color: var(--red); }
.center { text-align: center; }
.mt { margin-top: 16px; }
.hidden { display: none !important; }

.pop { animation: pop 0.5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.shake { animation: shake 0.4s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.reveal-up { animation: reveal-up .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes reveal-up { from { opacity: 0; transform: translateY(18px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
