/* Square Roots flashcard — custom plugin styles (ordering) */

/* ─── Square root inline expression (reused from lesson) ──────────── */
.sqr-root {
    display: inline-flex;
    align-items: flex-start;
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    color: inherit;
    line-height: 1;
}

.sqr-radical {
    font-size: 1.3em;
    line-height: 1;
    display: inline-block;
    margin-right: 0;
    margin-top: -0.06em;
}

.sqr-radicand {
    display: inline-block;
    border-top: 0.1em solid currentColor;
    padding: 0.22em 0.22em 0 0.14em;
    margin: -0.17em 0 0 0.02em;
}

.sqr-root-lg { font-size: 2.2rem; }
.sqr-root-sm { font-size: 1rem; }

/* ════════════════════════════════════════════════════════════════════
   ORDERING PLUGIN
   ════════════════════════════════════════════════════════════════════ */

.sr-ord-wrap {
    margin: 1.2rem auto 0.5rem;
    width: 100%;
    max-width: 560px;
    padding: 0 1rem;
}

.sr-ord-pool {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 1.6rem;
    min-height: 60px;
}

.sr-ord-card {
    font-family: 'Poppins', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    background: #fff;
    border: 2px solid #c084fc;
    border-radius: 12px;
    padding: 0.7rem 1.3rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
    min-width: 72px;
    box-shadow: 0 2px 8px rgba(147, 51, 234, 0.12);
}

.sr-ord-card:hover:not(:disabled):not(.placed) {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(147, 51, 234, 0.25);
    background: #faf5ff;
}

.sr-ord-card.placed {
    visibility: hidden;
    pointer-events: none;
}

.sr-ord-slots-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    justify-content: center;
}

.sr-ord-end-label {
    font-family: 'Poppins', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.sr-ord-slots {
    display: flex;
    gap: 0.5rem;
    flex: 1 1 auto;
    max-width: 380px;
    justify-content: space-between;
}

.sr-ord-slot {
    flex: 1 1 0;
    min-height: 64px;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    transition: background 0.15s, border-color 0.15s;
    position: relative;
}

.sr-ord-slot.filled {
    border-style: solid;
    border-color: #c084fc;
    background: #faf5ff;
}

.sr-ord-slot.correct-slot {
    border-color: #22c55e;
    background: #dcfce7;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.15);
}

.sr-ord-slot.wrong-slot {
    border-color: #ef4444;
    background: #fee2e2;
}

.sr-ord-placed {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
    background: transparent;
    border: none;
    cursor: pointer;
    width: 100%;
    height: 100%;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sr-ord-slots.disabled .sr-ord-placed,
.sr-ord-pool.disabled .sr-ord-card {
    cursor: default;
}

.sr-ord-correct-hint {
    position: absolute;
    bottom: -26px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Poppins', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    color: #16a34a;
    white-space: nowrap;
    background: #dcfce7;
    padding: 2px 8px;
    border-radius: 8px;
    border: 1px solid #86efac;
}

/* ════════════════════════════════════════════════════════════════════
   Mobile tweaks
   ════════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .sr-ord-wrap {
        padding: 0 0.4rem;
    }
    .sr-ord-card { font-size: 1.1rem; padding: 0.55rem 1rem; min-width: 60px; }
    .sr-ord-slot { min-height: 56px; }
    .sr-ord-end-label { font-size: 0.65rem; }
    .sr-ord-slots { gap: 0.35rem; }
}
