.fractions-page {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 50%, #f093fb 100%);
    align-items: flex-start;
}

.fractions-container {
    margin-top: 20px;
}

.fractions-container h1 {
    color: #c44569;
}

.back-link {
    display: inline-block;
    color: #c44569;
    text-decoration: none;
    font-weight: bold;
    margin-bottom: 12px;
}

.back-link:hover {
    color: #8b2f4a;
}

.fractions-modes .mode-btn {
    border-color: #c44569;
    color: #c44569;
}

.fractions-modes .mode-btn.active {
    background: #c44569;
    color: white;
}

.fractions-game {
    background: #fff8fa;
}

.fractions-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.question-type-badge {
    background: linear-gradient(135deg, #f093fb, #c44569);
    color: white;
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.95em;
}

.hint-btn {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.95em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.hint-btn:hover {
    background: #ffc107;
    transform: translateY(-1px);
}

.hint-panel {
    background: #fffbea;
    border: 2px solid #ffc107;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    font-size: 1.05em;
    line-height: 1.8;
    color: #5c4a00;
    white-space: pre-line;
    direction: ltr;
    text-align: center;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.fraction-visuals {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 40px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.frac-viz-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.frac-viz-label {
    font-size: 0.9em;
    color: #666;
    font-weight: bold;
}

.frac-viz-bar {
    display: flex;
    width: 200px;
    height: 36px;
    border: 3px solid #333;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    direction: ltr;
}

.frac-viz-segment {
    flex: 1;
    border-left: 1px solid rgba(0,0,0,0.15);
    transition: background 0.3s;
}

.frac-viz-segment:first-child {
    border-left: none;
}

.frac-viz-segment.filled {
    background: linear-gradient(180deg, #f093fb, #c44569);
}

.frac-viz-segment.filled.alt {
    background: linear-gradient(180deg, #667eea, #4a7cf7);
}

.fraction-equation {
    font-size: 2.8em;
}

.answer-stack .frac-num,
.answer-stack .frac-den {
    color: #c44569;
}

.compare-layout {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 20px;
    flex-wrap: wrap;
}

.compare-card {
    flex: 1;
    min-width: 200px;
    max-width: 280px;
    background: white;
    border: 3px solid #e8e8e8;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    transition: all 0.2s;
}

.compare-card.correct {
    border-color: #28a745;
    background: #d4edda;
}

.compare-card.wrong {
    border-color: #dc3545;
    background: #f8d7da;
}

.compare-stack {
    font-size: 2em;
}

.compare-vs {
    display: flex;
    align-items: center;
    font-weight: bold;
    color: #999;
    font-size: 1.2em;
}

.compare-pick-btn {
    width: 100%;
    padding: 14px;
    font-size: 1em;
    font-weight: bold;
    background: white;
    border: 3px solid #c44569;
    color: #c44569;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.compare-pick-btn:hover:not(:disabled) {
    background: #fff0f5;
    transform: translateY(-2px);
}

.compare-pick-btn:disabled {
    opacity: 0.7;
    cursor: default;
}

.compare-pick-btn.correct {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.compare-pick-btn.wrong {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

.input-label {
    text-align: center;
    color: #666;
    margin-bottom: 8px;
    font-weight: bold;
}

.streak-stat {
    color: #f5576c;
}

.fraction-input-area {
    flex-direction: column;
    align-items: center;
}

.fraction-input-area .btn-check {
    width: 100%;
    max-width: 280px;
    margin-top: 12px;
}

@media (max-width: 600px) {
    .fraction-equation {
        font-size: 2em;
        gap: 16px;
    }

    .frac-viz-bar {
        width: 160px;
        height: 30px;
    }

    .compare-layout {
        flex-direction: column;
        align-items: center;
    }

    .compare-vs {
        padding: 4px 0;
    }
}
