/* 全屏交互电影剧场（th- 前缀，独立于旧样式） */
.th-root {
  position: fixed;
  inset: 0;
  z-index: 2000;
  width: 100vw;
  height: 100dvh;
  background: #111315;
  color: #FBF9F5;
  font-family: var(--font-sans);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.th-stage-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1), filter 500ms ease;
}

.th-stage-media.th-slowmo {
  transform: scale(1.04);
  filter: blur(1.4px) saturate(0.92);
}

.th-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 450ms ease;
  pointer-events: none;
}

.th-layer.is-active {
  opacity: 1;
}

.th-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.th-kenburns {
  animation-name: thKenBurns;
  animation-timing-function: ease-in-out;
  animation-fill-mode: forwards;
  will-change: transform;
}

@keyframes thKenBurns {
  0% { transform: scale(1.06) translate3d(-1%, 0.6%, 0); }
  50% { transform: scale(1.12) translate3d(1%, -0.6%, 0); }
  100% { transform: scale(1.16) translate3d(0%, 0.4%, 0); }
}

.th-tint-rain::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(48, 76, 108, 0.32), rgba(20, 32, 48, 0.42));
}

.th-tint-dusk::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(35, 52, 88, 0.36), rgba(92, 64, 96, 0.28));
}

/* 电影氛围遮罩 */
.th-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 48%, rgba(0, 0, 0, 0) 48%, rgba(10, 12, 15, 0.56) 100%);
  transition: box-shadow 350ms ease, background 350ms ease;
}

.th-vignette.is-warn {
  box-shadow: inset 0 0 110px rgba(216, 68, 52, 0.72);
  animation: thWarnPulse 700ms ease-in-out infinite;
}

.th-vignette.is-cold {
  background: radial-gradient(circle at 50% 45%, rgba(62, 102, 146, 0.16) 20%, rgba(12, 24, 42, 0.72) 100%);
}

@keyframes thWarnPulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

.th-warm-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 55%, rgba(255, 206, 128, 0.7), rgba(255, 165, 86, 0.22));
  opacity: 0;
  transition: opacity 420ms ease;
}

.th-fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

/* 顶栏玻璃胶囊 */
.th-topbar {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.th-topbar > * {
  pointer-events: auto;
}

.th-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.th-glass-btn,
.th-score-chip {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(20, 24, 28, 0.46);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: #FAF7F2;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 15px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.th-glass-btn {
  cursor: pointer;
  transition: background-color 180ms ease, transform 180ms ease;
}

.th-glass-btn:hover {
  background: rgba(20, 24, 28, 0.72);
}

.th-score-chip strong {
  color: #F6D892;
  font-size: 15px;
}

/* 开场标题卡 */
.th-title-card {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 550ms ease;
}

.th-title-card.is-visible {
  opacity: 1;
}

.th-title-sub {
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 245, 224, 0.85);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
  margin-bottom: 8px;
}

.th-title-main {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-shadow: 0 6px 28px rgba(0, 0, 0, 0.65);
}

/* 全屏交互叠层 */
.th-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: auto;
  touch-action: none;
}

.th-prompt {
  position: absolute;
  top: max(68px, calc(env(safe-area-inset-top) + 56px));
  left: 50%;
  transform: translateX(-50%);
  width: min(90vw, 560px);
  text-align: center;
  font-size: clamp(14px, 2.2vw, 17px);
  font-weight: 600;
  color: #FFFFFF;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.78);
  pointer-events: none;
  transition: opacity 250ms ease;
}

.th-prompt.is-pulse {
  animation: thWarnPulse 1.1s ease-in-out infinite;
}

.th-autoplay-tag {
  position: absolute;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: rgba(255, 250, 240, 0.78);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  z-index: 14;
}

/* iOS 风格英文手机诱惑通知 */
.th-phone-banner {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  transform: translate(-50%, -140%);
  z-index: 25;
  width: min(92vw, 350px);
  padding: 11px 15px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(24, 27, 32, 0.82);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  text-align: left;
  transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.th-phone-banner.is-shown {
  transform: translate(-50%, 54px);
}

.th-phone-app {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3D7EFF, #2856D6);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  flex: 0 0 auto;
}

.th-phone-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.th-phone-title {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.05em;
}

.th-phone-text {
  font-size: 13.5px;
  font-weight: 600;
  color: #FFFFFF;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 交互道具样式 */
.th-brush-zone {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  width: 56vw;
  height: 38vh;
  max-width: 620px;
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 240, 200, 0.32);
  background: radial-gradient(circle, rgba(255, 232, 180, 0.08), transparent 70%);
  pointer-events: none;
}

.th-progress-track {
  position: absolute;
  bottom: max(46px, calc(env(safe-area-inset-bottom) + 34px));
  left: 50%;
  transform: translateX(-50%);
  width: min(72vw, 320px);
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
  pointer-events: none;
}

.th-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #F4C86A, #FFE8AF);
  transition: width 80ms linear;
}

.th-corner-hazard {
  position: absolute;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(82px, calc(env(safe-area-inset-bottom) + 70px));
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 190, 180, 0.45);
  background: rgba(120, 34, 28, 0.56);
  backdrop-filter: blur(14px);
  color: #FFEAE6;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.th-drop-circle {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 244, 214, 0.48);
  display: grid;
  place-items: center;
  font-size: 12px;
  color: rgba(255, 244, 214, 0.85);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

.th-props-row {
  position: absolute;
  bottom: max(44px, calc(env(safe-area-inset-bottom) + 32px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  width: min(94vw, 480px);
}

.th-prop-pill {
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(24, 28, 32, 0.58);
  backdrop-filter: blur(16px);
  color: #FFFDF8;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  touch-action: none;
  transition: transform 160ms ease, opacity 220ms ease, background-color 160ms ease;
}

.th-prop-pill.is-done {
  opacity: 0.36;
  pointer-events: none;
}

.th-ball-token {
  position: absolute;
  left: 50%;
  bottom: max(56px, calc(env(safe-area-inset-bottom) + 42px));
  transform: translate(-50%, 0);
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: radial-gradient(circle at 35% 30%, #EEFF8C, #A6C82B);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  color: #243210;
  font-size: 11px;
  font-weight: 800;
  cursor: grab;
  touch-action: none;
}

.th-doors-row {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  width: min(92vw, 680px);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.th-door-sign {
  flex: 1;
  min-height: 120px;
  border-radius: 24px;
  padding: 18px 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 200ms ease;
}

.th-door-sign:hover {
  transform: scale(1.03);
}

.th-door-sign.is-welcome {
  background: rgba(44, 102, 72, 0.72);
  border-color: rgba(154, 232, 184, 0.6);
}

.th-door-sign.is-nodogs {
  background: rgba(146, 46, 42, 0.72);
  border-color: rgba(255, 172, 162, 0.6);
}

.th-door-sign strong {
  font-size: clamp(16px, 2.8vw, 22px);
  letter-spacing: 0.05em;
}

.th-door-sign span {
  font-size: 11.5px;
  opacity: 0.85;
}

.th-lantern-dot {
  position: absolute;
  top: 32%;
  transform: translate(-50%, -50%);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid rgba(255, 228, 150, 0.75);
  background: rgba(255, 214, 110, 0.25);
  box-shadow: 0 0 24px rgba(255, 210, 102, 0.35);
  color: #FFF5D2;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: transform 220ms ease, background-color 220ms ease, box-shadow 220ms ease;
}

.th-lantern-dot.is-lit {
  background: radial-gradient(circle, #FFF6C8, #F4B93F);
  color: #4A3006;
  box-shadow: 0 0 42px rgba(255, 215, 108, 0.9);
  transform: translate(-50%, -50%) scale(1.12);
}

.th-noise-circle {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 116px;
  height: 116px;
  border-radius: 50%;
  border: 2px solid #FF6A5E;
  background: rgba(190, 44, 34, 0.34);
  color: #FFEAE6;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: grid;
  place-items: center;
  text-align: center;
  cursor: pointer;
  animation: thWarnPulse 650ms ease-in-out infinite;
}

.th-ghost {
  position: absolute;
  z-index: 28;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.92);
  background: rgba(255, 236, 178, 0.35);
  box-shadow: 0 0 22px rgba(255, 236, 178, 0.7);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: left 550ms cubic-bezier(0.22, 1, 0.36, 1), top 550ms cubic-bezier(0.22, 1, 0.36, 1), transform 140ms ease;
}

.th-ghost.is-tap {
  transform: translate(-50%, -50%) scale(0.78);
}

/* 结算胶囊 & 换分金色光环 */
.th-result-pill {
  position: absolute;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translate(-50%, 24px);
  z-index: 30;
  width: min(92vw, 500px);
  padding: 20px 22px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(22, 26, 30, 0.8);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.48);
  opacity: 0;
  pointer-events: none;
  transition: opacity 380ms ease, transform 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

.th-result-pill.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.th-result-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.th-result-kicker {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(255, 244, 218, 0.76);
}

.th-result-delta {
  font-size: 26px;
  font-weight: 800;
  color: #F6D892;
}

.th-result-delta.is-neg {
  color: #FF8E82;
}

.th-result-line {
  font-size: 14.5px;
  line-height: 1.6;
  color: #FFFDF8;
  margin-bottom: 10px;
}

.th-result-status {
  font-size: 12.5px;
  color: rgba(255, 248, 232, 0.72);
  margin-bottom: 14px;
}

.th-result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.th-btn-primary {
  border: 0;
  border-radius: 999px;
  background: #8E293B;
  color: #FFFDF8;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 18px;
  cursor: pointer;
}

.th-btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #FFFDF8;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 18px;
  cursor: pointer;
}

/* 换分金色光环揭示 */
.th-swap-overlay {
  position: absolute;
  inset: 0;
  z-index: 26;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 420ms ease;
  background: radial-gradient(circle, rgba(246, 214, 134, 0.26), rgba(14, 16, 20, 0.62) 70%);
}

.th-swap-overlay.is-visible {
  opacity: 1;
}

.th-swap-rings {
  position: relative;
  width: 190px;
  height: 190px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}

.th-swap-rings::before,
.th-swap-rings::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(246, 216, 146, 0.72);
  animation: thHaloSpin 4s linear infinite;
}

.th-swap-rings::after {
  inset: 18px;
  border-color: rgba(255, 240, 198, 0.88);
  animation-direction: reverse;
  animation-duration: 2.8s;
}

@keyframes thHaloSpin {
  0% { transform: scale(0.95) rotate(0deg); opacity: 0.7; }
  50% { transform: scale(1.06) rotate(180deg); opacity: 1; }
  100% { transform: scale(0.95) rotate(360deg); opacity: 0.7; }
}

.th-swap-num {
  font-size: 52px;
  font-weight: 800;
  color: #FFE7A8;
  text-shadow: 0 4px 24px rgba(246, 194, 88, 0.65);
}

.th-swap-msg {
  font-size: 16px;
  font-weight: 600;
  color: #FFFDF8;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}
