html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
    background-color: #444;
    font-family: 'Roboto', 'Helvetica', Arial, sans-serif;
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
    transition: opacity 0.5s ease;
    overflow: hidden;
    background-color: #011c2f;
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0d3004;
    z-index: 900;
    opacity: 1;
    /* Start transparent, made visible during transitions */
    pointer-events: none;
    transition: opacity 0.5s ease;

    width: 100%;
    height: 100vh;
    /* Full viewport height for 1920x1080 or 1080x1920 */
    background: linear-gradient(45deg,
            #000000 0%,
            /* Black start */
            #1a1a1a 25%,
            /* Dark grey transition */
            #333333 50%,
            /* Dark grey midpoint */
            #1a1a1a 75%,
            /* Dark grey transition */
            #000000 100%
            /* Black end */
        );
    background-size: 200% 200%;
    /* Ensures smooth scaling */
    background-repeat: no-repeat;
}

#overlay::before {
    content: '';
    position: absolute;
    top: 75%;
    /* 75% from the top */
    left: 50%;
    /* Center horizontally */
    transform: translate(-50%, -75%);
    /* Adjust for SVG dimensions */
    width: 200px;
    /* Size for visibility, adjust as needed */
    height: 200px;
    background-image: url('data:image/svg+xml;utf8,<svg fill="" viewBox="0 0 24 24" role="img" xmlns="http://www.w3.org/2000/svg" stroke=""><g id="SVGRepo_bgCarrier" stroke-width="1"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><path d="M21.893 8.23c-4.187.001-5.249 2.365-5.42 3.97-.194 1.802 1.053 3.57 4.127 3.57 1.294 0 2.14-.225 2.44-.32a.215.215 0 0 0 .147-.166l.173-.91a.184.184 0 0 0-.236-.21c-.336.106-.93.252-1.685.252-1.469 0-2.53-.882-2.395-2.4.13-1.47 1.121-2.59 2.485-2.59.82 0 1.183.43 1.156 1.003v.033a.184.184 0 0 0 .182.193h.557c.086 0 .16-.06.18-.143l.39-1.76a.215.215 0 0 0-.15-.255 7.21 7.21 0 0 0-1.95-.266zm-20.157.116a.2.2 0 0 0-.195.156l-.108.484a.198.198 0 0 0 .13.23l.033.01c.208.082.45.266.348.748l-.792 3.62c-.207.987-.542 1.19-.86 1.226h-.01a.2.2 0 0 0-.176.157l-.102.464a.192.192 0 0 0 .187.233h3.487c.085 0 .159-.06.177-.142l.12-.543a.184.184 0 0 0-.112-.21l-.022-.01c-.177-.07-.418-.224-.356-.51l.405-1.85c1.389 2.535 1.848 3.266 3.514 3.265H8.91a.181.181 0 0 0 .177-.142l.105-.47a.195.195 0 0 0-.186-.238c-.376-.006-.56-.093-.935-.575l-1.932-2.614 2.51-2.088c.337-.264.748-.338.976-.368l.022-.002a.185.185 0 0 0 .163-.144l.103-.464a.184.184 0 0 0-.18-.223h-3.02a.199.199 0 0 0-.193.155l-.102.46a.2.2 0 0 0 .138.235c.178.069.217.24.063.366L4.046 11.7l.44-2.014a.683.683 0 0 1 .477-.487l.025-.008a.199.199 0 0 0 .135-.147l.106-.477a.181.181 0 0 0-.177-.22zm8.88 0a.2.2 0 0 0-.194.156l-.107.483a.19.19 0 0 0 .122.221l.02.008c.204.077.487.274.364.758l-1.21 5.48a.182.182 0 0 0 .178.222h2.777c.086 0 .16-.06.179-.143l.12-.547a.174.174 0 0 0-.098-.196 1.558 1.558 0 0 1-.027-.013c-.176-.086-.438-.285-.35-.67.009-.05.27-1.24.27-1.24h2.362c.086 0 .16-.06.18-.143l.221-1a.183.183 0 0 0-.18-.224h-2.28l.427-1.94 1.592-.003c.515 0 .672.27.642.728l-.002.024a.184.184 0 0 0 .183.205h.587c.086 0 .16-.06.178-.144l.4-1.8a.184.184 0 0 0-.18-.222z"></path></g></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    filter: invert(100%);
    /* Invert white to black */
}
/* Styles for Service Worker Progress UI on the overlay */
#sw-progress-container {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: none; /* Hidden by default, shown by JS */
    flex-direction: column;
    align-items: center;
    z-index: 901; /* Above overlay background, below other potential popups if any */
}

#sw-progress-bar {
    width: 250px; /* Or your preferred width */
    height: 10px;
    background-color: #555; /* Darker background for the bar */
    border: 1px solid #777;
    border-radius: 5px;
    overflow: hidden; /* To contain the fill */
    margin-bottom: 8px; /* Space between bar and text */
}

#sw-progress-bar-fill {
    width: 0%; /* Initial width */
    height: 100%;
    background-color: lightgrey; /* Fill color */
    transition: width 0.3s ease-out, background-color 0.3s ease-out; /* Added background-color transition */
    animation: pulsate-opacity 2s infinite ease-in-out; /* Add pulsation animation */
}

#sw-status-message {
    font-size: 12pt;
    color: lightgrey;
    font-family: sans-serif; /* As requested */
    text-align: center;
}
/* Keyframes for opacity pulsation */
@keyframes pulsate-opacity {
    0% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.7;
    }
}

#precache-status {
    position: fixed; /* Use fixed to position relative to viewport */
    bottom: 20px; /* Position from the bottom */
    left: 50%; /* Center horizontally */
    transform: translateX(-50%); /* Adjust for centering */
    font-size: 12pt;
    color: white;
    font-family: sans-serif;
    z-index: 10001; /* Ensure it's above the overlay */
    text-shadow: 1px 1px 2px black; /* Improve readability */
    display: none; /* Hidden by default */
}

#error {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #721c24;
    color: #fff;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
    padding: 20px;
    text-align: center;
    font-family: Arial, sans-serif;
}

#countdown {
    margin-top: 20px;
    font-size: 1.2em;
}

/* Debug panel styles - hidden by default */
.debug-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 300px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px;
    font-size: 12px;
    z-index: 1000;
    display: none;
}

.debug-panel.visible {
    display: block;
}

.debug-item {
    margin-bottom: 5px;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

.debug-title {
    font-weight: bold;
    color: #4CAF50;
}