body { background: #f0f2f5; font-family: 'Segoe UI', sans-serif; margin: 0; }
.vocab-app { max-width: 600px; margin: 0 auto; background: #fff; min-height: 100vh; display: flex; flex-direction: column; box-shadow: 0 0 30px rgba(0,0,0,0.05); }

/* Header */
.app-header { background: #6c5ce7; color: white; padding: 15px 20px; display: flex; align-items: center; gap: 15px; }
.app-header h3 { margin: 0; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back-btn { color: white; text-decoration: none; font-weight: 600; font-size: 0.9rem; }

/* Loading */
.state-view { flex: 1; padding: 20px; display: flex; flex-direction: column; }
#loading-state { justify-content: center; align-items: center; text-align: center; height: 80vh; }
.loader { border: 4px solid #f3f3f3; border-top: 4px solid #6c5ce7; border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin-bottom: 20px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Tabs */
.mode-switcher { display: flex; background: #f8f9fa; padding: 5px; border-radius: 8px; margin-bottom: 20px; }
.m-btn { flex: 1; border: none; background: transparent; padding: 10px; border-radius: 6px; cursor: pointer; font-weight: 600; color: #666; transition: 0.2s; }
.m-btn.active { background: #fff; color: #6c5ce7; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }

/* Flashcard */
.tab-view { display: none; animation: fadeIn 0.3s; }
.tab-view.active { display: block; }
@keyframes fadeIn { from {opacity:0; transform:translateY(10px);} to {opacity:1; transform:translateY(0);} }

.card-container { perspective: 1000px; height: 350px; margin-bottom: 20px; }
.flashcard { width: 100%; height: 100%; position: relative; transition: transform 0.6s; transform-style: preserve-3d; cursor: pointer; }
.flashcard.flipped { transform: rotateY(180deg); }
.flashcard .front, .flashcard .back { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; border-radius: 20px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 30px; text-align: center; }
.front { background: linear-gradient(135deg, #a29bfe, #6c5ce7); color: white; }
.back { background: #fff; color: #333; transform: rotateY(180deg); border: 1px solid #eee; }

#fc-word { font-size: 2.5rem; margin: 10px 0; }
.click-hint { margin-top: 20px; opacity: 0.8; font-size: 0.9rem; }
.definition { font-size: 1.2rem; line-height: 1.5; margin: 15px 0; }
.example-box { background: #f8f9fa; padding: 10px; border-radius: 8px; font-style: italic; color: #555; font-size: 0.95rem; width: 100%; }

/* Controls */
.controls { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.c-btn { padding: 10px 20px; border: none; border-radius: 30px; background: #e0e0e0; font-weight: bold; cursor: pointer; color: #555; transition: 0.2s; }
.c-btn:hover { background: #d0d0d0; }
.c-btn.speak { background: #fff; border: 2px solid #6c5ce7; color: #6c5ce7; }
.progress-indicator { text-align: center; margin-top: 15px; color: #999; font-weight: 600; }

/* Quiz */
.quiz-item { background: #fff; border: 1px solid #eee; padding: 15px; border-radius: 10px; margin-bottom: 15px; }
.quiz-q { font-weight: bold; margin-bottom: 10px; display: block; }
.q-opt { display: block; width: 100%; text-align: left; padding: 10px; margin-bottom: 5px; border: 1px solid #eee; border-radius: 6px; background: #fdfdfd; cursor: pointer; }
.q-opt:hover { background: #f0f0f0; }
.q-opt.correct { background: #d4edda; border-color: #c3e6cb; color: #155724; }
.q-opt.wrong { background: #f8d7da; border-color: #f5c6cb; color: #721c24; }
