:root {
  --bg-deep:      #0c1830;
  --bg-mid:       #12233f;
  --bg-panel:     #16284a;
  --border-navy:  #1c2f52;
  --blue-primary: #1e63c4;
  --blue-light:   #4a90e2;
  --green-accent: #8bc34a;
  --green-deep:   #6a9c34;
  --teal-accent:  #2dd4bf;
  --white:        #f3f7fc;
  --white-dim:    #b9c8de;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg-deep);
  font-family: "Tajawal", "Segoe UI", Tahoma, sans-serif;
  overflow: hidden;
}

#unity-container {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 40%, var(--bg-mid) 0%, var(--bg-deep) 65%);
}

#unity-canvas {
  background: var(--bg-deep);
  display: block;
}

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

/* ---------- Loading screen ---------- */

#unity-loading-screen {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  transition: opacity 0.6s ease;
}

#unity-loading-screen.unity-loaded {
  opacity: 0;
  pointer-events: none;
}

.glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 560px;
  height: 560px;
  transform: translate(-50%, -55%);
  background: radial-gradient(circle, rgba(30, 99, 196, 0.35) 0%, rgba(45, 212, 191, 0.12) 45%, rgba(0,0,0,0) 70%);
  filter: blur(6px);
  pointer-events: none;
  animation: glow-pulse 4.5s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.7; transform: translate(-50%, -55%) scale(1); }
  50%      { opacity: 1;   transform: translate(-50%, -55%) scale(1.06); }
}

#unity-logo-wrap {
  position: relative;
  width: 148px;
  height: 148px;
  margin-bottom: 28px;
  animation: logo-float 3.2s ease-in-out infinite;
}

@keyframes logo-float {
  0%, 100% { transform: translateY(0px); }
  50%      { transform: translateY(-10px); }
}

#unity-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(30, 99, 196, 0.45));
}

#unity-title {
  margin: 0 0 8px 0;
  font-family: "Tajawal", sans-serif;
  font-weight: 800;
  font-size: 40px;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, var(--white) 0%, var(--teal-accent) 55%, var(--green-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

#unity-subtitle {
  margin: 0 0 34px 0;
  font-size: 16px;
  font-weight: 400;
  color: var(--white-dim);
}

/* ---------- Progress bar ---------- */

#unity-progress {
  width: min(340px, 78vw);
  display: none;
}

#unity-progress-track {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--bg-panel);
  border: 1px solid var(--border-navy);
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.35);
}

#unity-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue-primary) 0%, var(--teal-accent) 60%, var(--green-accent) 100%);
  transition: width 0.25s ease-out;
}

#unity-progress-sheen {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.35) 50%, rgba(255,255,255,0) 100%);
  animation: sheen-move 1.8s linear infinite;
}

@keyframes sheen-move {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(340%); }
}

#unity-progress-label {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.5px;
  direction: ltr;
}

/* ---------- Footer ---------- */

#unity-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: linear-gradient(0deg, rgba(12, 24, 48, 0.9) 0%, rgba(12, 24, 48, 0) 100%);
  z-index: 5;
  direction: ltr; /* keep logo+wordmark pinned bottom-left even on the RTL page */
}

#unity-logo-title-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--white-dim);
  font-size: 13px;
  font-weight: 500;
}

#unity-logo-title-footer img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

#unity-fullscreen-button {
  width: 28px;
  height: 28px;
  background: var(--bg-panel);
  border: 1px solid var(--border-navy);
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease;
}

#unity-fullscreen-button:hover {
  background: var(--blue-primary);
  border-color: var(--blue-light);
}

#unity-fullscreen-button::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 2px solid var(--white);
  border-radius: 2px;
  opacity: 0.85;
}

/* ---------- Warning banner ---------- */

#unity-warning {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, 90vw);
  z-index: 20;
  color: var(--white);
  font-size: 13px;
  text-align: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 520px) {
  #unity-logo-wrap { width: 108px; height: 108px; margin-bottom: 20px; }
  #unity-title { font-size: 30px; }
  #unity-subtitle { font-size: 14px; margin-bottom: 26px; }
}
