:root {
  color-scheme: dark;
  --bg: #0e0b22;
  --panel: #1a1538;
  --line: #2e2758;
  --text: #ece6fb;
  --muted: #a99fcc;
  --gold: #e6c15a;
  --violet: #c9a7ff;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 50% -200px, #2a1f5c 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--sans);
}
a { color: var(--violet); }
main { max-width: 760px; margin: 0 auto; padding: 0 16px 48px; }
h1, h2 { font-family: var(--serif); font-weight: 600; line-height: 1.15; }
h1 { font-size: clamp(2rem, 6vw, 2.8rem); margin: 8px 0; }
h2 { font-size: 1.7rem; margin: 40px 0 8px; }
.lead { color: var(--muted); font-size: 1.1rem; margin-top: 0; }
.small, .hint { color: var(--muted); font-size: .92rem; }

.top { display: flex; justify-content: space-between; align-items: center; max-width: 760px; margin: 0 auto; padding: 16px; }
.brand { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; color: var(--gold); text-decoration: none; }
.top nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.hero { text-align: center; padding: 24px 0 0; }

section.daily, section.spread { text-align: center; }
.flip {
  width: 180px; aspect-ratio: 200 / 340; margin: 8px auto; display: block; padding: 0; border: 0; border-radius: 14px;
  background: none; cursor: pointer; perspective: 900px;
}
.flip .back, .flip img { width: 100%; height: 100%; border-radius: 14px; display: block; }
.flip .back {
  background:
    repeating-linear-gradient(45deg, transparent 0 10px, rgba(230, 193, 90, .08) 10px 11px),
    radial-gradient(circle at 50% 50%, #3a2c7a 0 22%, #1d1742 23%);
  border: 1px solid var(--gold);
  box-shadow: 0 10px 40px rgba(201, 167, 255, .25);
}
.flip.open { animation: turn .5s ease; cursor: default; }
@keyframes turn { from { transform: rotateY(90deg); } to { transform: rotateY(0); } }
.rev { transform: rotate(180deg); }

.reading { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin: 16px 0; }
.reading h3 { font-family: var(--serif); font-size: 1.45rem; margin: 0 0 4px; }
.reading .tag { display: inline-block; font-size: .8rem; color: var(--gold); border: 1px solid var(--gold); border-radius: 99px; padding: 1px 10px; margin-bottom: 8px; }
.reading p { margin: 6px 0; }
.reading .kw { color: var(--muted); font-size: .92rem; }
.reading .row { display: flex; gap: 14px; align-items: flex-start; }
.reading .row img { width: 74px; border-radius: 8px; flex: none; }

.q { display: block; text-align: left; max-width: 460px; margin: 12px auto; }
.q span { display: block; font-size: .88rem; color: var(--muted); margin-bottom: 4px; }
.q input { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; }
.btn {
  display: inline-block; border: 0; border-radius: 99px; padding: 12px 26px; font: 600 1rem var(--sans);
  background: linear-gradient(135deg, var(--gold), #f3d98d); color: #1b1430; cursor: pointer; text-decoration: none;
}
.btn.ghost { background: none; border: 1px solid var(--line); color: var(--text); }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 460px; margin: 20px auto 0; }
.slot { aspect-ratio: 200 / 340; border: 1px dashed var(--line); border-radius: 12px; position: relative; }
.slot img { width: 100%; height: 100%; border-radius: 12px; display: block; animation: turn .5s ease; }
.slot .pos { position: absolute; left: 0; right: 0; bottom: -24px; font-size: .85rem; color: var(--muted); }
#three-out { margin-top: 36px; }
.actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }

.info { color: var(--muted); }
.card-head { display: flex; gap: 20px; align-items: flex-start; margin-top: 16px; }
.card-img { width: 160px; height: auto; border-radius: 12px; flex: none; }
.crumb { color: var(--muted); font-size: .9rem; margin: 0; }
.cta { text-align: center; margin: 32px 0; }
.pager { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 16px; font-size: .95rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 14px; }
.tile { text-decoration: none; color: var(--text); font-size: .82rem; text-align: center; line-height: 1.3; }
.tile img { width: 100%; height: auto; border-radius: 8px; display: block; margin-bottom: 4px; transition: transform .2s; }
.tile:hover img { transform: translateY(-3px); }

footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; text-align: center; padding: 20px 16px 32px; }
footer a { color: var(--muted); }

@media (max-width: 520px) {
  .card-head { flex-direction: column; align-items: center; text-align: center; }
  .card-img { width: 150px; }
}
