:root {
  --app-width: 100vw;
  --app-height: 100dvh;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --page-bg: #09121d;
  --panel-bg: rgba(8, 17, 27, 0.72);
  --panel-border: rgba(255, 255, 255, 0.14);
  --text-color: #f4f7fb;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(35, 74, 122, 0.45), transparent 45%),
    linear-gradient(180deg, #132235 0%, var(--page-bg) 68%);
  color: var(--text-color);
  font-family: Arial, sans-serif;
}

body {
  touch-action: none;
}

#unity-page {
  position: fixed;
  inset: 0;
  width: var(--app-width);
  height: var(--app-height);
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
}

#unity-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0f1b2c;
}

#unity-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #231f20;
}

#unity-loading-bar {
  position: absolute;
  inset: 0;
  display: none;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: rgba(9, 18, 29, 0.48);
  z-index: 4;
}

#unity-logo {
  width: 154px;
  height: 130px;
  background: url("unity-logo-dark.png") no-repeat center / contain;
}

#unity-progress-bar-empty {
  width: min(260px, 60vw);
  height: 18px;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

#unity-progress-bar-full {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #71c9ff 0%, #d7f0ff 100%);
}

#unity-warning {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  gap: 8px;
  width: min(92vw, 560px);
  z-index: 6;
}

#unity-warning > div {
  padding: 12px 14px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

.banner-warning {
  background: rgba(255, 208, 92, 0.96);
  color: #3c2500;
}

.banner-error {
  background: rgba(225, 69, 69, 0.96);
  color: #fff;
}

#unity-overlay {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 5;
}

#unity-build-title {
  padding: 10px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  font-size: 14px;
  line-height: 1;
}

#unity-fullscreen-button {
  width: 46px;
  height: 46px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: var(--panel-bg) url("fullscreen-button.png") no-repeat center / 18px;
  backdrop-filter: blur(12px);
  cursor: pointer;
}

#unity-fullscreen-button:hover {
  background-color: rgba(16, 28, 41, 0.88);
}

.unity-mobile #unity-overlay {
  right: 12px;
  bottom: 12px;
  gap: 10px;
}

.unity-mobile #unity-build-title {
  max-width: 58vw;
  font-size: 12px;
  padding: 9px 12px;
}

.unity-mobile #unity-fullscreen-button {
  width: 42px;
  height: 42px;
}
