:root {
  color-scheme: dark;
  --bg: #020911;
  --panel: #07131e;
  --blue: #26bfff;
  --blue-deep: #0767b8;
  --orange: #ff7a18;
  --white: #edf8ff;
  --muted: #728697;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-width: 320px;
  margin: 0;
  overflow: hidden;
}

body {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 44%, rgba(255, 80, 0, .12), transparent 28%),
    radial-gradient(circle at 84% 42%, rgba(0, 139, 255, .16), transparent 31%),
    linear-gradient(180deg, #01060b, #03101a 52%, #01060b);
  color: var(--white);
  font-family: "Segoe UI", Inter, Arial, sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: .28;
  background-image:
    linear-gradient(rgba(31, 171, 239, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 171, 239, .06) 1px, transparent 1px),
    radial-gradient(circle, rgba(43, 190, 255, .55) 1px, transparent 1.5px);
  background-position: center, center, center;
  background-size: 64px 64px, 64px 64px, 31px 31px;
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}

.page-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 0;
  margin: 0 auto;
  padding: clamp(4px, .6vh, 6px) clamp(8px, 1.25vw, 24px);
  overflow: hidden;
}

.ambient {
  position: fixed;
  top: 26%;
  width: 32vw;
  height: 48vh;
  border-radius: 50%;
  opacity: .21;
  filter: blur(90px);
  pointer-events: none;
}

.ambient--orange {
  left: -21vw;
  background: var(--orange);
}

.ambient--blue {
  right: -21vw;
  background: var(--blue);
}

.brand {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(40px, 1fr) clamp(72px, 6vw, 110px) minmax(40px, 1fr);
  align-items: center;
  width: 84%;
  flex: 0 0 clamp(44px, 6vh, 64px);
  height: clamp(44px, 6vh, 64px);
  margin: 0 auto 3px;
}

.brand-logo {
  z-index: 2;
  display: block;
  width: auto;
  max-width: 100%;
  height: min(54px, calc(100% - 8px));
  max-height: calc(100% - 16px);
  margin: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 13px rgba(21, 172, 255, .33));
}

.brand-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(118, 198, 242, .75));
  box-shadow: 0 0 8px rgba(38, 191, 255, .25);
}

.brand-line--left::after,
.brand-line--right::before {
  display: block;
  width: 28%;
  height: 4px;
  margin-top: -2px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--orange));
}

.brand-line--right {
  background: linear-gradient(90deg, rgba(118, 198, 242, .75), transparent);
}

.brand-line--right::before {
  margin-left: auto;
  background: linear-gradient(90deg, var(--blue), transparent);
}

.console {
  position: relative;
  display: grid;
  grid-template-rows: auto 46px;
  flex: 0 1 auto;
  align-self: center;
  width: min(100%, max(270px, calc((100svh - 150px) * 1.777778)));
  max-width: none;
  min-width: 0;
  margin: 0 auto;
  padding: clamp(5px, .55vmin, 9px);
  background: linear-gradient(125deg, rgba(18, 29, 39, .96), rgba(3, 13, 22, .98) 48%, rgba(7, 25, 40, .96));
  border: 1px solid rgba(123, 184, 221, .34);
  border-radius: clamp(22px, 3.5vw, 58px);
  box-shadow:
    -3px 0 0 rgba(255, 114, 20, .83),
    3px 0 0 rgba(35, 178, 255, .9),
    0 25px 80px rgba(0, 0, 0, .75),
    inset 0 0 45px rgba(25, 92, 137, .12);
}

.console::before,
.console::after {
  position: absolute;
  top: 20%;
  bottom: 20%;
  width: 2px;
  content: "";
  filter: blur(.2px);
}

.console::before {
  left: -2px;
  background: linear-gradient(transparent, var(--orange), transparent);
  box-shadow: 0 0 14px var(--orange);
}

.console::after {
  right: -2px;
  background: linear-gradient(transparent, var(--blue), transparent);
  box-shadow: 0 0 14px var(--blue);
}

.console-edge {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(84, 159, 201, .16);
  border-radius: inherit;
  pointer-events: none;
}

.screen {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  background: #02070b;
  border: 1px solid rgba(151, 221, 255, .85);
  border-radius: clamp(12px, 2vw, 32px);
  box-shadow:
    -5px 0 17px rgba(255, 112, 18, .48),
    5px 0 19px rgba(32, 178, 255, .55),
    0 0 0 4px rgba(4, 22, 35, .9),
    inset 0 0 22px rgba(21, 171, 255, .16);
}

#unity-canvas {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  border: 0;
  background: #02070b;
  outline: none;
  touch-action: none;
}

.loading-panel,
.error-panel {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle, rgba(6, 57, 91, .9), rgba(2, 9, 15, .98) 58%),
    #020911;
  transition: opacity .55s ease, visibility .55s ease;
}

.loading-panel.is-hidden {
  visibility: hidden;
  opacity: 0;
}

.loading-logo {
  width: clamp(90px, 10vw, 160px);
  max-height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(22, 168, 255, .28));
}

.loading-title,
.error-kicker {
  margin: 9px 0 14px;
  color: #dff6ff;
  font-size: clamp(10px, .82vw, 14px);
  font-weight: 600;
  letter-spacing: .32em;
}

.progress-track {
  overflow: hidden;
  width: min(360px, 60%);
  height: 4px;
  background: rgba(153, 208, 236, .14);
  border-radius: 10px;
}

.progress-bar {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--orange), #ffb12b 22%, var(--blue) 78%);
  box-shadow: 0 0 15px var(--blue);
  transition: width .2s ease;
}

.loading-label {
  margin: 15px 0 0;
  color: #7895a8;
  font-family: Consolas, monospace;
  font-size: clamp(8px, .68vw, 12px);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: .12em;
  text-shadow: 0 0 14px rgba(38, 191, 255, .32);
}

#unity-warning {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 6;
  display: grid;
  gap: 8px;
  max-width: min(420px, calc(100% - 32px));
  pointer-events: none;
}

.unity-notice {
  padding: 10px 14px;
  color: #dff6ff;
  background: rgba(3, 23, 37, .94);
  border: 1px solid rgba(38, 191, 255, .45);
  border-radius: 6px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .45);
  font-size: 12px;
}

.error-panel[hidden] {
  display: none;
}

.error-panel p {
  margin: 4px 0 14px;
  text-align: center;
}

.error-panel button {
  padding: 10px 22px;
  color: white;
  background: rgba(12, 111, 171, .25);
  border: 1px solid var(--blue);
  border-radius: 5px;
  cursor: pointer;
}

.console-footer {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 7px clamp(16px, 2.5vw, 48px) 0;
  color: #7e97a8;
  font-size: clamp(8px, .6vw, 11px);
  letter-spacing: .17em;
}

.console-brand {
  grid-column: 2;
  display: block;
  width: clamp(105px, 9vw, 160px);
  max-height: 25px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(44, 173, 239, .2));
}

.controls {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 7px;
  color: #9cdcff;
  background: rgba(11, 43, 63, .55);
  border: 1px solid rgba(69, 179, 237, .35);
  border-radius: 6px;
  cursor: pointer;
  place-items: center;
  transition: color .2s, border-color .2s, background .2s;
}

.icon-button:hover {
  color: white;
  background: rgba(13, 105, 157, .5);
  border-color: var(--blue);
}

.icon-button svg {
  width: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.edition {
  display: flex;
  align-items: center;
  align-self: center;
  gap: 14px;
  width: min(760px, 90%);
  min-height: 28px;
  flex: 0 0 auto;
  margin: 5px 0 0;
  padding: 4px 0;
  color: #d4edff;
  background: linear-gradient(90deg, transparent, rgba(20, 91, 134, .18) 28%, rgba(20, 91, 134, .18) 72%, transparent);
  font-size: clamp(11px, .78vw, 13px);
  font-weight: 700;
  letter-spacing: .18em;
  text-align: center;
  text-shadow: 0 0 12px rgba(38, 191, 255, .48);
  white-space: nowrap;
}

.edition span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(48, 153, 213, .45));
}

.edition span:last-child {
  background: linear-gradient(90deg, rgba(48, 153, 213, .45), transparent);
}

.edition strong {
  color: #8b9dac;
  font-weight: 400;
}

body.is-fullscreen .page-shell {
  width: 100%;
  padding: 0;
}

body.is-fullscreen .brand,
body.is-fullscreen .edition,
body.is-fullscreen .console-footer,
body.is-fullscreen .console-edge {
  display: none;
}

body.is-fullscreen .console {
  display: grid;
  grid-template-rows: 1fr;
  width: 100vw;
  height: 100vh;
  padding: 0;
  background: black;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  place-items: center;
}

body.is-fullscreen .screen {
  width: min(100vw, 177.7778vh);
  height: auto;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

@media (max-width: 800px) {
  .page-shell {
    padding-top: 6px;
  }

  .brand {
    grid-template-columns: 1fr clamp(72px, 19vw, 100px) 1fr;
    flex-basis: clamp(64px, 11vh, 88px);
    height: clamp(64px, 11vh, 88px);
    margin-bottom: 6px;
  }

  .brand-logo {
    height: min(72px, calc(100% - 14px));
    max-height: calc(100% - 14px);
  }

  .console {
    padding: 9px;
    border-radius: 20px;
  }

  .screen {
    border-radius: 11px;
  }

  .console-footer {
    grid-template-columns: 1fr auto 1fr;
    min-height: 46px;
    padding: 7px 10px 0;
  }

  .edition {
    margin-top: 8px;
  }
}

@media (max-height: 900px) {
  .console {
    width: min(100%, max(270px, calc((100svh - 145px) * 1.777778)));
  }
}

@media (max-height: 720px) and (min-width: 900px) {
  .page-shell {
    padding-top: 2px;
  }

  .brand {
    grid-template-columns: 1fr 75px 1fr;
    flex-basis: 58px;
    height: 58px;
    margin-bottom: 7px;
  }

  .brand-logo {
    height: 44px;
    max-height: 44px;
  }

  .console {
    padding: 7px;
    grid-template-rows: auto 42px;
  }

  .console-footer {
    min-height: 42px;
    padding-top: 5px;
  }

  .edition {
    margin-top: 5px;
  }
}

@media (max-height: 500px) {
  .page-shell {
    padding-top: 2px;
    padding-bottom: 2px;
  }

  .brand {
    grid-template-columns: 1fr 62px 1fr;
    flex-basis: 48px;
    height: 48px;
    margin-bottom: 5px;
  }

  .brand-logo {
    height: 38px;
    max-height: 38px;
  }

  .console {
    width: min(100%, max(270px, calc((100svh - 120px) * 1.777778)));
    grid-template-rows: auto 38px;
    padding: 5px;
  }

  .console-footer {
    min-height: 38px;
    padding-top: 3px;
  }

  .edition {
    margin-top: 3px;
    min-height: 22px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
