@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./bricolage-600.71449acc4222.ttf") format("truetype");
}

@font-face {
  font-family: "Arial Rounded MT Pro Cyr";
  src: url("./arial-rounded-mt-pro-cyr-bold.0843c53d0298.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  background-color: #06111c;
  color: #f8f9fa;
  font-family: "Inter Variable", Inter, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
}

.portal-shell iframe {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.portal-shell:has(noscript > p) iframe {
  display: none;
}

.portal {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  overflow: hidden;
  touch-action: manipulation;
  background: radial-gradient(120% 90% at 50% 40%, #0d2033 0%, #06111c 70%);
}

.stage {
  position: relative;
}
.water,
.water-type,
.shade {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100svh;
  pointer-events: none;
}

.lens-type,
.particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.shade {
  background: radial-gradient(
    130% 100% at 50% 45%,
    transparent 55%,
    rgb(3 10 18 / 45%)
  );
}

.particles {
  z-index: 2;
}

main {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 2rem 1rem 5rem;
}

.portal-glass {
  --login-panel-width: 1080px;
  position: relative;
  display: grid;
  width: min(100%, var(--login-panel-width));
  overflow: hidden;
  border-radius: 1.5rem;
  box-shadow:
    0 0 0 2px rgb(255 255 255 / 20%),
    0 50px 120px -40px rgb(0 0 0 / 75%);
  background-color: rgb(7 15 23 / 50%);
  backdrop-filter: blur(calc(var(--lens-inset, 32px) / 2));
}

.water-glass {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.portal-glass[data-painted-glass] {
  backdrop-filter: none;
}
.portal-glass[data-painted-glass] > .water-glass {
  display: block;
}

.lens {
  position: relative;
  overflow: hidden;
  height: 10rem;
}

.portal:is([data-control-room], [data-art-frozen])
  :is(.water, .water-type, .water-glass) {
  filter: brightness(0.46);
}

.portal[data-control-room] main {
  --control-gutter: clamp(8px, 1.5vmin, 12px);
  --tab-icon: 51.2px;
  --tab-art-height: 46.4px;
  --tab-row-height: var(--tab-art-height);
  --tab-panel-gap: 2px;
  --tab-header-space: calc(0.75rem + 2px);
  --control-top: calc(
    max(6px, env(safe-area-inset-top)) + var(--tab-header-space) +
      var(--tab-row-height) + var(--tab-panel-gap)
  );
  align-items: start;
  padding: var(--control-top) var(--control-gutter) var(--control-gutter);
}

.portal[data-control-room] .portal-glass {
  width: min(100%, calc(max(80vw, var(--login-panel-width)) + 60px));
  grid-template-columns: minmax(0, 1fr);
  min-height: min(
    calc(80svh + 60px),
    calc(100svh - var(--control-top) - var(--control-gutter))
  );
  overflow: visible;
  box-shadow: none;
  background-color: rgb(3 3 3 / 50%);
  backdrop-filter: blur(calc(var(--lens-inset, 32px) * 0.35));
}

.portal[data-control-room] :is(.lens, .water-glass) {
  display: none;
}

.portal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.75rem;
}

@media (prefers-reduced-motion: no-preference) {
  .portal :is(.water, .water-type, .water-glass) {
    transition: filter 270ms ease-in-out;
  }

  .glass-panel-enter,
  .glass-panel-leaving,
  .lens-leaving {
    animation-timing-function: ease-in-out;
    animation-fill-mode: both;
  }

  .glass-panel-enter {
    animation-duration: 220ms;
    animation-name: portal-fade-in;
    animation-fill-mode: backwards;
  }

  .glass-panel-leaving {
    animation-duration: 150ms;
    animation-name: portal-fade-out;
  }

  .lens-leaving {
    animation-duration: 210ms;
    animation-name: portal-fade-out;
  }
}

@keyframes portal-fade-in {
  from {
    opacity: 0;
  }
}

@keyframes portal-fade-out {
  to {
    opacity: 0;
  }
}

.login-heading,
.passkey-panel {
  width: min(100%, 21rem);
  margin-inline: auto;
  text-align: center;
}

.login-heading h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2.25vw, 1.9rem);
  font-weight: 620;
  line-height: 1.18;
  letter-spacing: -0.04em;
}

.portal-toolbar-actions {
  position: fixed;
  top: max(6px, env(safe-area-inset-top));
  right: max(6px, env(safe-area-inset-right));
  left: max(100px, calc(env(safe-area-inset-left) + 94px));
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.375rem;
  pointer-events: none;
}

.portal-toolbar-actions > .control-utility {
  min-width: 0;
  text-align: center;
  pointer-events: auto;
}

.portal-toolbar-actions:empty {
  display: none;
}

.portal-footer {
  position: fixed;
  inset-inline: 0;
  bottom: max(6px, env(safe-area-inset-bottom));
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  column-gap: 0.5rem;
  color: #999;
  line-height: 1;
  pointer-events: none;
}

.portal-version {
  margin: 0;
  font-size: 0.75rem;
}

.portal-credit {
  margin-inline-start: max(6px, env(safe-area-inset-left));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.625rem;
}

.portal-credit-name {
  font-family: "Arial Rounded MT Pro Cyr", sans-serif;
  font-weight: 700;
}

.passkey-panel {
  display: grid;
  justify-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.passkey-hint,
.passkey-status {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #c0c9cc;
}

.pairing-tile {
  width: min(280px, 100%);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: white url("./pairing-pattern.5a8bb7559e5a.png") center / cover no-repeat;
  box-shadow: 0 2px 10px rgb(0 0 0 / 20%);
}

button.pairing-tile {
  cursor: pointer;
}

button.pairing-tile:hover:not(:disabled) {
  box-shadow:
    0 0 0 2px rgb(255 255 255 / 45%),
    0 2px 10px rgb(0 0 0 / 20%);
}

.passkey-start {
  display: inline-grid;
  place-items: center;
  min-height: 46px;
  padding: 0.65rem 1.25rem;
  border: 1px solid #768189;
  border-radius: 9px;
  background: #0e1012;
  color: inherit;
  font: inherit;
  font-weight: 550;
  cursor: pointer;
  text-decoration: none;
}

.passkey-start:hover {
  background: #24282a;
}
.passkey-start:disabled,
.pairing-tile:disabled,
.passkey-link:disabled {
  opacity: 0.7;
  cursor: default;
}

.passkey-link {
  display: inline-grid;
  place-items: center;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: none;
  color: #dae0e2;
  font: inherit;
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.passkey-link:hover {
  color: white;
}

:where(a, button, input):focus-visible {
  outline: 2px solid #e4eaed;
  outline-offset: 4px;
}
.passkey-status {
  color: #f4dfca;
}
.passkey-status:empty {
  display: none;
}

.portal[data-control-room] .login-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.portal[data-control-room] .portal-content {
  position: static;
  justify-content: flex-start;
  gap: 1rem;
  min-width: 0;
  padding: clamp(12px, 2vw, 24px);
}

portal-function-tabs {
  position: absolute;
  bottom: calc(100% + var(--tab-panel-gap));
  left: 0;
  display: inline-flex;
  max-width: 100%;
  gap: 12px;
  font:
    400 16px/1.5 system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
}

portal-function-tabs label {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 4px;
  color: #bec6ca;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

portal-function-tabs input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
}

portal-function-tabs label:has(:checked) {
  color: inherit;
  font-weight: 500;
}

portal-function-tabs label:has(:focus-visible) {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 4px;
}

.function-tab-art {
  display: flex;
  align-items: center;
  flex: none;
  width: var(--tab-icon);
  height: var(--tab-art-height);
  /* The artwork has transparent padding along its edges. */
  margin-inline-end: -5px;
  pointer-events: none;
}

.function-tab-art video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.function-indicator,
portal-function-tabs:not([data-positioned]) label:has(:checked)::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  border-radius: 100px;
  background: currentColor;
  pointer-events: none;
}

.function-indicator {
  visibility: hidden;
  width: var(--tab-width);
  transform: translateX(var(--tab-x));
}

portal-function-tabs[data-positioned] .function-indicator {
  visibility: visible;
}

@media (prefers-reduced-motion: no-preference) {
  .function-indicator {
    transition:
      transform 300ms cubic-bezier(0.22, 0.8, 0.2, 1),
      width 300ms cubic-bezier(0.22, 0.8, 0.2, 1);
  }
}

@media (min-width: 1360px) {
  .portal[data-control-room] main {
    --tab-header-space: 0px;
  }
}

@media (max-width: 840px) {
  .portal[data-control-room] main {
    --tab-header-space: 0px;
  }
  .portal-toolbar-actions:has(.demo-exit) + .portal[data-control-room] main {
    --tab-header-space: 48px;
  }
  portal-function-tabs {
    gap: 6px;
  }
  portal-function-tabs label {
    padding-inline: 2px;
    font-size: 14px;
  }
  .function-indicator,
  portal-function-tabs:not([data-positioned]) label:has(:checked)::after {
    height: 3px;
  }
}

@media (max-width: 576px) {
  .portal-credit {
    gap: 0.125rem;
    font-size: 0.3125rem;
  }
  .portal-credit img {
    width: 7px;
    height: 7px;
  }
  .portal-version {
    color: #888;
    font-size: 0.5625rem;
  }

  .portal[data-control-room] main {
    --tab-label-size: clamp(11px, 3.4vw, 14px);
    --tab-row-height: calc(var(--tab-art-height) + 1.5 * var(--tab-label-size));
  }
  portal-function-tabs {
    width: 100%;
    gap: 4px;
  }
  portal-function-tabs label {
    flex: 1 1 0;
    flex-direction: column;
    min-width: 0;
    padding: 0 0 5px;
    font-size: var(--tab-label-size);
  }
  .function-tab-art {
    /* Pull the label into the artwork's transparent bottom edge. */
    margin-block-end: -5px;
    margin-inline-end: 0;
  }
}

@media (forced-colors: active) {
  .function-indicator,
  portal-function-tabs:not([data-positioned]) label:has(:checked)::after {
    background: Highlight;
    forced-color-adjust: none;
  }
}

.control-admin {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.control-utility {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.25rem 0.5rem;
  border: 1px solid #555;
  border-radius: 6px;
  background: #101010;
  color: #c2c2c2;
  font: inherit;
  font-size: 0.75rem;
  text-decoration: none;
  cursor: pointer;
}

.control-utility:hover:not(:disabled) {
  color: white;
  border-color: #999;
}

.control-utility:disabled {
  opacity: 0.55;
  cursor: default;
}

.portal-admin-button {
  justify-content: center;
  gap: 5px;
  min-height: 40px;
  border-color: #4a4a4a;
  background: #202020;
  color: #e8e8e8;
  font-weight: 600;
  line-height: 1.2;
}

.portal-admin-button::before {
  content: "";
  flex: none;
  width: 14px;
  aspect-ratio: 1;
  background: currentColor;
  mask: url("./bellator-mark.ba2b2b3d7c7f.svg") center / contain no-repeat;
}

.portal-admin-button:disabled {
  opacity: 0.76;
}

.demo-exit {
  flex: none;
  min-height: 44px;
  padding: 0.25rem 0.875rem;
  border-color: #666;
  border-radius: 999px;
  background: #242424;
  color: #f4f4f4;
  font-size: 0.8125rem;
  font-weight: 600;
}

.settings-actions {
  display: none;
  align-self: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin-block-start: auto;
}

portal-function-tabs:has(input[value="settings"]:checked) ~ .settings-actions {
  display: flex;
}

.sign-out-icon {
  display: block;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent url("./sign-out.8e23f7a780fb.svg") center / 24px 24px no-repeat;
  cursor: pointer;
}

@media (min-width: 640px) {
  main {
    padding: 3rem 2rem 5rem;
  }
  .lens {
    height: 13rem;
  }
  .portal-content {
    padding: 2.5rem 3rem;
  }
}

@media (min-width: 768px) {
  .portal-glass {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: min(580px, calc(100svh - 140px));
  }
  .lens {
    height: auto;
  }
  .portal-content {
    padding-inline: 2.5rem;
  }
}

@media (min-width: 1024px) {
  .portal-content {
    padding-inline: 3.5rem;
  }
}
