/* --- GAME STYLES --- */

.game-wrapper {
    background: linear-gradient(180deg, #5973a6 0%, #0D0053 56%);
    min-height: 100vh;
    padding: 20px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto 30px;
}

.game-title-left {
    color: #ffff00;
    font-size: 2em;
    margin: 0;
    flex: 0 0 auto;
}

.game-title-center {
    color: #ffff00;
    font-size: 1.8em;
    margin: 0;
    flex: 1;
    text-align: center;
}

.game-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto 40px;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.game-top-row {
    display: flex;
    gap: 30px;
}

.circuit-area {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border: 2px solid #000;
    background: white;
    min-height: auto;
    border-radius: 8px;
    position: relative;
    overflow: visible;
    padding: 20px;
}

.circuit-diagram {
    width: 100%;
    max-width: 400px;
    flex-shrink: 0;
}

.instructions-box {
    flex: 1;
    border: 2px solid #000;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.instructions-box h3 {
    margin: 0 0 15px 0;
    font-size: 1.4em;
    text-align: right;
    color: #000;
}

.instructions-content {
    flex: 1;
    font-size: 0.9em;
    line-height: 1.5;
    color: #333;
}

.instructions-content p {
    margin: 8px 0;
}

.help-button {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: #9966cc;
    color: white;
    padding: 8px 16px;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.help-button:hover {
    transform: scale(1.1);
}

.instructions-box {
    position: relative;
}

/* --- DRAGGABLE ELEMENTS --- */
.elements-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    position: relative;
    z-index: 10;
    background: linear-gradient(135deg, #c5ddeb 0%, #abd0d3 100%);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.element {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: grab;
    padding: 16px 24px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    min-width: 110px;
    position: relative;
    z-index: 10;
    text-decoration: none;
    user-select: none;
}

.element:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.element:active {
    cursor: grabbing;
    opacity: 0.95;
}

.element svg {
    width: 60px;
    height: 60px;
    display: block;
}

.element p {
    color: #ffffff;
    font-weight: 600;
    margin: 5px 0 0 0;
    font-size: 0.95em;
    text-align: center;
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .game-top-row {
        flex-direction: column;
    }

    .circuit-area {
        min-height: 300px;
    }

    .elements-container {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .game-header {
        flex-direction: column;
        gap: 10px;
    }

    .game-title-left,
    .game-title-center {
        font-size: 1.3em;
    }

    .game-container {
        padding: 15px;
        gap: 15px;
    }

    .instructions-box {
        min-height: auto;
        padding: 15px;
    }

    .elements-container {
        gap: 15px;
        padding: 10px;
    }

    .element {
        padding: 10px;
    }
}
