/* ==========================================================================
   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: #f8f0df;
  --muted: #cbbba0;
  --muted-soft: rgba(238, 224, 198, 0.84);
  --gold: #d0b06d;
  --gold-bright: #eddaa9;
  --gold-deep: #9c7d47;
  --gold-line: rgba(208, 176, 109, 0.30);
  --gold-line-soft: rgba(208, 176, 109, 0.17);
  --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-zh-body: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --back-damask: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0OCIgaGVpZ2h0PSI0OCIgdmlld0JveD0iMCAwIDQ4IDQ4Ij4KPGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjNmQ3MTUzIiBzdHJva2Utd2lkdGg9IjAuOSIgb3BhY2l0eT0iLjMyIj4KPHBhdGggZD0iTTI0IDEyIEMyOCAxOCAyOCAyMiAyNCAyOCBDMjAgMjIgMjAgMTggMjQgMTJaIi8+CjxwYXRoIGQ9Ik0yNCAzNiBDMjggMzAgMjggMjYgMjQgMjAgQzIwIDI2IDIwIDMwIDI0IDM2WiIvPgo8cGF0aCBkPSJNMTIgMjQgQzE4IDIwIDIyIDIwIDI4IDI0IEMyMiAyOCAxOCAyOCAxMiAyNFoiLz4KPHBhdGggZD0iTTM2IDI0IEMzMCAyMCAyNiAyMCAyMCAyNCBDMjYgMjggMzAgMjggMzYgMjRaIi8+CjxjaXJjbGUgY3g9IjI0IiBjeT0iMjQiIHI9IjEuMiIgZmlsbD0iIzljN2Q0OCIgc3Ryb2tlPSJub25lIi8+CjwvZz4KPC9zdmc+");
  --back-ornament: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyODAgNDM0Ij4KPGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjNmQ3MTUzIiBzdHJva2UtbGluZWNhcD0icm91bmQiPgo8cmVjdCB4PSIxMSIgeT0iMTEiIHdpZHRoPSIyNTgiIGhlaWdodD0iNDEyIiByeD0iNSIgc3Ryb2tlLXdpZHRoPSIyIiBvcGFjaXR5PSIuNTUiLz4KPHJlY3QgeD0iMTgiIHk9IjE4IiB3aWR0aD0iMjQ0IiBoZWlnaHQ9IjM5OCIgcng9IjMiIHN0cm9rZS13aWR0aD0iMS4xIiBvcGFjaXR5PSIuNDUiLz4KPGcgaWQ9ImMiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzZkNzE1MyIgc3Ryb2tlLXdpZHRoPSIxLjgiIG9wYWNpdHk9Ii41NSI+CjxwYXRoIGQ9Ik0yMiA1OCBDMjIgMzggMzYgMjMgNTcgMjEiLz4KPHBhdGggZD0iTTI1IDQ4IEMzNyA0OCA0NyAzOCA0OCAyNiBDNDggMjEgNDQgMTggNDAgMjIgQzM2IDI3IDQwIDM0IDQ4IDM1IEM1NiAzNiA2MiAzMCA2MyAyMSIvPgo8cGF0aCBkPSJNMjkgNjUgQzQxIDY1IDUyIDU2IDU0IDQ0Ii8+CjxwYXRoIGQ9Ik0zMSAzMiBDMzUgMjggNDEgMjkgNDMgMzQgQzM5IDM4IDMzIDM3IDMxIDMyWiIvPgo8cGF0aCBkPSJNNDcgMzEgQzUxIDI3IDU3IDI4IDU5IDMzIEM1NSAzNyA0OSAzNiA0NyAzMVoiLz4KPGNpcmNsZSBjeD0iMzIiIGN5PSI1NCIgcj0iMS40IiBmaWxsPSIjOWM3ZDQ4IiBzdHJva2U9Im5vbmUiLz4KPC9nPgo8L2c+Cjx1c2UgaHJlZj0iI2MiLz4KPHVzZSBocmVmPSIjYyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjgwIDApIHNjYWxlKC0xIDEpIi8+Cjx1c2UgaHJlZj0iI2MiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgNDM0KSBzY2FsZSgxIC0xKSIvPgo8dXNlIGhyZWY9IiNjIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgyODAgNDM0KSBzY2FsZSgtMSAtMSkiLz4KPC9zdmc+");
  --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);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  -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 24% 20% at 14% 18%, rgba(240, 201, 133, 0.075) 0%, transparent 72%),
    radial-gradient(ellipse 20% 16% at 86% 15%, rgba(195, 226, 201, 0.045) 0%, transparent 76%),
    radial-gradient(ellipse 38% 28% at 50% 8%, rgba(232, 197, 126, 0.10) 0%, transparent 72%),
    radial-gradient(ellipse 32% 26% at 50% 38%, rgba(132, 181, 137, 0.18) 0%, transparent 72%),
    radial-gradient(ellipse 48% 42% at 50% 40%, rgba(78, 136, 96, 0.46) 0%, rgba(24, 61, 42, 0.28) 48%, transparent 76%),
    radial-gradient(ellipse 74% 64% at 50% 44%, rgba(25, 63, 44, 0.56) 0%, rgba(13, 29, 21, 0.72) 66%, transparent 100%),
    radial-gradient(ellipse 82% 80% at 50% 100%, rgba(3, 8, 5, 0.78) 0%, transparent 58%),
    linear-gradient(150deg, #1a3024 0%, #0e1d15 48%, #08110c 100%);
}

body.theme-burgundy .table-grain {
  background:
    radial-gradient(ellipse 24% 20% at 14% 18%, rgba(240, 190, 140, 0.08) 0%, transparent 72%),
    radial-gradient(ellipse 20% 16% at 86% 15%, rgba(210, 158, 166, 0.045) 0%, transparent 76%),
    radial-gradient(ellipse 38% 28% at 50% 8%, rgba(236, 184, 132, 0.10) 0%, transparent 72%),
    radial-gradient(ellipse 32% 26% at 50% 38%, rgba(186, 98, 107, 0.18) 0%, transparent 72%),
    radial-gradient(ellipse 48% 42% at 50% 40%, rgba(141, 53, 58, 0.47) 0%, rgba(70, 22, 30, 0.30) 48%, transparent 76%),
    radial-gradient(ellipse 74% 64% at 50% 44%, rgba(67, 23, 31, 0.62) 0%, rgba(28, 10, 15, 0.78) 66%, transparent 100%),
    radial-gradient(ellipse 82% 80% at 50% 100%, rgba(8, 2, 4, 0.82) 0%, transparent 58%),
    linear-gradient(150deg, #321921 0%, #210b12 48%, #120609 100%);
}

body.theme-walnut .table-grain {
  background:
    radial-gradient(ellipse 24% 20% at 14% 18%, rgba(245, 205, 145, 0.09) 0%, transparent 72%),
    radial-gradient(ellipse 20% 16% at 86% 15%, rgba(205, 177, 130, 0.045) 0%, transparent 76%),
    radial-gradient(ellipse 38% 28% at 50% 8%, rgba(238, 201, 143, 0.10) 0%, transparent 72%),
    radial-gradient(ellipse 32% 26% at 50% 38%, rgba(170, 132, 88, 0.18) 0%, transparent 72%),
    radial-gradient(ellipse 48% 42% at 50% 40%, rgba(123, 89, 57, 0.45) 0%, rgba(59, 40, 26, 0.30) 48%, transparent 76%),
    radial-gradient(ellipse 74% 64% at 50% 44%, rgba(61, 43, 29, 0.60) 0%, rgba(27, 18, 12, 0.80) 66%, transparent 100%),
    radial-gradient(ellipse 82% 80% at 50% 100%, rgba(7, 4, 3, 0.82) 0%, transparent 58%),
    linear-gradient(150deg, #352419 0%, #23160f 48%, #140c08 100%);
}

body.theme-parchment {
  --ink: #e7d6b9;
  --ink-deep: #d6c09e;
  --ink-soft: #f4ead7;
  --ink-panel: rgba(247, 238, 222, 0.78);
  --ivory: #392a1a;
  --muted: #6d563b;
  --muted-soft: rgba(73, 54, 34, 0.78);
  --gold: #8b6a3c;
  --gold-bright: #6d4d28;
  --gold-deep: #5b4224;
  --gold-line: rgba(108, 81, 47, 0.34);
  --gold-line-soft: rgba(108, 81, 47, 0.18);
  --oxblood: #8b3a32;
  --oxblood-soft: rgba(139, 58, 50, 0.10);
  --shadow-card: 0 22px 44px rgba(79, 55, 30, 0.30), 0 5px 14px rgba(79, 55, 30, 0.20);
  background: #e7d6b9;
}

html:has(body.theme-parchment) {
  background: #e7d6b9;
}

body.theme-parchment .table-grain {
  background:
    radial-gradient(ellipse 24% 20% at 14% 18%, rgba(255, 250, 236, 0.74) 0%, transparent 72%),
    radial-gradient(ellipse 20% 16% at 86% 15%, rgba(255, 237, 207, 0.56) 0%, transparent 76%),
    radial-gradient(ellipse 38% 28% at 50% 8%, rgba(255, 248, 234, 0.64) 0%, transparent 72%),
    radial-gradient(ellipse 34% 28% at 50% 38%, rgba(255, 252, 242, 0.62) 0%, transparent 72%),
    radial-gradient(ellipse 80% 74% at 50% 100%, rgba(91, 64, 34, 0.22) 0%, transparent 62%),
    linear-gradient(150deg, #f3e7d1 0%, #e5d2b3 48%, #cdb58f 100%);
}

body.theme-parchment .table-grain::before {
  opacity: 0.18;
  mix-blend-mode: multiply;
}

body.theme-parchment .table-grain::after {
  background:
    radial-gradient(ellipse 82% 68% at 50% 48%, transparent 40%, rgba(84, 58, 30, 0.20) 100%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.10) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(45deg, rgba(91, 64, 34, 0.045) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(135deg, transparent 0 46px, rgba(108, 81, 47, 0.025) 46px 47px),
    repeating-linear-gradient(45deg, transparent 0 46px, rgba(108, 81, 47, 0.025) 46px 47px);
}

/* Parchment theme panels: keep the paper light, never the old dark green. */
body.theme-parchment .icon-button {
  color: var(--gold-deep);
  background: rgba(255, 250, 238, 0.30);
}

body.theme-parchment .draw-panel {
  background:
    linear-gradient(135deg, rgba(255, 250, 238, 0.55), transparent 38%),
    linear-gradient(180deg, rgba(249, 239, 221, 0.93), rgba(235, 218, 190, 0.95));
  box-shadow: 0 22px 50px rgba(82, 58, 32, 0.16), inset 0 0 0 4px rgba(255, 250, 238, 0.28);
}

body.theme-parchment .draw-panel::before,
body.theme-parchment .pick-zone::before {
  border-color: rgba(108, 81, 47, 0.12);
}

body.theme-parchment .question-input,
body.theme-parchment .pick-question-input,
body.theme-parchment .ai-question-input,
body.theme-parchment .ai-code-input {
  color: var(--ivory);
  border-color: var(--gold-line);
  background: rgba(255, 250, 238, 0.44);
}

body.theme-parchment .question-input::placeholder,
body.theme-parchment .pick-question-input::placeholder,
body.theme-parchment .ai-question-input::placeholder,
body.theme-parchment .ai-code-input::placeholder {
  color: rgba(82, 60, 36, 0.46);
}

body.theme-parchment .pick-zone {
  background:
    linear-gradient(135deg, rgba(255, 251, 241, 0.50), transparent 40%),
    rgba(249, 239, 222, 0.44);
}

body.theme-parchment .pick-zone.is-drag-over {
  background:
    linear-gradient(135deg, rgba(192, 154, 88, 0.16), transparent 48%),
    rgba(255, 250, 238, 0.64);
}

body.theme-parchment .pick-slot-frame {
  background: rgba(255, 251, 242, 0.32);
  border-color: rgba(108, 81, 47, 0.36);
}

body.theme-parchment .pick-slot.is-empty:hover .pick-slot-frame {
  background: rgba(255, 251, 242, 0.55);
  border-color: var(--gold-deep);
}

body.theme-parchment .pick-slot.is-filled .pick-slot-frame {
  background: #e4d2b2;
  border-color: var(--gold);
  box-shadow: 0 9px 18px rgba(79, 55, 30, 0.24), 0 1px 4px rgba(79, 55, 30, 0.18);
}

body.theme-parchment .pick-zone-hint,
body.theme-parchment .pick-deck-head,
body.theme-parchment .pick-hint,
body.theme-parchment .pick-slot-label,
body.theme-parchment .pick-question-label {
  color: var(--muted);
}

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

body.theme-parchment .ai-reading {
  color: var(--ivory);
  background:
    radial-gradient(ellipse 70% 55% at 82% 0%, rgba(255, 249, 234, 0.48), transparent 58%),
    linear-gradient(145deg, rgba(249, 239, 222, 0.94), rgba(234, 216, 188, 0.96));
  box-shadow: 0 28px 70px rgba(82, 58, 32, 0.18), inset 0 0 0 5px rgba(255, 250, 238, 0.22);
}

body.theme-parchment .ai-reading::before {
  border-color: rgba(108, 81, 47, 0.14);
}

body.theme-parchment .ai-gate {
  background: rgba(255, 250, 239, 0.44);
  border-color: var(--gold-line);
}

body.theme-parchment .ai-order-item {
  color: var(--ivory);
  background: rgba(255, 250, 239, 0.48);
  border-color: var(--gold-line);
}

body.theme-parchment .ai-result {
  border-top-color: rgba(108, 81, 47, 0.18);
}

body.theme-parchment .ai-result-text {
  color: var(--ivory);
}

body.theme-parchment .card-modal {
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 249, 234, 0.66), transparent 38%),
    linear-gradient(145deg, #f2e5cd, #e3d0af 75%);
  border-color: var(--gold-line);
  box-shadow: 0 30px 80px rgba(79, 55, 30, 0.30);
}

body.theme-parchment .ghost-button {
  color: var(--gold-deep);
  background: rgba(255, 250, 238, 0.42);
}

body.theme-parchment .ghost-button:hover {
  background: rgba(192, 154, 88, 0.14);
}

body.theme-parchment .slot-return {
  color: var(--parchment);
  background: rgba(84, 58, 30, 0.82);
}

.table-grain::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.30;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.62' 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='.72'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  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.50) 100%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.045) 0 1px, transparent 1px 4px),
    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.45s var(--ease-soft) backwards;
}

@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: clamp(20px, 3vw, 30px);
  border: 1px solid rgba(200, 166, 99, 0.16);
  background: rgba(5, 14, 9, 0.42);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.18);
}

.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: 20px 0 34px;
  color: var(--muted);
  font-family: var(--font-zh);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.9;
}

.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);
  background: rgba(5, 14, 9, 0.26);
  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: #24180d;
  background: linear-gradient(180deg, #e3c98f 0%, #c7a363 56%, #b58f52 100%);
  border-color: rgba(255, 243, 212, 0.55);
  box-shadow:
    0 5px 16px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(255, 248, 230, 0.42);
}

.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: rgba(46, 29, 12, 0.72);
}

.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: #5a3a1d;
}

.mode-card.is-selected .mode-desc {
  color: rgba(42, 27, 12, 0.72);
}

.mode-desc {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-zh);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.025em;
  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: 0.9;
}

.mode-card.is-selected .mode-sigil span {
  border-color: rgba(45, 28, 12, 0.55);
  background: rgba(255, 248, 230, 0.15);
}

.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);
}

.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-word {
  position: relative;
  z-index: 1;
  padding: 5px 10px;
  color: #665235;
  background: rgba(245, 234, 213, 0.84);
  border-top: 1px solid rgba(121, 96, 59, 0.38);
  border-bottom: 1px solid rgba(121, 96, 59, 0.38);
  font-family: var(--font-en);
  font-size: 6.5px;
  letter-spacing: 0.24em;
  line-height: 1.35;
  text-align: center;
}

.back-word em {
  display: block;
  margin-top: 2px;
  color: #8e744c;
  font-style: normal;
  font-size: 0.78em;
  letter-spacing: 0.16em;
}

.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);
}

.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: 9.5px;
  letter-spacing: 0.03em;
  opacity: 0.88;
}

.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;
  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);
  padding: 11px 16px 12px;
  border: 1px solid rgba(200, 166, 99, 0.14);
  background: rgba(5, 14, 9, 0.62);
  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 {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  gap: clamp(8px, 2.5vw, 24px);
}

.spread-2 .card-slot {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
}

.spread-5 {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  gap: clamp(4px, 1.1vw, 10px);
}

.spread-5 .card-slot {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
}

.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.4s var(--ease-card) forwards;
  animation-delay: calc(0.04s + var(--i) * 0.07s);
}

@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-hit {
  position: absolute;
  inset: 0;
  z-index: 8;
  border-radius: 7px;
}

.card-slot.is-active .playing-card::after {
  border-color: rgba(237, 218, 169, 0.82);
  box-shadow: 0 0 0 1px rgba(237, 218, 169, 0.22), 0 0 26px rgba(200, 166, 99, 0.24);
}

.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);
}

.playing-card:active {
  transform: scale(0.985);
  transition-duration: 0.14s;
}

.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% 34%, rgba(255, 251, 240, 0.82) 0%, rgba(240, 227, 204, 0.42) 44%, rgba(210, 190, 154, 0.46) 100%),
    linear-gradient(160deg, rgba(255, 250, 238, 0.28), transparent 52%, rgba(120, 94, 58, 0.08));
}

.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-slot.is-revealed .card-face-back {
  visibility: hidden;
  opacity: 0;
}

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

.card-face-front {
  transform: rotateY(180deg);
  background: #e9dcc2;
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.34),
    0 4px 9px rgba(0, 0, 0, 0.22),
    inset 0 0 0 1px rgba(255, 248, 228, 0.44),
    inset 0 0 24px rgba(62, 42, 20, 0.12);
}

.card-face-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.97) contrast(1.035) brightness(1.015);
  user-select: none;
  -webkit-user-drag: none;
}

.card-face-front::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border: 1px solid rgba(255, 246, 222, 0.36);
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255, 251, 238, 0.15) 0%, transparent 42%),
    linear-gradient(115deg, rgba(255, 255, 255, 0.055) 0%, transparent 34%, transparent 72%, rgba(38, 24, 10, 0.075) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(83, 59, 31, 0.22),
    inset 0 0 28px rgba(60, 40, 18, 0.12);
}

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

.card-label {
  margin-top: 9px;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--muted-soft);
  border: 1px solid rgba(200, 166, 99, 0.14);
  background: rgba(5, 14, 9, 0.54);
  text-align: center;
  transition: color 0.3s, background 0.3s, border-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 {
  width: fit-content;
  min-height: 20px;
  margin: 22px auto 0;
  padding: 4px 10px;
  color: var(--muted-soft);
  border: 1px solid rgba(200, 166, 99, 0.12);
  background: rgba(5, 14, 9, 0.50);
  font-family: var(--font-zh-body);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-align: center;
}

.reading-actions {
  margin-top: 17px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 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);
  overflow-anchor: none;
  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.5s 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 17px;
  color: #3d2e21;
  font-family: var(--font-zh);
  font-size: clamp(14.5px, 1.9vw, 16.5px);
  font-weight: 500;
  letter-spacing: 0.035em;
  line-height: 1.95;
}

.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 {
  width: 4px;
  height: 4px;
  flex: none;
  background: rgba(107, 78, 43, 0.55);
  transform: rotate(45deg);
}

.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;
}

.card-note p.note-interact {
  margin-top: 8px;
  padding-top: 8px;
  color: #5b452f;
  border-top: 1px dashed rgba(101, 73, 39, 0.24);
  font-size: 12.2px;
  line-height: 1.8;
}

.card-note p.note-interact span {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 5px;
  color: #835d35;
  border: 1px solid rgba(112, 79, 41, 0.28);
  background: rgba(255, 250, 238, 0.4);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  vertical-align: 1px;
}

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

.position-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 9px;
  padding: 15px 16px;
  border: 1px solid rgba(101, 73, 39, 0.16);
  background: rgba(255, 250, 238, 0.32);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

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

.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: #322417;
  font-family: var(--font-zh);
  font-size: 14px;
  font-weight: 500;
  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: #43311f;
  font-family: var(--font-zh);
  font-size: 13.4px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.9;
}

.position-copy .position-interact {
  margin-top: 8px;
  padding-top: 8px;
  color: #5b452f;
  border-top: 1px dashed rgba(101, 73, 39, 0.24);
  font-size: 12.2px;
  line-height: 1.8;
}

.position-interact span {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 5px;
  color: #835d35;
  border: 1px solid rgba(112, 79, 41, 0.28);
  background: rgba(255, 250, 238, 0.4);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  vertical-align: 1px;
}

.interaction-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.interaction-item {
  padding: 11px 13px;
  border: 1px solid rgba(101, 73, 39, 0.15);
  background: rgba(255, 250, 238, 0.30);
}

.interaction-pair {
  display: block;
  margin-bottom: 5px;
  color: #765233;
  font-family: var(--font-zh);
  font-size: 9.5px;
  letter-spacing: 0.1em;
}

.interaction-pair em {
  margin: 0 3px;
  color: var(--oxblood);
  font-style: normal;
}

.interaction-item p {
  margin: 0;
  color: #4b3927;
  font-family: var(--font-zh);
  font-size: 12.4px;
  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: 22px 0 0;
  padding-top: 14px;
  color: rgba(76, 54, 33, 0.82);
  border-top: 1px solid rgba(100, 73, 40, 0.18);
  font-family: var(--font-zh);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.035em;
  line-height: 1.85;
}

.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);
}

.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-end-actions {
  max-width: 820px;
  margin: -10px auto 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.reading-end-redraw {
  justify-self: auto;
  min-height: 40px;
  padding: 0 18px 0 14px;
}

.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.25s 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 1.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-1 { animation: shuffleA 1.05s ease-in-out infinite; }
.shuffle-card-2 { animation: shuffleB 1.05s -0.08s ease-in-out infinite; }
.shuffle-card-3 { animation: shuffleC 1.05s -0.16s ease-in-out infinite; }
.shuffle-card-4 { animation: shuffleD 1.05s -0.24s ease-in-out infinite; }
.shuffle-card-5 { animation: shuffleE 1.05s -0.32s 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);
  color: #3d2d1e;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 253, 245, 0.86), transparent 38%),
    radial-gradient(circle at 90% 100%, rgba(154, 121, 73, 0.14), transparent 44%),
    linear-gradient(145deg, rgba(247, 239, 224, 0.96), rgba(232, 217, 193, 0.95));
  border: 1px solid rgba(105, 76, 41, 0.55);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.52),
    inset 0 0 0 1px rgba(255, 250, 238, 0.55);
  backdrop-filter: blur(14px) saturate(1.04);
  -webkit-backdrop-filter: blur(14px) saturate(1.04);
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 88, 48, 0.35) transparent;
}

.card-modal .modal-close {
  color: #5b4228;
  border-color: rgba(108, 79, 43, 0.38);
  background: rgba(255, 250, 240, 0.55);
}

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

.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: #8d6d3e;
  font-family: var(--font-en);
  font-size: 8px;
  letter-spacing: 0.26em;
}

.modal-title {
  margin: 0;
  color: #2d2116;
  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: #8c6b42;
  font-size: 9px;
  letter-spacing: 0.22em;
}

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

.card-modal-copy .keyword {
  color: #75532e;
  border-color: rgba(112, 79, 41, 0.28);
  background: rgba(255, 248, 232, 0.42);
}

.modal-essence {
  margin: 0 0 20px;
  color: #3d2d1e;
  font-family: var(--font-zh);
  font-size: 15px;
  letter-spacing: 0.04em;
  line-height: 1.95;
}

.modal-advice {
  padding: 15px 17px;
  border-left: 2px solid rgba(139, 58, 50, 0.62);
  background: rgba(111, 78, 40, 0.075);
}

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

.modal-advice p {
  margin: 0;
  color: #4a3826;
  font-family: var(--font-zh);
  font-size: 13.2px;
  line-height: 1.9;
}

.modal-interact {
  margin: 16px 0 0;
  padding: 14px 16px;
  border: 1px solid rgba(101, 73, 39, 0.18);
  background: rgba(255, 250, 238, 0.38);
}

.modal-interact-label {
  display: block;
  margin-bottom: 6px;
  color: #8d6d3e;
  font-family: var(--font-zh);
  font-size: 9px;
  letter-spacing: 0.17em;
}

.modal-interact p {
  margin: 0;
  color: #4b3927;
  font-family: var(--font-zh);
  font-size: 12.8px;
  line-height: 1.9;
}

.modal-duality {
  margin: 18px 0 0;
  border-color: rgba(100, 73, 40, 0.18);
  background: rgba(100, 73, 40, 0.15);
}

.modal-duality .duality-item {
  background: rgba(244, 233, 212, 0.8);
}

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

.modal-duality .duality-label {
  color: #987442;
  font-size: 9px;
}

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

.modal-duality .duality-item p {
  color: #55412e;
  font-size: 12.4px;
  line-height: 1.8;
}

.modal-domains {
  margin-top: 16px;
  border-color: rgba(100, 73, 40, 0.18);
  background: rgba(100, 73, 40, 0.15);
}

.modal-domains .domain-item {
  background: rgba(244, 233, 212, 0.78);
}

.modal-domains .domain-label {
  color: #987442;
  font-size: 9px;
}

.modal-domains .domain-item p {
  color: #4a3928;
  font-size: 12.4px;
  line-height: 1.8;
}

/* Body copy uses a clearer sans on small screens; headings stay serif. */
.panel-lead,
.position-copy p,
.position-interact,
.interaction-item p,
.card-note p,
.advice-block p,
.modal-essence,
.modal-advice p,
.modal-interact p,
.modal-duality .duality-item p,
.modal-domains .domain-item p {
  font-family: var(--font-zh-body);
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* 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);
  overflow-anchor: none;
  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.5s 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: 0 auto;
  color: var(--muted);
  font-family: var(--font-zh);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.025em;
  line-height: 1.9;
}

.ai-question-field {
  display: block;
  max-width: 560px;
  margin: 12px auto 0;
  text-align: left;
}

.ai-question-label {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
  font-family: var(--font-zh);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.ai-question-input {
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  color: var(--ivory);
  border: 1px solid var(--gold-line);
  border-radius: 0;
  background: rgba(5, 13, 8, 0.32);
  font-family: var(--font-zh);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.025em;
  line-height: 1.7;
  resize: vertical;
  appearance: none;
  transition: border-color 0.25s, background 0.25s;
}

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

.ai-question-input:focus {
  outline: 0;
  border-color: rgba(229, 206, 152, 0.7);
  background: rgba(200, 166, 99, 0.04);
}

.ai-order {
  max-width: 560px;
  margin: 18px auto 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.ai-order-label {
  flex-basis: 100%;
  color: var(--muted-soft);
  font-family: var(--font-zh);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-align: center;
}

.ai-order-item {
  padding: 4px 8px;
  color: var(--ivory);
  border: 1px solid rgba(200, 166, 99, 0.18);
  background: rgba(200, 166, 99, 0.035);
  font-family: var(--font-zh);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.ai-order-item em {
  margin-right: 4px;
  color: var(--gold);
  font-style: normal;
  font-size: 8px;
  letter-spacing: 0.08em;
}

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

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

.ai-start-button .draw-text {
  font-size: 19px;
  letter-spacing: 0.18em;
}

.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: var(--ivory);
  font-family: var(--font-zh);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.025em;
  line-height: 2;
  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-field {
  display: block;
  max-width: 520px;
  margin: 15px auto 0;
  text-align: left;
}

.pick-question-label {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
  font-family: var(--font-zh);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.pick-question-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  color: var(--ivory);
  border: 1px solid var(--gold-line);
  border-radius: 0;
  background: rgba(5, 13, 8, 0.28);
  font-family: var(--font-zh);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.025em;
  appearance: none;
  transition: border-color 0.25s, background 0.25s;
}

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

.pick-question-input:focus {
  outline: 0;
  border-color: rgba(229, 206, 152, 0.7);
  background: rgba(200, 166, 99, 0.035);
}

.pick-hint {
  width: fit-content;
  margin: 12px auto 0;
  padding: 4px 9px;
  color: var(--muted);
  border: 1px solid rgba(200, 166, 99, 0.12);
  background: rgba(5, 14, 9, 0.48);
  font-family: var(--font-zh-body);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.035em;
  line-height: 1.75;
}

/* 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.12s ease;
}

.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);
}

.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);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.pick-slot.is-filled:hover .pick-slot-frame,
.pick-slot.is-filled:focus-visible .pick-slot-frame {
  border-color: rgba(237, 218, 169, 0.9);
  box-shadow:
    0 12px 22px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(237, 218, 169, 0.48),
    0 0 24px rgba(200, 166, 99, 0.22);
}

.pick-slot.is-new .pick-slot-frame {
  box-shadow:
    0 9px 18px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(237, 218, 169, 0.62),
    0 0 28px rgba(200, 166, 99, 0.28);
}

.pick-slot.is-new .pick-slot-frame {
  animation: slotSettle 0.28s 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%;
  padding: 3px 5px;
  color: var(--muted-soft);
  border: 1px solid rgba(200, 166, 99, 0.12);
  background: rgba(5, 14, 9, 0.50);
  font-family: var(--font-zh-body);
  font-size: 10px;
  letter-spacing: 0.07em;
  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 · overlapping velvet spread */

.pick-deck {
  position: relative;
  max-width: 620px;
  margin: 0 auto;
  padding: 0 0 10px;
  border: 0;
  background: transparent;
}

.pick-deck-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  padding: 0 3px;
  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 {
  --card-w: clamp(44px, 13.8vw, 82px);
  --card-h: calc(var(--card-w) * 1.55);
  --card-step: calc(var(--card-w) * 0.53);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 8px 0 3px;
}

.pick-grid.is-preparing {
  opacity: 0;
  pointer-events: none;
  transition: none;
}

.pick-grid.is-dealing .pick-cell {
  animation: pickDealIn 0.42s cubic-bezier(0.2, 0.86, 0.28, 1) backwards;
  animation-delay: calc(var(--deal-i, 0) * 14ms);
  will-change: transform, opacity;
}

@keyframes pickDealIn {
  from {
    opacity: 0;
    transform: translate3d(0, calc(var(--arc-y, 0px) - 28px), 0) rotate(var(--arc-rot, 0deg)) scale(0.88);
  }
  to {
    opacity: 1;
    transform: translate3d(0, var(--arc-y, 0px), 0) rotate(var(--arc-rot, 0deg)) scale(1);
  }
}

.pick-grid::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 112%;
  height: 78%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(200, 166, 99, 0.10) 0%, rgba(200, 166, 99, 0.03) 42%, transparent 72%);
  filter: blur(8px);
  pointer-events: none;
  z-index: 0;
}

.pick-row {
  position: relative;
  width: 100%;
  height: var(--card-h);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.pick-row + .pick-row {
  margin-top: calc(var(--card-h) * -0.22);
}

.pick-row {
  animation: rowDealIn 0.45s var(--ease-card) backwards;
  animation-delay: calc(var(--row, 0) * 0.07s);
}

@keyframes rowDealIn {
  from { opacity: 0; transform: translate3d(0, 22px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.pick-cell {
  position: relative;
  contain: layout style;
  flex: 0 0 var(--card-w);
  width: var(--card-w);
  height: var(--card-h);
  margin-left: calc(var(--card-step) - var(--card-w));
  padding: 0;
  border: 0;
  border-radius: clamp(4px, 0.55vw, 7px);
  background: transparent;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  z-index: calc(var(--row, 0) * 100 + var(--col) + 1);
  transform: translate3d(0, var(--arc-y, 0), 0) rotate(var(--arc-rot, 0deg));
  transform-origin: center bottom;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s, filter 0.25s;
}

.pick-cell:first-child {
  margin-left: 0;
}

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

.mini-card-back {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid rgba(83, 62, 38, 0.7);
  border-radius: inherit;
  background-color: #e7d8b8;
  background-image:
    radial-gradient(circle at 50% 34%, rgba(255, 252, 242, 0.82), rgba(240, 227, 204, 0.4) 48%, rgba(210, 190, 154, 0.42) 100%),
    linear-gradient(160deg, rgba(255, 250, 238, 0.22), transparent 55%, rgba(120, 94, 58, 0.07));
  box-shadow:
    0 3px 7px rgba(0, 0, 0, 0.3),
    0 8px 16px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 252, 240, 0.56),
    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::after {
  content: "";
  position: absolute;
  inset: clamp(3px, 0.55vw, 6px);
  border: 1px solid rgba(122, 97, 70, 0.3);
  border-radius: 1px;
}

.mini-back-word {
  position: absolute;
  left: 7%;
  bottom: 23%;
  z-index: 1;
  width: 54%;
  padding: 2px 2px 2px 3px;
  color: #6b5436;
  border-top: 1px solid rgba(120, 95, 59, 0.38);
  border-bottom: 1px solid rgba(120, 95, 59, 0.38);
  background: rgba(243, 232, 210, 0.72);
  font-family: var(--font-en);
  font-size: clamp(3.8px, 0.68vw, 5.8px);
  letter-spacing: 0.06em;
  line-height: 1.25;
  text-align: left;
  white-space: nowrap;
}

.mini-back-word em {
  display: block;
  margin-top: 1px;
  color: #8e744c;
  font-style: normal;
  font-size: 0.78em;
  letter-spacing: 0.07em;
}

.pick-cell:hover {
  z-index: 1000;
  transform: translate3d(0, calc(var(--arc-y, 0px) - 24px), 0) rotate(0deg) scale(1.08);
  filter: drop-shadow(0 0 7px rgba(237, 218, 169, 0.34));
}

.pick-cell:hover .mini-card-back {
  box-shadow:
    0 13px 26px rgba(0, 0, 0, 0.42),
    0 0 0 2px #E8D39A,
    0 0 20px rgba(232, 211, 154, 0.40),
    inset 0 0 0 2px rgba(244, 233, 212, 0.82),
    inset 0 0 0 2.7px rgba(112, 88, 57, 0.4);
}

.pick-cell.is-used {
  pointer-events: none;
  opacity: 0.22;
  transform: translate3d(0, var(--arc-y, 0), 0) scale(0.9);
  filter: grayscale(1);
}

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

.pick-cell.is-used .mini-card-back::after,
.pick-cell.is-used .mini-back-word {
  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 {
    z-index: calc(var(--row, 0) * 100 + var(--col) + 1);
    transform: translate3d(0, var(--arc-y, 0), 0) rotate(var(--arc-rot, 0deg));
  }

  .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: 0;
  }

  .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: 0;
  }

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

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

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

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

@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;
  }

  .interaction-list {
    grid-template-columns: 1fr;
  }

  .position-item {
    padding: 13px 13px;
    gap: 11px;
  }

  .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:not(.is-flipped):hover {
    transform: translateY(-6px) rotateX(1.2deg) rotateY(-1.4deg);
    filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.3));
  }

  .playing-card:hover::after {
    border-color: rgba(229, 206, 152, 0.46);
    box-shadow: 0 0 22px rgba(200, 166, 99, 0.16);
  }

  .spread-5 .playing-card:not(.is-flipped):hover {
    transform: translateY(-8px) rotateX(1deg) rotateY(-1.2deg);
  }
}



/* 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: 12.5px;
    line-height: 1.9;
  }

  .pick-question-field {
    margin-top: 12px;
  }

  .pick-question-label,
  .ai-question-label {
    font-size: 9.5px;
  }

  .pick-question-input {
    height: 42px;
    padding: 0 11px;
    font-size: 14px;
  }

  .ai-question-field {
    margin-top: 13px;
  }

  .ai-question-input {
    min-height: 64px;
    padding: 10px 11px;
    font-size: 14px;
  }

  .ai-order {
    gap: 4px;
  }

  .ai-order-item {
    font-size: 10.5px;
    padding: 3px 6px;
  }

  .ai-order-item em {
    font-size: 8.5px;
  }

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

  .ai-result-text {
    font-size: 14.5px;
    line-height: 2;
  }

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

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

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

/* Parchment theme contrast corrections */
body.theme-parchment .card-label {
  color: var(--muted);
}

body.theme-parchment .card-label-mark {
  color: var(--gold-deep);
  opacity: 1;
}

body.theme-parchment .card-label-name {
  color: var(--ivory);
  font-weight: 500;
}

body.theme-parchment .card-slot.is-active .card-label {
  color: var(--gold-deep);
}

body.theme-parchment .reading-hint {
  color: var(--muted);
}

body.theme-parchment .pick-read-button:disabled {
  color: rgba(91, 66, 36, 0.58);
  background: rgba(255, 250, 238, 0.32);
  box-shadow: inset 0 0 0 1px rgba(108, 81, 47, 0.28);
}

body.theme-parchment .pick-read-button:disabled .draw-deco,
body.theme-parchment .pick-read-button:disabled .draw-arrow {
  color: rgba(108, 81, 47, 0.38);
}

body.theme-parchment .pick-undo-button:disabled {
  color: rgba(91, 66, 36, 0.45);
  border-color: rgba(108, 81, 47, 0.22);
}

body.theme-parchment .toast {
  color: #f6e9d3;
  background: rgba(58, 40, 24, 0.95);
  border-color: rgba(232, 206, 160, 0.32);
}

/* --------------------------------------------------------------------------
   Local history
   -------------------------------------------------------------------------- */

.footer-history {
  display: inline-block;
  margin: 2px 0 10px;
  padding: 3px 0;
  color: var(--muted);
  border-bottom: 1px solid var(--gold-line-soft);
  font-family: var(--font-zh);
  font-size: 10px;
  letter-spacing: 0.06em;
  transition: color 0.2s, border-color 0.2s;
}

.footer-history:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.history-backdrop {
  position: fixed;
  inset: 0;
  z-index: 135;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 10, 7, 0.76);
  backdrop-filter: blur(9px);
  animation: overlayIn 0.22s ease both;
}

.history-sheet {
  position: relative;
  width: min(560px, 100%);
  max-height: min(84vh, 760px);
  overflow: auto;
  padding: 26px 26px 20px;
  color: #332518;
  border: 1px solid rgba(96, 70, 40, 0.48);
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 252, 240, 0.7), transparent 38%),
    linear-gradient(145deg, #f2e7d0, #e3d0af 78%);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.4), inset 0 0 0 5px rgba(255, 250, 238, 0.22);
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 88, 48, 0.35) transparent;
}

.history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-right: 34px;
}

.history-kicker {
  margin: 0 0 7px;
  color: #947546;
  font-family: var(--font-en);
  font-size: 8px;
  letter-spacing: 0.26em;
}

.history-title {
  margin: 0;
  color: #2d2116;
  font-family: var(--font-zh);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.3;
}

.history-privacy {
  margin: 12px 0 18px;
  padding: 9px 11px;
  color: #5c4733;
  border-left: 2px solid #9b6e3f;
  background: rgba(155, 110, 63, 0.08);
  font-family: var(--font-zh);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.7;
}

.history-close {
  position: absolute;
  top: 18px;
  right: 18px;
  color: #6d563b;
  background: rgba(105, 77, 43, 0.07);
  border-color: rgba(105, 77, 43, 0.28);
}

.history-close:hover {
  color: #3d2b1a;
  border-color: rgba(105, 77, 43, 0.5);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(48vh, 430px);
  overflow: auto;
  padding-right: 3px;
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 88, 48, 0.35) transparent;
}

.history-entry {
  width: 100%;
  padding: 11px 13px;
  text-align: left;
  color: #3b2b1b;
  border: 1px solid rgba(110, 81, 47, 0.22);
  background: rgba(255, 250, 239, 0.36);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.history-entry:hover {
  border-color: rgba(110, 81, 47, 0.48);
  background: rgba(255, 250, 239, 0.66);
  transform: translateY(-1px);
}

.history-entry-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.history-entry-mode {
  color: #7c5b32;
  font-family: var(--font-zh);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.history-entry-date {
  color: rgba(78, 58, 36, 0.62);
  font-family: var(--font-en);
  font-size: 8px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.history-entry-question {
  margin: 5px 0 4px;
  overflow: hidden;
  color: #332518;
  font-family: var(--font-zh);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-entry-cards {
  margin: 0;
  overflow: hidden;
  color: #6b5438;
  font-family: var(--font-zh);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-empty {
  padding: 34px 10px;
  color: #6c563c;
  font-family: var(--font-zh);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  line-height: 1.8;
  text-align: center;
}

.history-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid rgba(103, 76, 43, 0.18);
}

.history-count {
  color: rgba(78, 58, 36, 0.62);
  font-family: var(--font-zh);
  font-size: 9.5px;
  letter-spacing: 0.05em;
}

.history-clear {
  padding: 6px 0;
  color: #8b3a32;
  border-bottom: 1px solid rgba(139, 58, 50, 0.28);
  font-family: var(--font-zh);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.history-clear:hover {
  border-bottom-color: #8b3a32;
}

.history-clear:disabled {
  opacity: 0.35;
  cursor: default;
}

@media (max-width: 620px) {
  .history-backdrop {
    align-items: flex-end;
    padding: 12px;
  }

  .history-sheet {
    max-height: 82dvh;
    padding: 22px 18px 16px;
  }

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

  .history-list {
    max-height: 48dvh;
  }
}

.history-entry-question,
.history-entry-cards {
  display: block;
}

@media (max-width: 380px) {
  .site-header {
    padding-left: 14px;
    padding-right: 14px;
  }

  .header-actions {
    gap: 4px;
  }

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

  .install-button {
    height: 32px;
    padding: 0 8px;
    font-size: 9.5px;
    gap: 4px;
  }

  .brand-zh {
    font-size: 14px;
    letter-spacing: 0.08em;
  }

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


body.theme-parchment .reading-question-wrap,
body.theme-parchment .card-label,
body.theme-parchment .reading-hint,
body.theme-parchment .pick-hint,
body.theme-parchment .pick-slot-label {
  border-color: rgba(108, 81, 47, 0.20);
  background: rgba(255, 250, 239, 0.78);
}

body.theme-parchment .reading-question-wrap {
  box-shadow: 0 4px 16px rgba(80, 55, 30, 0.08);
}

body.theme-parchment .card-slot.is-active .card-label {
  background: rgba(230, 202, 156, 0.48);
  border-color: rgba(108, 81, 47, 0.34);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}

.topbar-history {
  width: 32px;
  height: 32px;
  flex: none;
}

.topbar-actions .text-button-right {
  white-space: nowrap;
}

.redraw-button {
  justify-self: end;
  min-height: 34px;
  padding: 0 12px 0 9px;
  gap: 7px;
  color: #f6e6bf;
  border: 1px solid rgba(200, 166, 99, 0.52);
  background:
    linear-gradient(180deg, rgba(200, 166, 99, 0.20), rgba(200, 166, 99, 0.055));
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.24),
    inset 0 0 0 1px rgba(255, 246, 220, 0.06);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  transition: color 0.25s, border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.redraw-button:hover {
  color: #fff2d3;
  border-color: rgba(232, 203, 141, 0.8);
  background:
    linear-gradient(180deg, rgba(200, 166, 99, 0.30), rgba(200, 166, 99, 0.10));
  box-shadow:
    0 5px 18px rgba(0, 0, 0, 0.28),
    0 0 0 3px rgba(200, 166, 99, 0.07);
}

.redraw-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border: 1px solid rgba(200, 166, 99, 0.4);
  border-radius: 50%;
  font-family: var(--font-ui);
  font-size: 11px;
  line-height: 1;
}

@media (max-width: 620px) {
  .topbar-actions {
    gap: 4px;
  }

  .topbar-history {
    width: 30px;
    height: 30px;
  }

  .topbar-actions .text-button {
    font-size: 10.5px;
    letter-spacing: 0.06em;
  }

  .redraw-button {
    min-height: 32px;
    padding: 0 9px 0 7px;
    gap: 5px;
    font-size: 10px;
  }

  .redraw-icon {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }
}

/* Ceremonial shuffle phases */
.shuffle-deck.phase-cut .shuffle-card,
.shuffle-deck.phase-square .shuffle-card {
  animation: none;
  transition: transform 0.68s var(--ease-card);
}

.shuffle-deck.phase-cut .shuffle-card:nth-child(1) { transform: translate(-46px, 3px) rotate(-9deg); }
.shuffle-deck.phase-cut .shuffle-card:nth-child(2) { transform: translate(-22px, 1px) rotate(-4deg); }
.shuffle-deck.phase-cut .shuffle-card:nth-child(3) { transform: translate(0, -2px) rotate(0deg); }
.shuffle-deck.phase-cut .shuffle-card:nth-child(4) { transform: translate(22px, 2px) rotate(4deg); }
.shuffle-deck.phase-cut .shuffle-card:nth-child(5) { transform: translate(46px, 4px) rotate(9deg); }

.shuffle-deck.phase-square .shuffle-card:nth-child(1) { transform: translate(0, 2px) rotate(0deg); }
.shuffle-deck.phase-square .shuffle-card:nth-child(2) { transform: translate(0, 0) rotate(0deg); }
.shuffle-deck.phase-square .shuffle-card:nth-child(3) { transform: translate(0, -1px) rotate(0deg); }
.shuffle-deck.phase-square .shuffle-card:nth-child(4) { transform: translate(0, 0) rotate(0deg); }
.shuffle-deck.phase-square .shuffle-card:nth-child(5) { transform: translate(0, 1px) rotate(0deg); }

/* Slightly slower card theatre */
@keyframes dealIn {
  from { opacity: 0; transform: translateY(36px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.card-slot {
  animation-duration: 0.62s;
  animation-delay: calc(0.06s + var(--i) * 0.11s);
}

.pick-row {
  animation-duration: 0.6s;
}

@keyframes slotSettle {
  0% { transform: scale(1.08); box-shadow: 0 0 0 1px rgba(229, 206, 152, 0.72), 0 0 30px rgba(200, 166, 99, 0.30); }
  100% { transform: scale(1); }
}

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


/* Crisper reading text on top of textures */
.lede,
.mode-desc,
.pick-hint,
.reading-question,
.reading-hint,
.card-label,
.pick-slot-label,
.panel-lead,
.position-copy p,
.panel-note,
.ai-lede,
.ai-result-text,
.ai-note,
.question-input,
.pick-question-input,
.ai-question-input,
.ai-code-input,
.history-entry-question,
.history-entry-cards,
.history-privacy {
  font-family: var(--font-zh-body);
}

/* Reference-style seven-layer shuffle stack */
.shuffle-deck {
  width: 112px;
  height: 173px;
  margin-bottom: 34px;
}

.shuffle-deck .shuffle-layer {
  position: absolute;
  inset: 0;
  will-change: transform, opacity, filter;
  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-deck .shuffle-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image:
    var(--back-ornament),
    radial-gradient(ellipse at 50% 50%, transparent 48%, rgba(91, 102, 72, 0.15) 100%);
  background-size: 100% 100%, 100% 100%;
  background-repeat: no-repeat;
  opacity: 0.9;
  pointer-events: none;
}

.shuffle-deck.phase-riffle .shuffle-layer-1 { animation: riffleSlowL 0.52s cubic-bezier(0.42, 0, 0.2, 1) 0s 3; }
.shuffle-deck.phase-riffle .shuffle-layer-2 { animation: riffleSlowR 0.52s cubic-bezier(0.42, 0, 0.2, 1) 0.04s 3; }
.shuffle-deck.phase-riffle .shuffle-layer-3 { animation: riffleSlowL 0.52s cubic-bezier(0.42, 0, 0.2, 1) 0.11s 3; }
.shuffle-deck.phase-riffle .shuffle-layer-4 { animation: riffleSlowR 0.52s cubic-bezier(0.42, 0, 0.2, 1) 0.15s 3; }
.shuffle-deck.phase-riffle .shuffle-layer-5 { animation: riffleSlowL 0.52s cubic-bezier(0.42, 0, 0.2, 1) 0.22s 3; }
.shuffle-deck.phase-riffle .shuffle-layer-6 { animation: riffleSlowR 0.52s cubic-bezier(0.42, 0, 0.2, 1) 0.26s 3; }
.shuffle-deck.phase-riffle .shuffle-layer-7 { animation: rifflePulseC 0.52s ease-in-out 0.08s 3; }

@keyframes riffleSlowL {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  36% { transform: translate3d(-76px, -12px, 0) rotate(-14deg); }
  66% { transform: translate3d(14px, -3px, 0) rotate(3deg); }
}

@keyframes riffleSlowR {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  36% { transform: translate3d(76px, 8px, 0) rotate(14deg); }
  66% { transform: translate3d(-14px, 3px, 0) rotate(-3deg); }
}

@keyframes rifflePulseC {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(0, -14px, 0) scale(1.04); }
}

.shuffle-deck.phase-cut .shuffle-layer-1,
.shuffle-deck.phase-cut .shuffle-layer-2 {
  animation: cutTopPacket 0.68s cubic-bezier(0.32, 0.06, 0.22, 1) forwards;
}
.shuffle-deck.phase-cut .shuffle-layer-3,
.shuffle-deck.phase-cut .shuffle-layer-4 {
  animation: cutMidPacket 0.68s cubic-bezier(0.32, 0.06, 0.22, 1) forwards;
}
.shuffle-deck.phase-cut .shuffle-layer-5,
.shuffle-deck.phase-cut .shuffle-layer-6,
.shuffle-deck.phase-cut .shuffle-layer-7 {
  animation: cutBotPacket 0.68s cubic-bezier(0.32, 0.06, 0.22, 1) forwards;
}

@keyframes cutTopPacket {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); }
  45% { transform: translate3d(-78px, -18px, 0) rotate(-8deg); }
  100% { transform: translate3d(0, 0, 0) rotate(0deg); }
}
@keyframes cutMidPacket {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  45% { transform: translate3d(0, -24px, 0) scale(1.05); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes cutBotPacket {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); }
  45% { transform: translate3d(78px, 12px, 0) rotate(8deg); }
  100% { transform: translate3d(0, 0, 0) rotate(0deg); }
}

.shuffle-deck.phase-square {
  animation: deckSquareGlow 0.34s ease forwards;
}

@keyframes deckSquareGlow {
  0% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(246, 224, 157, 0)); }
  50% { transform: scale(1.06); filter: drop-shadow(0 0 24px rgba(246, 224, 157, 0.7)); }
  100% { transform: scale(0.92); opacity: 0; }
}


.brand-version {
  display: block;
  margin-top: 2px;
  color: var(--muted-soft);
  font-family: var(--font-en);
  font-size: 7.5px;
  letter-spacing: 0.12em;
  line-height: 1.2;
}

.app-version {
  color: var(--muted-soft);
  font-family: var(--font-en);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  opacity: 0.7;
  white-space: nowrap;
}

h1 {
  font-weight: 500;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.28), 0 1px 1px rgba(0, 0, 0, 0.34);
}

body.theme-parchment h1 {
  text-shadow: none;
}

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


body.theme-parchment .hero-copy {
  border-color: rgba(108, 81, 47, 0.20);
  background: rgba(255, 250, 239, 0.62);
  box-shadow: 0 18px 40px rgba(80, 55, 30, 0.10);
}

body.theme-parchment .mode-card {
  background: rgba(255, 250, 239, 0.42);
}

/* In-place shuffle: the stack lives inside the deck area, not over the whole screen. */
.shuffle-overlay {
  position: absolute;
  inset: -8px 0 0;
  z-index: 30;
  border: 0;
  background:
    radial-gradient(ellipse 66% 56% at 50% 48%, rgba(255, 246, 220, 0.045) 0%, transparent 72%);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  overflow: hidden;
}

/* Gathering the 36 cards into the center stack */
.pick-grid.is-gathering .pick-row {
  animation: none;
}

.pick-grid.is-gathering .pick-cell {
  animation: none;
  transition: transform 0.56s var(--ease-card), opacity 0.56s;
  transform: translate3d(var(--gather-x, 0px), var(--gather-y, 0px), 0) rotate(0deg) scale(0.72);
  opacity: 0.22;
  z-index: 1;
}

/* Cards returning from the reading slots */
.pick-return-card {
  position: fixed;
  z-index: 215;
  overflow: hidden;
  pointer-events: none;
  border: 1px solid rgba(92, 68, 40, 0.72);
  border-radius: 6px;
  background: #e8d9ba;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.34);
  will-change: transform, opacity;
}

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

/* Home deck flying into the table */
.deck-stage-ghost {
  position: fixed;
  z-index: 216;
  margin: 0;
  pointer-events: none;
  transform-origin: center center;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.34));
  will-change: transform, opacity;
}

/* A little more card thickness and a bright selection halo */
.pick-slot-frame {
  box-shadow:
    0 2px 0 rgba(124, 98, 62, 0.34),
    0 3px 0 rgba(79, 58, 35, 0.28),
    0 9px 18px rgba(0, 0, 0, 0.24);
}

.pick-slot.is-next .pick-slot-frame {
  box-shadow:
    0 0 0 1px rgba(229, 206, 152, 0.42),
    0 0 24px rgba(200, 166, 99, 0.24),
    0 3px 0 rgba(124, 98, 62, 0.30);
  animation: nextSlotPulse 1.4s ease-in-out infinite;
}

.pick-slot.is-new .pick-slot-frame {
  box-shadow:
    0 0 0 1px rgba(237, 218, 169, 0.7),
    0 0 28px rgba(237, 218, 169, 0.42),
    0 3px 0 rgba(124, 98, 62, 0.30),
    0 12px 24px rgba(0, 0, 0, 0.34);
}

.pick-slot {
  position: relative;
}

.pick-slot.is-new::after {
  content: "";
  position: absolute;
  inset: -5px;
  z-index: 3;
  border: 1px solid rgba(237, 218, 169, 0.64);
  border-radius: 9px;
  box-shadow: 0 0 20px rgba(237, 218, 169, 0.28);
  pointer-events: none;
  animation: selectionHalo 0.8s ease-out both;
}

@keyframes selectionHalo {
  from { opacity: 0; transform: scale(0.96); }
  35% { opacity: 1; }
  to { opacity: 0; transform: scale(1.03); }
}

.mini-card-back {
  box-shadow:
    0 2px 0 rgba(126, 98, 61, 0.48),
    0 4px 0 rgba(88, 65, 39, 0.32),
    0 4px 8px rgba(0, 0, 0, 0.28),
    0 9px 18px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 252, 240, 0.56),
    inset 0 0 0 2px rgba(244, 233, 212, 0.75),
    inset 0 0 0 2.7px rgba(112, 88, 57, 0.44);
}

.card-face {
  box-shadow:
    0 2px 0 rgba(124, 98, 62, 0.34),
    0 3px 0 rgba(79, 58, 35, 0.30),
    var(--shadow-card),
    inset 0 0 0 1px rgba(255, 248, 228, 0.34);
}


/* More physical card edges and persistent selection rim */
.pick-slot.is-filled .pick-slot-frame {
  box-shadow:
    0 2px 0 #cbb68e,
    0 4px 0 #a68d63,
    0 6px 0 #75603e,
    0 11px 22px rgba(0, 0, 0, 0.30),
    0 0 0 1px rgba(237, 218, 169, 0.22),
    0 0 17px rgba(200, 166, 99, 0.10);
}

.pick-slot.is-filled:hover .pick-slot-frame,
.pick-slot.is-filled:focus-visible .pick-slot-frame {
  box-shadow:
    0 2px 0 #d6c39c,
    0 4px 0 #b59a6b,
    0 6px 0 #806943,
    0 14px 26px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(237, 218, 169, 0.7),
    0 0 26px rgba(237, 218, 169, 0.24);
}

.pick-slot.is-next .pick-slot-frame {
  border-color: rgba(237, 218, 169, 0.9);
  box-shadow:
    0 0 0 1px rgba(237, 218, 169, 0.4),
    0 0 24px rgba(237, 218, 169, 0.22),
    0 2px 0 rgba(124, 98, 62, 0.28);
}

.mini-card-back {
  box-shadow:
    0 2px 0 #cbb68e,
    0 4px 0 #a38a61,
    0 6px 0 #75603e,
    0 9px 18px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 252, 240, 0.56),
    inset 0 0 0 2px rgba(244, 233, 212, 0.75),
    inset 0 0 0 2.7px rgba(112, 88, 57, 0.44);
}

.card-face {
  box-shadow:
    0 2px 0 #cbb68e,
    0 4px 0 #9d845c,
    0 6px 0 #6d5738,
    var(--shadow-card),
    inset 0 0 0 1px rgba(255, 248, 228, 0.36);
}

.card-face-front::before {
  background:
    radial-gradient(ellipse at 18% 8%, rgba(255, 252, 241, 0.24) 0%, transparent 40%),
    linear-gradient(118deg, rgba(255, 255, 255, 0.10) 0%, transparent 28%, transparent 73%, rgba(38, 24, 10, 0.10) 100%);
}


.pick-slot.is-returning .pick-slot-frame {
  opacity: 0.12;
}

.pick-slot.is-returning {
  opacity: 0.12;
  transition: opacity 0.2s ease;
}

/* Aged ivory backs with an engraved olive-gold botanical frame. */
.mini-card-back,
.card-face-back,
.shuffle-deck .shuffle-layer,
.card-back-mini {
  background-color: #e9d9b9;
  background-image:
    var(--back-damask),
    radial-gradient(ellipse at 30% 8%, rgba(255, 252, 242, 0.72) 0%, transparent 46%),
    linear-gradient(135deg, rgba(255, 250, 238, 0.36) 0%, transparent 34%, transparent 68%, rgba(91, 102, 72, 0.09) 100%),
    linear-gradient(145deg, #f4e8d0 0%, #e8d5b1 55%, #d9c198 100%);
  background-size: 36px 36px, 100% 100%, 100% 100%, 100% 100%;
  background-position: center, center, center, center;
  background-repeat: repeat, no-repeat, no-repeat, no-repeat;
}

.card-face-back::after,
.mini-card-back::before,
.card-back-mini::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background-image:
    var(--back-ornament),
    radial-gradient(ellipse at 50% 50%, transparent 48%, rgba(91, 102, 72, 0.15) 100%);
  background-size: 100% 100%, 100% 100%;
  background-repeat: no-repeat;
  opacity: 0.9;
  pointer-events: none;
}

.card-face-back {
  box-shadow:
    0 2px 0 #cbb68e,
    0 4px 0 #9d845c,
    0 6px 0 #6d5738,
    var(--shadow-card),
    inset 0 0 0 1px rgba(255, 251, 239, 0.55),
    inset 0 0 0 2px rgba(116, 89, 53, 0.28);
}

.card-back-mini {
  box-shadow:
    inset 0 0 0 8px rgba(247, 237, 216, 0.82),
    inset 0 0 0 9px rgba(116, 89, 53, 0.34),
    inset 0 0 34px rgba(98, 70, 40, 0.10),
    0 18px 34px rgba(0, 0, 0, 0.22);
}

.pick-slot-frame .mini-card-back {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

/* A restrained white-gold selection frame, with no lift or shrink. */
.pick-slot.is-next .pick-slot-frame {
  animation: none;
  border-color: rgba(255, 250, 237, 0.88);
  background: rgba(255, 252, 241, 0.05);
  box-shadow:
    0 0 0 1px rgba(255, 250, 237, 0.22),
    0 0 16px rgba(255, 246, 222, 0.12);
}

.pick-slot.is-new .pick-slot-frame {
  animation: none;
  box-shadow:
    0 0 0 1px rgba(255, 250, 237, 0.66),
    0 0 18px rgba(255, 246, 222, 0.16),
    0 11px 22px rgba(0, 0, 0, 0.28);
}

.pick-slot.is-new::after {
  display: none;
}

/* Lift the darkest parts of the felt slightly and ease the image saturation. */
.table-grain::after {
  background:
    radial-gradient(ellipse 72% 62% at 50% 54%, rgba(223, 196, 143, 0.055) 0%, transparent 72%),
    radial-gradient(ellipse 80% 64% at 50% 48%, transparent 42%, rgba(2, 6, 4, 0.40) 100%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.040) 0 1px, transparent 1px 4px),
    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);
}

.card-face-front img {
  filter: saturate(0.93) contrast(1.02) brightness(1.045);
}

/* Center the home composition on the deck; compact horizontal spread tabs. */
.home-hero {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
  gap: 22px;
  align-items: center;
  text-align: center;
}

.hero-copy {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.eyebrow,
.lede {
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
}

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

.section-label {
  justify-content: center;
}

.mode-list {
  flex-direction: row;
  gap: 8px;
}

.mode-card {
  flex: 1;
  min-width: 0;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--gold-line-soft);
  border-bottom: 1px solid var(--gold-line-soft);
}

.mode-card:last-child {
  border-bottom: 1px solid var(--gold-line-soft);
}

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

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

.mode-main {
  align-items: center;
  text-align: center;
}

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

.mode-title span {
  display: none;
}

.hero-tableau {
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
}

.draw-panel {
  max-width: 410px;
  margin: 0 auto;
}

/* The label sits in the center of a full card back. */
.mini-back-word {
  top: 50%;
  bottom: auto;
  left: 50%;
  width: 64%;
  transform: translate(-50%, -50%);
  text-align: center;
}

/* Remove the gathered grid before the shuffle stack fades in. */
.pick-grid.is-gathered {
  opacity: 0;
  transition: opacity 0.16s ease;
  pointer-events: none;
}

@media (max-width: 620px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding-top: 16px;
  }

  .hero-copy {
    padding: 18px 16px;
  }

  .mode-section {
    margin-top: 14px;
  }

  .mode-card {
    min-height: 48px;
    padding: 0 5px;
  }

  .mode-title {
    font-size: 14px;
    letter-spacing: 0.05em;
  }

  .hero-tableau {
    max-width: 440px;
  }

  .draw-panel {
    max-width: 390px;
  }
}

/* Card backs: reset inherited multi-layer background sizing from the old lattice. */
.mini-card-back,
.card-face-back,
.shuffle-deck .shuffle-layer,
.card-back-mini {
  background-size: 100% 100%;
  background-position: center;
}

/* The gathered deck must disappear completely before the shuffle stack appears. */
.pick-grid.is-gathered {
  opacity: 0;
  transition: none;
}

/* Home: deck first, compact modes underneath. */
.hero-copy {
  padding-bottom: 8px;
  background: transparent;
  border: 0;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}

.hero-tableau {
  max-width: 560px;
}

.mode-section {
  width: 100%;
  max-width: 520px;
  margin: 14px auto 0;
}

.draw-panel {
  margin-top: 18px;
}

.deck-stage {
  width: 176px;
  height: 273px;
}

@media (max-width: 620px) {
  .hero-copy {
    padding-bottom: 2px;
  }

  .deck-stage {
    width: 152px;
    height: 235px;
  }
}

/* Keep the deck first on phones as well: title → deck → modes → question. */
.hero-tableau {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.deck-area {
  order: 0;
  margin-top: 0;
}

.mode-section {
  order: 0;
}

.draw-panel {
  order: 0;
}

/* iPhone readability pass: larger body copy, labels and controls. */
@media (max-width: 620px) {
  .home-hero {
    gap: 14px;
    padding-top: 10px;
    padding-bottom: 18px;
  }

  .hero-copy {
    padding: 16px 18px;
  }

  .eyebrow {
    margin-bottom: 12px;
  }

  h1 {
    font-size: clamp(32px, 9vw, 40px);
    line-height: 1.25;
  }

  .lede {
    margin: 8px auto 12px;
    font-size: 13px;
  }

  .deck-stage {
    width: 118px;
    height: 182px;
  }

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

  .deck-caption {
    margin: 8px 0 6px;
  }

  .mode-section {
    margin-top: 4px;
  }

  .section-label {
    margin-bottom: 8px;
  }

  .draw-panel {
    margin-top: 10px;
    padding: 16px 18px 14px;
  }

  .question-hint {
    margin-bottom: 10px;
  }

  .offline-note {
    margin-top: 8px;
  }

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

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

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

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

  .reading-hint {
    font-size: 11.5px;
    line-height: 1.7;
  }

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

  .ghost-button {
    font-size: 11.5px;
  }

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

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

  .panel-lead {
    font-size: 16px;
    line-height: 1.95;
  }

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

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

  .position-copy p {
    font-size: 14.2px;
    line-height: 1.95;
  }

  .position-copy .position-interact {
    font-size: 13.3px;
    line-height: 1.9;
  }

  .position-mark {
    font-size: 13px;
  }

  .interaction-pair {
    font-size: 10.5px;
  }

  .interaction-item p {
    font-size: 13.4px;
    line-height: 1.9;
  }

  .advice-label {
    font-size: 10px;
  }

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

  .card-note p {
    font-size: 13.5px;
  }

  .card-note p.note-interact {
    font-size: 13px;
  }

  .panel-note {
    font-size: 12px;
  }

  .modal-kicker {
    font-size: 9px;
  }

  .modal-en {
    font-size: 10px;
  }

  .keyword {
    font-size: 10.5px;
  }

  .modal-essence {
    font-size: 16px;
    line-height: 1.95;
  }

  .modal-advice-label,
  .modal-interact-label {
    font-size: 10.5px;
  }

  .modal-advice p,
  .modal-interact p {
    font-size: 14px;
    line-height: 1.9;
  }

  .modal-duality .duality-label,
  .modal-domains .domain-label {
    font-size: 10px;
  }

  .modal-duality .duality-item p,
  .modal-domains .domain-item p {
    font-size: 13.3px;
    line-height: 1.85;
  }

  .ai-start-button {
    min-height: 68px;
  }

  .ai-start-button .draw-text {
    font-size: 20px;
    letter-spacing: 0.16em;
  }

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

  .ai-question-label {
    font-size: 10.5px;
  }

  .ai-order-item {
    font-size: 11px;
  }

  .ai-order-item em {
    font-size: 9px;
  }

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

  .ai-result-text {
    font-size: 15.5px;
    line-height: 2;
  }

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

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

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

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

  .pick-count {
    font-size: 10px;
  }

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

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

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

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

  .reading-footer {
    font-size: 9px;
  }

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

  .question-optional {
    font-size: 10px;
  }

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

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

  .footer-history {
    font-size: 10.5px;
  }

  .redraw-button {
    min-height: 36px;
  }

  .reading-end-redraw {
    min-height: 40px;
  }
}

/* Short phones: keep the primary draw button on the first screen. */
@media (max-width: 620px) and (max-height: 760px) {
  .home-hero {
    gap: 8px;
    padding-top: 6px;
    padding-bottom: 12px;
  }

  .hero-copy {
    padding: 10px 14px;
  }

  .eyebrow {
    margin-bottom: 6px;
  }

  h1 {
    font-size: 30px;
    line-height: 1.15;
  }

  .lede {
    margin: 4px auto 6px;
    font-size: 12px;
  }

  .deck-stage {
    width: 96px;
    height: 148px;
  }

  .deck-caption {
    display: none;
  }

  .mode-section {
    margin-top: 2px;
  }

  .section-label {
    margin-bottom: 5px;
  }

  .draw-panel {
    padding: 12px 14px 10px;
  }

  .question-hint {
    display: none;
  }

  .offline-note {
    margin-top: 6px;
  }
}

/* Thin cardstock: remove the stacked "brick" edges, keep a soft paper shadow. */
.card-face {
  box-shadow:
    0 1px 2px rgba(5, 3, 2, 0.42),
    0 8px 18px rgba(6, 4, 2, 0.30),
    0 16px 30px rgba(4, 3, 2, 0.16),
    inset 0 1px 0 rgba(255, 252, 240, 0.56),
    inset 0 0 0 1px rgba(108, 84, 57, 0.42);
}

.mini-card-back {
  box-shadow:
    0 1px 2px rgba(5, 3, 2, 0.40),
    0 4px 10px rgba(6, 4, 2, 0.26),
    inset 0 1px 0 rgba(255, 252, 240, 0.56),
    inset 0 0 0 1px rgba(112, 88, 57, 0.42);
}

.pick-slot.is-filled .pick-slot-frame {
  box-shadow:
    0 1px 2px rgba(5, 3, 2, 0.38),
    0 5px 12px rgba(6, 4, 2, 0.26),
    0 0 0 1px rgba(237, 218, 169, 0.22);
}

.pick-slot.is-filled:hover .pick-slot-frame,
.pick-slot.is-filled:focus-visible .pick-slot-frame {
  box-shadow:
    0 1px 2px rgba(5, 3, 2, 0.40),
    0 7px 16px rgba(6, 4, 2, 0.30),
    0 0 0 1px rgba(237, 218, 169, 0.62),
    0 0 18px rgba(200, 166, 99, 0.18);
}

.shuffle-deck .shuffle-layer {
  will-change: transform;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(112, 88, 57, 0.36);
}

/* Do not animate filters or box-shadows while cards are moving on a phone. */
.shuffle-aura {
  filter: none;
}

.pick-grid::before {
  filter: none;
}

.pick-drag-ghost,
.pick-fly-card,
.deck-stage-ghost {
  filter: none;
}

.pick-cell.is-used,
.pick-cell.is-dragging-source {
  filter: none;
}

.pick-cell {
  transition: transform 0.24s cubic-bezier(0.2, 0.88, 0.26, 1), opacity 0.22s ease;
}

.pick-slot.is-next .pick-slot-frame {
  animation: none;
}

@keyframes slotSettle {
  from { transform: scale(1.035); }
  to { transform: scale(1); }
}

/* Five cards on a phone: 3 + 2, so each card is much larger than a five-across strip. */
@media (max-width: 620px) {
  .spread-5 {
    max-width: 300px;
    flex-wrap: wrap;
    gap: 10px 8px;
  }

  .reading-stage {
    padding-top: 12px;
    padding-bottom: 14px;
  }

  .reading-hint {
    margin-top: 12px;
  }

  .reading-actions {
    margin-top: 10px;
  }

  .spread-5 .card-label {
    margin-top: 6px;
  }

  .spread-5 .card-slot {
    flex: 0 0 calc((100% - 16px) / 3);
    width: calc((100% - 16px) / 3);
  }

  .card-modal-visual {
    max-width: min(250px, 72vw);
  }
}

/* Compact manual-draw table: one screen, no page drift while dragging. */
@media (max-width: 620px) {
  .pick-topbar {
    grid-template-columns: 1fr auto;
  }

  .view-picking {
    height: 100dvh;
    min-height: 0;
    padding-bottom: 0;
    overflow: hidden;
  }

  .view-picking .reading-footer {
    display: none;
  }

  .pick-stage {
    padding-top: 8px;
    padding-bottom: 6px;
  }

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

  .pick-question-field {
    margin-top: 0;
  }

  .pick-question-label {
    margin-bottom: 3px;
  }

  .pick-question-input {
    height: 38px;
  }

  .pick-zone {
    padding: 8px 10px 9px;
  }

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

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

  .pick-actions {
    margin: 8px 0 6px;
  }

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

  .pick-deck {
    padding: 4px 8px 4px;
  }

  .pick-grid {
    padding: 4px 0 2px;
  }
}

@media (max-width: 620px) {
  .pick-slots-1 {
    --slot-w: clamp(100px, 29vw, 136px);
  }
}

@media (max-width: 620px) {
  .reading-topbar {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }
}

/* 36-card library view */
.view-library {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 0 clamp(18px, 5vw, 54px) max(34px, env(safe-area-inset-bottom));
}

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

.library-topbar {
  grid-template-columns: 1fr;
  border-bottom: 1px solid var(--gold-line-soft);
}

.library-stage {
  padding: clamp(20px, 3.2vh, 34px) 0 36px;
}

.library-head {
  margin: 0 auto clamp(20px, 3vh, 30px);
  text-align: center;
}

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

.library-title {
  margin: 0;
  color: var(--ivory);
  font-family: var(--font-zh);
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 400;
  letter-spacing: 0.08em;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px 10px;
}

.library-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 0;
  color: var(--muted-soft);
  text-align: center;
}

.library-card-visual {
  width: 100%;
  aspect-ratio: 560 / 868;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(239, 218, 176, 0.48);
  border-radius: 6px;
  background: #e8d9ba;
  box-shadow:
    0 1px 2px rgba(5, 3, 2, 0.38),
    0 6px 14px rgba(5, 3, 2, 0.26);
  transition: transform 0.2s var(--ease-soft), box-shadow 0.2s ease;
}

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

.library-card:hover .library-card-visual {
  transform: translateY(-2px);
  box-shadow:
    0 1px 2px rgba(5, 3, 2, 0.40),
    0 9px 20px rgba(5, 3, 2, 0.32),
    0 0 0 1px rgba(237, 218, 169, 0.42);
}

.library-card-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 2px 4px;
  color: var(--muted);
  font-family: var(--font-zh-body);
  font-size: 8.5px;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.library-card-label em {
  color: var(--gold);
  font-family: var(--font-en);
  font-style: normal;
  font-size: 0.92em;
  letter-spacing: 0.04em;
}

.library-card-label span {
  color: var(--muted-soft);
  font-family: var(--font-en);
  font-size: 0.86em;
  letter-spacing: 0.04em;
  opacity: 0.76;
}

@media (max-width: 980px) {
  .library-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

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

  .library-stage {
    padding-top: 18px;
  }

  .library-head {
    margin-bottom: 16px;
  }

  .library-title {
    font-size: 28px;
  }

  .library-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 9px;
  }

  .library-card-label {
    font-size: 9.5px;
  }

  .library-card-label span {
    font-size: 8.5px;
  }

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

/* Finger-down / hover lift for one card only, with a faint violet rim. */
.pick-cell.is-pressed {
  z-index: 1000;
  transform: translate3d(0, calc(var(--arc-y, 0px) - 24px), 0) rotate(0deg) scale(1.08);
}

.pick-cell.is-pressed .mini-card-back,
.pick-cell:hover .mini-card-back,
.pick-drag-ghost .mini-card-back {
  box-shadow:
    0 0 0 1.5px rgba(190, 150, 255, 0.62),
    0 0 16px rgba(145, 90, 255, 0.34),
    0 1px 3px rgba(5, 3, 2, 0.42),
    0 8px 18px rgba(5, 3, 2, 0.32);
}

.pick-cell:hover {
  filter: drop-shadow(0 0 7px rgba(170, 110, 255, 0.26));
}

/* Lift the non-parchment tabletops: larger central light, softer edges. */
body.theme-moss .table-grain {
  background:
    radial-gradient(ellipse 30% 24% at 14% 18%, rgba(245, 210, 145, 0.10) 0%, transparent 74%),
    radial-gradient(ellipse 26% 20% at 86% 15%, rgba(205, 232, 210, 0.06) 0%, transparent 78%),
    radial-gradient(ellipse 50% 36% at 50% 8%, rgba(238, 205, 140, 0.12) 0%, transparent 76%),
    radial-gradient(ellipse 46% 36% at 50% 38%, rgba(145, 195, 153, 0.21) 0%, transparent 76%),
    radial-gradient(ellipse 66% 56% at 50% 40%, rgba(86, 148, 106, 0.40) 0%, rgba(31, 73, 50, 0.24) 50%, transparent 82%),
    radial-gradient(ellipse 96% 84% at 50% 44%, rgba(30, 70, 48, 0.32) 0%, rgba(17, 38, 27, 0.42) 70%, transparent 100%),
    radial-gradient(ellipse 100% 88% at 50% 100%, rgba(4, 10, 6, 0.42) 0%, transparent 66%),
    linear-gradient(150deg, #244735 0%, #163122 50%, #0d2016 100%);
}

body.theme-burgundy .table-grain {
  background:
    radial-gradient(ellipse 30% 24% at 14% 18%, rgba(248, 203, 152, 0.12) 0%, transparent 74%),
    radial-gradient(ellipse 26% 20% at 86% 15%, rgba(226, 176, 181, 0.06) 0%, transparent 78%),
    radial-gradient(ellipse 50% 36% at 50% 8%, rgba(242, 197, 146, 0.13) 0%, transparent 76%),
    radial-gradient(ellipse 46% 36% at 50% 38%, rgba(198, 113, 122, 0.21) 0%, transparent 76%),
    radial-gradient(ellipse 66% 56% at 50% 40%, rgba(151, 61, 67, 0.42) 0%, rgba(83, 29, 37, 0.26) 50%, transparent 82%),
    radial-gradient(ellipse 96% 84% at 50% 44%, rgba(78, 28, 37, 0.36) 0%, rgba(38, 13, 20, 0.45) 70%, transparent 100%),
    radial-gradient(ellipse 100% 88% at 50% 100%, rgba(10, 3, 5, 0.44) 0%, transparent 66%),
    linear-gradient(150deg, #3d1f29 0%, #2a1018 50%, #18080e 100%);
}

body.theme-walnut .table-grain {
  background:
    radial-gradient(ellipse 30% 24% at 14% 18%, rgba(250, 212, 155, 0.12) 0%, transparent 74%),
    radial-gradient(ellipse 26% 20% at 86% 15%, rgba(220, 192, 148, 0.06) 0%, transparent 78%),
    radial-gradient(ellipse 50% 36% at 50% 8%, rgba(244, 210, 153, 0.13) 0%, transparent 76%),
    radial-gradient(ellipse 46% 36% at 50% 38%, rgba(186, 148, 101, 0.21) 0%, transparent 76%),
    radial-gradient(ellipse 66% 56% at 50% 40%, rgba(139, 103, 67, 0.42) 0%, rgba(72, 49, 32, 0.27) 50%, transparent 82%),
    radial-gradient(ellipse 96% 84% at 50% 44%, rgba(68, 48, 33, 0.36) 0%, rgba(33, 22, 15, 0.46) 70%, transparent 100%),
    radial-gradient(ellipse 100% 88% at 50% 100%, rgba(9, 5, 4, 0.44) 0%, transparent 66%),
    linear-gradient(150deg, #402e20 0%, #2c1b11 50%, #1b100a 100%);
}

body:not(.theme-parchment) .table-grain::after {
  background:
    radial-gradient(ellipse 94% 80% at 50% 48%, transparent 58%, rgba(2, 6, 4, 0.26) 100%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.040) 0 1px, transparent 1px 4px),
    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);
}

/* Mobile modal scroll cue: a soft fade and a small line, not an emoji. */
.modal-scroll-hint {
  display: none;
}

@media (max-width: 620px) {
  .modal-scroll-hint {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 130;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 24px 16px calc(env(safe-area-inset-bottom) + 12px);
    color: #8d6d3e;
    background: linear-gradient(
      to top,
      #efe1c8 0%,
      rgba(239, 225, 200, 0.96) 42%,
      rgba(239, 225, 200, 0) 100%
    );
    font-family: var(--font-zh);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-shadow: 0 1px 0 rgba(255, 252, 241, 0.45);
    pointer-events: none;
  }

  .modal-scroll-hint i {
    width: 5px;
    height: 5px;
    border-right: 1px solid rgba(141, 109, 62, 0.82);
    border-bottom: 1px solid rgba(141, 109, 62, 0.82);
    transform: rotate(45deg);
    animation: modalScrollBob 1.7s ease-in-out infinite;
  }

  @keyframes modalScrollBob {
    0%, 100% { transform: translateY(-1px) rotate(45deg); opacity: 0.55; }
    50% { transform: translateY(3px) rotate(45deg); opacity: 1; }
  }

  .library-topbar {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 10px);
    left: 12px;
    z-index: 80;
    width: auto;
    padding: 0;
    border: 0;
    background: none;
  }

  .library-topbar .text-button {
    padding: 8px 13px;
    color: var(--gold-bright);
    border: 1px solid rgba(200, 166, 99, 0.46);
    border-radius: 999px;
    background: rgba(9, 18, 13, 0.92);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.34);
    font-size: 11px;
    letter-spacing: 0.08em;
  }

  .library-stage {
    padding-top: 64px;
  }
}

/* Accessibility: keep the mobile detail readable above its scroll cue. */
@media (max-width: 620px) {
  .card-modal {
    padding-bottom: 68px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .card-modal .modal-close {
    width: 38px;
    height: 38px;
  }
}

/* Respect reduced motion for decorative lift, not for the core shuffle/flip choreography. */
@media (prefers-reduced-motion: reduce) {
  .library-card:hover .library-card-visual {
    transform: none;
  }

  .modal-scroll-hint i {
    animation: none;
  }
}

/* Desktop home: keep the primary action above the fold on common 900px screens. */
@media (min-width: 821px) and (max-height: 1000px) {
  .home-hero {
    padding-top: 12px;
    padding-bottom: 12px;
    gap: 10px;
  }

  .home-hero h1 {
    font-size: clamp(38px, 4vw, 48px);
  }

  .home-hero .lede {
    margin: 8px 0 10px;
  }

  .home-hero .deck-stage {
    width: 136px;
    height: 211px;
  }

  .home-hero .deck-seal {
    width: 42px;
    height: 42px;
    right: -10px;
  }

  .home-hero .deck-caption {
    margin: 8px 0;
    font-size: 7px;
  }

  .home-hero .mode-section {
    margin-top: 0;
  }

  .home-hero .draw-panel {
    padding: 14px 18px;
  }
}
