:root {
  --violet-1: #0e0a1f;
  --violet-2: #1a1236;
  --violet-3: #2a1b4a;
  --violet-4: #4b3474;
  --silver: #c9c3e6;
  --silver-soft: #f1eefc;
  --gold: #e6c96b;
  --gold-deep: #a98531;
  --rose: #e7a6c7;
  --teal: #84c7c0;
  --ink: #080612;
  --panel: rgba(241, 238, 252, 0.07);
  --line: rgba(201, 195, 230, 0.24);
  --gold-line: rgba(230, 201, 107, 0.5);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --card-radius: 13px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--violet-1);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100svh;
  overflow-x: hidden;
  color: var(--silver-soft);
  font-family: "Noto Sans TC", "PingFang TC", system-ui, sans-serif;
  background:
    radial-gradient(circle at 50% 4%, rgba(230, 201, 107, 0.16), transparent 22rem),
    radial-gradient(circle at 16% 82%, rgba(132, 199, 192, 0.1), transparent 24rem),
    radial-gradient(circle at 88% 72%, rgba(231, 166, 199, 0.1), transparent 24rem),
    linear-gradient(155deg, var(--violet-1) 0%, var(--violet-2) 44%, var(--violet-3) 100%);
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}

button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

button:disabled { cursor: default; }

[hidden] { display: none !important; }

.text-link {
  min-height: 0;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: rgba(201, 195, 230, 0.78);
  font-size: 0.92rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

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

.home-history-link {
  margin-top: 14px;
  align-self: flex-start;
}

.app-shell {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
}

/* ---- 星空背景 ---- */
.star-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.star-field::before,
.star-field::after {
  content: "";
  position: absolute;
  inset: -18% -10%;
  background:
    radial-gradient(circle at 20% 18%, rgba(241, 238, 252, 0.2) 0 1px, transparent 2px),
    radial-gradient(circle at 66% 28%, rgba(241, 238, 252, 0.18) 0 1px, transparent 2px),
    radial-gradient(circle at 88% 18%, rgba(230, 201, 107, 0.18) 0 1px, transparent 2px);
  background-size: 170px 150px, 240px 220px, 310px 270px;
}

.star-field::after {
  opacity: 0.36;
  transform: rotate(16deg) scale(1.2);
}

.star {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--silver-soft);
  box-shadow: 0 0 15px rgba(241, 238, 252, 0.92);
  opacity: 0.76;
  will-change: opacity, transform;
}

.star-a { left: 9%; top: 15%; }
.star-b { left: 31%; top: 10%; background: var(--gold); }
.star-c { left: 72%; top: 18%; }
.star-d { left: 90%; top: 36%; background: var(--teal); }
.star-e { left: 18%; top: 52%; }
.star-f { left: 56%; top: 42%; background: var(--gold); }
.star-g { left: 78%; top: 68%; }
.star-h { left: 39%; top: 80%; background: var(--rose); }

.scene-stack {
  position: relative;
  z-index: 1;
  min-height: 100svh;
}

.scene {
  min-height: 100svh;
  padding: 24px 18px 30px;
}

.scene[hidden] { display: none; }

.scene-inner {
  position: relative;
  width: min(100%, 1080px);
  margin: 0 auto;
}

.narrow-inner {
  width: min(100%, 900px);
  padding-top: clamp(42px, 10vh, 96px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.hero-title,
.scene-title,
.card-name {
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
}

/* ---- 首頁 ---- */
.scene-home {
  position: relative;
  isolation: isolate;
  background: #0c0821 url("../assets/hero-bg.jpg") center / cover no-repeat;
}

.scene-home::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(10, 7, 26, 0.82), rgba(10, 7, 26, 0.5) 52%, rgba(10, 7, 26, 0.26)),
    linear-gradient(0deg, rgba(10, 7, 26, 0.5), rgba(10, 7, 26, 0.08));
}

.home-inner {
  min-height: calc(100svh - 56px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 58px 0 32px;
}

.hero-title {
  margin: 0;
  color: var(--silver-soft);
  font-size: clamp(3.25rem, 17vw, 7rem);
  line-height: 0.98;
  text-shadow: 0 2px 0 rgba(230, 201, 107, 0.3), 0 0 26px rgba(230, 201, 107, 0.2), 0 22px 60px rgba(0, 0, 0, 0.5);
}

.hero-copy {
  width: min(100%, 30rem);
  margin: 22px 0 30px;
  color: #efeafd;
  font-size: clamp(1.04rem, 4.5vw, 1.3rem);
  line-height: 1.85;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}

.mirror-note {
  width: min(100%, 32rem);
  margin: 20px 0 0;
  color: rgba(220, 214, 244, 0.86);
  line-height: 1.72;
}

.guide-card {
  width: min(100%, 370px);
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(230, 201, 107, 0.36);
  border-radius: 8px;
  background: rgba(14, 10, 31, 0.72);
  color: var(--silver-soft);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
}

.home-guide-card {
  margin-top: 22px;
}

.ritual-guide-card {
  margin-top: 14px;
  text-align: left;
}

.pick-guide-card {
  margin-top: 8px;
}

.guide-img {
  display: block;
  width: 76px;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(230, 201, 107, 0.32);
}

.guide-copy {
  min-width: 0;
}

.guide-name {
  display: inline-flex;
  margin-bottom: 4px;
  color: var(--gold);
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.2;
}

.guide-copy p {
  margin: 0;
  color: rgba(241, 238, 252, 0.92);
  font-size: 0.94rem;
  line-height: 1.58;
}

.result-guide-card {
  width: min(100%, 430px);
  margin: 0 auto 14px;
  background: rgba(241, 238, 252, 0.08);
}

.redline-card {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  width: min(calc(100vw - 32px), 330px);
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  min-height: 0;
  padding: 10px;
  border: 1px solid rgba(231, 166, 199, 0.52);
  border-radius: 8px;
  background: rgba(35, 13, 43, 0.92);
  color: var(--silver-soft);
  text-align: left;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(12px);
}

.redline-card[hidden] {
  display: none;
}

.redline-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: #ffdbe9;
  line-height: 1.55;
}

.redline-copy > span:last-child {
  font-size: 0.92rem;
}

.primary-btn,
.secondary-btn,
.topic-chip,
.fan-card,
.cut-stage {
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.primary-btn {
  min-width: 160px;
  padding: 14px 24px;
  background: linear-gradient(180deg, #f4dd8c 0%, var(--gold) 100%);
  color: #201334;
  font-weight: 900;
  box-shadow: 0 14px 36px rgba(230, 201, 107, 0.32);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 44px rgba(230, 201, 107, 0.4);
}

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

.secondary-btn {
  padding: 12px 18px;
  border: 1px solid var(--gold-line);
  background: rgba(241, 238, 252, 0.08);
  color: var(--silver-soft);
  font-weight: 800;
}

.secondary-btn:hover:not(:disabled) {
  background: rgba(241, 238, 252, 0.15);
  transform: translateY(-1px);
}

.secondary-btn:disabled {
  opacity: 0.55;
  border-style: dashed;
}

/* ---- 通用牌 ---- */
.tarot-card {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--card-radius);
  overflow: hidden;
  backface-visibility: hidden;
}

.tarot-back {
  background: #1c1238 url("../assets/cards/back.png") center / cover no-repeat;
  box-shadow: inset 0 0 0 2px rgba(230, 201, 107, 0.55), inset 0 0 0 5px rgba(14, 10, 31, 0.7), 0 10px 26px rgba(0, 0, 0, 0.3);
}

.tarot-face {
  background: #14102a;
  box-shadow: inset 0 0 0 2px rgba(230, 201, 107, 0.6), inset 0 0 0 5px rgba(14, 10, 31, 0.55);
}

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

.tarot-face.is-fallback::after {
  content: attr(data-symbol);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 3.4rem;
  background: linear-gradient(160deg, #21163d, #100b22);
}

.floating-cards {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.float-card {
  position: absolute;
  width: clamp(78px, 14vw, 122px);
  aspect-ratio: 0.6;
  filter: drop-shadow(0 22px 30px rgba(0, 0, 0, 0.4));
  will-change: transform;
}

.float-card-a { right: 8%; top: 12%; transform: rotate(12deg); }
.float-card-b { left: 6%; bottom: 13%; transform: rotate(-14deg); }
.float-card-c { right: 21%; bottom: 8%; transform: rotate(-5deg); }

/* ---- 場景標題 ---- */
.scene-title {
  margin: 0 0 18px;
  color: var(--silver-soft);
  font-size: clamp(2rem, 8vw, 3.9rem);
  line-height: 1.14;
}

.scene-copy {
  margin: 0 auto;
  color: var(--silver);
  font-size: 1.06rem;
  line-height: 1.85;
}

/* ---- 洗牌 / 切牌 / 選牌 ---- */
.ritual-inner,
.pick-inner {
  min-height: calc(100svh - 54px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 34px 0;
}

.question-input {
  width: min(100%, 30rem);
  margin: 6px 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--gold-line);
  border-radius: 12px;
  background: rgba(14, 10, 31, 0.66);
  color: var(--silver-soft);
  font: inherit;
  line-height: 1.7;
  resize: vertical;
}

.question-input::placeholder { color: rgba(201, 195, 230, 0.5); }

.question-input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.question-echo {
  margin: 0 0 14px;
  padding: 12px 16px;
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  background: rgba(230, 201, 107, 0.08);
  color: var(--silver-soft);
  font-family: "Noto Serif TC", "Songti TC", serif;
  line-height: 1.7;
}

.question-echo[hidden] { display: none; }

.question-echo span {
  color: var(--gold);
  font-weight: 700;
}

.shuffle-stage {
  width: min(100%, 520px);
  min-height: 250px;
  display: grid;
  place-items: center;
  margin: 20px auto 10px;
  perspective: 900px;
}

.shuffle-deck {
  position: relative;
  width: 132px;
  height: 220px;
}

.shuffle-card {
  position: absolute;
  inset: 0;
  width: 120px;
  height: 200px;
  margin: auto;
  will-change: transform, opacity;
}

.ritual-status {
  min-height: 1.8em;
  margin: 12px 0 0;
  color: var(--gold);
  font-weight: 800;
  line-height: 1.7;
}

.cut-stage {
  position: relative;
  width: 190px;
  height: 216px;
  margin: 22px auto 6px;
  padding: 0;
  border: 0;
  background: transparent;
  perspective: 900px;
}

.cut-stage:hover:not(:disabled) { transform: translateY(-2px); }

.cut-pile {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 122px;
  height: 200px;
  margin-left: -61px;
  margin-top: -100px;
  will-change: transform;
}

.cut-pile .tarot-card {
  position: absolute;
  inset: 0;
}

.cut-pile .tarot-card:nth-child(2) { transform: translate(2px, -3px) rotate(1.4deg); }
.cut-pile .tarot-card:nth-child(3) { transform: translate(-2px, -6px) rotate(-1.6deg); }
.cut-pile-top { z-index: 2; transform: translateY(8px); }
.cut-pile-bottom { z-index: 1; transform: translateY(-8px); }

/* ---- 三張牌位置槽 ---- */
.pick-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: min(100%, 430px);
  margin: 18px auto 2px;
}

.pick-slot {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.slot-label {
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 800;
}

.slot-frame {
  width: min(100%, 92px);
  aspect-ratio: 0.6;
  border: 1px dashed rgba(201, 195, 230, 0.4);
  border-radius: 10px;
  background: rgba(241, 238, 252, 0.05);
  overflow: hidden;
}

.pick-slot.is-filled .slot-frame {
  border-style: solid;
  border-color: var(--gold-line);
  box-shadow: 0 0 22px rgba(230, 201, 107, 0.28);
}

.slot-frame .tarot-card {
  width: 100%;
  height: 100%;
  border-radius: 9px;
}

.pick-progress {
  min-height: 1.8em;
  margin: 10px 0 0;
  color: var(--gold);
  font-weight: 800;
  line-height: 1.7;
}

/* ---- 22 張扇形牌背 ---- */
.fan-stage {
  position: relative;
  width: min(100%, 780px);
  height: clamp(190px, 42vw, 320px);
  margin-top: 10px;
  perspective: 1100px;
}

.fan-slot {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%) translate(var(--x, 0px), var(--y, 0px)) rotate(var(--r, 0deg));
  will-change: transform;
}

.fan-slot:hover,
.fan-slot:focus-within {
  z-index: 60 !important;
}

.fan-card {
  width: var(--fan-w, 72px);
  aspect-ratio: 0.6;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.38));
  will-change: transform, opacity;
}

.fan-card:hover:not(.is-picked),
.fan-card:focus-visible:not(.is-picked) {
  transform: translateY(-16px) rotateY(9deg) scale(1.04);
}

.fan-card:hover:not(.is-picked) .tarot-back,
.fan-card:focus-visible:not(.is-picked) .tarot-back {
  box-shadow: inset 0 0 0 2px rgba(230, 201, 107, 0.95), inset 0 0 0 5px rgba(14, 10, 31, 0.7), 0 0 26px rgba(230, 201, 107, 0.45);
}

.fan-card.is-picked .tarot-back {
  box-shadow: inset 0 0 0 2px var(--gold), inset 0 0 0 5px rgba(14, 10, 31, 0.7), 0 0 30px rgba(230, 201, 107, 0.6);
}

/* ---- 翻牌飛行 ---- */
.picked-flyer {
  position: fixed;
  z-index: 20;
  perspective: 1200px;
  pointer-events: none;
  filter: drop-shadow(0 30px 50px rgba(0, 0, 0, 0.55));
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.flip-side {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
}

.flip-back { transform: rotateY(180deg); }

/* ---- 結果頁 ---- */
.result-inner {
  width: min(100%, 760px);
  padding: 30px 0 48px;
}

/* 三張牌橫排 */
.trio-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: min(100%, 520px);
  margin: 0 auto 20px;
}

.trio-card {
  margin: 0;
  text-align: center;
}

.trio-pos {
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 0.84rem;
  font-weight: 800;
}

.trio-frame {
  position: relative;
  width: min(100%, 120px);
  aspect-ratio: 0.6;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background: #14102a;
  box-shadow:
    inset 0 0 0 2px rgba(230, 201, 107, 0.6),
    inset 0 0 0 5px rgba(14, 10, 31, 0.5),
    0 18px 40px rgba(0, 0, 0, 0.4);
}

.trio-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.trio-frame.is-fallback::after {
  content: attr(data-symbol);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 2.6rem;
  background: linear-gradient(160deg, #21163d, #100b22);
}

.trio-name {
  margin: 8px 0 0;
  color: var(--silver-soft);
  font-size: 0.95rem;
  font-weight: 800;
}

/* 逆位 */
.face-reversed { transform: rotate(180deg); }

.tarot-face.is-reversed .tarot-face-img { transform: rotate(180deg); }

.tarot-face.is-reversed.is-fallback::after { transform: rotate(180deg); }

.reversed-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border: 1px solid rgba(216, 184, 239, 0.55);
  border-radius: 999px;
  color: #d8b8ef;
  background: rgba(216, 184, 239, 0.12);
  font-size: 0.72rem;
  font-weight: 900;
  vertical-align: middle;
}

.reversed-hint {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px dashed rgba(201, 195, 230, 0.25);
  color: rgba(241, 238, 252, 0.74);
  font-size: 0.95rem;
  line-height: 1.85;
}

.anchor-panel .card-meta { margin-bottom: 14px; }

.side-body {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.side-thumb {
  position: relative;
  width: 60px;
  aspect-ratio: 0.6;
  border-radius: 7px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(230, 201, 107, 0.55);
}

.side-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.side-thumb img.face-reversed { transform: rotate(180deg); }

.side-thumb.is-fallback::after {
  content: attr(data-symbol);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  background: linear-gradient(160deg, #21163d, #100b22);
}

.side-name {
  margin: 0 0 4px;
  color: var(--silver-soft);
  font-size: 1.05rem;
  font-weight: 900;
}

.side-core {
  margin: 0;
  color: var(--gold);
  font-size: 0.94rem;
  line-height: 1.6;
}

.side-modern {
  margin: 0 0 10px;
  color: rgba(241, 238, 252, 0.9);
  line-height: 1.85;
}

.side-cards {
  display: grid;
  gap: 12px;
  margin: 12px 0;
}

.side-card .keyword-row { justify-content: flex-start; }

@media (min-width: 720px) {
  .side-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.card-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.card-kicker { margin: 0; }

.roman {
  color: var(--gold);
  font-family: "Noto Serif TC", "Songti TC", serif;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.card-name {
  margin: 0;
  color: var(--silver-soft);
  font-size: 1.9rem;
  line-height: 1.18;
}

.card-name small {
  display: block;
  margin-top: 6px;
  color: var(--silver);
  font-family: "Times New Roman", Georgia, serif;
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.keyword-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.keyword {
  padding: 6px 11px;
  border: 1px solid rgba(201, 195, 230, 0.34);
  border-radius: 999px;
  background: rgba(241, 238, 252, 0.08);
  color: var(--silver-soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.keyword::before {
  content: "✦ ";
  color: var(--gold);
}

.tone-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  color: var(--gold);
  background: rgba(230, 201, 107, 0.1);
  font-size: 0.8rem;
  font-weight: 900;
}

.tone-badge[data-tone="bright"] { color: #f5dc86; }
.tone-badge[data-tone="rising"] {
  color: #aee2d8;
  border-color: rgba(132, 199, 192, 0.5);
  background: rgba(132, 199, 192, 0.12);
}
.tone-badge[data-tone="deep"] {
  color: #d8b8ef;
  border-color: rgba(216, 184, 239, 0.48);
  background: rgba(216, 184, 239, 0.12);
}

.result-panel {
  margin-bottom: 12px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(241, 238, 252, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.side-cards .result-panel { margin-bottom: 0; }

.focus-panel {
  border-color: var(--gold-line);
  background: rgba(230, 201, 107, 0.08);
}

.advice-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(230, 201, 107, 0.25);
}

.result-panel h3 {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 1.06rem;
  line-height: 1.45;
}

.panel-mark { color: var(--gold-deep); }

.panel-topic {
  color: var(--silver);
  font-size: 0.9rem;
  font-weight: 700;
}

.result-panel p {
  margin: 0;
  color: rgba(241, 238, 252, 0.92);
  line-height: 1.88;
}

/* 鎖定區（靜態文字，無按鈕） */
.lock-area {
  margin-top: 20px;
  padding: 16px 18px;
  border: 1px dashed rgba(201, 195, 230, 0.35);
  border-radius: 12px;
  text-align: center;
}

.lock-title {
  margin: 0;
  color: var(--gold);
  font-weight: 900;
}

.lock-note {
  margin: 8px 0 0;
  color: rgba(201, 195, 230, 0.8);
  font-size: 0.92rem;
  line-height: 1.7;
}

.footer-line {
  margin: 24px 0 4px;
  color: rgba(220, 214, 244, 0.9);
  text-align: center;
  line-height: 1.85;
}

.footer-links {
  margin: 0;
  text-align: center;
}

.topic-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* ---- 牌記錄 ---- */
.history-inner { padding-bottom: 48px; }

.history-list {
  list-style: none;
  display: grid;
  gap: 10px;
  margin: 20px 0 24px;
  padding: 0;
}

.history-row {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(241, 238, 252, 0.07);
  color: var(--silver-soft);
  text-align: left;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.history-row:hover {
  border-color: var(--gold-line);
  background: rgba(230, 201, 107, 0.1);
}

.history-date {
  min-width: 4.5em;
  font-weight: 900;
}

.history-thumbs {
  display: flex;
  gap: 6px;
}

.history-thumb {
  width: 30px;
  aspect-ratio: 0.6;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: inset 0 0 0 1px rgba(230, 201, 107, 0.4);
}

.history-meta {
  color: rgba(201, 195, 230, 0.85);
  font-size: 0.88rem;
}

.history-empty {
  margin: 24px 0;
  color: rgba(201, 195, 230, 0.85);
  line-height: 1.8;
}

.topic-chip {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(241, 238, 252, 0.08);
  color: var(--silver-soft);
  font-size: 0.9rem;
  font-weight: 800;
}

.topic-chip:hover,
.topic-chip.is-selected {
  border-color: var(--gold-line);
  background: rgba(230, 201, 107, 0.13);
}

/* ---- RWD ---- */
@media (min-width: 680px) {
  .scene { padding-inline: 30px; }
  .side-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trio-row { width: min(100%, 560px); }
}

@media (max-width: 560px) {
  .float-card-c { display: none; }

  .fan-stage { height: clamp(180px, 52vw, 240px); }

  .slot-frame { width: min(100%, 78px); }

  .scene-title { font-size: clamp(1.9rem, 9vw, 2.6rem); }
}

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