/* === Lewis Structures Game Styles === */

#game-area {
    width: 100%;
    max-width: 600px;
    margin: 1.5rem auto;
}

/* --- Mode Toggle --- */
#mode-toggle {
    text-align: center;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #495057;
}

#mode-toggle label {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#mode-toggle input[type="checkbox"] {
    accent-color: #362A8D;
    width: 16px;
    height: 16px;
}

/* --- Canvas Wrapper --- */
#lewis-canvas-wrap {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: #fff;
    /* 4:5 aspect ratio to give room for tray at bottom */
    aspect-ratio: 5 / 5;
    touch-action: none;
}

#lewis-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: pointer;
    border-radius: 8px;
}

/* --- Target Display --- */
#target-display {
    text-align: center;
    margin-bottom: 0.75rem;
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
}

#target-formula sub {
    font-size: 0.75em;
}

/* --- Game Controls --- */
#game-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 1rem;
}

#primary-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

#check-btn {
    background-color: #362A8D;
    min-width: 100px;
}

#skip-btn {
    background-color: #bbc8ca;
    min-width: 100px;
}

#skip-btn.next-ready {
    background-color: #333;
}

#secondary-controls {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
}

#secondary-controls .link-button {
    font-size: 0.85rem;
    padding: 2px 0;
}

#secondary-controls .link-button:disabled {
    color: #adb5bd;
    text-decoration: none;
    cursor: default;
}

/* --- Feedback --- */
#feedback-message {
    min-height: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 0.5rem;
}

/* --- Animations --- */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

#lewis-canvas-wrap.shake {
    animation: shake 0.4s ease;
    border-color: #dc3545;
}

#lewis-canvas-wrap.correct-flash {
    animation: pop 0.3s ease;
    border-color: #28a745;
    background-color: #d4edda;
}

/* --- Valence Prompt Overlay --- */
#valence-prompt {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.88);
    z-index: 10;
    border-radius: 8px;
}

#valence-prompt-box {
    text-align: center;
    padding: 1.25rem 1.75rem;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

#valence-prompt-box p {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    color: #333;
}

#valence-prompt-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

#valence-prompt-input {
    width: 60px;
    padding: 6px 8px;
    font-size: 1.1rem;
    text-align: center;
    border: 2px solid #dee2e6;
    border-radius: 6px;
}

#valence-prompt-input:focus {
    outline: none;
    border-color: #362A8D;
}

#valence-prompt-submit {
    padding: 6px 16px;
    background: #362A8D;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
}

#valence-prompt-feedback {
    min-height: 1.2rem;
    color: #dc3545;
    font-size: 0.85rem;
    font-weight: normal;
    margin: 0.5rem 0 0;
}

/* --- Responsive --- */
@media (max-width: 500px) {
    #lewis-canvas-wrap {
        max-width: 100%;
    }
}
