body { padding: 0; margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

#unity-container { position: absolute; box-sizing: border-box; }

#unity-container.unity-desktop {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

#unity-container.unity-mobile {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
}

#unity-canvas {
  background: #231F20;
  touch-action: none;
}

/* flex-basis 0 + min-height 0: canvas must not use intrinsic height (pushes footer off-screen on mobile). */
.unity-mobile #unity-canvas {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  width: 100%;
  align-self: stretch;
}

#unity-loading-bar {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none;
}

#unity-logo { width: 154px; height: 130px; background: url('unity-logo-dark.png') no-repeat center }
#unity-progress-bar-empty { width: 141px; height: 18px; margin-top: 10px; margin-left: 6.5px; background: url('progress-bar-empty-dark.png') no-repeat center }
#unity-progress-bar-full { width: 0%; height: 18px; margin-top: 10px; background: url('progress-bar-full-dark.png') no-repeat center }

#unity-footer {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
  min-height: 56px;
  padding: 10px 14px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(22, 26, 38, 0.95) 0%, rgba(14, 16, 24, 0.98) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
}

.unity-desktop #unity-footer {
  max-width: 100%;
  border-radius: 0 0 12px 12px;
}

#unity-logo-title-footer {
  flex: 0 0 auto;
  width: 102px;
  height: 38px;
  background: url('unity-logo-title-footer.png') no-repeat center;
  background-size: contain;
}

#unity-build-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  line-height: 1.3;
  font-size: clamp(14px, 3.5vw, 17px);
  color: rgba(235, 238, 245, 0.92);
  text-align: right;
  font-weight: 500;
  letter-spacing: 0.01em;
}

#unity-fullscreen-button {
  flex: 0 0 auto;
  cursor: pointer;
  width: 52px;
  height: 52px;
  min-width: 52px;
  min-height: 52px;
  border: none;
  border-radius: 14px;
  box-sizing: border-box;
  background:
    rgba(255, 255, 255, 0.12) url('fullscreen-button.png') no-repeat center;
  background-size: 26px 26px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.12s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Mobile: floating control so it stays visible (footer can sit below fold when canvas used height:auto). */
.unity-mobile #unity-fullscreen-button {
  position: fixed;
  z-index: 10000;
  right: max(14px, env(safe-area-inset-right, 0px));
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  border-radius: 18px;
  background-size: 28px 28px;
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.45),
    0 2px 8px rgba(61, 126, 234, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.unity-desktop #unity-fullscreen-button {
  position: relative;
  right: auto;
  bottom: auto;
  z-index: auto;
  width: 52px;
  height: 52px;
  min-width: 52px;
  min-height: 52px;
  border-radius: 14px;
  background-size: 26px 26px;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

#unity-fullscreen-button:hover {
  background-color: rgba(90, 140, 255, 0.35);
  box-shadow:
    0 6px 20px rgba(61, 126, 234, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.unity-mobile #unity-fullscreen-button:hover {
  box-shadow:
    0 10px 32px rgba(0, 0, 0, 0.5),
    0 4px 14px rgba(61, 126, 234, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

#unity-fullscreen-button:active {
  transform: scale(0.96);
}

#unity-fullscreen-button:focus-visible {
  outline: 2px solid rgba(120, 170, 255, 0.9);
  outline-offset: 2px;
}

#unity-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none }
