/* Fortune Cookie — midnight indigo + gold, elegant serif display type.
   Mobile-first. One stylesheet for the whole site. */

:root {
  --indigo-950: #070822;
  --indigo-900: #0b0e2a;
  --indigo-800: #141842;
  --indigo-700: #1d2160;
  --gold: #d4af37;
  --gold-soft: #e8cf7a;
  --gold-dim: #9a7d24;
  --cream: #f4ecd8;
  --ink: #e9e6f5;
  --muted: #a7a3c7;
  --card: rgba(20, 24, 66, 0.72);
  --line: rgba(212, 175, 55, 0.35);
  --danger: #ff8a8a;
  --ok: #9fe6b8;
  --radius: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1100px 550px at 85% -10%, rgba(124, 58, 237, 0.38), transparent 60%),
    radial-gradient(900px 620px at -10% 25%, rgba(30, 64, 175, 0.50), transparent 55%),
    radial-gradient(1000px 700px at 55% 115%, rgba(13, 84, 110, 0.35), transparent 60%),
    linear-gradient(180deg, #02020a, #05071a 45%, #03040f);
  min-height: 100vh;
  line-height: 1.55;
}

/* faint starfield */
.stars {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 34% 68%, #ffe9a8 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 57% 12%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 73% 44%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 88% 78%, #ffe9a8 50%, transparent 51%),
    radial-gradient(1px 1px at 45% 88%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 5% 55%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 95% 30%, #fff 50%, transparent 51%);
  opacity: 0.5;
}

header, main, footer { position: relative; z-index: 1; }

h1, h2, h3, .brand-name {
  font-family: "Playfair Display", "Didot", "Bodoni MT", Georgia, serif;
  color: var(--cream);
  letter-spacing: 0.02em;
}

a { color: var(--gold-soft); }
a:hover { color: var(--gold); }

/* ------------------------------------------------ header */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.2rem;
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 8, 34, 0.82);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 0.55rem; text-decoration: none; }
.brand img { border-radius: 50%; border: 2px solid var(--gold); }
.brand-name { font-size: 1.35rem; color: var(--gold); font-weight: 700; }
.main-nav { display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem; flex: 1; }
.main-nav a { color: var(--ink); text-decoration: none; font-size: 0.95rem; }
.main-nav a:hover { color: var(--gold-soft); }
.main-nav .nav-premium { color: var(--gold); font-weight: 600; }
.account-nav { display: flex; gap: 0.5rem; }

/* ------------------------------------------------ buttons & forms */
.btn {
  display: inline-block; border: 1px solid var(--line); background: transparent;
  color: var(--ink); padding: 0.55rem 1.1rem; border-radius: 999px;
  font-size: 1rem; cursor: pointer; text-decoration: none; text-align: center;
  transition: transform 0.08s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-gold {
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: #241a02; font-weight: 700; border-color: var(--gold);
  box-shadow: 0 4px 18px rgba(212, 175, 55, 0.35);
}
.btn-ghost { border-color: rgba(233, 230, 245, 0.4); }
.btn-small { padding: 0.35rem 0.8rem; font-size: 0.9rem; }
.btn-big { padding: 0.8rem 1.7rem; font-size: 1.08rem; width: 100%; }

label { display: block; margin: 0.7rem 0; font-size: 0.95rem; color: var(--cream); }
input, textarea, select {
  width: 100%; margin-top: 0.3rem; padding: 0.65rem 0.8rem;
  border-radius: 10px; border: 1px solid rgba(167, 163, 199, 0.45);
  background: rgba(7, 8, 34, 0.65); color: var(--ink); font-size: 1rem;
}
input:focus, textarea:focus { outline: 2px solid var(--gold-dim); border-color: var(--gold); }

.grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
.grid-span { grid-column: 1 / -1; }
@media (min-width: 700px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* ------------------------------------------------ layout cards */
main { max-width: 980px; margin: 0 auto; padding: 1.2rem 1rem 3rem; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.3rem 1.5rem; margin: 1.2rem 0;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.35);
}
.page-head { text-align: center; margin: 1.6rem 0 0.4rem; }
.page-head h1 { font-size: 2.1rem; margin: 0.3rem 0; }
.page-head p { color: var(--muted); max-width: 620px; margin: 0.4rem auto; }

/* ------------------------------------------------ hero + ask */
.hero { text-align: center; padding: 1.6rem 0 0.2rem; }
.hero-mascot { width: 150px; height: 150px; border-radius: 50%; border: 3px solid var(--gold); box-shadow: 0 0 44px rgba(212, 175, 55, 0.4); }
.hero-mascot.small { width: 92px; height: 92px; }
.hero h1 { font-size: 2.6rem; margin: 0.7rem 0 0.3rem; color: var(--gold); }
.hero-sub { color: var(--ink); max-width: 640px; margin: 0 auto; font-size: 1.06rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.6rem 0 1rem; }
.chip {
  border: 1px solid var(--line); background: rgba(7, 8, 34, 0.55); color: var(--ink);
  padding: 0.45rem 0.95rem; border-radius: 999px; cursor: pointer; font-size: 0.95rem;
}
.chip:hover { border-color: var(--gold); }
.chip-active { background: linear-gradient(180deg, var(--gold-soft), var(--gold)); color: #241a02; font-weight: 700; }

.ask-result { margin-top: 1.3rem; border-top: 1px dashed var(--line); padding-top: 1.1rem; }
.chart-strip {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; font-size: 0.92rem; color: var(--muted);
  margin-bottom: 0.8rem;
}
.chart-strip strong { color: var(--gold-soft); }
.answer-bubble {
  background: rgba(244, 236, 216, 0.07); border: 1px solid var(--line);
  border-left: 4px solid var(--gold); border-radius: 12px;
  padding: 1rem 1.1rem; font-size: 1.08rem; color: var(--cream); white-space: pre-wrap;
}
.followup-title { color: var(--muted); margin-bottom: 0.2rem; }
#followup-form, #member-ask-form { display: flex; gap: 0.5rem; }
#followup-form input, #member-ask-form input { flex: 1; }
.gate-box, .error-box, .ok-box {
  margin-top: 1rem; border-radius: 12px; padding: 0.9rem 1.1rem; font-size: 0.98rem;
}
.gate-box { border: 1px solid var(--gold); background: rgba(212, 175, 55, 0.1); }
.error-box { border: 1px solid var(--danger); color: var(--danger); background: rgba(255, 90, 90, 0.07); }
.ok-box { border: 1px solid var(--ok); color: var(--ok); }
.fineprint { color: var(--muted); font-size: 0.86rem; }

/* ------------------------------------------------ cookie + tools */
.cookie-card { text-align: center; }
.cookie-fortune { font-family: Georgia, serif; font-style: italic; font-size: 1.25rem; color: var(--gold-soft); }
.cookie-lucky { color: var(--muted); }

.tools-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin: 1.4rem 0; }
@media (min-width: 700px) { .tools-grid { grid-template-columns: repeat(3, 1fr); } }
.tool-card {
  display: block; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem; text-align: center;
}
.tool-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.tool-card h3 { margin: 0.4rem 0 0.2rem; }
.tool-card p { color: var(--muted); margin: 0.2rem 0; font-size: 0.94rem; }
.tool-emoji { font-size: 1.9rem; }

/* ------------------------------------------------ fortune scores */
.big-score { font-family: Georgia, serif; font-size: 4rem; color: var(--gold); text-align: center; line-height: 1; }
.big-score span { font-size: 1.3rem; color: var(--muted); }
.fortune-result h2 { text-align: center; margin-top: 0.5rem; }
.fortune-date, .theme-text { text-align: center; color: var(--muted); }
.fortune-result .theme-text { text-align: center; }
.score-row { display: flex; align-items: center; gap: 0.7rem; margin: 0.45rem 0; }
.score-row span:first-child { width: 76px; color: var(--cream); }
.score-bar { flex: 1; height: 10px; border-radius: 999px; background: rgba(233, 230, 245, 0.14); overflow: hidden; }
.score-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); }
.fortune-list li { margin: 0.35rem 0; }
.fortune-list.caution li { color: #ffc4c4; }
.color-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line); vertical-align: -2px; }
.lucky-line { margin-top: 0.9rem; }
.mini-chart { border-top: 1px dashed var(--line); margin-top: 1rem; padding-top: 0.6rem; color: var(--muted); font-size: 0.94rem; }

/* ------------------------------------------------ horoscope / tarot / iching */
.sign-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin: 1rem 0; }
@media (min-width: 700px) { .sign-grid { grid-template-columns: repeat(4, 1fr); } }
.sign-card {
  display: flex; flex-direction: column; text-align: center; text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0.7rem 0.4rem; color: var(--ink);
}
.sign-card .sign-dates { color: var(--muted); font-size: 0.8rem; }
.sign-active { border-color: var(--gold); background: rgba(212, 175, 55, 0.13); }

.tarot-spread { display: grid; gap: 1rem; margin-top: 1.2rem; }
@media (min-width: 700px) { .tarot-spread { grid-template-columns: repeat(3, 1fr); } }
.tarot-face {
  border: 1px solid var(--gold); border-radius: 14px; padding: 1.1rem; text-align: center;
  background: linear-gradient(160deg, rgba(212, 175, 55, 0.12), rgba(20, 24, 66, 0.8));
  min-height: 170px;
}
.tarot-pos { color: var(--muted); text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.14em; }

.iching-stage { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-top: 1rem; }
.hexagram { display: flex; flex-direction: column; gap: 7px; min-width: 150px; padding-top: 0.4rem; }
.hex-line { display: flex; gap: 14px; height: 14px; }
.hex-line span { flex: 1; background: var(--gold); border-radius: 3px; }
.iching-side { flex: 1; min-width: 240px; }
.coin-line { font-size: 1.5rem; text-align: center; }

/* ------------------------------------------------ premium / member / admin */
.price { font-family: Georgia, serif; font-size: 2.6rem; color: var(--gold); text-align: center; }
.perk-list { list-style: none; padding: 0; max-width: 560px; margin: 1rem auto; }
.perk-list li { margin: 0.6rem 0; }
.premium-card { text-align: center; }
.premium-badge { color: var(--gold); font-weight: 700; }
.upsell { border-color: var(--gold); }
.history-item { border-top: 1px dashed var(--line); padding: 0.8rem 0; }
.history-item:first-child { border-top: none; }
.history-q { color: var(--cream); font-weight: 600; margin: 0.2rem 0; }
.history-cat { color: var(--gold); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; margin-right: 0.4rem; }
.history-date { color: var(--muted); font-weight: 400; font-size: 0.85rem; margin-left: 0.5rem; }
.history-a { color: var(--ink); margin: 0.2rem 0; white-space: pre-wrap; }
.member-ask { border-top: 1px dashed var(--line); margin-top: 1.2rem; padding-top: 0.8rem; }
.member-ask .answer-bubble, .member-ask .error-box { margin-top: 0.8rem; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.8rem; margin: 1.1rem 0; }
@media (min-width: 700px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-box {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 0.9rem; text-align: center; color: var(--muted); font-size: 0.9rem;
  display: flex; flex-direction: column; gap: 0.2rem;
}
.stat-num { font-family: Georgia, serif; font-size: 2rem; color: var(--gold); }
.stats-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.stats-table th, .stats-table td { border-bottom: 1px solid rgba(167, 163, 199, 0.25); padding: 0.45rem 0.5rem; text-align: left; }
.stats-table th { color: var(--gold-soft); }
.truncate { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sim-banner { border: 1px dashed var(--gold); padding: 0.8rem 1rem; border-radius: 10px; background: rgba(212, 175, 55, 0.08); }
.auth-card { max-width: 520px; margin-left: auto; margin-right: auto; }

/* ------------------------------------------------ flash + footer */
.flash-wrap { max-width: 980px; margin: 0.8rem auto 0; padding: 0 1rem; position: relative; z-index: 1; }
.flash { border-radius: 10px; padding: 0.7rem 1rem; margin-bottom: 0.5rem; border: 1px solid var(--line); background: var(--card); }
.flash-ok { border-color: var(--ok); color: var(--ok); }
.flash-error { border-color: var(--danger); color: var(--danger); }
.flash-info { color: var(--gold-soft); }

.site-footer { text-align: center; padding: 2rem 1rem 2.4rem; border-top: 1px solid var(--line); color: var(--muted); }
.site-footer img { border-radius: 50%; opacity: 0.9; }
.footer-brand { color: var(--gold-soft); font-family: Georgia, serif; margin: 0.4rem 0 0.2rem; }
.disclaimer { font-size: 0.84rem; max-width: 620px; margin: 0.3rem auto; }
.footer-links { font-size: 0.9rem; }

.bdate { display: flex; gap: 8px; }
.bdate select { flex: 1 1 0; min-width: 0; }

.live-bar { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; background: linear-gradient(90deg, #120c2c, #251a52, #120c2c); color: #f3e9c8; font-size: 14px; letter-spacing: .02em; padding: 8px 12px; text-align: center; position: relative; z-index: 5; }
.live-bar strong { color: var(--gold-soft); font-size: 15px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #ff4d5e; box-shadow: 0 0 9px #ff4d5e; animation: livepulse 1.6s ease-in-out infinite; }
@keyframes livepulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.live-sep { opacity: .55; }

.ritual { font-style: italic; }
.ritual-dots i { font-style: normal; animation: rdot 1.2s ease-in-out infinite; }
.ritual-dots i:nth-child(2) { animation-delay: .2s; }
.ritual-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes rdot { 0%, 60%, 100% { opacity: .15; } 30% { opacity: 1; } }
.ritual-overlay { position: fixed; inset: 0; background: rgba(8, 6, 20, .9); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; z-index: 60; color: #f3e9c8; font-size: 18px; text-align: center; padding: 20px; }
.ritual-overlay img { animation: livepulse 1.8s ease-in-out infinite; border-radius: 50%; }

#starfield { display: block; }

.btime { display: flex; gap: 8px; }
.btime select { flex: 1 1 0; min-width: 0; }

/* Today's Cookie — crack-to-open */
.cookie-crack-btn {
  font-size: 96px; line-height: 1.1; background: none; border: none; cursor: pointer;
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.5));
  animation: cookie-wiggle 3.2s ease-in-out infinite;
}
.cookie-crack-btn.cracking { animation: cookie-crack 0.65s ease-in forwards; }
@keyframes cookie-wiggle {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg) translateY(-5px); }
}
@keyframes cookie-crack {
  0% { transform: scale(1); opacity: 1; }
  30% { transform: scale(1.14) rotate(-6deg); opacity: 1; }
  55% { transform: scale(0.94) rotate(5deg); opacity: 1; }
  100% { transform: scale(1.3); opacity: 0; }
}
#cookie-opened .cookie-fortune { animation: paper-in 0.7s ease both; }
@keyframes paper-in {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.cookie-tap { color: #b9c2dd; }
.cookie-again { color: #8f9bb8; font-size: 0.92em; margin-top: 14px; }
.lucky-dot {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%;
  margin: 0 8px 0 4px; vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, 0.35);
}
