/* ==========================================================================
   Old Style Lenormand · 复古雷诺曼牌室
   Pure CSS, no external fonts or assets besides the local card images.
   ========================================================================== */

:root {
  --ink: #101915;
  --ink-deep: #0a110e;
  --ink-soft: #18261f;
  --ink-panel: rgba(17, 29, 23, 0.72);
  --parchment: #eee2c8;
  --parchment-deep: #e2d1b2;
  --paper-ink: #30251a;
  --paper-muted: #6e5c46;
  --ivory: #f2e8d4;
  --muted: #b6a78d;
  --muted-soft: rgba(226, 210, 181, 0.68);
  --gold: #c8a663;
  --gold-bright: #e5ce98;
  --gold-deep: #8f713d;
  --gold-line: rgba(200, 166, 99, 0.26);
  --gold-line-soft: rgba(200, 166, 99, 0.14);
  --oxblood: #8b3a32;
  --oxblood-soft: rgba(139, 58, 50, 0.12);
  --shadow-card: 0 24px 48px rgba(0, 0, 0, 0.42), 0 5px 14px rgba(0, 0, 0, 0.38);
  --font-en: "Baskerville", "Iowan Old Style", "Palatino Linotype", "Palatino", "Georgia", serif;
  --font-zh: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "Baskerville", "Georgia", serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --ease-soft: cubic-bezier(0.22, 0.8, 0.3, 1);
  --ease-card: cubic-bezier(0.19, 0.76, 0.28, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  min-height: 100%;
  background: var(--ink);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 300px;
  min-height: 100%;
  color: var(--ivory);
  background: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible {
  outline: 1px solid var(--gold-bright);
  outline-offset: 4px;
}

img,
svg {
  display: block;
}

[hidden] {
  display: none !important;
}

::selection {
  color: var(--ink);
  background: var(--gold-bright);
}

.font-en {
  font-family: var(--font-en);
}

/* --------------------------------------------------------------------------
   Table & frame
   -------------------------------------------------------------------------- */

.app-shell {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  isolation: isolate;
  overflow: hidden;
}

.table-grain {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(ellipse 42% 30% at 50% 10%, rgba(215, 178, 105, 0.085) 0%, transparent 72%),
    radial-gradient(ellipse 62% 48% at 50% 34%, rgba(58, 91, 70, 0.34) 0%, rgba(19, 35, 27, 0.7) 46%, transparent 78%),
    radial-gradient(ellipse 80% 80% at 50% 100%, rgba(4, 9, 7, 0.72) 0%, transparent 58%),
    linear-gradient(150deg, #17261f 0%, #101a15 48%, #0b120f 100%);
}

.table-grain::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.65'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.table-grain::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 64% at 50% 48%, transparent 42%, rgba(2, 6, 4, 0.48) 100%),
    repeating-linear-gradient(135deg, transparent 0 46px, rgba(200, 166, 99, 0.018) 46px 47px),
    repeating-linear-gradient(45deg, transparent 0 46px, rgba(200, 166, 99, 0.018) 46px 47px);
  pointer-events: none;
}

.gilt-frame {
  position: fixed;
  inset: 12px;
  z-index: 30;
  border: 1px solid rgba(200, 166, 99, 0.22);
  pointer-events: none;
}

.gilt-frame::before,
.gilt-frame::after {
  content: "";
  position: absolute;
  width: 34px;
  height: 34px;
  border-color: rgba(200, 166, 99, 0.56);
  border-style: solid;
}

.gilt-frame::before {
  top: -1px;
  left: -1px;
  border-width: 1px 0 0 1px;
}

.gilt-frame::after {
  right: -1px;
  bottom: -1px;
  border-width: 0 1px 1px 0;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: relative;
  z-index: 20;
  width: min(100%, 1320px);
  margin: 0 auto;
  padding: max(26px, calc(env(safe-area-inset-top) + 18px)) clamp(22px, 5vw, 64px) 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 4px 0;
  text-align: left;
}

.brand-mark {
  width: 35px;
  height: 35px;
  color: var(--gold);
  flex: none;
  transition: transform 0.8s var(--ease-soft);
}

.brand:hover .brand-mark {
  transform: rotate(22deg);
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-en {
  color: var(--muted-soft);
  font-family: var(--font-en);
  font-size: 8.5px;
  letter-spacing: 0.24em;
  line-height: 1.3;
}

.brand-zh {
  color: var(--ivory);
  font-family: var(--font-zh);
  font-size: 18px;
  letter-spacing: 0.16em;
  line-height: 1.2;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  border: 1px solid var(--gold-line-soft);
  border-radius: 999px;
  background: rgba(12, 23, 17, 0.36);
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}

.icon-button svg {
  width: 15px;
  height: 15px;
}

.icon-button .icon-sound-off {
  display: none;
}

body.sound-off .icon-button .icon-sound-on {
  display: none;
}

body.sound-off .icon-button .icon-sound-off {
  display: block;
}

.icon-button .sound-state {
  display: none;
}

.icon-button:hover {
  color: var(--gold-bright);
  border-color: var(--gold-line);
  background: rgba(200, 166, 99, 0.06);
}

.install-button {
  height: 38px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--gold-bright);
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  background: rgba(200, 166, 99, 0.055);
  font-size: 12px;
  letter-spacing: 0.12em;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}

.install-button svg {
  width: 14px;
  height: 14px;
}

.install-button:hover {
  border-color: rgba(200, 166, 99, 0.48);
  background: rgba(200, 166, 99, 0.11);
}

body.is-standalone .install-button {
  color: var(--muted-soft);
  border-color: var(--gold-line-soft);
}

/* --------------------------------------------------------------------------
   Views
   -------------------------------------------------------------------------- */

.view {
  position: relative;
  z-index: 5;
  animation: viewIn 0.7s var(--ease-soft) both;
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-home {
  min-height: calc(100vh - 84px);
  min-height: calc(100dvh - 84px);
  display: flex;
  flex-direction: column;
}

.home-hero {
  width: min(100%, 1320px);
  margin: 0 auto;
  padding: clamp(28px, 5.5vh, 72px) clamp(22px, 5vw, 64px) 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(330px, 0.92fr);
  gap: clamp(36px, 7vw, 96px);
  align-items: center;
  flex: 1;
}

.hero-copy {
  max-width: 620px;
  padding-top: 6px;
}

.eyebrow {
  margin: 0 0 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gold);
  font-family: var(--font-en);
  font-size: 9.5px;
  letter-spacing: 0.27em;
  white-space: nowrap;
}

.eyebrow span {
  display: block;
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
  opacity: 0.58;
}

.eyebrow span:last-child {
  transform: rotate(180deg);
}

h1 {
  margin: 0;
  color: var(--ivory);
  font-family: var(--font-zh);
  font-size: clamp(40px, 4.5vw, 66px);
  font-weight: 400;
  letter-spacing: 0.035em;
  line-height: 1.35;
  text-wrap: balance;
}

h1 em {
  color: var(--gold-bright);
  font-style: normal;
  position: relative;
}

h1 em::after {
  content: "";
  position: absolute;
  left: 0.02em;
  right: 0.02em;
  bottom: -0.09em;
  height: 1px;
  background: linear-gradient(90deg, var(--gold-line), var(--gold), transparent);
  opacity: 0.6;
}

.lede {
  max-width: 445px;
  margin: 22px 0 38px;
  color: var(--muted);
  font-family: var(--font-zh);
  font-size: 14px;
  letter-spacing: 0.055em;
  line-height: 2;
}

.lede-short {
  display: none;
}

.mode-section {
  max-width: 510px;
}

.section-label {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--muted-soft);
  font-family: var(--font-zh);
  font-size: 10.5px;
  letter-spacing: 0.18em;
}

.section-rule {
  flex: 1;
  height: 1px;
  background: var(--gold-line-soft);
}

.section-en {
  font-family: var(--font-en);
  font-size: 8px;
  letter-spacing: 0.16em;
  opacity: 0.75;
}

.mode-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-top: 1px solid var(--gold-line-soft);
  border-bottom: 1px solid var(--gold-line-soft);
}

.mode-card {
  position: relative;
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 15px;
  padding: 11px 12px 11px 8px;
  text-align: left;
  color: var(--muted);
  border-bottom: 1px solid var(--gold-line-soft);
  transition: color 0.35s, background 0.35s, padding 0.35s;
}

.mode-card:last-child {
  border-bottom: 0;
}

.mode-card::before {
  content: "";
  position: absolute;
  inset: 4px 0;
  border: 1px solid transparent;
  pointer-events: none;
  transition: border-color 0.35s, background 0.35s;
}

.mode-card:hover {
  color: var(--ivory);
  background: rgba(200, 166, 99, 0.035);
}

.mode-card.is-selected {
  color: var(--ivory);
  background: linear-gradient(90deg, rgba(200, 166, 99, 0.09), rgba(200, 166, 99, 0.018));
}

.mode-card.is-selected::before {
  border-color: var(--gold-line);
  background: linear-gradient(90deg, rgba(200, 166, 99, 0.035), transparent);
}

.mode-number {
  color: var(--gold-deep);
  font-family: var(--font-en);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-align: center;
  transition: color 0.35s;
}

.mode-card.is-selected .mode-number {
  color: var(--gold-bright);
}

.mode-main {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.mode-title {
  display: flex;
  align-items: baseline;
  gap: 7px;
  color: inherit;
  font-family: var(--font-zh);
  font-size: 17px;
  letter-spacing: 0.1em;
}

.mode-title span {
  color: var(--muted-soft);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.mode-card.is-selected .mode-title span {
  color: var(--gold);
}

.mode-desc {
  overflow: hidden;
  color: var(--muted-soft);
  font-family: var(--font-zh);
  font-size: 11.5px;
  letter-spacing: 0.035em;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-sigil {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  opacity: 0.48;
  transition: opacity 0.35s;
}

.mode-card.is-selected .mode-sigil {
  opacity: 1;
}

.mode-sigil span {
  display: block;
  width: 8px;
  height: 13px;
  border: 1px solid var(--gold-deep);
  border-radius: 1px;
  background: rgba(200, 166, 99, 0.06);
}

.mode-card.is-selected .mode-sigil span {
  border-color: var(--gold);
  background: rgba(200, 166, 99, 0.12);
}

.mode-sigil-two span {
  width: 10px;
  height: 16px;
}

.mode-sigil-five {
  gap: 2px;
}

.mode-sigil-five span {
  width: 5px;
  height: 10px;
}

/* --------------------------------------------------------------------------
   Tableau · deck and draw panel
   -------------------------------------------------------------------------- */

.hero-tableau {
  position: relative;
  width: 100%;
  max-width: 410px;
  justify-self: center;
  padding: 4px 0 8px;
}

.tableau-glow {
  position: absolute;
  top: 2%;
  left: 50%;
  width: 115%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 166, 99, 0.12) 0%, rgba(200, 166, 99, 0.035) 32%, transparent 67%);
  pointer-events: none;
}

.deck-area {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.deck-stage {
  position: relative;
  width: 164px;
  height: 254px;
  transform: rotate(-2.5deg);
  transition: transform 0.7s var(--ease-soft);
}

.hero-tableau:hover .deck-stage {
  transform: rotate(0deg) translateY(-3px);
}

.deck-layer {
  position: absolute;
  inset: 0;
  border-radius: 7px;
  background: #d9c7a7;
  border: 1px solid rgba(74, 55, 35, 0.38);
  box-shadow: 0 9px 18px rgba(0, 0, 0, 0.2);
}

.deck-layer-1 {
  transform: translate(7px, 7px) rotate(2.4deg);
  background: #cbb793;
  opacity: 0.76;
}

.deck-layer-2 {
  transform: translate(3px, 3px) rotate(1.2deg);
  background: #e0d0b1;
  opacity: 0.9;
}

.deck-card {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 7px;
  border: 1px solid rgba(79, 59, 37, 0.55);
  background: var(--parchment);
  box-shadow: 0 22px 36px rgba(0, 0, 0, 0.36), 0 4px 10px rgba(0, 0, 0, 0.28);
}

.card-back-mini {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  background-color: #e8d9ba;
  background-image:
    radial-gradient(circle at 50% 44%, rgba(200, 166, 99, 0.18) 0 1px, transparent 1.5px),
    radial-gradient(circle at 50% 44%, transparent 0 29%, rgba(151, 123, 78, 0.42) 29.2% 29.7%, transparent 30%),
    repeating-linear-gradient(45deg, transparent 0 10px, rgba(126, 100, 64, 0.11) 10px 11px),
    repeating-linear-gradient(-45deg, transparent 0 10px, rgba(126, 100, 64, 0.11) 10px 11px),
    radial-gradient(circle at 50% 43%, rgba(255, 249, 232, 0.85) 0%, rgba(232, 217, 186, 0.5) 42%, rgba(211, 191, 157, 0.48) 100%);
  background-size: 13px 13px, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
  box-shadow: inset 0 0 0 8px rgba(239, 226, 202, 0.88), inset 0 0 0 9px rgba(112, 88, 57, 0.52), inset 0 0 44px rgba(94, 72, 45, 0.18);
}

.card-back-mini::before {
  content: "";
  position: absolute;
  inset: 21px;
  border: 1px solid rgba(115, 90, 56, 0.56);
  border-radius: 2px;
  box-shadow: inset 0 0 0 3px rgba(243, 232, 211, 0.34);
}

.card-back-mini::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 74px;
  height: 74px;
  transform: translate(-50%, -54%);
  border: 1px solid rgba(146, 117, 72, 0.5);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(232, 217, 186, 0.6), 0 0 0 6px rgba(146, 117, 72, 0.25);
}

.back-ornament {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #75603d;
  pointer-events: none;
}

.back-star {
  position: relative;
  z-index: 1;
  color: #a7864c;
  font-family: var(--font-en);
  font-size: 39px;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 248, 232, 0.7);
}

.back-word {
  position: relative;
  z-index: 1;
  padding: 5px 9px;
  color: #665235;
  font-family: var(--font-en);
  font-size: 6.5px;
  letter-spacing: 0.24em;
  background: rgba(240, 228, 204, 0.82);
  border-top: 1px solid rgba(121, 96, 59, 0.38);
  border-bottom: 1px solid rgba(121, 96, 59, 0.38);
}

.deck-seal {
  position: absolute;
  right: -17px;
  bottom: 18px;
  z-index: 4;
  width: 57px;
  height: 57px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: #6e5530;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 248, 232, 0.74), transparent 44%),
    linear-gradient(145deg, #d6bd8c, #b7975e);
  border: 1px solid rgba(255, 245, 220, 0.56);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.35), inset 0 0 0 3px rgba(255, 244, 218, 0.22), inset 0 0 0 4px rgba(87, 67, 37, 0.34);
  transform: rotate(8deg);
}

.seal-star {
  font-size: 12px;
  line-height: 1;
  opacity: 0.76;
}

.seal-line {
  font-family: var(--font-en);
  font-size: 13px;
  letter-spacing: 0.04em;
  line-height: 1;
}

.deck-caption {
  margin: 17px 0 17px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted-soft);
  font-family: var(--font-en);
  font-size: 8px;
  letter-spacing: 0.2em;
}

.deck-caption .caption-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold-deep);
  opacity: 0.75;
}

.draw-panel {
  position: relative;
  z-index: 3;
  width: 100%;
  padding: 23px 24px 20px;
  border: 1px solid var(--gold-line);
  background:
    linear-gradient(135deg, rgba(200, 166, 99, 0.055), transparent 38%),
    linear-gradient(180deg, rgba(20, 34, 26, 0.92), rgba(13, 24, 18, 0.94));
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.28), inset 0 0 0 4px rgba(16, 25, 21, 0.35);
  backdrop-filter: blur(10px);
}

.draw-panel::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(200, 166, 99, 0.09);
  pointer-events: none;
}

.question-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-family: var(--font-zh);
  font-size: 10.5px;
  letter-spacing: 0.18em;
}

.question-optional {
  color: var(--muted-soft);
  font-size: 9px;
  letter-spacing: 0.08em;
  opacity: 0.8;
}

.question-input {
  width: 100%;
  margin-top: 9px;
  padding: 3px 0 8px;
  color: var(--ivory);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(200, 166, 99, 0.24);
  border-radius: 0;
  font-family: var(--font-zh);
  font-size: 14px;
  letter-spacing: 0.04em;
  line-height: 1.7;
  appearance: none;
  transition: border-color 0.25s;
}

.question-input::placeholder {
  color: rgba(210, 194, 164, 0.32);
}

.question-input:focus {
  outline: 0;
  border-bottom-color: rgba(200, 166, 99, 0.7);
}

.question-hint {
  margin: 7px 0 16px;
  color: var(--muted-soft);
  font-family: var(--font-zh);
  font-size: 9px;
  letter-spacing: 0.04em;
  opacity: 0.72;
}

.draw-button {
  position: relative;
  width: 100%;
  min-height: 50px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a211a;
  background:
    radial-gradient(circle at 24% 10%, rgba(255, 250, 232, 0.48), transparent 44%),
    linear-gradient(110deg, #b79152 0%, #ddc184 45%, #c7a362 100%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(255, 246, 218, 0.5), inset 0 0 0 3px rgba(86, 65, 31, 0.16);
  overflow: hidden;
  transition: filter 0.25s, transform 0.25s, box-shadow 0.25s;
}

.draw-button::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40%;
  width: 25%;
  transform: skewX(-22deg);
  background: linear-gradient(90deg, transparent, rgba(255, 251, 235, 0.28), transparent);
  transition: left 0.7s var(--ease-soft);
}

.draw-button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 9px 22px rgba(0, 0, 0, 0.32), inset 0 0 0 1px rgba(255, 246, 218, 0.6), inset 0 0 0 3px rgba(86, 65, 31, 0.16);
}

.draw-button:hover::after {
  left: 118%;
}

.draw-button:active {
  transform: translateY(0);
  filter: brightness(0.97);
}

.draw-button-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.draw-text {
  font-family: var(--font-zh);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
}

.draw-deco {
  color: rgba(69, 49, 19, 0.65);
  font-size: 11px;
}

.draw-arrow {
  position: absolute;
  right: 17px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(48, 34, 13, 0.56);
  font-family: var(--font-en);
  font-size: 15px;
}

.offline-note {
  margin: 13px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted-soft);
  font-family: var(--font-zh);
  font-size: 9px;
  letter-spacing: 0.07em;
  opacity: 0.8;
}

.status-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #89a17c;
  box-shadow: 0 0 0 3px rgba(137, 161, 124, 0.08);
}

body.is-offline .status-dot {
  background: #bd8b58;
}

.home-footer {
  width: min(100%, 1320px);
  margin: 0 auto;
  padding: 19px clamp(22px, 5vw, 64px) max(18px, calc(env(safe-area-inset-bottom) + 14px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted-soft);
  border-top: 1px solid var(--gold-line-soft);
  font-family: var(--font-zh);
  font-size: 9px;
  letter-spacing: 0.1em;
  opacity: 0.75;
}

.home-footer p {
  margin: 0;
}

.footer-en {
  font-family: var(--font-en);
  font-size: 7.5px;
  letter-spacing: 0.16em;
}

/* --------------------------------------------------------------------------
   Reading view
   -------------------------------------------------------------------------- */

.view-reading {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 0 clamp(18px, 5vw, 54px) max(30px, env(safe-area-inset-bottom));
}

.reading-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 12px 0 18px;
  border-bottom: 1px solid var(--gold-line-soft);
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 0;
  color: var(--muted);
  font-family: var(--font-zh);
  font-size: 11px;
  letter-spacing: 0.11em;
  transition: color 0.25s;
}

.text-button:hover {
  color: var(--gold-bright);
}

.text-button-right {
  justify-self: end;
}

.reading-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
}

.reading-mode {
  color: var(--gold-bright);
  font-family: var(--font-zh);
  font-size: 12px;
  letter-spacing: 0.17em;
}

.reading-date {
  color: var(--muted-soft);
  font-family: var(--font-ui);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.reading-stage {
  position: relative;
  padding: clamp(26px, 4vh, 44px) 0 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.reading-stage::before {
  content: "";
  position: absolute;
  top: 4%;
  left: 50%;
  width: min(92vw, 640px);
  height: 330px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(200, 166, 99, 0.085) 0%, transparent 68%);
  pointer-events: none;
  z-index: -1;
}

.reading-question-wrap {
  max-width: 680px;
  margin: 0 auto clamp(22px, 4vh, 38px);
  text-align: center;
}

.reading-question-label {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--gold);
  font-family: var(--font-zh);
  font-size: 8.5px;
  letter-spacing: 0.22em;
  opacity: 0.8;
}

.reading-question {
  margin: 0;
  color: var(--ivory);
  font-family: var(--font-zh);
  font-size: clamp(15px, 2.1vw, 19px);
  letter-spacing: 0.06em;
  line-height: 1.8;
}

.spread-area {
  width: 100%;
  display: flex;
  justify-content: center;
}

.spread {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
}

.spread-1 {
  --card-w: clamp(188px, 52vw, 294px);
}

.spread-2 {
  --card-w: clamp(119px, 34vw, 218px);
  gap: clamp(14px, 4.5vw, 34px);
}

.spread-5 {
  --card-w: clamp(51px, 15.2vw, 132px);
  gap: clamp(5px, 1.8vw, 18px);
}

.card-slot {
  width: var(--card-w);
  flex: 0 0 var(--card-w);
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  animation: dealIn 0.6s var(--ease-card) forwards;
  animation-delay: calc(0.08s + var(--i) * 0.115s);
}

@keyframes dealIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.playing-card {
  position: relative;
  width: 100%;
  aspect-ratio: 560 / 868;
  padding: 0;
  border: 0;
  border-radius: 7px;
  perspective: 1100px;
  -webkit-perspective: 1100px;
  background: transparent;
  transition: transform 0.45s var(--ease-soft), filter 0.45s;
}

.playing-card::after {
  content: "";
  position: absolute;
  inset: -4px;
  z-index: 6;
  border: 1px solid transparent;
  border-radius: 10px;
  pointer-events: none;
  transition: border-color 0.35s, box-shadow 0.35s;
}

.card-slot.is-active .playing-card::after {
  border-color: rgba(229, 206, 152, 0.72);
  box-shadow: 0 0 18px rgba(200, 166, 99, 0.18);
}

.card-inner {
  position: absolute;
  inset: 0;
  display: block;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.78s var(--ease-card);
  border-radius: inherit;
}

.playing-card.is-flipped .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  border-radius: 7px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: var(--shadow-card), inset 0 0 0 1px rgba(73, 53, 31, 0.42);
}

.card-face-back {
  background-color: #e8d9ba;
  background-image:
    radial-gradient(circle at 50% 40%, rgba(255, 249, 234, 0.74) 0%, rgba(232, 217, 186, 0.3) 44%, rgba(207, 187, 151, 0.44) 100%),
    repeating-linear-gradient(45deg, transparent 0 12px, rgba(126, 100, 64, 0.10) 12px 13px),
    repeating-linear-gradient(-45deg, transparent 0 12px, rgba(126, 100, 64, 0.10) 12px 13px);
}

.card-face-back::before {
  content: "";
  position: absolute;
  inset: 6%;
  border: 1px solid rgba(112, 88, 57, 0.5);
  border-radius: 2px;
  box-shadow:
    inset 0 0 0 3px rgba(247, 237, 217, 0.38),
    inset 0 0 0 4px rgba(112, 88, 57, 0.16);
}

.card-face-back::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 42%;
  aspect-ratio: 1;
  transform: translate(-50%, -54%);
  border: 1px solid rgba(140, 111, 67, 0.48);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(232, 217, 186, 0.58), 0 0 0 6px rgba(140, 111, 67, 0.2);
}

.card-face-back .back-star {
  font-size: clamp(20px, 5.7vw, 64px);
}

.card-face-back .back-word {
  font-size: clamp(4px, 1.05vw, 8px);
  padding: 4px 8px;
}

.card-face-front {
  transform: rotateY(180deg);
  background: #e9dcc2;
}

.card-face-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.card-face-front::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 250, 236, 0.12) 0%, transparent 36%, rgba(46, 30, 14, 0.08) 100%);
  pointer-events: none;
}

.card-label {
  margin-top: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--muted-soft);
  text-align: center;
  transition: color 0.3s;
}

.card-label-mark {
  color: var(--gold);
  font-family: var(--font-zh);
  font-size: 9px;
  letter-spacing: 0.17em;
  opacity: 0.8;
}

.card-label-name {
  color: inherit;
  font-family: var(--font-zh);
  font-size: 11px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.card-slot.is-active .card-label {
  color: var(--gold-bright);
}

.spread-5 .card-label {
  margin-top: 9px;
  gap: 2px;
}

.spread-5 .card-label-mark {
  font-size: 8.5px;
}

.spread-5 .card-label-name {
  font-size: 9.5px;
  letter-spacing: 0.02em;
}

.spread-5 .card-slot:not(.is-flipped) .card-label-name {
  color: var(--muted-soft);
  opacity: 0.56;
}

.spread-2 .card-label-name {
  font-size: 12px;
}

.reading-hint {
  min-height: 20px;
  margin: 22px 0 0;
  color: var(--muted-soft);
  font-family: var(--font-zh);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-align: center;
}

.reading-actions {
  margin-top: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.ghost-button {
  min-height: 38px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--gold-bright);
  border: 1px solid var(--gold-line);
  background: rgba(200, 166, 99, 0.035);
  font-family: var(--font-zh);
  font-size: 11px;
  letter-spacing: 0.1em;
  transition: border-color 0.25s, background 0.25s, opacity 0.25s;
}

.ghost-button:hover {
  border-color: rgba(200, 166, 99, 0.5);
  background: rgba(200, 166, 99, 0.08);
}

.ghost-button:disabled {
  cursor: default;
  opacity: 0.34;
}

.progress-label {
  color: var(--muted-soft);
  font-family: var(--font-ui);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
}

/* --------------------------------------------------------------------------
   Parchment reading panel
   -------------------------------------------------------------------------- */

.reading-panel {
  position: relative;
  max-width: 880px;
  margin: 8px auto 34px;
  padding: clamp(26px, 5vw, 54px);
  color: var(--paper-ink);
  background:
    radial-gradient(circle at 12% 4%, rgba(255, 252, 240, 0.72), transparent 30%),
    radial-gradient(circle at 88% 96%, rgba(161, 129, 84, 0.13), transparent 35%),
    linear-gradient(120deg, #f2e7d0 0%, #eadcc2 48%, #e5d4b6 100%);
  border: 1px solid rgba(89, 66, 39, 0.54);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.35), 0 3px 8px rgba(0, 0, 0, 0.2);
  isolation: isolate;
  animation: paperIn 0.7s var(--ease-soft) both;
}

@keyframes paperIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.reading-panel::before {
  content: "";
  position: absolute;
  inset: 9px;
  z-index: -1;
  border: 1px solid rgba(94, 70, 42, 0.28);
  pointer-events: none;
}

.reading-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.14;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.84' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  pointer-events: none;
}

.panel-placeholder {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.placeholder-star {
  color: rgba(121, 91, 52, 0.5);
  font-size: 18px;
}

.panel-placeholder p {
  margin: 0;
  color: var(--paper-muted);
  font-family: var(--font-zh);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.panel-content {
  position: relative;
  z-index: 1;
}

.panel-kicker {
  margin: 0 0 12px;
  color: #8d6d3e;
  font-family: var(--font-en);
  font-size: 8px;
  letter-spacing: 0.28em;
}

.panel-heading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 18px;
  margin-bottom: 20px;
}

.panel-heading {
  margin: 0;
  color: #2d2116;
  font-family: var(--font-zh);
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.45;
}

.panel-heading em {
  color: var(--oxblood);
  font-style: normal;
}

.panel-index {
  flex: none;
  margin-left: auto;
  color: #947546;
  font-family: var(--font-en);
  font-size: 9px;
  letter-spacing: 0.16em;
  white-space: nowrap;
}

.panel-lead {
  margin: 0 0 16px;
  color: #46372a;
  font-family: var(--font-zh);
  font-size: clamp(13.5px, 1.8vw, 15.5px);
  letter-spacing: 0.045em;
  line-height: 2.05;
}

.panel-lead:last-child {
  margin-bottom: 0;
}

.panel-divider {
  margin: 26px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(107, 78, 43, 0.55);
}

.panel-divider::before,
.panel-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(101, 73, 39, 0.32));
}

.panel-divider::after {
  transform: rotate(180deg);
}

.panel-divider span {
  font-size: 10px;
}

.panel-subheading {
  margin: 0 0 13px;
  color: #6f5231;
  font-family: var(--font-zh);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.13em;
}

.keyword-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 17px;
}

.keyword {
  padding: 4px 8px;
  color: #75532e;
  border: 1px solid rgba(112, 79, 41, 0.24);
  background: rgba(255, 248, 232, 0.23);
  font-family: var(--font-zh);
  font-size: 9px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.essence-quote {
  position: relative;
  margin: 0 0 20px;
  padding: 2px 0 2px 20px;
  color: #3e2f21;
  font-family: var(--font-zh);
  font-size: clamp(14px, 1.9vw, 16px);
  letter-spacing: 0.04em;
  line-height: 2;
}

.essence-quote::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--oxblood), transparent);
  opacity: 0.6;
}

.advice-block {
  margin: 22px 0;
  padding: 16px 18px;
  color: #40301f;
  background: rgba(111, 78, 40, 0.07);
  border-left: 2px solid rgba(139, 58, 50, 0.68);
}

.advice-label {
  display: block;
  margin-bottom: 5px;
  color: var(--oxblood);
  font-family: var(--font-zh);
  font-size: 9px;
  letter-spacing: 0.18em;
}

.advice-block p {
  margin: 0;
  font-family: var(--font-zh);
  font-size: 13px;
  letter-spacing: 0.035em;
  line-height: 1.9;
}

.domain-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 24px 0 0;
  border-top: 1px solid rgba(100, 73, 40, 0.22);
  border-bottom: 1px solid rgba(100, 73, 40, 0.22);
  background: rgba(102, 73, 39, 0.18);
}

.domain-item {
  padding: 14px 13px;
  background: rgba(244, 233, 212, 0.88);
}

.domain-label {
  display: block;
  margin-bottom: 5px;
  color: #9a7747;
  font-family: var(--font-zh);
  font-size: 8px;
  letter-spacing: 0.16em;
}

.domain-item p {
  margin: 0;
  color: #4a3928;
  font-family: var(--font-zh);
  font-size: 11px;
  letter-spacing: 0.03em;
  line-height: 1.7;
}

.duality-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 22px 0;
  border: 1px solid rgba(100, 73, 40, 0.18);
  background: rgba(100, 73, 40, 0.15);
}

.duality-item {
  padding: 13px 15px;
  background: rgba(244, 233, 212, 0.7);
}

.duality-item:last-child {
  background: rgba(225, 207, 179, 0.52);
}

.duality-label {
  display: block;
  margin-bottom: 5px;
  color: #987442;
  font-family: var(--font-zh);
  font-size: 8px;
  letter-spacing: 0.16em;
}

.duality-item:last-child .duality-label {
  color: #8b5a45;
}

.duality-item p {
  margin: 0;
  color: #55412e;
  font-family: var(--font-zh);
  font-size: 11px;
  letter-spacing: 0.02em;
  line-height: 1.75;
}

.card-note-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 6px 0 0;
}

.card-note {
  padding: 19px 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  border-bottom: 1px solid rgba(101, 73, 39, 0.16);
}

.card-note:first-child {
  border-top: 1px solid rgba(101, 73, 39, 0.16);
}

.card-note:last-child {
  border-bottom: 0;
}

.card-note-number {
  padding-top: 2px;
  color: #a17d4b;
  font-family: var(--font-en);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.card-note-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 6px;
}

.card-note-title {
  margin: 0;
  color: #32251a;
  font-family: var(--font-zh);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.card-note-en {
  color: #99794d;
  font-family: var(--font-en);
  font-size: 7.5px;
  letter-spacing: 0.13em;
}

.card-note-mark {
  margin-left: auto;
  color: #a17d4b;
  font-family: var(--font-zh);
  font-size: 8.5px;
  letter-spacing: 0.14em;
}

.card-note p {
  margin: 0 0 7px;
  color: #53402e;
  font-family: var(--font-zh);
  font-size: 12px;
  letter-spacing: 0.025em;
  line-height: 1.85;
}

.card-note p:last-child {
  margin-bottom: 0;
}

.card-note p.note-advice {
  color: #7e5d3a;
  font-size: 11px;
}

.card-note p.note-advice::before {
  content: "↳ ";
  opacity: 0.65;
}

.position-list {
  display: flex;
  flex-direction: column;
  margin: 4px 0 0;
}

.position-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid rgba(101, 73, 39, 0.15);
}

.position-item:last-child {
  border-bottom: 1px solid rgba(101, 73, 39, 0.15);
}

.position-mark {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #825f36;
  border: 1px solid rgba(114, 82, 44, 0.28);
  border-radius: 50%;
  font-family: var(--font-zh);
  font-size: 12px;
  line-height: 1;
}

.position-copy h4 {
  margin: 1px 0 5px;
  color: #3c2c1d;
  font-family: var(--font-zh);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.position-copy h4 span {
  margin-left: 6px;
  color: #9a7747;
  font-size: 8.5px;
  letter-spacing: 0.1em;
}

.position-copy p {
  margin: 0;
  color: #5c4733;
  font-family: var(--font-zh);
  font-size: 11.5px;
  letter-spacing: 0.025em;
  line-height: 1.8;
}

.quintessence {
  margin: 26px 0 0;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 15px;
  align-items: center;
  background: rgba(93, 65, 32, 0.07);
  border: 1px solid rgba(105, 75, 40, 0.2);
}

.quintessence-mark {
  width: 42px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e5ce98;
  background: #263126;
  border: 1px solid rgba(122, 92, 51, 0.4);
  font-family: var(--font-en);
  font-size: 13px;
  letter-spacing: 0.03em;
  box-shadow: inset 0 0 0 2px rgba(229, 206, 152, 0.14);
}

.quintessence-label {
  display: block;
  margin-bottom: 3px;
  color: #987442;
  font-family: var(--font-zh);
  font-size: 8px;
  letter-spacing: 0.16em;
}

.quintessence h4 {
  margin: 0 0 4px;
  color: #3b2b1b;
  font-family: var(--font-zh);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.quintessence p {
  margin: 0;
  color: #665038;
  font-family: var(--font-zh);
  font-size: 11px;
  line-height: 1.75;
}

.panel-note {
  margin: 21px 0 0;
  padding-top: 14px;
  color: rgba(92, 69, 44, 0.65);
  border-top: 1px solid rgba(100, 73, 40, 0.15);
  font-family: var(--font-zh);
  font-size: 9px;
  letter-spacing: 0.06em;
  line-height: 1.8;
}

.card-detail-link {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 0;
  color: #7c5a32;
  border-bottom: 1px solid rgba(109, 78, 40, 0.32);
  font-family: var(--font-zh);
  font-size: 10px;
  letter-spacing: 0.08em;
  transition: color 0.2s, border-color 0.2s;
}

.card-detail-link:hover {
  color: var(--oxblood);
  border-bottom-color: var(--oxblood);
}

.partial-note {
  margin: 0 0 22px;
  padding: 10px 13px;
  color: #7d5c36;
  background: rgba(140, 103, 56, 0.07);
  border-left: 2px solid rgba(151, 114, 63, 0.46);
  font-family: var(--font-zh);
  font-size: 10px;
  letter-spacing: 0.025em;
  line-height: 1.7;
}

.mini-card-line {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 9px;
  color: #987a4e;
  font-family: var(--font-en);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.mini-card-line span {
  width: 24px;
  height: 1px;
  background: rgba(120, 87, 45, 0.3);
}

.reading-footer {
  max-width: 880px;
  margin: 0 auto;
  padding: 4px 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted-soft);
  font-family: var(--font-zh);
  font-size: 8px;
  letter-spacing: 0.09em;
  text-align: center;
  opacity: 0.65;
}

.footer-star {
  color: var(--gold-deep);
  font-size: 8px;
}

/* --------------------------------------------------------------------------
   Shuffle overlay
   -------------------------------------------------------------------------- */

.shuffle-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 50%, rgba(32, 55, 42, 0.92) 0%, rgba(10, 18, 14, 0.97) 62%, #070d0a 100%);
  backdrop-filter: blur(8px);
  animation: overlayIn 0.3s ease both;
  transition: opacity 0.35s ease;
}

.shuffle-overlay.is-leaving {
  opacity: 0;
  pointer-events: none;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.shuffle-aura {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(72vw, 460px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 166, 99, 0.16), transparent 65%);
  filter: blur(6px);
  animation: auraPulse 2.4s ease-in-out infinite;
}

@keyframes auraPulse {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(0.94); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); }
}

.shuffle-deck {
  position: relative;
  width: 132px;
  height: 205px;
  margin-bottom: 34px;
}

.shuffle-card {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(76, 56, 34, 0.62);
  border-radius: 6px;
  background-color: #e7d8b8;
  background-image:
    radial-gradient(circle at 50% 42%, rgba(255, 249, 232, 0.62), transparent 44%),
    repeating-linear-gradient(45deg, transparent 0 9px, rgba(126, 100, 64, 0.13) 9px 10px),
    repeating-linear-gradient(-45deg, transparent 0 9px, rgba(126, 100, 64, 0.13) 9px 10px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.34), inset 0 0 0 6px rgba(239, 226, 202, 0.88), inset 0 0 0 7px rgba(112, 88, 57, 0.44);
  transform-origin: 50% 92%;
}

.shuffle-card::after {
  content: "✦";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -56%);
  color: #a7864c;
  font-family: var(--font-en);
  font-size: 27px;
}

.shuffle-card-1 { animation: shuffleA 1.2s ease-in-out infinite; }
.shuffle-card-2 { animation: shuffleB 1.2s 0.1s ease-in-out infinite; }
.shuffle-card-3 { animation: shuffleC 1.2s 0.2s ease-in-out infinite; }
.shuffle-card-4 { animation: shuffleD 1.2s 0.3s ease-in-out infinite; }
.shuffle-card-5 { animation: shuffleE 1.2s 0.4s ease-in-out infinite; }

@keyframes shuffleA {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-24px, -2px) rotate(-8deg); }
  50% { transform: translate(-8px, 2px) rotate(-2deg); }
  75% { transform: translate(-18px, -1px) rotate(-5deg); }
}

@keyframes shuffleB {
  0%, 100% { transform: translate(0, 1px) rotate(1deg); }
  25% { transform: translate(16px, 1px) rotate(5deg); }
  50% { transform: translate(26px, -2px) rotate(9deg); }
  75% { transform: translate(9px, 1px) rotate(3deg); }
}

@keyframes shuffleC {
  0%, 100% { transform: translate(0, -2px) rotate(-1deg); }
  25% { transform: translate(4px, -5px) rotate(2deg); }
  50% { transform: translate(-6px, 0) rotate(-3deg); }
  75% { transform: translate(14px, -4px) rotate(6deg); }
}

@keyframes shuffleD {
  0%, 100% { transform: translate(0, 0) rotate(2deg); }
  25% { transform: translate(-13px, 2px) rotate(-6deg); }
  50% { transform: translate(10px, 3px) rotate(4deg); }
  75% { transform: translate(-3px, -2px) rotate(0deg); }
}

@keyframes shuffleE {
  0%, 100% { transform: translate(0, 0) rotate(-2deg); }
  25% { transform: translate(20px, 0) rotate(7deg); }
  50% { transform: translate(-2px, -4px) rotate(-1deg); }
  75% { transform: translate(-19px, 2px) rotate(-7deg); }
}

.shuffle-caption {
  margin: 0;
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
}

.shuffle-sub {
  margin: 9px 0 0;
  color: var(--muted-soft);
  font-family: var(--font-zh);
  font-size: 10.5px;
  letter-spacing: 0.14em;
}

/* --------------------------------------------------------------------------
   Modals
   -------------------------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(5, 10, 7, 0.82);
  backdrop-filter: blur(10px);
  animation: overlayIn 0.25s ease both;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border: 1px solid var(--gold-line);
  border-radius: 50%;
  background: rgba(12, 22, 16, 0.5);
  font-family: var(--font-ui);
  font-size: 12px;
  transition: color 0.2s, border-color 0.2s;
}

.modal-close:hover {
  color: var(--gold-bright);
  border-color: rgba(200, 166, 99, 0.54);
}

.card-modal {
  position: relative;
  width: min(900px, 100%);
  max-height: min(88vh, 780px);
  max-height: min(88dvh, 780px);
  overflow: auto;
  padding: clamp(22px, 4vw, 44px);
  background:
    radial-gradient(circle at 10% 0%, rgba(66, 94, 74, 0.22), transparent 38%),
    linear-gradient(145deg, #192a21, #0e1813 75%);
  border: 1px solid var(--gold-line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 166, 99, 0.3) transparent;
}

.card-modal-inner {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(24px, 5vw, 54px);
  align-items: center;
}

.card-modal-visual {
  width: 100%;
  max-width: 300px;
  justify-self: center;
}

.card-modal-visual .playing-card {
  pointer-events: none;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.42);
}

.card-modal-visual .card-inner {
  transform: none !important;
}

.card-modal-visual .card-face-front {
  transform: none;
}

.card-modal-visual .card-face-back {
  display: none;
}

.card-modal-copy {
  min-width: 0;
}

.modal-kicker {
  margin: 0 0 10px;
  color: var(--gold);
  font-family: var(--font-en);
  font-size: 8px;
  letter-spacing: 0.26em;
}

.modal-title {
  margin: 0;
  color: var(--ivory);
  font-family: var(--font-zh);
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.35;
}

.modal-en {
  margin: 6px 0 18px;
  color: var(--muted-soft);
  font-size: 9px;
  letter-spacing: 0.22em;
}

.card-modal-copy .keyword-row {
  margin-bottom: 20px;
}

.card-modal-copy .keyword {
  color: var(--gold-bright);
  border-color: var(--gold-line);
  background: rgba(200, 166, 99, 0.06);
}

.modal-essence {
  margin: 0 0 20px;
  color: rgba(238, 226, 202, 0.85);
  font-family: var(--font-zh);
  font-size: 13.5px;
  letter-spacing: 0.04em;
  line-height: 2;
}

.modal-advice {
  padding: 14px 16px;
  border-left: 1px solid rgba(200, 166, 99, 0.5);
  background: rgba(200, 166, 99, 0.045);
}

.modal-advice-label {
  display: block;
  margin-bottom: 5px;
  color: var(--gold);
  font-family: var(--font-zh);
  font-size: 8.5px;
  letter-spacing: 0.17em;
}

.modal-advice p {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-zh);
  font-size: 12px;
  line-height: 1.9;
}

.modal-duality {
  margin: 18px 0 0;
  border-color: var(--gold-line-soft);
  background: rgba(200, 166, 99, 0.1);
}

.modal-duality .duality-item {
  background: rgba(200, 166, 99, 0.035);
}

.modal-duality .duality-item:last-child {
  background: rgba(139, 58, 50, 0.07);
}

.modal-duality .duality-label {
  color: var(--gold);
}

.modal-duality .duality-item:last-child .duality-label {
  color: #c58f7f;
}

.modal-duality .duality-item p {
  color: var(--muted);
}

.modal-domains {
  margin-top: 16px;
  border-color: var(--gold-line-soft);
  background: rgba(200, 166, 99, 0.1);
}

.modal-domains .domain-item {
  background: rgba(18, 29, 23, 0.56);
}

.modal-domains .domain-label {
  color: var(--gold);
}

.modal-domains .domain-item p {
  color: var(--muted);
}

/* Install sheet */

.install-sheet {
  position: relative;
  width: min(560px, 100%);
  max-height: min(88vh, 760px);
  max-height: min(88dvh, 760px);
  overflow: auto;
  padding: clamp(28px, 5vw, 46px);
  color: var(--paper-ink);
  background:
    radial-gradient(circle at 88% 4%, rgba(255, 252, 240, 0.72), transparent 34%),
    linear-gradient(130deg, #f1e5cd, #e4d2b1);
  border: 1px solid rgba(87, 63, 36, 0.6);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.48);
}

.install-sheet::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(95, 69, 40, 0.27);
  pointer-events: none;
}

.install-sheet .modal-close {
  color: #7d5f3a;
  border-color: rgba(107, 78, 41, 0.3);
  background: rgba(255, 248, 232, 0.55);
}

.install-sheet .modal-close:hover {
  color: var(--oxblood);
  border-color: rgba(139, 58, 50, 0.45);
}

.install-sheet .modal-kicker {
  color: #8b6b3d;
}

.install-sheet .modal-title {
  color: #2f2317;
  font-size: clamp(24px, 4vw, 32px);
}

.install-lede {
  margin: 12px 0 25px;
  color: #604b36;
  font-family: var(--font-zh);
  font-size: 12px;
  letter-spacing: 0.03em;
  line-height: 1.9;
}

.install-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid rgba(101, 73, 39, 0.2);
}

.install-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid rgba(101, 73, 39, 0.2);
}

.step-number {
  color: #a17d4b;
  font-family: var(--font-en);
  font-size: 10px;
  letter-spacing: 0.1em;
  padding-top: 2px;
}

.install-step h3 {
  margin: 0 0 4px;
  color: #3b2c1d;
  font-family: var(--font-zh);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.07em;
}

.install-step p {
  margin: 0;
  color: #67523c;
  font-family: var(--font-zh);
  font-size: 11px;
  line-height: 1.8;
}

.install-step strong {
  color: var(--oxblood);
  font-weight: 600;
}

.install-tip {
  margin: 18px 0 0;
  color: #806241;
  font-family: var(--font-zh);
  font-size: 10px;
  letter-spacing: 0.02em;
  line-height: 1.7;
}

.install-confirm {
  margin-top: 22px;
  min-height: 46px;
}

.install-confirm .draw-text {
  font-size: 13px;
}

/* Toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 18px));
  z-index: 150;
  transform: translateX(-50%) translateY(10px);
  padding: 10px 16px;
  color: var(--ivory);
  background: rgba(19, 32, 24, 0.96);
  border: 1px solid var(--gold-line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  font-family: var(--font-zh);
  font-size: 11px;
  letter-spacing: 0.06em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --------------------------------------------------------------------------
   AI deep reading
   -------------------------------------------------------------------------- */

.ai-reading {
  position: relative;
  max-width: 880px;
  margin: 0 auto 36px;
  padding: clamp(26px, 4.5vw, 46px);
  color: var(--ivory);
  border: 1px solid var(--gold-line);
  background:
    radial-gradient(ellipse 70% 55% at 82% 0%, rgba(200, 166, 99, 0.09), transparent 58%),
    linear-gradient(145deg, rgba(31, 48, 38, 0.88), rgba(11, 21, 15, 0.94));
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.34), inset 0 0 0 5px rgba(200, 166, 99, 0.025);
  animation: paperIn 0.7s var(--ease-soft) both;
}

.ai-reading::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(200, 166, 99, 0.09);
  pointer-events: none;
}

.ai-head {
  max-width: 660px;
  margin: 0 auto;
  text-align: center;
}

.ai-kicker {
  margin-bottom: 11px;
  color: var(--gold);
}

.ai-title {
  margin: 0;
  color: var(--ivory);
  font-family: var(--font-zh);
  font-size: clamp(24px, 3.2vw, 32px);
  font-weight: 400;
  letter-spacing: 0.07em;
  line-height: 1.5;
}

.ai-lede {
  margin: 12px auto 0;
  color: var(--muted);
  font-family: var(--font-zh);
  font-size: 11.5px;
  letter-spacing: 0.035em;
  line-height: 1.95;
}

.ai-question {
  max-width: 560px;
  margin: 14px auto 0;
  padding: 7px 12px;
  color: var(--gold-bright);
  border-left: 1px solid rgba(200, 166, 99, 0.45);
  background: rgba(200, 166, 99, 0.035);
  font-family: var(--font-zh);
  font-size: 10.5px;
  letter-spacing: 0.035em;
  line-height: 1.75;
  text-align: left;
}

.ai-start {
  max-width: 430px;
  margin: 24px auto 0;
}

.ai-start-button {
  width: 100%;
  min-height: 50px;
}

.ai-start-button .draw-text {
  font-size: 14px;
}

.ai-note {
  margin: 11px 0 0;
  color: var(--muted-soft);
  font-family: var(--font-zh);
  font-size: 8.5px;
  letter-spacing: 0.035em;
  line-height: 1.7;
  text-align: center;
  opacity: 0.8;
}

/* Invite gate */

.ai-gate {
  max-width: 430px;
  margin: 22px auto 0;
  padding: 18px 19px;
  border: 1px solid rgba(200, 166, 99, 0.18);
  background: rgba(200, 166, 99, 0.035);
}

.ai-gate-title {
  margin: 0 0 4px;
  color: var(--gold-bright);
  font-family: var(--font-zh);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.ai-gate-copy {
  margin: 0 0 13px;
  color: var(--muted-soft);
  font-family: var(--font-zh);
  font-size: 10px;
  line-height: 1.7;
}

.ai-gate-row {
  display: flex;
  gap: 8px;
}

.ai-code-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  color: var(--ivory);
  border: 1px solid var(--gold-line);
  border-radius: 0;
  background: rgba(5, 13, 8, 0.42);
  font-family: var(--font-zh);
  font-size: 12px;
  letter-spacing: 0.06em;
  appearance: none;
}

.ai-code-input::placeholder {
  color: rgba(210, 194, 164, 0.3);
}

.ai-code-input:focus {
  outline: 0;
  border-color: rgba(229, 206, 152, 0.72);
}

.ai-gate-row .ghost-button {
  min-height: 40px;
  padding: 0 16px;
}

.ai-error {
  margin: 9px 0 0;
  color: #c58f7f;
  font-family: var(--font-zh);
  font-size: 9.5px;
  line-height: 1.7;
}

/* Result */

.ai-result {
  max-width: 700px;
  margin: 26px auto 0;
  padding-top: 22px;
  border-top: 1px solid rgba(200, 166, 99, 0.15);
}

.ai-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.ai-result-label {
  color: var(--gold);
  font-family: var(--font-en);
  font-size: 8px;
  letter-spacing: 0.26em;
}

.ai-provider {
  color: var(--muted-soft);
  font-family: var(--font-en);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.ai-result-text {
  color: rgba(242, 232, 212, 0.9);
  font-family: var(--font-zh);
  font-size: 13.5px;
  letter-spacing: 0.035em;
  line-height: 2.1;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ai-result-text.is-streaming::after {
  content: "▍";
  margin-left: 2px;
  color: var(--gold);
  animation: aiCursor 0.9s ease-in-out infinite;
}

@keyframes aiCursor {
  0%, 45% { opacity: 1; }
  55%, 100% { opacity: 0.15; }
}

.ai-result-actions {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(200, 166, 99, 0.1);
}

.ai-result-actions .card-detail-link {
  color: var(--gold);
  border-bottom-color: rgba(200, 166, 99, 0.32);
}

.ai-result-actions .card-detail-link:hover {
  color: var(--gold-bright);
  border-bottom-color: var(--gold-bright);
}

.ai-disclaimer {
  color: var(--muted-soft);
  font-family: var(--font-zh);
  font-size: 8px;
  letter-spacing: 0.04em;
  opacity: 0.75;
}

.ai-status {
  min-height: 18px;
  margin: 16px 0 0;
  color: var(--muted-soft);
  font-family: var(--font-zh);
  font-size: 9.5px;
  letter-spacing: 0.035em;
  line-height: 1.7;
  text-align: center;
}

.ai-status.is-loading {
  color: var(--gold);
  animation: aiBreath 1.8s ease-in-out infinite;
}

.ai-status.is-error {
  color: #c58f7f;
}

@keyframes aiBreath {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@media (max-width: 620px) {
  .ai-reading {
    padding: 27px 19px 25px;
    margin-bottom: 26px;
  }

  .ai-reading::before {
    inset: 6px;
  }

  .ai-title {
    font-size: 22px;
  }

  .ai-lede {
    font-size: 10.5px;
  }

  .ai-start {
    margin-top: 20px;
  }

  .ai-start-button .draw-text {
    font-size: 13px;
  }

  .ai-note {
    font-size: 8px;
  }

  .ai-result-text {
    font-size: 12.5px;
    line-height: 2.05;
  }

  .ai-result-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .ai-gate {
    padding: 15px;
  }
}

/* --------------------------------------------------------------------------
   Picking table · 3 × 12 card spread + manual draw
   -------------------------------------------------------------------------- */

body.is-in-game .site-header {
  display: none;
}

body.is-in-game .view-picking,
body.is-in-game .view-reading {
  padding-top: max(18px, env(safe-area-inset-top));
}

.view-picking {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 0 clamp(18px, 5vw, 54px) max(30px, env(safe-area-inset-bottom));
}

.pick-topbar {
  border-bottom: 1px solid var(--gold-line-soft);
}

.pick-stage {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(18px, 2.6vh, 28px) 0 22px;
}

.pick-intro {
  max-width: 760px;
  margin: 0 auto clamp(16px, 2.2vh, 22px);
  text-align: center;
}

.pick-kicker {
  margin: 0 0 10px;
  color: var(--gold);
  font-family: var(--font-en);
  font-size: 8.5px;
  letter-spacing: 0.28em;
}

.pick-title {
  margin: 0;
  color: var(--ivory);
  font-family: var(--font-zh);
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 400;
  letter-spacing: 0.065em;
  line-height: 1.45;
  text-wrap: balance;
}

.pick-question {
  max-width: 600px;
  margin: 10px auto 0;
  color: var(--gold-bright);
  font-family: var(--font-zh);
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.8;
}

.pick-question::before {
  content: "所问 · ";
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.pick-hint {
  margin: 12px auto 0;
  color: var(--muted-soft);
  font-family: var(--font-zh);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  line-height: 1.7;
}

/* Drop zone */

.pick-zone {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  padding: 16px 20px 17px;
  border: 1px dashed rgba(200, 166, 99, 0.34);
  background:
    linear-gradient(135deg, rgba(200, 166, 99, 0.045), transparent 40%),
    rgba(9, 19, 14, 0.25);
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}

.pick-zone::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(200, 166, 99, 0.065);
  pointer-events: none;
}

.pick-zone.is-drag-over {
  border-color: rgba(229, 206, 152, 0.85);
  background:
    linear-gradient(135deg, rgba(200, 166, 99, 0.11), transparent 48%),
    rgba(25, 43, 32, 0.48);
  box-shadow: 0 0 34px rgba(200, 166, 99, 0.13), inset 0 0 42px rgba(200, 166, 99, 0.04);
}

.pick-zone-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--gold);
  font-family: var(--font-zh);
  font-size: 9.5px;
  letter-spacing: 0.14em;
}

.zone-star {
  margin-right: 5px;
  font-size: 8px;
  opacity: 0.8;
}

.pick-count {
  color: var(--muted-soft);
  font-family: var(--font-en);
  font-size: 8.5px;
  letter-spacing: 0.12em;
}

.pick-slots {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.pick-slots-1 {
  --slot-w: clamp(122px, 38vw, 178px);
}

.pick-slots-2 {
  --slot-w: clamp(88px, 27vw, 148px);
  gap: clamp(12px, 3vw, 28px);
}

.pick-slots-5 {
  --slot-w: clamp(47px, 15.2vw, 92px);
  gap: clamp(5px, 1.8vw, 14px);
}

.pick-slot {
  width: var(--slot-w);
  flex: 0 0 var(--slot-w);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 0;
  color: var(--muted-soft);
  text-align: center;
}

.pick-slot-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 560 / 868;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px dashed rgba(200, 166, 99, 0.32);
  border-radius: 5px;
  background: rgba(4, 10, 7, 0.18);
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s, transform 0.3s;
}

.pick-slot.is-empty:hover .pick-slot-frame {
  border-color: rgba(200, 166, 99, 0.58);
  background: rgba(200, 166, 99, 0.04);
}

.pick-slot.is-next .pick-slot-frame {
  border-color: var(--gold-bright);
  background: rgba(200, 166, 99, 0.06);
  box-shadow: 0 0 0 1px rgba(229, 206, 152, 0.16), 0 0 22px rgba(200, 166, 99, 0.16);
  animation: nextSlotPulse 1.4s ease-in-out infinite;
}

@keyframes nextSlotPulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(229, 206, 152, 0.12), 0 0 16px rgba(200, 166, 99, 0.1); }
  50% { box-shadow: 0 0 0 1px rgba(229, 206, 152, 0.28), 0 0 27px rgba(200, 166, 99, 0.22); }
}

.slot-plus {
  color: rgba(200, 166, 99, 0.42);
  font-family: var(--font-en);
  font-size: clamp(12px, 2.1vw, 22px);
  font-weight: 300;
  line-height: 1;
}

.slot-return {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  width: 17px;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f2e6cf;
  border-radius: 50%;
  background: rgba(13, 24, 18, 0.78);
  font-size: 9px;
  opacity: 0;
  transition: opacity 0.2s;
}

.pick-slot.is-filled:hover .slot-return,
.pick-slot.is-filled:focus-visible .slot-return {
  opacity: 1;
}

.pick-slot.is-filled .pick-slot-frame {
  border-style: solid;
  border-color: rgba(200, 166, 99, 0.48);
  background: #e8d9ba;
  box-shadow: 0 9px 18px rgba(0, 0, 0, 0.3), 0 1px 4px rgba(0, 0, 0, 0.24);
}

.pick-slot.is-new .pick-slot-frame {
  animation: slotSettle 0.42s var(--ease-card) both;
}

@keyframes slotSettle {
  0% { transform: scale(1.07); box-shadow: 0 0 0 1px rgba(229, 206, 152, 0.7), 0 0 28px rgba(200, 166, 99, 0.28); }
  100% { transform: scale(1); }
}

.pick-slot.is-filled .pick-slot-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pick-slot.is-filled .pick-slot-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 250, 236, 0.11), transparent 38%, rgba(46, 30, 14, 0.08));
  pointer-events: none;
}

.pick-slot-label {
  max-width: 100%;
  color: var(--muted-soft);
  font-family: var(--font-zh);
  font-size: 10px;
  letter-spacing: 0.09em;
  line-height: 1.5;
  white-space: nowrap;
}

.pick-slot.is-filled .pick-slot-label {
  color: var(--ivory);
}

.pick-slot-label em {
  color: var(--gold-deep);
  font-style: normal;
  font-size: 8.5px;
  letter-spacing: 0.12em;
}

.pick-slots-5 .pick-slot-label {
  font-size: 8.5px;
  letter-spacing: 0.02em;
}

.pick-slots-5 .pick-slot-label em {
  display: block;
  margin-top: 1px;
  font-size: 7.5px;
}

.pick-zone-hint {
  position: relative;
  z-index: 1;
  min-height: 16px;
  margin: 12px 0 0;
  color: var(--muted-soft);
  font-family: var(--font-zh);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-align: center;
  opacity: 0.78;
}

.pick-zone.is-drag-over .pick-zone-hint {
  color: var(--gold-bright);
  opacity: 1;
}

/* Picking actions */

.pick-actions {
  max-width: 820px;
  margin: 13px auto 18px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
}

.pick-undo-button {
  flex: none;
  min-height: 48px;
  padding: 0 15px;
  white-space: nowrap;
}

.pick-read-button {
  flex: 1;
  min-height: 48px;
}

.pick-read-button .draw-text {
  font-size: 13px;
}

.pick-read-button:disabled {
  cursor: default;
  opacity: 1;
  color: rgba(229, 206, 152, 0.38);
  background: rgba(200, 166, 99, 0.055);
  filter: none;
  transform: none;
  box-shadow: inset 0 0 0 1px rgba(200, 166, 99, 0.18);
}

.pick-read-button:disabled .draw-deco {
  color: rgba(200, 166, 99, 0.26);
}

.pick-read-button:disabled .draw-arrow {
  color: rgba(200, 166, 99, 0.24);
}

.pick-read-button:disabled::after {
  display: none;
}

.pick-read-button:not(:disabled) {
  animation: readyGlow 2.2s ease-in-out infinite;
}

@keyframes readyGlow {
  0%, 100% { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(255, 246, 218, 0.5), inset 0 0 0 3px rgba(86, 65, 31, 0.16); }
  50% { box-shadow: 0 8px 26px rgba(200, 166, 99, 0.2), inset 0 0 0 1px rgba(255, 246, 218, 0.72), inset 0 0 0 3px rgba(86, 65, 31, 0.16); }
}

/* 3 rows × 12 cards */

.pick-deck {
  max-width: 860px;
  margin: 0 auto;
  padding: 12px 14px 16px;
  border: 1px solid var(--gold-line-soft);
  background:
    linear-gradient(180deg, rgba(200, 166, 99, 0.035), transparent 34%),
    rgba(6, 14, 10, 0.27);
}

.pick-deck-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: var(--muted-soft);
  font-family: var(--font-zh);
  font-size: 8.5px;
  letter-spacing: 0.1em;
}

.pick-deck-head span:last-child {
  font-family: var(--font-en);
  font-size: 7.5px;
  letter-spacing: 0.12em;
  opacity: 0.8;
}

.pick-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(3px, 0.65vw, 8px);
}

.pick-cell {
  position: relative;
  width: 100%;
  aspect-ratio: 560 / 868;
  padding: 0;
  border: 0;
  border-radius: clamp(2px, 0.4vw, 5px);
  background: transparent;
  cursor: grab;
  transition: transform 0.22s var(--ease-soft), opacity 0.3s, filter 0.3s;
}

.pick-cell:active {
  cursor: grabbing;
}

.mini-card-back {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid rgba(83, 62, 38, 0.68);
  border-radius: inherit;
  background-color: #e7d8b8;
  background-image:
    radial-gradient(circle at 50% 42%, rgba(255, 249, 232, 0.58), transparent 47%),
    repeating-linear-gradient(45deg, transparent 0 5px, rgba(126, 100, 64, 0.14) 5px 5.8px),
    repeating-linear-gradient(-45deg, transparent 0 5px, rgba(126, 100, 64, 0.14) 5px 5.8px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25), inset 0 0 0 2px rgba(244, 233, 212, 0.75), inset 0 0 0 2.7px rgba(112, 88, 57, 0.44);
}

.mini-card-back::before {
  content: "✦";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  color: #a7864c;
  font-family: var(--font-en);
  font-size: clamp(5px, 1.1vw, 11px);
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 248, 232, 0.55);
}

.mini-card-back::after {
  content: "";
  position: absolute;
  inset: clamp(3px, 0.55vw, 5px);
  border: 1px solid rgba(122, 97, 70, 0.28);
  border-radius: 1px;
}

.pick-cell:hover {
  z-index: 2;
  transform: translateY(-4px) scale(1.06);
}

.pick-cell:hover .mini-card-back {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.34), 0 0 16px rgba(200, 166, 99, 0.12), inset 0 0 0 2px rgba(244, 233, 212, 0.8), inset 0 0 0 2.7px rgba(112, 88, 57, 0.4);
}

.pick-cell.is-used {
  pointer-events: none;
  transform: scale(0.92);
}

.pick-cell.is-used .mini-card-back {
  border: 1px dashed rgba(200, 166, 99, 0.2);
  background: rgba(200, 166, 99, 0.018);
  box-shadow: none;
}

.pick-cell.is-used .mini-card-back::before {
  content: "✦";
  color: rgba(200, 166, 99, 0.28);
  font-size: clamp(4px, 0.9vw, 8px);
}

.pick-cell.is-used .mini-card-back::after {
  display: none;
}

.pick-cell.is-dragging-source {
  opacity: 0.14;
  filter: grayscale(0.8);
}

.pick-grid.is-complete .pick-cell:not(.is-used) {
  pointer-events: none;
}

.pick-drag-ghost {
  position: fixed;
  z-index: 210;
  pointer-events: none;
  border-radius: 5px;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.45));
  will-change: transform;
}

.pick-drag-ghost .mini-card-back {
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(229, 206, 152, 0.24);
}

.pick-fly-card {
  position: fixed;
  z-index: 205;
  pointer-events: none;
  border-radius: 5px;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.34));
  will-change: transform, opacity;
}

body.is-picking-drag {
  cursor: grabbing;
  user-select: none;
  -webkit-user-select: none;
}

body.is-picking-drag .pick-cell {
  cursor: grabbing;
}

@media (hover: none) {
  .pick-cell:hover {
    transform: none;
  }

  .pick-slot.is-filled .slot-return {
    opacity: 0.72;
  }
}

@media (max-width: 820px) {
  .pick-stage {
    padding-top: 18px;
  }

  .pick-slots {
    gap: clamp(6px, 2vw, 14px);
  }

  .pick-intro {
    margin-bottom: 18px;
  }

  .pick-title {
    font-size: clamp(23px, 6vw, 30px);
  }

  .pick-zone {
    padding: 13px 13px 14px;
  }

  .pick-slots {
    margin-top: 11px;
  }

  .pick-zone-hint {
    margin-top: 9px;
    font-size: 8.5px;
  }

  .pick-actions {
    margin-top: 10px;
    margin-bottom: 14px;
  }

  .pick-undo-button {
    min-height: 44px;
    padding: 0 10px;
    font-size: 9.5px;
  }

  .pick-read-button {
    min-height: 44px;
  }

  .pick-deck {
    margin-left: -14px;
    margin-right: -14px;
    padding: 9px 9px 12px;
    border-left: 0;
    border-right: 0;
  }

  .pick-grid {
    gap: 2px;
  }

  .pick-deck-head {
    margin-bottom: 7px;
    padding: 0 2px;
  }
}

@media (max-width: 620px) {
  .view-picking {
    padding-left: 16px;
    padding-right: 16px;
  }

  .pick-stage {
    padding-top: 15px;
    padding-bottom: 16px;
  }

  .pick-intro {
    margin-bottom: 15px;
  }

  .pick-kicker {
    margin-bottom: 8px;
    font-size: 7.5px;
  }

  .pick-title {
    font-size: clamp(21px, 6.2vw, 28px);
    letter-spacing: 0.03em;
  }

  .pick-hint {
    margin-top: 9px;
    font-size: 9px;
  }

  .pick-question {
    margin-top: 8px;
    font-size: 10.5px;
  }

  .pick-zone {
    padding: 12px 10px 12px;
  }

  .pick-zone-head {
    font-size: 8.5px;
  }

  .pick-slots-1 {
    --slot-w: clamp(112px, 34vw, 150px);
  }

  .pick-slots-2 {
    --slot-w: clamp(82px, 25vw, 120px);
  }

  .pick-slots-5 {
    --slot-w: clamp(47px, 15.2vw, 78px);
    gap: clamp(4px, 1.5vw, 8px);
  }

  .pick-zone-hint {
    font-size: 8px;
  }

  .pick-actions {
    gap: 7px;
  }

  .pick-read-button .draw-text {
    font-size: 12px;
    letter-spacing: 0.16em;
  }

  .pick-deck {
    margin-left: -16px;
    margin-right: -16px;
    padding: 8px 8px 11px;
  }

  .pick-grid {
    gap: 2px;
  }

  .pick-deck-head {
    font-size: 7.5px;
    letter-spacing: 0.05em;
  }

  .pick-deck-head span:last-child {
    font-size: 6.5px;
  }

  .mini-card-back::before {
    font-size: clamp(4.5px, 1.5vw, 7px);
  }

  .mini-card-back::after {
    inset: 2px;
  }

  .pick-cell {
    border-radius: 2px;
  }
}

@media (max-width: 380px) {
  .pick-slots-5 {
    --slot-w: clamp(44px, 14.6vw, 70px);
    gap: 4px;
  }

  .pick-intro {
    margin-bottom: 12px;
  }

  .pick-title {
    font-size: 20px;
  }

  .pick-hint {
    font-size: 8.5px;
  }

  .pick-zone {
    padding-left: 8px;
    padding-right: 8px;
  }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 980px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.8fr);
    gap: 34px;
  }

  h1 {
    font-size: clamp(38px, 5vw, 52px);
  }

  .mode-card {
    grid-template-columns: 28px minmax(0, 1fr) 48px;
    gap: 11px;
    padding-right: 8px;
  }

  .mode-desc {
    white-space: normal;
  }
}

@media (max-width: 820px) {
  .gilt-frame {
    inset: 8px;
  }

  .site-header {
    padding-top: max(21px, calc(env(safe-area-inset-top) + 14px));
  }

  .home-hero {
    grid-template-columns: 1fr;
    gap: 34px;
    padding-top: 28px;
    padding-bottom: 34px;
  }

  .hero-copy {
    max-width: 620px;
  }

  .eyebrow {
    justify-content: center;
    font-size: 8px;
    letter-spacing: 0.2em;
  }

  h1 {
    text-align: center;
    font-size: clamp(36px, 7.4vw, 52px);
    line-height: 1.38;
  }

  .lede {
    max-width: 470px;
    margin: 18px auto 30px;
    text-align: center;
    font-size: 13px;
  }

  .mode-section {
    max-width: 560px;
    margin: 0 auto;
  }

  .hero-tableau {
    max-width: 420px;
    display: flex;
    flex-direction: column;
  }

  .draw-panel {
    order: 1;
  }

  .deck-area {
    order: 2;
    margin-top: 22px;
  }

  .tableau-glow {
    top: 8%;
  }

  .home-footer {
    flex-direction: column;
    gap: 5px;
    text-align: center;
  }

  .view-reading {
    padding-left: 16px;
    padding-right: 16px;
  }

  .reading-stage {
    padding-top: 24px;
  }
}

@media (max-width: 620px) {
  .site-header {
    gap: 8px;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 29px;
    height: 29px;
  }

  .brand-en {
    display: none;
  }

  .brand-zh {
    font-size: 15px;
    letter-spacing: 0.12em;
    white-space: nowrap;
  }

  .header-actions {
    gap: 6px;
  }

  .icon-button {
    width: 34px;
    height: 34px;
  }

  .install-button {
    height: 34px;
    padding: 0 11px;
    font-size: 10.5px;
    letter-spacing: 0.08em;
  }

  .install-button svg {
    width: 12px;
    height: 12px;
  }

  .home-hero {
    padding-top: 18px;
    padding-left: 17px;
    padding-right: 17px;
    gap: 20px;
  }

  .eyebrow {
    gap: 7px;
    margin-bottom: 12px;
    font-size: 7.5px;
  }

  .eyebrow span {
    width: 16px;
  }

  h1 {
    font-size: clamp(30px, 8.8vw, 40px);
    line-height: 1.34;
  }

  .lede {
    max-width: 356px;
    margin: 14px auto 20px;
    font-size: 12.5px;
    line-height: 1.8;
  }

  .lede-full {
    display: none;
  }

  .lede-short {
    display: inline;
  }

  .section-label {
    padding: 0 2px;
  }

  .mode-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mode-card {
    min-height: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 5px;
    border-right: 1px solid var(--gold-line-soft);
    border-bottom: 0;
    text-align: center;
  }

  .mode-card:last-child {
    border-right: 0;
  }

  .mode-card::before {
    inset: 3px;
  }

  .mode-number {
    font-size: 8px;
    line-height: 1;
  }

  .mode-main {
    align-items: center;
    gap: 2px;
  }

  .mode-title {
    font-size: 15px;
    letter-spacing: 0.08em;
  }

  .mode-title span {
    display: none;
  }

  .mode-desc,
  .mode-sigil {
    display: none;
  }

  .deck-stage {
    width: 128px;
    height: 198px;
  }

  .deck-seal {
    width: 48px;
    height: 48px;
    right: -13px;
  }

  .seal-line {
    font-size: 11px;
  }

  .deck-caption {
    margin: 10px 0 11px;
    font-size: 7px;
  }

  .draw-panel {
    padding: 19px 17px 17px;
  }

  .draw-text {
    font-size: 14px;
  }

  .question-input {
    font-size: 13px;
  }

  .home-footer {
    padding-left: 17px;
    padding-right: 17px;
  }

  .reading-topbar {
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    padding: 8px 0 14px;
  }

  .text-button {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.05em;
  }

  .reading-mode {
    font-size: 11.5px;
    letter-spacing: 0.1em;
  }

  .reading-date {
    font-size: 8.5px;
    font-weight: 500;
    letter-spacing: 0.08em;
  }

  .reading-question-wrap {
    margin-bottom: 18px;
  }

  .reading-question {
    font-size: 15px;
    line-height: 1.85;
  }

  .reading-hint {
    margin-top: 18px;
    font-size: 10.5px;
    line-height: 1.7;
  }

  .reading-actions {
    margin-top: 13px;
    gap: 12px;
  }

  .ghost-button {
    min-height: 38px;
    padding: 0 14px;
    font-size: 11px;
  }

  .progress-label {
    font-size: 8.5px;
  }

  .reading-panel {
    padding: 28px 20px 26px;
    margin-bottom: 24px;
  }

  .panel-heading-row {
    margin-bottom: 16px;
  }

  .panel-kicker {
    font-size: 8.5px;
    letter-spacing: 0.16em;
  }

  .panel-lead {
    font-size: 14px;
    line-height: 2;
  }

  .essence-quote {
    font-size: 14px;
    line-height: 2;
    padding-left: 15px;
  }

  .advice-block {
    padding: 13px 14px;
  }

  .advice-block p {
    font-size: 13px;
    line-height: 1.95;
  }

  .domain-grid {
    grid-template-columns: 1fr;
  }

  .domain-item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 9px;
    align-items: baseline;
    padding: 10px 11px;
  }

  .domain-label {
    margin: 0;
    font-size: 9px;
  }

  .domain-item p {
    font-size: 12px;
    line-height: 1.75;
  }

  .card-note {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
    padding: 15px 0;
  }

  .card-note-title {
    font-size: 15.5px;
  }

  .card-note p {
    font-size: 13px;
    line-height: 1.95;
  }

  .position-item {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 9px;
    padding: 13px 0;
  }

  .position-mark {
    width: 26px;
    height: 26px;
    font-size: 10.5px;
  }

  .position-copy h4 {
    font-size: 13.5px;
  }

  .position-copy p {
    font-size: 12.5px;
    line-height: 1.9;
  }

  .quintessence {
    padding: 14px;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 11px;
  }

  .quintessence-mark {
    width: 34px;
    height: 46px;
    font-size: 11px;
  }

  .quintessence h4 {
    font-size: 14px;
  }

  .quintessence p {
    font-size: 12px;
    line-height: 1.8;
  }

  .reading-footer {
    font-size: 8px;
    gap: 7px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .modal-backdrop {
    padding: 12px;
    align-items: flex-end;
  }

  .card-modal {
    width: 100%;
    max-height: 90vh;
    max-height: 90dvh;
    padding: 28px 20px 24px;
  }

  .card-modal-inner {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .card-modal-visual {
    max-width: 160px;
  }

  .modal-en {
    margin-bottom: 14px;
  }

  .install-sheet {
    max-height: 91vh;
    max-height: 91dvh;
    padding: 30px 21px 24px;
  }

  .modal-close {
    top: 11px;
    right: 11px;
  }
}

@media (max-width: 380px) {
  .brand-en {
    display: none;
  }

  .brand-zh {
    font-size: 14px;
  }

  .install-button {
    padding: 0 9px;
  }

  .install-button span {
    display: none;
  }

  .install-button {
    width: 34px;
    justify-content: center;
    padding: 0;
  }

  .mode-desc {
    font-size: 9.8px;
  }

  .spread-5 {
    --card-w: clamp(47px, 14.7vw, 112px);
    gap: 4px;
  }

  .spread-5 .card-label-name {
    font-size: 7px;
  }

  .reading-mode {
    font-size: 9.5px;
  }

  .text-button {
    font-size: 9px;
  }
}

@media (max-height: 720px) and (min-width: 821px) {
  .home-hero {
    padding-top: 20px;
    padding-bottom: 16px;
  }

  h1 {
    font-size: clamp(38px, 4.2vw, 56px);
  }

  .lede {
    margin: 16px 0 25px;
  }

  .deck-stage {
    width: 146px;
    height: 226px;
  }

  .deck-caption {
    margin: 12px 0;
  }

  .draw-panel {
    padding: 18px 22px 16px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .playing-card:hover {
    transform: translateY(-5px);
    filter: drop-shadow(0 6px 15px rgba(0, 0, 0, 0.28));
  }

  .spread-5 .playing-card:hover {
    transform: translateY(-8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}


/* Mobile readability pass · keep essential text legible on small screens */
@media (max-width: 620px) {
  .panel-note {
    font-size: 10.5px;
    color: rgba(83, 62, 40, 0.82);
    line-height: 1.9;
  }

  .panel-subheading {
    font-size: 13px;
  }

  .card-detail-link {
    font-size: 11px;
  }

  .domain-item {
    padding: 11px 12px;
  }

  .card-label-name {
    font-size: 11px;
    font-weight: 500;
  }

  .spread-5 .card-label-name {
    font-size: 9px;
  }

  .spread-5 .card-label-mark {
    font-size: 8px;
  }

  .pick-kicker {
    font-size: 8.5px;
  }

  .pick-hint {
    font-size: 10px;
    line-height: 1.8;
  }

  .pick-question {
    font-size: 11.5px;
  }

  .pick-zone-head {
    font-size: 9.5px;
  }

  .pick-zone-hint {
    font-size: 9px;
  }

  .pick-slot-label {
    font-size: 11px;
  }

  .pick-slots-5 .pick-slot-label {
    font-size: 9px;
  }

  .pick-undo-button {
    font-size: 10.5px;
  }

  .pick-read-button .draw-text {
    font-size: 13px;
  }

  .pick-deck-head {
    font-size: 8.5px;
  }

  .pick-deck-head span:last-child {
    font-size: 7.5px;
  }

  .ai-title {
    font-size: 24px;
  }

  .ai-lede {
    font-size: 11.5px;
    line-height: 1.9;
  }

  .ai-question {
    font-size: 11px;
  }

  .ai-note {
    font-size: 9px;
    line-height: 1.8;
  }

  .ai-result-text {
    font-size: 13.5px;
    line-height: 2.05;
  }

  .ai-gate-copy {
    font-size: 11px;
  }

  .ai-disclaimer {
    font-size: 8.5px;
  }

  .ai-status {
    font-size: 10.5px;
  }
}
