@import url("fonts.css");

/* ============================================================
   Prank Port · 参考站点外壳复刻样式
   ------------------------------------------------------------
   布局数值来自对参考站 launch.css 的逐条还原：
   20:9 画框、6px 进度条、65px 启动条、Barlow Condensed 500、
   文本 -webkit-text-stroke 等。素材全部为自制原创。
   ============================================================ */

:root {
  --ink: #15101c;
  --ink-2: #211f2a;
  --ink-3: #29273c;
  --paper: #faf8fa;
  --alert: #c4252d;
  --cond: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --sans: "Kumbh Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --text: 1;
  --scale: 1;
  --ready-at: 55%;
  --cinema-footer: clamp(44px, 4.5cqw, 86px);
  --film-grain: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--ink);
}

body {
  overflow: hidden;
  color: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  touch-action: manipulation;
}

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

button, a { -webkit-tap-highlight-color: transparent; }

/* ============ 画框 ============ */

#game {
  position: relative;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  overflow: hidden;
  container-type: inline-size;
}

#frame {
  position: relative;
  width: min(100%, calc(100dvh * 20 / 9));
  height: min(100%, calc(100vw * 2 / 3));
  background: var(--ink-2);
  overflow: hidden;
  isolation: isolate;
}

#frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  background-image: var(--film-grain);
  opacity: .055;
  mix-blend-mode: overlay;
}

#stage {
  position: absolute;
  inset: 0;
  transform: scale(var(--scale));
  transform-origin: center;
}

/* ============ 加载页 ============ */

#loading {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background: var(--ink-3);
  transition: opacity .55s ease;
}

#loading.is-out { opacity: 0; pointer-events: none; }

.loading-art {
  position: absolute;
  inset: 0;
  background: #1b1826;
}

/* 参考站的加载页是一段全屏视频（外链），这里直接用同一个文件 */
.loading-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus, 45%) 5%;
  background: #29273c;
  z-index: 0;
}

#loading.has-video .loading-art { opacity: 0; }

/* 参考站的字标是一张 1024×1024 透明 PNG；断网时回落到文字字标 */
.download-logo-img {
  position: absolute;
  top: max(clamp(16px, 2.92vw, 56px), env(safe-area-inset-top));
  left: max(clamp(16px, 2.92vw, 56px), env(safe-area-inset-left));
  width: clamp(86px, 12vw, 210px);
  height: auto;
  transform: translate(-.586%, -12.4%);
  pointer-events: none;
  z-index: 1;
  filter: drop-shadow(0 6px 18px rgba(8, 4, 14, .55));
}

#loading.has-logo .download-logo { display: none; }

.loading-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus, 65%) 5%;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.6s ease, transform 9s linear;
  will-change: opacity, transform;
}

.loading-art img.is-live {
  opacity: 1;
  transform: scale(1.005);
}

#loading::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 0%, transparent 40%, rgba(9, 6, 14, .55) 100%),
    linear-gradient(transparent 55%, rgba(10, 7, 16, .5));
}

.download-logo {
  position: absolute;
  top: max(clamp(16px, 2.92vw, 56px), env(safe-area-inset-top));
  left: max(clamp(16px, 2.92vw, 56px), env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: .82;
  pointer-events: none;
  transform: translate(-.586%, -12.4%);
  filter: drop-shadow(0 6px 18px rgba(8, 4, 14, .55));
}

.logo-script {
  font: 700 clamp(22px, 3.1vw, 52px)/.9 var(--cond);
  letter-spacing: .01em;
  color: #f7eef2;
  text-transform: none;
  transform: skewX(-9deg);
}

.logo-mark {
  font: 700 clamp(40px, 6.4vw, 108px)/.78 var(--cond);
  letter-spacing: .02em;
  background: linear-gradient(178deg, #ffe9f3 8%, #f3a8c8 42%, #c86fb4 78%, #8d4aa3 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: .045em rgba(24, 10, 26, .85);
  paint-order: stroke fill;
}

/* ---- 加载 HUD ---- */

.loading-progress {
  position: fixed;
  z-index: 2;
  inset: auto 0 0;
  --track-height: 6px;
  --gutter: clamp(8px, 1.46vw, 28px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  padding: clamp(28px, 5vh, 70px) max(var(--gutter), env(safe-area-inset-right))
           calc(19px + var(--safe-bottom)) max(var(--gutter), env(safe-area-inset-left));
  background: linear-gradient(transparent, #100e19bc 76%);
  pointer-events: none;
  display: grid;
  gap: 0;
  transition: opacity .45s ease;
}

.loading-progress.is-out { opacity: 0; }

.loading-caption {
  display: flex;
  align-items: center;
  gap: clamp(8px, .8vw, 15px);
  color: #f8f5f8;
  font: 500 clamp(19px, 1.67vw, 32px)/1 var(--cond);
  text-transform: uppercase;
  letter-spacing: 1px;
  -webkit-text-stroke: .12em #000;
  paint-order: stroke fill;
}

.loading-spinner {
  --diameter: 1em;
  position: relative;
  display: block;
  flex: none;
  width: var(--diameter);
  aspect-ratio: 1;
  mask-image: conic-gradient(from 22deg, transparent, #0009 72deg, #000 158deg 260deg, transparent 261deg);
  animation: turn .85s linear infinite;
}

/* 两段圆弧：外层深色描边 + 内层亮面 */
.loading-spinner::before,
.loading-spinner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: conic-gradient(from 22deg, var(--ink) 0 var(--sweep), transparent var(--sweep));
  mask-image: radial-gradient(closest-side, transparent calc(var(--inner) - 4%), #000 var(--inner) var(--outer), transparent calc(var(--outer) + 4%));
}

.loading-spinner::before { --ink: #08070c; --inner: 52%; --outer: 96%; --sweep: 228deg; }
.loading-spinner::after { --ink: #e2e1e9; --inner: 61%; --outer: 87%; --sweep: 218deg; }

@keyframes turn { to { transform: rotate(360deg); } }

#loading-percent { font-variant-numeric: tabular-nums; }

.download-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: clamp(38px, 2.8vw, 54px);
}

#download-detail {
  margin: 0;
  color: #eee9ef;
  font: 400 clamp(14px, 1.25vw, 24px)/1.25 var(--sans);
  opacity: 0;
  transition: opacity .35s ease;
}

#download-detail.is-on { opacity: 1; }

.download-start {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(7px, .6vw, 12px);
  min-height: 36px;
  padding: 5px 12px;
  border: 2px solid #f3eef1;
  background: #f3eef1;
  color: #241d2a;
  font: 500 clamp(16px, 1.18vw, 22.5px)/1 var(--cond);
  text-transform: uppercase;
  letter-spacing: .05em;
  cursor: pointer;
  transition: transform .12s ease, background .18s ease;
}

.download-start:hover { background: #fff; transform: translateY(-1px); }

.download-mark {
  position: absolute;
  left: var(--ready-at);
  bottom: var(--track-height);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  color: #d5cdd8;
  font: 500 clamp(12px, 1.05vw, 20px)/1 var(--cond);
  text-transform: uppercase;
  transition: opacity .3s ease;
}

#loading-hud[data-ready] .download-mark { color: #fff; }

.download-mark i {
  width: clamp(10px, .8vw, 16px);
  height: clamp(7px, .55vw, 11px);
  background: currentColor;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.loading-track {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--track-height);
  background: #ffffff30;
  overflow: hidden;
}

.loading-track > div {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform: scaleX(var(--progress, 0));
  background: #fff;
  transition: transform .26s linear;
}

/* 描边文字（复刻关键质感） */
#download-detail,
.download-mark,
.launch-strip > span,
.launch-strip .button-label,
.prompt,
#rotate-title,
.button-label {
  -webkit-text-stroke: .12em #000;
  paint-order: stroke fill;
}

/* ============ 封面 ============ */

#cover {
  position: absolute;
  inset: 0;
  background: #000;
  overflow: hidden;
}

.key-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  margin: 0;
}

#title-motion {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  pointer-events: none;
}

#cover::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(105% 80% at 46% 42%, transparent 38%, rgba(8, 4, 12, .62) 100%);
}

.launch-strip {
  --footer-baseline: max(43px, calc((26px + env(safe-area-inset-bottom, 0px)) / var(--scale, 1)));
  position: absolute;
  inset: 0;
  height: auto;
  padding: 0;
  pointer-events: none;
  background: linear-gradient(to top, #120a19c7, transparent 165px);
  font: 500 23px/1 var(--cond);
  text-transform: uppercase;
  letter-spacing: 1.3px;
  opacity: 0;
  transition: opacity .8s ease;
}

.launch-strip.is-on { opacity: 1; }

.launch-strip > span {
  position: absolute;
  left: max(48px, calc(env(safe-area-inset-left, 0px) / var(--scale, 1) + 8px));
  bottom: var(--footer-baseline);
  font-size: clamp(14px, 1.6vw, 23px);
  color: #eae3ec;
}

.launch-play {
  position: absolute;
  left: 47.6%;
  right: max(48px, calc(env(safe-area-inset-right, 0px) / var(--scale, 1) + 8px));
  bottom: var(--footer-baseline);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.launch-play > button {
  flex: none;
  translate: -50% 0;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 14px 24px;
  font: 500 28px/1 var(--cond);
  text-transform: uppercase;
  letter-spacing: .7px;
  color: #fff;
  border: 2px solid #fff8;
  background: #17111bd9;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .12s ease;
  animation: playPulse 3.4s ease-in-out infinite;
}

.launch-play > button:hover { background: #322334; border-color: #fff; }

@keyframes playPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
  50% { box-shadow: 0 0 26px 0 rgba(240, 190, 220, .22); }
}

.launch-play small {
  font: 500 clamp(11px, .8cqw, 14px)/1.3 var(--sans);
  text-transform: none;
  letter-spacing: normal;
  color: #fff;
  text-align: right;
  min-width: 0;
  opacity: .8;
  -webkit-text-stroke: .12em #17111b;
  paint-order: stroke fill;
}

/* 键帽 */
.pc-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: calc(31px * var(--text, 1));
  height: calc(28px * var(--text, 1));
  padding: 0 6px;
  border: 2px solid #000;
  border-radius: 5px;
  background: #f6f4f5;
  color: #171719;
  font: 500 calc(17px * var(--text, 1))/1 var(--sans);
  text-transform: none;
  letter-spacing: 0;
  -webkit-text-stroke: 0;
  flex: none;
}

/* ============ 过场字卡 ============ */

#cinema {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: #000;
  display: grid;
  place-items: center;
  opacity: 1;
  transition: opacity .6s ease;
}

#film {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  z-index: 1;
}

#cinema.is-out { opacity: 0; }

#cinema-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 0 6cqw;
  text-align: center;
  animation: cardIn .8s ease both;
}

#cinema-card.is-swap { animation: cardOut .35s ease both; }

@keyframes cardIn { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
@keyframes cardOut { to { opacity: 0 } }

#cinema-card h2 {
  margin: 0;
  font: 500 clamp(30px, 5.2vw, 78px)/.95 var(--cond);
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #f7f4f8;
}

#cinema-card p {
  margin: 0;
  font: 500 clamp(10px, 1.15vw, 16px)/1 var(--sans);
  letter-spacing: .42em;
  text-transform: uppercase;
  color: #b7adbb;
}

#cinema-card img {
  max-width: 78cqw;
  max-height: 62cqh;
  object-fit: contain;
}

/* ============ 整蛊舞台 ============ */

#prank {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: #050408;
  overflow: hidden;
}

#prank-stage { position: absolute; inset: 0; }

.prank-item {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity .45s ease;
}

.prank-item.is-live { opacity: 1; }

.prank-item.is-out { opacity: 0; }

/* 整蛊视频的迷你控制条：暂停 / 进度 / 时间码，不抢画面 */
.prank-ctl {
  position: absolute;
  right: clamp(14px, 2vw, 34px);
  bottom: calc(var(--cinema-footer, 64px) + 18px);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(8, 5, 14, .62);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .12);
  opacity: .62;
  transition: opacity .25s ease;
}

.prank-ctl:hover,
.prank-ctl:focus-within { opacity: 1; }

.prank-ctl .ctl-toggle {
  width: 26px;
  height: 26px;
  min-width: 26px;
  padding: 0;
  display: grid;
  place-items: center;
  font: 600 13px/1 var(--sans, system-ui, sans-serif);
  color: #fff;
  background: rgba(255, 255, 255, .14);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  letter-spacing: 0;
}

.prank-ctl .ctl-track {
  position: relative;
  width: clamp(90px, 16vw, 190px);
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
  cursor: pointer;
}

.prank-ctl .ctl-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #59e6ff, #ff4fd8);
}

.prank-ctl .ctl-time {
  font: 400 11px/1 ui-monospace, monospace;
  letter-spacing: .04em;
  color: rgba(255, 255, 255, .66);
  white-space: nowrap;
}

.prank-item[data-type="video"] .prank-caption { bottom: calc(var(--cinema-footer, 64px) + 70px); }

.prank-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #050408;
}

.prank-item[data-type="image"] .prank-media { animation: kenburns 14s ease-out both; }

@keyframes kenburns { from { transform: scale(1.02) } to { transform: scale(1.11) } }

.prank-caption {
  position: absolute;
  left: clamp(18px, 3.4cqw, 56px);
  bottom: calc(var(--cinema-footer) + 32px);
  right: clamp(18px, 3.4cqw, 56px);
  font: 500 clamp(18px, 2.1vw, 34px)/1.15 var(--cond);
  letter-spacing: .02em;
  color: #fff;
  -webkit-text-stroke: .05em #000;
  paint-order: stroke fill;
  text-shadow: 0 3px 22px rgba(0, 0, 0, .8);
}

.prank-text {
  display: grid;
  gap: clamp(10px, 1.6vh, 22px);
  padding: 0 8cqw;
  text-align: center;
  animation: cardIn .6s ease both;
}

.prank-text h2 {
  margin: 0;
  font: 700 clamp(38px, 7.2vw, 112px)/.92 var(--cond);
  text-transform: uppercase;
  letter-spacing: .02em;
  background: linear-gradient(180deg, #fff 12%, #ffc7dd 55%, #e070a8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: .06em rgba(0, 0, 0, .9);
  paint-order: stroke fill;
}

.prank-text p {
  margin: 0 auto;
  max-width: min(30em, 84%);
  font: 400 clamp(14px, 1.6vw, 24px)/1.5 var(--sans);
  color: #d9d1dc;
}

.prank-item[data-type="embed"] iframe,
.prank-item[data-type="video"] video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

/* ============ 结尾 ============ */

#wasted {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: clamp(14px, 2.4vh, 30px);
  background:
    radial-gradient(120% 100% at 50% 50%, rgba(120, 8, 22, .28), transparent 62%),
    #08060b;
  animation: wastedIn .9s ease both;
}

@keyframes wastedIn { from { opacity: 0; filter: blur(6px) } to { opacity: 1; filter: none } }

#wasted::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 3px);
  opacity: .5;
  mix-blend-mode: overlay;
}

.wasted-title {
  position: relative;
  margin: 0;
  font: 700 clamp(56px, 15cqw, 210px)/.86 var(--cond);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #f1e9ef;
  transform: skewX(-7deg);
  text-shadow: 0 0 6px rgba(255, 255, 255, .25), 0 10px 42px rgba(196, 37, 45, .55);
}

.wasted-title span {
  display: block;
  background: linear-gradient(182deg, #fff 6%, #ff8d9b 48%, #a3101c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: .035em rgba(10, 4, 8, .9);
  paint-order: stroke fill;
}

.wasted-sub {
  margin: 0;
  font: 400 clamp(13px, 1.4vw, 20px)/1.4 var(--sans);
  color: #cbc1cf;
  text-align: center;
  padding: 0 6cqw;
}

.wasted-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}

.wasted-actions button,
.wasted-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 2px solid #ffffff59;
  background: #17111bd9;
  color: #fff;
  font: 500 18px/1 var(--cond);
  text-transform: uppercase;
  letter-spacing: .08em;
  cursor: pointer;
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease;
}

.wasted-actions button:hover,
.wasted-actions a:hover { background: #322334; border-color: #fff; }

.wasted-note {
  position: absolute;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 0; right: 0;
  margin: 0;
  text-align: center;
  font: 400 11px/1.5 var(--sans);
  color: #7d7482;
}

/* ============ 影院页脚 ============ */

#cinema-footer {
  --footer-inset: max(calc(28px * var(--scale, 1)), env(safe-area-inset-bottom, 0px));
  position: absolute;
  z-index: 6;
  inset: auto 0 0;
  min-height: var(--cinema-footer);
  pointer-events: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  column-gap: 12px;
  padding-bottom: var(--footer-inset);
  padding-right: max(3.6cqw, 44px, env(safe-area-inset-right, 0px), calc(50% - (960px - 24px) * var(--scale, 1)));
  padding-left: max(2cqw, env(safe-area-inset-left, 0px));
}

#cinema-controls {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  column-gap: calc(17px * var(--text));
}

.prompt {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: .4em;
  padding: 5px 0;
  font: 500 calc(22.5px * var(--text))/1 var(--cond);
  letter-spacing: 1.05px;
  text-transform: uppercase;
  color: #f6f6f4;
  text-decoration: none;
  white-space: nowrap;
  background: none;
  border: 0;
}

.prompt:hover { color: #ffd7e6; text-decoration: none; }

.prompt .button-label { -webkit-text-stroke: .15em #000; paint-order: stroke fill; }

.x-logo {
  display: block;
  height: .85em;
  width: auto;
  flex: none;
  stroke: #000;
  stroke-width: 100;
  paint-order: stroke fill;
  overflow: visible;
}

#visitor-count {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  display: grid;
  justify-items: start;
  row-gap: 6px;
  color: var(--paper);
  font: 500 clamp(19px, 1.55cqw, 30px)/1 var(--cond);
  font-variant-numeric: tabular-nums;
  -webkit-text-stroke: .13em #000;
  paint-order: stroke fill;
}

#visitor-count .visitor-label {
  font-size: clamp(11px, .72cqw, 14px);
  letter-spacing: .06em;
  color: #faf8fa;
}

#visitor-presence {
  font-size: clamp(12px, 1.05cqw, 18px);
  white-space: nowrap;
  color: #faf8fa;
}

/* ============ 提示 & 工具 ============ */

#toast {
  position: absolute;
  z-index: 7;
  bottom: var(--cinema-footer, 44px);
  left: 50%;
  translate: -50% 0;
  pointer-events: none;
  background: #2d2133;
  border: 1px solid #a288aa;
  border-radius: 3px;
  padding: 10px 17px;
  font-size: 15px;
}

#prank-tools {
  position: absolute;
  z-index: 7;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
  opacity: .9;
}

#prank-tools button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #ffffff40;
  border-radius: 4px;
  background: #100c17b8;
  color: #e7e1ea;
  font: 500 12px/1 var(--cond);
  letter-spacing: .08em;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

#prank-tools svg { width: 16px; height: 16px; fill: currentColor; stroke: currentColor; stroke-width: 0; }

#mute-toggle { fill: currentColor; stroke: currentColor; stroke-width: 0; }
#mute-toggle .mute-line { display: none; stroke-width: 2; fill: none; }
#mute-toggle .waves { fill: none; stroke-width: 2; }
#mute-toggle[data-muted="1"] .mute-line { display: block; }
#mute-toggle[data-muted="1"] .waves { display: none; }

/* 参考站的全屏键只在触屏设备上出现：桌面视口一律不显示 */
#fullscreen-tools {
  position: fixed;
  z-index: 8;
  top: max(8px, env(safe-area-inset-top, 0px));
  right: max(10px, env(safe-area-inset-right, 0px));
  display: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

@media (pointer: coarse) {
  #fullscreen-tools { display: flex; }
}

#fullscreen-toggle {
  width: 44px; height: 44px;
  padding: 9px;
  display: grid; place-items: center;
  color: #fff;
  background: none;
  border: 0;
  cursor: pointer;
  opacity: .6;
  transition: opacity .2s ease;
}

#fullscreen-toggle svg {
  box-sizing: content-box;
  width: 19px; height: 19px;
  padding: 5px;
  background: #1b1520df;
  border: 1px solid #b4a9b8;
}

#fullscreen-toggle:hover { opacity: 1; }

#fullscreen-toggle .collapse { display: none; }
body.is-fullscreen #fullscreen-toggle .collapse { display: inline; }
body.is-fullscreen #fullscreen-toggle .expand { display: none; }


/* ============ 弹窗 ============ */

#rotate-screen {
  position: fixed;
  z-index: 20;
  inset: 0;
  margin: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  border: 0;
  padding: 0;
  background: #15101c;
  color: var(--paper);
}

#rotate-screen::backdrop { background: #15101c; }

.rotate-message {
  height: 100%;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 22px;
  padding: 24px;
  text-align: center;
}

.rotate-icon { width: min(38vw, 150px); height: auto; }

#rotate-title {
  margin: 0;
  font: 500 clamp(26px, 7vw, 54px)/1 var(--cond);
  text-transform: uppercase;
  letter-spacing: .06em;
}

#font-error {
  position: fixed;
  z-index: 12;
  left: 50%;
  bottom: 14px;
  translate: -50% 0;
  margin: 0;
  padding: 8px 14px;
  background: #2d2133;
  border: 1px solid #a288aa;
  font-size: 13px;
  color: #f2ecf4;
}

#font-error a { color: #ffd7e6; }

/* ============ 响应式 ============ */

@media (max-width: 960px) {
  .launch-play { left: 0; right: 0; justify-content: center; bottom: calc(var(--footer-baseline) + 26px); }
  .launch-play > button { translate: none; padding: 12px 18px; gap: 10px; font-size: 20px; }
  .launch-play small { position: absolute; right: 8px; bottom: -34px; max-width: 26ch; font-size: 10.5px; white-space: nowrap; }
  .launch-strip > span { font-size: 12px; letter-spacing: 1px; left: 12px; }
  #cinema-controls { column-gap: 10px; }
  .prompt { font-size: 15px; }
  #prank-tools { top: 8px; right: 8px; }
  #toast { bottom: 104px; }
}

@media (prefers-reduced-motion: reduce) {
  .loading-art img { transition: opacity 1.2s ease; transform: none !important; }
  .loading-spinner { animation-duration: 1.6s; }
  .launch-play > button { animation: none; }
  .prank-item[data-type="image"] .prank-media { animation: none; }
  #wasted { animation: none; }
}

/* 整蛊段角标：提醒观众这只是一个玩笑 */
.joke-badge {
  position: absolute;
  top: 18px;
  left: 22px;
  z-index: 6;
  padding: 6px 12px 5px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(10, 6, 16, .55);
  color: rgba(255, 255, 255, .72);
  font: 600 11px/1 var(--font-ui, system-ui, sans-serif);
  letter-spacing: .16em;
  text-transform: uppercase;
  pointer-events: none;
  backdrop-filter: blur(6px);
}
@media (max-width: 620px) {
  .joke-badge { top: 12px; left: 14px; font-size: 10px; padding: 5px 9px 4px; }
}

/* 结局页二维码：宽屏贴右侧竖排，窄屏回到中间（避免压到页脚） */
.share-qr {
  position: absolute;
  right: clamp(16px, 3vw, 52px);
  top: auto;
  bottom: calc(var(--cinema-footer, 64px) + 46px);
  margin: 0;
  width: min(300px, 84vw);
  padding: 14px 16px 16px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .04);
  text-align: center;
}
.share-qr .qr-head { font: 600 12px/1.4 var(--font-ui, system-ui, sans-serif); letter-spacing: .12em; color: rgba(255,255,255,.7); text-transform: uppercase; }
.share-qr .qr-code { display: block; width: 162px; height: 162px; margin: 10px auto 8px; padding: 6px; background: #fff; border-radius: 4px; }
.share-qr .qr-code svg { display: block; width: 100%; height: 100%; }
.share-qr .qr-url { display: block; font: 400 12px/1.4 ui-monospace, monospace; color: rgba(255,255,255,.6); word-break: break-all; }
.share-qr .qr-copy { margin-top: 10px; }
.share-qr.is-failed .qr-code { display: none; }

@media (max-width: 1099px) {
  .share-qr { position: static; transform: none; margin: 4px auto 0; }
  #wasted { padding-bottom: calc(var(--cinema-footer, 64px) + 26px); overflow-y: auto; }
}

/* 短屏（手机横屏 / 笔记本缩放 150%）：压缩结局页，别让二维码压到页脚 */
@media (max-height: 640px) {
  .wasted-sub,
  .wasted-note { display: none; }
  #wasted { gap: 10px; padding-bottom: calc(var(--cinema-footer, 64px) + 12px); }
  .share-qr { width: min(260px, 80vw); padding: 10px 12px 12px; }
  .share-qr .qr-code { width: 126px; height: 126px; margin: 6px auto; }
  .share-qr .qr-url { display: none; }
  .share-qr .qr-copy { margin-top: 6px; }
}

/* 微信内提示条 */
.wechat-tip {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 60;
  padding: 12px 18px;
  border-radius: 10px;
  background: rgba(18, 10, 24, .92);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #fff;
  font: 500 13px/1.5 var(--font-ui, system-ui, sans-serif);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .45);
  transition: opacity .4s ease, transform .4s ease;
}
.wechat-tip.is-out { opacity: 0; transform: translate(-50%, 10px); pointer-events: none; }

/* 竖屏/窄屏时整蛊视频铺满画框，不留上下黑边 */
@media (max-aspect-ratio: 3/4) {
  .prank-media { width: 100%; height: 100%; object-fit: cover; }
}


.rotate-hint {
  margin: -8px 0 0;
  max-width: 300px;
  font: 400 14px/1.5 var(--sans, system-ui, sans-serif);
  color: rgba(255, 255, 255, .55);
}

.rotate-skip {
  padding: 10px 18px;
  font: 600 12px/1 var(--sans, system-ui, sans-serif);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .72);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 2px;
  cursor: pointer;
}

.rotate-skip:hover { color: #fff; border-color: rgba(255, 255, 255, .5); }
