:root {
  --bg: #0a0710;
  --fg: #f4eef7;
  --muted: #b7a9c4;
  --panel: rgba(20, 14, 28, 0.72);
  --accent-a: #B23A48;
  --accent-b: #6C5CE7;
  --ring: rgba(255, 255, 255, 0.85);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
body { overflow: hidden; }
#app { position: fixed; inset: 0; }
.screen { position: absolute; inset: 0; }
.hidden { display: none !important; }

/* ---------- 起始页 ---------- */
#start {
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(108,92,231,0.22), transparent 60%),
    radial-gradient(120% 80% at 50% 100%, rgba(178,58,72,0.20), transparent 60%),
    var(--bg);
  padding: 24px;
}
.start-inner { text-align: center; max-width: 420px; }
#start h1 { font-size: 34px; margin: 0 0 10px; letter-spacing: 2px;
  text-shadow: 0 0 24px rgba(108,92,231,0.5); }
.sub { color: var(--muted); font-size: 15px; margin: 0 0 32px; }
.bigstart {
  appearance: none; border: 0; cursor: pointer;
  padding: 16px 48px; border-radius: 999px; font-size: 18px; font-weight: 600;
  color: #fff; background: linear-gradient(135deg, #8d6cff, #b23a66);
  box-shadow: 0 10px 40px rgba(141,108,255,0.45); transition: transform .12s ease;
}
.bigstart:active { transform: scale(0.96); }
.adult { margin: 26px 0 0; font-size: 12px; color: var(--muted); opacity: 0.75; letter-spacing: 1px; }

/* ---------- 播放台 ---------- */
/* 竖屏视频内容:宽屏上约束成居中的 9:16「手机框」,避免被 cover 放大裁切；
   手机竖屏时 min() 取 100vw = 全屏，行为不变。框外是深色留白。 */
#stage {
  position: absolute; inset: 0 auto 0 50%;
  transform: translateX(-50%);
  width: min(100vw, calc(100vh * 9 / 16));
  background: #000; overflow: hidden;
}
.video-wrap { position: absolute; inset: 0; }
.layer {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; background: #000;
  opacity: 0; transition: opacity .22s ease;
  pointer-events: none;
}
.layer.active { opacity: 1; }
#vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(130% 100% at 50% 40%, transparent 55%, rgba(0,0,0,0.55) 100%);
}

/* ---------- 遮罩（走向选择 / 结束） ---------- */
#overlay { position: absolute; inset: 0; pointer-events: none; }
#overlay.on { pointer-events: auto; }

.choose {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; gap: 18px;
  padding: 0 20px calc(40px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.35) 45%, transparent 75%);
  animation: fade .3s ease;
}
.choose .prompt { font-size: 20px; font-weight: 600; margin-bottom: 4px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.8); }
.choose .cards { display: flex; gap: 14px; width: 100%; max-width: 440px; }
.choice-card {
  flex: 1; cursor: pointer; border: 0; color: #fff;
  padding: 20px 14px; border-radius: 18px; font-size: 18px; font-weight: 700;
  background: var(--panel); backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255,255,255,0.14);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  transition: transform .12s ease, box-shadow .2s ease;
  position: relative; overflow: hidden;
}
.choice-card::before {
  content: ""; position: absolute; inset: 0; opacity: 0.9;
  background: linear-gradient(135deg, var(--c) 0%, transparent 70%); mix-blend-mode: screen;
}
.choice-card .cc-label { position: relative; }
.choice-card .cc-tag { position: relative; display: block; font-size: 12px;
  font-weight: 500; opacity: 0.85; margin-top: 6px; }
.choice-card:active { transform: scale(0.96); }

/* 结束遮罩 */
.ended {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  background: rgba(0,0,0,0.6); animation: fade .35s ease;
}
.ended .big { font-size: 22px; font-weight: 700; margin-bottom: 6px;
  text-shadow: 0 0 20px rgba(108,92,231,0.5); }
.ended button {
  appearance: none; border: 1.5px solid rgba(255,255,255,0.2); cursor: pointer;
  min-width: 210px; padding: 13px 22px; border-radius: 999px;
  font-size: 15px; font-weight: 600; color: #fff; background: var(--panel);
  transition: transform .12s ease; backdrop-filter: blur(6px);
}
.ended button.primary { background: linear-gradient(135deg, #8d6cff, #b23a66); border: 0; }
.ended button:active { transform: scale(0.96); }
.ended .demo-tag { margin-top: 10px; font-size: 12px; color: var(--muted); }

/* 自动播放被拦兜底 */
.bigstart.resume { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); }

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

/* ---------- 控制条 ---------- */
#controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
}
#playpause { appearance: none; border: 0; background: transparent; color: #fff;
  font-size: 20px; cursor: pointer; width: 32px; }
#seek { flex: 1; -webkit-appearance: none; height: 4px; border-radius: 4px;
  background: rgba(255,255,255,0.28); outline: none; }
#seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px;
  border-radius: 50%; background: #fff; box-shadow: 0 0 8px rgba(255,255,255,0.7); }
#seek::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; }

/* ---------- spinner（切换兜底） ---------- */
#spinner { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  z-index: 6; pointer-events: none; }
#spinner .ring { width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.25); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
