#difficulty-filter {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 0.25rem auto 0;
    padding: 6px 14px;
    background: #f4f3f9;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    width: fit-content;
}

.filter-label {
    font-size: 0.8rem;
    color: #495057;
    font-weight: 500;
}

.diff-btn {
    padding: 4px 14px;
    border: 1.5px solid #c5c0e0;
    border-radius: 6px;
    background: #fff;
    color: #6c757d;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.diff-btn:hover {
    border-color: #362A8D;
    color: #362A8D;
    background: #fff;
}

.diff-btn.active {
    background: #362A8D;
    border-color: #362A8D;
    color: white;
}

#problem-prompt {
    text-align: center;
    font-size: 1.1rem;
    margin: 0.5rem 0;
    color: #495057;
    font-weight: 500;
}

#build-layout {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 0.5rem auto;
    flex-wrap: wrap;
}

#structure-container {
    width: 280px;
    height: 280px;
}

#newman-container {
    width: 280px;
    position: relative;
}

#newman-svg {
    width: 100%;
    height: auto;
    touch-action: none;
}

#newman-bottom-overlay {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    text-align: center;
}

/* Answer toggle (Correct / Yours) */
#answer-toggle {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.answer-toggle-btn {
    padding: 3px 12px;
    border: 1.5px solid #ccc;
    border-radius: 5px;
    background: rgba(255,255,255,0.9);
    color: #6c757d;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.answer-toggle-btn[data-show="correct"] {
    border-color: #28a745;
    color: #28a745;
}

.answer-toggle-btn[data-show="correct"].active {
    background: #28a745;
    color: white;
}

.answer-toggle-btn[data-show="yours"] {
    border-color: #dc3545;
    color: #dc3545;
}

.answer-toggle-btn[data-show="yours"].active {
    background: #dc3545;
    color: white;
}

/* Carbon number labels on RDKit structure */
.carbon-label {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 20px;
    font-weight: 600;
    fill: #362A8D;
}

/* Newman diagram elements */
.newman-back-circle {
    fill: none;
    stroke: #333;
    stroke-width: 2;
}

.newman-front-dot {
    fill: #333;
}

.newman-bond {
    stroke: #333;
    stroke-width: 2;
}

.newman-bond.back {
    stroke: #666;
}

.newman-label {
    font-family: Arial, sans-serif;
    font-size: 18px;
    dominant-baseline: central;
    pointer-events: none;
}

/* Rotation handles */
.rotation-handle {
    cursor: grab;
    transition: filter 0.15s;
}

.rotation-handle:hover {
    filter: brightness(0.85);
}

.rotation-handle.grabbing {
    cursor: grabbing;
}


/* Check button */
#check-btn {
    min-width: 140px;
    padding: 10px 30px;
}

@media (max-width: 650px) {
    #build-layout {
        flex-direction: column;
    }

    #structure-container {
        width: 260px;
        height: 260px;
    }

    #newman-container {
        width: 260px;
    }
}
