/* ===== SPACE INVADERS EASTER EGG =====
 * Self-contained styles - all classes prefixed with 'si-' to avoid conflicts
 * ======================================= */

/* Game Container - sits above everything when active */
#si-game-container {
    position: fixed;
    top: -100vh;
    left: 0;
    width: 100%;
    height: 100%;
    background: none;
    z-index: 10000;
    transition: top 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

#si-game-container.si-active {
    top: 0;
    pointer-events: auto;
}

/* Game Canvas */
#si-canvas {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(27, 31, 34, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    border-radius: 4px;
}

/* Game UI - Score, Lives, Hi-Score */
#si-game-ui {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 40px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    letter-spacing: 0.1rem;
}

#si-exit-hint {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.05rem;
}

/* Mobile Controls */
#si-mobile-controls {
    display: none;
    position: absolute;
    bottom: 50px;
    left: 0;
    width: 100%;
    padding: 0 20px;
    justify-content: space-between;
    align-items: center;
}

.si-mobile-btn {
    width: 65px;
    height: 65px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    background: rgba(27, 31, 34, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.8);
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.3);
}

.si-mobile-btn:active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.si-direction-btns {
    display: flex;
    gap: 15px;
}

/* Hide mobile controls on devices with fine pointer (mouse) */
@media (pointer: fine) {
    #si-mobile-controls {
        display: none !important;
    }
}

/* Show mobile controls only on small screens (mobile phones/tablets) */
@media (max-width: 768px) {
    #si-mobile-controls {
        display: flex;
    }
    #si-exit-hint {
        bottom: 130px;
    }
}

/* But still hide on small screens if a mouse is present */
@media (max-width: 768px) and (pointer: fine) {
    #si-mobile-controls {
        display: none !important;
    }
}

/* Game Overlay - Modal Style */
#si-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    max-width: 90%;
    padding: 3rem 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(27, 31, 34, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    z-index: 100;
    font-family: 'Courier New', monospace;
    color: #ffffff;
}

#si-overlay.si-hidden {
    display: none;
}

#si-overlay-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 400;
    letter-spacing: 0.3rem;
    animation: si-pulse-glow 2s infinite;
}

@keyframes si-pulse-glow {
    0%, 100% { text-shadow: 0 0 20px rgba(255, 255, 255, 0.3); }
    50% { text-shadow: 0 0 30px rgba(255, 255, 255, 0.6); }
}

#si-overlay p {
    font-size: 0.85rem;
    margin: 0.3rem 0;
    opacity: 0.7;
    letter-spacing: 0.1rem;
    text-align: center;
}

#si-final-score {
    font-size: 1.2rem;
    margin: 1rem 0;
    letter-spacing: 0.15rem;
}

/* Sensitivity Slider */
.si-slider-container {
    margin-top: 1.5rem;
    width: 100%;
    text-align: center;
}

.si-slider-label {
    font-size: 0.75rem;
    letter-spacing: 0.1rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
    display: block;
}

.si-slider-value {
    font-size: 0.85rem;
    opacity: 0.9;
}

#si-sensitivity-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    max-width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    margin: 0.5rem 0;
}

#si-sensitivity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    transition: transform 0.2s, box-shadow 0.2s;
}

#si-sensitivity-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
}

#si-sensitivity-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

#si-start-btn {
    margin-top: 1.5rem;
    padding: 12px 35px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #ffffff;
    cursor: pointer;
    letter-spacing: 0.15rem;
    transition: all 0.3s ease;
    border-radius: 4px;
}

#si-start-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

@media screen and (max-width: 480px) {
    #si-overlay {
        padding: 2rem 2.5rem;
    }
    #si-overlay-title {
        font-size: 1.5rem;
    }
}

/* Logo shake animation for easter egg trigger */
.si-logo-shaking {
    animation: si-rocket-shake 0.1s infinite !important;
}

.si-logo-shaking img {
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.8)) !important;
}

@keyframes si-rocket-shake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-2px, 1px) rotate(-1deg); }
    50% { transform: translate(2px, -1px) rotate(1deg); }
    75% { transform: translate(-1px, -2px) rotate(-0.5deg); }
}

/* Countdown ring for hold progress */
.si-countdown-ring {
    position: absolute;
    width: 140px;
    height: 140px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.si-countdown-ring.si-visible {
    opacity: 1;
}

.si-countdown-ring svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.si-countdown-ring circle {
    fill: none;
    stroke: rgba(255, 255, 255, 0.8);
    stroke-width: 2;
    stroke-dasharray: 408;
    stroke-dashoffset: 408;
    transition: stroke-dashoffset 0.1s linear;
}

/* Wrapper slide animation */
#wrapper.si-slide-down {
    transform: translateY(100vh);
    transition: transform 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
