@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Quicksand', sans-serif;
    background: linear-gradient(135deg, #00b4db 0%, #0083b0 50%, #005f8c 100%);
    color: #ffffff;
    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.4); }
.score-display { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.score, .accuracy { background: rgba(255,255,255,0.2); 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.3); }

.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.15); backdrop-filter: blur(15px); border: 2px solid rgba(255,255,255,0.3); border-radius: 20px; padding: 40px 30px; text-align: center; box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
.setup-panel h2 { font-size: 2rem; margin-bottom: 10px; font-weight: 700; }
.subtitle { font-size: 1.1rem; margin-bottom: 30px; opacity: 0.9; }

.shape-selector, .difficulty-selector { margin: 30px 0; }
.shape-selector h3, .difficulty-selector h3 { font-size: 1.3rem; margin-bottom: 20px; font-weight: 700; }

.shape-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 15px; margin-bottom: 30px; }
.shape-btn { background: rgba(255,255,255,0.15); border: 2px solid rgba(255,255,255,0.3); border-radius: 15px; padding: 20px 15px; cursor: pointer; transition: all 0.3s; display: flex; flex-direction: column; gap: 8px; font-family: 'Quicksand', sans-serif; color: white; }
.shape-btn:hover { background: rgba(255,255,255,0.25); transform: translateY(-3px); }
.shape-btn.selected { background: rgba(0,180,219,0.5); border-color: #00b4db; box-shadow: 0 0 20px rgba(0,180,219,0.6); }
.shape-icon { font-size: 2.5rem; }
.shape-name { font-size: 1.1rem; font-weight: 700; }
.shape-formula { font-size: 0.85rem; opacity: 0.9; font-style: italic; }

.difficulty-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; margin-bottom: 30px; }
.difficulty-btn { background: rgba(255,255,255,0.15); border: 2px solid rgba(255,255,255,0.3); border-radius: 15px; padding: 20px 15px; cursor: pointer; transition: all 0.3s; display: flex; flex-direction: column; gap: 8px; font-family: 'Quicksand', sans-serif; color: white; }
.difficulty-btn:hover { background: rgba(255,255,255,0.25); transform: translateY(-3px); }
.difficulty-btn.selected { background: rgba(0,180,219,0.5); border-color: #00b4db; box-shadow: 0 0 20px rgba(0,180,219,0.6); }
.diff-emoji { font-size: 2.5rem; }
.diff-name { font-size: 1.1rem; font-weight: 700; }
.diff-desc { font-size: 0.9rem; opacity: 0.8; }

.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.2); border: 2px solid rgba(255,255,255,0.4); border-radius: 15px; padding: 12px 20px; font-size: 1.3rem; color: white; text-align: center; width: 120px; font-family: 'Quicksand', sans-serif; font-weight: 700; }
.input-group input:focus { outline: none; border-color: #00b4db; box-shadow: 0 0 15px rgba(0,180,219,0.5); }

.main-btn { background: linear-gradient(135deg, #00b4db 0%, #0083b0 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: 'Quicksand', sans-serif; text-transform: uppercase; box-shadow: 0 6px 25px rgba(0,180,219,0.4); margin: 10px; }
.main-btn:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 10px 35px rgba(0,180,219,0.6); }
.main-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.secondary-btn { background: linear-gradient(135deg, #005f8c 0%, #003f5c 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: 'Quicksand', sans-serif; box-shadow: 0 6px 25px rgba(0,95,140,0.4); margin: 10px; }
.secondary-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 35px rgba(0,95,140,0.6); }

.progress-bar { background: rgba(255,255,255,0.15); border-radius: 25px; height: 50px; position: relative; margin-bottom: 30px; overflow: hidden; border: 2px solid rgba(255,255,255,0.3); }
.progress-fill { background: linear-gradient(90deg, #00b4db 0%, #0083b0 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; }

.shape-display { background: rgba(255,255,255,0.1); border: 3px solid rgba(255,255,255,0.3); border-radius: 20px; padding: 30px; margin: 0 auto 20px; max-width: 500px; }
.shape-visual { font-size: 8rem; margin-bottom: 15px; }
.dimensions { font-size: 1.3rem; font-weight: 600; line-height: 1.6; }

.question { font-size: 2.5rem; font-weight: 700; margin-bottom: 20px; }

.formula-hint { background: rgba(0,180,219,0.3); border: 2px solid rgba(0,180,219,0.5); border-radius: 15px; padding: 15px; margin: 15px auto; max-width: 400px; }
.formula-label { font-weight: 700; margin-right: 10px; }
.formula-text { font-family: 'Courier New', monospace; font-weight: 600; color: #fbbf24; }

.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; transition: all 0.3s; white-space: pre-line; text-align: center; max-width: 700px; }
.feedback.correct { background: rgba(52,211,153,0.3); border: 3px solid #34D399; animation: pulse 0.6s; }
.feedback.incorrect { background: rgba(248,113,113,0.3); border: 3px solid #F87171; animation: shake 0.6s; }

@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }

.text-input-wrapper { display: flex; justify-content: center; align-items: center; gap: 10px; max-width: 700px; margin: 0 auto; flex-wrap: wrap; }

#answer-input { background: rgba(255,255,255,0.2); border: 3px solid rgba(255,255,255,0.4); border-radius: 20px; padding: 20px 30px; font-size: 2rem; color: white; text-align: center; width: 200px; font-family: 'Quicksand', sans-serif; font-weight: 700; }
#answer-input:focus { outline: none; border-color: #00b4db; box-shadow: 0 0 20px rgba(0,180,219,0.5); }
#answer-input:disabled { opacity: 0.6; }

.unit-label { font-size: 1.1rem; font-weight: 600; opacity: 0.9; }

.submit-btn { background: linear-gradient(135deg, #00b4db 0%, #0083b0 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: 'Quicksand', sans-serif; box-shadow: 0 4px 20px rgba(0,180,219,0.4); }
.submit-btn:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,180,219,0.6); }
.submit-btn:disabled { opacity: 0.6; }
.submit-btn.hidden { display: none; }

.next-btn { background: linear-gradient(135deg, #005f8c 0%, #003f5c 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: 'Quicksand', sans-serif; box-shadow: 0 4px 20px rgba(0,95,140,0.4); }
.next-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,95,140,0.6); }
.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(0,180,219,0.2); border: 2px solid rgba(0,180,219,0.4); border-radius: 20px; padding: 20px; text-align: center; }
.stat-label { display: block; font-size: 1rem; margin-bottom: 10px; opacity: 0.9; font-weight: 600; }
.stat-value { font-size: 2rem; font-weight: 700; color: #fbbf24; }

.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.15); 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: 2rem; }
    .shape-visual { font-size: 5rem; }
    .shape-buttons { grid-template-columns: 1fr; }
    .difficulty-buttons { grid-template-columns: 1fr; }
    .text-input-wrapper { flex-direction: column; }
    #answer-input { width: 100%; max-width: 250px; }
}
