/* ========================================
   YULETIDE PROJECTOR STYLES
   ======================================== */

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background: #000;
    overscroll-behavior: none;
}

.grecaptcha-badge {
    display: none !important;
}

/* ===== FULLSCREEN CONTAINER ===== */
.yule-fullscreen {
    position: fixed;
    inset: 0;
    margin: 0;
    padding: 0;
    background: #000;
    z-index: 9999;
    display: flex;
    align-items: stretch;
    justify-content: center;
    overflow: hidden;
}

.yule-projector {
    width: 100%;
    min-height: 100%;
    color: #fff;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: #000;
    background-attachment: fixed;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* ===== DESKTOP LAYOUT ===== */
.yule-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-rows: 1fr auto;
    padding: 16px 40px 40px;
    box-sizing: border-box;
    backdrop-filter: blur(2px);
    position: relative;
}

.yule-brand {
    position: absolute;
    left: 50%;
    top: 5px;
    transform: translateX(-50%);
    z-index: 2;
    text-align: center;
    pointer-events: none;
}

.yule-brand img {
    display: block;
    margin: 0 auto;
    width: 28vw;
    max-width: 300px;
    height: auto;
    filter: drop-shadow(0 2px 10px rgba(0,0,0,.45));
}

.yule-columns {
    align-self: center;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    padding-top: 90px; /* Reduced for more vertical space */
}

.yule-col {
    width: 22%;
    min-width: 220px;
    max-width: 340px;
    flex-shrink: 0;
}

.yule-heat-title {
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: 2px;
    font-weight: 800;
    font-size: 24px;
}

.yule-band-tile {
    background: #000;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    opacity: 0.9;
    transition: opacity 0.6s ease, box-shadow 0.3s ease, outline 0.3s ease;
    box-shadow: 0 0 8px rgba(0,0,0,0.8);
}

.yule-band-tile.active {
    opacity: 1;
    outline: 3px solid #ffffff;
    box-shadow: 0 0 20px rgba(255,0,0,0.9), 0 0 40px rgba(255,0,0,0.6), 0 0 60px rgba(139,0,0,0.4);
    animation: activePulse 3s ease-in-out infinite;
}

@keyframes activePulse {
    0%, 100% { 
        transform: scale(1) rotate(0deg); 
        box-shadow: 0 0 20px rgba(255,0,0,0.9), 0 0 40px rgba(255,0,0,0.6), 0 0 60px rgba(139,0,0,0.4);
    }
    25% { 
        transform: scale(1.03) rotate(0.5deg); 
        box-shadow: 0 0 25px rgba(255,0,0,1), 0 0 50px rgba(255,0,0,0.7), 0 0 80px rgba(139,0,0,0.5);
    }
    50% { 
        transform: scale(1) rotate(0deg); 
        box-shadow: 0 0 20px rgba(255,0,0,0.9), 0 0 40px rgba(255,0,0,0.6), 0 0 60px rgba(139,0,0,0.4);
    }
    75% { 
        transform: scale(1.03) rotate(-0.5deg); 
        box-shadow: 0 0 25px rgba(255,0,0,1), 0 0 50px rgba(255,0,0,0.7), 0 0 80px rgba(139,0,0,0.5);
    }
}

.yule-band-tile.played {
    opacity: 0.5;
}

/* Pre-draw shuffle - no opacity fade, instant swaps */
.yule-band-tile.shuffling {
    opacity: 1;
}

/* Locked bands (previously drawn) - solid black glow */
.yule-band-tile.locked {
    opacity: 1;
    box-shadow: 0 0 20px rgba(0,0,0,1), 0 0 40px rgba(0,0,0,0.8);
}

/* Just locked band (most recently drawn) - elastic scale + bounce + gold glow fading to black */
.yule-band-tile.locked.just-locked {
    animation: elasticPop 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards, 
               crazyBounce 0.6s ease-in-out 0.8s infinite, 
               glowFade 4s ease-out forwards;
    box-shadow: 0 0 35px rgba(255,215,0,1), 0 0 70px rgba(255,215,0,0.6);
}

/* Elastic pop-in animation - starts at 1.5x, snaps down to 1x */
@keyframes elasticPop {
    0% { transform: scale(1.5); }
    30% { transform: scale(0.9); }
    50% { transform: scale(1.1); }
    70% { transform: scale(0.97); }
    85% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes crazyBounce {
    0%, 100% { transform: scale(1) rotate(0deg); }
    15% { transform: scale(1.06) rotate(-1.5deg); }
    30% { transform: scale(0.96) rotate(1.5deg); }
    45% { transform: scale(1.04) rotate(-1deg); }
    60% { transform: scale(0.98) rotate(1deg); }
    75% { transform: scale(1.02) rotate(-0.5deg); }
    90% { transform: scale(1) rotate(0.5deg); }
}

@keyframes glowFade {
    0% { box-shadow: 0 0 35px rgba(255,215,0,1), 0 0 70px rgba(255,215,0,0.6); }
    40% { box-shadow: 0 0 28px rgba(220,180,0,0.7), 0 0 50px rgba(180,130,0,0.4); }
    70% { box-shadow: 0 0 22px rgba(100,80,0,0.4), 0 0 35px rgba(50,40,0,0.2); }
    100% { box-shadow: 0 0 20px rgba(0,0,0,1), 0 0 40px rgba(0,0,0,0.8); }
}

.yule-band-logo {
    width: 52px;
    height: 52px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yule-band-logo img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.yule-band-text {
    display: flex;
    flex-direction: column;
}

.yule-band-name {
    font-size: 20px;
    line-height: 1.15;
    font-weight: 800;
}

.yule-band-time {
    font-size: 20px;
    opacity: 0.8;
}

/* ===== CENTER AREA ===== */
.yule-center {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 90px; /* Push logo down below brand */
}

/* ===== CORNER LOGOS ===== */
.yule-corner-logo {
    position: fixed;
    width: 150px;
    height: 150px;
    z-index: 50;
    pointer-events: none;
}

.yule-corner-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.yule-corner-logo.bottom-left {
    left: 22px;
    bottom: 22px;
}

.yule-corner-logo.bottom-right {
    right: 22px;
    bottom: 22px;
}

.yule-main-logo {
    position: relative;
    width: 100%;
    max-width: 850px;
    height: 650px;
}

.yule-main-logo > img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Hide mobile view on desktop */
.yule-mobile-view {
    display: none;
}

.yule-mobile-timer-bar {
    display: none;
}

/* ===== FOOTER TIMER (DESKTOP) ===== */
.yule-footer {
    text-align: center;
    font-size: 18px;
    margin-top: 14px;
}

.yule-timer {
    margin-top: 4px;
    font-weight: 800;
    letter-spacing: 2px;
    font-size: 140px;
    line-height: 1;
    transition: color 0.3s;
}

.yule-timer.over {
    color: #ff3b30;
}

/* ===== MOBILE TOP TIMER (hidden on desktop) ===== */
.yule-top-timer {
    display: none;
    text-align: center;
    font-weight: 900;
    letter-spacing: 1px;
    margin-top: 6px;
}

.yule-top-timer.over {
    color: #ff3b30;
}

/* ========================================
   MOBILE PORTRAIT LAYOUT
   ======================================== */
@media (max-width: 900px) and (orientation: portrait) {
    /* Reset everything for mobile portrait */
    html, body {
        height: 100%;
        margin: 0;
        padding: 0;
        overflow: hidden;
        background: #000 !important;
        touch-action: none;
    }
    
    .yule-fullscreen {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        overflow: hidden;
        background: #000;
    }
    
    .yule-projector {
        width: 100%;
        height: 100%;
        overflow: hidden;
        background: #000;
    }
    
    /* Hide desktop view on mobile portrait */
    .yule-desktop-view {
        display: none !important;
    }
    
    /* Hide corner logos on mobile portrait */
    .yule-corner-logo {
        display: none !important;
    }
    
    /* Mobile view container */
    .yule-mobile-view {
        display: block !important;
        width: 100%;
        height: 100%;
        position: relative;
    }
    
    /* ===== FIXED HEADER ===== */
    .yule-mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 38vh;
        min-height: 220px;
        max-height: 300px;
        background: linear-gradient(180deg, rgba(0,0,0,0.98) 0%, rgba(0,0,0,0.92) 100%);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(255,255,255,0.1);
        display: flex;
        flex-direction: column;
        padding: 12px 16px;
        padding-top: calc(12px + env(safe-area-inset-top, 0px));
        box-sizing: border-box;
        z-index: 100;
    }
    
    /* Top row: brand logo + timer */
    .yule-mobile-header-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px;
    }
    
    .yule-mobile-brand {
        flex-shrink: 0;
    }
    
    .yule-mobile-brand img {
        height: 80px;
        width: auto;
        filter: drop-shadow(0 2px 6px rgba(0,0,0,.5));
    }
    
    .yule-mobile-timer {
        font-size: 36px;
        font-weight: 900;
        letter-spacing: 2px;
        line-height: 1;
        font-variant-numeric: tabular-nums;
        transition: color 0.3s;
    }
    
    .yule-mobile-timer.over {
        color: #ff3b30;
    }
    
    /* Current band area */
    .yule-mobile-current-band {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        flex: 1;
        min-height: 0;
        padding: 10px 0;
    }
    
    .yule-mobile-band-logo {
        position: relative;
        width: 180px;
        height: 180px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(30,30,30,0.8);
        border-radius: 16px;
        overflow: hidden;
    }
    
    .yule-mobile-band-logo img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }
    
    .yule-mobile-elf {
        position: absolute;
        inset: 0;
        background: #000;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .yule-mobile-elf img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    
    .yule-mobile-elf.hidden {
        opacity: 0;
    }
    
    .yule-mobile-band-name {
        font-size: 22px;
        font-weight: 800;
        line-height: 1.2;
        text-align: center;
    }
    
    .yule-mobile-mode-label {
        font-size: 16px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 2px;
        opacity: 0.7;
        text-align: center;
    }
    
    /* Up next strip */
    .yule-mobile-upnext {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 0;
        margin-top: auto;
        border-top: 1px solid rgba(255,255,255,0.1);
        font-size: 13px;
    }
    
    .yule-mobile-upnext-label {
        text-transform: uppercase;
        letter-spacing: 1px;
        opacity: 0.5;
        font-weight: 600;
    }
    
    .yule-mobile-upnext-name {
        font-weight: 700;
        flex: 1;
    }
    
    .yule-mobile-upnext-time {
        opacity: 0.7;
    }
    
    /* ===== SCROLLABLE CONTENT ===== */
    .yule-mobile-scroll {
        position: fixed;
        top: 38vh;
        left: 0;
        right: 0;
        bottom: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        padding: 12px;
        padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
        background: #000;
        z-index: 1;
        touch-action: pan-y;
    }
    
    /* Heat sections */
    .yule-mobile-heat {
        background: rgba(20,20,20,0.6);
        border-radius: 12px;
        padding: 14px;
        border: 1px solid rgba(255,255,255,0.08);
        margin-bottom: 20px;
    }
    
    .yule-mobile-heat-title {
        font-size: 14px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 2px;
        opacity: 0.6;
        margin-bottom: 12px;
        padding-bottom: 8px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .yule-mobile-heat-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    /* Mobile band tiles */
    .yule-mobile-band-tile {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 12px;
        background: rgba(40,40,40,0.6);
        border-radius: 10px;
        transition: all 0.5s ease;
    }
    
    .yule-mobile-band-tile.active {
        background: rgba(139,0,0,0.25);
        outline: 2px solid #ffffff;
        box-shadow: 0 0 15px rgba(255,0,0,0.8), 0 0 30px rgba(139,0,0,0.5);
        animation: activePulse 3s ease-in-out infinite;
    }
    
    .yule-mobile-band-tile.played {
        opacity: 0.4;
    }
    
    /* Pre-draw shuffle - no opacity fade, instant swaps */
    .yule-mobile-band-tile.shuffling {
        opacity: 1;
    }

    /* Locked bands (previously drawn) - solid black glow */
    .yule-mobile-band-tile.locked {
        opacity: 1;
        background: rgba(30,30,30,0.9);
        box-shadow: 0 0 15px rgba(0,0,0,1), 0 0 30px rgba(0,0,0,0.8);
    }
    
    /* Just locked band (most recently drawn) - elastic scale + bounce + gold glow fading to black */
    .yule-mobile-band-tile.locked.just-locked {
        animation: elasticPop 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards, 
                   crazyBounce 0.6s ease-in-out 0.8s infinite, 
                   glowFade 4s ease-out forwards;
        box-shadow: 0 0 25px rgba(255,215,0,1), 0 0 50px rgba(255,215,0,0.6);
    }
    
    .yule-mobile-tile-num {
        font-size: 14px;
        font-weight: 800;
        opacity: 0.4;
        min-width: 20px;
        text-align: center;
    }
    
    .yule-mobile-tile-logo {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .yule-mobile-tile-logo img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }
    
    .yule-mobile-tile-info {
        flex: 1;
        min-width: 0;
    }
    
    .yule-mobile-tile-name {
        font-size: 15px;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .yule-mobile-tile-time {
        font-size: 12px;
        opacity: 0.6;
        margin-top: 2px;
    }
}

/* ========================================
   MOBILE LANDSCAPE - Show scaled desktop view
   ======================================== */
@media (max-width: 900px) and (orientation: landscape) {
    /* Reset for landscape */
    html, body {
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: auto !important;
        background: #000 !important;
        touch-action: auto !important;
    }
    
    .yule-fullscreen {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        overflow: auto;
        background: #000;
    }
    
    .yule-projector {
        width: 100%;
        min-height: 100%;
        overflow: visible;
        background: #000;
    }
    
    /* Show desktop view in landscape */
    .yule-desktop-view {
        display: block !important;
    }
    
    /* Hide mobile view in landscape */
    .yule-mobile-view {
        display: none !important;
    }
    
    /* Hide mobile header/scroll in landscape */
    .yule-mobile-header,
    .yule-mobile-scroll {
        display: none !important;
    }
    
    /* Show corner logos in landscape */
    .yule-corner-logo {
        display: block !important;
        width: 80px;
        height: 80px;
    }
    
    .yule-corner-logo.bottom-left {
        left: 12px;
        bottom: 12px;
    }
    
    .yule-corner-logo.bottom-right {
        right: 12px;
        bottom: 12px;
    }
    
    /* Scale down desktop layout for small landscape screens */
    .yule-wrap {
        padding: 8px 16px 20px;
        min-height: 100vh;
    }
    
    .yule-brand img {
        width: 18vw;
        max-width: 150px;
    }
    
    .yule-columns {
        padding-top: 60px;
    }
    
    .yule-col {
        width: 20%;
        min-width: 120px;
        max-width: 200px;
    }
    
    .yule-heat-title {
        font-size: 14px;
        margin-bottom: 4px;
    }
    
    .yule-band-tile {
        padding: 4px 8px;
        margin-bottom: 4px;
        border-radius: 6px;
    }
    
    .yule-band-logo {
        width: 28px;
        height: 28px;
        margin-right: 6px;
    }
    
    .yule-band-name {
        font-size: 11px;
    }
    
    .yule-band-time {
        font-size: 10px;
    }
    
    .yule-center {
        padding-top: 50px;
    }
    
    .yule-main-logo {
        max-width: 400px;
        height: 300px;
    }
}

/* ========================================
   FULL-SCREEN OVERLAYS
   ======================================== */
.yule-overlay-wrap {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    pointer-events: none;
}

.yule-overlay-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* Spitfire overlay - sits under presents, covers entire screen */
.yule-overlay-spitfire {
    z-index: 99998;
}

.yule-overlay-spitfire img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

/* Presents overlay - on top, flashes, stays contained */
.yule-overlay-presents {
    z-index: 99999;
    transition: opacity 0.15s ease;
}

.yule-overlay-presents.hidden {
    opacity: 0;
}

/* Elf mode - covers the entire band logo area with solid background */
.yule-elf-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    background: #000;
    transition: opacity 0.15s ease;
}

.yule-elf-overlay img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.yule-elf-overlay.hidden {
    opacity: 0;
}

/* ===== PHASE IMAGES ===== */
.yule-phase-overlay {
    position: fixed;
    inset: 0;
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.85);
}

.yule-phase-overlay img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
