:root {
    --signal-page-top-offset: 40px; /* INSTÄLLNING - Avståndet från toppen för hela layouten. */
    --signal-section-gap: 16px; /* INSTÄLLNING - Avståndet mellan HUD, spelplan och instruktion. */
    --signal-panel-size: min(480px, calc(100vh - 350px)); /* INSTÄLLNING - Storlek på spelpanelen. */
    --signal-noise-opacity: 0.12; /* INSTÄLLNING - noiseOpacity */
}

.fade-in-up.delay-1 {
    padding-top: var(--signal-page-top-offset);
}

#game-container {
    position: relative;
    width: 480px;
    background: linear-gradient(135deg, #0e0e12, #08080a);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 
        inset 0 12px 40px rgba(0, 0, 0, 0.9),
        0 20px 60px rgba(0, 0, 0, 0.5);
}

#screen {
    position: relative;
    height: 180px;
    background-color: #050507;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 15px rgba(0,0,0,0.8);
}

#noise-layer {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: var(--signal-noise-opacity);
    mix-blend-mode: screen;
    pointer-events: none;
}

#wave-container { width: 90%; height: 80px; opacity: 0.9; }
#signal-wave { width: 100%; height: 100%; filter: drop-shadow(0 0 8px currentColor); }
#wave-path { fill: none; stroke: var(--signal-color, #8b6cff); stroke-width: 1.5; transition: stroke 0.3s ease; }

#lock-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #4cc9f0;
    letter-spacing: 0.2em;
    padding: 2px 8px;
    border: 1px solid #4cc9f0;
    border-radius: 4px;
}

.overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(5, 5, 7, 0.95);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 2rem;
    text-align: center;
}

.overlay.hidden { display: none; }
.hidden { display: none !important; }


/* INSTÄLLNING - Global Mobile Fallback Fix */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw;
}
@media (max-width: 800px) {
    canvas, .game-canvas, #game-container, #game-stage, #app {
        max-width: 100% !important;
        height: auto;
    }
    .panel, .sidebar, .menu, #ui, #overlay {
        max-width: 100% !important;
        box-sizing: border-box;
    }
}
