* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: #000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: #fff;
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    /* Establish a containment context so children inside the offline overlay
       can scale relative to the player's width (cqw units), keeping the 16:9
       aspect intact while still fitting all content on small screens. */
    container-type: inline-size;
}

/* ========== QUALITY SELECTOR MENU ========== */
/* By default Video.js caps menu height at ~10em and shows a scrollbar.
   With displayCurrentQuality: true the quality menu has Auto + one row
   per rendition, which often pushes Auto off-screen. Let the menu grow
   to fit every item (and stay anchored above the control bar). */
.video-js .vjs-quality-selector .vjs-menu-content {
    max-height: none;
    overflow: visible;
}

/* ========== MUTED OVERLAY ========== */
.muted-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    z-index: 10;
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.2s ease, background 0.2s ease;
    animation: pulse 2s infinite;
    user-select: none;
}

.muted-overlay:hover,
.muted-overlay:focus {
    background: rgba(31, 111, 235, 0.95);
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.5);
    outline: none;
}

.muted-overlay.hidden {
    display: none;
}

.muted-overlay svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(255, 255, 255, 0); }
}

/* ========== OFFLINE OVERLAY ========== */
.offline-overlay {
    position: absolute;
    inset: 0;
    background: #ab2734;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    padding: clamp(8px, 2cqw, 28px);
    /* Maintain 16:9 strictly: clip anything that would overflow on extreme
       sizes rather than letting the panel grow taller. */
    overflow: hidden;
    /* Vertical rhythm between rows scales with the player width. */
    gap: clamp(4px, 3.2cqw, 48px);
}

.offline-overlay.hidden {
    display: none;
}

.ceremony-title {
    font-size: clamp(14px, 3.4cqw, 44px);
    font-weight: 700;
    margin: 0;
    padding: 0 clamp(8px, 2cqw, 24px);
    max-width: 1100px;
    letter-spacing: 0.5px;
    text-align: center;
    text-wrap: balance;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    line-height: 1.15;
}

.offline-message {
    font-size: clamp(12px, 2.1cqw, 28px);
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    text-align: center;
    max-width: 700px;
    line-height: 1.4;
    padding: 0 clamp(8px, 1.5cqw, 16px);
}

.countdown-container {
    display: flex;
    gap: clamp(4px, 1.4cqw, 20px);
    flex-wrap: nowrap; /* Force a single row to preserve 16:9 fit. */
    justify-content: center;
}

.countdown-box {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: clamp(8px, 2cqw, 28px) clamp(10px, 2.4cqw, 32px);
    border-radius: clamp(8px, 1.2cqw, 16px);
    min-width: clamp(48px, 8.5cqw, 110px);
    text-align: center;
}

.countdown-value {
    font-size: clamp(20px, 4.4cqw, 60px);
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.countdown-label {
    font-size: clamp(8px, 1.2cqw, 16px);
    color: rgba(255, 255, 255, 0.75);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-top: clamp(3px, 0.6cqw, 8px);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
    .muted-overlay {
        top: 12px;
        right: 12px;
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* ========== CAPTIONS BUTTON - VISIBILITY ENHANCEMENT ========== */

/* 
 * Important: We style the inner placeholder, NOT the button itself.
 * This preserves Video.js's default sizing and click target.
 */

/* Subtle background tint on the button (no size changes) */
.video-js .vjs-subs-caps-button,
.video-js .vjs-captions-button,
.video-js .vjs-subtitles-button {
    background-color: rgba(31, 111, 235, 0.25);
    transition: background-color 0.2s ease;
}

.video-js .vjs-subs-caps-button:hover,
.video-js .vjs-captions-button:hover,
.video-js .vjs-subtitles-button:hover {
    background-color: rgba(31, 111, 235, 0.6);
}

/* Brighten the icon itself (no size changes — keeps it centered) */
.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,
.video-js .vjs-captions-button .vjs-icon-placeholder:before,
.video-js .vjs-subtitles-button .vjs-icon-placeholder:before {
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.9);
}

/* Active state when captions are turned ON */
.video-js .vjs-subs-caps-button.vjs-captioning,
.video-js .vjs-captions-button.vjs-captioning,
.video-js .vjs-subtitles-button.vjs-captioning {
    background-color: rgba(31, 111, 235, 0.85);
}