:root {
    --path-page-top-offset: 40px; /* INSTÄLLNING - Avståndet från toppen för hela layouten. */
    --path-section-gap: 16px; /* INSTÄLLNING - Avståndet mellan HUD, spelplan och instruktion. */
    --path-panel-size: min(450px, calc(100vh - 350px)); /* INSTÄLLNING - Storlek på spelpanelen. */
    --path-glow: 0.28; /* INSTÄLLNING - pathGlowStrength */
    --visited-opacity: 0.78; /* INSTÄLLNING - visitedTileOpacity */
    --fail-pulse: 0.34; /* INSTÄLLNING - failPulseStrength */
}

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

#game-container {
    position: relative;
    width: 450px;
    height: 450px;
    background-color: #050507;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: inset 0 0 50px rgba(0,0,0,1);
}

#grid-container {
    display: grid;
    width: 100%;
    height: 100%;
    padding: 20px;
}

.node {
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.node::before {
    content: "";
    width: 6px;
    height: 6px;
    background-color: #1a1a25;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.node.visible::before { background-color: #3a3a45; }
.node.player::before { background-color: #8b6cff; box-shadow: 0 0 15px #8b6cff; width: 10px; height: 10px; }
.node.exit::before { background-color: #fff; box-shadow: 0 0 20px #fff; width: 12px; height: 12px; }
.node.collapsed::before { opacity: 0; }
.node.dead { background-color: rgba(255, 76, 76, 0.05); }

.node.interactive { cursor: pointer; }
.node.interactive:hover::before { background-color: #8b6cff; opacity: 0.5; }

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


/* 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;
    }
}
