:root {
  --bg: #0d0a1e;
  --bg2: #171231;
  --card: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.12);
  --gold: #e8c16a;
  --gold2: #f5dd9c;
  --text: #ece7f7;
  --muted: #a99fc4;
  --violet: #7d5bd6;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: radial-gradient(ellipse at 50% -20%, #2a1c55 0%, var(--bg) 60%);
  color: var(--text);
  font-family: Georgia, 'Times New Roman', serif;
  min-height: 100vh;
  line-height: 1.6;
}
.stars {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff8 60%, transparent 61%),
    radial-gradient(1px 1px at 68% 8%, #fff8 60%, transparent 61%),
    radial-gradient(1.5px 1.5px at 85% 30%, #fff9 60%, transparent 61%),
    radial-gradient(1px 1px at 32% 55%, #fff7 60%, transparent 61%),
    radial-gradient(1.5px 1.5px at 55% 75%, #fff8 60%, transparent 61%),
    radial-gradient(1px 1px at 8% 88%, #fff7 60%, transparent 61%),
    radial-gradient(1px 1px at 92% 70%, #fff8 60%, transparent 61%),
    radial-gradient(1.5px 1.5px at 42% 32%, #fff9 60%, transparent 61%);
}
header {
  position: relative; z-index: 1;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .6rem; }
.brand .moon { font-size: 1.6rem; }
.brand h1 { font-size: 1.4rem; letter-spacing: .06em; color: var(--gold2); font-weight: normal; }
nav { display: flex; gap: .4rem; }
.tab-btn {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  padding: .5rem 1rem; border-radius: 999px; cursor: pointer; font-family: inherit; font-size: .95rem;
  transition: all .2s;
}
.tab-btn.active, .tab-btn:hover { color: #1a1230; background: linear-gradient(135deg, var(--gold), var(--gold2)); border-color: transparent; }
main { position: relative; z-index: 1; max-width: 860px; margin: 0 auto; padding: 2rem 1.2rem 4rem; }
.tab { display: none; }
.tab.active { display: block; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
h2 { font-size: 1.7rem; color: var(--gold2); font-weight: normal; letter-spacing: .03em; }
.sub { color: var(--muted); margin: .3rem 0 1.5rem; font-style: italic; }

.sign-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.sign-item {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 1rem; cursor: pointer; text-align: center; transition: all .2s;
}
.sign-item:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 6px 24px rgba(232,193,106,.15); }
.sign-item .sym { font-size: 1.5rem; display: block; }
.sign-item .nm { color: var(--text); font-size: 1.02rem; }
.sign-item .dt { color: var(--muted); font-size: .78rem; font-style: italic; }

.result-card {
  margin-top: 1.6rem; background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.6rem;
}
.result-card h3 { color: var(--gold2); font-weight: normal; margin-bottom: .8rem; }
.hook-note { margin-top: 1rem; color: var(--muted); font-style: italic; font-size: .9rem; }
.fine { color: var(--muted); font-size: .82rem; margin-top: .5rem; }

.tarot-controls { display: flex; flex-direction: column; gap: 1rem; max-width: 460px; }
.tarot-controls label { display: flex; flex-direction: column; gap: .4rem; color: var(--muted); font-size: .95rem; }
input, select {
  background: rgba(0,0,0,.35); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: .7rem .9rem; font-family: inherit; font-size: 1rem; width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--gold); }
.spread-picker { display: flex; gap: .6rem; }
.spread-btn {
  flex: 1; background: transparent; border: 1px solid var(--border); color: var(--muted);
  padding: .55rem; border-radius: 10px; cursor: pointer; font-family: inherit;
}
.spread-btn.active { color: #1a1230; background: linear-gradient(135deg, var(--gold), var(--gold2)); border-color: transparent; }
.cta {
  background: linear-gradient(135deg, var(--violet), #9a6fe8); color: #fff;
  border: none; border-radius: 12px; padding: .85rem 1.4rem; font-size: 1.05rem;
  cursor: pointer; font-family: inherit; letter-spacing: .02em; transition: filter .2s;
}
.cta:hover { filter: brightness(1.12); }
.cta.gold { background: linear-gradient(135deg, #b8860b, var(--gold)); color: #22160a; font-weight: bold; }
.ghost { background: transparent; border: none; color: var(--muted); padding: .6rem; cursor: pointer; font-family: inherit; }

.tarot-cards { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1.5rem 0; justify-content: center; }
.tarot-card {
  width: 150px; height: 240px; border-radius: 14px; position: relative;
  background: linear-gradient(160deg, #2b2150, #151033);
  border: 1px solid var(--gold); display: flex; align-items: center; justify-content: center;
  animation: deal .5s ease; box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
@keyframes deal { from { transform: translateY(-30px) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
.tarot-card .card-inner { text-align: center; padding: .8rem; }
.tarot-card .card-sym { font-size: 2.4rem; }
.tarot-card .card-name { color: var(--gold2); font-size: 1.02rem; margin-top: .5rem; }
.tarot-card .card-kw { color: var(--muted); font-size: .78rem; font-style: italic; margin-top: .3rem; }
.tarot-card .rev { color: #e08a8a; font-size: .75rem; margin-top: .3rem; }

.chart-form { display: flex; flex-direction: column; gap: 1rem; max-width: 460px; }
.chart-form label { display: flex; flex-direction: column; gap: .4rem; color: var(--muted); font-size: .95rem; }
.chart-table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.chart-table td { padding: .45rem .6rem; border-bottom: 1px solid var(--border); font-size: .95rem; }
.chart-table td:first-child { color: var(--muted); width: 45%; }
.bal-row { display: flex; gap: .6rem; flex-wrap: wrap; margin: .4rem 0 1rem; }
.bal-chip { background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: .3rem .8rem; font-size: .85rem; color: var(--muted); }
.bal-chip b { color: var(--gold2); }

.modal { position: fixed; inset: 0; background: rgba(5,3,15,.8); z-index: 10; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-box {
  background: #1b1438; border: 1px solid var(--gold); border-radius: 18px;
  padding: 1.8rem; max-width: 420px; width: 100%; display: flex; flex-direction: column; gap: .9rem;
}
.modal-box h3 { color: var(--gold2); font-weight: normal; }
.hidden { display: none !important; }
footer { position: relative; z-index: 1; text-align: center; color: var(--muted); padding: 1.5rem; font-size: .85rem; border-top: 1px solid var(--border); }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; margin-right: .4rem; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 480px) {
  header { flex-direction: column; gap: .8rem; }
  .tarot-card { width: 110px; height: 185px; }
}
.compat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: 720px; margin-bottom: 1rem; }
.compat-half { display: flex; flex-direction: column; gap: .8rem; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 1rem; }
.compat-half label { display: flex; flex-direction: column; gap: .4rem; color: var(--muted); font-size: .95rem; }
.divider { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
footer a { color: var(--gold2); text-decoration: none; }
footer a:hover { text-decoration: underline; }
.page { max-width: 720px; margin: 0 auto; padding: 2rem 1.2rem 4rem; }
.page h2 { margin-bottom: 1rem; }
.page p, .page li { color: var(--muted); margin-bottom: .8rem; font-size: .98rem; }
.page h3 { color: var(--gold2); font-weight: normal; margin: 1.4rem 0 .6rem; }
@media (max-width: 640px) { .compat-grid { grid-template-columns: 1fr; } }


/* ===== real tarot card images ===== */
.tarot-card {
  width: 150px; height: auto; background: none; border: none;
  display: block; padding: 0;
}
.tarot-card .card-inner { padding: 0; }
.card-img {
  width: 100%; display: block; border-radius: 12px;
  border: 1px solid var(--gold);
  box-shadow: 0 8px 22px rgba(0,0,0,.45);
  background: #151033;
}
.card-img.is-rev { transform: rotate(180deg); }
.tarot-card .card-name { font-size: .92rem; margin-top: .55rem; }
.tarot-card .rev { margin-top: .2rem; }
.tarot-card .card-kw { margin-top: .2rem; }
@media (max-width: 640px){
  .tarot-card { width: 110px; height: auto; }
}
