@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&display=swap');
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Fredoka', sans-serif; background: linear-gradient(135deg, #fa8231 0%, #ffb74d 50%, #ff9800 100%); color: #fff; min-height: 100vh; }
.game-container { max-width: 950px; margin: 0 auto; padding: 20px; }
.header { text-align: center; margin-bottom: 30px; }
.game-title { font-size: 2.5rem; font-weight: 700; margin-bottom: 20px; text-shadow: 3px 3px 6px rgba(0,0,0,0.3); }
.score-display { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.score, .accuracy { background: rgba(255,255,255,0.25); backdrop-filter: blur(10px); padding: 10px 20px; border-radius: 20px; font-weight: 700; font-size: 1.1rem; border: 2px solid rgba(255,255,255,0.4); }
.screen { display: block; animation: fadeIn 0.5s; }
.screen.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.setup-panel, .results-panel { background: rgba(255,255,255,0.2); backdrop-filter: blur(15px); border: 2px solid rgba(255,255,255,0.4); border-radius: 20px; padding: 40px 30px; text-align: center; box-shadow: 0 8px 32px rgba(0,0,0,0.2); }
.setup-panel h2 { font-size: 2rem; margin-bottom: 10px; font-weight: 700; }
.subtitle { font-size: 1.1rem; margin-bottom: 30px; opacity: 0.95; }
.operation-selector, .difficulty-selector { margin: 30px 0; }
.operation-selector h3, .difficulty-selector h3 { font-size: 1.3rem; margin-bottom: 20px; font-weight: 700; }
.operation-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 15px; }
.operation-btn { background: rgba(255,255,255,0.2); border: 2px solid rgba(255,255,255,0.4); border-radius: 15px; padding: 20px 15px; cursor: pointer; transition: all 0.3s; font-family: 'Fredoka', sans-serif; color: white; font-weight: 600; font-size: 1.1rem; }
.operation-btn:hover { background: rgba(255,255,255,0.3); transform: translateY(-3px); }
.operation-btn.selected { background: rgba(255,152,0,0.6); border-color: #ff9800; box-shadow: 0 0 20px rgba(255,152,0,0.6); }
.difficulty-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; }
.difficulty-btn { background: rgba(255,255,255,0.2); border: 2px solid rgba(255,255,255,0.4); border-radius: 15px; padding: 20px 15px; cursor: pointer; transition: all 0.3s; font-family: 'Fredoka', sans-serif; color: white; font-weight: 600; }
.difficulty-btn:hover { background: rgba(255,255,255,0.3); transform: translateY(-3px); }
.difficulty-btn.selected { background: rgba(255,152,0,0.6); border-color: #ff9800; box-shadow: 0 0 20px rgba(255,152,0,0.6); }
.difficulty-btn small { font-size: 0.85rem; opacity: 0.9; }
.input-group { margin: 25px 0; }
.input-group label { display: block; font-size: 1.1rem; margin-bottom: 10px; font-weight: 600; }
.input-group input { background: rgba(255,255,255,0.3); border: 2px solid rgba(255,255,255,0.5); border-radius: 15px; padding: 12px 20px; font-size: 1.3rem; color: white; text-align: center; width: 120px; font-family: 'Fredoka', sans-serif; font-weight: 700; }
.main-btn { background: linear-gradient(135deg, #ff9800 0%, #fa8231 100%); border: none; border-radius: 50px; padding: 18px 40px; font-size: 1.4rem; font-weight: 700; color: white; cursor: pointer; transition: all 0.3s; font-family: 'Fredoka', sans-serif; text-transform: uppercase; box-shadow: 0 6px 25px rgba(255,152,0,0.5); margin: 10px; }
.main-btn:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 10px 35px rgba(255,152,0,0.7); }
.main-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.secondary-btn { background: linear-gradient(135deg, #e65100 0%, #bf360c 100%); border: none; border-radius: 50px; padding: 18px 40px; font-size: 1.3rem; font-weight: 700; color: white; cursor: pointer; transition: all 0.3s; font-family: 'Fredoka', sans-serif; box-shadow: 0 6px 25px rgba(191,54,12,0.5); margin: 10px; }
.secondary-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 35px rgba(191,54,12,0.7); }
.progress-bar { background: rgba(255,255,255,0.2); border-radius: 25px; height: 50px; position: relative; margin-bottom: 30px; overflow: hidden; border: 2px solid rgba(255,255,255,0.4); }
.progress-fill { background: linear-gradient(90deg, #ff9800 0%, #fa8231 100%); height: 100%; width: 0%; transition: width 0.5s; border-radius: 25px; }
.progress-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-weight: 700; font-size: 1.1rem; text-shadow: 2px 2px 4px rgba(0,0,0,0.6); }
.question-panel { text-align: center; margin: 40px 0; }
.question { font-size: 3.5rem; font-weight: 700; margin-bottom: 20px; }
.hint-text { background: rgba(255,152,0,0.3); border: 2px solid rgba(255,152,0,0.5); border-radius: 15px; padding: 12px; margin: 15px auto; max-width: 400px; font-size: 1.1rem; font-weight: 600; }
.feedback { font-size: 1.5rem; font-weight: 700; min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 20px auto; border-radius: 20px; padding: 15px; white-space: pre-line; text-align: center; max-width: 700px; }
.feedback.correct { background: rgba(52,211,153,0.3); border: 3px solid #34D399; }
.feedback.incorrect { background: rgba(248,113,113,0.3); border: 3px solid #F87171; }
.text-input-wrapper { display: flex; justify-content: center; align-items: center; gap: 15px; flex-wrap: wrap; }
#answer-input { background: rgba(255,255,255,0.3); border: 3px solid rgba(255,255,255,0.5); border-radius: 20px; padding: 20px 30px; font-size: 2rem; color: white; text-align: center; width: 250px; font-family: 'Fredoka', sans-serif; font-weight: 700; }
#answer-input::placeholder { color: rgba(255,255,255,0.6); }
#answer-input:focus { outline: none; border-color: #ff9800; box-shadow: 0 0 20px rgba(255,152,0,0.5); }
#answer-input:disabled { opacity: 0.6; }
.submit-btn { background: linear-gradient(135deg, #ff9800 0%, #fa8231 100%); border: none; border-radius: 20px; padding: 20px 35px; font-size: 1.3rem; font-weight: 700; color: white; cursor: pointer; transition: all 0.3s; font-family: 'Fredoka', sans-serif; box-shadow: 0 4px 20px rgba(255,152,0,0.5); }
.submit-btn:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(255,152,0,0.7); }
.submit-btn:disabled { opacity: 0.6; }
.submit-btn.hidden { display: none; }
.next-btn { background: linear-gradient(135deg, #e65100 0%, #bf360c 100%); border: none; border-radius: 20px; padding: 20px 35px; font-size: 1.3rem; font-weight: 700; color: white; cursor: pointer; transition: all 0.3s; font-family: 'Fredoka', sans-serif; box-shadow: 0 4px 20px rgba(191,54,12,0.5); }
.next-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(191,54,12,0.7); }
.next-btn.hidden { display: none; }
.final-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px; margin: 30px 0; }
.stat { background: rgba(255,152,0,0.3); border: 2px solid rgba(255,152,0,0.5); border-radius: 20px; padding: 20px; text-align: center; }
.stat-label { display: block; font-size: 1rem; margin-bottom: 10px; font-weight: 600; }
.stat-value { font-size: 2rem; font-weight: 700; color: #fff; }
.missed-section { margin: 30px 0; }
.missed-section h3 { font-size: 1.4rem; margin-bottom: 15px; font-weight: 700; }
#missed-list { background: rgba(248,113,113,0.2); border: 2px solid #F87171; border-radius: 15px; padding: 20px; max-height: 250px; overflow-y: auto; text-align: left; }
.missed-problem { background: rgba(248,113,113,0.3); border-left: 4px solid #F87171; padding: 12px; margin: 8px 0; border-radius: 8px; font-size: 1.1rem; }
.results-actions { display: flex; justify-content: center; gap: 15px; margin-top: 30px; flex-wrap: wrap; }
@media (max-width: 768px) {
    .game-title { font-size: 1.8rem; }
    .question { font-size: 2.5rem; }
    .operation-buttons, .difficulty-buttons { grid-template-columns: 1fr; }
    .text-input-wrapper { flex-direction: column; }
    #answer-input { width: 100%; max-width: 300px; }
}
