* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: #f0f4f8; color: #1a202c; direction: rtl; }
nav { background: #2d3748; padding: 12px 24px; color: white; }
nav a { color: #90cdf4; text-decoration: none; margin: 0 8px; }
nav a:hover { color: white; }
main { max-width: 900px; margin: 40px auto; padding: 0 20px; }
h1 { font-size: 2rem; margin-bottom: 16px; }
h2 { font-size: 1.4rem; margin-bottom: 12px; color: #2d3748; }
.stats { display: flex; gap: 20px; margin-bottom: 40px; flex-wrap: wrap; }
.stat-card { background: white; border-radius: 12px; padding: 24px 32px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.08); flex: 1; min-width: 120px; }
.stat-card .number { font-size: 2.5rem; font-weight: bold; color: #3182ce; }
.stat-card .label { color: #718096; font-size: 0.9rem; margin-top: 4px; }
.modes { display: flex; gap: 20px; flex-wrap: wrap; }
.mode-card { background: white; border-radius: 12px; padding: 32px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.08); flex: 1; min-width: 200px; cursor: pointer; text-decoration: none; color: inherit; transition: transform 0.15s, box-shadow 0.15s; display: block; }
.mode-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.mode-card .icon { font-size: 3rem; margin-bottom: 12px; }
.mode-card h2 { margin-bottom: 8px; }
.mode-card p { color: #718096; font-size: 0.9rem; }
.card-container { perspective: 1000px; width: 100%; max-width: 600px; height: 320px; margin: 0 auto 32px; cursor: pointer; }
.card { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.5s; }
.card.flipped { transform: rotateY(180deg); }
.card-front, .card-back { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; background: white; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; text-align: center; }
.card-back { transform: rotateY(180deg); }
.card-word { font-size: 2.5rem; font-weight: bold; margin-bottom: 12px; }
.card-hebrew { font-size: 1.6rem; color: #3182ce; margin-bottom: 12px; }
.card-def { font-size: 0.95rem; color: #4a5568; line-height: 1.6; }
.card-image { max-height: 120px; border-radius: 8px; margin-bottom: 16px; }
.tts-btn { background: none; border: none; font-size: 1.6rem; cursor: pointer; margin-top: 8px; opacity: 0.6; }
.tts-btn:hover { opacity: 1; }
.rating-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn { padding: 10px 24px; border: none; border-radius: 8px; font-size: 1rem; cursor: pointer; font-weight: 600; transition: opacity 0.15s; }
.btn:hover { opacity: 0.85; }
.btn-again { background: #fed7d7; color: #c53030; }
.btn-hard  { background: #fefcbf; color: #744210; }
.btn-good  { background: #c6f6d5; color: #276749; }
.btn-easy  { background: #bee3f8; color: #2a69ac; }
.btn-primary { background: #3182ce; color: white; }
.btn-check { background: #38a169; color: white; }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 600px; margin: 0 auto 24px; }
.quiz-option { padding: 18px 24px; border: 2px solid #e2e8f0; border-radius: 10px; background: white; font-size: 1.1rem; cursor: pointer; text-align: center; transition: border-color 0.15s; }
.quiz-option:hover { border-color: #3182ce; }
.quiz-option.correct { border-color: #38a168; background: #f0fff4; }
.quiz-option.wrong   { border-color: #e53e3e; background: #fff5f5; }
.write-input { width: 100%; max-width: 400px; padding: 14px 18px; font-size: 1.2rem; border: 2px solid #e2e8f0; border-radius: 10px; text-align: center; margin-bottom: 16px; direction: ltr; }
.write-input:focus { outline: none; border-color: #3182ce; }
.write-feedback { font-size: 1.1rem; margin-bottom: 16px; min-height: 28px; }
.write-feedback.correct { color: #38a168; }
.write-feedback.wrong   { color: #e53e3e; }
.loading { text-align: center; color: #718096; font-size: 1.2rem; padding: 60px; }
