/* Property Tycoon — custom web loader
   Sirf transform / opacity animate hote hain (GPU par sasta, low-end PC par bhi smooth). */

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b1530;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Canvas hamesha game ki reference resolution (2778x1284) ke ratio par — warna kam chauri
   screens (16:9, 16:10) par UI side se katta hai. Bachi jagah body ka background (#0b1530) dikhata hai. */
#unity-canvas {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(100vw, calc(100vh * 2778 / 1284));
  height: min(100vh, calc(100vw * 1284 / 2778));
  width: min(100vw, calc(100dvh * 2778 / 1284));
  height: min(100dvh, calc(100vw * 1284 / 2778));
  display: block;
  outline: none;
  background: #0b1530;
}

/* ---------------- Loader ---------------- */
#pt-loader {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: #fff;
  transition: opacity 0.5s ease;
}
#pt-loader.hidden { opacity: 0; pointer-events: none; }

.pt-bg {
  position: absolute;
  inset: 0;
  background: #1b3a78 url("loader-bg.jpg") center / cover no-repeat;
  animation: pt-zoom 14s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes pt-zoom {
  from { transform: scale(1.03); }
  to   { transform: scale(1.12); }
}

.pt-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(8, 16, 40, 0) 40%, rgba(8, 16, 40, 0.85) 100%);
}

.pt-panel {
  position: absolute;
  left: 50%;
  bottom: 7%;
  width: min(520px, 86vw);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: pt-in 0.6s ease-out both;
}
@keyframes pt-in {
  from { opacity: 0; transform: translate(-50%, 24px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.pt-logo {
  width: clamp(64px, 11vh, 104px);
  height: auto;
  border-radius: 22%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  animation: pt-float 2.4s ease-in-out infinite alternate;
}
@keyframes pt-float {
  from { transform: translateY(0); }
  to   { transform: translateY(-8px); }
}

.pt-title {
  margin: 12px 0 14px;
  font-size: clamp(18px, 3.4vh, 28px);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-shadow: 0 3px 0 #1d3f8a, 0 6px 14px rgba(0, 0, 0, 0.5);
}

.pt-bar {
  position: relative;
  width: 100%;
  height: 18px;
  padding: 3px;
  box-sizing: border-box;
  border-radius: 999px;
  background: rgba(10, 20, 50, 0.75);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.pt-bar-fill {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(to bottom, #ffe27a, #ffb21e 60%, #f08a00);
  transform-origin: left center;
  transform: scaleX(0);
  overflow: hidden;
  will-change: transform;
}
.pt-bar-shine {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: pt-shine 1.4s ease-in-out infinite;
}
@keyframes pt-shine {
  from { transform: translateX(-120%); }
  to   { transform: translateX(380%); }
}

.pt-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}
#pt-percent { color: #ffd54a; font-variant-numeric: tabular-nums; }

.pt-tip {
  min-height: 2.6em;
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.3;
  text-align: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}
.pt-tip.show { opacity: 1; transform: translateY(0); }
.pt-tip b { color: #ffd54a; }

/* ---------------- Error ---------------- */
.pt-error {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 10, 25, 0.75);
}
.pt-error.show { display: flex; }
.pt-error-box {
  width: min(380px, 86vw);
  padding: 22px;
  border-radius: 16px;
  background: #13254f;
  border: 2px solid rgba(255, 255, 255, 0.85);
  text-align: center;
}
.pt-error-title { font-size: 18px; font-weight: 900; margin-bottom: 8px; }
.pt-error-msg { font-size: 13px; opacity: 0.8; margin-bottom: 16px; word-break: break-word; }
#pt-retry {
  font: inherit;
  font-weight: 900;
  font-size: 15px;
  padding: 10px 28px;
  border: 0;
  border-radius: 999px;
  color: #3a2200;
  background: linear-gradient(to bottom, #ffe27a, #ffb21e);
  cursor: pointer;
}

/* Chhoti height (landscape phone / chhota iframe) */
@media (max-height: 420px) {
  .pt-panel { bottom: 4%; }
  .pt-title { margin: 6px 0 8px; }
  .pt-tip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pt-bg, .pt-logo, .pt-bar-shine { animation: none; }
}

/* Fullscreen Button */
#pt-fullscreen {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  background: rgba(11, 21, 48, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}
#pt-fullscreen:hover {
  background: rgba(11, 21, 48, 0.9);
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.05);
}
#pt-fullscreen svg {
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  width: 20px;
  height: 20px;
}
