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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    font-family: system-ui, -apple-system, sans-serif;
}

.slideshow-body {
    display: flex;
    align-items: center;
    justify-content: center;
}

.slideshow-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.slide {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
}

.slide.active {
    display: flex;
}

.slide-media {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.slide-media img {
    animation: fadeIn 0.5s ease;
    max-width: 100%;
    max-height: 100%;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to   { opacity: 1; transform: scale(1); }
}

.slide-qr {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 4px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.orientation-horizontal .slide-qr {
    left: auto;
    right: var(--qr-offset-x, 30px);
}

.orientation-horizontal .slide-qr img {
    width: var(--qr-size-h, 160px);
    height: var(--qr-size-h, 160px);
}

.slide-qr.visible {
    display: flex;
}

.slide-qr img {
    display: block;
    max-width: 100%;
    max-height: calc(100% - 26px);
    object-fit: contain;
}

.orientation-vertical .slide-qr img {
    transform: rotate(180deg);
}

.orientation-vertical .slide-qr {
    flex-direction: row;
    padding: 4px 6px;
}

.orientation-vertical .qr-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    order: -1;
    margin-right: 4px;
    max-height: 100%;
    max-width: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.dev-mode .slide-qr {
    cursor: pointer;
}

.dev-mode .slide-qr::after {
    content: "TEST";
    position: absolute;
    top: -8px;
    left: -8px;
    background: #ef4444;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 11;
}

.orientation-vertical.dev-mode .slide-qr::after {
    top: auto;
    left: auto;
    bottom: -8px;
    right: -8px;
    transform: rotate(90deg);
    transform-origin: center;
}

.qr-label {
    font-size: clamp(10px, 2vw, 48px);
    color: #333;
    font-weight: 700;
    text-align: center;
    line-height: 1.15;
    order: 2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
    padding: 0 2px;
}
