/* General Page Styles */
.quintessential-regular {
  font-family: "Quintessential", serif;
  font-weight: 400;
  font-style: normal;
}

.cherish-regular {
  font-family: "Cherish", serif;
  font-weight: 400;
  font-style: normal;
}

/* General Page Styles */
html, body {
    margin: 0;
    overflow: hidden;
    background-color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    height: 100%;
    width: 100%;
    border: none;
}

/* Portal Container */
#portal-container {
    position: relative;
    width: 90vw; /* Make sure it's large enough */
    height: 87vh;
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    box-shadow: 0px 0px 30px rgba(138, 43, 226, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow: hidden; /* Prevent fog from overflowing */
    transition: width 0.5s ease-in-out, height 0.5s ease-in-out;

}

/* Portal Animation */
#portal {
    position: absolute;
    width: 350px;
    height: 350px;
    transition: transform 2s ease-in-out, opacity 1s ease-in-out;
    filter: drop-shadow(0px 0px 20px rgba(138, 43, 226, 0.8));
    z-index: 10;
    filter: hue-rotate(0deg); 
}

.open {
    transform: scale(5);
    opacity: 0;
}

/* Portal Image */
#portal img {
    width: 100%;
    height: 100%;
}

.portal-normal {
    animation: rotate 10s linear infinite;
}

.portal-fast {
    animation: rotate 1s linear infinite;
}


/* Animation */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Incantation Input */
#code-input-box {
    margin-top: 20px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: 2px solid #8A2BE2;
    border-radius: 8px;
    width: 500px;
    font-family: 'Cherish', cursive;
    font-size: 3em;
    text-align: center;
    box-shadow: 0px 0px 20px rgba(138, 43, 226, 0.8);
}
/* Expand portal-container to full height when portal opens */
#portal-container.expanded {
    position: fixed; /* <– Key to detach from previous layout */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    z-index: 10;
    transition: width 0.5s ease-in-out, height 0.5s ease-in-out;
}

/* Fade-out effect for the incantation input */
#code-input-box.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none; /* Prevents interaction while faded out */
}

/* Fade input back in when closed */
#code-input-box {
    transition: opacity 0.5s ease-in-out;
}

/* Video Iframe (🚨 BIG FIX HERE) */
#iframe-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 99%;  /* Ensuring it's large enough */
    height: 99%;
    display: none;  /* Initially hidden */
    z-index: 15;  /* Make sure it's on top */
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.2); /* Subtle, semi-transparent white border */
    border-radius: 15px; /* Round the corners */
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5); /* Optional shadow for better blending */
}

#iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    opacity: 1 !important;
    background-color: black !important;
}

/* Close Button */
#close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
    background-color: rgba(0, 0, 0, 0.7);
    color: red;
    font-family: 'Cherish', cursive;
    font-size: 2em;
    border: none;
    padding:5px;
    cursor: pointer;
    border-radius: 5px;
    display: none;
    box-shadow: 1px 1px 5px rgba(255, 255, 255, 0.8);
}

#close-button:hover {
    color: white;
    box-shadow: 1px 1px 5px rgba(255, 0, 0, 1);
}

/* ✨✨✨ Overlay (Ensuring it's on top) ✨✨✨ */
#overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    font-family: 'Quintessential', cursive;
    font-size: 2em;
    color: white;
    z-index: 20;
    transition: opacity 0.3s ease-in-out;
}

/* Hide overlay when the video starts */
#overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
}

#portal.shake {
    filter: hue-rotate(-200deg); 
    animation: shake .5s infinite;
}

/* Soft Background Fog Effect (Horizontal Scroll) */
@keyframes fog {
  0% { opacity: 0.6; transform: translateX(0px); }
  50% { opacity: 0.8; transform: translateX(-20px); } /* Move left */
  100% { opacity: 0.6; transform: translateX(0px); }
}


.fog-layer {
  position: absolute; /* Position inside portal-container */
  top: 0;
  left: 0;
  width: 130%;
  height: 130%;
  background: url('images/fog.png') repeat;
  opacity: 0.7;
  animation: fog 10s infinite linear;
  pointer-events: none;
}

