/* One original video over a full viewport background; no duplicate logo layer. */
#teamo-loading-screen.tm-loadscreen {
  --tm-load-vw: 100vw;
  --tm-load-vh: 100vh;
  --tm-load-top: env(safe-area-inset-top, 0px);
  --tm-load-right: env(safe-area-inset-right, 0px);
  --tm-load-bottom: env(safe-area-inset-bottom, 0px);
  --tm-load-left: env(safe-area-inset-left, 0px);
  --tm-load-ring: min(
    700px,
    calc((var(--tm-load-vw) - var(--tm-load-left) - var(--tm-load-right)) * .82),
    calc((var(--tm-load-vh) - var(--tm-load-top) - var(--tm-load-bottom) - 180px) * .82)
  );
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  row-gap: 16px;
  place-items: center;
  width: var(--tm-load-vw);
  height: var(--tm-load-vh);
  min-width: 0;
  min-height: 0;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: calc(var(--tm-load-top) + 16px) var(--tm-load-right) calc(var(--tm-load-bottom) + 16px) var(--tm-load-left);
  border: 0;
  border-radius: 0;
  box-sizing: border-box;
  isolation: isolate;
  overflow: hidden;
  background-color: #020001;
  background-image: radial-gradient(ellipse at 50% 50%, rgba(76, 27, 11, .10), rgba(27, 9, 4, .07) 52%, transparent 82%);
  color: #fff;
  opacity: 1;
  transition: opacity 720ms ease-in-out;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

@supports (height: 100dvh) {
  #teamo-loading-screen.tm-loadscreen {
    --tm-load-vw: 100dvw;
    --tm-load-vh: 100dvh;
  }
}

#teamo-loading-screen.tm-loadscreen::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 25% 66%, rgba(93, 38, 16, .06), transparent 56%),
    repeating-linear-gradient(128deg, transparent 0 9px, rgba(151, 77, 41, .018) 10px, transparent 11px 23px);
  pointer-events: none;
}

#teamo-loading-screen .tm-loadscreen__stage {
  position: relative;
  width: var(--tm-load-ring);
  height: var(--tm-load-ring);
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  background: none;
}

/* The source ring is 1440 px in a 3840 x 2160 frame. Its sparks reach 1536 px.
   Reserve the lower row for progress and Retry before sizing the original video. */
#teamo-loading-screen .tm-loadscreen__media {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: calc(var(--tm-load-ring) * 2.666666667);
  height: calc(var(--tm-load-ring) * 1.5);
  min-width: 0;
  min-height: 0;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  object-fit: fill;
  transform: translate(-50%, -50%);
  -webkit-mask-image: radial-gradient(circle at center, #000 0, #000 calc(var(--tm-load-ring) * .58), transparent calc(var(--tm-load-ring) * .735));
  mask-image: radial-gradient(circle at center, #000 0, #000 calc(var(--tm-load-ring) * .58), transparent calc(var(--tm-load-ring) * .735));
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  pointer-events: none;
}

#teamo-loading-screen .tm-loadscreen__video,
#teamo-loading-screen .tm-loadscreen__loop {
  visibility: hidden;
}

#teamo-loading-screen.is-playing .tm-loadscreen__video {
  visibility: visible;
}

#teamo-loading-screen.is-playing .tm-loadscreen__poster {
  visibility: hidden;
}

#teamo-loading-screen.is-looping .tm-loadscreen__video {
  visibility: hidden;
}

#teamo-loading-screen.is-looping .tm-loadscreen__loop {
  visibility: visible;
}

#teamo-loading-screen.is-leaving {
  opacity: 0;
}

/* The real, already painted app opens outward from the original video. */
body.tm-entry-underlay {background:#020001!important}
html body #app.tm-entry-building {
  --tm-entry-x:50%;
  --tm-entry-y:44%;
  transform-origin:var(--tm-entry-x) var(--tm-entry-y);
  animation:tm-entry-screen 720ms cubic-bezier(.22,.8,.3,1) both;
  background:#fff!important;
}
html body #app.tm-entry-building[data-tm-entry-mode="work"] {background:#080808!important}
#app.tm-entry-building .tm-overview-head {
  animation:tm-entry-part 480ms ease-out 40ms both;
}
#app.tm-entry-building .tm-overview-list,
#app.tm-entry-building .tm-conversation-panel {
  animation:tm-entry-part 580ms ease-out 80ms both;
}
#app.tm-entry-building .tm-navigation {
  animation:tm-entry-part 480ms ease-out 160ms both;
}
#teamo-loading-screen .tm-loadscreen__stage {
  transition:transform 720ms cubic-bezier(.22,.8,.3,1);
}
#teamo-loading-screen.is-leaving .tm-loadscreen__stage {
  transform:scale(1.12);
}
@keyframes tm-entry-screen {
  from {clip-path:circle(0 at var(--tm-entry-x) var(--tm-entry-y));opacity:.25;transform:scale(.985)}
  to {clip-path:circle(150vmax at var(--tm-entry-x) var(--tm-entry-y));opacity:1;transform:none}
}
@keyframes tm-entry-part {
  from {opacity:0;transform:translateY(10px)}
  to {opacity:1;transform:none}
}

#teamo-loading-screen .tm-loadscreen__status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  #teamo-loading-screen.tm-loadscreen {
    transition: none;
  }
  #teamo-loading-screen .tm-loadscreen__stage {transition:none}
  #app.tm-entry-building,
  #app.tm-entry-building .tm-overview-head,
  #app.tm-entry-building .tm-overview-list,
  #app.tm-entry-building .tm-conversation-panel,
  #app.tm-entry-building .tm-navigation {animation:none}
}

#teamo-loading-screen .tm-loadscreen__progress {
  position:relative;width:90%;min-width:0;
  display:flex;align-items:center;flex-direction:column;gap:10px;text-align:center;
  font-family:system-ui,sans-serif;line-height:1.3;
}
#teamo-loading-screen .tm-loadscreen__percent {font-size:clamp(24px,5vw,38px);color:#fff;font-variant-numeric:tabular-nums;}
#teamo-loading-screen .tm-loadscreen__caption {font-size:14px;color:#efddd4;}
#teamo-loading-screen .tm-loadscreen__retry {padding:10px 18px;border:1px solid #fa9a74;border-radius:12px;background:#2b1710;color:#fff;font:inherit;cursor:pointer;touch-action:manipulation;}
#teamo-loading-screen .tm-loadscreen__retry[hidden] {display:none;}
@media (max-height:500px) {
  #teamo-loading-screen .tm-loadscreen__progress {gap:6px;}
  #teamo-loading-screen .tm-loadscreen__percent {font-size:24px;}
  #teamo-loading-screen .tm-loadscreen__retry {padding:8px 16px;}
}
