@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&display=swap');

body { padding: 0; margin: 0;  font-family: 'Merriweather', serif; line-height: 25px!important; }

#unity-container { position: fixed; width: 100%; height: 100%;padding: 0; margin: 0 }

#unity-canvas { width: 100%; height: 100%; background: #000000 }

#unity-loading-bar { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);   display: block; }

#unity-logo { width: 154px; height: 130px; background: url('unity-logo-dark.png') no-repeat center }

#unity-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none }

#unity-loading-bar {
  width: 300px; /* fixed width for simpler % calc */
  margin: 0 auto;
  margin-top: 20px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

#unity-progress-bar-empty {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
}

#unity-progress-bar-full {
  height: 100%;
  width: 0%;
  background: white;
 }


#unity-progress-text {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(50% + 10px); 
  color: white;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 1000;
  pointer-events: none;
  text-align: center;
}

#unity-loading-bar,
#unity-progress-text {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#unity-loading-bar.visible,
#unity-progress-text.visible {
  opacity: 1;
}

.fade-out {
  opacity: 0 !important;
}

  /* Full-screen rotate overlay (hidden by default) */
  #rotate-overlay {
    position: fixed;
    inset: 0;
    background: #000000;
    color: #fff;
    display: none;                 /* default hidden; media query/JS will show */
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 2147483647;           /* above everything, including Unity canvas */
    padding: 32px;
    pointer-events: all;           /* capture taps/clicks */
  }
  #rotate-overlay .box {
    max-width: 28rem;
    margin: 0 auto;
  }
  #rotate-overlay .emoji {
    font-size: 56px;
    line-height: 1;
    display: block;
    margin-bottom: 16px;
  }
  #rotate-overlay h1 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 700;
  }
  #rotate-overlay p {
    margin: 0;
    opacity: 0.85;
    font-size: 16px;
  }

  /* Pure-CSS: show overlay on portrait for typical device widths */
  @media screen and (orientation: portrait) and (max-width: 1200px) {
    #rotate-overlay { display: flex; }
  }

  /* When overlay is visible, prevent background scroll */
  body.rotate-lock {
    overflow: hidden;
    touch-action: none;
  }
  
    /* Intro overlay */
  #intro-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;             /* black backdrop */
    color: #fff;
    z-index: 2147483646;          /* just under rotate overlay if you use it */
    pointer-events: auto;
  }
  #intro-overlay[hidden] { display: none; }

  #intro-overlay .intro-box {
    text-align: center;
    padding: 32px 24px;
    max-width: 720px;
    width: min(90vw, 720px);
  }

  #intro-overlay h1 {
    font-weight: 800;
    letter-spacing: 0.06em;
    font-size: clamp(22px, 5vw, 36px);
    margin: 0 0 28px 0;
  }

  #intro-overlay .btn-primary {
    display: inline-block;
    border: none;
    padding: 14px 22px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    background: #ffffff;
    color: #000000;
    transition: transform 120ms ease, opacity 120ms ease;
  }
  #intro-overlay .btn-primary:active { transform: scale(0.98); }

  #intro-overlay .btn-link {
    display: block;
    margin: 10px auto 18px auto;
    background: none;
    border: none;
    color: white;
    text-decoration: underline;
    font-size: 14px;
    cursor: pointer;
  }

  #intro-overlay .copyright {
    margin: 0;
    font-size: 12px;
    color: white;
  }

  /* Optional: prevent background scroll while intro is up */
  body.intro-lock {
    overflow: hidden;
    touch-action: none;
  }