html,
body {
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  background: #080d16;
  overflow: hidden;
}

body {
  min-height: 100%;
  font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
  background:
    radial-gradient(circle at 50% 18%, rgba(45, 111, 157, 0.28), transparent 34%),
    linear-gradient(140deg, #070b13 0%, #111827 48%, #07111f 100%);
}

#unity-container {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#unity-container::before {
  content: "";
  position: absolute;
  inset: -24px;
  background: var(--game-splash) center / cover no-repeat;
  opacity: 0.32;
  filter: saturate(0.9);
  transform: scale(1.03);
}

#unity-container::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 9, 17, 0.58), rgba(5, 9, 17, 0.7));
}

#unity-container.unity-desktop {
  width: 100%;
  height: 100%;
}

#unity-container.unity-mobile {
  position: fixed;
  width: 100%;
  height: 100%;
}

#unity-canvas {
  position: relative;
  z-index: 1;
  background: #080d16;
  display: block;
  max-width: 100vw;
  max-height: 100vh;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

.unity-mobile #unity-canvas {
  max-width: 100vw;
  max-height: 100vh;
}

#unity-loading-bar {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #fff;
  background:
    radial-gradient(circle at 50% 42%, rgba(243, 196, 88, 0.16), transparent 24%),
    linear-gradient(180deg, rgba(5, 9, 17, 0.34), rgba(5, 9, 17, 0.62));
  text-align: center;
}

#loading-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateY(-22px);
}

#loading-emblem {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 230, 160, 0.72);
  border-radius: 18px;
  color: #ffe8a6;
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  background:
    linear-gradient(145deg, rgba(255, 217, 126, 0.2), rgba(255, 255, 255, 0.04)),
    rgba(10, 14, 24, 0.56);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 30px rgba(244, 197, 89, 0.18);
}

#loading-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff7de;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
}

#loading-subtitle {
  font-size: 13px;
  line-height: 1.4;
  color: rgba(245, 247, 255, 0.72);
}

#loading-progress-row {
  width: min(420px, calc(100vw - 56px));
  display: grid;
  grid-template-columns: 1fr 48px;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  transform: translateY(-16px);
}

#unity-progress-bar-empty {
  position: relative;
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    0 10px 28px rgba(0, 0, 0, 0.28);
}

#unity-progress-bar-empty::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  opacity: 0.46;
  pointer-events: none;
}

#unity-progress-bar-full {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f2c45b 0%, #ffe59e 48%, #58d5d0 100%);
  box-shadow: 0 0 22px rgba(245, 203, 96, 0.42);
  transition: width 220ms ease-out;
}

#unity-progress-percent {
  min-width: 48px;
  color: rgba(255, 250, 228, 0.9);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-align: right;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

#unity-warning {
  position: absolute;
  left: 50%;
  top: 5%;
  z-index: 6;
  transform: translate(-50%);
  display: none;
  max-width: min(680px, calc(100vw - 32px));
  border-radius: 8px;
  overflow: hidden;
  color: #1c1c1c;
  background: #fff;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
}

#orientation-hint {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  color: #fff7de;
  background: rgba(5, 9, 17, 0.94);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.orientation-hint-icon {
  font-size: 58px;
  line-height: 1;
  color: #ffe59e;
  animation: orientation-hint-turn 1.4s ease-in-out infinite alternate;
}

@keyframes orientation-hint-turn {
  from { transform: rotate(-25deg); }
  to { transform: rotate(65deg); }
}

@media (max-width: 640px) {
  #loading-emblem {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    font-size: 29px;
  }

  #loading-title {
    font-size: 21px;
  }

  #loading-progress-row {
    grid-template-columns: 1fr 42px;
    gap: 10px;
    margin-top: 24px;
  }
}
