/* Times Tables Game - Retro/Sunset Theme (Kid-Friendly) */

/* Game Screens */
.game-screen {
    max-width: 900px;
    margin: 1.5rem auto;
    padding: 30px;
    background: var(--surface, #3a1775);
    border: 3px solid var(--border, #4a1d96);
    border-radius: 8px;
    text-align: center;
}

.game-screen.hidden {
    display: none;
}

.game-screen h1 {
    font-size: 2.4rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, var(--accent, #ff6b6b), var(--yellow, #feca57));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline, .instruction {
    font-size: 1.2rem;
    color: var(--muted, #9badb7);
    margin-bottom: 25px;
    font-weight: 600;
}

/* Buttons - Large and Kid-Friendly */
.big-button {
    font-size: 1.4rem;
    font-weight: 700;
    padding: 16px 32px;
    margin: 8px;
    border: 3px solid var(--accent, #ff6b6b);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    min-width: 240px;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--accent, #ff6b6b);
    color: #fff;
    display: inline-block;
    box-shadow: none;
}

.big-button:hover {
    background: transparent;
    color: var(--accent, #ff6b6b);
    transform: translateY(-3px);
}

.big-button:active {
    transform: translateY(0);
}

.big-button.primary {
    background: var(--accent, #ff6b6b);
    border-color: var(--accent, #ff6b6b);
}

.big-button.primary:hover {
    background: transparent;
    color: var(--accent, #ff6b6b);
}

.big-button.secondary {
    background: var(--yellow, #feca57);
    border-color: var(--yellow, #feca57);
    color: #1a0a3a;
}

.big-button.secondary:hover {
    background: transparent;
    color: var(--yellow, #feca57);
}

/* Stats Display */
.menu-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 25px 0;
}

.stat-box {
    background: rgba(255, 255, 255, 0.08);
    border: 3px solid var(--border, #4a1d96);
    padding: 16px 32px;
    border-radius: 8px;
}

.stat-box .stat-value {
    display: block;
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--yellow, #feca57);
}

.stat-box .stat-label {
    display: block;
    font-size: 1rem;
    color: var(--muted, #9badb7);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

/* Table Selection Grid */
.table-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 25px 0;
    padding: 16px;
}

.table-card {
    background: rgba(255, 255, 255, 0.08);
    border: 3px solid var(--border, #4a1d96);
    border-radius: 8px;
    padding: 20px 16px;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.table-card:hover {
    border-color: var(--accent, #ff6b6b);
    transform: translateY(-3px);
}

.table-card.locked {
    opacity: 0.4;
    cursor: not-allowed;
}

.table-card.locked:hover {
    transform: none;
    border-color: var(--border, #4a1d96);
}

.table-card.mastered {
    border-color: var(--yellow, #feca57);
    background: rgba(254, 202, 87, 0.1);
}

.table-number {
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--accent, #ff6b6b);
    display: block;
    margin-bottom: 6px;
}

.table-card.locked .table-number {
    color: var(--muted, #9badb7);
}

.table-card.mastered .table-number {
    color: var(--yellow, #feca57);
}

.table-label {
    font-size: 0.9rem;
    color: var(--muted, #9badb7);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-progress {
    font-size: 0.8rem;
    color: var(--muted, #9badb7);
    margin-top: 8px;
}

.lock-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 1.2rem;
}

.star-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 1.6rem;
}

/* Quiz Screen */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--yellow, #feca57);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.canvas-container {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 10px 0;
    max-height: 150px;
}

#game-canvas {
    border-radius: 4px;
    border: 2px solid var(--border, #4a1d96);
    max-height: 150px;
}

.quiz-content {
    margin: 10px 0;
}

.question-display {
    margin-bottom: 20px;
}

#question-text {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--text, #f4f4f4);
    letter-spacing: 6px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 550px;
    margin: 0 auto;
}

.option-button {
    font-size: 2.4rem;
    font-weight: 900;
    padding: 24px;
    background: rgba(255, 255, 255, 0.08);
    border: 3px solid var(--border, #4a1d96);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text, #f4f4f4);
    min-height: 100px;
}

.option-button:hover {
    border-color: var(--accent, #ff6b6b);
    transform: translateY(-3px);
    background: rgba(255, 107, 107, 0.1);
}

.option-button:active {
    transform: translateY(0);
}

.option-button.correct {
    background: rgba(56, 183, 100, 0.3);
    border-color: #38b764;
    color: #38b764;
}

.option-button.incorrect {
    background: rgba(255, 107, 107, 0.3);
    border-color: var(--accent, #ff6b6b);
    color: var(--accent, #ff6b6b);
}

.option-button.selected {
    border-width: 4px;
    border-color: var(--yellow, #feca57);
}

.option-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Progress Bar */
.progress-bar-container {
    margin-top: 24px;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid var(--border, #4a1d96);
    border-radius: 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent, #ff6b6b), var(--yellow, #feca57));
    transition: width 0.5s ease;
    width: 0%;
    border-radius: 10px;
}

/* Results Screen */
.results-content {
    margin: 25px 0;
}

.stars-display {
    margin: 25px 0;
}

#results-stars {
    font-size: 4rem;
    display: block;
    margin-bottom: 16px;
}

#results-score {
    font-size: 1.6rem;
    color: var(--text, #f4f4f4);
    font-weight: 700;
}

.results-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 30px 0;
}

.results-stats .stat-item {
    text-align: center;
}

.results-stats .stat-item .stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--muted, #9badb7);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.results-stats .stat-item .stat-value {
    display: block;
    font-size: 2.4rem;
    font-weight: 900;
    color: var(--yellow, #feca57);
}

.encouragement {
    font-size: 1.5rem;
    color: #38b764;
    font-weight: 900;
    margin: 25px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.unlock-notification {
    background: rgba(254, 202, 87, 0.15);
    border: 2px solid var(--yellow, #feca57);
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
}

.unlock-message {
    font-size: 1.2rem;
    color: var(--yellow, #feca57);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.results-buttons {
    margin-top: 25px;
}

/* Settings Screen */
.settings-content {
    margin: 30px auto;
    max-width: 450px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    margin: 12px 0;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid var(--border, #4a1d96);
    border-radius: 8px;
}

.setting-item label {
    font-size: 1.1rem;
    color: var(--text, #f4f4f4);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toggle-button {
    font-size: 1rem;
    font-weight: 700;
    padding: 8px 20px;
    border: 2px solid #38b764;
    border-radius: 4px;
    cursor: pointer;
    min-width: 80px;
    background: #38b764;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.15s;
}

.toggle-button:hover {
    transform: none;
}

.toggle-button.off {
    background: var(--accent, #ff6b6b);
    border-color: var(--accent, #ff6b6b);
}

/* Timer display */
#timer-display {
    color: var(--accent, #ff6b6b);
    font-weight: 700;
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-screen {
        margin: 0.5rem;
        padding: 20px;
    }

    .table-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    #question-text {
        font-size: 2.6rem;
    }

    .option-button {
        font-size: 1.8rem;
        padding: 18px;
        min-height: 80px;
    }

    .game-screen h1 {
        font-size: 1.8rem;
    }

    .big-button {
        font-size: 1.1rem;
        min-width: 200px;
        padding: 14px 24px;
    }
}

@media (max-width: 480px) {
    .table-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .options-grid {
        gap: 10px;
    }

    .option-button {
        font-size: 1.5rem;
        padding: 14px;
    }
}
