body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: black;
    user-select: none;
}

#overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%; /* Scale based on viewport width */
    height: auto;
    max-width: 100vw; /* Maximum width of the video container */
    max-height: 100vh; /* Maximum height of the video container */
    aspect-ratio: 16 / 9; /* Maintain 16:9 aspect ratio */
    background-color: black; /* Black bars for letterboxing */
    display: flex;
    justify-content: center;
    align-items: center;
}
/* Video that fills the overlay but maintains aspect ratio */
#NightTime, video {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensure no stretching, maintain aspect ratio */
    position: absolute;
    top: 0;
    left: 0;
    background-color: black; /* Black bars on sides for ultrawide monitors */
}


#NightTime {
    transition: opacity 4s ease;
}

video {
    opacity: 0;
    transition: opacity 4s ease;
    z-index: 1;  /* Video is behind the volume controls */
}

/* New styles for video container */
#video-container {
    position: relative;
    width: 100vw;
    height: 56.25vw; /* 56.25vw is 100vw * (9/16) to maintain 16:9 aspect ratio */
    max-height: 100vh;
    max-width: 177.78vh; /* 100vh * (16/9) */
    margin: 0 auto; /* Center horizontally */
    overflow: hidden;
    background-color: black; /* For letterboxing */
}

#video-container img,
#video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: fill; /* The container maintains aspect ratio, so fill the container */
}


/* Clickable areas */
.clickable {
    position: absolute;
    /* background-color: rgba(255, 0, 0, 0.3);*/  /* Debug visibility, can be removed */
    z-index: 5; /* Ensure clickable regions are on top of video */
    cursor: default;
}

/* Circular regions */
.clickable-circle {
    border-radius: 50%; /* Makes the region circular */
}

/* Rectangular clickable regions (default shape) */
.clickable-rect {
    border-radius: 0;
}

/* Specific clickable regions with custom positions */
#wantedPoster {
    top: 32.8%;
    left: 33.6%;
    width: 7%;
    height: 22%;
    transform: skew(-8deg, 14deg); 
}

#bookOnTable {
    top: 79.5%;
    left: 37.7%;
    width: 9.4%;
    height: 4.3%;
    transform: skew(-64.3deg, 5deg) rotate(3.9deg);
}

.clickable.disabled {
    pointer-events: none; /* Disable clicks */
    cursor: default;
}






/* Volume controls */
#volume-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    z-index: 2; /* Ensure the volume controls are on top */
    opacity: 0; /* Initially hidden */
    transition: opacity 1s ease;
}

#volume-controls.show {
    opacity: 1; /* Full visibility when initially shown */
}

#volume-controls.fade {
    opacity: 0.25; /* Fade to 25% opacity when not hovered */
}

#volume-controls.fade:hover {
    opacity: 1; /* Full opacity on hover */
}

/* Scaled-down volume icon */
#volume-icon {
    font-size: 18px; /* Scaled down */
    margin-right: 10px;
    cursor: pointer;
    color: white; /* White icon */
}

/* Adjusted slider styling */
#volume-slider {
    -webkit-appearance: none; /* Remove default appearance */
    width: 100px;
    height: 5px;
    background: linear-gradient(to right, white 100%, rgba(255, 255, 255, 0.5) 100%);
    border-radius: 5px; /* Rounded ends */
    outline: none;
    cursor: pointer;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none; /* Remove default appearance */
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%; /* Circular knob */
    background: white; /* White knob */
    cursor: pointer;
}

#volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white; /* White knob */
    cursor: pointer;
}

.default-cursor {
    cursor: default;
}







/* Image Viewer */
#image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#image-viewer.visible {
    display: flex;
    opacity: 1;
}

/* Viewer Content */
#viewer-content {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Prevent overflow outside viewer */
    cursor: grab;     /* Indicate draggable */
}

/* Change cursor when dragging */
#viewer-content.grabbing,
#viewer-content.grabbing #viewer-image {
    cursor: grabbing;
}


/* Viewer Image */
#viewer-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: center center;
    transform: translate(-50%, -50%) scale(1);
    cursor: grab; /* Indicate draggable */
    user-select: none; /* Prevent text selection */
    -webkit-user-drag: none; /* Prevent image dragging in WebKit browsers */
    transition: transform 0.3s ease, opacity 0.3s ease; /* Smooth zoom and fade transitions */
    opacity: 1;
}


.fade-out {
    opacity: 0;
}

.fade-in {
    opacity: 1;
}

/* Image Viewer Controls Container */
#image-viewer-controls {
    position: relative; /* Establishes a positioning context for child elements */
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allows clicks to pass through except for child elements */
}

/* Previous Navigation Controls */
.navigation-controls-left {
    position: absolute;
    top: 50%;
    left: 20px; /* Distance from the left edge */
    transform: translateY(-50%); /* Vertically center */
    display: flex;
    align-items: center;
    pointer-events: auto; /* Enables interaction for child elements */
}

.navigation-controls-left button {
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid #fff;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, color 0.3s;
}

.navigation-controls-left button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Next Navigation Controls */
.navigation-controls-right {
    position: absolute;
    top: 50%;
    right: 20px; /* Distance from the right edge */
    transform: translateY(-50%); /* Vertically center */
    display: flex;
    align-items: center;
    pointer-events: auto; /* Enables interaction for child elements */
}

.navigation-controls-right button {
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid #fff;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, color 0.3s;
}

.navigation-controls-right button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Top Right Controls */
.top-right-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px; /* Space between buttons */
    pointer-events: auto; /* Enables interaction for child elements */
}

.top-right-controls button {
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid #fff;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, color 0.3s;
}

.top-right-controls button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Specific Button Styling */
#close-image-viewer {
    font-size: 24px; /* Larger 'X' symbol */
}

#zoom-in,
#zoom-out {
    font-size: 20px; /* Consistent icon sizing */
}



/* Input Interface Styles */
#input-interface {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Remove display: none; */
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 100;
    opacity: 0;
    transition: opacity 1s ease; /* Adjust duration as desired */
    overflow: hidden;
    pointer-events: none; /* Prevent interaction when hidden */
}

#input-interface.visible {
    /* Remove display: block; */
    opacity: 1;
    pointer-events: auto; /* Enable interaction when visible */
}

/* Close Button for Input Interface */
#close-input-interface {
    position: absolute;
    top: 20px;
    right: 30px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid #fff;      /* Thin white border */
    border-radius: 5px;          /* Rounded corners */
    color: #fff;
    font-size: 24px;             /* Adjusted for consistency */
    line-height: 1;
    cursor: pointer;
    z-index: 101;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, color 0.3s;
}

/* Hover Effect for Close Button */
#close-input-interface:hover {
    background: rgba(255, 255, 255, 0.2); /* Slightly visible background on hover */
}


/* Telegram Container */
#telegram-container {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 60%;
    height: auto;
    z-index: 101;
}

/* Telegram Paper Container */
#telegram-paper-container {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: auto;
    overflow: visible;
    z-index: 1;
}

/* Telegram Paper Wrapper */
#telegram-paper-wrapper {
    position: absolute;
    bottom: 0;
    left: 17%;
    width: 65%;
    height: auto;
    max-height: 50vh;
    overflow: hidden;
    z-index: 1;
}

/* Telegram Paper */
#telegram-paper {
    width: 100%;
    height: auto;
    display: block;
    position: relative; /* Ensure relative positioning */
    z-index: 1;
    transform: translateY(100%); /* Start off-screen below */
    pointer-events: none;
    user-select: none;
}

#telegram-paper.animate {
    animation: slideInPaper 2s forwards;
    animation-delay: 5s;
    animation-timing-function: ease-out;
}
@keyframes slideInPaper {
    0% {
        transform: translateY(100%);
    }
    100% {
        transform: translateY(0%);
    }
}


/* Message Container */
#message-container {
    position: absolute;
    top: 10%; /* Adjust as needed */
    left: 10%;
    width: 80%;
    height: 80%;
    overflow: hidden; /* Hide overflow */
    z-index: 2;
}

#message-container::-webkit-scrollbar {
    display: none;
}

/* Individual Message */
.message {
    width: 100%;
    color: black;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.2em;
    margin-bottom: 10px;
}

/* Typewriter Cursor */
.cursor {
    display: inline-block;
    width: 1px;
    background-color: black;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* Telegram Machine Image */
#telegram-machine {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    z-index: 2;
    transform: translateY(100%); /* Start off-screen below */
    pointer-events: none;
    user-select: none;
}
#telegram-machine.animate {
    animation: slideInMachine 2s forwards;
    animation-delay: 4s;
    animation-timing-function: cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
@keyframes slideInMachine {
    0% {
        transform: translateY(100%);
    }
    80% {
        transform: translateY(10%); /* Slight overshoot */
    }
    100% {
        transform: translateY(0%);
    }
}


/* Input Controls */
#input-controls {
    position: absolute;
    bottom: 5%;
    left: 52%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 600px;
    display: flex;
    justify-content: center;
    z-index: 102;
    opacity: 0; /* Start hidden */
}

#input-controls.animate {
    animation: fadeInControls 1s forwards;
    animation-delay: 5s;
}

@keyframes fadeInControls {
    to {
        opacity: 1;
    }
}

#user-input {
    flex: 1;
    padding: 10px;
    font-size: 16px;
    background-color: #ffffffa6;
    border-color: #383838a8;
    border-radius: 5%;
    max-width: 500px;
}
#send-btn {
    padding: 10px 20px;
    font-size: 16px;
    margin-left: 10px;
    background-color: #ffffffa6;
    border-color: #383838a8;
    border-radius: 5%;
}

/* Animations */
.paper-printing {
    animation: printPaper 1s forwards;
}

@keyframes printPaper {
    from {
        bottom: -100%;
    }
    to {
        bottom: 0%;
    }
}
.prefix {
    font-weight: bold;
}


/* Slide Out to Left */
@keyframes slideOutLeft {
    from {
        transform: translate(-50%, -50%) translate(0px, 0px) scale(1);
    }
    to {
        transform: translate(-50%, -50%) translate(-100%, 0px) scale(1);
    }
}

.slide-out-left {
    animation: slideOutLeft 0.3s forwards;
}

/* Slide In from Right */
@keyframes slideInRight {
    from {
        transform: translate(-50%, -50%) translate(100%, 0px) scale(1);
    }
    to {
        transform: translate(-50%, -50%) translate(0px, 0px) scale(1);
    }
}

.slide-in-right {
    animation: slideInRight 0.3s forwards;
}

/* Slide Out to Right */
@keyframes slideOutRight {
    from {
        transform: translate(-50%, -50%) translate(0px, 0px) scale(1);
    }
    to {
        transform: translate(-50%, -50%) translate(100%, 0px) scale(1);
    }
}

.slide-out-right {
    animation: slideOutRight 0.3s forwards;
}

/* Slide In from Left */
@keyframes slideInLeft {
    from {
        transform: translate(-50%, -50%) translate(-100%, 0px) scale(1);
    }
    to {
        transform: translate(-50%, -50%) translate(0px, 0px) scale(1);
    }
}

.slide-in-left {
    animation: slideInLeft 0.3s forwards;
}



.fancybox__image {
    max-width: none;
    max-height: none;
  }
  
.fancybox__backdrop{
    background-color: rgba(0 0 0 / 82%) !important;
}
  

/* Customize Fancybox toolbar buttons */
.fancybox__toolbar .f-button {
    border: 2px solid white;
    border-radius: 5px; /* Adjust for more or less rounding */
    background: transparent; /* Make the background transparent */
    color: white; /* Ensure icons are visible */
    padding: 5px; /* Adjust as needed */
  }
  
  /* Adjust hover effect */
  .fancybox__toolbar .f-button:hover {
    background: rgba(255, 255, 255, 0.1); /* Optional hover background */
  }
  

  .fancybox__nav .f-button:before{
border: 2px solid white;
border-radius: 5px;
background: transparent;
color: white;
padding: 5px;

  }


  .clock-container {
    position: relative;
    width: 9vw;
    height: 8.6vw;
    top: 20.9%;
    left: 19%;
    z-index: 50;
    transform: skew(2deg, 7deg);

}



/* Common styles for both hands */
.clock-hand {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: center 84%; /* Pivot at the center bottom */
    transform: translate(-50%, -100%) rotate(0deg);
    transition: transform 0.5s ease-in-out;
    pointer-events: none; /* Allows clicks to pass through the hands */
}

/* Hour Hand Specific Styles */
#hour-hand {
    width: 50%; /* Scale down to 60% of the container's width */
    height: 40%; /* Adjust to 60% to ensure it doesn't overflow */
    z-index: 50; /* Ensure hour hand is above the minute hand */
    color: #211306; /* Hand color */
}

#hour-hand svg {
    width: 100%;
    height: 100%;
    /* No additional scaling needed as SVG is adjusted */
}

/* Minute Hand Specific Styles */
#minute-hand {
    width: 80%; /* Scale down to 80% of the container's width */
    height: 40%; /* Adjust to 80% to ensure it doesn't overflow */
    z-index: 50;
    color: #211306; /* Hand color */
}

#minute-hand svg {
    width: 100%;
    height: 100%;
    /* No additional scaling needed as SVG is adjusted */
}