/* ===== Layout ===== */
.container {
    padding: 0 12px;
}
@media (min-width: 768px) {
    .container { padding: 0 24px; }
}

/* Footer */
.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 60px;
}

/* Demo container – row‑reverse on desktop, column‑reverse on mobile */
#demo-container {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    width: 100%;
    flex-direction: row-reverse;
}
#demo-board {
    aspect-ratio: 1 / 1;
    width: min(80vw, 80vh, 600px);
    max-width: 100%;
    height: auto;
    flex: none; /* Important – remove flex stretching */
}
#html-sliders-container {
    flex: 1;
    min-width: 200px;
    max-width: 350px;
}

@media (max-width: 768px) {
    #demo-container {
        flex-direction: column-reverse;
    }
    #demo-board,
    #html-sliders-container {
        flex: unset !important;
        width: 100%;
        max-width: 100%;
        min-width: 100%;
    }
}

/* Boards */
#demo-board,
.jsxgraph-board {
    width: min(100%, 500px);
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    display: block;
    overflow: hidden;
    touch-action: none;
}
@media (max-width: 600px) {
    #demo-board,
    .jsxgraph-board {
        height: 280px;
    }
}

/* Memory Palace items */
.memory-item {
    transition: box-shadow 0.2s;
}

    .memory-item:hover {
        box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    }

    .memory-item:active {
        cursor: grabbing;
    }