html, body {
  padding: 0;
  margin: 0;
  background: #000;
}

/* Mobile video fallback (no WebGL); shown only with .rivelo-mobile-fallback--active + hidden removed in JS */
#rivelo-mobile-fallback:not(.rivelo-mobile-fallback--active) {
  display: none !important;
}
#rivelo-mobile-fallback.rivelo-mobile-fallback--active {
  display: flex !important;
  position: fixed;
  inset: 0;
  z-index: 1;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  padding:
    max(16px, env(safe-area-inset-top, 0px))
    max(16px, env(safe-area-inset-right, 0px))
    max(16px, env(safe-area-inset-bottom, 0px))
    max(16px, env(safe-area-inset-left, 0px));
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
}
.rivelo-mobile-fallback-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: min(100%, 960px);
  max-height: 100%;
  min-height: 0;
  gap: 12px;
}
#rivelo-mobile-fallback-video {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  /* Reserve space for native controls + error line + gap (tweak if controls feel tight) */
  max-height: calc(100vh - 140px);
  max-height: calc(100dvh - 140px);
  object-fit: contain;
  background: #000;
}
.rivelo-mobile-fallback-error {
  margin: 0;
  padding: 12px 14px;
  max-width: 100%;
  text-align: center;
  font-family: arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  color: #1a1a1a;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

#unity-container { position: absolute }
#unity-container.unity-desktop { left: 50%; top: 50%; transform: translate(-50%, -50%) }
#unity-container.unity-mobile { position: fixed; width: 100%; height: 100% }
#unity-canvas {
  --unity-canvas-bg: #231F20;
  background: #000;
}
.unity-mobile #unity-canvas { width: 100%; height: 100% }
#unity-loading-bar { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none }
#unity-progress-bar-empty { width: 141px; height: 18px; 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 { position: relative; min-height: 38px }
.unity-mobile #unity-footer { display: none }
#unity-fullscreen-button {
  cursor: pointer;
  float: right;
  width: 38px;
  height: 38px;
  border: none;
  padding: 0;
  /* url() is relative to this CSS file (TemplateData/), same folder as the PNG */
  background: transparent url("fullscreen-icon.png") no-repeat center / contain;
}
#unity-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none }

.rivelo-share-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
}

.rivelo-share-frame {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  width: min(560px, calc(100vw - 32px));
}

.rivelo-share-close {
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  background: #000;
  color: #ffffff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.rivelo-share-close:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.95);
}

.rivelo-share-close:active {
  transform: translateY(1px);
}

.rivelo-share-close:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.rivelo-share-panel {
  width: 100%;
  background: #000;
  border-radius: 14px;
  padding: 18px 18px 16px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  font-family: arial, sans-serif;
  color: #ffffff;
}

.rivelo-share-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 16px;
}

.rivelo-share-title-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.rivelo-share-title-wrap::before,
.rivelo-share-title-wrap::after {
  content: "";
  height: 2px;
  flex: 1 1 auto;
  background: rgba(255, 255, 255, 0.7);
}

.rivelo-share-title {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.2px;
  line-height: 1.1;
  padding: 0 6px;
}

.rivelo-share-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.rivelo-share-action {
  border: 2px solid rgba(255, 255, 255, 0.65);
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  padding: 14px 16px;
  border-radius: 6px;
  font-size: 22px;
  text-align: left;
  color: #ffffff;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.rivelo-share-action:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.8);
}

.rivelo-share-action:active {
  transform: translateY(1px);
}

.rivelo-share-action-inner {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  width: 100%;
}

.rivelo-share-action-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.92);
}

.rivelo-share-action-icon svg {
  width: 30px;
  height: 30px;
  display: block;
}

.rivelo-share-action-label {
  text-align: center;
}

.rivelo-share-status {
  margin-top: 14px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.2px;
  min-height: 1.4em;
  text-align: center;
  color: rgba(255, 255, 255, 0.92);
}
