:root { --primary: #4F46E5; --bg: #F3F4F6; --text: #1F2937; --success: #10B981; --danger: #EF4444; --gold: #F59E0B; --streak: #f97316; }
body { font-family: 'Segoe UI', Tahoma, sans-serif; background-color: var(--bg); color: var(--text); margin: 0; padding: 20px; display: flex; justify-content: center; }
#app { width: 100%; max-width: 600px; background: white; padding: 30px; border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--bg); margin-bottom: 20px; padding-bottom: 10px; }
.hidden { display: none !important; }
.error { color: var(--danger); font-weight: bold; }
input { width: 100%; padding: 12px; margin-bottom: 15px; border: 2px solid #D1D5DB; border-radius: 8px; font-size: 16px; box-sizing: border-box; transition: all 0.2s; text-align: center;}
input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2); }
button { background-color: var(--primary); color: white; border: none; padding: 12px 20px; border-radius: 8px; font-size: 16px; cursor: pointer; font-weight: bold; width: 100%; transition: background 0.2s; }
button:hover { background-color: #4338CA; }
.btn-secondary { background-color: #e2e8f0; color: #1e293b; margin: 0; }
.btn-secondary:hover { background-color: #cbd5e1; }
button.level-btn { display: flex; flex-direction: column; align-items: flex-start; background-color: #f8fafc; color: var(--text); border: 2px solid #e2e8f0; padding: 15px; margin-bottom:12px;}
button.level-btn:hover { border-color: var(--primary); background-color: #f1f5f9; transform: translateY(-2px); }
.level-header { display: flex; justify-content: space-between; width: 100%; align-items: center; margin-bottom: 5px; }
.level-title { font-size: 18px; font-weight: bold; }
.level-cycle { font-size: 12px; color: #94a3b8; font-weight: normal; background: #e2e8f0; padding: 2px 6px; border-radius: 4px; }
.level-stats { font-size: 13px; color: #64748b; font-weight: normal; margin-bottom: 3px;}
.level-rank { font-size: 12px; color: var(--primary); font-weight: bold; background: #e0e7ff; padding: 2px 6px; border-radius: 4px;}
.card { text-align: center; padding: 20px 0 40px 0; transition: transform 0.15s ease-out, opacity 0.15s; }
.huge-text { font-size: 48px; font-weight: bold; margin-bottom: 30px; }
#answerInput { font-size: 36px; max-width: 200px; margin: 0 auto; display: block; }
.game-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.progress-container { width: 100%; height: 10px; background: #e2e8f0; border-radius: 5px; margin-bottom: 5px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--success); width: 0%; transition: width 0.3s ease; }
.progress-text { text-align: center; font-size: 14px; color: #6B7280; font-weight: bold; margin-bottom: 20px; }
.timer { font-size: 18px; font-weight: bold; color: var(--primary); background: #e0e7ff; padding: 5px 10px; border-radius: 8px; }
.correction-item { padding: 10px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; }
.correct { color: var(--success); font-weight: bold; }
.wrong { color: var(--danger); font-weight: bold; }
.user-info { display: flex; align-items: center; gap: 15px; }
#playerName { font-weight: bold; color: var(--primary); font-size: 18px; }
.welcome-box { background: #fffbeb; padding: 15px; margin-bottom: 20px; border-radius: 8px; border-left: 4px solid var(--gold); display: flex; justify-content: space-between; align-items: center;}
.streak-box { font-size: 20px; font-weight: bold; color: var(--streak); background: #ffedd5; padding: 5px 10px; border-radius: 8px; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
.shake { animation: shake 0.3s ease-in-out; }
.slide-out { transform: translateX(-50px); opacity: 0; }
.slide-in { transform: translateX(50px); opacity: 0; }
.level-ranks { display: flex; flex-direction: column; gap: 4px; margin-top: 5px; width: 100%; text-align: left; }
.rank-badge { font-size: 12px; color: var(--primary); font-weight: bold; background: #e0e7ff; padding: 3px 8px; border-radius: 6px; width: fit-content; }
.rank-badge.global { background: #f1f5f9; color: #475569; }
.level-ranks { display: flex; flex-direction: column; gap: 4px; margin-top: 5px; width: 100%; text-align: left; }
.rank-badge { font-size: 12px; color: var(--primary); font-weight: bold; background: #e0e7ff; padding: 3px 8px; border-radius: 6px; width: fit-content; }
.rank-badge.global { background: #f1f5f9; color: #475569; }
