:root {
    --safe-space: clamp(20px, 2vw, 32px);
    --viewport-safe-width: calc(100vw - (var(--safe-space) * 2));
    --viewport-safe-height: calc(100vh - (var(--safe-space) * 2));
    --kiosk-stage-width: min(var(--viewport-safe-width), calc(var(--viewport-safe-height) * 0.5625));
    --kiosk-stage-height: min(var(--viewport-safe-height), calc(var(--viewport-safe-width) * 1.777777778));
}

html,
body {
    width: 100%;
    height: 100%;
    min-height: 100%;
}

body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-image: url('img/GrupoBelatorTextura2.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    font-family: 'Poppins', sans-serif;
    background-color: #1a1a1d;
    color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    touch-action: manipulation;
    overscroll-behavior: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

body.viewer-open {
    overflow: hidden;
}

.menu-container {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    max-width: 100%;
    max-height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(24px, 3vh, 40px);
    text-align: center;
    padding: clamp(32px, 4vw, 56px);
    border-radius: 0;
    background:
        linear-gradient(180deg, rgba(37, 58, 138, 0.92), rgba(13, 24, 69, 0.96)),
        rgba(44, 44, 52, 0.94);
    box-shadow: none;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

h1 {
    margin: 0;
    font-weight: 600;
    font-size: clamp(34px, 2.6vw, 48px);
    border-bottom: 2px solid #00aaff;
    padding-bottom: 14px;
}

.menu-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    overflow-y: auto;
    padding-right: 6px;
    touch-action: pan-y;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

@supports (height: 100dvh) {
    body {
        min-height: 100dvh;
    }

    .menu-container {
        height: 100dvh;
        min-height: 100dvh;
    }
}

.menu-button {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 84px;
    padding: 18px 24px;
    box-sizing: border-box;
    background: linear-gradient(135deg, #00aaff, #0f74ff);
    color: #ffffff;
    text-decoration: none;
    font-size: clamp(21px, 1.7vw, 28px);
    font-weight: 600;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: transform 0.2s ease-in-out, background-color 0.2s, box-shadow 0.2s;
    touch-action: manipulation;
}

.menu-button:hover {
    transform: translateY(-2px);
    background-color: #0088cc;
    box-shadow: 0 16px 28px rgba(0, 136, 204, 0.25);
}

.menu-button.disabled {
    background-color: #555;
    color: #999;
    cursor: not-allowed;
    pointer-events: none;
}

@media (max-width: 767px) {
    .menu-container {
        justify-content: flex-start;
        gap: 20px;
        padding: 24px;
    }

    h1 {
        font-size: clamp(26px, 8vw, 34px);
        padding-bottom: 10px;
    }

    .menu-button {
        min-height: 64px;
        padding: 14px 18px;
        font-size: clamp(18px, 5vw, 22px);
        border-radius: 14px;
    }
}

.viewer-shell {
    position: fixed;
    inset: 0;
    z-index: 60;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: #081225;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.viewer-shell.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.viewer-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: #081225;
}

.content-shell {
    position: fixed;
    inset: 0;
    z-index: 55;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: #081225;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.content-shell.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.content-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: #081225;
}

.viewer-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 4vw, 48px);
    background: rgba(8, 18, 37, 0.78);
    color: #ffffff;
    font-size: clamp(24px, 2.2vw, 34px);
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.02em;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.viewer-loading.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
