/**
 * HUD Styles
 * Immersive UI overlay for Escapepolis
 * Redesigned as centered 965px container layout
 */

/* ==========================================================================
   CSS Variables for HUD
   ========================================================================== */
:root {
    /* HUD Colors */
    --hud-color-primary: #ff6b00;
    --hud-color-primary-glow: rgba(255, 107, 0, 0.3);
    --hud-color-gold-glow: rgba(212, 168, 75, 0.5);
    /* --hud-max-width: 940px; */
    --hud-max-width: 1160px;
    --hud-transition-fast: 0.2s ease;
    --hud-z-wrapper: 100;
}

/* ==========================================================================
   HUD Background
   ========================================================================== */

.hud-background {
    width: 100%;
    background-color: #091520;
    border-radius: 10px;
    padding: 10px 5px 5px 5px;
    border: 1px solid #132D51;
    outline: 1px solid #091520;
    box-shadow: 0px 0px 10px rgba(255, 107, 0, 0.7), inset 0px 0px 5px var(--hud-color-primary-glow);
}

/* ==========================================================================
   HUD Wrapper - Main Container
   ========================================================================== */
.hud-wrapper {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    z-index: var(--hud-z-wrapper);
    display: grid;
    /* grid-template-columns: 220px 480px 200px; */
    grid-template-columns: 220px 700px 200px;
    grid-template-rows: auto;
    align-items: stretch;
    gap: 5px;
    padding: 15px;
    justify-content: space-between;
    overflow: visible;
}
.home .hud-wrapper {
	pointer-events:all;
}
body:not(.home) .hud-wrapper,
.home .hud-wrapper.is-scrolled {
    pointer-events: none;
}

.hud-wrapper.home-hud {
    max-width: var(--hud-max-width);
    bottom: 70px;
}

/* ==========================================================================
   HUD Layout - Three Column Structure
   ========================================================================== */
.hud-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-self: stretch;
    grid-column: 1;
    overflow: hidden;
    pointer-events: all;
}

.hud-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-self: stretch;
    grid-column: 3;
    overflow: hidden;
    min-width: 220px;
    pointer-events: all;
}

/* ==========================================================================
   HUD Left - Video Carousel Player (Owl Carousel)
   ========================================================================== */

.video-container {
    position: relative;
}

.hud-video-background {
    position: absolute;
    top: -4px;
    left: 50%;
    width: 180px;
    height: 10px;
    box-shadow: 0px 5px 4px 4px var(--orange);
    border-radius: 6px;
    background: radial-gradient(circle, rgba(79, 56, 73, 1) 50%, rgba(92, 54, 31, 1) 100%);
    transform: translateX(-50%);

    &::before {
        content: "";
        position: absolute;
        z-index: -1;
        inset: 0;
        border-radius: inherit;
        border: 1px solid transparent;
        background: linear-gradient(rgba(255, 255, 255, 0.5), rgba(189, 189, 189, 0.6)) border-box;
        mask: linear-gradient(black, black) border-box,
            linear-gradient(black, black) padding-box;
        mask-composite: subtract;
    }
}

.hud-video-player {
    width: 100%;
    flex: 1;
}

.hud-video-carousel {
    background: hsl(from var(--surface-3) h s l / 0.25);
    backdrop-filter: blur(12px);
    padding: 3px;
    -webkit-box-shadow: 0px 5px 7px 2px #162561;
    box-shadow: 0px 5px 7px 2px #162561;

    &::before {
        content: "";
        position: absolute;
        z-index: -1;
        inset: 0;
        border-radius: inherit;
        border: 1px solid transparent;
        background: linear-gradient(rgba(255, 255, 255, 0.3), rgba(189, 189, 189, 0.3)) border-box;
        mask: linear-gradient(black, black) border-box,
            linear-gradient(black, black) padding-box;
        mask-composite: subtract;
    }

    &::after {
        content: "";
        position: absolute;
        z-index: 1;
        border: 1.5px solid var(--orange);
        outline: 1.5px solid rgba(255, 255, 255, 0.7);
        width: calc(100% - 6px);
        height: calc(100% - 6px);
        top: 50%;
        left: 50%;
        border-radius: inherit;
        transform: translate(-50%, -50%);
    }

    .swiper-wrapper {
        border-radius: inherit;
        overflow: hidden;
    }
}

/* Swiper Carousel Styles */
.hud-video-carousel.swiper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 6px;
}

.hud-video-carousel .swiper-wrapper {
    height: 100%;
}

.hud-video-carousel .swiper-slide {
    height: 100%;
    opacity: 0 !important;
    transition: opacity 0.8s ease;
    pointer-events: none;

    iframe {
        
    }
}

.hud-video-carousel .swiper-slide::before {
    content:"";
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: #000;
    transition: var(--main-easing);
    z-index: 10;
    opacity: 0;
}
.hud-video-carousel .swiper-slide.loading::before {
    opacity: 1;
}

.hud-video-carousel .swiper-slide-active {
    opacity: 1 !important;
}

/* Video Slides */
.video-slide {
    position: relative;
    width: 100%;
    height: 100%;
    background: #1a1a2e;
}

.video-slide video,
.video-slide .video-iframe {
    width: 100%;
    height: 100%;
    display: block;
}

.video-slide video {
    object-fit: cover;
}

.video-embed-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #1a1a2e;
}

.video-embed-wrapper iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    transform: translate(-50%, -50%);
    border: 0;
}

/* Room Info Overlay */
.video-room-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 0.5rem 0.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    text-decoration: none;
    transition: background 0.3s ease;
    z-index: 5;
}

.video-room-info:hover {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.3) 100%);
}

.video-room-info .room-name {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Placeholder when no videos */
.video-placeholder {
    display: flex;
    align-items: center;
    width: 215px;
    height: 105px;
    aspect-ratio: 16/9;
}

.video-placeholder .placeholder-content {
    color: var(--hud-color-primary);
    font-size: 0.75rem;
    text-align: center;
    padding: 1rem;
}

.video-arrows {
    --swiper-navigation-size: 20px;
    --swiper-navigation-color: #FFA360;
    opacity: 0;
    transition: opacity var(--hud-transition-fast);
}

.video-container:hover .video-arrows {
    opacity: 1;
}

/* ==========================================================================
   HUD Right - Action Buttons
   ========================================================================== */
.hud-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    height: 100%;
}

.hud-btn {
    font-size: 16px;
    padding: 6px 0;
}

/* Blue/Cyan buttons (Game Hub, Gift Shop) - Filled style */
.hud-btn-secondary {
    text-align: center;
}

.hud-btn-orange-1 {
    grid-column: 1 / 3;
}

.hud-btn-orange-2 {
    grid-column: 1 / 3;
}

/* ==========================================================================
   HUD Center - Room Carousel Section
   ========================================================================== */
.hud-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    overflow: visible;
    position: relative;
    min-height: 80px;
    grid-column: 2;
}

/* ==========================================================================
   Room Carousel (Swiper Coverflow) - Oval Cards
   ========================================================================== */
.hud-carousel-wrapper {
    position: absolute;
    bottom: calc(100% - 30px);
    left: 50%;
    transform: translateX(-50%);
    width: 410px;
    height: 220px;
    z-index: 20;
}

/* Swiper Container */
.room-carousel.swiper {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Swiper Slides */
.room-carousel .swiper-slide {
    width: 120px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.room-carousel .swiper-slide:not(.swiper-slide-visible) {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.room-card-item {
    padding: 0;
    display: flex;
    justify-content: center;
}

/* Room Card - Pill/Oval Shape */
.room-card {
    display: block;
    text-decoration: none;
}

/* Default card size - 83x140 (outer cards) */
.room-card-frame {
    position: relative;
    width: 83px;
    height: 140px;
    border: 2px solid var(--off-orange);
    border-radius: 45px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow:
        0 0 8px var(--d-orange),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Adjacent slides - 100x170 */
.room-carousel .swiper-slide-prev .room-card-frame,
.room-carousel .swiper-slide-next .room-card-frame {
    width: 100px;
    height: 170px;
    border-radius: 55px;
}

/* Center slide - 120x205 */
.room-carousel .swiper-slide-active .room-card-frame {
    width: 120px;
    height: 205px;
    border-radius: 65px;
    border-width: 2px;
    box-shadow: 0 0 15px var(--d-orange);
}

.room-card-frame:hover {
    transform: translateY(-3px);
    box-shadow:
        0 5px 25px var(--hud-color-gold-glow),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.room-card-image {
    width: 100%;
    height: 100%;
}

.room-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.room-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.4rem 0.3rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), transparent);
}

.room-card-title {
    /*font-size: 0.5rem;
    color: #fff;
    text-transform: uppercase;
    text-align: center;
    display: block;
    line-height: 1.2;*/
    display: none;
}

.room-card-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(ellipse at center top, rgba(212, 168, 75, 0.2) 0%, transparent 60%);
}

/* ==========================================================================
   Location Navigation - Prev / Location / Next
   ========================================================================== */
.hud-nav-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding-top: 10px;
}

.hud-location-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    width: 100%;
    padding: 0 20px;
}

.hud-prev-room,
.hud-next-room {
    display: flex;
    align-items: center;
    gap: 5px;
    /* font-size: 0.5rem; */
    font-size: 13px;
    color: #FFA360;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all var(--hud-transition-fast);
    white-space: nowrap;
    min-width: 150px;
}

.hud-next-room {
    justify-content: right;
}

.hud-prev-room:hover,
.hud-next-room:hover {
    color: #fff;
    text-shadow: 0 0 10px var(--hud-color-primary-glow);
}

.hud-prev-room .nav-arrow,
.hud-next-room .nav-arrow {
    font-size: 0.8rem;
}

/* Location Indicator */

.location-name {
    /* font-size: 9px; */
    font-size: 13px;
}

/* ==========================================================================
   Ticker - Inside hud-center
   ========================================================================== */
.hud-ticker {
    width: 100%;
    max-width: 100%;
    height: 35px;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 1);
    border-radius: 10px;
    box-shadow: 0 0 10px var(--hud-color-primary-glow);
    position: relative;
}

.ticker-glass {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% + 6px);
    height: calc(100% + 7px);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(255, 107, 0, 0.5), inset 0 0 15px rgba(255, 107, 0, 0.4);

    &::before {
        content: "";
        position: absolute;
        z-index: -1;
        inset: 0;
        border-radius: inherit;
        border: 1px solid transparent;
        background: linear-gradient(rgba(255, 255, 255, 0.3), rgba(189, 189, 189, 0.1)) border-box;
        mask: linear-gradient(black, black) border-box,
            linear-gradient(black, black) padding-box;
        mask-composite: subtract;
    }
}

.ticker-wrapper {
    height: 100%;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.ticker-content {
    display: flex;
	animation: tickerScroll 40s linear infinite;
    white-space: nowrap;
}

.ticker-text {
    padding: 0 0.75rem;
    font-size: 12px;
    color: var(--off-orange);
    text-shadow: 0 0 5px var(--d-orange), 0 0 5px var(--d-orange);
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes tickerScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* ==========================================================================
   Responsive - New Grid-based Layout
   ========================================================================== */

@media (max-width: 1200px) {   
  /* Hud Responsive */
  .hud-wrapper .hud-left, 
  .hud-wrapper .hud-right {display: none !important;}
  .hud-wrapper {display: block;}
  .hud-nav-wrapper {width: calc(100vw - 40px);}
  .hud-wrapper.home-hud {bottom: 0 !important;}
  .hud-carousel-wrapper {bottom: 100%;}
  /* End Hud Responsive */

  /* Default card size - 83x140 (outer cards) */
  .room-carousel .swiper-slide,
  .room-carousel .swiper-slide-prev .room-card-frame,
  .room-carousel .swiper-slide-next .room-card-frame,
  .room-card-frame {width: 83px;height: 140px;}
  .room-carousel .swiper-slide-active .room-card-frame {width: 83px;height: 140px;}
  .hud-carousel-wrapper {height: 160px;}

}

@media (max-width: 900px) {
    /* .hud-wrapper {
        grid-template-columns: 180px 1fr 160px;
        gap: 10px;
        padding: 12px;
    } */

    /* .room-card-frame {
        width: 65px;
        height: 90px;
        border-radius: 32px;
    }

    .room-carousel .owl-item.active.center .room-card-frame {
        width: 80px;
        height: 110px;
        border-radius: 40px;
    } */
}

@media (max-width: 768px) {
    /* .hud-wrapper {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        gap: 12px;
        bottom: 10px;
        width: calc(100% - 20px);
    } */

    .hud-wrapper span.nav-text {display: none;}
    .hud-prev-room, .hud-next-room {min-width: initial;}
    .hud-prev-room .nav-arrow, .hud-next-room .nav-arrow {
        font-size: 24px;
        line-height: 1;
    }

    .hud-left {
        order: 2;
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    .hud-video-player {
        max-width: 200px;
    }

    .hud-center {
        order: 1;
    }

    .hud-right {
        order: 3;
    }

    .hud-actions {
        grid-template-columns: repeat(4, 1fr);
    }

    .hud-btn-orange-1,
    .hud-btn-orange-2 {
        grid-column: auto;
    }

    .hud-ticker {
        order: 4;
    }

    /* .room-card-frame {
        width: 55px;
        height: 75px;
        border-radius: 28px;
    }

    .room-carousel .owl-item.active.center .room-card-frame {
        width: 70px;
        height: 95px;
        border-radius: 35px;
    } */

    .hud-location-navigation {
        flex-wrap: wrap;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .hud-center * {
        pointer-events: all;
    }
    .hud-wrapper {
        padding: 10px;
        gap: 10px;
    }

    .hud-left {
        flex-direction: column;
    }

    .hud-video-player {
        max-width: 100%;
    }

    .hud-actions {
        grid-template-columns: 1fr 1fr;
    }

    .hud-btn-orange-1,
    .hud-btn-orange-2 {
        grid-column: 1 / 3;
    }

    .hud-btn {
        font-size: 0.6rem;
        padding: 0.5rem 0.4rem;
    }

    .room-card-frame {
        width: 45px;
        height: 62px;
        border-width: 2px;
        border-radius: 22px;
    }

    .room-carousel .owl-item.active.center .room-card-frame {
        width: 60px;
        height: 82px;
        border-radius: 30px;
    }

    /*.room-card-title {
        font-size: 0.4rem;
    }*/

    .location-name {
        font-size: 8px;
    }

    .hud-location-indicator {
        padding: 0.3rem 1rem;
    }
    .hud-location-navigation {
        padding: 0;
        gap: 2px;
    }
}