/* Fractions Game Styles - 5 Cards Layout */

:root {
    --frac-primary: #6366f1;
    --frac-secondary: #8b5cf6;
    --frac-accent: #06b6d4;
    --frac-success: #10b981;
    --frac-warning: #f59e0b;
    --frac-error: #ef4444;
    --frac-pink: #ec4899;
    --frac-orange: #f97316;
    --frac-lime: #84cc16;
    --frac-teal: #14b8a6;
}

.fractions-game {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
    box-sizing: border-box;
    user-select: none;
}

/* Header */
.fractions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.fractions-stats {
    display: flex;
    gap: 1rem;
    font-size: 1rem;
}

.fractions-stat {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Progress */
.fractions-progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.fractions-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--frac-primary), var(--frac-secondary));
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Prompt */
.fractions-prompt {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

/* Cards Grid */
.fractions-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

/* Single Card */
.fraction-card {
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.fraction-card.correct {
    border-color: var(--frac-success);
    background: rgba(16, 185, 129, 0.15);
}

.fraction-card.wrong {
    border-color: var(--frac-error);
    background: rgba(239, 68, 68, 0.15);
}

/* Shape in Card */
.fraction-card-shape {
    width: 120px;
    height: 120px;
    margin-bottom: 1rem;
}

.fraction-card-shape svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Shape colors */
.shape-filled {
    transition: fill 0.2s ease;
    stroke: #000;
    stroke-width: 1;
}

.shape-empty {
    fill: #fff;
    stroke: #000;
    stroke-width: 1;
}

/* Color classes */
.color-indigo {
    fill: #6366f1;
}

.color-violet {
    fill: #8b5cf6;
}

.color-cyan {
    fill: #06b6d4;
}

.color-emerald {
    fill: #10b981;
}

.color-amber {
    fill: #f59e0b;
}

.color-rose {
    fill: #f43f5e;
}

.color-pink {
    fill: #ec4899;
}

.color-orange {
    fill: #f97316;
}

.color-lime {
    fill: #84cc16;
}

.color-teal {
    fill: #14b8a6;
}

/* Original fraction (simplify mode) */
.fraction-card-original {
    font-size: 1rem;
    font-weight: bold;
    color: var(--frac-warning);
    margin: -0.25rem 0;
}

/* Inputs in Card */
.fraction-card-inputs {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.fraction-input-small {
    width: 45px;
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    padding: 0.3rem;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.6);
    outline: none;
    transition: all 0.2s ease;
}

.fraction-input-small:focus {
    border-color: var(--frac-accent);
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

.fraction-input-small::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.fraction-input-small:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.fraction-line-small {
    width: 35px;
    height: 3px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 2px;
}

/* Correct answer display */
.fraction-card-answer {
    font-size: 0.9rem;
    color: var(--frac-success);
    font-weight: bold;
    margin-top: -0.25rem;
}

/* Controls */
.fractions-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Responsive - Tablet */
@media (max-width: 600px) {
    .fractions-cards {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.5rem;
    }

    .fraction-card {
        padding: 0.5rem;
    }

    .fraction-card-shape {
        width: 60px;
        height: 60px;
    }

    .fraction-input-small {
        width: 36px;
        font-size: 0.95rem;
        padding: 0.25rem;
    }

    .fraction-line-small {
        width: 28px;
        height: 2px;
    }

    .fraction-card-original {
        font-size: 0.85rem;
    }
}

/* Responsive - Mobile */
@media (max-width: 450px) {
    .fractions-game {
        padding: 0.5rem;
    }

    .fractions-cards {
        gap: 0.35rem;
    }

    .fraction-card {
        padding: 0.35rem;
        border-radius: 8px;
    }

    .fraction-card-shape {
        width: 50px;
        height: 50px;
    }

    .fraction-input-small {
        width: 30px;
        font-size: 0.85rem;
        padding: 0.2rem;
        border-radius: 4px;
    }

    .fraction-line-small {
        width: 22px;
    }

    .fractions-prompt {
        font-size: 1rem;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}