/* --- GRAPHICS MODULE: CHAOS THEORY (OPTIMIZED + TOUCH HINT) --- */

:root {
    --gfx-bg: #080808;
    --gfx-border: #2a2a2e;
}

/* --- CONTAINER --- */
.gfx-window {
    background-color: var(--gfx-bg);
    border: 1px solid var(--gfx-border);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin-bottom: 1.5rem;
    height: 240px;
    width: 100%;
    position: relative;
    overflow: hidden;

    transform: translateZ(0);
    will-change: transform;
    touch-action: none;

    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.gfx-window:active {
    cursor: grabbing;
}

.gfx-window:hover {
    border-color: #555;
    transform: translateY(-2px);
}

/* --- INTERACTIVE HINT (ICON) --- */
.gfx-hint {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 20;

    color: rgba(255, 255, 255, 0.8);
    font-size: 20px;

    /* Не мешает кликать */
    pointer-events: none;

    /* Анимация пульсации */
    animation: pulse-hint 2s infinite ease-in-out;
    transition: opacity 0.5s ease;
}

@keyframes pulse-hint {
    0% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 0.5; }
}

/* Класс для скрытия подсказки после первого тача */
.gfx-hint.hidden {
    opacity: 0 !important;
    animation: none;
}

/* --- CRT OVERLAY --- */
.gfx-window::before {
    content: " ";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.2) 2px,
        rgba(0, 0, 0, 0.2) 4px
    );
    z-index: 5;
    pointer-events: none;
    opacity: 0.5;
}

/* VIGNETTE */
.gfx-window::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 30%, rgba(0,0,0,0.8) 120%);
    pointer-events: none;
    z-index: 6;
}

/* --- CANVAS --- */
#gfx-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: block;
    image-rendering: auto;
}

/* HIDE UI */
.gfx-ui, .gfx-header, .gfx-footer, .gfx-status {
    display: none !important;
}