/* 露華閣 — 國風微恐：暗紅帷幔 × 嫁衣朱紅 × 黛青雲肩 × 鳳冠金 */
:root {
  --ink: #0d0507;          /* 近黑暗紅底 */
  --drape: #3a0d11;        /* 帷幔深紅 */
  --drape-2: #21070a;
  --red: #c0392b;          /* 嫁衣朱紅 */
  --red-deep: #8b1a1a;
  --teal: #2e8b8b;         /* 雲肩黛青 */
  --teal-deep: #1f6f6f;
  --gold: #c9a227;         /* 鳳冠金 */
  --gold-soft: #e3c878;
  --pale: #e8d5d0;         /* 亡魂膚色 */
  --paper: #efe3d8;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background:
    radial-gradient(ellipse 80% 55% at 50% -10%, #4a0e12 0%, transparent 60%),
    radial-gradient(ellipse 120% 90% at 50% 115%, #1a0508 0%, transparent 55%),
    var(--ink);
  color: var(--pale);
  font-family: "Noto Serif TC", "PMingLiU", serif;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--gold-soft); }

/* 頂部燭光 */
.lamp-glow {
  position: fixed; top: -60px; left: 50%; transform: translateX(-50%);
  width: 620px; height: 320px; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse at center, rgba(201,162,39,.22), transparent 65%);
  animation: flicker 4.2s ease-in-out infinite;
}
@keyframes flicker {
  0%,100% { opacity: .85; } 42% { opacity: 1; } 46% { opacity: .7; } 60% { opacity: .95; }
}

/* —— 舞台 hero —— */
.stage {
  position: relative; min-height: 88vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 4rem 1rem 3rem;
}
.drapes {
  position: absolute; top: 0; bottom: 0; width: 22vw; max-width: 240px; z-index: 0;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.35) 0 6px, transparent 6px 26px),
    linear-gradient(180deg, var(--drape) 0%, var(--drape-2) 78%, transparent 100%);
  filter: saturate(.9);
  animation: sway 9s ease-in-out infinite alternate;
}
.drape-l { left: 0; border-right: 2px solid rgba(201,162,39,.25); transform-origin: top left; }
.drape-r { right: 0; border-left: 2px solid rgba(201,162,39,.25); transform-origin: top right; animation-delay: -4s; }
@keyframes sway { from { transform: skewY(0deg); } to { transform: skewY(1.1deg); } }

.plaque {
  display: flex; gap: clamp(.6rem, 3vw, 1.4rem); padding: 1.1rem 2.2rem; z-index: 1;
  background: linear-gradient(180deg, #2b090c, #160406);
  border: 2px solid var(--gold);
  border-radius: 8px;
  box-shadow: 0 0 0 4px #160406, 0 0 40px rgba(201,162,39,.35), inset 0 0 30px rgba(0,0,0,.8);
}
.plaque-char {
  font-family: "Ma Shan Zheng", "Noto Serif TC", serif;
  font-size: clamp(2.6rem, 9vw, 4.6rem); line-height: 1;
  color: var(--gold); text-shadow: 0 0 18px rgba(201,162,39,.6), 0 2px 0 #000;
}
.couplet {
  writing-mode: vertical-rl; letter-spacing: .45em; z-index: 1;
  color: var(--red); font-size: clamp(.95rem, 2.6vw, 1.3rem);
  text-shadow: 0 0 12px rgba(192,57,43,.45);
}
.couplet-l { position: absolute; left: 8vw; top: 18vh; }
.couplet-r { position: absolute; right: 8vw; top: 18vh; color: var(--gold-soft); text-shadow: 0 0 12px rgba(201,162,39,.4); }
@media (max-width: 640px) { .couplet { display: none; } .stage::after {
  content: "露華閣上殘紅盡 · 一紙嫁衣待亡魂"; display: block; margin-top: 1.4rem; z-index: 1;
  color: var(--red); letter-spacing: .2em; font-size: .95rem; } }

.hero-meta { margin-top: 2.2rem; z-index: 1; }
.badge {
  display: inline-block; padding: .45rem 1.1rem; border: 1px solid var(--teal);
  border-radius: 999px; color: var(--teal); background: rgba(31,111,111,.12);
  font-size: .9rem; letter-spacing: .25em;
}
.handle { margin-top: 1rem; color: #9ca3af; font-size: .95rem; }

/* —— 區塊 —— */
main { position: relative; z-index: 1; max-width: 860px; margin: 0 auto; padding: 0 1.2rem 4rem; }
section { margin: 4.5rem 0; text-align: center; }
.sec-title {
  font-size: clamp(1.5rem, 5vw, 2.1rem); color: var(--gold-soft); letter-spacing: .35em;
  display: flex; align-items: center; justify-content: center; gap: 1rem;
}
.talisman {
  font-family: "Ma Shan Zheng", serif; font-size: .85em; color: var(--red);
  border: 1px dashed var(--red-deep); border-radius: 4px; padding: .1rem .4rem;
}
.sec-sub { margin-top: .9rem; color: #b9a89f; font-size: .98rem; line-height: 1.9; }

/* —— 籤卡 —— */
.cards { display: flex; gap: clamp(.8rem, 3vw, 1.6rem); justify-content: center; margin-top: 2.2rem; flex-wrap: wrap; }
.card {
  position: relative; width: clamp(150px, 26vw, 190px); aspect-ratio: 3/5; cursor: pointer;
  border: none; background: none; perspective: 900px; padding: 0;
  transition: transform .3s ease; font-family: inherit;
}
.card:hover { transform: translateY(-8px); }
.card::before { /* 卡背（封紅） */
  content: ""; position: absolute; inset: 0; border-radius: 10px;
  background:
    repeating-linear-gradient(45deg, rgba(0,0,0,.12) 0 8px, transparent 8px 16px),
    linear-gradient(165deg, var(--red) 0%, var(--red-deep) 100%);
  border: 2px solid var(--gold); box-shadow: 0 8px 24px rgba(0,0,0,.6), inset 0 0 24px rgba(0,0,0,.35);
  transition: opacity .5s;
}
.seal-char {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: "Ma Shan Zheng", serif; font-size: 3.2rem; color: var(--gold);
  text-shadow: 0 0 14px rgba(0,0,0,.6); z-index: 2; transition: opacity .5s;
}
.card-fore { /* 卡面（籤文面） */
  position: absolute; inset: 0; border-radius: 10px; opacity: 0; z-index: 3;
  background:
    radial-gradient(circle at 50% 18%, rgba(46,139,139,.28), transparent 55%),
    linear-gradient(180deg, var(--paper), #d9c4b4);
  border: 2px solid var(--teal-deep);
  box-shadow: 0 8px 24px rgba(0,0,0,.6), inset 0 0 18px rgba(31,111,111,.25);
  transition: opacity .5s;
}
.card.opened::before, .card.opened .seal-char { opacity: 0; }
.card.opened .card-fore { opacity: 1; }
.card.dimmed { opacity: .28; filter: grayscale(.6); pointer-events: none; }

.verdict { margin-top: 2.4rem; animation: rise .9s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.verdict-grade {
  font-family: "Ma Shan Zheng", serif; font-size: clamp(2rem, 6vw, 3rem);
  color: var(--gold); text-shadow: 0 0 20px rgba(201,162,39,.45); letter-spacing: .2em;
}
.verdict-text {
  margin: 1.2rem auto 1.8rem; max-width: 34em; line-height: 2.1; color: var(--paper);
  font-size: 1.05rem; white-space: pre-line;
}

/* —— 問月老 —— */
#ask-form { max-width: 540px; margin: 2rem auto 0; text-align: left; }
textarea, select {
  width: 100%; font-family: inherit; font-size: 1rem; color: var(--paper);
  background: #1a0508; border: 1px solid rgba(201,162,39,.4); border-radius: 8px;
  padding: .9rem 1rem; outline: none; resize: vertical;
}
textarea:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.15); }
.ask-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .9rem; flex-wrap: wrap; }
.who { color: #b9a89f; font-size: .95rem; display: flex; align-items: center; gap: .6rem; }
.who select { width: auto; }
.btn {
  font-family: inherit; cursor: pointer; font-size: 1.02rem; letter-spacing: .2em;
  color: var(--ink); background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  border: 1px solid var(--gold); border-radius: 999px; padding: .75rem 1.9rem;
  box-shadow: 0 4px 18px rgba(201,162,39,.35); transition: transform .15s ease, box-shadow .15s ease;
  text-decoration: none; display: inline-block;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(201,162,39,.5); }
.btn.ghost { background: transparent; color: var(--gold-soft); box-shadow: none; }
.btn.ghost:hover { border-color: var(--gold-soft); }
.answer {
  max-width: 540px; margin: 1.8rem auto 0; padding: 1.4rem 1.6rem; text-align: left;
  border-left: 3px solid var(--teal); background: rgba(31,111,111,.1);
  border-radius: 0 10px 10px 0; line-height: 2; color: var(--paper); font-size: 1.02rem;
  animation: rise .8s ease both; white-space: pre-line;
}
.live-btn { margin-top: 1.6rem; background: linear-gradient(180deg, var(--red), var(--red-deep)); color: var(--paper);
  border-color: var(--red); box-shadow: 0 4px 18px rgba(192,57,43,.4); }

footer { text-align: center; color: #7d6b64; font-size: .85rem; padding: 2.5rem 1rem 3rem; letter-spacing: .1em; }
