/* ============================================================
   BIDMAS Challenge — Per-Game Styles
   /maths/css/bidmas.css
   ============================================================ */

:root {
    --primary-color:        #0d9488;
    --primary-hover:        #0f766e;
    --primary-light:        rgba(13, 148, 136, 0.12);
    --primary-shadow:       rgba(13, 148, 136, 0.35);
    --btn-text-color:       #0f5a54;
    --hero-gradient-start:  rgba(13, 148, 136, 0.18);
    --hero-gradient-end:    rgba(6, 182, 212, 0.08);
}

/* ===== DIFFICULTY GRID ===== */

.gs-difficulty-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin: 1rem 0 1.25rem;
}

/* Difficulty has 3 cards — last one spans full width */
#gsDifficultyGrid .gs-diff-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.gs-diff-card {
    padding: 1rem 1.1rem;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.18s ease;
    background: #fff;
    text-align: left;
}

.gs-diff-card:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.gs-diff-card.selected {
    border-color: var(--primary-color);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px var(--primary-shadow);
}

.gs-diff-name {
    font-weight: 700;
    font-size: 1rem;
    color: #212529;
    margin-bottom: 0.3rem;
}

.gs-diff-card.selected .gs-diff-name {
    color: var(--primary-color);
}

.gs-diff-desc {
    font-size: 0.82rem;
    color: #6c757d;
    line-height: 1.4;
}

/* ===== QUESTION DISPLAY ===== */

.bidmas-question-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    text-align: center;
}

.bidmas-task {
    font-size: 1rem;
    color: #555;
    text-align: center;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.bidmas-task strong {
    color: #212529;
}

/* ===== EXPRESSION ROW — shared by all question types ===== */

.bidmas-expr {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 1rem 0 1.5rem;
    font-family: 'Courier New', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: #212529;
    min-height: 3.5rem;
}

.bidmas-token {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.5rem;
    border-radius: 8px;
    line-height: 1;
}

/* Numbers */
.bidmas-token.num {
    color: #212529;
    font-size: 2rem;
}

/* Superscript characters (² ³) within num tokens */
.bidmas-token.num sup,
.bidmas-token.num .sup {
    font-size: 0.6em;
    vertical-align: super;
    line-height: 0;
}

/* Operators */
.bidmas-token.op {
    color: #6c757d;
    font-size: 1.6rem;
}

/* Equals + target */
.bidmas-token.eq {
    color: #6c757d;
    font-size: 1.6rem;
}

.bidmas-token.target {
    color: var(--primary-color);
}

/* Missing operator slot */
.bidmas-token.missing-op {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    border: 2.5px dashed var(--primary-color);
    border-radius: 8px;
    color: var(--primary-color);
    font-size: 1.4rem;
    background: var(--primary-light);
    cursor: default;
}

.bidmas-token.missing-op.filled {
    border-style: solid;
    background: var(--primary-color);
    color: #fff;
}

/* Superscript indices */
.bidmas-token sup {
    font-size: 0.6em;
    vertical-align: super;
    line-height: 0;
}

/* ===== BRACKET DRAG UI ===== */

/* Token bank */
.bidmas-bracket-bank {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.bidmas-bracket-token {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    font-family: 'Courier New', monospace;
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--primary-color);
    color: #fff;
    border-radius: 10px;
    cursor: grab;
    user-select: none;
    box-shadow: 0 3px 10px var(--primary-shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bidmas-bracket-token:active {
    cursor: grabbing;
    transform: scale(1.12);
    box-shadow: 0 6px 18px var(--primary-shadow);
}

.bidmas-bracket-token.depleted {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Drop zones between tokens */
.bidmas-drop-zone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 2.8rem;
    border-radius: 6px;
    border: 2px dashed transparent;
    font-family: 'Courier New', monospace;
    font-size: 1.6rem;
    font-weight: 700;
    color: transparent;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
    cursor: default;
    vertical-align: middle;
    flex-shrink: 0;
}

.bidmas-drop-zone.drag-over {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.bidmas-drop-zone.has-bracket {
    border-color: var(--primary-color);
    background: var(--primary-light);
    color: var(--primary-color);
    cursor: pointer;
    width: auto;
    padding: 0 0.15rem;
}

/* ===== OPERATOR CHOICE BUTTONS (Missing Op) ===== */

.bidmas-op-choices {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.bidmas-op-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.2rem;
    height: 3.2rem;
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    background: #fff;
    color: #212529;
    border: 2.5px solid #dee2e6;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
}

.bidmas-op-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.bidmas-op-btn.selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 3px 10px var(--primary-shadow);
}

/* ===== SPOT THE MISTAKE — step list ===== */

.bidmas-steps {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.bidmas-step-btn {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 1.1rem;
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: all 0.18s ease;
    font-size: 0.95rem;
    font-weight: 600;
    color: #212529;
    width: 100%;
}

.bidmas-step-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.bidmas-step-btn .bidmas-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    background: #f0f0f0;
    color: #555;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.bidmas-step-btn .bidmas-step-expr {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
}

/* ===== TARGET CHALLENGE — expression options ===== */

.bidmas-target-options {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.bidmas-target-btn {
    display: block;
    width: 100%;
    padding: 0.9rem 1.2rem;
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: #212529;
    text-align: center;
    transition: all 0.18s ease;
}

.bidmas-target-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* ===== ANSWER STATE — applied to all interactive elements ===== */

.bidmas-step-btn.bidmas-correct,
.bidmas-target-btn.bidmas-correct {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.08);
    color: #1a7a32;
    cursor: default;
}

.bidmas-step-btn.bidmas-wrong,
.bidmas-target-btn.bidmas-wrong {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.08);
    color: #a71d2a;
    cursor: default;
}

/* ===== FEEDBACK PANEL ===== */

.bidmas-feedback {
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 1rem;
    display: none;
}

.bidmas-feedback.show {
    display: block;
}

.bidmas-feedback.correct {
    background: rgba(40, 167, 69, 0.08);
    border: 1.5px solid rgba(40, 167, 69, 0.35);
    color: #1a7a32;
}

.bidmas-feedback.wrong {
    background: rgba(220, 53, 69, 0.08);
    border: 1.5px solid rgba(220, 53, 69, 0.35);
    color: #a71d2a;
}

.bidmas-feedback strong {
    font-weight: 700;
}

/* ===== SUBMIT / NEXT BUTTONS ===== */

.bidmas-btn-row {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.bidmas-submit-btn {
    padding: 0.8rem 2.2rem;
    font-size: 1rem;
    font-weight: 700;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px var(--primary-shadow);
}

.bidmas-submit-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.bidmas-submit-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

/* ===== QUESTION TYPE BADGE ===== */

.bidmas-type-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}