.startup-video-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block: 12px;
}

.startup-video-settings p {
  margin: 0;
  color: #526650;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.startup-video-effects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 12px;
  margin-block: 16px;
}

.startup-video-effects label {
  display: grid;
  gap: 7px;
  color: #526650;
  font-size: 13px;
}

.startup-video-effects select {
  width: 100%;
  min-height: 42px;
  padding: 7px 12px;
  border: 1px solid #cdd8c6;
  border-radius: 7px;
  background: #fafbf7;
  color: #314f3e;
  font: inherit;
}

.startup-video-player {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #121713;
}

.startup-video-player-fixed {
  z-index: 2147483647;
  overscroll-behavior: contain;
  touch-action: none;
}

.startup-video-player[data-pending] {
  opacity: 0;
  pointer-events: none;
}

dialog.startup-video-player::backdrop {
  background: transparent;
}

.startup-video-player video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.startup-video-player button {
  position: absolute;
  z-index: 2;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid #fff9;
  border-radius: 999px;
  background: #141b17e6;
  color: #fff;
  font-size: 14px;
}

.startup-video-player .startup-video-play {
  inset: auto auto calc(90px + env(safe-area-inset-bottom, 0px)) 50%;
  transform: translate(-50%, -50%);
  background: #f6f8f0;
  color: #234b3c;
  font-weight: 600;
}

.startup-video-play-status {
  position: absolute;
  z-index: 2;
  right: 12px;
  bottom: calc(54px + env(safe-area-inset-bottom, 0px));
  left: 12px;
  margin: 0;
  color: #f8f5ec;
  text-align: center;
  font-size: 13px;
  text-shadow: 0 1px 4px #000;
}

.startup-video-splash {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 45%, #294a3e, #121713 72%);
  pointer-events: none;
}

.startup-video-player [hidden] { display: none !important; }

.startup-video-splash strong {
  max-width: 100%;
  color: #f4e7c8;
  font: 600 32px "Songti SC", SimSun, serif;
  font-size: clamp(28px, 7vw, 54px);
  letter-spacing: .1em;
  text-align: center;
  overflow-wrap: anywhere;
}

.startup-video-player[data-phase="fallback"] .startup-video-splash strong {
  animation: startup-brand-reveal 1.3s ease-out both;
}

.startup-video-splash img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #121713;
}

@keyframes startup-brand-reveal {
  from { opacity: .4; transform: translateY(8px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.startup-video-player[data-phase="playing"] video {
  animation: var(--startup-intro, none) var(--startup-intro-time, 550ms) ease-out both;
}

.startup-video-player[data-phase="ending"] {
  animation: var(--startup-outro, none) var(--startup-outro-time, 550ms) ease-in-out both;
}

.startup-video-player[data-intro="fade"] { --startup-intro: startup-fade-in; }
.startup-video-player[data-intro="zoom"] { --startup-intro: startup-zoom-in; }
.startup-video-player[data-intro="slide"] { --startup-intro: startup-slide-in; }
.startup-video-player[data-intro="iris"] { --startup-intro: startup-iris-in; }
.startup-video-player[data-outro="fade"] { --startup-outro: startup-fade-out; }
.startup-video-player[data-outro="zoom"] { --startup-outro: startup-zoom-out; }
.startup-video-player[data-outro="slide"] { --startup-outro: startup-slide-out; }
.startup-video-player[data-outro="iris"] { --startup-outro: startup-iris-out; }
.startup-video-player[data-intro="focus"] {
  --startup-intro: startup-focus-in;
  --startup-intro-time: 950ms;
}

.startup-video-player[data-intro="curtain"] {
  --startup-intro: startup-curtain-in;
  --startup-intro-time: 850ms;
}

.startup-video-player[data-outro="focus"] {
  --startup-outro: startup-focus-out;
  --startup-outro-time: 1250ms;
}

.startup-video-player[data-outro="melt"] {
  --startup-outro: startup-melt-out;
  --startup-outro-time: 1900ms;
}

.startup-video-player[data-phase="ending"][data-outro="melt"]::backdrop {
  animation: startup-page-focus var(--startup-outro-time) linear both;
}

.startup-video-player[data-phase="ending"][data-outro="melt"] video {
  animation: startup-melt-soften var(--startup-outro-time) ease-in both;
}

@keyframes startup-fade-in { from { opacity: .04; } }
@keyframes startup-fade-out { to { opacity: 0; } }
@keyframes startup-zoom-in { from { opacity: .04; transform: scale(.92); } }
@keyframes startup-zoom-out { to { opacity: 0; transform: scale(.92); } }
@keyframes startup-slide-in { from { opacity: .04; transform: translateY(12%); } }
@keyframes startup-slide-out { to { opacity: 0; transform: translateY(-100%); } }
@keyframes startup-iris-in { from { clip-path: circle(1%); } to { clip-path: circle(75%); } }
@keyframes startup-iris-out { from { clip-path: circle(75%); } to { clip-path: circle(0%); } }

@keyframes startup-focus-in {
  from { opacity: .04; filter: blur(18px); transform: scale(1.07); }
  45% { opacity: 1; }
  to { opacity: 1; filter: blur(0); transform: scale(1); }
}

@keyframes startup-curtain-in {
  from { opacity: .45; clip-path: inset(49% 0); }
  to { opacity: 1; clip-path: inset(0); }
}

@keyframes startup-focus-out {
  from { opacity: 1; filter: blur(0); transform: scale(1); }
  to { opacity: 0; filter: blur(16px); transform: scale(1.035); }
}

@keyframes startup-melt-out {
  from {
    opacity: 1;
    clip-path: polygon(0 0, 6% 0, 12% 0, 18% 0, 25% 0, 31% 0, 37% 0, 43% 0, 50% 0, 56% 0, 62% 0, 68% 0, 75% 0, 81% 0, 87% 0, 93% 0, 100% 0, 100% 100%, 0 100%);
  }
  32% {
    opacity: .96;
    clip-path: polygon(0 18%, 6% 20%, 12% 32%, 18% 25%, 25% 13%, 31% 16%, 37% 30%, 43% 38%, 50% 29%, 56% 19%, 62% 22%, 68% 32%, 75% 25%, 81% 17%, 87% 18%, 93% 27%, 100% 31%, 100% 100%, 0 100%);
  }
  68% {
    opacity: .76;
    clip-path: polygon(0 57%, 6% 63%, 12% 77%, 18% 67%, 25% 51%, 31% 56%, 37% 74%, 43% 84%, 50% 72%, 56% 55%, 62% 60%, 68% 75%, 75% 65%, 81% 53%, 87% 55%, 93% 68%, 100% 73%, 100% 100%, 0 100%);
  }
  to {
    opacity: 0;
    clip-path: polygon(0 100%, 6% 100%, 12% 100%, 18% 100%, 25% 100%, 31% 100%, 37% 100%, 43% 100%, 50% 100%, 56% 100%, 62% 100%, 68% 100%, 75% 100%, 81% 100%, 87% 100%, 93% 100%, 100% 100%, 100% 100%, 0 100%);
  }
}

@keyframes startup-melt-soften {
  from { filter: blur(0); }
  to { filter: blur(10px); }
}

@keyframes startup-page-focus {
  0%, 18% { backdrop-filter: blur(12px); background: rgb(35 29 25 / 15%); }
  to { backdrop-filter: blur(0); background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .startup-video-player[data-phase="fallback"] .startup-video-splash strong { animation: none; }
  .startup-video-player[data-phase="playing"] video,
  .startup-video-player[data-phase="ending"],
  .startup-video-player[data-phase="ending"][data-outro="melt"] video,
  .startup-video-player[data-phase="ending"][data-outro="melt"]::backdrop {
    animation-duration: 1ms;
  }
}
