:root {
  color-scheme: light dark;
  --bg: radial-gradient(circle at 20% 10%, #0f1024, #0a0b1a 50%, #070812 100%);
  --panel: rgba(255,255,255,0.04);
  --border: rgba(255,255,255,0.12);
  --muted: #b6b8c9;
  --accent: #d4af37;
  --accent2: #7c3aed;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: ui-sans-serif, system-ui, 'Microsoft Yahei', Segoe UI, Roboto, Helvetica, Arial, sans-serif; background: #0a0b1a; color: #f2f3f9; }
body::before {
  content: "";
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: -1;
}
.site-header, .site-footer { text-align: center; padding: 20px; }
.header-bar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; justify-items: center; gap: 12px;
}
.header-bar h1 { margin: 0; grid-column: 2; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }
.header-actions { grid-column: 3; justify-self: end; display: flex; flex-direction: column; align-items: end; gap: 8px; }
.subtitle { color: var(--muted); margin-top: 8px; }
.controls-inline { display: flex; gap: 12px; align-items: flex-end; }
.type-panel { display: grid; gap: 6px; align-items: start; }
.lang-panel { display: flex; align-items: center; }
.lang-panel .lang-label { margin-right: 6px; color: var(--muted); }
.checkboxes { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,0.06); }
.checkbox input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.group-title { display: inline-block; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); color: var(--accent); background: rgba(124,58,237,0.12); margin-right: 4px; }
.divider { width: 100%; height: 1px; background: var(--border); margin: 4px 0; opacity: .6; }
.select-wrap { display: flex; gap: 8px; align-items: center; }
.select {
  appearance: none;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 10px 12px;
  color: #f2f3f9;
  box-shadow: 0 0 0 0 rgba(212,175,55,0);
}
.select:hover { background: rgba(255,255,255,0.08); }
.select:focus { outline: none; box-shadow: 0 0 0 2px rgba(212,175,55,0.28), 0 10px 24px rgba(0,0,0,0.35); }
.select option { background-color: #0a0b1a; color: #f2f3f9; }
.select optgroup { color: var(--accent); background-color: #0a0b1a; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255,255,255,0.06); color: #f2f3f9; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0,0,0,0.35); }
.btn.primary { background: linear-gradient(135deg, #7c3aed, #c084fc); border-color: transparent; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 24px; box-shadow: 0 12px 32px rgba(0,0,0,0.35); backdrop-filter: blur(8px); max-width: 980px; margin: 20px auto;
}
.site-header, main, .site-footer { padding-inline: clamp(12px, 5vw, 24px); }
.controls-bar { max-width: 980px; margin: 0 auto 10px; }
.controls-inline { display: flex; gap: 12px; align-items: flex-end; }
.cta { display: grid; place-items: center; margin-top: 12px; }
.cta { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 1000; }
.cta-large { padding: 16px 30px; font-size: 18px; border-radius: 999px; min-width: 240px; box-shadow: 0 14px 28px rgba(0,0,0,0.35); }
body { padding-bottom: 120px; }
#drawCta { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 1001; }
.guide { display: grid; gap: 10px; }
.guide .section { display: grid; gap: 6px; color: var(--muted); }
.guide .title { font-weight: 700; color: #f2f3f9; }
.guide .list { display: grid; gap: 6px; }
.table { display: grid; gap: 20px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; justify-items: center; }
@media (max-width: 640px) { .cards { grid-template-columns: 1fr; } }
.tarot-card {
  width: 200px; height: 340px; perspective: 1000px;
}
.tarot-card .inner {
  position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .6s ease;
}
.tarot-card.revealed .inner { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; border-radius: 16px; border: 1px solid rgba(255,255,255,0.25); box-shadow: 0 16px 40px rgba(0,0,0,0.5); backface-visibility: hidden; overflow: hidden;
}
.face.back {
  background:
    radial-gradient(ellipse at 50% 20%, rgba(124,58,237,0.5), transparent 60%),
    repeating-linear-gradient(45deg, rgba(212,175,55,0.15) 0 8px, rgba(124,58,237,0.15) 8px 16px),
    linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  display: grid; place-items: center;
}
.seal {
  width: 72px; height: 72px; border-radius: 50%; border: 2px solid #d4af37; display: grid; place-items: center; color: #d4af37; font-weight: 700; letter-spacing: 1px;
}
.face.front {
  transform: rotateY(180deg);
  background: radial-gradient(circle at 50% 0%, rgba(192,132,252,0.25), transparent 45%), linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  display: grid; grid-template-rows: auto 1fr auto; padding: 14px;
}
.card-title { text-align: center; font-weight: 700; color: #f2f3f9; }
.card-body { display: grid; place-items: center; color: #f2f3f9; }
.card-body .art { width: 100%; height: auto; max-height: 180px; object-fit: contain; border-radius: 8px; filter: drop-shadow(0 6px 16px rgba(0,0,0,0.45)); }
.card-body .glyph {
  width: 100px; height: 100px; border-radius: 50%; border: 2px dashed rgba(212,175,55,0.5); display: grid; place-items: center; color: #d4af37; font-size: 24px;
}
.card-footer { display: grid; gap: 4px; text-align: center; color: var(--muted); }
.reading { color: #f2f3f9; border-top: 1px dashed var(--border); padding-top: 12px; }
.tag { display: inline-block; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--border); background: rgba(255,255,255,0.06); font-size: 12px; color: var(--muted); }
.details { display: grid; gap: 12px; margin-top: 8px; }
.details .card-detail { border: 1px dashed var(--border); border-radius: 12px; padding: 10px; background: rgba(255,255,255,0.04); }
.details .title { font-weight: 700; color: #f2f3f9; }
.details .kv { display: grid; gap: 4px; color: var(--muted); }
.details .card-detail .title { font-weight: 700; color: #f2f3f9; }
.details .card-detail .kv { display: grid; gap: 4px; color: var(--muted); }
.details .combo { border-top: 1px dashed var(--border); padding-top: 10px; }
.legal { margin-top: 10px; color: var(--muted); }
.legal a { color: inherit; text-decoration: none; }
.legal a:hover { text-decoration: underline; }
@media (max-width: 768px) {
  .header-bar { grid-template-columns: 1fr; }
  .header-actions { justify-self: center; align-items: stretch; }
  .controls-inline { flex-wrap: wrap; justify-content: center; }
  .controls-bar { margin-bottom: 16px; }
  .select { width: 100%; }
  .tarot-card { width: 170px; height: 300px; }
  #drawCta { min-width: 70vw; }
}
@media (min-width: 1200px) {
  #drawCta { bottom: calc(64px + env(safe-area-inset-bottom)); }
  body { padding-bottom: 160px; }
}
