@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=Sora:wght@400;500;600;700&display=swap");

:root {
  --ink: #1d2430;
  --ink-soft: #546072;
  --bg: #f2ede2;
  --bg-deep: #121f34;
  --panel: #fdf8ee;
  --panel-alt: #f6edd8;
  --line: #d4c5a8;
  --accent: #b9832e;
  --accent-strong: #8f5f17;
  --accent-cold: #2f6b7d;
  --shadow: 0 12px 34px rgba(16, 22, 34, 0.18);
  --soft-shadow: 0 6px 18px rgba(15, 20, 30, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Sora", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 12%, rgba(255, 247, 228, 0.32), transparent 30%),
    radial-gradient(circle at 86% 30%, rgba(116, 174, 196, 0.2), transparent 34%),
    linear-gradient(180deg, #26395f 0%, #334f73 25%, #d8ccb7 64%, var(--bg) 100%);
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.34;
  background-image:
    radial-gradient(circle at 8% 16%, rgba(255, 255, 255, 0.82) 0 1.2px, transparent 1.4px),
    radial-gradient(circle at 72% 12%, rgba(255, 255, 255, 0.75) 0 1.1px, transparent 1.3px),
    radial-gradient(circle at 22% 34%, rgba(255, 255, 255, 0.66) 0 1px, transparent 1.2px),
    radial-gradient(circle at 81% 42%, rgba(255, 255, 255, 0.74) 0 1.1px, transparent 1.3px),
    radial-gradient(circle at 38% 62%, rgba(255, 255, 255, 0.65) 0 1px, transparent 1.2px),
    radial-gradient(circle at 59% 74%, rgba(255, 255, 255, 0.7) 0 1px, transparent 1.2px),
    radial-gradient(circle at 12% 84%, rgba(255, 255, 255, 0.72) 0 1px, transparent 1.2px),
    radial-gradient(circle at 93% 86%, rgba(255, 255, 255, 0.72) 0 1.1px, transparent 1.3px);
}

h1,
h2,
h3,
h4,
h5 {
  font-family: "Cinzel", Georgia, serif;
  margin: 0;
  line-height: 1.2;
}

p {
  margin: 0;
}

button,
input {
  font: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(330px, 86vw);
  background:
    radial-gradient(circle at 80% 8%, rgba(255, 255, 255, 0.18), transparent 30%),
    radial-gradient(circle at 14% 78%, rgba(255, 225, 163, 0.18), transparent 38%),
    linear-gradient(165deg, rgba(11, 20, 33, 0.97), rgba(20, 32, 50, 0.95));
  color: #f8f6ef;
  padding: 1.2rem 1rem 1.8rem;
  transform: translateX(-105%);
  transition: transform 220ms ease;
  z-index: 32;
  overflow: auto;
  border-right: 1px solid rgba(240, 211, 158, 0.35);
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.sidebar-header h2 {
  font-size: 1.3rem;
  letter-spacing: 0.06em;
}

.sidebar-header h2::after {
  content: "  ✦";
  color: #f2ce89;
}

.ghost-btn {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  font-size: 1.05rem;
  padding: 0.38rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
}

.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.33rem;
}

.nav-group {
  margin-top: 0.84rem;
  padding-top: 0.78rem;
  border-top: 1px solid rgba(242, 206, 137, 0.22);
}

.nav-group p {
  font-size: 0.76rem;
  color: rgba(255, 240, 210, 0.72);
  margin-bottom: 0.3rem;
  letter-spacing: 0.08em;
}

.nav-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: #f7f4eb;
  text-align: left;
  padding: 0.63rem 0.68rem;
  border-radius: 0.56rem;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.42rem;
}

.nav-item::before {
  content: "✧";
  color: #e7c98a;
  font-size: 0.72rem;
}

.nav-item:hover,
.nav-item.active {
  background: linear-gradient(90deg, rgba(196, 144, 56, 0.28), rgba(196, 144, 56, 0.04));
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 8, 16, 0.55);
  opacity: 0;
  transition: opacity 180ms ease;
  z-index: 24;
}

.sidebar-backdrop.show {
  opacity: 1;
}

.app-main {
  min-height: 100vh;
  width: min(960px, 100%);
  margin: 0 auto;
  padding-bottom: 2.7rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 18;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.58rem 0.75rem;
  color: #f6f2e8;
  background:
    linear-gradient(180deg, rgba(12, 22, 37, 0.97), rgba(24, 37, 57, 0.95)),
    radial-gradient(circle at 50% 4%, rgba(220, 178, 98, 0.24), transparent 54%);
  box-shadow: 0 4px 16px rgba(7, 12, 19, 0.36);
  border-bottom: 1px solid rgba(242, 206, 137, 0.3);
}

.topbar h1 {
  text-align: center;
  font-size: clamp(1.04rem, 3.9vw, 1.42rem);
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-btn {
  border: 1px solid rgba(255, 255, 255, 0.19);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  width: 42px;
  height: 38px;
  cursor: pointer;
}

.topbar-btn:hover {
  background: rgba(255, 255, 255, 0.17);
}

.view-container {
  padding: 0.95rem;
  display: grid;
  gap: 0.9rem;
}

.view-container > * {
  animation: rise-in 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.view-container > *:nth-child(2) {
  animation-delay: 55ms;
}

.view-container > *:nth-child(3) {
  animation-delay: 95ms;
}

.view-container > *:nth-child(4) {
  animation-delay: 130ms;
}

.panel {
  background:
    linear-gradient(150deg, rgba(255, 254, 251, 0.9), rgba(247, 237, 218, 0.9)),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 1.05rem;
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(2px);
}

.panel h2 {
  font-size: 1.48rem;
  margin-bottom: 0.28rem;
  letter-spacing: 0.015em;
}

.panel h3 {
  font-size: 1.22rem;
}

.home-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 24%, rgba(255, 255, 255, 0.42), transparent 30%),
    radial-gradient(circle at 89% 18%, rgba(255, 224, 159, 0.28), transparent 32%),
    linear-gradient(140deg, rgba(31, 57, 88, 0.89), rgba(63, 109, 138, 0.85)),
    #294665;
  color: #f8f2e8;
  border-color: rgba(242, 206, 137, 0.42);
}

.home-hero::after {
  content: "☽  ✶  ☉";
  position: absolute;
  right: 0.9rem;
  top: 0.72rem;
  letter-spacing: 0.35rem;
  font-size: 0.8rem;
  color: rgba(255, 229, 176, 0.85);
}

.home-hero .eyebrow {
  color: rgba(241, 222, 188, 0.9);
}

.home-hero h2 {
  color: #fff;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.muted {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.lead {
  font-size: 1.04rem;
  font-weight: 600;
}

.insight {
  margin-top: 0.7rem;
  margin-bottom: 0.7rem;
  color: #3d4757;
}

.primary-btn,
.secondary-btn,
.link-btn,
.quiz-choice,
.quick-item,
.sample-row,
.article-row {
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 160ms ease, background 160ms ease;
}

.card-link-btn {
  border: 0;
  background: transparent;
  padding: 0;
  width: 100%;
  max-width: 300px;
  cursor: pointer;
}

.card-link-btn .tarot-card {
  width: 100%;
}

.primary-btn,
.secondary-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.62rem 1rem;
  font-weight: 700;
}

.primary-btn {
  color: #fff8ef;
  background:
    linear-gradient(130deg, #c59138, #9a6720),
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 38%);
  box-shadow: 0 6px 16px rgba(154, 103, 32, 0.35);
}

.primary-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.secondary-btn {
  color: #273244;
  background: linear-gradient(180deg, #f6efde, #ecdfc8);
  border: 1px solid #c9b38e;
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-weight: 700;
  padding: 0;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.quick-item {
  border: 1px solid rgba(212, 197, 168, 0.8);
  border-radius: 0.88rem;
  padding: 0.84rem;
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 255, 255, 0.48), transparent 36%),
    linear-gradient(130deg, rgba(190, 139, 53, 0.2), rgba(56, 106, 122, 0.13)),
    var(--panel-alt);
  text-align: left;
  display: grid;
  gap: 0.24rem;
  box-shadow: var(--soft-shadow);
}

.quick-item:hover {
  transform: translateY(-2px);
}

.quick-item strong {
  font-family: "Cinzel", Georgia, serif;
  font-size: 1.02rem;
}

.quick-item span {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.55rem;
}

.article-list {
  display: grid;
  gap: 0.65rem;
}

.article-row {
  border: 1px solid var(--line);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.82), rgba(245, 233, 208, 0.82)),
    #f6efdd;
  border-radius: 0.88rem;
  text-align: left;
  padding: 0.85rem;
}

.article-row:hover {
  transform: translateY(-2px);
  box-shadow: var(--soft-shadow);
}

.article-row h3,
.article-row h4 {
  margin-top: 0.22rem;
  margin-bottom: 0.22rem;
  font-size: 1.12rem;
}

.article-row p {
  color: #4e596a;
}

.article-list.compact .article-row h4 {
  font-size: 1rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  background: #e9dbc0;
  color: #66411a;
  padding: 0.2rem 0.5rem;
}

.chip.alt {
  background: #dce8f4;
  color: #1e4b62;
}

.daily-card-wrap {
  margin-top: 0.65rem;
  display: flex;
  justify-content: center;
}

.history-list {
  display: grid;
  gap: 0.48rem;
  margin-top: 0.6rem;
}

.history-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.7rem;
  border-radius: 0.82rem;
  border: 1px solid var(--line);
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.6), rgba(224, 235, 240, 0.3)),
    rgba(255, 255, 255, 0.5);
  padding: 0.56rem 0.68rem;
}

.history-date {
  display: grid;
  align-content: center;
  text-align: center;
  border-right: 1px solid rgba(199, 179, 140, 0.62);
  padding-right: 0.5rem;
}

.history-date strong {
  font-size: 1.45rem;
  font-family: "Cinzel", Georgia, serif;
}

.history-date span {
  font-size: 0.66rem;
  color: var(--ink-soft);
}

.history-content {
  display: grid;
  align-items: center;
  color: var(--ink-soft);
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
}

.week-card {
  border-radius: 0.95rem;
  background:
    radial-gradient(circle at 20% 14%, rgba(255, 255, 255, 0.58), transparent 40%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(231, 223, 204, 0.72));
  border: 1px solid var(--line);
  padding: 0.76rem;
  display: grid;
  gap: 0.55rem;
  box-shadow: var(--soft-shadow);
}

.week-card h3 {
  text-align: center;
  font-size: 1.05rem;
}

.active-week {
  border-color: #b88637;
  box-shadow: inset 0 0 0 1px rgba(196, 144, 56, 0.58), var(--soft-shadow);
}

.week-card-body {
  display: grid;
  place-items: center;
}

.spread-grid {
  display: grid;
  gap: 0.65rem;
}

.spread-grid.free {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.spread-grid.relationship,
.spread-grid.sample {
  grid-template-columns: 1fr;
}

.spread-item {
  border-radius: 0.88rem;
  border: 1px solid var(--line);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.74), rgba(243, 234, 216, 0.74)),
    rgba(255, 255, 255, 0.62);
  padding: 0.72rem;
  display: grid;
  gap: 0.48rem;
}

.spread-item h4 {
  font-size: 0.95rem;
}

.spread-item p {
  color: #455366;
  font-size: 0.88rem;
}

.segment-tabs {
  display: flex;
  border-radius: 999px;
  background: linear-gradient(180deg, #d6c5a4, #cfbc98);
  padding: 0.22rem;
  gap: 0.25rem;
  margin-bottom: 0.65rem;
}

.segment-btn {
  flex: 1;
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 0.45rem 0.5rem;
  color: #5b4930;
  font-weight: 700;
  font-size: 0.8rem;
}

.segment-btn.active {
  background: #fdf8ed;
  color: #283142;
  box-shadow: var(--soft-shadow);
}

.list-panel {
  padding: 0.52rem;
}

.sample-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(232, 245, 245, 0.42)),
    rgba(255, 255, 255, 0.62);
  padding: 0.78rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  text-align: left;
}

.sample-row:hover {
  transform: translateY(-2px);
}

.sample-row + .sample-row {
  margin-top: 0.52rem;
}

.sample-row h3 {
  margin-bottom: 0.2rem;
  font-size: 1.06rem;
}

.sample-row p {
  color: var(--ink-soft);
  font-size: 0.87rem;
}

.text-input {
  width: 100%;
  border-radius: 0.66rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  padding: 0.6rem 0.66rem;
  margin-top: 0.56rem;
  margin-bottom: 0.56rem;
}

.glossary-list {
  display: grid;
  gap: 0.45rem;
}

.glossary-item {
  border: 1px solid var(--line);
  border-radius: 0.74rem;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(237, 249, 252, 0.4)),
    rgba(255, 255, 255, 0.58);
  padding: 0.68rem;
}

.glossary-item h3 {
  font-size: 1rem;
  margin-bottom: 0.18rem;
}

.glossary-item p {
  color: #4f5c6d;
  font-size: 0.86rem;
}

.article-detail p {
  line-height: 1.62;
  color: #384457;
}

.article-detail .lead {
  margin-top: 0.5rem;
}

.article-detail p + p {
  margin-top: 0.65rem;
}

.tarot-detail {
  display: grid;
  gap: 0.6rem;
}

.detail-image-wrap {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  border-radius: 0.9rem;
  overflow: hidden;
  border: 1px solid rgba(47, 64, 92, 0.26);
  background: linear-gradient(145deg, #f9efc8, #f2e3b0);
}

.detail-image-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

.detail-image-fallback {
  display: none;
  padding: 0.4rem;
}

.detail-image-wrap.missing .detail-image-fallback {
  display: block;
}

.detail-sections {
  display: grid;
  gap: 0.55rem;
}

.detail-item {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.78), rgba(237, 227, 202, 0.74));
  padding: 0.68rem 0.74rem;
}

.detail-item h3 {
  font-size: 0.98rem;
  margin-bottom: 0.22rem;
}

.detail-item p {
  font-size: 0.88rem;
  color: #3d4a5d;
  line-height: 1.5;
}

.range-label {
  display: inline-block;
  margin-top: 0.5rem;
  margin-bottom: 0.36rem;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  margin-bottom: 0.72rem;
}

.quiz-choices {
  display: grid;
  gap: 0.56rem;
  margin-top: 0.85rem;
}

.quiz-choice {
  border: 1px solid var(--line);
  border-radius: 0.76rem;
  text-align: left;
  padding: 0.66rem 0.75rem;
  background: linear-gradient(140deg, #fbf5e8, #f1e5cb);
}

.quiz-choice:hover {
  background: linear-gradient(140deg, #f8f0df, #ead7b3);
}

.review-item {
  border-radius: 0.76rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  padding: 0.64rem;
}

.review-item h4 {
  margin-bottom: 0.2rem;
  font-size: 0.96rem;
}

.review-item p {
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.review-item.ok {
  border-color: rgba(47, 112, 72, 0.36);
}

.review-item.wrong {
  border-color: rgba(170, 56, 56, 0.32);
}

.tarot-card {
  width: 100%;
  border-radius: 0.98rem;
  border: 1px solid #2d3f5f;
  padding: 0.58rem;
  color: #142131;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.38), transparent 36%),
    radial-gradient(circle at 86% 82%, rgba(129, 195, 211, 0.2), transparent 40%),
    linear-gradient(150deg, #f8e18b 0%, #e9cb70 45%, #f4e8b7 100%);
  display: grid;
  gap: 0.25rem;
  justify-items: center;
  text-align: center;
  min-height: 180px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(19, 28, 45, 0.18);
}

.tarot-card.with-image {
  padding-top: 0.42rem;
}

.tarot-card-image {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 0.62rem;
  overflow: hidden;
  border: 1px solid rgba(35, 53, 82, 0.35);
  background: linear-gradient(150deg, rgba(250, 245, 229, 0.95), rgba(211, 228, 232, 0.45));
  margin-bottom: 0.18rem;
}

.tarot-card-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.tarot-card-image.missing {
  display: none;
}

.tarot-card::before {
  content: "✶";
  position: absolute;
  top: 0.38rem;
  right: 0.48rem;
  font-size: 0.72rem;
  color: rgba(34, 52, 80, 0.6);
}

.tarot-card.small {
  min-height: 152px;
}

.tarot-card.large {
  min-height: 216px;
  max-width: 290px;
}

.tarot-card.reversed {
  transform: rotate(180deg);
}

.tarot-number {
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 0.78rem;
}

.tarot-name {
  font-size: 1.02rem;
  line-height: 1.15;
}

.tarot-subname,
.tarot-meta {
  font-size: 0.77rem;
}

.tarot-meta {
  color: rgba(28, 41, 59, 0.86);
}

.tarot-card.back {
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.2), transparent 36%),
    linear-gradient(160deg, #253b57, #17273d);
  color: #ececf2;
  border: 1px dashed rgba(231, 204, 150, 0.76);
}

.tarot-card.back .sigil {
  font-size: 1.5rem;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 760px) {
  .view-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    padding: 1rem;
  }

  .view-container > .panel,
  .view-container > section,
  .view-container > article {
    grid-column: span 2;
  }

  .quick-grid,
  .week-grid,
  .spread-grid.free {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .quick-grid .quick-item {
    grid-column: span 2;
  }

  .spread-grid.relationship,
  .spread-grid.sample {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar {
    width: 348px;
  }
}

@media (max-width: 420px) {
  .panel h2 {
    font-size: 1.34rem;
  }

  .quick-item strong {
    font-size: 0.95rem;
  }

  .sample-row h3 {
    font-size: 0.98rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
