:root {
  color-scheme: dark;
  --bg: #120b04;
  --bg-2: #1c1209;
  --panel: rgba(44, 28, 12, 0.82);
  --panel-2: rgba(82, 55, 24, 0.42);
  --gold: #d8b466;
  --gold-2: #f6dd9e;
  --text: #fff7e6;
  --muted: #c9b891;
  --danger: #f2a872;
  --line: rgba(216, 180, 102, 0.24);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top, rgba(122,83,30,.45), transparent 32rem), linear-gradient(150deg, #090603, var(--bg) 42%, #221205); color: var(--text); }
button { font: inherit; color: inherit; }
.app-shell { width: min(1180px, 100%); margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 18px 48px; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0 18px; backdrop-filter: blur(18px); }
.brand-block { display: flex; align-items: center; gap: 13px; }
.brand-mark { width: 48px; height: 48px; border: 1px solid var(--gold); border-radius: 50%; display:grid; place-items:center; background: radial-gradient(circle, var(--gold-2), var(--gold)); color:#160b03; font-weight: 800; box-shadow: 0 0 28px rgba(216,180,102,.35); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 0; font-size: clamp(1.3rem, 5vw, 2rem); letter-spacing: .08em; }
.topbar p { margin: 2px 0 0; color: var(--muted); font-size: .86rem; }
main { padding-top: 10px; }
.panel, .card { border: 1px solid var(--line); background: var(--panel); border-radius: 24px; box-shadow: 0 18px 60px rgba(0,0,0,.25); }
.panel { padding: 22px; }
.panel.compact { padding: 18px; }
.hero { display:flex; align-items:center; justify-content:space-between; gap: 20px; overflow:hidden; position:relative; }
.hero h2 { font-size: clamp(2.2rem, 7vw, 4rem); margin-bottom: 8px; }
.hero p { color: var(--muted); max-width: 720px; line-height: 1.8; }
.hero-orb { min-width: 132px; height:132px; border-radius:50%; display:grid; place-items:center; color:#170c03; font-weight:900; letter-spacing:.1em; background: radial-gradient(circle at 30% 25%, #fff0b6, #d1a04d 58%, #6c4318); box-shadow: 0 0 70px rgba(216,180,102,.42); }
.eyebrow { color: var(--gold-2); letter-spacing: .16em; font-size: .82rem; text-transform: uppercase; }
.page-grid { display: grid; gap: 28px; }
.section-title { margin: 0 0 14px; color: var(--gold-2); }
.category-grid { display:grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; }
.category-tile { min-height: 118px; padding: 18px; text-align:left; border:1px solid var(--line); border-radius:22px; background: linear-gradient(145deg, rgba(216,180,102,.16), rgba(255,255,255,.03)); cursor:pointer; }
.category-tile span { display:block; font-size: 1.1rem; font-weight: 800; margin-bottom: 24px; }
.category-tile small { color: var(--muted); }
.cards-grid { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.card { padding: 18px; cursor:pointer; transition: transform .18s, border-color .18s, background .18s; }
.card:hover, .category-tile:hover { transform: translateY(-2px); border-color: rgba(246,221,158,.55); background-color: rgba(216,180,102,.12); }
.card h3 { margin-bottom: 8px; color: var(--gold-2); }
.card p { color: var(--muted); line-height: 1.6; }
.card-topline, .meta-row, .status-strip { display:flex; align-items:center; justify-content:space-between; gap: 10px; color: var(--muted); font-size: .86rem; }
.pill { display:inline-flex; padding: 4px 9px; border-radius:999px; border:1px solid var(--line); color: var(--gold-2); }
.pill.strong { background: rgba(216,180,102,.13); }
.status.pending { color: var(--danger); }
.page-heading { margin-bottom: 18px; }
.page-heading h2 { font-size: clamp(1.8rem, 6vw, 3rem); margin: 6px 0; }
.page-heading p, .ritual-role, .notes { color: var(--muted); line-height: 1.8; }
.primary-button, .ghost-button { border:1px solid var(--line); border-radius: 999px; padding: 10px 15px; cursor:pointer; background: rgba(255,255,255,.04); }
.primary-button { background: linear-gradient(135deg, var(--gold), #9c6b26); color:#170c03; font-weight: 900; border-color: transparent; }
.ghost-button.large, .primary-button.large { padding: 14px 18px; min-width: 108px; }
.player-layout { display:grid; gap: 16px; }
.player-panel { text-align:center; }
.player-panel h2 { font-size: clamp(2rem, 7vw, 4.2rem); margin: 8px 0; }
.player-kicker { color: var(--gold-2); letter-spacing:.12em; }
.status-strip { justify-content:center; flex-wrap:wrap; margin: 16px 0; }
.status-strip span { border:1px solid var(--line); border-radius:999px; padding: 6px 10px; }
.player-actions { display:flex; justify-content:center; flex-wrap:wrap; gap: 12px; margin-top: 16px; }
.controls-grid { display:grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.segmented { display:flex; gap: 8px; flex-wrap:nowrap; }
.segmented.wrap { flex-wrap:wrap; }
.segmented button { flex: 1; min-width: 72px; padding: 10px 12px; border-radius: 14px; border:1px solid var(--line); background: rgba(255,255,255,.04); cursor:pointer; }
.segmented button.active { background: var(--gold); color:#170c03; font-weight:900; border-color: transparent; }
.scripture-panel { padding: 26px; }
.scripture-line { font-size: clamp(1.12rem, 4.5vw, 1.55rem); line-height: 2.15; letter-spacing: .04em; border-bottom: 1px dashed rgba(216,180,102,.18); padding-bottom: 10px; }
.muted { color: var(--muted); }
.timeline-list { display:grid; gap: 10px; }
.timeline-row { display:flex; gap: 14px; align-items:flex-start; border:1px solid var(--line); border-radius: 18px; padding: 14px; background: rgba(255,255,255,.035); }
.timeline-index { width: 34px; height:34px; border-radius:50%; display:grid; place-items:center; background:rgba(216,180,102,.16); color: var(--gold-2); font-weight:800; }
.timeline-row p { margin: 4px 0 0; color: var(--muted); }
.setting-row { display:flex; justify-content:space-between; gap: 20px; align-items:center; margin-bottom: 14px; }
.switch input { display:none; }
.switch span { display:block; width:58px; height:32px; border-radius:999px; border:1px solid var(--line); position:relative; background: rgba(255,255,255,.08); }
.switch span:after { content:""; position:absolute; width:24px; height:24px; top:3px; left:4px; border-radius:50%; background:var(--muted); transition:.18s; }
.switch input:checked + span { background: rgba(216,180,102,.3); }
.switch input:checked + span:after { transform: translateX(24px); background: var(--gold-2); }
.instruction-list { color: var(--muted); line-height: 1.9; }
.caution { border-color: rgba(242,168,114,.32); }
@media (max-width: 880px) { .category-grid, .cards-grid, .controls-grid { grid-template-columns: 1fr 1fr; } .hero { align-items:flex-start; } .hero-orb { min-width: 92px; height:92px; } }
@media (max-width: 620px) { .app-shell { padding-inline: 12px; } .topbar { gap:8px; } .brand-mark { width:42px; height:42px; } .ghost-button { padding: 8px 10px; } .category-grid, .cards-grid, .controls-grid { grid-template-columns: 1fr; } .hero { display:block; } .hero-orb { margin-top: 18px; } .panel, .card { border-radius: 20px; } .segmented button { min-width: 68px; } }
.top-actions { display:flex; gap:8px; align-items:center; }
.sound-hint { color: var(--gold-2); background: rgba(216,180,102,.10); border:1px solid var(--line); border-radius:16px; padding:10px 12px; line-height:1.6; margin: 12px auto; max-width: 760px; }
@media (max-width: 620px) { .top-actions { flex-direction:column; gap:6px; } .top-actions .ghost-button { font-size:.82rem; padding:7px 9px;} }
