/* ============================================================================
   YE KAL GEBETA 3D — WEBGL SACRED STYLESHEET WITH NU TECHNOLOGIES BRANDING
   ============================================================================ */

:root {
  --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);
}

html, body {
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #060812;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Ethiopic", serif;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#unity-container {
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
  left: 0 !important;
  top: 0 !important;
  transform: none !important;
}

#unity-fullscreen-container {
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
}

#unity-canvas {
  width: 100% !important;
  height: 100% !important;
  background: #060812;
  display: block;
}

/* ============================================================================
   STAGE 1 — NU TECHNOLOGIES STARTUP SPLASH SCREEN
   Replaces the black "Made with Unity" splash.
   Smoothly cross-fades into the Ye Kal Gebeta Sacred Loading Screen.
   ============================================================================ */
#nu-splash-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 45%, #0d1a33 0%, #060b19 70%, #03060c 100%);
  color: #f7e7c4;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  box-sizing: border-box;
  overflow: hidden;
}

#nu-splash-container.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.nu-logo-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  animation: nuLogoFadeIn 0.52s cubic-bezier(0.16, 1, 0.3, 1) 0.08s forwards;
}

.nu-logo-img {
  width: 148px;
  height: auto;
  max-width: 38vw;
  filter: drop-shadow(0 0 24px rgba(229, 185, 85, 0.42));
  animation: nuGlowPulse 2.8s ease-in-out 0.6s infinite alternate;
  user-select: none;
  -webkit-user-drag: none;
}

.nu-company-title {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Ethiopic", serif;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 5.5px;
  color: #f4d374;
  text-transform: uppercase;
  text-shadow: 0 0 16px rgba(244, 211, 116, 0.45);
  animation: nuTitleFadeIn 0.45s ease-out 0.48s forwards;
  opacity: 0;
}

@keyframes nuLogoFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.88);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes nuGlowPulse {
  0% {
    filter: drop-shadow(0 0 18px rgba(229, 185, 85, 0.35));
  }
  100% {
    filter: drop-shadow(0 0 32px rgba(255, 215, 100, 0.7));
  }
}

@keyframes nuTitleFadeIn {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================================
   STAGE 2 — RESTORED SACRED YE KAL GEBETA LOADING SCREEN
   Exact original design with rotating Fidel wheel, octagram, ቃል glyph,
   Ethiopic numeral percentage, gold progress bar, and motes.
   ============================================================================ */
#unity-loading-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 44%, #10162b 0%, #070a14 62%, #04050b 100%);
  color: #f6e7c1;
  transition: opacity 0.48s ease-out, visibility 0.48s ease-out;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  box-sizing: border-box;
  overflow: hidden;
}

#unity-loading-container.loaded-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sacred-loader-card {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 440px;
  width: 88%;
  padding: 28px 24px;
  border-radius: 20px;
  background: rgba(10, 13, 24, 0.84);
  border: 1.5px solid rgba(235, 194, 92, 0.55);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.75), 0 0 36px rgba(235, 194, 92, 0.14);
  text-align: center;
}

.sacred-fidel-wheel-wrap {
  position: relative;
  width: 152px;
  height: 152px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sacred-fidel-wheel-outer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: sacredSpinSlow 28s linear infinite;
  filter: drop-shadow(0 0 8px rgba(245, 204, 96, 0.45));
}

.sacred-fidel-wheel-inner {
  position: absolute;
  width: 96px;
  height: 96px;
  animation: sacredSpinReverse 18s linear infinite;
}

.sacred-center-glyph {
  position: relative;
  z-index: 3;
  font-size: 32px;
  font-weight: 700;
  color: #ffe38e;
  text-shadow: 0 0 14px rgba(255, 212, 94, 0.85);
  animation: sacredPulseGlow 2.4s ease-in-out infinite;
}

.sacred-title-amh {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #f8d878;
  text-shadow: 0 2px 12px rgba(248, 216, 120, 0.45);
  margin: 0 0 4px 0;
}

.sacred-title-eng {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: #dcd4c0;
  margin: 0 0 18px 0;
}

.sacred-ethiopian-numeral {
  font-size: 26px;
  font-weight: 800;
  color: #ffe28a;
  text-shadow: 0 0 12px rgba(255, 215, 100, 0.55);
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

#unity-progress-bar-empty {
  width: 100%;
  max-width: 280px;
  height: 10px;
  background: rgba(24, 28, 46, 0.95);
  border: 1px solid rgba(235, 194, 92, 0.65);
  border-radius: 999px;
  overflow: hidden;
  padding: 1px;
  box-sizing: border-box;
  margin-bottom: 14px;
}

#unity-progress-bar-full {
  width: 3%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #c89128 0%, #f8d878 55%, #fff2b2 100%);
  box-shadow: 0 0 12px rgba(248, 216, 120, 0.8);
  transition: width 0.18s ease-out;
}

.sacred-status-eng {
  font-size: 13.5px;
  color: #e6dec8;
  margin: 0 0 4px 0;
  letter-spacing: 0.4px;
}

.sacred-status-amh {
  font-size: 13px;
  color: #cbb882;
  margin: 0;
}

/* Error / Retry UI (Strictly contained within card, no technical overlays) */
#sacred-loading-error {
  display: none;
  flex-direction: column;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(235, 194, 92, 0.3);
  width: 100%;
}

.sacred-error-msg {
  font-size: 13.5px;
  line-height: 1.5;
  color: #ffb4a2;
  margin: 0 0 12px 0;
  text-align: center;
}

.sacred-error-amh {
  display: block;
  font-size: 12px;
  color: #e8cfa0;
  margin-top: 4px;
}

.sacred-retry-btn {
  background: linear-gradient(180deg, #f5cd62 0%, #cf9b2e 100%);
  color: #1a1205;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1.5px;
  border: 1px solid #ffe89e;
  border-radius: 999px;
  padding: 10px 32px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(245, 205, 98, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sacred-retry-btn:active {
  transform: scale(0.96);
  box-shadow: 0 2px 8px rgba(245, 205, 98, 0.25);
}

/* Subtle Floating Gold Particles */
.sacred-motes-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.sacred-mote {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #f8d878;
  box-shadow: 0 0 8px #f8d878;
  opacity: 0.35;
  animation: sacredFloatUp 6s ease-in-out infinite;
}

@keyframes sacredSpinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes sacredSpinReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes sacredPulseGlow {
  0%, 100% { transform: scale(0.96); opacity: 0.85; }
  50% { transform: scale(1.06); opacity: 1; }
}

@keyframes sacredFloatUp {
  0%, 100% { transform: translateY(0px) scale(0.85); opacity: 0.2; }
  50% { transform: translateY(-22px) scale(1.15); opacity: 0.65; }
}

#unity-footer {
  display: none !important;
}

#unity-warning {
  display: none !important;
}

/* Landscape / Mobile responsiveness for NU splash and Sacred Loader */
@media screen and (max-height: 520px) and (orientation: landscape) {
  .nu-logo-wrapper {
    margin-bottom: 10px;
  }
  .nu-logo-img {
    width: 90px;
  }
  .nu-company-title {
    font-size: 15px;
    letter-spacing: 4px;
  }
  .sacred-loader-card {
    padding: 12px 18px;
    max-width: 380px;
  }
  .sacred-fidel-wheel-wrap {
    width: 96px;
    height: 96px;
    margin-bottom: 6px;
  }
  .sacred-fidel-wheel-inner {
    width: 60px;
    height: 60px;
  }
  .sacred-center-glyph {
    font-size: 20px;
  }
  .sacred-title-amh {
    font-size: 18px;
    margin-bottom: 2px;
  }
  .sacred-title-eng {
    font-size: 10px;
    letter-spacing: 2px;
    margin-bottom: 6px;
  }
  .sacred-ethiopian-numeral {
    font-size: 16px;
    min-height: 22px;
    margin-bottom: 4px;
  }
  #unity-progress-bar-empty {
    max-width: 220px;
    height: 7px;
    margin-bottom: 6px;
  }
  .sacred-status-eng {
    font-size: 11px;
    margin-bottom: 2px;
  }
  .sacred-status-amh {
    font-size: 10px;
  }
  .sacred-error-msg {
    font-size: 11.5px;
    margin-bottom: 8px;
  }
  .sacred-error-amh {
    font-size: 10.5px;
  }
  .sacred-retry-btn {
    padding: 7px 24px;
    font-size: 12px;
  }
}

@media screen and (max-width: 480px) {
  .nu-logo-img {
    width: 115px;
  }
  .nu-company-title {
    font-size: 16px;
    letter-spacing: 4px;
  }
  .sacred-loader-card {
    padding: 22px 16px;
    width: 90%;
  }
  .sacred-fidel-wheel-wrap {
    width: 126px;
    height: 126px;
    margin-bottom: 12px;
  }
  .sacred-fidel-wheel-inner {
    width: 80px;
    height: 80px;
  }
  .sacred-center-glyph {
    font-size: 26px;
  }
  .sacred-title-amh {
    font-size: 24px;
  }
  .sacred-title-eng {
    font-size: 12px;
    letter-spacing: 2px;
    margin-bottom: 12px;
  }
  .sacred-ethiopian-numeral {
    font-size: 22px;
    min-height: 28px;
  }
  #unity-progress-bar-empty {
    max-width: 240px;
  }
}
