ls · CSS
Copy

/* ============================================================
   UTILS.CSS — DigiOpo
   Apuluokat, scroll-to-top, pelioverlay, loader
   ============================================================ */
 
/* --- Apuluokat --------------------------------------------- */
 
.is-hidden {
  display: none !important;
}

/* --- Scroll to top ----------------------------------------- */

#scrollTopBtn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: #4f46e5;
  color: white;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 800;
}

#scrollTopBtn.nakyvissa {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#scrollTopBtn:hover {
  background: #3730a3;
  transform: translateY(-2px);
}

#scrollTopBtn:focus-visible {
  outline: 3px solid #a5b4fc;
  outline-offset: 2px;
}

/* --- Peli-overlay (fullscreen) ----------------------------- */

.peli-overlay {
  position: fixed;
  inset: 0;
  background: #eef1f4;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 9999;
}

.peli-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.peli-frame {
  width: 100%;
  height: 100%;
  border: none;
}

.peli-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #ff8c00;
  border: 3px solid #000;
  border-radius: 20px;
  padding: 8px 14px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 3px 3px 0 #000;
  z-index: 10000;
}

/* --- Game wrapper (iframe-pohjainen peli) ------------------ */

.game-wrapper {
  position: relative;
  width: 100%;
  height: calc(100vh - 80px);
}

#gameFrame {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 10px;
}

.game-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: white;
  z-index: 5;
}

.loader {
  width: 40px;
  height: 40px;
  border: 4px solid #ddd;
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
