:root {
  --bg: #0b0f14;
  --text: #f4f1ea;
  --muted: #9aa6b2;
  --amber: #f5b942;
  --lime: #b8f25a;
  --danger: #ff6b6b;
  --line: rgba(255,255,255,.08);
  --card: rgba(255,255,255,.04);
  --radius: 18px;
  --sans: "DM Sans", system-ui, sans-serif;
  --display: "Syne", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); color: var(--text); background: var(--bg); min-height: 100vh; }
.bg-glow { position: fixed; inset: 0; z-index: -1; pointer-events: none; background:
  radial-gradient(900px 500px at 12% -10%, rgba(245,185,66,.18), transparent 60%),
  radial-gradient(700px 420px at 90% 0%, rgba(184,242,90,.1), transparent 55%); }
.wrap { width: min(1100px, calc(100% - 2rem)); margin-inline: auto; }
.site-header { position: sticky; top: 0; z-index: 30; backdrop-filter: blur(14px); background: rgba(11,15,20,.82); border-bottom: 1px solid var(--line); }
.header-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .85rem 0; }
.brand { display: flex; gap: .7rem; align-items: center; color: inherit; text-decoration: none; }
.brand-mark { width: 2.2rem; height: 2.2rem; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--amber), #ff8a3d); color: #111; font-family: var(--display); font-weight: 800; }
.brand-text { font-family: var(--display); font-weight: 700; }
.nav { display: flex; gap: .9rem; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--text); }
.ticker { overflow: hidden; border-top: 1px solid var(--line); background: #141b24; }
.ticker-track { display: inline-block; white-space: nowrap; padding: .4rem 0; color: var(--amber); animation: ticker 28s linear infinite; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.hero { padding: 2.2rem 0 1rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; color: var(--lime); font-size: .75rem; margin: 0 0 .55rem; }
.hero h1, .section-head h2 { font-family: var(--display); letter-spacing: -.03em; margin: 0; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.3rem); line-height: 1.05; }
.lede { color: var(--muted); max-width: 42rem; }
.hero-actions, .date-jump { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.btn { border: 0; border-radius: 999px; padding: .7rem 1.05rem; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; }
.btn-primary { background: var(--amber); color: #111; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
input, select, textarea { background: #0f151d; color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: .65rem .8rem; }
.date-jump input[type=date] { border-radius: 999px; }

.next-panel { margin: 1rem 0 1.4rem; }
.next-card { text-align: center; padding: 1.3rem; border-radius: 24px; border: 1px solid rgba(245,185,66,.28);
  background: linear-gradient(145deg, rgba(245,185,66,.12), rgba(255,255,255,.03)); }
.next-label { color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; }
.timer {
  font-family: "Manrope", var(--sans);
  font-size: clamp(2.2rem, 8vw, 3.6rem);
  font-weight: 700;
  margin: .35rem 0;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.pulse-text, .wait { color: var(--amber); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.next-meta { color: var(--muted); margin: 0; }

.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin: 1.4rem 0 .75rem; }
.section-head p { margin: .2rem 0 0; color: var(--muted); }
.pill { background: rgba(184,242,90,.14); color: var(--lime); border-radius: 999px; padding: .25rem .7rem; font-size: .75rem; font-weight: 700; }

.bazi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; }
@media (max-width: 720px) { .bazi-grid { grid-template-columns: repeat(2, 1fr); } }
.bazi-cell { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem; min-height: 7rem; }
.bazi-cell header { display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; margin-bottom: .35rem; }
.patti { font-family: var(--display); font-size: 1.65rem; font-weight: 800; }
.single { color: var(--amber); font-weight: 700; }
.muted { color: var(--muted); }
.bazi-cell.state-awaiting_admin { border-color: rgba(245,185,66,.45); }
.bazi-cell.state-upcoming { border-color: rgba(184,242,90,.28); }
.bazi-cell.state-declared { background: rgba(184,242,90,.06); }

.history-stack { display: grid; gap: .85rem; }
.day-chart { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.day-chart-head { display: flex; justify-content: space-between; gap: .5rem; padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
.day-chart-head a { color: inherit; text-decoration: none; font-weight: 700; }
.tag { color: var(--danger); font-size: .75rem; font-weight: 700; }
.chart-row { display: grid; grid-template-columns: repeat(8, 1fr); text-align: center; }
.chart-row > div { padding: .55rem .15rem; border-right: 1px solid var(--line); font-weight: 700; }
.chart-row > div:last-child { border-right: 0; }
.chart-row.head { background: #17202b; color: var(--muted); font-size: .75rem; }
.patti-row { font-family: var(--display); font-size: clamp(.85rem, 2.4vw, 1.05rem); }
.single-row { color: var(--amber); border-top: 1px solid var(--line); }

.schedule { margin: 2rem 0 3rem; }
.schedule-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
@media (max-width: 720px) { .schedule-grid { grid-template-columns: repeat(2, 1fr); } }
.schedule-grid div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .8rem; display: flex; justify-content: space-between; }
.site-footer { color: var(--muted); font-size: .85rem; padding: 1.4rem 0 2.4rem; border-top: 1px solid var(--line); margin-top: 1rem; }
.footer-row { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; }
.footer-row p { margin: 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: .85rem; }
.footer-nav a { color: var(--muted); text-decoration: none; }
.footer-nav a:hover { color: var(--amber); }
.footer-domain { margin: .65rem 0 0; color: var(--amber); font-weight: 700; letter-spacing: .04em; }

.legal-page { padding: 2rem 0 3rem; max-width: 46rem; }
.legal-page h1 { font-family: var(--display); font-size: clamp(2rem, 5vw, 2.8rem); margin: 0 0 .5rem; letter-spacing: -.03em; }
.legal-page h2 { font-family: var(--display); font-size: 1.15rem; margin: 1.6rem 0 .45rem; }
.legal-page section p, .legal-page .lede { color: var(--muted); line-height: 1.65; }
.legal-page .lede { margin-bottom: 1.2rem; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card, .admin-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 1.2rem; }
.login-card { width: min(400px, 100%); }
.login-card h1 { font-family: var(--display); margin-top: 0; }
.login-card label { display: block; margin-top: .55rem; color: var(--muted); font-size: .9rem; }
.login-card input { width: 100%; margin-top: .25rem; }
.error { color: var(--danger); }
.admin-shell { width: min(1000px, calc(100% - 2rem)); margin: 1.4rem auto 2rem; }
.admin-top { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.admin-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; }
@media (max-width: 800px) { .admin-grid { grid-template-columns: 1fr; } }
.admin-card h3 { font-family: var(--display); margin: 0 0 .6rem; }
.admin-card form, .admin-card label { display: grid; gap: .35rem; }
.flash { background: rgba(184,242,90,.12); color: var(--lime); padding: .7rem 1rem; border-radius: 12px; margin-bottom: 1rem; }

/* Light front polish only — same palette */
.hero { animation: fadeUp .55s ease both; }
.next-panel { animation: fadeUp .6s ease .05s both; }
.bazi-grid { animation: fadeUp .65s ease .1s both; }
.history-stack { animation: fadeUp .7s ease .14s both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero, .next-panel, .bazi-grid, .history-stack { animation: none; }
}
