html, body { width: 100%; height: 100%; padding: 0; margin: 0; overflow: hidden; background: #231F20 }
/* dvh fills the true screen height on iOS 15+, including below the home bar.
   Falls back to 100% (already set above) on older browsers that lack dvh.    */
@supports (height: 100dvh) {
  html, body { height: 100dvh; }
}
#unity-container { position: absolute }
#unity-container.unity-desktop {
  left: 50%;
  top: 50%;
  width: min(390px, calc(100vw - 32px), calc((100vh - 32px) * 390 / 844));
  height: min(844px, calc(100vh - 32px), calc((100vw - 32px) * 844 / 390));
  transform: translate(-50%, -50%);
}
/* Mobile: stretch to fill the entire screen including safe-area insets.
   top/bottom padding pushes content away from the notch and home indicator.
   The background colour on html/body covers the inset bands so no black gap
   appears at the bottom or sides on notched iPhones.                         */
#unity-container.unity-mobile {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: env(safe-area-inset-left, 0px);
  right: env(safe-area-inset-right, 0px);
  bottom: env(safe-area-inset-bottom, 0px);
  width: auto;
  height: auto;
}
#unity-canvas { width: 100%; height: 100%; display: block; background: #231F20 }
#unity-canvas:focus { outline: none }
.unity-mobile #unity-canvas { width: 100%; height: 100% }
#unity-loading-bar { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none }
#unity-logo { width: 154px; height: 130px; background: url('unity-logo-dark.png') no-repeat center }
#unity-progress-bar-empty { width: 141px; height: 18px; margin-top: 10px; margin-left: 6.5px; background: url('progress-bar-empty-dark.png') no-repeat center }
#unity-progress-bar-full { width: 0%; height: 18px; margin-top: 10px; background: url('progress-bar-full-dark.png') no-repeat center }
#unity-footer { display: none; position: relative }
.unity-mobile #unity-footer { display: none }
#unity-logo-title-footer { float:left; width: 102px; height: 38px; background: url('unity-logo-title-footer.png') no-repeat center }
#unity-build-title { float: right; margin-right: 10px; line-height: 38px; font-family: arial; font-size: 18px }
#unity-fullscreen-button { cursor:pointer; float: right; width: 38px; height: 38px; background: url('fullscreen-button.png') no-repeat center }
#unity-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none }

/* ── Portrait-lock overlay ───────────────────────────────────────────────── */
#rotate-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at 50% 46%, #264A31, #152A1B);
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 38px;
  padding: 44px;
  direction: rtl;
}
#rotate-overlay.visible { display: flex; }
#rotate-overlay::before {
  content: 'برگ‌باز';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 44px;
  background: #2C1A0E;
  border-bottom: 1px solid rgba(201,168,76,.28);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #C9A84C;
  font-weight: 700;
  font-size: 14px;
  line-height: 44px;
  text-align: center;
}
.ro-stage {
  position: relative;
  width: 118px;
  height: 118px;
  flex-shrink: 0;
}
.ro-glow {
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,.18), transparent 70%);
  animation: ro-pulse 2.4s ease-in-out infinite;
}
@keyframes ro-pulse {
  0%, 100% { transform: scale(.9);  opacity: .6; }
  50%       { transform: scale(1.12); opacity: 1; }
}
.ro-arc {
  position: absolute;
  inset: 0;
  border: 1.5px dashed rgba(201,168,76,.35);
  border-radius: 50%;
}
.ro-card {
  position: absolute;
  top: 50%; left: 50%;
  width: 64px; height: 88px;
  margin: -44px 0 0 -32px;
  background: #F5F0E8;
  border-radius: 8px;
  border: 1px solid #D4C9B0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ro-spin 2.6s ease-in-out infinite;
}
.ro-card img { width: 100%; height: 100%; object-fit: cover; }
@keyframes ro-spin {
  0%, 100% { transform: rotate(0deg)   scale(1); }
  50%       { transform: rotate(90deg)  scale(1.04); }
}
.ro-txt { text-align: right; }
.ro-txt h1 {
  color: #F0E6C8;
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 8px;
}
.ro-txt p {
  color: #8FAE93;
  font-size: 12px;
  line-height: 1.7;
  margin: 0 0 16px;
}
.ro-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(201,168,76,.1);
  border: 1px solid rgba(201,168,76,.35);
  border-radius: 20px;
  padding: 6px 14px;
  color: #C9A84C;
  font-size: 11px;
  font-weight: 600;
}
.ro-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #C9A84C;
  animation: ro-blink .9s ease-in-out infinite;
}
@keyframes ro-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: .25; }
}
