/* Artwork coordinates follow the selected 852px reference at a 414px logical width. */
.live-tarot .tarot-room {
  height: 519px;
  overflow: hidden;
  color: #f5e1b8;
  background: #302233;
  isolation: isolate;
}
.tarot-scenery, .tarot-table, .tarot-clear-table {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.tarot-scenery {
  background: url(assets/tarot-visual/scene-crown.jpg) top / 100% 51px no-repeat,
    linear-gradient(180deg,#231d2c 14%,#362635 78%,#382437 89%,#291b2a);
}
.tarot-table {
  background: url(assets/tarot-visual/scene-table.jpg) center 91px / 414px 349px no-repeat;
  /* Cut the deck from the original plate. Only projected card geometry can occupy this area. */
  mask: linear-gradient(#000 83%,transparent 85%), linear-gradient(#000 0 0) center 205px / 361px 170px no-repeat;
  mask-composite: subtract;
}
.tarot-clear-table {
  background: url(assets/tarot-visual/scene-clear.jpg) 50% 159px / 414px auto no-repeat;
  mask-image: linear-gradient(to right,transparent 1%,#000 5%,#000 95%,transparent 99%),
    linear-gradient(transparent 36%,#000 39%,#000 73%,transparent 84%);
  mask-composite: intersect;
}
.tarot-room > .tarot-scenery + div { z-index: 4; }
.tarot-room [data-name="Status bar - iPhone"] { transform: translateY(-7px) scaleX(1.10); }
.tarot-room [data-name="导航栏_文字标题"] {
  margin-top: -11px;
  height: 40px;
  background: rgb(39 32 48 / 92%);
}
.tarot-room > [data-name="底部操作"] {
  position: absolute;
  inset: auto 0 0;
  height: 79px;
  padding: 0 10px 11px;
  gap: 9px;
  z-index: 4;
}
.tarot-room > [data-name="底部操作"] > .frame-control { width: 78px; height: 68px; }
.tarot-room [data-name="底部操作"] .frame-primary { height: 68px; }
.tarot-room [data-name="底部操作"] .frame-primary:disabled {
  opacity: 1;
  background: #b4a42d;
}
.live-tarot .tarot-room .game-slot {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.live-tarot #game { position: relative; padding: 0; }
.live-tarot #game > header {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.live-tarot #hint {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
/* Outside the zoomed stage, so the replay control stays at the viewport bottom. */
.tarot-bottom {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 6;
  width: calc(100dvh * 414 / 896);
  transform: translateX(-50%);
  background: #251b2cf7;
  border-top: 1px solid #9f764c;
  padding: 6px 12px max(6px, env(safe-area-inset-bottom));
  text-align: center;
}
.tarot-bottom[hidden] { display: none; }
@media (max-width: 600px) { .tarot-bottom { width: 100%; } }
.tarot-replay {
  min-height: 44px;
  padding: 0 26px;
  border: 1px solid #ba945c;
  border-radius: 24px;
  background: #36243a;
  color: #fcdfac;
  font: 600 15px/20px "PingFang SC",sans-serif;
}
.tarot-has-footer { scroll-padding-bottom: 64px; }
.tarot-has-footer .frame-layout { padding-bottom: 76px; }
.live-tarot #stage { position: absolute; inset: 0; z-index: 2; }
/* A single perspective camera projects three identical card meshes. */
.tarot-cards {
  position: absolute;
  inset: 207px 0 auto;
  height: 160px;
  perspective: 740px;
  perspective-origin: 50% 48%;
}
.tarot-card {
  --lift: 0px;
  --depth: 0px;
  position: absolute;
  top: 0;
  width: 108px;
  height: 159px;
  border: 0;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  transform-style: preserve-3d;
  transform: translate3d(0,var(--lift),var(--depth)) rotateZ(var(--roll)) rotateY(var(--yaw)) rotateX(var(--pitch));
  transition: transform .24s cubic-bezier(.22,.65,.25,1);
  pointer-events: auto;
}
.tarot-card:nth-child(1) { left: 37px; }
.tarot-card:nth-child(2) { left: 153px; }
.tarot-card:nth-child(3) { left: 269px; }
.tarot-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: fill;
  pointer-events: none;
  backface-visibility: hidden;
}
.tarot-back-art {
  transform: translateZ(1.5px);
  box-shadow: 0 6px 10px #0e0814dc;
  transition: box-shadow .24s ease;
}
.tarot-card[aria-pressed="true"] { --lift: -5px; --depth: 12px; z-index: 2; }
.tarot-card[aria-pressed="true"] .tarot-back-art {
  box-shadow: 0 0 0 1.5px #f7d893, 0 0 20px #e9b45bb0, 0 10px 14px #0e0814cc;
}
.tarot-card::after {
  content: "";
  position: absolute;
  inset: 2px -1.5px 2px auto;
  width: 3px;
  background: #957445;
  transform: rotateY(90deg);
  pointer-events: none;
}
.tarot-card .tarot-flip-art {
  transform: rotateY(180deg) translateZ(1.5px);
  box-shadow: 0 0 12px #eccc7e9c;
}
.tarot-turning .tarot-card[aria-pressed="false"] {
  animation: tarot-withdraw .63s cubic-bezier(.26,.58,.37,1) both;
}
.tarot-in-flight:disabled { z-index: 3; opacity: 1; transition: none; }
@keyframes tarot-withdraw {
  from { opacity: 1; }
  to { opacity: 0; transform: translate3d(0,22px,-30px) rotateZ(var(--roll)) rotateY(var(--yaw)) rotateX(var(--pitch)); }
}
.tarot-effects {
  position: absolute;
  left: 50%;
  top: 279px;
  z-index: 3;
  pointer-events: none;
}
.tarot-effects > * { position: absolute; opacity: 0; pointer-events: none; }
.tarot-orbit {
  inset: -93px;
  width: 186px;
  height: 186px;
  border: 1px solid #edc987;
  border-radius: 50%;
  box-shadow: inset 0 0 22px #f6cf7542,0 0 18px #f0bd5980;
}
.tarot-glint {
  inset: -150px -50px;
  width: 100px;
  height: 300px;
  background: radial-gradient(ellipse,#fff1bc 0%,#f8cd7f60 28%,transparent 65%);
  mix-blend-mode: screen;
}
.tarot-effects i {
  width: 4px;
  height: 4px;
  background: #ffe6a6;
  transform: rotate(var(--angle));
  box-shadow: 0 0 8px 2px #e9b650;
  border-radius: 50%;
}
.tarot-turning .tarot-orbit { animation: tarot-orbit 1.42s .14s ease-out both; }
.tarot-turning .tarot-glint { animation: tarot-glint .59s 1.08s ease-out both; }
.tarot-turning .tarot-effects i { animation: tarot-ember .56s calc(1.06s + var(--delay)) ease-out both; }
@keyframes tarot-orbit {
  0% { opacity: 0; transform: scale(.54) rotateX(56deg); }
  50% { opacity: .56; transform: scale(1) rotateX(49deg); }
  74% { opacity: .7; }
  100% { opacity: 0; transform: scale(1.64) rotateX(46deg); }
}
@keyframes tarot-glint {
  0% { opacity: 0; transform: scaleX(.15); }
  19% { opacity: .73; }
  100% { opacity: 0; transform: scaleX(2.5); }
}
@keyframes tarot-ember {
  0% { opacity: 0; transform: rotate(var(--angle)) translateX(32px) scale(.6); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--angle)) translateX(var(--radius)) scale(.25); }
}
.tarot-front {
  position: absolute;
  top: 171px;
  left: 50%;
  width: 142px;
  height: 208px;
  transform: translateX(-50%);
  filter: drop-shadow(0 0 11px #eeb8729c) drop-shadow(0 8px 12px #110811);
}
.tarot-front img { width: 100%; height: 100%; object-fit: fill; border-radius: 8px; }
.tarot-result-mode .tarot-table {
  background-image: url(assets/tarot-visual/scene-table-revealed.jpg);
  background-position-y: 85px;
  mask-position: center,center 199px;
}
.tarot-result-mode .tarot-clear-table { background-position-y: 151px; }
.tarot-result-mode .tarot-scenery {
  background-color: #332438;
}

.tarot-room.tarot-result-mode > [data-name="底部操作"] { height: 61px; padding-bottom: 7px; }
.tarot-room.tarot-result-mode > [data-name="底部操作"] :is(.frame-control,.frame-primary) { height: 54px; }
.tarot-result-mode :is(#frame-rules,#frame-retry) > [data-name="图标"] { top: 4px; width: 28px; height: 28px; }
.tarot-result-mode :is(#frame-rules,#frame-retry) > :last-child { top: 50px; }
.tarot-reading {
  position: absolute;
  top: 386px;
  left: 0;
  width: 100%;
  padding: 0 29px;
  color: #ffe3ae;
  text-align: center;
  text-shadow: 0 2px 5px #150a1b;
}
.tarot-reading strong { display: flex; gap: 15px; align-items: center; justify-content: center; font: 700 23px/29px "Songti SC","Noto Serif CJK SC",SimSun,serif; }
.tarot-reading strong::before,.tarot-reading strong::after {
  content: "✦";
  color: #e9c787;
  font: 12px/20px serif;
  text-shadow: 0 0 9px #dfa451;
}
.tarot-reading p { margin: 3px 0 0; font: 400 13px/17px "PingFang SC",sans-serif; }
.tarot-revealed .tarot-reading { animation: tarot-enter .46s .07s ease-out both; }
.tarot-recommend-in { animation: tarot-enter .4s .18s ease-out both; }
@keyframes tarot-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.live-tarot #feed { row-gap: 6px; padding: 7px 10px 10px; }
.live-tarot #feed [data-name="搜索框"] { width: 394px; height: 34px; }
.live-tarot #feed [data-name="搜索框"] .sample-search-button { height: 28px; }
.live-tarot #feed [data-name="商品1"] { width: 193px; height: 239px; }
.live-tarot #feed [data-name="商品1"] > [data-name="image"] {
  width: 193px; height: 157px; background: #f2f2f2;
}
.live-tarot #feed [data-name="商品1"] > [data-name="image"] img { object-fit: fill; }
.tarot-pick { width: 100%; padding: 12px; background: #fff9ed; color: #261f2b; border-bottom: 1px solid #e7d9bc; }
.tarot-pick h2 { font: 600 17px/22px "PingFang SC",sans-serif; margin-bottom: 7px; }
.tarot-pick article { display: grid; grid-template-columns: 60px minmax(0,1fr) auto; gap: 9px; align-items: center; }
.tarot-pick img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; }
.tarot-pick p { font-size: 13px; color: #4d5666; }
.tarot-pick button { min-height: 44px; padding: 0 9px; border-radius: 7px; background: #eae0ee; font-size: 13px; }
@media (prefers-reduced-motion: reduce) {
  .tarot-card, .tarot-back-art { transition: none; }
  .tarot-revealed .tarot-reading, .tarot-recommend-in { animation: none; }
}
