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

body {
  position: relative;
  font-family: Arial, Helvetica, sans-serif;
  color: #ffffff;
  background:
    radial-gradient(circle at top left, rgba(67, 191, 255, 0.22), transparent 28%),
    radial-gradient(circle at bottom right, rgba(57, 255, 133, 0.14), transparent 30%),
    linear-gradient(180deg, #061327 0%, #0a1f3f 45%, #081222 100%);
}

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 220, 86, 0.10), transparent 18%),
    radial-gradient(circle at 80% 18%, rgba(74, 157, 255, 0.12), transparent 20%),
    radial-gradient(circle at 50% 100%, rgba(255, 153, 51, 0.10), transparent 24%);
  filter: blur(10px);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 12px;
  box-sizing: border-box;
}

#unity-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#unity-container.unity-desktop,
#unity-container.unity-mobile {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
}

#unity-canvas {
  display: block;
  width: min(540px, calc(100vw - 24px));
  height: auto;
  aspect-ratio: 540 / 960;
  max-height: calc(100vh - 74px);
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,0.14);
  background: linear-gradient(180deg, #10294f 0%, #09192f 100%);
  box-shadow:
    0 30px 90px rgba(0,0,0,0.42),
    0 0 0 10px rgba(255,255,255,0.04);
}

.unity-mobile #unity-canvas {
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  aspect-ratio: auto;
}

.unity-mobile .app-shell {
  min-height: 100dvh;
  padding: 0;
}

.unity-mobile #unity-container {
  width: 100vw;
  height: 100dvh;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  box-sizing: border-box;
}

.unity-mobile #unity-footer {
  display: none;
}

.unity-mobile #unity-fullscreen-button {
  display: none;
}

.unity-mobile .page-bg {
  display: none;
}

.unity-mobile #unity-loading-bar {
  border-radius: 0;
}

#unity-loading-bar {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 28px;
  background: rgba(5, 12, 24, 0.78);
  backdrop-filter: blur(8px);
  z-index: 2;
}

.loader-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(78%, 280px);
}

#game-loading-icon {
  width: 124px;
  height: 124px;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(0,0,0,0.35));
  animation: chicken-bob 1.5s ease-in-out infinite;
}

@keyframes chicken-bob {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-8px) scale(1.03); }
}

#unity-progress-bar-empty {
  width: 100%;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.14);
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.22);
}

#unity-progress-bar-full {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3cc9ff 0%, #43ef51 100%);
  transition: width 0.2s ease;
}

.loading-text {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: rgba(255,255,255,0.92);
  text-align: center;
}

#loading-percent {
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,0.78);
}

#unity-footer {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  min-height: 38px;
}

.unity-mobile #unity-footer {
  display: none;
}

#unity-build-title {
  line-height: 38px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: rgba(255,255,255,0.92);
  text-align: center;
}

#unity-fullscreen-button {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  cursor: pointer;
  background: rgba(255,255,255,0.06);
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}

#unity-fullscreen-button:hover {
  background: rgba(255,255,255,0.12);
}

#unity-fullscreen-button img {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
  opacity: 0.92;
}

#unity-warning {
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  width: min(90%, 460px);
  display: none;
  z-index: 3;
}

#unity-warning > div {
  margin-bottom: 8px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
}

@media (max-width: 700px) {
  .app-shell {
    padding: 8px;
  }

  #unity-canvas {
    width: min(540px, calc(100vw - 16px));
    max-height: calc(100vh - 60px);
    border-radius: 22px;
  }

  #unity-loading-bar {
    border-radius: 22px;
  }

  #game-loading-icon {
    width: 100px;
    height: 100px;
  }

  #unity-fullscreen-button {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  #unity-fullscreen-button img {
    width: 15px;
    height: 15px;
  }
}
