/* ============================================
   Stuck Pixel Fixer Styles
   ============================================ */

/* Section Container */
.pixel-fixer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 1rem;
}

/* Epilepsy Warning */
.epilepsy-warning {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(255, 68, 68, 0.4);
    animation: pulse-warning 2s ease-in-out infinite;
    max-width: 500px;
    text-align: center;
}

.epilepsy-warning .warning-icon {
    font-size: 1.5rem;
}

@keyframes pulse-warning {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(255, 68, 68, 0.4);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 6px 25px rgba(255, 68, 68, 0.6);
    }
}

/* Fixer Box (Preview on main page) */
.fixer-box {
    position: relative;
    width: 300px;
    height: 300px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.3),
        0 0 0 4px rgba(255, 255, 255, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    cursor: grab;
    touch-action: none;
    user-select: none;
    transition: box-shadow 0.2s ease;
}

.fixer-box:active {
    cursor: grabbing;
    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.4),
        0 0 0 4px rgba(74, 144, 226, 0.5),
        inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.fixer-box canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: #000;
}

/* Controls */
.controls-toolbar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-glow {
    animation: btn-glow 2s ease-in-out infinite;
}

@keyframes btn-glow {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
    }

    50% {
        box-shadow: 0 4px 25px rgba(74, 144, 226, 0.7);
    }
}

/* ============================================
   Fullscreen Overlay
   ============================================ */

.fixer-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: #000;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.fixer-fullscreen-overlay.active {
    display: flex;
}

/* Fixer Box in Fullscreen */
.fixer-box-fullscreen {
    position: absolute;
    width: 300px;
    height: 300px;
    /* Border and overflow moved to inner wrapper to allow tooltip outside */
    cursor: grab;
    touch-action: none;
    user-select: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.fixer-canvas-wrapper {
    width: 100%;
    height: 100%;
    border: 4px solid #555;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: border-color 0.2s ease;
}

.fixer-box-fullscreen:active .fixer-canvas-wrapper {
    border-color: #4a90e2;
}

.fixer-box-fullscreen:active {
    cursor: grabbing;
}

.fixer-box-fullscreen canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: #000;
}


/* Tooltip */
.fixer-tooltip {
    position: absolute;
    left: 105%;
    /* Position to the right of the box */
    top: 50%;
    transform: translateY(-50%);
    background: white;
    color: #333;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    width: 250px;
    font-size: 0.9rem;
    line-height: 1.4;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    /* Let clicks pass through if needed, though interaction hides it */
    opacity: 1;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.fixer-tooltip.hidden {
    opacity: 0;
}

.tooltip-arrow {
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid white;
}

/* Floating Buttons */
.floating-btn {
    position: fixed;
    bottom: 20px;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    z-index: 100000;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    touch-action: none;
}

.floating-btn:hover {
    transform: scale(1.1);
}

/* Resize Button - Green, Bottom Right */
.floating-btn-resize {
    right: 20px;
    background: #2ecc71;
    color: white;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.5);
}

.floating-btn-resize:hover {
    box-shadow: 0 6px 25px rgba(46, 204, 113, 0.7);
}

/* Responsive */
@media (max-width: 400px) {

    .fixer-box,
    .fixer-box-fullscreen {
        width: 280px;
        height: 280px;
    }

    .epilepsy-warning {
        font-size: 0.85rem;
        padding: 0.75rem 1rem;
    }

    .floating-btn {
        width: 45px;
        height: 45px;
    }
}

/* Hide body content when fullscreen is active */
body.fixer-fullscreen-active {
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    zoom: 1 !important;
    transform: none !important;
}

body.fixer-fullscreen-active>*:not(.fixer-fullscreen-overlay) {
    visibility: hidden !important;
}

body.fixer-fullscreen-active .fixer-fullscreen-overlay {
    visibility: visible !important;
}