:root {
  --red: #b3232a;
  --red-dark: #8a1219;
  --gold: #d4a63a;
  --gold-light: #f3d78a;
  --cream: #fff8ee;
  --ink: #2b1d14;
  --muted: #7a6a5c;
  --card: #ffffff;
  --line: #eadbc4;
  --shadow: 0 8px 24px rgba(90, 40, 10, 0.12);
  --radius: 18px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream) radial-gradient(circle at top, #fff3d6 0%, var(--cream) 55%);
  line-height: 1.6;
}
a { color: var(--red); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; color: var(--red-dark); }
p { margin: 0 0 1em; }
.muted { color: var(--muted); font-size: 0.92rem; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px 90px; }

/* Header */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand .om {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: var(--gold-light); display: grid; place-items: center;
  font-size: 22px; box-shadow: var(--shadow);
}
.brand strong { display: block; font-size: 1rem; }
.brand small { display: block; color: var(--muted); font-size: 0.72rem; }
.lang { display: flex; gap: 4px; }
.lang button {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 4px 10px; font-size: 0.8rem; cursor: pointer; color: var(--muted);
}
.lang button.active { background: var(--red); color: #fff; border-color: var(--red); }

/* Hero */
.hero {
  background: linear-gradient(160deg, var(--red) 0%, var(--red-dark) 100%);
  color: #fff; border-radius: 24px; padding: 28px 22px; margin: 8px 0 20px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.hero::after {
  content: "🐘"; position: absolute; right: -10px; bottom: -18px;
  font-size: 120px; opacity: 0.15; transform: rotate(-10deg);
}
.hero.photo { padding: 0; min-height: 300px; display: flex; align-items: flex-end; }
.hero.photo::after { display: none; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 42%; }
.hero .overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(60,8,12,.15) 0%, rgba(60,8,12,.35) 45%, rgba(120,15,22,.92) 100%); }
.hero-body { position: relative; z-index: 1; padding: 120px 22px 24px; width: 100%; }
.hero h1 { color: var(--gold-light); text-shadow: 0 2px 8px rgba(0,0,0,.35); }
.hero p { color: #ffe9c9; max-width: 480px; }
.hero .today { font-size: 0.85rem; opacity: 0.9; margin-bottom: 6px; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 24px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.card.link { text-decoration: none; color: var(--ink); display: block; transition: transform .15s; }
.card.link:hover { transform: translateY(-3px); }
.card .icon { font-size: 34px; margin-bottom: 6px; }
.card h3 { font-size: 1.05rem; margin-bottom: 4px; }
.card p { margin: 0; color: var(--muted); font-size: 0.9rem; }

section { margin-bottom: 28px; }

/* Forms */
label { display: block; font-weight: 600; font-size: 0.9rem; margin: 12px 0 6px; }
input, select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  font-size: 1rem; background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 0.85rem; }
.check input { width: auto; margin-top: 4px; }

.btn {
  display: inline-block; width: 100%; text-align: center; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--red), var(--red-dark)); color: #fff;
  font-size: 1.05rem; font-weight: 700; padding: 14px 20px; border-radius: 14px;
  margin-top: 16px; box-shadow: var(--shadow); text-decoration: none;
}
.btn.gold { background: linear-gradient(135deg, var(--gold), #b8862b); color: var(--ink); }
.btn.ghost { background: #fff; color: var(--red); border: 2px solid var(--red); box-shadow: none; }
.btn.small { width: auto; padding: 9px 16px; font-size: 0.9rem; margin-top: 8px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions .btn { flex: 1 1 140px; }

/* Result */
.result { display: none; }
.result.show { display: block; animation: rise .4s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(12px);} to { opacity: 1; transform: none;} }

.profile { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.profile .zodiac { font-size: 48px; }
.profile .tag { display: inline-block; background: var(--cream); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 0.78rem; margin: 2px 4px 2px 0; }

.stars { color: var(--gold); letter-spacing: 2px; }
.score-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.score-row:last-child { border-bottom: 0; }
.score-row b { font-size: 0.95rem; }
.lucky { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.lucky div { background: var(--cream); border-radius: 12px; padding: 10px; text-align: center; }
.lucky small { display: block; color: var(--muted); font-size: 0.72rem; }
.lucky strong { font-size: 1rem; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: middle; margin-right: 4px; border: 1px solid rgba(0,0,0,.15); }

.quote {
  background: linear-gradient(135deg, #fff7e3, #ffefc9); border-left: 4px solid var(--gold);
  padding: 14px 16px; border-radius: 0 14px 14px 0; font-style: italic; margin: 14px 0;
}
.quote::before { content: "🐘 "; font-style: normal; }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs button {
  flex: 1; padding: 10px; border: 1px solid var(--line); background: #fff;
  border-radius: 12px; font-weight: 600; cursor: pointer; color: var(--muted);
}
.tabs button.active { background: var(--gold-light); color: var(--ink); border-color: var(--gold); }

/* Oracle */
.tube {
  text-align: center; padding: 30px 20px; background: #fff; border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow); margin-bottom: 16px;
}
.tube .sticks { font-size: 72px; display: inline-block; transition: transform .1s; }
.tube.shaking .sticks { animation: shake .12s infinite; }
@keyframes shake {
  0% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } 100% { transform: rotate(-6deg); }
}
.lot-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.lot-no { font-size: 0.85rem; color: var(--muted); }
.lot-level { font-weight: 800; padding: 4px 12px; border-radius: 999px; font-size: 0.9rem; }
.lv-great { background: #ffe1a8; color: #7a4d00; }
.lv-good { background: #dff3d8; color: #1f5e2a; }
.lv-mid { background: #e6e6f5; color: #3b3b7a; }
.lv-low { background: #f6dede; color: #7a1f1f; }
.poem {
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif; font-size: 1.15rem; text-align: center;
  line-height: 2; padding: 14px; background: var(--cream); border-radius: 12px; margin: 10px 0 14px;
  white-space: pre-line;
}
.poem-en { font-size: 0.85rem; color: var(--muted); font-style: italic; white-space: pre-line; text-align: center; margin-bottom: 14px; }
.reading { display: grid; gap: 8px; }
.reading div { display: grid; grid-template-columns: 64px 1fr; gap: 8px; font-size: 0.92rem; }
.reading b { color: var(--red-dark); }

/* Stamps */
.stampcard { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0; }
.stamp {
  aspect-ratio: 1; border: 2px dashed var(--line); border-radius: 50%; display: grid;
  place-items: center; font-size: 28px; color: var(--line); background: #fff;
}
.stamp.done { border: 2px solid var(--gold); background: var(--gold-light); color: var(--red); }
.reward { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px dashed var(--line); font-size: 0.92rem; }
.reward .lvl { min-width: 40px; height: 40px; border-radius: 50%; background: var(--cream); display: grid; place-items: center; font-weight: 700; color: var(--red); }
.badge { display: inline-block; background: var(--red); color: #fff; padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; margin-left: 6px; }
.streak { text-align: center; padding: 12px; background: var(--cream); border-radius: 12px; margin-bottom: 12px; }
.streak strong { font-size: 1.6rem; color: var(--red); display: block; }

/* TikTok */
.tt-card { background: #111; color: #fff; border-color: #222; }
.tt-card h2 { color: #fff; margin: 0; font-size: 1.1rem; }
.tt-card .muted { color: #bbb; text-decoration: none; font-size: 0.8rem; }
.tt-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tt-head > div { flex: 1; min-width: 0; }
.tt-head .btn { margin-top: 0; }
.tt-logo { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #25f4ee, #fe2c55); display: grid; place-items: center; font-weight: 900; color: #111; }
.tt-player { position: relative; width: min(100%, 340px); margin: 0 auto; aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: #000; }
.tt-player iframe { width: 100%; height: 100%; border: 0; display: block; }
.tt-sound { position: absolute; right: 10px; top: 10px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 18px; cursor: pointer; }
.tt-open { position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,.55); color: #fff; text-decoration: none; font-size: 0.78rem; padding: 6px 10px; border-radius: 999px; }
.tt-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.tt-ugc { flex: 0 0 200px; aspect-ratio: 9 / 16; border-radius: 12px; overflow: hidden; background: #000; scroll-snap-align: start; }
.tt-ugc iframe { width: 100%; height: 100%; border: 0; }
.tiktok-embed { border-radius: 12px; overflow: hidden; }
.tt-fallback { display: grid; gap: 12px; }
.tt-card-link { display: grid; justify-items: center; gap: 6px; text-decoration: none; color: #fff; background: #1c1c1c; border: 1px solid #2a2a2a; border-radius: 14px; padding: 18px; }
.tt-card-link b { font-size: 1.1rem; }
.tt-card-link small { color: #bbb; }
.tt-card-link .btn { margin-top: 6px; }
.tt-logo.big { width: 56px; height: 56px; font-size: 26px; }

/* Offerings / checkout */
.item .price { font-size: 1.3rem; font-weight: 800; color: var(--red); margin: 6px 0 2px; }
.item .btn { margin-top: 8px; }
.notice { background: #fff3cd; border: 1px solid #f3d78a; color: #6b4e00; border-radius: 12px; padding: 10px 14px; font-size: .9rem; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; z-index: 60; padding: 16px; }
.sheet { width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; }
.sheet label span { display: block; font-weight: 600; font-size: .9rem; margin: 12px 0 6px; }
.sheet .price { font-weight: 800; color: var(--red); }

/* Blessing hall / name-tag wall */
.shrine {
  position: relative; text-align: center; padding: 22px 16px 14px; cursor: pointer; user-select: none;
  background: radial-gradient(circle at 50% 35%, #ffe9b8 0%, #fff8ee 60%); border-radius: var(--radius);
  border: 1px solid var(--line); overflow: hidden;
}
.shrine .statue { font-size: 84px; line-height: 1; display: inline-block; position: relative; z-index: 1; animation: float 3s ease-in-out infinite; }
.shrine .aura {
  position: absolute; left: 50%; top: 58px; width: 150px; height: 150px; border-radius: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(212,166,58,.55) 0%, rgba(212,166,58,0) 70%); animation: pulse 2.4s ease-in-out infinite;
}
.shrine.blessed .aura { animation: burst .9s ease-out; }
.shrine .tap { font-size: 0.75rem; color: var(--muted); margin-top: 6px; }
@keyframes float { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-6px);} }
@keyframes pulse { 0%,100% { opacity: .6; transform: translate(-50%,-50%) scale(1);} 50% { opacity: 1; transform: translate(-50%,-50%) scale(1.25);} }
@keyframes burst { 0% { transform: translate(-50%,-50%) scale(1); opacity: 1;} 100% { transform: translate(-50%,-50%) scale(2.6); opacity: 0;} }
.spark { position: absolute; bottom: 40%; font-size: 22px; animation: sparkUp 1.5s ease-out forwards; pointer-events: none; z-index: 2; }
@keyframes sparkUp { 0% { transform: translateY(0) scale(.6); opacity: 0;} 20% { opacity: 1;} 100% { transform: translateY(-140px) scale(1.2); opacity: 0;} }

.counters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0; }
.counters div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 4px; text-align: center; }
.counters small { display: block; font-size: 0.68rem; color: var(--muted); }
.counters strong { font-size: 1.25rem; color: var(--red); }
.counters .gold strong { color: #b8862b; }

.today-bless { background: linear-gradient(135deg, #fff2cc, #ffe0a3); border-radius: 14px; padding: 12px 14px; margin: 10px 0; text-align: center; }
.today-bless small { display: block; color: #7a4d00; font-size: 0.75rem; letter-spacing: 1px; }
.today-bless .who { font-size: 1.3rem; font-weight: 800; margin: 4px 0; }
.today-bless p { margin: 0; font-size: 0.88rem; color: var(--ink); }

.tier { display: inline-block; font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.tier.gold { background: linear-gradient(135deg, #f3d78a, #d4a63a); color: #5a3a00; }
.tier.vip { background: #e6e6f5; color: #3b3b7a; }
.tier.normal { background: var(--cream); color: var(--muted); border: 1px solid var(--line); }

.nametag {
  display: inline-block; padding: 6px 12px; margin: 4px; border-radius: 8px 8px 12px 12px; font-size: 0.85rem; white-space: nowrap;
  background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--line); box-shadow: 0 2px 6px rgba(90,40,10,.08);
}
.nametag.gold { border-top-color: var(--gold); background: #fffaf0; }
.nametag.vip { border-top-color: #6a6ab8; }
.nametag.normal { border-top-color: #c9b8a0; }

.wall { overflow: hidden; margin: 8px -18px; padding: 4px 0; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: inline-flex; white-space: nowrap; animation: marquee 40s linear infinite; }
.wall:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.wall-grid { display: flex; flex-wrap: wrap; margin-bottom: 14px; }

.tiers { display: grid; gap: 12px; }
.tiers .card h3 { display: flex; align-items: center; gap: 8px; }
.tiers ul { margin: 6px 0 0; padding-left: 18px; font-size: 0.88rem; color: var(--muted); }
.tiers li { margin: 3px 0; }

/* Live crowd */
.video { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; background: #1a1210; display: block; }
.video.placeholder { display: grid; place-items: center; color: #e7d7bd; text-align: center; }
.video.placeholder span { font-size: 40px; display: block; }
.video.placeholder p { margin: 6px 0 0; font-size: 0.9rem; }
.gauge { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--cream); }
.gauge .dot { width: 18px; height: 18px; border-radius: 50%; background: #999; box-shadow: 0 0 0 4px rgba(0,0,0,.05); animation: pulse2 1.6s ease-in-out infinite; }
.gauge b { display: block; font-size: 1.1rem; }
.gauge span { font-size: 0.85rem; color: var(--muted); }
.gauge.low .dot { background: #43a047; } .gauge.mid .dot { background: #fb8c00; } .gauge.high .dot { background: #e53935; } .gauge.closed .dot { background: #999; animation: none; }
@keyframes pulse2 { 0%,100% { transform: scale(1);} 50% { transform: scale(1.25);} }
.heat { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
.heat th { font-weight: 600; color: var(--muted); padding: 6px 4px; font-size: 0.72rem; }
.heat td { text-align: center; padding: 8px 4px; border-radius: 8px; font-size: 1.1rem; }
.heat td.low { color: #43a047; } .heat td.mid { color: #fb8c00; } .heat td.high { color: #e53935; }
.heat td.now { outline: 2px solid var(--red); outline-offset: -2px; background: #fff; }
.lg.low { color: #43a047; } .lg.mid { color: #fb8c00; } .lg.high { color: #e53935; }

/* Deities */
.deity { margin-bottom: 12px; padding: 0; }
.deity summary { list-style: none; cursor: pointer; display: flex; gap: 12px; align-items: center; padding: 16px 18px; }
.deity summary::-webkit-details-marker { display: none; }
.deity summary .icon { font-size: 34px; }
.deity summary b { display: block; font-size: 1.02rem; }
.deity summary small { color: var(--muted); font-size: 0.8rem; }
.deity h3 { font-size: 0.95rem; color: var(--red-dark); margin: 0 18px 4px; }
.deity p { margin: 0 18px 14px; font-size: 0.9rem; }
.deity.featured { border: 2px solid var(--gold); background: linear-gradient(180deg, #fffaf0, #fff); }

/* Events */
.event { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.event:last-child { border-bottom: 0; }
.event .date { text-align: center; background: var(--red); color: #fff; border-radius: 10px; padding: 6px 2px; height: fit-content; }
.event .date b { display: block; font-size: 1.2rem; line-height: 1; }
.event .date small { font-size: 0.65rem; }
.event h3 { font-size: 1rem; margin-bottom: 2px; }
.event p { font-size: 0.85rem; color: var(--muted); margin: 0; }

.map { width: 100%; height: 260px; border: 0; border-radius: 14px; }
.info-list { list-style: none; padding: 0; margin: 0; }
.info-list li { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 0.92rem; display: flex; gap: 10px; }
.info-list li:last-child { border-bottom: 0; }

.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 0.9rem;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 50; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Bottom nav */
.nav {
  position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; padding: 6px 0 max(8px, env(safe-area-inset-bottom));
  z-index: 40;
}
.nav a { text-decoration: none; color: var(--muted); font-size: 0.68rem; text-align: center; flex: 1; }
.nav a span { display: block; font-size: 20px; }
.nav a.active { color: var(--red); font-weight: 700; }

footer { text-align: center; color: var(--muted); font-size: 0.75rem; padding: 24px 0 0; }

@media (max-width: 420px) {
  .row { grid-template-columns: 1fr 1fr 1fr; }
  h1 { font-size: 1.6rem; }
  .reading div { grid-template-columns: 56px 1fr; }
}
