/* ========================================
   YULETIDE DIRECTOR STYLES v2
   Clean, Utilitarian, Responsive
   ======================================== */

:root {
    --yule-bg: #0a0a0a;
    --yule-surface: #141414;
    --yule-surface-light: #1a1a1a;
    --yule-border: #2a2a2a;
    --yule-text: #ffffff;
    --yule-text-muted: #888888;
    --yule-blue: #0a84ff;
    --yule-blue-dark: #0070e0;
    --yule-blue-glow: rgba(10,132,255,0.35);
    --yule-green: #30d158;
    --yule-green-dark: #28b84c;
    --yule-green-glow: rgba(48,209,88,0.35);
    --yule-red: #ff453a;
    --yule-red-dark: #e03e35;
    --yule-red-glow: rgba(255,69,58,0.35);
    --yule-orange: #ff9f0a;
    --yule-radius: 10px;
    --yule-radius-sm: 6px;
}

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

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

/* ===== FULLSCREEN CONTAINER ===== */
.yule-fullscreen {
    position: fixed;
    inset: 0;
    background: var(--yule-bg);
    z-index: 9999;
    overflow: auto;
    min-height: 100%;
    min-height: 100dvh;
}

.yule-director {
    width: 100%;
    min-height: 100%;
    max-width: 900px;
    margin: 0 auto;
    background: var(--yule-bg);
    color: var(--yule-text);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
    padding: 12px 16px;
    padding-bottom: calc(20vh + 20px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
}

.yule-logo-top {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 0 0 12px 0;
    color: var(--yule-text);
    opacity: 0.9;
}

/* ===== SECTIONS ===== */
.yule-section {
    background: var(--yule-surface);
    border: 1px solid var(--yule-border);
    border-radius: var(--yule-radius);
    padding: 14px 16px;
    margin-bottom: 12px;
}

.yule-section h2 {
    margin: 0 0 10px 0;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--yule-text-muted);
}

/* ===== PIN GATEWAY ===== */
.yule-gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    text-align: center;
}

.yule-gate h2 {
    margin-bottom: 16px;
    font-size: 20px;
    font-weight: 600;
    color: var(--yule-text);
}

.yule-gate input {
    background: var(--yule-surface);
    color: var(--yule-text);
    border: 2px solid var(--yule-border);
    border-radius: var(--yule-radius);
    padding: 12px 16px;
    font-size: 24px;
    letter-spacing: 8px;
    text-align: center;
    width: 180px;
    transition: border-color 0.2s;
}

.yule-gate input:focus {
    outline: none;
    border-color: var(--yule-blue);
}

.yule-gate-error {
    color: var(--yule-red);
    font-size: 13px;
    font-weight: 500;
    margin-top: 10px;
    display: none;
}

/* ===== HEAT DRAW ===== */
.yule-heats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .yule-heats {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

.yule-heat-block h3 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--yule-text);
}

.yule-heat-row {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    gap: 8px;
}

.yule-heat-row > span {
    width: 22px;
    font-size: 12px;
    font-weight: 600;
    color: var(--yule-text-muted);
    text-align: right;
    flex-shrink: 0;
}

/* ===== BAND SLOT (either dropdown or selected band) ===== */
.yule-slot {
    flex: 1;
    min-width: 0;
    position: relative;
}

/* Empty slot - dropdown style */
.yule-dd-toggle {
    width: 100%;
    background: var(--yule-surface-light);
    color: var(--yule-text-muted);
    border: 1px dashed var(--yule-border);
    border-radius: var(--yule-radius-sm);
    padding: 8px 12px;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s;
    box-sizing: border-box;
}

.yule-dd-toggle:hover {
    border-color: var(--yule-blue);
    color: var(--yule-text);
}

.yule-dd-toggle.empty::after {
    content: '+';
    font-size: 16px;
    font-weight: 600;
    opacity: 0.6;
}

/* Selected band - solid style with X */
.yule-slot-filled {
    display: flex;
    align-items: center;
    background: var(--yule-surface-light);
    border: 1px solid var(--yule-border);
    border-radius: var(--yule-radius-sm);
    padding: 6px 8px 6px 12px;
    gap: 8px;
}

.yule-slot-filled .yule-band-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--yule-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.yule-slot-remove {
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--yule-text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.yule-slot-remove:hover {
    background: var(--yule-red);
    color: #fff;
}

/* Drag hint */
.yule-drag-hint {
    font-size: 12px;
    color: var(--yule-text-muted);
    margin-bottom: 12px;
    opacity: 0.7;
}

/* Drag handle */
.yule-drag-handle {
    cursor: grab;
    padding: 0 6px;
    font-size: 14px;
    letter-spacing: 2px;
    opacity: 0.4;
    transition: opacity 0.2s;
    user-select: none;
}

.yule-slot:hover .yule-drag-handle {
    opacity: 0.8;
}

.yule-drag-handle:active {
    cursor: grabbing;
}

/* Drag states */
.yule-slot.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.yule-heat-row.drag-over {
    background: rgba(0, 122, 255, 0.15);
    border-radius: var(--yule-radius);
}

.yule-heat-row.drag-over .yule-slot {
    border-color: var(--yule-blue);
}

/* Dropdown menu */
.yule-dd-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: var(--yule-surface);
    border: 1px solid var(--yule-border);
    border-radius: var(--yule-radius);
    max-height: 240px;
    overflow-y: auto;
    display: none;
    z-index: 99999;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.yule-slot.open .yule-dd-menu {
    display: block;
}

.yule-dd-item {
    padding: 10px 14px;
    font-size: 13px;
    cursor: pointer;
    color: var(--yule-text);
    border-bottom: 1px solid var(--yule-border);
    transition: background 0.1s;
}

.yule-dd-item:last-child {
    border-bottom: none;
}

.yule-dd-item:hover {
    background: var(--yule-blue);
}

.yule-dd-item.disabled {
    display: none; /* Hide used bands entirely */
}

/* ===== CONFIRM DIALOG ===== */
.yule-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.yule-confirm-overlay.show {
    opacity: 1;
    visibility: visible;
}

.yule-confirm-box {
    background: var(--yule-surface);
    border: 1px solid var(--yule-border);
    border-radius: var(--yule-radius);
    padding: 20px 24px;
    max-width: 300px;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.2s;
}

.yule-confirm-overlay.show .yule-confirm-box {
    transform: scale(1);
}

.yule-confirm-box p {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: var(--yule-text);
}

.yule-confirm-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.yule-confirm-btn {
    padding: 10px 20px;
    border-radius: var(--yule-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}

.yule-confirm-cancel {
    background: var(--yule-surface-light);
    color: var(--yule-text);
}

.yule-confirm-cancel:hover {
    background: var(--yule-border);
}

.yule-confirm-yes {
    background: var(--yule-red);
    color: #fff;
}

.yule-confirm-yes:hover {
    background: var(--yule-red-dark);
}

/* ===== TIMER CONFIG GRID ===== */
.yule-timer-config-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.yule-timer-config-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: var(--yule-surface-light);
    padding: 14px 10px;
    border-radius: var(--yule-radius);
    border: 1px solid var(--yule-border);
}

.yule-timer-config-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--yule-text);
}

.yule-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--yule-surface);
    border-radius: var(--yule-radius-sm);
    overflow: hidden;
    border: 1px solid var(--yule-border);
}

.yule-stepper-btn {
    width: 32px;
    height: 36px;
    background: var(--yule-surface-light);
    border: none;
    color: var(--yule-text);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yule-stepper-btn:hover {
    background: var(--yule-border);
}

.yule-stepper-btn:active {
    background: var(--yule-blue);
    color: #fff;
}

.yule-stepper input[type="number"] {
    width: 48px;
    height: 36px;
    background: var(--yule-surface) !important;
    color: var(--yule-text) !important;
    border: none !important;
    border-left: 1px solid var(--yule-border) !important;
    border-right: 1px solid var(--yule-border) !important;
    padding: 0;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    -moz-appearance: textfield;
}

.yule-stepper input[type="number"]::-webkit-outer-spin-button,
.yule-stepper input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.yule-stepper input[type="number"]:focus {
    outline: none;
    background: var(--yule-surface-light) !important;
}

.yule-timer-config-unit {
    font-size: 10px;
    color: var(--yule-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== CONTROL ROW ===== */
.yule-control-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.yule-control-row label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--yule-text-muted);
}

.yule-control-row input[type="number"] {
    width: 60px;
    background: var(--yule-surface-light) !important;
    color: var(--yule-text) !important;
    border: 1px solid var(--yule-border) !important;
    border-radius: var(--yule-radius-sm);
    padding: 6px 8px;
    font-size: 13px;
    text-align: center;
}

.yule-control-row input[type="number"]:focus {
    outline: none;
    border-color: var(--yule-blue) !important;
}

/* Quick action buttons */
.yule-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

/* ===== BUTTONS ===== */
.yule-btn {
    background: var(--yule-surface-light);
    color: var(--yule-text);
    border: 1px solid var(--yule-border);
    border-radius: var(--yule-radius-sm);
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.yule-btn:hover {
    background: var(--yule-border);
    border-color: #3a3a3a;
}

.yule-btn:active {
    transform: scale(0.98);
}

.yule-btn-primary {
    background: var(--yule-blue);
    border-color: var(--yule-blue);
    color: #fff;
}

.yule-btn-primary:hover {
    background: var(--yule-blue-dark);
    border-color: var(--yule-blue-dark);
}

#yule-pin-button {
    background: var(--yule-blue);
    color: #fff;
    border: none;
    border-radius: var(--yule-radius);
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: all 0.15s;
}

#yule-pin-button:hover {
    background: var(--yule-blue-dark);
    transform: translateY(-1px);
}

/* ========================================
   TOGGLE SWITCHES
   ======================================== */
.yule-toggle-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.yule-toggle-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--yule-surface-light);
    padding: 10px 14px;
    border-radius: var(--yule-radius);
    border: 1px solid var(--yule-border);
    position: relative;
    flex: 1;
    min-width: 140px;
}

.yule-toggle-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--yule-text);
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

/* Auto badge for Elf Mode */
.yule-toggle-auto {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 5px;
    border-radius: 3px;
    background: var(--yule-border);
    color: var(--yule-text-muted);
    transition: all 0.2s;
}

.yule-toggle-auto.active {
    background: var(--yule-orange);
    color: #000;
    box-shadow: 0 0 10px rgba(255,159,10,0.5);
}

/* Toggle switch */
.yule-toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    cursor: pointer;
    flex-shrink: 0;
}

.yule-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.yule-toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--yule-border);
    border-radius: 26px;
    transition: all 0.2s;
}

.yule-toggle-slider:before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.yule-toggle-switch input:checked + .yule-toggle-slider {
    background: var(--yule-green);
}

.yule-toggle-switch input:checked + .yule-toggle-slider:before {
    transform: translateX(22px);
}

.yule-toggle-switch.loading {
    opacity: 0.5;
    pointer-events: none;
}

.yule-toggle-switch.loading .yule-toggle-slider:before {
    animation: pulse 0.6s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Error tooltip */
.yule-toggle-error {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--yule-red);
    color: #fff;
    padding: 6px 10px;
    border-radius: var(--yule-radius-sm);
    font-size: 11px;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.yule-toggle-error.show {
    opacity: 1;
}

/* ===== STATUS ===== */
.yule-status {
    font-size: 12px;
    color: var(--yule-text-muted);
    margin: 10px 0 0 0;
}

.yule-status strong {
    color: var(--yule-text);
    font-weight: 600;
}

/* ========================================
   DIRECTOR FOOTER - Compact & Max 20vh
   ======================================== */
.yule-director-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 20vh;
    background: var(--yule-bg);
    border-top: 1px solid var(--yule-border);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    z-index: 99999;
    box-sizing: border-box;
}

.yule-footer-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.yule-footer-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}

.yule-footer-label {
    font-weight: 700;
    color: var(--yule-text-muted);
    flex-shrink: 0;
}

.yule-footer-text {
    color: var(--yule-text);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.yule-footer-center {
    text-align: center;
}

.yule-footer-clock {
    font-size: 11px;
    color: var(--yule-text-muted);
    margin-bottom: 2px;
}

#yule-footer-timer {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s;
}

#yule-footer-timer.over {
    color: var(--yule-red);
}

.yule-footer-right {
    display: flex;
    justify-content: flex-end;
}

.yule-footer-btn {
    background: var(--yule-blue);
    color: #fff;
    border: none;
    border-radius: var(--yule-radius);
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s;
    min-width: 120px;
    text-align: center;
}

.yule-footer-btn:hover {
    background: var(--yule-blue-dark);
    transform: translateY(-1px);
}

.yule-footer-btn:active {
    transform: translateY(0);
}

.yule-footer-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* ===== MOBILE FOOTER ===== */
@media (max-width: 600px) {
    html, body {
        background: #000 !important;
    }
    
    .yule-director {
        padding-bottom: calc(220px + env(safe-area-inset-bottom, 0px));
    }
    
    /* Hide toggles in main content on mobile - they go in footer */
    .yule-toggle-group {
        display: none !important;
    }
    
    .yule-director-footer {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 16px 16px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        max-height: none;
        background: #000;
        border-top: 1px solid var(--yule-border);
    }
    
    /* Row 1: Toggles - horizontal layout: LABEL toggle | LABEL toggle | LABEL AUTO toggle */
    .yule-footer-toggles {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        padding-bottom: 12px;
        border-bottom: 1px solid var(--yule-border);
    }
    
    .yule-footer-toggle-item {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        font-size: 14px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 1px;
    }
    
    .yule-footer-toggle-item span {
        white-space: nowrap;
    }
    
    .yule-toggle-auto {
        background: #333;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 11px;
        font-weight: 700;
        border: 1px solid #555;
    }
    
    /* Toggle switches in footer */
    .yule-footer-toggle-item .yule-toggle-switch {
        width: 50px;
        height: 28px;
    }
    
    .yule-footer-toggle-item .yule-toggle-slider:before {
        width: 22px;
        height: 22px;
        left: 3px;
        top: 3px;
    }
    
    .yule-footer-toggle-item input:checked + .yule-toggle-slider:before {
        transform: translateX(22px);
    }
    
    /* Row 2: 2-column - NOW/NEXT left, TIMER right */
    .yule-footer-main {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 16px;
        padding: 8px 0;
    }
    
    .yule-footer-info {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    
    .yule-footer-line {
        display: flex;
        align-items: baseline;
        gap: 10px;
        font-size: 16px;
    }
    
    .yule-footer-label {
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 1px;
        opacity: 0.5;
        min-width: 50px;
    }
    
    .yule-footer-text {
        font-weight: 700;
    }
    
    .yule-footer-center {
        display: none;
    }
    
    .yule-footer-timer-wrap {
        text-align: right;
    }
    
    #yule-footer-timer {
        font-size: 56px;
        font-weight: 800;
        line-height: 1;
        font-variant-numeric: tabular-nums;
    }
    
    #yule-footer-timer.over {
        color: var(--yule-red);
    }
    
    /* Row 3: Full width action button */
    .yule-footer-right {
        width: 100%;
    }
    
    .yule-footer-btn {
        width: 100%;
        padding: 16px 20px;
        font-size: 18px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 2px;
        border-radius: 50px;
    }
    
    .yule-timer-config-group {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Hide footer toggles on desktop */
.yule-footer-toggles {
    display: none;
}

/* Footer main wrapper - grid on mobile, contents on desktop */
.yule-footer-main {
    display: contents;
}

