:root {
  --bg: #f7efe3;
  --panel: #fbf6ee;
  --navy: #2f4169;
  --navy-soft: #3e4f78;
  --text: #5a4033;
  --muted: #7b6557;
  --gold: #c9a46a;
  --gold-soft: #d8be91;
  --pink: #d98c9e;
  --pink-deep: #c9788c;
  --pink-soft: #e9b7be;
  --ivory: #fff8f0;
  --shadow: 0 18px 42px rgba(47, 65, 105, 0.16);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 8px 0 92px;
  color: var(--text);
  font-family: "Noto Sans TC", "Microsoft YaHei", "Microsoft JhengHei", sans-serif;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(247, 239, 227, 0.12), rgba(247, 239, 227, 0.12)),
    url("./assets/ui/bg-texture.png");
  background-repeat: repeat;
  background-size: 480px auto;
}

body::before {
  position: fixed;
  inset: 4px;
  z-index: -1;
  border: 2.5px solid rgba(201, 164, 106, 0.72);
  border-radius: 24px;
  content: "";
  pointer-events: none;
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(100% - 18px, 520px);
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.hero-section,
.question-section,
.spread-section,
.draw-section,
.result-section,
.app-page {
  position: relative;
  border: 3px solid var(--gold);
  border-radius: 26px;
  background: rgba(251, 246, 238, 0.84);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-section::before,
.question-section::before,
.spread-section::before,
.draw-section::before,
.result-section::before,
.app-page::before {
  position: absolute;
  inset: 10px;
  border: 1.5px solid rgba(201, 164, 106, 0.62);
  border-radius: 19px;
  content: "";
  pointer-events: none;
}

[data-page][hidden] {
  display: none;
}

.hero-section {
  min-height: 640px;
  padding: 42px 18px 28px;
  display: grid;
  justify-items: center;
  align-content: start;
  text-align: center;
}

.hero-subtitle {
  order: 2;
  margin: -8px 0 18px;
  color: var(--pink-deep);
  font-family: "Cormorant Garamond", "Noto Serif TC", serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.28em;
}

h1 {
  order: 1;
  margin: 4px 0 14px;
  color: var(--text);
  font-family: "Noto Serif TC", "Microsoft YaHei", serif;
  font-size: clamp(2.15rem, 9.4vw, 3.35rem);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: 0.1em;
}

.hero-card-frame {
  order: 3;
  width: min(73%, 270px);
  margin: 0 auto 20px;
  padding: 12px;
  border: 2px solid var(--gold);
  border-radius: 24px;
  background: rgba(255, 248, 240, 0.74);
  box-shadow: 0 18px 34px rgba(47, 65, 105, 0.2);
}

.hero-card-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: contain;
  border-radius: 14px;
}

.intro-steps {
  order: 4;
  width: min(100%, 30rem);
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.72;
  list-style: none;
  text-align: left;
}

.intro-steps li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.intro-steps li:nth-child(3) {
  white-space: nowrap;
}

.intro-steps li::before {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(201, 164, 106, 0.72);
  border-radius: 999px;
  color: var(--pink-deep);
  background: var(--ivory);
  content: attr(data-step);
  font-weight: 700;
}

.spread-section {
  padding: 24px 16px 26px;
}

.question-section {
  padding: 24px 16px 26px;
}

.question-panel,
.deep-insight-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  padding: 20px 18px 22px;
  border: 2px solid rgba(201, 164, 106, 0.7);
  border-radius: 22px;
  background: rgba(255, 248, 240, 0.66);
  box-shadow: inset 0 0 0 1px rgba(255, 248, 240, 0.82);
}

.question-panel label,
.deep-insight-card h2 {
  margin: 0;
  color: var(--text);
  font-family: "Noto Serif TC", "Microsoft YaHei", serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
}

.question-panel textarea {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  padding: 14px 16px;
  border: 1.5px solid rgba(185, 145, 94, 0.72);
  border-radius: 18px;
  color: var(--text);
  background: rgba(255, 252, 246, 0.9);
  box-shadow: inset 0 2px 8px rgba(47, 65, 105, 0.06);
  font: 500 1rem/1.7 "Noto Sans TC", "Microsoft YaHei", sans-serif;
}

.question-panel textarea:focus {
  outline: 2px solid rgba(201, 164, 106, 0.32);
  border-color: var(--navy);
}

.question-panel p,
.deep-insight-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 500;
  line-height: 1.75;
  text-align: center;
}

.section-title {
  position: relative;
  z-index: 1;
  width: min(78%, 300px);
  min-height: 58px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  color: #f8e4be;
  font-family: "Noto Serif TC", "Microsoft YaHei", serif;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-align: center;
  background-image: url("./assets/ui-clean/section-title-frame.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
}

.spread-selector {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  border: 0;
}

.spread-selector legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.spread-option {
  position: relative;
  min-height: 186px;
  display: block;
  cursor: pointer;
}

.spread-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.spread-option span {
  position: relative;
  height: 100%;
  padding: 18px 10px 14px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
  border: 2px solid rgba(185, 145, 94, 0.78);
  border-radius: 22px;
  background: rgba(255, 248, 240, 0.68);
  box-shadow: inset 0 0 0 1px rgba(255, 248, 240, 0.76), 0 10px 22px rgba(47, 65, 105, 0.1);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.spread-option span::before,
.spread-option span::after {
  position: absolute;
  width: 26px;
  height: 26px;
  border-color: rgba(201, 164, 106, 0.72);
  content: "";
}

.spread-option span::before {
  top: 9px;
  left: 9px;
  border-top: 1.5px solid;
  border-left: 1.5px solid;
}

.spread-option span::after {
  right: 9px;
  bottom: 9px;
  border-right: 1.5px solid;
  border-bottom: 1.5px solid;
}

.spread-option strong {
  color: var(--text);
  font-family: "Noto Serif TC", "Microsoft YaHei", serif;
  font-size: 1.48rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.spread-option small {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.rabbit-wand {
  width: 86px;
  margin-top: 4px;
  display: block;
}

.preview-cards {
  position: relative;
  width: 128px;
  height: 88px;
  margin-top: 12px;
  display: block;
}

.preview-cards i {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 48px;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  background-image: url("./assets/ui-clean/card-back.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  box-shadow: 0 8px 14px rgba(47, 65, 105, 0.18);
}

.preview-cards i:nth-child(1) {
  transform: translateX(-64px) rotate(-10deg);
}

.preview-cards i:nth-child(2) {
  transform: translateX(-24px);
  z-index: 1;
}

.preview-cards i:nth-child(3) {
  transform: translateX(16px) rotate(10deg);
}

.spread-option input:checked + span {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(201, 164, 106, 0.22), 0 14px 28px rgba(47, 65, 105, 0.16);
  transform: translateY(-2px);
}

.action-row {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  display: grid;
  justify-items: center;
  gap: 12px;
}

.primary-button,
.secondary-button {
  width: min(100%, 310px);
  min-height: 66px;
  padding: 14px 26px 16px;
  border: 0;
  cursor: pointer;
  color: var(--ivory);
  font-family: "Noto Serif TC", "Microsoft YaHei", serif;
  font-size: 1.36rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-align: center;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  filter: drop-shadow(0 12px 16px rgba(151, 91, 103, 0.2));
  transition:
    transform 180ms ease,
    filter 180ms ease;
}

.primary-button {
  background-image: url("./assets/ui-clean/button-primary.png");
}

.secondary-button {
  color: var(--text);
  background-image: url("./assets/ui-clean/button-secondary.png");
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-2px);
  filter: drop-shadow(0 14px 20px rgba(47, 65, 105, 0.2)) brightness(1.03);
}

.draw-section {
  min-height: 430px;
  padding: 22px 14px;
}

.draw-panel,
.reading-results.is-empty,
.reading-card {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 390px;
  padding: 42px 28px 34px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  background-image: url("./assets/ui-clean/result-container-frame.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  text-align: center;
}

.draw-panel {
  min-height: 330px;
  padding: 28px 22px;
  border: 2px solid rgba(201, 164, 106, 0.72);
  border-radius: 22px;
  background-image: none;
  background-color: rgba(255, 248, 240, 0.62);
  box-shadow: inset 0 0 0 1px rgba(255, 248, 240, 0.86);
}

.draw-panel:has(.shuffle-area:not([hidden])) .draw-placeholder,
.draw-panel:has(.fan-area:not([hidden])) .draw-placeholder {
  display: none;
}

.draw-placeholder p,
.shuffle-area p,
.fan-title,
.empty-title {
  margin: 0;
  color: var(--text);
  font-family: "Noto Serif TC", "Microsoft YaHei", serif;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.65;
}

.draw-placeholder span,
.fan-hint,
.empty-copy {
  max-width: 20rem;
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 500;
  line-height: 1.82;
}

.shuffle-area,
.fan-area {
  width: 100%;
  display: grid;
  place-items: center;
  gap: 18px;
}

.shuffle-deck {
  position: relative;
  width: 174px;
  height: 261px;
  perspective: 900px;
}

.card-back,
.fan-card-back {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background-image: url("./assets/ui-clean/card-back.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  box-shadow: 0 18px 28px rgba(47, 65, 105, 0.2);
}

.card-back-1 {
  animation: shuffleLeft 1.8s ease-in-out infinite;
}

.card-back-2 {
  animation: shuffleRight 1.8s ease-in-out 120ms infinite;
}

.card-back-3 {
  animation: shuffleFlip 1.8s ease-in-out 240ms infinite;
}

.card-back-4 {
  animation: shuffleSlide 1.8s ease-in-out 360ms infinite;
}

.card-back-5 {
  animation: shuffleCenter 1.8s ease-in-out 480ms infinite;
}

.shuffle-area.is-stopped .card-back {
  animation-play-state: paused;
}

.fan-area {
  overflow: hidden;
  overflow-y: hidden;
  justify-content: center;
}

.fan-title,
.fan-hint {
  justify-self: center;
  text-align: center;
}

.fan-deck {
  position: relative;
  width: min(100%, 360px);
  height: auto;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px 7px;
  place-items: center;
  padding: 4px 0;
}

.fan-card {
  position: relative;
  left: auto;
  bottom: auto;
  width: min(100%, 48px);
  aspect-ratio: 2 / 3;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transform: translateY(var(--lift, 0px));
  transform-origin: 50% 50%;
  transition:
    filter 180ms ease,
    transform 180ms ease,
    opacity 180ms ease;
}

.fan-card:hover,
.fan-card:focus-visible {
  --lift: -10px;
  z-index: 10;
  outline: 0;
}

.fan-card.is-selected {
  --lift: -14px;
  cursor: default;
  filter: drop-shadow(0 12px 18px rgba(201, 164, 106, 0.45));
  z-index: 20;
}

.fan-card.is-selected::after {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ivory);
  border-radius: 999px;
  color: var(--ivory);
  background: var(--pink-deep);
  box-shadow: 0 8px 16px rgba(47, 65, 105, 0.22);
  content: attr(data-pick);
  font-size: 0.82rem;
  font-weight: 700;
}

.fan-card:disabled:not(.is-selected) {
  cursor: default;
  opacity: 0.45;
}

.result-section {
  padding: 22px 14px 26px;
}

.app-page {
  min-height: 640px;
  padding: 26px 14px 30px;
}

.result-title {
  margin-bottom: 12px;
}

.reading-results {
  position: relative;
  z-index: 1;
  width: 100%;
  display: grid;
  gap: 18px;
  justify-items: center;
}

.reading-results.is-empty {
  min-height: 390px;
}

.reading-results.single-spread,
.reading-results.three-card-spread {
  grid-template-columns: minmax(0, 1fr);
}

.reading-card {
  max-width: 430px;
  min-height: auto;
  padding: 30px 18px 24px;
  align-content: start;
  overflow: visible;
  border: 2px solid rgba(201, 164, 106, 0.68);
  border-radius: 24px;
  background-image: none;
  background-color: rgba(255, 248, 240, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 248, 240, 0.82), 0 12px 24px rgba(47, 65, 105, 0.08);
}

.position-label {
  min-width: 92px;
  margin: 0;
  padding: 7px 14px;
  border: 1.5px solid var(--gold);
  border-radius: 999px;
  color: var(--pink-deep);
  background: var(--ivory);
  font-weight: 700;
  text-align: center;
}

.tarot-card {
  width: min(100%, 300px);
  min-width: 0;
}

.tarot-border {
  display: grid;
  gap: 12px;
}

.tarot-header {
  display: flex;
  justify-content: center;
  gap: 12px;
  color: var(--text);
  font-weight: 700;
}

.card-number,
.card-orientation {
  min-height: 32px;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  border: 1.5px solid rgba(201, 164, 106, 0.64);
  border-radius: 999px;
  background: var(--ivory);
}

.card-orientation {
  color: var(--pink-deep);
}

.tarot-art {
  width: min(100%, 190px);
  margin: 0 auto;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 20px rgba(47, 65, 105, 0.14);
}

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

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

.tarot-info {
  width: min(100%, 300px);
  min-width: 0;
  margin: 0 auto;
}

.card-kicker {
  width: max-content;
  max-width: 100%;
  margin: 0 auto 8px;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--gold);
  background: var(--navy);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tarot-card h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-family: "Noto Serif TC", "Microsoft YaHei", serif;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.12em;
}

.keyword-row {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 10px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text);
  background: #f2e6d4;
  font-size: 0.86rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.card-description {
  width: 100%;
  max-width: 100%;
  margin: 12px auto 0;
  padding: 14px 16px;
  border: 1.5px solid rgba(201, 164, 106, 0.46);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 252, 246, 0.66);
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.78;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.reading-results.three-card-spread .reading-card {
  padding-bottom: 24px;
}

.deep-insight-card {
  min-height: auto;
  padding: 22px 18px 24px;
}

.deep-insight-card .secondary-button {
  justify-self: center;
  width: min(100%, 340px);
  font-size: 1.08rem;
  letter-spacing: 0.08em;
}

.deep-insight-status {
  min-height: 1.5em;
  color: var(--pink-deep);
}

.deep-insight-status a {
  color: var(--navy);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.archive-panel,
.guide-panel,
.about-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  padding: 20px 16px 22px;
  border: 2px solid rgba(201, 164, 106, 0.7);
  border-radius: 22px;
  background: rgba(255, 248, 240, 0.64);
  box-shadow: inset 0 0 0 1px rgba(255, 248, 240, 0.82);
}

.about-image-panel {
  padding: 0;
  overflow: hidden;
  border-color: rgba(47, 65, 105, 0.42);
  background: transparent;
}

.about-image-panel img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
}

.archive-list,
.guide-list {
  display: grid;
  gap: 14px;
}

.archive-empty,
.library-empty {
  min-height: 280px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
}

.record-card,
.library-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1.5px solid rgba(185, 145, 94, 0.66);
  border-radius: 18px;
  background: rgba(251, 246, 238, 0.86);
  box-shadow: 0 10px 20px rgba(47, 65, 105, 0.08);
}

.record-card::before,
.library-card::before {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(201, 164, 106, 0.42);
  border-radius: 12px;
  content: "";
  pointer-events: none;
}

.record-header,
.library-header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.record-title,
.library-card h3 {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--text);
  font-family: "Noto Serif TC", "Microsoft YaHei", serif;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.record-question {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.65;
}

.record-cards,
.library-body {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
}

.record-item,
.library-body {
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
}

.record-item {
  display: grid;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.38);
}

.record-thumb,
.library-thumb {
  width: 72px;
  aspect-ratio: 2 / 3;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 14px rgba(47, 65, 105, 0.14);
}

.record-item.is-reversed .record-thumb,
.library-thumb.is-reversed {
  transform: rotate(180deg);
}

.record-meta,
.library-meta {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: var(--text);
  font-weight: 600;
}

.record-keywords,
.library-meaning {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.library-body {
  display: grid;
}

.library-meaning {
  margin: 0;
}

.library-meaning strong {
  color: var(--navy);
  font-weight: 700;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  width: min(100%, 520px);
  aspect-ratio: 2508 / 627;
  min-height: 0;
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  border: 0;
  background-image: url("./assets/ui-clean/bottom-nav-style.png");
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: 100% 100%;
  filter: drop-shadow(0 -8px 18px rgba(47, 65, 105, 0.22));
}

.bottom-nav a {
  display: block;
  color: transparent;
  font-size: 0;
  text-decoration: none;
}

.install-prompt {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: end center;
  padding: 18px 14px 108px;
  background: rgba(47, 65, 105, 0.26);
}

.install-prompt[hidden] {
  display: none;
}

.install-prompt-card {
  width: min(100%, 480px);
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border: 2px solid rgba(201, 164, 106, 0.88);
  border-radius: 24px;
  color: var(--text);
  background: rgba(255, 248, 240, 0.96);
  box-shadow: 0 18px 34px rgba(47, 65, 105, 0.28), inset 0 0 0 1px rgba(255, 248, 240, 0.9);
}

.install-prompt-card img {
  width: 74px;
  height: 74px;
  border: 1.5px solid rgba(201, 164, 106, 0.68);
  border-radius: 18px;
  box-shadow: 0 8px 16px rgba(47, 65, 105, 0.14);
}

.install-prompt-card h2 {
  margin: 0 0 6px;
  font-family: "Noto Serif TC", "Microsoft YaHei", serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.install-prompt-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.65;
}

.install-prompt-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.install-prompt-actions .primary-button,
.install-prompt-actions .secondary-button {
  width: 100%;
  min-height: 54px;
  padding: 10px 18px 12px;
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.install-help {
  grid-column: 1 / -1;
  text-align: center;
}

@keyframes shuffleLeft {
  0%, 100% { transform: translateX(0) rotate(-5deg); }
  45% { transform: translateX(-72px) translateY(8px) rotate(-18deg); }
  70% { transform: translateX(22px) rotate(7deg); }
}

@keyframes shuffleRight {
  0%, 100% { transform: translateX(0) rotate(4deg); }
  45% { transform: translateX(72px) translateY(-6px) rotate(17deg); }
  70% { transform: translateX(-22px) rotate(-6deg); }
}

@keyframes shuffleFlip {
  0%, 100% { transform: rotateY(0deg) rotate(1deg); }
  50% { transform: rotateY(64deg) translateY(-18px) rotate(-4deg); }
}

@keyframes shuffleSlide {
  0%, 100% { transform: translateY(0) rotate(7deg); }
  50% { transform: translateY(-32px) translateX(16px) rotate(13deg); }
}

@keyframes shuffleCenter {
  0%, 100% { transform: translateY(0) scale(0.97) rotate(-1deg); }
  50% { transform: translateY(22px) scale(1.03) rotate(3deg); }
}

@media (min-width: 760px) {
  body {
    padding-top: 18px;
  }

  .page-shell {
    width: min(100% - 44px, 760px);
  }

  .reading-results.three-card-spread .reading-card {
    padding-right: 48px;
    padding-left: 48px;
  }
}

@media (min-width: 1024px) {
  body {
    padding: 24px 0 118px;
  }

  .page-shell {
    width: min(100% - 64px, 1180px);
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    align-items: start;
    gap: 22px;
  }

  .hero-section,
  .result-section,
  .app-page {
    grid-column: 1 / -1;
  }

  .hero-section {
    min-height: auto;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    column-gap: 34px;
    padding: 54px 56px 48px;
    text-align: left;
  }

  .hero-section h1,
  .hero-subtitle,
  .intro-steps {
    justify-self: start;
    grid-column: 1;
  }

  .hero-section h1 {
    margin-top: 24px;
    font-size: clamp(3.2rem, 5vw, 5rem);
  }

  .hero-subtitle {
    text-align: left;
  }

  .hero-card-frame {
    grid-column: 2;
    grid-row: 1 / span 3;
    width: min(100%, 340px);
    margin: 0;
    align-self: center;
  }

  .intro-steps {
    width: min(100%, 38rem);
    font-size: 1.06rem;
  }

  .question-section,
  .spread-section {
    min-height: 360px;
  }

  .draw-section {
    grid-column: 1 / -1;
    min-height: 470px;
    padding: 28px 24px;
  }

  .draw-panel {
    min-height: 390px;
  }

  .fan-deck {
    position: relative;
    display: block;
    width: 100%;
    max-width: 760px;
    height: 330px;
    padding: 0;
  }

  .fan-card {
    position: absolute;
    left: 50%;
    bottom: var(--row-y, 0px);
    width: 72px;
    transform:
      translateX(calc(-50% + var(--offset)))
      translateY(calc(var(--curve, 0px) + var(--lift, 0px)))
      rotate(var(--angle));
    transform-origin: 50% 140%;
  }

  .fan-card:hover,
  .fan-card:focus-visible {
    --lift: -22px;
  }

  .fan-card.is-selected {
    --lift: -36px;
  }

  .reading-results.three-card-spread {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  .reading-results.three-card-spread .deep-insight-card,
  .reading-results.single-spread .deep-insight-card {
    grid-column: 1 / -1;
  }

  .reading-results.three-card-spread .reading-card {
    max-width: 100%;
    padding: 26px 16px 22px;
  }

  .reading-results.three-card-spread .tarot-card {
    width: min(100%, 230px);
  }

  .reading-results.three-card-spread .tarot-art {
    width: min(100%, 142px);
  }

  .reading-results.single-spread .reading-card {
    max-width: 520px;
  }

  .archive-list,
  .guide-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .about-image-panel {
    width: min(100%, 920px);
    margin: 0 auto;
  }

  .bottom-nav {
    width: min(100%, 780px);
  }
}
