/* =========================================
   VILBIL Pixel Streaming Player - Styles
   ========================================= */

/* CSS Variables */
:root {
    /* Primary brand color - use for buttons, text accents, counters */
    --vilbil-teal: #145162;
    
    --player-bg: #1a1a1a;
    --overlay-bg: rgba(0, 0, 0, 0.85);
    --panel-bg: rgba(30, 30, 30, 0.95);
    --text-color: #ffffff;
    --text-muted: #a0a0a0;
    --accent-color: #4a90d9;
    --like-color: #e74c3c;
    --btn-size: 2.5rem;
    --btn-size-mobile: 2rem;
    --controls-width: 3rem;
    --info-panel-width: 320px;
    --border-radius: 8px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --z-video: 1;
    --z-nav-buttons: 90;
    --z-controls: 100;
    --z-overlay: 200;
    --z-modal: 300;
}

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

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: url('/local/img/backg_container_vilbil.jpg') center/cover no-repeat;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html.is-locked,
html.is-locked body {
    height: auto;
    height: calc(var(--window-inner-height) - 1px);
    overflow: hidden;
    box-sizing: border-box;
}

/* =========================================
   Player Root Container
   ========================================= */

/* =========================================
   Cursor Styles
   =========================================
   All cursors in /local/vilbilplayer/cursors/
   Class name = file name: cursor-{filename}
   
   - arrow.svg      : Default arrow pointer
   - arrow-tap.svg  : Arrow click feedback
   - finger.svg     : Hover on objects
   - finger-tap.svg : Finger click feedback
   - loupe.svg      : Object view mode
   - loupe-tap.svg  : Object click feedback
   - rotate.svg     : Drag to rotate
   - move.svg       : Drag to pan
   - shift.svg      : Drag to shift
   ========================================= */

#stream-video.cursor-arrow {
    cursor: url('cursors/arrow.svg') 7 7, crosshair;
}

#stream-video.cursor-arrow-tap {
    cursor: url('cursors/arrow-tap.svg') 7 7, pointer;
}

#stream-video.cursor-finger {
    cursor: url('cursors/finger.svg') 10 10, pointer;
}

#stream-video.cursor-finger-tap {
    cursor: url('cursors/finger-tap.svg') 10 10, pointer;
}

#stream-video.cursor-loupe {
    cursor: url('cursors/loupe.svg') 10 10, zoom-in;
}

#stream-video.cursor-loupe-tap {
    cursor: url('cursors/loupe-tap.svg') 10 10, zoom-in;
}

#stream-video.cursor-rotate {
    cursor: url('cursors/rotate.svg') 16 16, grab;
}

#stream-video.cursor-move {
    cursor: url('cursors/move.svg') 16 16, move;
}

#stream-video.cursor-shift {
    cursor: url('cursors/shift.svg') 16 16, ew-resize;
}

.player-root {
    position: relative;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: var(--player-bg);
    background-image: url('/local/img/backg_container_vilbil.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

/* =========================================
   Video Container
   ========================================= */

.video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-video);
    display: flex;
    align-items: center;
    justify-content: center;
    /* Poster image shows while connecting, before UE sends video */
    background: url('images/poster.jpg') center/cover no-repeat #000;
}

#stream-video {
    width: 100%;
    height: 100%;
    object-fit: fill;
    background: transparent;
    /* Hidden until video stream starts */
    visibility: hidden;
}

#stream-video.has-video {
    visibility: visible;
}

/* =========================================
   Loading Overlay
   ========================================= */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Poster background while loading */
    background: url('images/poster.jpg') center/cover no-repeat;
    z-index: 9999;  /* Above everything */
    transition: opacity var(--transition-normal);
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* =========================================
   Play Overlay (Standby Resume)
   ========================================= */

.play-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;  /* Выравнивание снизу */
    justify-content: center;
    /* Standby poster background */
    background: url('images/poster.jpg') center/cover no-repeat;
    z-index: 9999;  /* Above everything */
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.play-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* =========================================
   First Interaction Overlay (Autoplay Policy)
   ========================================= */

.first-interaction-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;  /* Above video, below controls and tutorial */
    /* cursor: pointer; -- changed to custom arrow */
    cursor: url('cursors/arrow.svg') 7 7, crosshair;
}

.first-interaction-overlay.hidden {
    display: none;
}

.play-overlay-content {
    /* Position from bottom - responsive to window height */
    text-align: center;
    margin-bottom: 5%;  /* 5% от высоты окна */
}

/* Pulsing animation for play button */
@keyframes pulse-glow {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3));
    }
    50% {
        transform: scale(1.08);
        filter: drop-shadow(0 0 40px rgba(255, 255, 255, 0.6));
    }
}

.play-button {
    width: 15vmin;
    height: 15vmin;
    border: none;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
    animation: pulse-glow 2s ease-in-out infinite;
    transition: transform 0.6s ease, filter 0.6s ease;
}

.play-button:hover {
    animation: none;
    transform: scale(1.15);
    filter: drop-shadow(0 0 60px rgba(255, 255, 255, 0.9));
}

.play-button:active {
    transform: scale(0.95);
}

.play-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Tablets (480-1024px): same button size, higher position */
@media (max-width: 1024px) {
    .play-overlay-content {
        margin-bottom: calc(15% + 10vmin);  /* Выше на планшетах: +половина кнопки */
    }
}

/* Mobile phones (< 480px): larger button, highest position */
@media (max-width: 479.98px) {
    .play-button {
        width: 24vmin;
        height: 24vmin;
    }
    
    .play-overlay-content {
        margin-bottom: 35%;  /* Максимально высоко на телефонах */
    }
}

/* =========================================
   AFK Overlay (Inactivity Warning)
   ========================================= */

.afk-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);  /* Starts transparent, animated via JS */
    z-index: 9999;  /* Above everything */
    pointer-events: none;
    cursor: pointer;
    visibility: hidden;  /* Hide children when not active */
}

.afk-overlay.visible {
    pointer-events: auto;
    visibility: visible;
}

/* Teleport icon in center */
.afk-icon {
    width: 240px;
    height: 240px;
    margin-bottom: 40px;
    opacity: 0.9;
}

/* Progress bar container (градусник) */
.afk-progress-container {
    width: 420px;
    height: 20px;
    background: transparent;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--vilbil-teal);
}

/* Progress bar fill (уменьшается справа налево) */
.afk-progress-bar {
    width: 100%;
    height: 100%;
    background: white;  /* Белая полоска */
    border-radius: 8px;
    transform-origin: left center;
    /* Scale будет анимироваться через JS */
}

/* Mobile: smaller icon and bar */
@media (max-width: 479.98px) {
    .afk-icon {
        width: 160px;
        height: 160px;
        margin-bottom: 30px;
    }
    .afk-progress-container {
        width: 300px;
        height: 16px;
    }
}

/* =========================================
   Connection Status
   ========================================= */

.connection-status {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--overlay-bg);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    z-index: var(--z-overlay);
    transition: opacity var(--transition-fast);
}

.connection-status.hidden {
    opacity: 0;
    pointer-events: none;
}

.connection-status.error {
    background: rgba(231, 76, 60, 0.9);
}

.connection-status.reconnecting {
    /* Hidden: no need to show reconnecting banner */
    display: none !important;
}

/* Slot badge inside connection-status toast */
.slot-badge {
    display: inline-block;
    padding: 0.1em 0.45em;
    margin-left: 0.4em;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8em;
    vertical-align: middle;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
}

.slot-badge.slot-rc {
    background: rgba(46, 204, 113, 0.25);
    color: #2ecc71;
}

/* =========================================
   Controls Panel
   ========================================= */

.controls-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    width: auto;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    z-index: var(--z-controls);
    transition: transform var(--transition-normal), opacity var(--transition-normal);
}

/* nav-left moves controls to left */
.nav-left .controls-panel {
    right: auto;
    left: 10px;
}

.controls-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* Control buttons with semi-transparent background */
.ctrl-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
    border: none;
    border-radius: 4px;
    color: var(--vilbil-teal);
    font-size: 22px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    text-decoration: none !important;
    outline: none;
    box-shadow: none;
}

/* Links inside navigation - remove all default link styles */
.rightStage a,
.leftStage a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: transparent !important;
    border-radius: 0;
    text-decoration: none !important;
    outline: none;
    transition: none;
}

/* Menu icons - teal color */
.rightStage a i,
.leftStage a i,
.rightStage i,
.leftStage i {
    color: var(--vilbil-teal);
    font-size: 22px;
    transition: transform 0.2s ease;
}

.rightStage a:hover i,
.leftStage a:hover i {
    transform: scale(1.1);
}

.rightStage a:hover,
.leftStage a:hover {
    background: transparent !important;
    transform: none;
    text-decoration: none !important;
}

.rightStage a:focus,
.leftStage a:focus,
.rightStage a:active,
.leftStage a:active {
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
    background: transparent !important;
}

.ctrl-btn i {
    color: var(--vilbil-teal);
    text-decoration: none !important;
    line-height: 1;
}

.ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.05);
    text-decoration: none !important;
    outline: none;
}

.ctrl-btn:active {
    transform: scale(0.95);
    text-decoration: none !important;
    outline: none;
}

.ctrl-btn:focus {
    outline: none;
    box-shadow: none;
    text-decoration: none !important;
}

.ctrl-btn.active i {
    color: var(--accent-color);
}

.ctrl-btn.liked .bi-heart {
    color: var(--like-color);
}

.ctrl-btn .badge {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.55rem;
    min-width: 1em;
    text-align: center;
}

/* Menu toggle specific */
.menu-toggle {
    font-size: 1.8rem;
}

/* Hide/show menu button */
.btn-show-menu {
    position: fixed !important;
    top: 10px !important;
    right: 10px !important;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
    border: none;
    border-radius: 4px;
    color: var(--vilbil-teal);
    font-size: 22px;
    cursor: pointer;
    z-index: var(--z-controls);
    transition: all 0.3s ease;
    padding: 0;
    line-height: 32px;
}

.btn-show-menu i,
.btn-show-menu svg {
    line-height: 32px;
    vertical-align: middle;
    position: relative;
    top: 0;
}

.btn-show-menu svg {
    display: block;
}

.btn-show-menu:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.1);
}

.btn-show-menu.hidden {
    display: none !important;
}

/* =========================================
   Navigation Buttons (below show-menu)
   ========================================= */

.nav-buttons {
    position: fixed !important;
    top: 66px !important; /* Below btn-show-menu (10px + 32px + 24px gap) */
    right: 10px !important;
    display: flex;
    flex-direction: column;
    gap: 24px;
    z-index: var(--z-nav-buttons);
    opacity: 1;
    transition: opacity 0.3s ease-out;
}

.nav-buttons.hidden {
    display: none !important;
}

/* Hide nav buttons when menu is open - fade out */
.nav-buttons.menu-open {
    opacity: 0;
    pointer-events: none;
}

.nav-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
    border: none;
    border-radius: 4px;
    color: var(--vilbil-teal);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.1);
}

/* Room icon - large, fills button with padding */
.nav-btn .nav-icon-room {
    width: 24px;
    height: 24px;
}

/* Buy button - inverted style for emphasis */
.nav-btn.nav-btn-buy {
    background: var(--vilbil-teal);
    color: #fff;
}

.nav-btn.nav-btn-buy:hover {
    background: var(--vilbil-dark-teal);
    color: #fff;
}

.nav-btn.hidden {
    display: none !important;
}

/* nav-left positioning */
.player-root.nav-left .nav-buttons {
    right: auto !important;
    left: 10px !important;
}

/* Controls hide animation */
.controls-panel.hide {
    animation: slideOut 0.4s ease forwards;
}

.controls-panel.show {
    animation: slideIn 0.4s ease forwards;
}

@keyframes slideOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

/* =========================================
   Info Overlay (Draggable Panel)
   ========================================= */

.info-overlay {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: var(--info-panel-width);
    max-width: calc(100% - 80px);
    background: rgba(255, 255, 255, 0.60);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: var(--z-overlay);
    overflow: hidden;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.info-overlay.fade-in {
    animation: infoFadeIn 0.2s ease forwards;
}

.info-overlay.fade-out {
    animation: infoFadeOut 0.2s ease forwards;
}

@keyframes infoFadeIn {
    from { opacity: 0; margin-top: -10px; }
    to { opacity: 1; margin-top: 0; }
}

@keyframes infoFadeOut {
    from { opacity: 1; margin-top: 0; }
    to { opacity: 0; margin-top: -10px; }
}

.info-overlay.hidden {
    display: block !important;  /* Override .hidden { display: none } */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.info-overlay.dragging {
    cursor: grabbing !important;
    transition: none;
}

.info-overlay.dragging * {
    cursor: grabbing !important;
    pointer-events: none;
}

.info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.5rem 0.4rem 0.75rem;
    cursor: grab;
    user-select: none;
}

/* Title block containing author + title */
.info-title-block {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding-right: 0.5rem;
}

/* Author line (Bold, Italic) - only in hub mode */
.info-author {
    display: none; /* Hidden by default, shown in hub mode */
    font-weight: 700;
    font-style: italic;
    font-size: 0.85rem;
    color: var(--vilbil-teal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Show author in hub mode */
.hub-mode .info-author:not(:empty) {
    display: block;
}

/* Buy button visibility by mode */
/* Hub mode: show Buy in menu, hide in overlay */
.hub-mode #contBuy.visible {
    display: block !important;
}
.hub-mode .info-buy-btn {
    display: none !important;
}

/* Embed mode (no .hub-mode): show Buy in overlay, hide in menu */
.player-root:not(.hub-mode) #contBuy {
    display: none !important;
}

.info-header:active {
    cursor: grabbing;
}

.info-header-buttons {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.info-title {
    flex: 1;
    text-align: left;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--vilbil-teal);
    overflow: hidden;
    padding-right: 0.5rem;
    /* Allow two lines for hall title */
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0; /* Allow flex item to shrink below content size */
}

/* Single line title (artwork) */
.info-title:not(:has(.artist-name)) {
    white-space: nowrap;
    text-overflow: ellipsis;
    display: block;
}

/* Artist name - first line (uppercase) */
.info-title .artist-name {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Exhibition title - second line */
.info-title .exhibition-title {
    display: block;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    opacity: 0.85;
}

.info-ctrl-btn {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--vilbil-teal);
    cursor: pointer;
    border-radius: 4px;
    transition: background var(--transition-fast);
    flex-shrink: 0;
    font-size: 1.25rem;
}

.info-ctrl-btn:hover {
    background: rgba(20, 81, 98, 0.15);
}

/* Collapsed state - only title visible */
.info-overlay.collapsed .info-body {
    display: none;
}

.info-body {
    padding: 0 0.75rem 0.75rem;
}

.info-details {
    font-size: 0.8125rem;
    color: var(--vilbil-teal);
    line-height: 1.4;
    max-height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.info-series-row {
    margin-top: 0.4rem;
    font-size: 0.8125rem;
    color: var(--vilbil-teal);
}

.info-series-row.hidden {
    display: none;
}

.info-series-label {
    font-weight: 400;
}

.info-series-value {
    font-weight: 400;
}

.info-buy-btn {
    display: block;
    width: 100%;
    margin-top: 0.6rem;
    padding: 0.5rem 1rem;
    background: var(--vilbil-teal);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.info-buy-btn:hover {
    background: #0f3d4a;
}

.info-buy-btn.hidden {
    display: none;
}

/* =========================================
   Success Confirmation Modal
   ========================================= */

.success-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 600;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.success-modal.hidden {
    display: flex !important;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.success-modal-content {
    background: white;
    padding: 40px 50px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: successPop 0.3s ease-out;
}

@keyframes successPop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-icon {
    width: 70px;
    height: 70px;
    background: #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 40px;
    color: white;
    font-weight: bold;
}

.success-title {
    color: #145162;
    font-size: 22px;
    margin: 0 0 15px;
}

.success-message {
    color: #555;
    font-size: 15px;
    line-height: 1.5;
    margin: 0 0 25px;
}

.success-ok-btn {
    background: #145162;
    color: white;
    border: none;
    padding: 12px 50px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.success-ok-btn:hover {
    background: #0d3a47;
}

/* =========================================
   Buy Modal
   ========================================= */

.buy-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.buy-modal.hidden {
    display: flex !important;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.buy-modal-content {
    background: #fff;
    border-radius: var(--border-radius);
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Mobile adjustments for buy modal */
@media (max-height: 700px), (max-width: 480px) {
    .buy-modal-content {
        max-height: 95vh;
        width: 95%;
        border-radius: 8px;
    }
    
    .buy-modal-header {
        padding: 0.75rem;
    }
    
    .buy-modal-header h3 {
        font-size: 0.9rem;
    }
    
    .buy-modal-body {
        padding: 0 0.75rem 0.75rem;
    }
    
    .buy-artwork-name {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
        margin-top: 0.5rem;
    }
    
    .buy-note {
        font-size: 0.8rem;
        margin-top: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .buy-input {
        padding: 0.5rem 0.6rem;
        font-size: 0.85rem;
    }
    
    .buy-textarea {
        min-height: 50px;
    }
    
    .buy-required-note {
        font-size: 0.75rem;
        margin-top: 0.5rem;
    }
    
    .buy-disclaimer {
        font-size: 0.7rem;
        margin-top: 0.5rem;
    }
    
    .buy-modal-footer {
        padding: 0.75rem;
    }
    
    .buy-submit-btn {
        padding: 0.5rem 1.5rem;
        font-size: 0.85rem;
    }
}

.buy-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.buy-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #333;
}

.buy-modal-close-btn {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 1.25rem;
    border-radius: 4px;
}

.buy-modal-close-btn:hover {
    background: #f0f0f0;
}

.buy-modal-body {
    padding: 0 1rem 1rem;
}

/* Artwork info card (inverted colors - light text on dark) */
.buy-artwork-info {
    margin-top: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--vilbil-teal);
    border-radius: 4px;
}

.buy-artwork-author {
    color: #fff;
    font-weight: 700;
    font-style: italic;
    font-size: 0.9rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.buy-artwork-author:empty {
    display: none;
}

.buy-artwork-name {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.buy-note {
    font-size: 0.9rem;
    color: var(--vilbil-teal);
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.buy-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.buy-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    box-sizing: border-box;
    color: var(--vilbil-teal);
}

.buy-input::placeholder {
    color: var(--vilbil-teal);
    opacity: 1;
}

/* Optional fields - lighter color */
.buy-input.buy-optional::placeholder {
    color: #5a9aa8;
    opacity: 1;
}

.buy-input:focus {
    outline: none;
    border-color: var(--vilbil-teal);
}

.buy-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

.buy-select option {
    padding: 0.5rem;
}

.buy-textarea {
    resize: vertical;
    min-height: 70px;
    font-family: inherit;
}

.buy-input.hidden {
    display: none;
}

.buy-contact-section {
    margin-top: 0.5rem;
}

.buy-contact-section h4 {
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0.5rem 0;
    color: #333;
}

.buy-contact-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.buy-contact-option input[type="checkbox"] {
    accent-color: var(--vilbil-teal);
}

.buy-contact-option label {
    font-size: 0.9rem;
    color: #333;
}

.buy-contact-input {
    margin-left: 1.5rem;
    width: calc(100% - 1.5rem);
}

.buy-required-note {
    font-size: 0.8rem;
    color: var(--vilbil-teal);
    text-align: left;
    margin-top: 0.75rem;
}

.buy-disclaimer {
    font-size: 0.75rem;
    color: #888;
    margin-top: 1rem;
}

.buy-modal-footer {
    padding: 1rem;
    background: #f3f3f2;
    display: flex;
    justify-content: center;
}

.buy-submit-btn {
    padding: 0.6rem 2rem;
    background: var(--vilbil-teal);
    color: #fff;
    border: 2px solid var(--vilbil-teal);
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.buy-submit-btn:hover {
    background: #0d3a47;
    border-color: #0d3a47;
    color: #fff;
}

/* =========================================
   Help Overlay
   ========================================= */

.help-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    z-index: var(--z-modal);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    pointer-events: none;  /* Pass clicks through to video */
}

.help-overlay.hidden {
    display: flex !important;  /* Override .hidden { display: none } */
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.help-content {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    max-width: 320px;
    width: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: none;  /* Pass clicks through to video */
}

.help-items-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;  /* Center both rows */
    gap: 1rem;
    width: 100%;
    margin-top: 0.75rem;
    max-width: 280px;  /* Forces 3 items per row */
}

.help-item-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 70px;
}

.help-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 0.5rem;
    /* Color is now baked into SVG files */
}

.help-label {
    font-size: 0.875rem;
    font-weight: bold;
    color: var(--vilbil-teal);
}

/* Large screens: 2x icons and optimized layout */
@media (min-width: 1024.02px) {
    .help-content {
        max-width: 450px;
        padding: 1.5rem 2rem;
    }

    .help-item-box {
        width: 100px;
        gap: 0.5rem;
    }

    .help-icon {
        width: 56px;
        height: 56px;
    }

    .help-label {
        font-size: 0.9rem;
    }

    .help-items-container {
        gap: 1.25rem;
        max-width: 360px;  /* 100px * 3 + 20px * 2 gaps = 340px + buffer */
    }
    
    .share-content {
        max-width: 400px;
        padding: 1.5rem 2rem;
    }
}

/* Small screens (< 1024px): tablet/mobile help layout */
@media (max-width: 1024px) {
    /* Default small screen layout already defined in base styles */
}

/* Small mobile: narrower layout */
@media (max-width: 479.98px) {
    .help-items-container {
        max-width: 180px;  /* 2+2+1 layout, centered */
        gap: 1rem;
    }
    .help-item-box {
        width: 70px;
    }
    .help-icon {
        width: 40px;
        height: 40px;
    }
    .help-label {
        font-size: 0.75rem;
    }
    .share-social-icons {
        max-width: 160px;  /* 4+4 layout */
        gap: 0.5rem;
    }
    .share-social-link {
        width: 2rem;
        height: 2rem;
        font-size: 1.25rem;
    }
}

/* Very small mobile (< 360px) */
@media (max-width: 359.98px) {
    .help-content {
        padding: 1rem;
        width: 95%;
    }
    .share-content {
        padding: 1rem;
        width: 95%;
    }
    .share-social-icons {
        max-width: 140px;  /* 4+4 tighter */
        gap: 0.25rem;
    }
    .share-social-link {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 1rem;
    }
}

.help-close-btn,
.share-close-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--vilbil-teal);
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background var(--transition-fast);
    pointer-events: auto;  /* Close button must be clickable */
}

.help-close-btn:hover,
.share-close-btn:hover {
    background: rgba(20, 81, 98, 0.15);
}

/* =========================================
   Share Modal
   ========================================= */

.share-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    z-index: var(--z-modal);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.share-modal.hidden {
    display: flex !important;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.share-content {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    color: var(--vilbil-teal);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    max-width: 320px;
    width: auto;
    position: relative;
}

.share-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: var(--vilbil-teal);
}

.share-description {
    text-align: center;
    margin: 0.25rem 0 0.75rem 0;
    font-size: 0.875rem;
    color: var(--vilbil-teal);
}

.share-social-icons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;  /* Center both rows */
    gap: 0.75rem;
    max-width: 196px;  /* 4 items per row: 4 * 40px + 3 * 12px gaps */
    margin: 0 auto;
}

.share-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    color: var(--vilbil-teal);
    font-size: 1.5rem;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.share-social-link:hover {
    transform: scale(1.15);
}

.share-social-link svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: currentColor;
}

/* share-close-btn styles moved to unified .help-close-btn, .share-close-btn block */

/* =========================================
   Toast Notification
   ========================================= */

.toast-notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.toast-notification.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(1rem);
}

.toast-notification i {
    font-size: 1.25rem;
    color: #EFAB59;
}

@media (max-width: 1024px) {
    .toast-notification {
        bottom: 1rem;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* =========================================
   Mobile Scroll Zone Padding
   ========================================= */

/* Removed conflicting rules - positioning handled in main .controls-panel */

.player-root.nav-left .btn-show-menu {
    right: auto;
    left: 10px;
}

/* =========================================
   Desktop Styles (above 1024px)
   ========================================= */

@media (min-width: 1024.02px) {
    .controls-panel {
        background: transparent;
    }
    
    .ctrl-btn {
        background: rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(4px);
    }
    
    .ctrl-btn:hover {
        background: rgba(0, 0, 0, 0.5);
    }
    
    /* Hide menu toggle on desktop */
    .menu-toggle {
        display: none;
    }
}

/* =========================================
   Tablet/Mobile Styles (1024px and below)
   ========================================= */

@media (max-width: 1024px) {
    .player-root.nav-right {
        padding-right: var(--controls-width);
    }
    
    .player-root.nav-left {
        padding-left: var(--controls-width);
    }
    
    .controls-panel {
        background: transparent;  /* Let player-root background show through */
    }
    
    .info-overlay {
        max-width: calc(100% - 100px);
    }
}

/* =========================================
   Touch Device Optimizations
   ========================================= */

@media (pointer: coarse) {
    .ctrl-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .info-ctrl-btn {
        min-height: 36px;
        min-width: 36px;
    }
}

/* =========================================
   Utility Classes
   ========================================= */

.hidden {
    display: none !important;
}

.visually-hidden {
    opacity: 0;
    pointer-events: none;
}

/* =========================================
   Fullscreen Styles
   ========================================= */

.player-root.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 9999;
    padding: 0 !important;
}

.player-root.fullscreen .video-container {
    border-radius: 0;
}

.player-root.fullscreen.nav-right {
    padding-right: var(--controls-width) !important;
}

.player-root.fullscreen.nav-left {
    padding-left: var(--controls-width) !important;
}

/* =========================================
   Hub Mode (minimal UI - info shown outside player)
   ========================================= */

/* Hub mode: hide info overlay (info shown in parent frame) */
.player-root.hub-mode .info-overlay,
.player-root.hub-mode .btn-recall-info {
    display: none !important;
}

/* Hub mode fullscreen: SHOW info overlay (no parent frame info visible) */
.player-root.hub-mode.fullscreen .info-overlay {
    display: block !important;
}

/* Embed mode (default): hide BUY button in menu (BUY is in info overlay) */
.player-root:not(.hub-mode) #contBuy {
    display: none !important;
}

/* =========================================
   Info Overlay Hall Mode (only title shown)
   ========================================= */

.info-overlay.hall-mode .info-details,
.info-overlay.hall-mode .info-series-row,
.info-overlay.hall-mode .info-buy-btn,
.info-overlay.hall-mode #info-toggle {
    display: none !important;
}

/* Keep close button visible in hall-mode */
.info-overlay.hall-mode #info-close {
    display: flex !important;
}

.info-overlay.hall-mode .info-header {
    padding-bottom: 0;
}

.info-overlay.hall-mode {
    min-width: 150px;
}

/* Inactive state for Recall Info button (in hall, not near artwork) */
#contRecallInfo.inactive {
    opacity: 0.35;
    pointer-events: none;
}

#contRecallInfo.inactive a {
    cursor: default;
}

/* =========================================
   Animations
   ========================================= */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.ctrl-btn.pulse {
    animation: pulse 0.3s ease;
}

/* =========================================
   Navigation Styles from _tmp_player
   ========================================= */

.navApp {
    direction: ltr;
}

.navApp ul {
    padding: 0;
    list-style: none;
    margin: 0;
}

.navApp ul li {
    color: var(--vilbil-teal);
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 4px;
    font-size: 25px;
    margin-bottom: 11px;
    line-height: 1.5rem;
    padding: 3px 0px;
    height: 32px;
    width: 32px;
    text-align: center;
    vertical-align: middle;
    list-style: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.navApp ul li:hover {
    background-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.05);
}

.nav_btn {
    color: var(--vilbil-teal);
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 4px;
    font-size: 25px;
    margin-bottom: 11px;
    line-height: 1.5rem;
    padding: 2px 0px;
    height: 32px;
    width: 32px;
    text-align: center;
    vertical-align: middle;
    transition: background-color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.nav_btn:hover {
    background-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.05);
}
}

.nav_btn_up {
    color: #fff;
    background-color: rgba(0, 4, 8, 0.4);
    border-radius: 4px;
    margin-bottom: 11px;
    text-align: center;
    line-height: 32px;
    padding: 0;
    font-size: 1.8rem;
    height: 32px;
    width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav_btn_up i {
    line-height: 1;
}

.navApp .leftStage {
    position: absolute;
    top: 10px;
    cursor: auto;
}

.lstage-right {
    right: 10px;
}

.lstage-left {
    left: 10px;
}

.stage-right {
    right: 10px;
}

/* Reset stage position when inside controls-panel (panel already has left/right: 10px) */
.controls-panel .stage-right,
.controls-panel .rightStage {
    right: 0;
}

.controls-panel .stage-left,
.controls-panel .leftStage {
    left: 0;
}

.stage-left {
    left: 10px;
}

.navApp .leftStage ul li {
    margin-top: 15px;
    margin-bottom: 25px;
    display: block;
    margin-right: 0.8rem;
}

.navApp .rightStage {
    position: absolute;
    top: 0;
    height: 100%;
    cursor: auto;
}

.navApp .rightStage li {
    left: 0;
}

.hide {
    opacity: 0;
    transition: opacity 0.8s ease-in, transform 0.8s ease-in;
    transform: scale(0.01, 0.01);
    transform-origin: 25px 25px;
    pointer-events: none;
}

.show {
    opacity: 1;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    transform: scale(1, 1);
    transform-origin: 25px 25px;
    pointer-events: auto;
}

/* Mobile: adjust transform-origin to match show-menu button position */
/* On mobile rStage starts ~83px lower than show-menu button */
@media (max-width: 1024px) {
    .hide,
    .show {
        transform-origin: 25px -60px;
    }
}

.non_active a {
    color: #000;
    cursor: none;
    pointer-events: none;
}

/* Make icons teal */
.navApp ul li i,
.navApp a i {
    color: var(--vilbil-teal);
}

/* Remove underlines and focus rings from all navigation links */
.navApp a,
.navApp a:link,
.navApp a:visited,
.navApp a:hover,
.navApp a:active,
.navApp a:focus {
    text-decoration: none !important;
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* Remove any bootstrap button styling */
.navApp .btn,
.navApp .btn:hover,
.navApp .btn:focus,
.navApp .btn:active {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

@media (hover: hover) {
    .navApp li:hover {
        cursor: pointer;
        color: #000;
    }
    .navApp .nav_btn_up:hover {
        cursor: pointer;
        color: #000;
    }
    .navApp .rightStage img:hover {
        transform: scale(1.1);
    }
    .non_active li:hover {
        cursor: none;
    }
    .non_active a:hover {
        cursor: none;
    }
}

/* Like counter positioning */
#cont_likes {
    position: absolute;
    bottom: -4px;
    left: 4px;
    padding: 0;
}

#like-count {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--vilbil-teal);
}

@media (hover: none) {
    .navApp li:hover {
        color: #fff;
    }
    .navApp a:hover {
        color: #fff;
    }
}

#eFS {
    font-size: 20px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
}

#eFS a,
#eFS i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Mobile responsive - Legacy navApp styles */
@media (max-width: 479.98px) {
    .navApp ul {
        padding-left: 0;
        padding-right: 0.5rem;
    }
    .navApp .leftStage {
        top: 48px;
        right: -3.8rem;
        margin-left: 0;
    }
    .navApp .rightStage {
        position: absolute;
        top: 0;
        right: -10px;
        margin-right: 0;
        cursor: auto;
    }
    .stage-right {
        right: -3.3rem;
        margin-right: 0.5rem;
    }
    .stage-left {
        width: 10px;
        left: -3.45rem;
        margin-left: 0.5rem;
    }
    .lstage-right {
        right: -43px;
    }
    .lstage-left {
        width: 10px;
        left: -39px;
    }
}

/* Adaptive height for player container */
.video-container.adaptive-height {
    height: calc(100vh - 14.5rem);
    min-height: 200px;
    max-height: 729px;
}

/* Tablet and below: increased header offset */
@media (max-width: 1024px) {
    .video-container.adaptive-height {
        height: calc(100vh - 15rem);
    }
}

/* Mobile phones (<480px): further increased header offset */
@media (max-width: 479.98px) {
    .video-container.adaptive-height {
        height: calc(100vh - 16rem);
        max-height: 800px;
    }
}

/* ===========================================
   Touch Devices (tablets, phones) — pointer: coarse + small screen
   Shows scroll strip for touch scrolling
   Only applies when screen width ≤1024px (excludes laptops with touchscreen)
   =========================================== */
@media (pointer: coarse) and (max-width: 1024px) {
    /* Touch devices: NO horizontal scroll! Everything fits in viewport */
    html, body {
        overflow-x: hidden !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }
    
    /* Player root fills viewport with padding for buttons */
    .player-root {
        width: 100vw !important;
        max-width: 100vw !important;
        overflow: visible !important;
    }
    
    /* Mobile: add padding to player-root for button zone */
    .player-root.nav-right {
        padding-right: 3rem !important;
        padding-left: 0.3rem !important;
        padding-top: 0.3rem !important;
        padding-bottom: 0.3rem !important;
    }
    .player-root.nav-left {
        padding-left: 3rem !important;
        padding-right: 0.3rem !important;
        padding-top: 0.3rem !important;
        padding-bottom: 0.3rem !important;
    }
    
    /* Video container fills remaining width (minus padding) */
    .video-container {
        width: 100% !important;
        position: relative !important;
        overflow: visible !important; /* Allow buttons to extend outside */
    }
    
    /* Controls panel: transparent to show player-root background texture */
    .controls-panel {
        background: transparent !important;
        width: var(--controls-width) !important;
        height: 100% !important;
        top: 0 !important;
        padding-top: 10px !important;
    }
    
    .player-root.nav-right .controls-panel {
        right: calc(-1 * var(--controls-width)) !important;  /* Fully in padding zone */
        left: auto !important;
    }
    
    .player-root.nav-left .controls-panel {
        left: calc(-1 * var(--controls-width)) !important;  /* Fully in padding zone */
        right: auto !important;
    }
    
    /* Reset stage positioning for mobile */
    .player-root .controls-panel .stage-right,
    .player-root .controls-panel .stage-left,
    .player-root .controls-panel .rightStage,
    .player-root .controls-panel .leftStage {
        position: relative !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        margin: 0 !important;
        /* Center buttons horizontally in panel */
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
    }
    
    /* Reset ul padding for mobile */
    .player-root .controls-panel ul {
        padding: 0 !important;
        margin: 0 !important;
        /* Center list items */
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
    }
    
    /* Show-menu button: position: fixed, centered in padding zone */
    .player-root.nav-right .btn-show-menu {
        right: 0.5rem !important;
        left: auto !important;
    }
    
    .player-root.nav-left .btn-show-menu {
        left: 0.5rem !important;
        right: auto !important;
    }
    
    /* Nav buttons: position in padding zone (below show-menu) */
    .player-root.nav-right .nav-buttons {
        right: 0.5rem !important;
        left: auto !important;
    }
    
    .player-root.nav-left .nav-buttons {
        left: 0.5rem !important;
        right: auto !important;
    }
    
    /* =========================================
       Mobile Fullscreen Mode
       In fullscreen, buttons go ON the video (no padding zone)
       ========================================= */
    .player-root.fullscreen,
    .player-root.fullscreen.nav-right,
    .player-root.fullscreen.nav-left {
        padding: 0 !important;
    }
    
    .player-root.fullscreen .video-container {
        width: 100% !important;
        height: 100% !important;
    }
    
    /* Controls panel: overlay on video in fullscreen */
    .player-root.fullscreen .controls-panel {
        position: absolute !important;
    }
    
    .player-root.fullscreen.nav-right .controls-panel {
        right: 0 !important;
    }
    
    .player-root.fullscreen.nav-left .controls-panel {
        left: 0 !important;
    }
    
    /* Show-menu button on video */
    .player-root.fullscreen.nav-right .btn-show-menu {
        right: 0.5rem !important;
    }
    
    .player-root.fullscreen.nav-left .btn-show-menu {
        left: 0.5rem !important;
    }
    
    /* Nav buttons on video */
    .player-root.fullscreen.nav-right .nav-buttons {
        right: 0.5rem !important;
    }
    
    .player-root.fullscreen.nav-left .nav-buttons {
        left: 0.5rem !important;
    }
}

/* Fullscreen mode */
.full_screen {
    position: fixed;
    z-index: 10;
    left: 0;
    top: 0;
    width: 100%;
    height: calc(var(--vh, 1vh) * 100);
}

.menu-position-left {
    left: 8px !important;
}

.menu-position-right {
    right: 38px !important;
}

.menu-hidden {
    display: none !important;
}
/* =========================================
   Volume Slider (horizontal, appears on music button hover)
   Same height and style as music button
   ========================================= */

.volume-control-wrapper {
    position: relative;
}

.volume-slider-container {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    /* Match button height (~32px) and style */
    height: 32px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.8);  /* Same as menu button background */
    border-radius: 16px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
}

/* Right nav: slider on LEFT of button */
.nav-right .volume-slider-container {
    right: 100%;
    left: auto;
    margin-right: 8px;
}

/* Left nav: slider on RIGHT of button */
.nav-left .volume-slider-container {
    left: 100%;
    right: auto;
    margin-left: 8px;
}

/* Show slider on hover (desktop with mouse only) */
@media (hover: hover) and (pointer: fine) {
    .volume-control-wrapper:hover .volume-slider-container {
        opacity: 1;
        visibility: visible;
    }
}

/* Show slider when .visible class added (mobile long-press) */
.volume-slider-container.visible {
    opacity: 1;
    visibility: visible;
}

/* Volume value display */
.volume-value {
    color: var(--vilbil-teal);  /* Teal color to match theme */
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    min-width: 32px;
    text-align: center;
}

/* Horizontal range slider */
.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

/* Webkit (Chrome, Safari) track */
.volume-slider::-webkit-slider-runnable-track {
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, var(--vilbil-teal) 0%, var(--vilbil-teal) var(--volume-percent, 100%), rgba(0,0,0,0.15) var(--volume-percent, 100%), rgba(0,0,0,0.15) 100%);
    border-radius: 2px;
}

/* Webkit thumb */
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--vilbil-teal);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    margin-top: -5px;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 6px rgba(20, 81, 98, 0.5);
}

/* Firefox track */
.volume-slider::-moz-range-track {
    width: 80px;
    height: 4px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
}

/* Firefox progress (filled part) */
.volume-slider::-moz-range-progress {
    background: var(--vilbil-teal);
    border-radius: 2px;
}

/* Firefox thumb */
.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--vilbil-teal);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* =========================================
   Ad Bottom Sheet (Mobile)
   iOS/Android style slide-up confirmation
   ========================================= */

.ad-bottom-sheet {
    position: absolute;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    opacity: 0;
    visibility: hidden;
    transition: background 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    overflow: hidden;
}

.ad-bottom-sheet.visible {
    background: rgba(0, 0, 0, 0.3);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.ad-sheet-content {
    width: calc(100% - 32px);
    max-width: 400px;
    margin: 0 16px 16px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 16px 20px 20px;
    transform: translateY(calc(100% + 16px));
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.ad-bottom-sheet.visible .ad-sheet-content {
    transform: translateY(0);
}

.ad-sheet-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.ad-sheet-icon {
    width: 24px;
    height: 24px;
    color: var(--vilbil-teal, #145162);
    transform: rotate(-45deg);
}

.ad-sheet-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.ad-sheet-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--vilbil-teal, #145162);
}

.ad-sheet-domain {
    text-align: center;
    font-size: 14px;
    color: var(--vilbil-teal, #145162);
    margin-bottom: 20px;
    word-break: break-all;
}

.ad-sheet-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ad-sheet-btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease, background 0.2s ease;
}

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

.ad-sheet-confirm {
    background: var(--vilbil-teal, #145162);
    color: #fff;
}

.ad-sheet-confirm:hover {
    background: #1a6a7f;
}

.ad-sheet-cancel {
    background: #333;
    color: #fff;
}

.ad-sheet-cancel:hover {
    background: #444;
}

/* Safe area padding for notched devices */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .ad-sheet-content {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
}

/* =========================================
   Migration Overlay — Fade to Black
   ========================================= */
.migration-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.migration-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.migration-overlay.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.migration-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-family: inherit;
    text-align: center;
    letter-spacing: 0.5px;
}
