* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: #000;
}

/* Background layer with blurred image */
.background-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(40px);
    transform: scale(1.1);
    opacity: 0.6;
    z-index: 1;
    transition: background-image 1s ease-in-out;
    background-color: #000;
}

/* Main media container */
.image-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    overflow: hidden;
    z-index: 2;
}

.media-layer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    will-change: opacity;
    pointer-events: none;
    backface-visibility: hidden;
}

.media-layer.visible {
    opacity: 1;
    z-index: 2;
}

.media-layer img,
.media-layer video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.media-layer video {
    background: #000;
}

/* Mask layer */
.mask-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    overflow: hidden;
}

.mask-layer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/mask.png');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
}

/* Rotate mask image 90 degrees clockwise in portrait orientation */
@media (orientation: portrait) {
    .mask-layer::before {
        /* Set dimensions to screen height x width before rotation */
        width: 100vh;
        height: 100vw;
        /* Center the element */
        top: 50%;
        left: 50%;
        margin-top: -50vw;
        margin-left: -50vh;
        /* Rotate 90 degrees clockwise */
        transform: rotate(90deg);
        transform-origin: center center;
    }
}

/* No playlist message */
.no-playlist-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 4;
    pointer-events: none;
}

.no-playlist-message.show {
    display: flex;
}

.message-content {
    background: rgba(30, 30, 30, 0.9);
    backdrop-filter: blur(20px);
    padding: 40px 60px;
    border-radius: 16px;
    text-align: center;
    color: white;
    pointer-events: all;
}

.message-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.message-content h2 {
    font-size: 24px;
    margin-bottom: 12px;
    font-weight: 600;
}

.message-content p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}

/* Settings icon */
.settings-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(10px);
    font-size: 24px;
}

.settings-icon:hover {
    opacity: 1 !important;
    visibility: visible !important;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Settings panel */
.settings-panel {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 320px;
    background: rgba(30, 30, 30, 0.95);
    border-radius: 12px;
    padding: 20px;
    color: white;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 11;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.settings-panel.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.panel-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-item label {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 15px;
}

.speed-control input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.speed-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.speed-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.speed-control span {
    font-size: 16px;
    font-weight: 600;
    min-width: 30px;
    text-align: right;
}

.toggle-item {
    gap: 6px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
}

.toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #ffffff;
}

.action-btn {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
}

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

.action-btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.info-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    padding: 8px 0;
}

.info-text span {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.info-text.small {
    font-size: 12px;
    padding-top: 0;
    color: rgba(255, 255, 255, 0.55);
}

