:root {
  color-scheme: dark;
  --ink: #f6f4ed;
  --muted: #a9b2ad;
  --night: #101714;
  --night-2: #16211c;
  --panel: rgba(31, 43, 37, .9);
  --panel-soft: rgba(246, 244, 237, .06);
  --line: rgba(246, 244, 237, .14);
  --amber: #f3a329;
  --amber-deep: #b45309;
  --amber-soft: rgba(243, 163, 41, .14);
  --green: #49d17d;
  --green-soft: rgba(73, 209, 125, .14);
  --red: #ff6b62;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 0, #29372f 0, transparent 34rem),
    #090d0b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button, input { font: inherit; }

.player-shell { width: min(1280px, 100%); }

.stage {
  position: relative;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  isolation: isolate;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 20px;
  background:
    linear-gradient(130deg, rgba(243,163,41,.035), transparent 42%),
    linear-gradient(180deg, #121a16 0%, #0d1411 100%);
  box-shadow: 0 35px 90px rgba(0,0,0,.55);
}

.ambient {
  position: absolute;
  z-index: -3;
  width: 38%;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .12;
  pointer-events: none;
}

.ambient-a { top: -18%; left: -8%; background: var(--amber); }
.ambient-b { right: -12%; bottom: -25%; background: var(--green); }

.grain {
  position: absolute;
  z-index: 20;
  inset: 0;
  opacity: .035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.film-brand {
  position: absolute;
  z-index: 30;
  top: 4.2%;
  left: 4.2%;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(10px, 1.2vw, 16px);
  font-weight: 700;
  letter-spacing: -.01em;
}

.wall-logo {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 7px);
  grid-auto-rows: 5px;
  gap: 2px;
  width: 34px;
  height: 29px;
  padding: 6px 5px;
  border-radius: 7px;
  background: #202a25;
  box-shadow: 0 0 0 1px rgba(243,163,41,.25), 0 6px 18px rgba(0,0,0,.25);
}

.wall-logo i { display: block; border-radius: 1px; background: var(--amber); }
.wall-logo i:nth-child(1) { grid-column: span 2; }
.wall-logo i:nth-child(2) { grid-column: span 2; }
.wall-logo i:nth-child(3) { grid-column: span 1; margin-left: 3px; }
.wall-logo i:nth-child(4) { grid-column: span 2; }
.wall-logo i:nth-child(5) { grid-column: span 1; }
.wall-logo i:nth-child(6) { grid-column: span 2; }
.wall-logo i:nth-child(7) { grid-column: span 2; }

.scene {
  position: absolute;
  z-index: 1;
  inset: 0;
  padding: 8.8% 7% 7%;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.018);
  transition: opacity .55s ease, transform .7s ease, visibility 0s linear .7s;
  pointer-events: none;
}

.scene.active {
  z-index: 5;
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  transition-delay: 0s;
}

.eyebrow {
  margin: 0 0 .6em;
  color: var(--amber);
  font-size: clamp(10px, 1.08vw, 14px);
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.scene-heading { position: relative; z-index: 2; text-align: center; }
.scene-heading h2, .expire-copy h2 {
  margin: 0;
  font-size: clamp(23px, 3vw, 43px);
  line-height: 1.2;
  letter-spacing: -.045em;
}
.compact-heading h2 { font-size: clamp(22px, 2.5vw, 36px); }

.scene-intro { display: flex; align-items: center; }
.intro-copy { position: relative; z-index: 2; width: 58%; margin-left: 1%; }
.intro-copy h1 {
  margin: 0;
  font-size: clamp(30px, 4.8vw, 68px);
  line-height: 1.11;
  letter-spacing: -.055em;
}
.intro-copy h1 em { color: var(--amber); font-style: normal; }
.lead {
  margin: 1.5em 0 0;
  color: var(--muted);
  font-size: clamp(12px, 1.5vw, 20px);
}

.intro-wall {
  position: absolute;
  top: 0;
  right: 0;
  width: 45%;
  height: 100%;
  opacity: .9;
  perspective: 900px;
}

.wall-grid {
  position: absolute;
  inset: -8% -8% -8% 0;
  transform: rotateY(-18deg) translateX(12%);
  transform-origin: right center;
  background:
    linear-gradient(90deg, rgba(255,255,255,.055) 0 2px, transparent 2px) 0 0 / 86px 52px,
    linear-gradient(90deg, rgba(255,255,255,.055) 0 2px, transparent 2px) 43px 26px / 86px 52px,
    linear-gradient(rgba(255,255,255,.055) 0 2px, transparent 2px) 0 0 / 100% 26px,
    linear-gradient(135deg, #253029, #131b17);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%);
  mask-image: linear-gradient(90deg, transparent, #000 25%);
}

.intro-door {
  position: absolute;
  top: 27%;
  right: 17%;
  display: grid;
  place-items: center;
  width: 34%;
  aspect-ratio: .75;
  border: 4px solid var(--amber);
  border-bottom: 0;
  border-radius: 80px 80px 8px 8px;
  background: #0c120f;
  box-shadow: 0 0 30px rgba(243,163,41,.2), inset 0 0 30px rgba(243,163,41,.1);
}

.intro-door span { color: var(--amber); font-weight: 900; font-size: clamp(18px, 3vw, 40px); letter-spacing: .08em; }
.door-glow {
  position: absolute;
  inset: 17% 15% 0;
  background: linear-gradient(180deg, rgba(243,163,41,.22), transparent);
  filter: blur(22px);
}

.scene-intro.active .intro-copy { animation: rise .8s .15s both; }
.scene-intro.active .intro-wall { animation: wall-arrive 1.1s .1s both; }

.network-map {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr 1.2fr 1fr;
  align-items: center;
  gap: 1.2%;
  width: 90%;
  height: 48%;
  margin: 4% auto 0;
}

.actor, .firewall-node, .server-rack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.actor b, .firewall-node b, .server-rack b, .flow-node b {
  margin-top: .8em;
  font-size: clamp(12px, 1.35vw, 18px);
}

.actor code, .server-rack small, .firewall-node small, .flow-node code, .flow-node small {
  margin-top: .3em;
  color: var(--muted);
  font: clamp(8px, .95vw, 13px)/1.4 var(--mono);
}

.avatar {
  display: grid;
  place-items: center;
  width: clamp(58px, 7vw, 96px);
  aspect-ratio: 1;
  border-radius: 50%;
  font-weight: 800;
  font-size: clamp(18px, 2.3vw, 32px);
}
.danger-avatar { color: var(--red); border: 1px solid rgba(255,107,98,.5); background: rgba(255,107,98,.1); }
.ok-avatar { color: var(--green); border: 1px solid rgba(73,209,125,.5); background: rgba(73,209,125,.1); }

.route {
  position: relative;
  height: 2px;
  background: rgba(255,255,255,.12);
}
.route::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -1px;
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}
.route-blocked { color: var(--red); background: linear-gradient(90deg, rgba(255,107,98,.75), rgba(255,107,98,.2)); }
.route-muted { color: rgba(255,255,255,.12); }
.route-open { color: var(--green); background: linear-gradient(90deg, rgba(73,209,125,.8), rgba(73,209,125,.25)); box-shadow: 0 0 14px rgba(73,209,125,.28); }

.packet {
  position: absolute;
  top: -4px;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
  opacity: 0;
}
.block-sign {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: -8px;
  display: grid;
  place-items: center;
  width: clamp(28px, 3vw, 42px);
  aspect-ratio: 1;
  color: white;
  border-radius: 50%;
  background: var(--red);
  font-size: clamp(18px, 2.3vw, 30px);
  transform: translate(50%, -50%);
  box-shadow: 0 0 25px rgba(255,107,98,.35);
}

.brick-shield {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 18px);
  grid-auto-rows: 14px;
  gap: 4px;
  width: clamp(78px, 8.2vw, 112px);
  height: clamp(78px, 8.2vw, 112px);
  padding: 18% 11%;
  overflow: hidden;
  border: 1px solid rgba(243,163,41,.38);
  border-radius: 46% 46% 54% 54% / 33% 33% 66% 66%;
  background: var(--amber-soft);
}
.brick-shield span { border-radius: 2px; background: var(--amber); }
.brick-shield span:nth-child(1), .brick-shield span:nth-child(2), .brick-shield span:nth-child(6), .brick-shield span:nth-child(7) { grid-column: span 2; }
.brick-shield span:nth-child(3) { grid-column: span 1; margin-left: 10px; }
.brick-shield span:nth-child(4) { grid-column: span 2; }
.brick-shield span:nth-child(5) { grid-column: span 1; }

.server-rack {
  justify-content: flex-start;
  width: clamp(84px, 9vw, 120px);
  min-height: clamp(100px, 10vw, 140px);
  margin: auto;
  padding: 20px 12px 12px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  background:
    repeating-linear-gradient(0deg, transparent 0 24%, rgba(255,255,255,.09) 24% 26%),
    linear-gradient(140deg, #27342d, #18211c);
  box-shadow: 0 18px 35px rgba(0,0,0,.28);
}
.rack-light {
  position: absolute;
  right: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
}
.rack-light:nth-child(1) { top: 18%; }
.rack-light:nth-child(2) { top: 44%; }
.rack-light:nth-child(3) { top: 70%; }
.server-rack b { margin-top: auto; }

.fact-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: 90%;
  padding: 10px 18px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  font-size: clamp(9px, 1vw, 13px);
}
.chip-bottom { margin: 1.8% auto 0; }
.chip-icon { display: grid; place-items: center; width: 20px; height: 20px; color: var(--green); border-radius: 50%; background: var(--green-soft); }

.scene-problem.active .outsider { animation: rise .55s .1s both; }
.scene-problem.active .firewall-node { animation: rise .55s .45s both; }
.scene-problem.active .server-rack { animation: rise .55s .8s both; }
.scene-problem.active .route-blocked .packet { animation: packet-block 1.9s infinite; }
.scene-problem.active .route-blocked .p2 { animation-delay: .55s; }
.scene-problem.active .route-blocked .p3 { animation-delay: 1.1s; }
.scene-problem.active .block-sign { animation: block-pulse 1.3s .8s infinite; }

.browser-frame {
  width: 86%;
  height: 65%;
  margin: 2.4% auto 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  background: #edf0e9;
  box-shadow: 0 25px 60px rgba(0,0,0,.32);
}
.browser-top {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 10%;
  min-height: 28px;
  padding: 0 2%;
  color: #647067;
  background: #dfe4dc;
  border-bottom: 1px solid #ccd2c8;
  font-size: clamp(9px, .9vw, 12px);
}
.browser-top i { width: 8px; height: 8px; border-radius: 50%; background: #a9b0aa; }
.browser-top span { flex: 1; margin-left: 1%; padding: .55em 1em; border-radius: 5px; background: #f8faf6; }
.browser-top b { color: #298447; font-weight: 600; }
.allow-layout {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  height: 90%;
  padding: 2% 7%;
  color: #1d231f;
  background: radial-gradient(circle at 26% 0, rgba(180,83,9,.11), transparent 34%), #f1f2ec;
}
.allow-card {
  position: relative;
  width: 62%;
  min-width: 230px;
  height: 95%;
  margin: auto;
  padding: 12% 7% 5%;
  border: 1px solid #c8cec1;
  border-radius: 11px;
  background: white;
  box-shadow: 0 12px 28px rgba(29,35,31,.15);
}
.brick-cap {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: 14%;
  border-radius: 10px 10px 0 0;
  background:
    linear-gradient(90deg, #d3d7cb 0 2px, transparent 2px) 0 0 / 52px 20px,
    linear-gradient(90deg, #d3d7cb 0 2px, transparent 2px) 26px 20px / 52px 20px,
    linear-gradient(#d3d7cb 0 2px, transparent 2px) 0 19px / 100% 20px,
    #e6e8e0;
}
.mini-logo {
  display: grid;
  place-items: center;
  width: clamp(20px, 2.5vw, 32px);
  aspect-ratio: 1;
  color: white;
  border-radius: 6px;
  background: var(--amber-deep);
  font-size: clamp(7px, .72vw, 10px);
  font-weight: 800;
}
.allow-card > p { margin: 0 0 1%; text-align: center; color: #68736c; font-size: clamp(9px, .88vw, 12px); }
.allow-card h3 { margin: 0; text-align: center; font-size: clamp(12px, 1.4vw, 19px); }
.allow-card > small { display: block; margin: 1% 0 4%; text-align: center; color: #68736c; font-size: clamp(8px, .8vw, 11px); }
.ip-field { padding: 3% 5%; border: 1px solid rgba(180,83,9,.35); border-radius: 6px; background: rgba(180,83,9,.08); }
.ip-field span { display: block; color: #68736c; font-size: clamp(8px, .8vw, 11px); }
.ip-field strong { color: #96490a; font: 600 clamp(10px, 1.2vw, 16px)/1.4 var(--mono); }
.allow-card label { display: block; margin-top: 3%; font-size: clamp(8px, .82vw, 11px); font-weight: 700; }
.fake-input { display: block; height: clamp(15px, 2vw, 28px); margin-top: 2%; overflow: hidden; border: 1px solid #c8cec1; border-radius: 5px; background: #f1f2ec; }
.fake-input i { display: block; height: 100%; padding: 2% 5%; font: normal clamp(7px, .75vw, 11px)/1.5 var(--mono); }
.typed-code::after { content: ""; }
.typed-secret::after { content: ""; letter-spacing: .2em; }
.fake-submit { width: 100%; height: clamp(18px, 2.3vw, 32px); margin-top: 4%; color: white; border: 0; border-radius: 5px; background: var(--amber-deep); font-size: clamp(8px, .82vw, 11px); font-weight: 800; }
.cursor-hand {
  position: absolute;
  right: 11%;
  bottom: 7%;
  width: 10px;
  height: 10px;
  color: transparent;
  border: 2px solid #1d231f;
  border-radius: 50%;
  opacity: 0;
}
.request-notes { display: grid; gap: 8%; padding-left: 6%; }
.note-card { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6%; opacity: 0; }
.note-card > span { color: var(--amber-deep); font: 700 clamp(13px, 1.8vw, 25px)/1 var(--mono); }
.note-card p { margin: 0; color: #68736c; font-size: clamp(8px, .9vw, 12px); }
.note-card b { color: #1d231f; font-size: clamp(9px, 1vw, 14px); }

.scene-request.active .browser-frame { animation: rise .65s .1s both; }
.scene-request.active .typed-code::after { animation: type-code 1.1s 1.2s steps(4, end) forwards; }
.scene-request.active .typed-secret::after { animation: type-secret 1.2s 2.6s steps(6, end) forwards; }
.scene-request.active .cursor-hand { animation: cursor-click 1.1s 4s both; }
.scene-request.active .fake-submit { animation: submit-flash .5s 4.55s both; }
.scene-request.active .note-one { animation: slide-left .5s 1.2s both; }
.scene-request.active .note-two { animation: slide-left .5s 2.2s both; }
.scene-request.active .note-three { animation: slide-left .5s 3.2s both; }

.sync-flow {
  display: grid;
  grid-template-columns: 1fr .9fr 1.25fr .9fr 1fr;
  align-items: center;
  width: 88%;
  height: 39%;
  margin: 4.2% auto 0;
}
.flow-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 78%;
  padding: 8%;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.045);
  box-shadow: 0 16px 35px rgba(0,0,0,.18);
}
.central-node { border-color: rgba(243,163,41,.35); background: var(--amber-soft); }
.node-icon { display: grid; place-items: center; width: clamp(34px, 4vw, 54px); aspect-ratio: 1; border-radius: 50%; }
.user-icon { position: relative; border: 1px solid rgba(255,255,255,.2); }
.user-icon::before { content: ""; position: absolute; top: 18%; width: 28%; aspect-ratio: 1; border-radius: 50%; background: var(--ink); }
.user-icon::after { content: ""; position: absolute; bottom: 15%; width: 58%; height: 32%; border-radius: 30px 30px 10px 10px; background: var(--ink); }
.dw-icon { color: #fff; border-radius: 11px; background: var(--amber-deep); font-size: clamp(10px, 1.2vw, 16px); font-weight: 900; }
.pulse-icon { border: 1px solid rgba(73,209,125,.45); background: var(--green-soft); }
.pulse-icon i { width: 38%; aspect-ratio: 1; border-radius: 50%; background: var(--green); box-shadow: 0 0 20px rgba(73,209,125,.7); }
.allow-row { display: flex; align-items: center; gap: 6px; margin-top: 7%; padding: 5px 7px; border-radius: 6px; background: rgba(0,0,0,.18); }
.allow-row i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.allow-row code { margin: 0; color: var(--ink); font-size: clamp(6px, .7vw, 10px); }
.allow-row em { padding: 2px 4px; color: var(--green); border-radius: 3px; background: var(--green-soft); font-size: clamp(5px, .55vw, 8px); font-style: normal; }
.health-pill { margin-top: 7%; padding: 4px 7px; color: var(--green); border-radius: 999px; background: var(--green-soft); font-size: clamp(6px, .65vw, 9px); }
.flow-link { position: relative; height: 2px; background: rgba(243,163,41,.26); }
.flow-link::after { content: ""; position: absolute; top: -3px; right: 0; width: 7px; height: 7px; border-top: 2px solid var(--amber); border-right: 2px solid var(--amber); transform: rotate(45deg); }
.flow-link i { position: absolute; top: -4px; left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px var(--amber); opacity: 0; }
.flow-link span { position: absolute; top: 11px; left: 50%; width: max-content; color: var(--muted); font-size: clamp(6px, .65vw, 9px); transform: translateX(-50%); }
.fact-grid { display: grid; grid-template-columns: repeat(3, 1fr); width: 78%; margin: 2% auto 0; }
.fact-grid > div { padding: 0 7%; text-align: center; border-left: 1px solid var(--line); }
.fact-grid > div:first-child { border-left: 0; }
.fact-grid b, .fact-grid span { display: block; }
.fact-grid b { font-size: clamp(8px, .92vw, 12px); }
.fact-grid span { margin-top: .3em; color: var(--muted); font-size: clamp(6px, .7vw, 10px); }

.scene-sync.active .client-node { animation: rise .5s .1s both; }
.scene-sync.active .central-node { animation: rise .5s .8s both; }
.scene-sync.active .agent-node { animation: rise .5s 1.6s both; }
.scene-sync.active .link-one i { animation: flow-packet 1.1s .5s both; }
.scene-sync.active .link-two i { animation: flow-packet 1.1s 1.3s infinite; }
.scene-sync.active .pulse-icon { animation: soft-pulse 1.5s 2s infinite; }

.success-eyebrow { color: var(--green); }
.open-shield { border-color: rgba(73,209,125,.5); background: var(--green-soft); box-shadow: 0 0 30px rgba(73,209,125,.14); }
.open-shield span { background: var(--green); }
.live-rack .rack-light { background: var(--green); box-shadow: 0 0 9px rgba(73,209,125,.7); }
.success-toast {
  position: absolute;
  left: 50%;
  bottom: 8.2%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 33%;
  padding: 12px 18px;
  border: 1px solid rgba(73,209,125,.38);
  border-radius: 10px;
  background: rgba(19,42,29,.94);
  box-shadow: 0 18px 45px rgba(0,0,0,.3);
  opacity: 0;
  transform: translate(-50%, 20px);
}
.success-toast > span { display: grid; place-items: center; width: 28px; aspect-ratio: 1; color: #0d1411; border-radius: 50%; background: var(--green); font-weight: 900; }
.success-toast b, .success-toast small { display: block; }
.success-toast b { color: var(--green); font-size: clamp(9px, 1vw, 14px); }
.success-toast small { margin-top: .25em; color: var(--muted); font-size: clamp(7px, .75vw, 10px); }

.scene-success.active .customer-actor { animation: rise .5s .1s both; }
.scene-success.active .open-node { animation: rise .5s .5s both; }
.scene-success.active .live-rack { animation: rise .5s .9s both; }
.scene-success.active .route-open .packet { animation: packet-open 1.45s infinite; }
.scene-success.active .route-open .p2 { animation-delay: .45s; }
.scene-success.active .route-open .p3 { animation-delay: .9s; }
.scene-success.active .success-toast { animation: toast-up .55s 2.1s both; }

.scene-expire { display: flex; align-items: center; gap: 8%; padding-left: 9%; padding-right: 9%; }
.expire-copy { width: 53%; }
.expire-copy > p:not(.eyebrow) { max-width: 90%; color: var(--muted); font-size: clamp(10px, 1.2vw, 16px); line-height: 1.75; }
.safety-row { display: flex; gap: 4%; margin-top: 7%; }
.safety-row span { padding: 7px 10px; color: var(--green); border-radius: 6px; background: var(--green-soft); font-size: clamp(7px, .78vw, 11px); }
.clock-visual { position: relative; width: 34%; aspect-ratio: 1; }
.clock-ring {
  position: absolute;
  top: 3%;
  right: 4%;
  width: 74%;
  aspect-ratio: 1;
  border: 2px solid rgba(243,163,41,.55);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(243,163,41,.12), transparent 65%);
  box-shadow: 0 0 60px rgba(243,163,41,.1), inset 0 0 40px rgba(243,163,41,.08);
}
.clock-ring::before {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.35) 0 1deg, transparent 1deg 30deg);
  -webkit-mask: radial-gradient(circle, transparent 64%, #000 65% 69%, transparent 70%);
  mask: radial-gradient(circle, transparent 64%, #000 65% 69%, transparent 70%);
}
.clock-hand { position: absolute; left: 50%; bottom: 50%; width: 2px; border-radius: 2px; background: var(--amber); transform-origin: bottom; }
.hour-hand { height: 27%; transform: rotate(354deg); }
.minute-hand { height: 36%; transform: rotate(342deg); }
.clock-center { position: absolute; top: 50%; left: 50%; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); transform: translate(-50%, -50%); }
.clock-ring b { position: absolute; left: 50%; bottom: 19%; font: 700 clamp(10px, 1.25vw, 17px)/1 var(--mono); transform: translateX(-50%); }
.ttl-card {
  position: absolute;
  left: 0;
  bottom: 3%;
  width: 72%;
  padding: 6%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(31,43,37,.96);
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
}
.ttl-card span, .ttl-card code, .ttl-card strong { display: block; }
.ttl-card span { color: var(--muted); font-size: clamp(7px, .78vw, 11px); }
.ttl-card code { margin-top: 3%; font-size: clamp(8px, .9vw, 12px); }
.ttl-value { margin-top: 6%; color: var(--amber); font: 700 clamp(14px, 2vw, 28px)/1 var(--mono); }
.ttl-bar { height: 4px; margin-top: 9%; overflow: hidden; border-radius: 5px; background: rgba(255,255,255,.08); }
.ttl-bar i { display: block; width: 100%; height: 100%; background: linear-gradient(90deg, var(--red), var(--amber)); transform-origin: left; }
.scene-expire.active .expire-copy { animation: rise .6s .1s both; }
.scene-expire.active .clock-visual { animation: rise .6s .5s both; }
.scene-expire.active .minute-hand { animation: clock-tick 5s .7s linear forwards; }
.scene-expire.active .ttl-bar i { animation: ttl-drain 5s .7s linear forwards; }
.scene-expire.active .ttl-value { animation: ttl-alert .8s 4.7s both; }

.admin-window {
  width: 88%;
  height: 57%;
  margin: 2.4% auto 0;
  overflow: hidden;
  color: #1d231f;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 12px;
  background: #f1f2ec;
  box-shadow: 0 25px 60px rgba(0,0,0,.32);
}
.admin-topbar {
  display: flex;
  align-items: center;
  gap: 1%;
  height: 17%;
  padding: 0 2%;
  background:
    linear-gradient(90deg, #d3d7cb 0 1px, transparent 1px) 0 0 / 52px 23px,
    linear-gradient(#d3d7cb 0 1px, transparent 1px) 0 22px / 100% 23px,
    #e6e8e0;
  border-bottom: 1px solid #c8cec1;
  font-size: clamp(6px, .72vw, 10px);
}
.admin-topbar > b { font-size: clamp(8px, .9vw, 12px); }
.admin-topbar nav { display: flex; align-self: stretch; margin-left: 5%; }
.admin-topbar nav i { display: grid; place-items: center; padding: 0 1.4vw; color: #5d6a62; border-bottom: 2px solid transparent; font-style: normal; }
.admin-topbar nav i.selected { color: #96490a; border-bottom-color: #b45309; font-weight: 700; }
.admin-topbar > button { margin-left: auto; color: #4f5a53; border: 1px solid #c8cec1; border-radius: 5px; background: transparent; font-size: inherit; }
.admin-main { height: 83%; padding: 2% 3%; }
.admin-title { display: flex; align-items: center; justify-content: space-between; }
.admin-title b { font-size: clamp(8px, .95vw, 13px); }
.admin-title button { padding: .5em 1em; color: #fff; border: 0; border-radius: 5px; background: #b45309; font-size: clamp(6px, .62vw, 9px); }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 1.5%; padding-bottom: 1.5%; border-bottom: 1px solid #dde1d7; }
.stats-row > div { display: flex; flex-direction: column-reverse; padding-left: 6%; border-left: 1px solid #dde1d7; }
.stats-row > div:first-child { padding-left: 0; border-left: 0; }
.stats-row span { color: #5d6a62; font-size: clamp(5px, .58vw, 8px); }
.stats-row b { font: 600 clamp(12px, 1.7vw, 23px)/1.1 var(--mono); }
.green-dot, .red-dot { display: inline-block; width: 5px; height: 5px; margin-right: 4px; border-radius: 50%; }
.green-dot { background: #15803d; }
.red-dot { background: #dc2626; }
.admin-table { margin-top: 1.5%; overflow: hidden; border: 1px solid #dde1d7; border-radius: 6px; background: #fff; }
.table-row { display: grid; grid-template-columns: 1.25fr .6fr 1.25fr .8fr .55fr 1fr; align-items: center; min-height: clamp(24px, 3.3vw, 42px); border-top: 1px solid #e6e9e1; font-size: clamp(5px, .63vw, 9px); }
.table-row:first-child { border-top: 0; }
.table-row > span { padding: 0 7%; }
.table-head { color: #5d6a62; background: #f7f8f4; font-weight: 700; }
.table-row button { padding: .35em .6em; color: #96490a; border: 1px solid #c8cec1; border-radius: 4px; background: #fff; font-size: inherit; }
.table-row button:disabled { color: #9aa29c; }
.port-pill { padding: .3em .5em; color: #96490a; border-radius: 4px; background: rgba(180,83,9,.08); font-style: normal; }
.highlight-row { position: relative; }
.highlight-row::after { content: ""; position: absolute; inset: 0; pointer-events: none; border: 2px solid rgba(243,163,41,.8); opacity: 0; }
.active-count { color: #15803d; font-weight: 800; }
.admin-features { display: flex; justify-content: center; gap: 1.5%; margin-top: 1.7%; }
.admin-features span { padding: .55em 1em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; font-size: clamp(6px, .68vw, 9px); }
.scene-admin.active .admin-window { animation: rise .65s .1s both; }
.scene-admin.active .highlight-row::after { animation: row-highlight 1.8s 1.5s both; }
.scene-admin.active .active-count { animation: count-pop .7s 2s both; }

.scene-outro { display: grid; place-items: center; text-align: center; }
.outro-lockup { display: flex; flex-direction: column; align-items: center; }
.large-logo { transform: scale(1.8); margin-bottom: 4%; }
.outro-lockup h2 { margin: 0; font-size: clamp(36px, 5vw, 72px); letter-spacing: -.055em; }
.outro-lockup p { margin: .35em 0 0; color: var(--amber); font-size: clamp(12px, 1.7vw, 23px); font-weight: 700; letter-spacing: .08em; }
.outro-line { width: 0; height: 1px; margin: 6% auto 4%; background: linear-gradient(90deg, transparent, var(--amber), transparent); }
.outro-lockup small { color: var(--muted); font-size: clamp(9px, 1.1vw, 15px); opacity: 0; }
.scene-outro.active .outro-lockup { animation: rise .7s .15s both; }
.scene-outro.active .outro-line { animation: line-grow 1s .7s both; }
.scene-outro.active .outro-lockup small { animation: fade-in .7s 1.3s both; }

.subtitle {
  position: absolute;
  z-index: 25;
  left: 50%;
  bottom: 3.2%;
  width: 86%;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}
.subtitle span {
  display: inline-block;
  min-height: 1.7em;
  padding: .36em 1em;
  color: rgba(255,255,255,.94);
  border-radius: 6px;
  background: rgba(0,0,0,.62);
  font-size: clamp(11px, 1.28vw, 18px);
  line-height: 1.5;
  text-shadow: 0 1px 2px #000;
}
.stage-progress { position: absolute; z-index: 31; right: 0; bottom: 0; left: 0; height: 3px; background: rgba(255,255,255,.08); }
.stage-progress i { display: block; width: 0; height: 100%; background: var(--amber); box-shadow: 0 0 12px rgba(243,163,41,.6); }

.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 6px 0;
}
.control-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 34px;
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  background: rgba(255,255,255,.05);
  cursor: pointer;
}
.control-button:hover { border-color: rgba(243,163,41,.5); background: var(--amber-soft); }
.control-button.primary { color: #111713; border-color: var(--amber); background: var(--amber); }
#timeline { flex: 1; accent-color: var(--amber); cursor: pointer; }
#time-label { min-width: 104px; color: var(--muted); font: 12px/1 var(--mono); }
.player-note { margin: 9px 0 0; color: #768078; text-align: center; font-size: 12px; }

/* 官网和后台弹窗内使用固定画布，避免 iframe 自身产生滚动条。 */
html.is-embedded,
html.is-embedded body {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
html.is-embedded body { padding: 4px; }
html.is-embedded .controls { padding-top: 6px; }
html.is-embedded .player-note { display: none; }

/* 生成静态预览图时只保留 16:9 舞台。 */
html.is-preview,
html.is-preview body {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
html.is-preview body { padding: 0; }
html.is-preview .player-shell { width: 100%; height: 100%; }
html.is-preview .stage { width: 100%; height: 100%; border: 0; border-radius: 0; }
html.is-preview .chapter-strip,
html.is-preview .controls,
html.is-preview .player-note { display: none; }

@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slide-left {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes wall-arrive {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: .9; transform: translateX(0); }
}
@keyframes packet-block {
  0% { left: 0; opacity: 0; }
  15% { opacity: 1; }
  68% { left: 85%; opacity: 1; }
  76%, 100% { left: 85%; opacity: 0; }
}
@keyframes packet-open {
  0% { left: 0; opacity: 0; }
  15% { opacity: 1; }
  90% { left: 96%; opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
@keyframes block-pulse {
  0%, 100% { box-shadow: 0 0 15px rgba(255,107,98,.25); }
  50% { box-shadow: 0 0 35px rgba(255,107,98,.58); }
}
@keyframes type-code {
  0% { content: ""; }
  25% { content: "S"; }
  50% { content: "S1"; }
  75% { content: "S10"; }
  100% { content: "S101"; }
}
@keyframes type-secret {
  0% { content: ""; }
  16% { content: "•"; }
  32% { content: "••"; }
  48% { content: "•••"; }
  64% { content: "••••"; }
  80% { content: "•••••"; }
  100% { content: "••••••"; }
}
@keyframes cursor-click {
  0% { opacity: 0; transform: translate(20px, 14px); }
  45% { opacity: 1; transform: translate(0, 0); }
  70% { transform: scale(.7); }
  100% { opacity: 0; transform: scale(1); }
}
@keyframes submit-flash {
  0%, 100% { background: var(--amber-deep); }
  50% { background: #15803d; box-shadow: 0 0 16px rgba(21,128,61,.35); }
}
@keyframes flow-packet {
  0% { left: 0; opacity: 0; }
  15% { opacity: 1; }
  90% { left: 96%; opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
@keyframes soft-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(73,209,125,.1); }
  50% { box-shadow: 0 0 0 10px rgba(73,209,125,.08); }
}
@keyframes toast-up {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes clock-tick {
  from { transform: rotate(342deg); }
  to { transform: rotate(360deg); }
}
@keyframes ttl-drain {
  from { transform: scaleX(1); }
  to { transform: scaleX(.03); }
}
@keyframes ttl-alert {
  0% { color: var(--amber); }
  50% { color: var(--red); text-shadow: 0 0 12px rgba(255,107,98,.55); }
  100% { color: var(--muted); opacity: .5; }
}
@keyframes row-highlight {
  0% { opacity: 0; }
  25%, 75% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes count-pop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.5); }
}
@keyframes line-grow { from { width: 0; } to { width: 120%; } }

@media (max-width: 760px) {
  body { padding: 8px; }
  .stage { border-radius: 12px; }
  .film-brand { top: 3.2%; }
  .scene { padding-top: 8%; }
  .subtitle { bottom: 2.2%; }
  .controls { gap: 6px; }
  .control-button { width: 34px; height: 30px; }
  #time-label { min-width: 88px; font-size: 10px; }
  .player-note { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .scene, .scene * { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }
}
