/* Flashcards v4 – CSS */
.app-icon-flashcards {
    background: linear-gradient(145deg, #1c1c1c, #121212)
}

.flashcards-modal {
    display: none;
    position: fixed;
    z-index: 3500;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .7);
    animation: fc-fadeIn .3s ease;
    --fc-copy-size: 15px;
    --fc-copy-line: 1.55;
    --fc-inline-math-scale: 1em;
    --fc-display-math-scale: 1.55em;
    --fc-graph-axis-math-scale: 0.95em
}

.flashcards-modal.visible {
    display: flex;
    justify-content: center;
    align-items: center
}

.flashcards-modal.closing {
    animation: fc-fadeOut .3s ease
}

.flashcards-content {
    background: #141414;
    padding: 22px 24px 24px;
    width: 94%;
    max-width: 480px;
    border-radius: 26px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, .5);
    color: #fff;
    animation: fc-popOut .4s ease-out;
    box-sizing: border-box;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden
}

.flashcards-modal.closing .flashcards-content {
    animation: fc-popIn .3s ease
}

/* Header */
.fc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    min-height: 28px
}

.fc-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0
}

.fc-back-btn {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: #1a1a1a;
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .18s, border-color .18s;
    flex-shrink: 0;
    padding: 0
}

.fc-back-btn::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-left: 3px
}

.fc-back-btn:hover {
    background: #252525;
    border-color: rgba(255, 255, 255, .2)
}

.fc-back-btn.show {
    display: inline-flex
}

.fc-breadcrumb {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, .5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: .3px
}

.fc-breadcrumb span {
    color: #fff
}

.fc-close-btn {
    color: #aaa;
    font-size: 26px;
    font-weight: bold;
    cursor: pointer;
    transition: color .2s;
    line-height: 1;
    flex-shrink: 0;
    margin-left: 10px;
    background: none;
    border: none;
    padding: 0
}

.fc-close-btn:hover {
    color: #fff
}

/* Hearts – SVG based */
.fc-hearts {
    display: none;
    justify-content: center;
    gap: 6px;
    margin-bottom: 10px
}

.fc-hearts.show {
    display: flex
}

.fc-heart-svg {
    width: 28px;
    height: 28px;
    transition: transform .3s, opacity .3s;
    overflow: visible
}

.fc-heart-svg.filling {
    animation: fc-heartFillRise .42s cubic-bezier(.22, .74, .29, 1.02)
}

.fc-heart-svg .heart-front {
    fill: #2a2a2a;
    transition: fill .3s;
    transform-origin: center
}

.fc-heart-svg .heart-depth {
    fill: #121212;
    transition: fill .3s;
    transform-origin: center
}

.fc-heart-svg.active .heart-front {
    fill: #ff3c3c
}

.fc-heart-svg.active .heart-depth {
    fill: #9f1f1f
}

.fc-heart-svg.losing .heart-front {
    animation: fc-heartLoseAnim .6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards
}

/* Progress */
.fc-progress-bar {
    display: none;
    height: 6px;
    border-radius: 999px;
    background: #1b1b1b;
    margin-bottom: 12px;
    overflow: hidden
}

.fc-progress-bar.show {
    display: block
}

.fc-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: #00c853;
    transition: width .35s ease;
    width: 0%
}

/* Stats */
.fc-stats-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 8px
}

.fc-stat-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .06);
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, .5)
}

.fc-stat-pill.mastered {
    color: #00c853;
    border-color: rgba(0, 200, 83, .15);
    background: rgba(0, 200, 83, .05)
}

/* Screens & Phases */
.fc-screen {
    display: none;
    animation: fc-slideIn .28s ease
}

.fc-screen.active {
    display: block
}

.fc-phase {
    display: none;
    animation: fc-slideIn .25s ease
}

.fc-phase.active {
    display: block
}

/* Courses & Topics */
.fc-course-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px
}

.fc-topic-list {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.fc-course-btn,
.fc-topic-btn {
    display: flex;
    align-items: center;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, .08);
    background: #0b0b0b;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: transform .18s, box-shadow .18s, border-color .18s;
    box-shadow: 0 4px 0 #050505, 0 6px 14px rgba(0, 0, 0, .3);
    text-align: left
}

.fc-course-btn {
    gap: 8px;
    padding: 14px 12px;
    border-radius: 16px;
    font-size: 14px;
    min-height: 92px;
    justify-content: center;
    align-items: flex-start
}

.fc-topic-btn {
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 14px
}

.fc-course-btn:hover,
.fc-topic-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #050505, 0 8px 18px rgba(0, 0, 0, .35);
    border-color: rgba(255, 255, 255, .14)
}

.fc-course-btn:active,
.fc-topic-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #050505, 0 3px 8px rgba(0, 0, 0, .25)
}

.fc-course-btn.disabled,
.fc-topic-btn.disabled {
    opacity: .4;
    cursor: default;
    pointer-events: none
}

.fc-course-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0
}

.fc-course-icon.physics {
    background: #0088ff
}

.fc-course-icon.math {
    background: #00c853
}

.fc-course-icon.chemistry {
    background: #ff3c3c
}

.fc-course-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%
}

.fc-course-name {
    font-size: 14px;
    line-height: 1.2
}

.fc-course-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, .45);
    font-weight: 600
}

.fc-topic-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0
}

.fc-topic-emoji {
    font-size: 20px;
    flex-shrink: 0
}

.fc-topic-left>span:last-child,
.fc-topic-left>span:only-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.fc-topic-count {
    font-size: 12px;
    color: rgba(255, 255, 255, .4);
    font-weight: 600
}

.fc-coming-soon {
    font-size: 11px;
    color: rgba(255, 255, 255, .35);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em
}

/* Question Phase */
.fc-question-box {
    background: #0b0b0b;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    padding: 22px 20px;
    margin-bottom: 16px;
    text-align: center
}

.fc-question-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255, 255, 255, .35);
    margin-bottom: 12px
}

.fc-question-text {
    font-size: var(--fc-copy-size);
    line-height: var(--fc-copy-line);
    color: #e6e6e6;
    font-weight: 600
}

.fc-question-target {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, .06);
    font-size: 13px;
    font-weight: 700;
    color: #0088ff
}

.fc-question-text .katex,
.fc-question-target .katex,
.fc-question-mini .katex {
    font-size: var(--fc-inline-math-scale) !important;
    color: inherit !important
}

.fc-question-text .katex-display,
.fc-question-target .katex-display,
.fc-question-mini .katex-display {
    margin: 0
}

.fc-ready-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 14px;
    background: #0088ff;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    cursor: pointer;
    box-shadow: 0 4px 0 #005bb5, 0 6px 14px rgba(0, 0, 0, .3);
    transition: transform .18s, box-shadow .18s
}

.fc-ready-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #005bb5, 0 8px 18px rgba(0, 0, 0, .35)
}

.fc-ready-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #005bb5, 0 3px 8px rgba(0, 0, 0, .25)
}

/* Assemble Phase */
.fc-question-mini {
    font-size: var(--fc-copy-size);
    color: rgba(255, 255, 255, .5);
    line-height: var(--fc-copy-line);
    margin-bottom: 12px;
    font-weight: 600;
    padding: 10px 14px;
    background: #0b0b0b;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .06)
}

.fc-assembly-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: rgba(255, 255, 255, .4);
    margin-bottom: 8px
}

.fc-assembly-zone {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 20px 14px;
    background: #0b0b0b;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    min-height: 56px;
    margin-bottom: 14px;
    transition: border-color .3s, box-shadow .3s
}

.fc-assembly-zone.flash-wrong {
    border-color: #ff3c3c;
    box-shadow: 0 0 12px rgba(255, 60, 60, .15)
}

.fc-assembly-zone.flash-correct {
    border-color: #00c853;
    box-shadow: 0 0 12px rgba(0, 200, 83, .15)
}

/* Slots */
.fc-slot {
    min-width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 2px dashed rgba(255, 255, 255, .18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    color: rgba(255, 255, 255, .25);
    cursor: pointer;
    transition: background .2s, border-color .2s, transform .15s, color .2s;
    background: transparent;
    padding: 0 8px;
    box-sizing: border-box
}

.fc-slot:hover {
    border-color: rgba(255, 255, 255, .3)
}

.fc-slot.selected {
    border: 2px solid #ffd700;
    background: rgba(255, 215, 0, .08);
    color: rgba(255, 215, 0, .6)
}

.fc-slot.filled {
    border: 2px solid #0088ff;
    background: rgba(0, 136, 255, .12);
    color: #fff
}

.fc-slot.filled.just-filled {
    animation: fc-chipPop .2s ease
}

.fc-slot .katex {
    font-size: 1em;
    line-height: 1
}

.fc-slot.correct {
    border-color: #00c853 !important;
    background: rgba(0, 200, 83, .12) !important;
    color: #00c853 !important
}

.fc-slot.wrong {
    border-color: #ff3c3c !important;
    background: rgba(255, 60, 60, .12) !important;
    color: #ff3c3c !important;
    animation: fc-slotShake .4s ease
}

/* Math elements */
.fc-eq-op {
    font-size: 18px;
    font-weight: 700;
    color: rgba(255, 255, 255, .4);
    padding: 0 3px;
    user-select: none
}

.fc-eq-const {
    font-size: 16px;
    font-weight: 700;
    color: rgba(255, 255, 255, .55);
    user-select: none
}

.fc-sup-wrap {
    display: inline-flex;
    align-items: flex-start;
    position: relative
}

.fc-sup-wrap>sup {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, .4);
    margin-top: -2px
}

/* Fraction – stacked numerator/denominator */
.fc-frac {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    vertical-align: middle;
    margin: 0 3px
}

.fc-frac-num,
.fc-frac-den {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 3px 6px;
    line-height: 1.1
}

.fc-frac-line {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, .4);
    border-radius: 1px;
    min-width: 30px
}

.fc-frac .fc-slot {
    min-width: 30px;
    height: 30px;
    font-size: 13px;
    padding: 0 6px
}

.fc-frac .fc-eq-op {
    font-size: 14px;
    padding: 0 2px
}

.fc-frac .fc-sup-wrap>sup {
    font-size: 10px
}

/* Square root */
.fc-sqrt {
    display: inline-flex;
    align-items: stretch
}

.fc-sqrt-sign {
    display: flex;
    width: 14px;
    align-items: stretch;
    margin-right: -1px
}

.fc-sqrt-sign svg {
    width: 100%;
    height: 100%;
    display: block
}

.fc-sqrt-inner {
    display: flex;
    align-items: center;
    gap: 4px;
    border-top: 2px solid rgba(255, 255, 255, .4);
    padding: 4px 6px 2px 2px;
    margin-top: 1px
}

.fc-sqrt .fc-slot {
    min-width: 30px;
    height: 30px;
    font-size: 13px;
    padding: 0 6px
}

.fc-sqrt .fc-eq-op {
    font-size: 14px;
    padding: 0 2px
}

.fc-sqrt .fc-sup-wrap>sup {
    font-size: 10px
}

/* Chip pool */
.fc-chip-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 14px
}

.fc-pool-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 14px 6px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .1);
    background: #1a1a1a;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 3px 0 #0e0e0e, 0 4px 10px rgba(0, 0, 0, .25);
    transition: transform .14s, box-shadow .14s, border-color .14s
}

.fc-pool-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #0e0e0e, 0 6px 14px rgba(0, 0, 0, .3);
    border-color: rgba(255, 255, 255, .2)
}

.fc-pool-chip:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 #0e0e0e, 0 2px 6px rgba(0, 0, 0, .2)
}

.fc-chip-sym {
    font-size: 16px;
    font-weight: 800
}

.fc-chip-sym .katex {
    font-size: 1em;
    line-height: 1
}

.fc-chip-name {
    font-size: 9px;
    font-weight: 600;
    color: rgba(255, 255, 255, .35);
    text-transform: uppercase;
    letter-spacing: .03em
}

.fc-pool-chip.word {
    flex-direction: row;
    gap: 0;
    padding: 10px 14px
}

.fc-pool-chip.word .fc-chip-sym {
    font-size: 14px;
    line-height: 1.1
}

.fc-pool-chip.word .fc-chip-name {
    display: none
}

.fc-pool-chip.symbol-only {
    padding: 10px 14px;
    justify-content: center
}

.fc-pool-chip.symbol-only .fc-chip-sym {
    font-size: 18px;
    line-height: 1
}

.fc-pool-chip.symbol-only .fc-chip-sym .katex {
    font-size: 1.05em
}

/* Assemble actions */
.fc-assemble-actions {
    display: flex;
    gap: 10px
}

.fc-hint-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: none;
    border-radius: 14px;
    background: #2a2a2a;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 0 #1a1a1a, 0 6px 14px rgba(0, 0, 0, .3);
    transition: transform .18s, box-shadow .18s
}

.fc-hint-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #1a1a1a, 0 8px 18px rgba(0, 0, 0, .35)
}

.fc-hint-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #1a1a1a, 0 3px 8px rgba(0, 0, 0, .25)
}

.fc-hint-btn .fc-hint-text {
    margin-right: auto
}

.fc-hint-charges {
    display: flex;
    gap: 3px
}

.fc-hint-charge {
    width: 14px;
    height: 8px;
    border-radius: 2px;
    background: #333;
    transition: background .3s
}

.fc-hint-charge.active {
    background: #ffd700
}

.fc-check-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 14px;
    background: #0088ff;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .4px;
    cursor: pointer;
    box-shadow: 0 4px 0 #005bb5, 0 6px 14px rgba(0, 0, 0, .3);
    transition: transform .18s, box-shadow .18s
}

.fc-check-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #005bb5, 0 8px 18px rgba(0, 0, 0, .35)
}

/* Solve Phase */
.fc-revealed-eq {
    background: #0b0b0b;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    margin-bottom: 14px;
    font-size: 20px
}

.fc-revealed-eq:not(.text-card):not(.graph-card) .katex {
    font-size: var(--fc-display-math-scale)
}

.fc-revealed-eq.text-card {
    font-size: 16px;
    line-height: 1.45;
    font-weight: 700;
    color: rgba(255, 255, 255, .9)
}

.fc-revealed-eq.text-card .katex {
    color: inherit !important;
    font-size: 1em !important
}

.fc-revealed-eq.text-card .katex-display {
    margin: .15em 0
}

.fc-revealed-eq.graph-card {
    padding: 10px 12px 12px
}

.fc-graph-wrap {
    width: 100%;
    background: #080808;
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 12px;
    padding: 6px;
    box-sizing: border-box
}

.fc-graph-stage {
    position: relative
}

.fc-graph-svg {
    display: block;
    width: 100%;
    height: auto;
    position: relative;
    z-index: 1
}

.fc-graph-grid {
    stroke: rgba(255, 255, 255, .08);
    stroke-width: 1
}

.fc-graph-axis {
    stroke: rgba(255, 255, 255, .42);
    stroke-width: 1.5
}

.fc-graph-line {
    fill: none;
    stroke: #00a2ff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round
}

.fc-graph-point {
    fill: #bde7ff;
    stroke: #00a2ff;
    stroke-width: 1.2
}

.fc-graph-area {
    fill: rgba(0, 162, 255, .16);
    stroke: none
}

.fc-graph-label {
    fill: rgba(255, 255, 255, .55);
    font-size: 10px;
    font-weight: 700
}

.fc-graph-label.axis {
    fill: rgba(255, 255, 255, .88);
    font-size: 12px
}

.fc-graph-caption {
    margin-top: 4px;
    font-size: var(--fc-copy-size);
    line-height: var(--fc-copy-line);
    text-align: center;
    color: rgba(255, 255, 255, .9);
    font-weight: 600;
    min-height: 0
}

.fc-graph-caption .katex {
    font-size: var(--fc-inline-math-scale) !important;
    color: inherit !important
}

.fc-graph-caption .katex-display {
    margin: 0
}

.fc-given-values {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 14px
}

.fc-given-pill {
    padding: 6px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .08);
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, .7)
}

.fc-given-pill .fc-pill-unit {
    font-size: 11px;
    color: rgba(255, 255, 255, .35);
    margin-left: 4px
}

.fc-given-pill .katex {
    font-size: 1em
}

.fc-answer-section {
    margin-bottom: 14px
}

.fc-answer-row {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center
}

.fc-answer-label {
    font-size: 18px;
    font-weight: 800;
    color: #0088ff
}

.fc-answer-input {
    width: 120px;
    height: 44px;
    padding: 0 14px;
    border: 2px solid #333;
    border-radius: 12px;
    background: #1e1e1e;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    box-sizing: border-box;
    transition: border-color .2s;
    appearance: textfield;
    -moz-appearance: textfield
}

.fc-answer-input::-webkit-inner-spin-button,
.fc-answer-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0
}

.fc-answer-input:focus {
    outline: none;
    border-color: #0088ff
}

.fc-answer-input.flash-wrong {
    border-color: #ff3c3c;
    animation: fc-shake .35s ease
}

.fc-answer-unit {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, .4)
}

.fc-choice-wrap {
    display: none
}

.fc-choice-wrap.show {
    display: block
}

.fc-choice-wrap.flash-wrong {
    animation: fc-shake .35s ease
}

.fc-choice-prompt {
    text-align: center;
    font-size: var(--fc-copy-size);
    line-height: var(--fc-copy-line);
    font-weight: 600;
    color: #e6e6e6;
    margin-bottom: 10px
}

.fc-choice-prompt .katex {
    font-size: var(--fc-inline-math-scale) !important;
    color: inherit !important
}

.fc-choice-prompt .katex-display {
    margin: 0
}

.fc-graph-olabel {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    color: rgba(255, 255, 255, .65);
    line-height: 1;
    transform: translate(-50%, -50%)
}

.fc-graph-olabel[data-anchor="start"] {
    transform: translate(0, -50%)
}

.fc-graph-olabel[data-anchor="end"] {
    transform: translate(-100%, -50%)
}

.fc-graph-olabel.axis {
    color: rgba(255, 255, 255, .92)
}

.fc-graph-olabel .katex {
    font-size: .82em !important;
    color: inherit !important
}

.fc-graph-olabel.axis .katex {
    font-size: var(--fc-graph-axis-math-scale) !important;
    font-weight: 700
}

.fc-graph-olabel.origin .katex {
    font-size: .78em !important
}

.fc-graph-olabel .katex-display {
    margin: 0
}

.fc-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px
}

.fc-choice-grid.single {
    grid-template-columns: repeat(2, minmax(0, 1fr))
}

.fc-choice-btn {
    min-height: 52px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: #1a1a1a;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    line-height: 1.25;
    white-space: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .14s, border-color .14s, background .14s, box-shadow .14s;
    box-shadow: 0 3px 0 #0e0e0e, 0 4px 10px rgba(0, 0, 0, .22)
}

.fc-choice-btn .katex {
    font-size: 1.35em !important
}

.fc-choice-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, .2)
}

.fc-choice-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 #0e0e0e, 0 2px 6px rgba(0, 0, 0, .2)
}

.fc-choice-btn.selected {
    border-color: #0088ff;
    background: rgba(0, 136, 255, .12)
}

.fc-choice-btn.wrong {
    border-color: #ff3c3c;
    background: rgba(255, 60, 60, .12);
    animation: fc-shake .35s ease
}

.fc-submit-btn {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 14px;
    background: #0088ff;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    cursor: pointer;
    box-shadow: 0 4px 0 #005bb5, 0 6px 14px rgba(0, 0, 0, .3);
    transition: transform .18s, box-shadow .18s
}

.fc-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #005bb5, 0 8px 18px rgba(0, 0, 0, .35)
}

.fc-submit-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #005bb5, 0 3px 8px rgba(0, 0, 0, .25)
}

/* Result Phase */
.fc-result-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin: 0 auto 10px;
    animation: fc-resultPop .4s cubic-bezier(.175, .885, .32, 1.275)
}

.fc-result-glyph {
    width: 34px;
    height: 34px;
    display: block;
    filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .22)) drop-shadow(0 1px 2px rgba(0, 0, 0, .28))
}

.fc-result-glyph path {
    fill: none;
    stroke: currentColor;
    stroke-width: 3.4;
    stroke-linecap: round;
    stroke-linejoin: round
}

.fc-result-icon.correct {
    background: rgba(0, 200, 83, .12);
    color: #00c853;
    border: 2px solid rgba(0, 200, 83, .25)
}

.fc-result-icon.wrong {
    background: rgba(255, 136, 0, .12);
    color: #ff8800;
    border: 2px solid rgba(255, 136, 0, .25)
}

.fc-result-text {
    text-align: center;
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 6px
}

.fc-result-text.correct {
    color: #00c853
}

.fc-result-text.wrong {
    color: #ff8800
}

.fc-result-sub {
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, .4);
    font-weight: 600;
    margin-bottom: 16px
}

.fc-result-stars {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    height: 40px;
}

.fc-result-stars .fc-star-svg {
    width: 46px;
    height: 46px;
    opacity: 1;
    transform: scale(1);
    color: #2a2a2a;
}

.fc-result-stars .fc-star-svg .star-front {
    fill: currentColor;
    transition: fill .3s;
}

.fc-result-stars .fc-star-svg .star-depth {
    fill: #111;
}

.fc-result-stars .fc-star-svg.lit {
    animation: fc-starPop .6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    color: #ffd700;
}

.fc-result-stars .fc-star-svg.lit .star-front {
    fill: #ffd700;
}

.fc-result-stars .fc-star-svg.lit .star-depth {
    fill: #8b6900;
}

/* Create the slight arch effect */
.fc-result-stars .star-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.fc-result-stars .star-wrap:nth-child(1) {
    transform: translateY(6px) rotate(-12deg);
}

.fc-result-stars .star-wrap:nth-child(2) {
    transform: translateY(-4px);
    width: 54px;
    height: 54px;
}

.fc-result-stars .star-wrap:nth-child(3) {
    transform: translateY(6px) rotate(12deg);
}

.fc-result-stars .star-wrap:nth-child(2) .fc-star-svg {
    width: 54px;
    height: 54px;
}

.fc-flying-star {
    position: fixed;
    z-index: 4000;
    width: 32px;
    height: 32px;
    pointer-events: none;
    animation: fc-flyMastery .8s cubic-bezier(.25, .1, .25, 1) forwards;
}

.fc-flying-star .star-front {
    fill: #ffd700;
}

.fc-flying-star .star-depth {
    fill: #8b6900;
}

.fc-continue-btn {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 14px;
    background: #2a2a2a;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    cursor: pointer;
    box-shadow: 0 4px 0 #1a1a1a, 0 6px 14px rgba(0, 0, 0, .3);
    transition: transform .18s, box-shadow .18s
}

.fc-continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #1a1a1a, 0 8px 18px rgba(0, 0, 0, .35)
}

/* End screen */
.fc-end-screen {
    text-align: center;
    padding: 30px 10px
}

.fc-end-icon {
    font-size: 48px;
    margin-bottom: 14px;
    animation: fc-resultPop .5s cubic-bezier(.175, .885, .32, 1.275)
}

.fc-end-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 6px
}

.fc-end-sub {
    font-size: 13px;
    color: rgba(255, 255, 255, .45);
    font-weight: 600;
    margin-bottom: 20px
}

.fc-restart-btn {
    padding: 12px 28px;
    border: none;
    border-radius: 14px;
    background: #0088ff;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 4px 0 #005bb5, 0 6px 14px rgba(0, 0, 0, .3);
    transition: transform .18s, box-shadow .18s
}

.fc-restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #005bb5, 0 8px 18px rgba(0, 0, 0, .35)
}

/* Animations */
@keyframes fc-fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

@keyframes fc-fadeOut {
    from {
        opacity: 1
    }

    to {
        opacity: 0
    }
}

@keyframes fc-popOut {
    0% {
        opacity: 0;
        transform: scale(.8) translateY(20px)
    }

    80% {
        transform: scale(1.02) translateY(-5px)
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0)
    }
}

@keyframes fc-popIn {
    0% {
        opacity: 1;
        transform: scale(1)
    }

    100% {
        opacity: 0;
        transform: scale(.8)
    }
}

@keyframes fc-slideIn {
    from {
        opacity: 0;
        transform: translateX(16px)
    }

    to {
        opacity: 1;
        transform: translateX(0)
    }
}

@keyframes fc-chipPop {
    0% {
        transform: scale(.7)
    }

    60% {
        transform: scale(1.12)
    }

    100% {
        transform: scale(1)
    }
}

@keyframes fc-resultPop {
    0% {
        transform: scale(0);
        opacity: 0
    }

    60% {
        transform: scale(1.2)
    }

    100% {
        transform: scale(1);
        opacity: 1
    }
}

@keyframes fc-shake {

    0%,
    100% {
        transform: translateX(0)
    }

    20% {
        transform: translateX(-6px)
    }

    40% {
        transform: translateX(6px)
    }

    60% {
        transform: translateX(-4px)
    }

    80% {
        transform: translateX(4px)
    }
}

@keyframes fc-heartLose {
    0% {
        transform: scale(1)
    }

    30% {
        transform: scale(1.4)
    }

    100% {
        transform: scale(1)
    }
}

@keyframes fc-heartFillRise {
    0% {
        transform: translateY(0) scale(1)
    }

    38% {
        transform: translateY(-8px) scale(1.08)
    }

    68% {
        transform: translateY(-3px) scale(1.04)
    }

    100% {
        transform: translateY(0) scale(1)
    }
}

@media(max-width:600px) {
    .flashcards-content {
        width: 96%;
        padding: 16px 14px 18px;
        max-height: 90vh;
        border-radius: 22px
    }

    .fc-slot {
        min-width: 30px;
        height: 30px;
        font-size: 12px;
        padding: 0 5px
    }

    .fc-frac .fc-slot {
        min-width: 26px;
        height: 26px;
        font-size: 11px
    }

    .fc-sqrt .fc-slot {
        min-width: 26px;
        height: 26px;
        font-size: 11px
    }

    .fc-pool-chip {
        padding: 6px 12px 5px
    }

    .fc-chip-sym {
        font-size: 14px
    }

    .fc-course-btn {
        padding: 12px 10px;
        min-height: 84px
    }

    .fc-course-icon {
        width: 36px;
        height: 36px;
        font-size: 16px
    }

    .fc-course-name {
        font-size: 13px
    }

    .fc-course-sub {
        font-size: 11px
    }
}

@keyframes fc-slotShake {

    0%,
    100% {
        transform: rotate(0)
    }

    20% {
        transform: rotate(-10deg)
    }

    40% {
        transform: rotate(10deg)
    }

    60% {
        transform: rotate(-8deg)
    }

    80% {
        transform: rotate(8deg)
    }
}

@keyframes fc-starPop {
    0% {
        opacity: 0;
        transform: scale(0)
    }

    50% {
        opacity: 1;
        transform: scale(1.3)
    }

    70% {
        transform: scale(0.9)
    }

    100% {
        opacity: 1;
        transform: scale(1)
    }
}

@keyframes fc-flyMastery {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1
    }

    20% {
        transform: scale(1.4) rotate(-20deg);
        opacity: 1
    }

    100% {
        transform: scale(0.3) rotate(360deg);
        opacity: 1
    }
}

@keyframes fc-pillBounce {
    0% {
        transform: scale(1);
        background: rgba(0, 200, 83, .05)
    }

    40% {
        transform: scale(1.15);
        background: rgba(0, 200, 83, .25);
        border-color: rgba(0, 200, 83, .6)
    }

    100% {
        transform: scale(1);
        background: rgba(0, 200, 83, .05)
    }
}

@keyframes fc-heartLoseAnim {
    0% {
        transform: scale(1);
        fill: #ff3c3c;
        filter: drop-shadow(0 0 0 rgba(255, 60, 60, 0))
    }

    20% {
        transform: scale(1.6);
        fill: #ff6b6b;
        filter: drop-shadow(0 0 12px rgba(255, 60, 60, 0.8))
    }

    40% {
        transform: scale(1.4);
        fill: #555
    }

    100% {
        transform: scale(1);
        fill: #2a2a2a;
        filter: drop-shadow(0 0 0 rgba(255, 60, 60, 0))
    }
}

@keyframes fc-heartsContainerShake {

    0%,
    100% {
        transform: translateX(0)
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-6px)
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(6px)
    }
}

@keyframes fc-pillFlash {

    0%,
    100% {
        transform: scale(1);
        background: rgba(255, 255, 255, .04);
        border-color: rgba(255, 255, 255, .06)
    }

    50% {
        transform: scale(0.92);
        background: rgba(255, 255, 255, .15);
        border-color: rgba(255, 255, 255, .3)
    }
}
