:root {
  --bg: #101412;
  --surface: #18201d;
  --surface-2: #222824;
  --text: #f4f0e8;
  --muted: #b6afa4;
  --line: #353a34;
  --gold: #d9b760;
  --rose: #d77c73;
  --teal: #64b6a5;
  --ink: #101412;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(16, 20, 18, 0.92), rgba(16, 20, 18, 1)),
    repeating-linear-gradient(90deg, rgba(217, 183, 96, 0.05) 0 1px, transparent 1px 92px);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans TC", sans-serif;
  letter-spacing: 0;
}

button {
  font: inherit;
}

.app-shell {
  width: min(100%, 860px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 14px 28px;
}

.topbar,
.section-heading,
.action-row,
.tabs {
  display: flex;
  align-items: center;
}

.topbar,
.section-heading {
  justify-content: space-between;
  gap: 16px;
}

.eyebrow,
.muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  margin: 2px 0 0;
  font-size: 1.7rem;
  line-height: 1.12;
}

h2 {
  margin: 3px 0 0;
  font-size: 1.25rem;
}

h3 {
  margin: 4px 0 8px;
  font-size: 1.1rem;
}

.icon-button,
.primary-button,
.secondary-button,
.product-button {
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.icon-button {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  background: var(--surface);
  color: var(--gold);
  border-color: var(--line);
  font-size: 1.1rem;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 3;
  gap: 8px;
  margin: 18px 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 32, 29, 0.94);
  backdrop-filter: blur(12px);
}

.tab {
  min-width: 0;
  height: 42px;
  flex: 1;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}

.tab span {
  display: inline-block;
  margin-right: 4px;
  color: var(--gold);
}

.tab.active {
  background: var(--gold);
  color: var(--ink);
}

.tab.active span {
  color: var(--ink);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.daily-layout {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 18px;
  align-items: stretch;
}

.tarot-card {
  min-height: 352px;
  border: 1px solid rgba(217, 183, 96, 0.65);
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(217, 183, 96, 0.18), rgba(100, 182, 165, 0.08)),
    var(--surface);
  box-shadow: var(--shadow);
  padding: 12px;
}

.card-frame {
  display: grid;
  min-height: 326px;
  grid-template-rows: auto 1fr auto auto;
  align-items: center;
  justify-items: center;
  border: 1px solid rgba(244, 240, 232, 0.22);
  border-radius: 6px;
  padding: 14px;
  text-align: center;
}

.card-number {
  width: 100%;
  margin: 0;
  color: var(--muted);
  text-align: left;
}

.card-sigil {
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  border: 1px solid rgba(217, 183, 96, 0.85);
  border-radius: 50%;
  color: var(--gold);
  font-size: 3rem;
  font-family: Georgia, "Times New Roman", serif;
}

.card-frame h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
}

.card-frame p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
}

.daily-copy {
  display: flex;
  min-height: 352px;
  flex-direction: column;
  justify-content: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
}

.daily-copy p {
  max-width: 48rem;
  line-height: 1.72;
}

.action-row {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.primary-button,
.secondary-button,
.product-button {
  min-height: 44px;
  padding: 0 16px;
  font-weight: 700;
}

.primary-button {
  background: var(--gold);
  color: var(--ink);
}

.secondary-button {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.progress-track {
  height: 10px;
  margin: 14px 0 18px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

#deck-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--rose));
  transition: width 220ms ease;
}

.deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 10px;
}

.mini-card,
.achievement-item,
.product-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.mini-card {
  display: grid;
  min-height: 112px;
  place-items: center;
  padding: 10px;
  text-align: center;
}

.mini-card strong {
  font-size: 0.82rem;
  line-height: 1.28;
}

.mini-card span {
  color: var(--muted);
  font-size: 0.76rem;
}

.mini-card.locked {
  color: #837d74;
  background: rgba(34, 40, 36, 0.65);
}

.achievement-list,
.shop-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.achievement-item,
.product-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
}

.achievement-item.done {
  border-color: rgba(100, 182, 165, 0.75);
}

.achievement-badge {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
}

.achievement-copy {
  flex: 1;
}

.achievement-copy p,
.product-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.product-card.featured {
  border-color: rgba(217, 183, 96, 0.88);
}

.product-button {
  flex: 0 0 auto;
  background: var(--teal);
  color: var(--ink);
}

@media (max-width: 640px) {
  .app-shell {
    padding-inline: 12px;
  }

  .daily-layout {
    grid-template-columns: 1fr;
  }

  .tarot-card,
  .daily-copy {
    min-height: auto;
  }

  .card-frame {
    min-height: 284px;
  }

  .tabs {
    gap: 4px;
  }

  .tab {
    font-size: 0.86rem;
  }

  .tab span {
    display: block;
    margin-right: 0;
    line-height: 1;
  }

  .product-card,
  .achievement-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .product-button {
    width: 100%;
  }
}
