/* style.css for Matematik Fırtınası */

:root {
    --shadow-color: rgba(139, 92, 246, 0.15);
    --glow-correct: #22c55e;
    --glow-incorrect: #ef4444;
}

/* Base Settings */
.game-container {
    position: relative;
    overflow: hidden;
    min-height: 580px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
    20%, 40%, 60%, 80% { transform: translateX(8px); }
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    80% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes correctFlash {
    0% { box-shadow: 0 0 0px var(--glow-correct); }
    50% { box-shadow: 0 0 25px var(--glow-correct); }
    100% { box-shadow: 0 0 0px var(--glow-correct); }
}

@keyframes wrongFlash {
    0% { box-shadow: 0 0 0px var(--glow-incorrect); }
    50% { box-shadow: 0 0 25px var(--glow-incorrect); }
    100% { box-shadow: 0 0 0px var(--glow-incorrect); }
}

@keyframes floatFeedback {
    0% { transform: translateY(0) scale(0.8); opacity: 0; }
    20% { opacity: 1; transform: translateY(-30px) scale(1.1); }
    100% { transform: translateY(-90px) scale(0.9); opacity: 0; }
}

@keyframes flameGlow {
    0%, 100% { filter: drop-shadow(0 0 2px #f97316) drop-shadow(0 0 8px #f97316); }
    50% { filter: drop-shadow(0 0 8px #f97316) drop-shadow(0 0 20px #ef4444); }
}

@keyframes floatingSymbol {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-25px) rotate(180deg); }
    100% { transform: translateY(0px) rotate(360deg); }
}

@keyframes floatOpposite {
    0% { transform: translateY(0px) rotate(360deg); }
    50% { transform: translateY(25px) rotate(180deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes pulseBorder {
    0%, 100% { border-color: rgba(139, 92, 246, 0.3); }
    50% { border-color: var(--primary-color); }
}

/* Floating background icons */
.bg-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.floating-symbol {
    position: absolute;
    color: rgba(139, 92, 246, 0.05);
    font-size: 5rem;
    font-weight: 800;
    user-select: none;
}

.symb-1 { top: 15%; left: 8%; animation: floatingSymbol 12s infinite ease-in-out; }
.symb-2 { top: 75%; left: 12%; animation: floatOpposite 16s infinite ease-in-out; font-size: 6rem; }
.symb-3 { top: 25%; right: 10%; animation: floatOpposite 14s infinite ease-in-out; }
.symb-4 { top: 70%; right: 15%; animation: floatingSymbol 18s infinite ease-in-out; font-size: 6.5rem; }
.symb-5 { top: 45%; left: 45%; animation: floatingSymbol 20s infinite ease-in-out; font-size: 3.5rem; color: rgba(236, 72, 153, 0.04); }
.symb-6 { top: 80%; left: 50%; animation: floatOpposite 15s infinite ease-in-out; font-size: 4rem; color: rgba(236, 72, 153, 0.04); }

/* Screens Configuration */
.screen {
    animation: popIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* LOGO Area */
.icon-header {
    margin-bottom: 1rem;
}

.storm-logo {
    position: relative;
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.3);
}

.storm-logo .bolt-icon {
    font-size: 3.2rem;
    color: #ffffff;
    z-index: 2;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
}

.storm-logo .cloud-icon {
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 0.6);
    z-index: 1;
}

/* Mode Settings Selection */
.settings-container {
    width: 100%;
    max-width: 650px;
    background: #f8fafc;
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid #e2e8f0;
}

.setting-section {
    margin-bottom: 1.5rem;
    text-align: left;
}

.setting-section:last-child {
    margin-bottom: 0;
}

.setting-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-section h3 i {
    color: var(--primary-color);
}

/* Custom Interactive Checkbox Buttons */
.checkbox-group, .radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.8rem;
}

.custom-toggle, .custom-radio {
    cursor: pointer;
    position: relative;
    user-select: none;
}

.custom-toggle input, .custom-radio input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-btn, .radio-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    color: #475569;
    padding: 10px 14px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.25s ease;
    text-align: center;
}

.custom-toggle:hover .toggle-btn, .custom-radio:hover .radio-btn {
    border-color: #94a3b8;
    background: #f1f5f9;
}

/* Selected state styling */
.custom-toggle input:checked + .toggle-btn,
.custom-radio input:checked + .radio-btn {
    border-color: var(--primary-color);
    background: rgba(139, 92, 246, 0.08);
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.15);
}

.custom-radio input:checked + .radio-btn.dynamic-badge {
    border-color: var(--secondary-color);
    background: rgba(236, 72, 153, 0.08);
    color: var(--secondary-color);
    animation: pulseBorder 2s infinite ease-in-out;
}

/* Audio toggle */
.audio-toggle-container {
    margin-bottom: 1.5rem;
}

.sound-toggle {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.sound-toggle:hover {
    background: #e2e8f0;
}

.sound-toggle.muted {
    background: #fee2e2;
    color: #ef4444;
    border-color: #fca5a5;
}

/* Gameplay HUD / Stats */
.game-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 1.2rem;
    gap: 1rem;
}

.stat-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 10px 18px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 1.5px;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1e293b;
    font-variant-numeric: tabular-nums;
}

.timer-countdown {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-color);
    font-variant-numeric: tabular-nums;
    transition: color 0.3s;
}

.timer-countdown.warning {
    color: #ef4444;
    animation: shake 0.5s infinite;
}

/* Combo elements styling */
.combo-item {
    min-width: 120px;
    border: none;
    background: none;
    padding: 0;
}

.combo-bubble {
    background: linear-gradient(135deg, #f97316, #ef4444);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
    color: #ffffff;
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.combo-bubble.active {
    transform: scale(1.1);
}

.combo-bubble.super-charged {
    transform: scale(1.25);
    animation: flameGlow 1.5s infinite ease-in-out;
}

.combo-mult {
    font-size: 1.6rem;
    font-weight: 800;
}

.combo-lbl {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Progress Timer Bar */
.timer-bar-container {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
    position: relative;
}

.timer-bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
    transition: width 0.1s linear, background-color 0.3s;
}

.timer-bar-fill.warning {
    background: linear-gradient(90deg, #f97316, #ef4444);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* Streak Dots Meter */
.streak-meter-box {
    margin-bottom: 1.5rem;
    text-align: center;
}

.streak-dots-wrapper {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 4px;
}

.streak-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #cbd5e1;
    transition: all 0.3s ease;
}

.streak-dot.active {
    background: #eab308;
    box-shadow: 0 0 8px #eab308;
    transform: scale(1.2);
}

.streak-text {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
    height: 18px;
    transition: all 0.3s;
}

.streak-text.frenzy {
    color: #ef4444;
    font-weight: 700;
    text-shadow: 0 0 4px rgba(239, 68, 68, 0.2);
}

/* Equation Display Card */
.question-container {
    width: 100%;
    max-width: 550px;
    margin: 0 auto 2rem auto;
    position: relative;
}

.equation-card {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 2px solid #e2e8f0;
    border-radius: 24px;
    padding: 2.2rem 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.equation-card.correct-anim {
    animation: correctFlash 0.4s ease;
    border-color: var(--glow-correct);
}

.equation-card.wrong-anim {
    animation: wrongFlash 0.4s ease, shake 0.4s ease;
    border-color: var(--glow-incorrect);
}

.eq-num {
    font-size: 3.2rem;
    font-weight: 800;
    color: #1e293b;
    text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.8);
}

.eq-op {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--primary-color);
}

.eq-eq {
    font-size: 2.8rem;
    font-weight: 800;
    color: #94a3b8;
}

.eq-q {
    font-size: 3.2rem;
    font-weight: 800;
    color: var(--secondary-color);
    background: rgba(236, 72, 153, 0.05);
    padding: 2px 16px;
    border-radius: 12px;
    border: 2px dashed rgba(236, 72, 153, 0.3);
}

/* Floating Answer Feedbacks */
.feedback-text {
    position: absolute;
    font-size: 1.8rem;
    font-weight: 800;
    pointer-events: none;
    z-index: 10;
    animation: floatFeedback 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    left: 50%;
    top: 50%;
}

.feedback-text.correct {
    color: #22c55e;
    text-shadow: 0 4px 10px rgba(34, 197, 94, 0.3), 0 0 1px #fff;
}

.feedback-text.incorrect {
    color: #ef4444;
    text-shadow: 0 4px 10px rgba(239, 68, 68, 0.3), 0 0 1px #fff;
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
    width: 100%;
    max-width: 550px;
    margin-bottom: 1.5rem;
}

.option-btn {
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: 18px;
    padding: 1.2rem 1rem;
    font-size: 1.8rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.option-btn:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.15);
}

.option-btn:active {
    transform: translateY(-1px);
}

/* Keyboard hint indicators */
.key-indicator {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.1);
}

.option-btn:hover .key-indicator {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary-color);
    border-color: rgba(139, 92, 246, 0.2);
}

.opt-text {
    font-family: 'Poppins', sans-serif;
    font-variant-numeric: tabular-nums;
}

/* Keyboard Helper Bottom text */
.keyboard-helper {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 0.5rem;
}

.keyboard-helper strong {
    background: #e2e8f0;
    color: #475569;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    font-size: 0.8rem;
    font-family: monospace;
}

/* Result Box / End Game Screen */
.result-box {
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    width: 100%;
}

.result-header {
    margin-bottom: 2rem;
}

.trophy-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}

.trophy-wrapper .trophy {
    font-size: 4.5rem;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 10px rgba(245, 158, 11, 0.3));
}

.trophy-wrapper .spark-bolt-1 {
    position: absolute;
    top: -10px;
    left: -15px;
    font-size: 1.5rem;
    color: #f59e0b;
    animation: floatingSymbol 3s infinite ease-in-out;
}

.trophy-wrapper .spark-bolt-2 {
    position: absolute;
    bottom: 0px;
    right: -20px;
    font-size: 1.8rem;
    color: #ec4899;
    animation: floatOpposite 4s infinite ease-in-out;
}

.result-box h2 {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

/* Results Grid Display */
.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
    max-width: 550px;
    margin: 0 auto 2rem auto;
}

.result-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    transition: transform 0.2s;
}

.result-card:hover {
    transform: translateY(-2px);
}

.res-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.res-icon.score { background: rgba(139, 92, 246, 0.1); color: var(--primary-color); }
.res-icon.combo { background: rgba(249, 115, 22, 0.1); color: #f97316; }
.res-icon.correct { background: rgba(34, 197, 94, 0.1); color: #22c55e; }
.res-icon.total { background: rgba(6, 182, 212, 0.1); color: #06b6d4; }

.res-data {
    display: flex;
    flex-direction: column;
}

.res-num {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1e293b;
}

.res-label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

/* Rank Badge Display */
.rank-container {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), rgba(236, 72, 153, 0.05));
    border: 2px dashed rgba(139, 92, 246, 0.2);
    border-radius: 16px;
    padding: 1rem 2rem;
    max-width: 400px;
    margin: 0 auto 2.5rem auto;
}

.rank-desc {
    display: block;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 4px;
}

.rank-badge-glow {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-color);
    text-shadow: 0 2px 10px rgba(139, 92, 246, 0.15);
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn-restart-game {
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-secondary-menu {
    background: #ffffff !important;
    border: 2px solid #cbd5e1;
    color: #475569 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

.btn-secondary-menu:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8;
    color: #1e293b !important;
    transform: translateY(-3px) scale(1.02);
}

/* Response Media Queries */
@media (max-width: 650px) {
    .game-container {
        padding: 1.5rem;
        min-height: auto;
    }
    
    h1 {
        font-size: 2rem !important;
    }
    
    .settings-container {
        padding: 1rem;
    }
    
    .checkbox-group, .radio-group {
        grid-template-columns: 1fr 1fr;
    }
    
    .eq-num {
        font-size: 2.2rem;
    }
    
    .eq-op, .eq-eq {
        font-size: 1.8rem;
    }
    
    .eq-q {
        font-size: 2.2rem;
        padding: 2px 10px;
    }
    
    .option-btn {
        font-size: 1.4rem;
        padding: 1rem 0.5rem;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .result-card {
        padding: 0.8rem;
    }
    
    .result-actions {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .btn {
        width: 100%;
    }
}
