/* English Adventure - CSS */
:root {
  --primary: #22c55e;
  --primary-dark: #16a34a;
  --secondary: #3b82f6;
  --accent: #f59e0b;
  --danger: #ef4444;
  --bg: #f0fdf4;
  --card: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
}

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

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
}

.screen {
  display: none;
  padding: 16px;
  padding-bottom: 80px;
  min-height: 100vh;
  animation: fadeIn 0.3s ease;
}

.screen.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === BUTTONS === */
button {
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  border: none;
  outline: none;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  transition: all 0.2s;
}

.action-btn.primary {
  background: var(--primary);
  color: white;
}

.action-btn.primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.action-btn.secondary {
  background: #e2e8f0;
  color: var(--text);
}

.action-btn.danger {
  background: var(--danger);
  color: white;
}

.action-btn.full-width {
  width: 100%;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: white;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.back-btn {
  background: none;
  color: var(--primary);
  font-size: 16px;
  font-weight: 700;
  padding: 8px;
}

.speak-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--secondary);
  color: white;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px auto;
}

.speak-btn.large {
  width: 64px;
  height: 64px;
  font-size: 28px;
}

/* === SCREEN HEADER === */
.screen-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.screen-header h2 {
  flex: 1;
  font-size: 20px;
}

/* === PROFILE SELECT === */
.profile-select-header {
  text-align: center;
  padding: 40px 0;
}

.app-logo {
  font-size: 80px;
  margin-bottom: 16px;
}

.profile-select-header h1 {
  font-size: 28px;
  color: var(--primary-dark);
}

.profile-select-header p {
  color: var(--text-light);
  margin-top: 8px;
}

.profiles-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 20px 0;
}

.profile-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
}

.profile-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.profile-avatar {
  font-size: 48px;
  margin-bottom: 8px;
}

.profile-name {
  font-size: 18px;
  font-weight: 700;
}

.profile-age {
  color: var(--text-light);
  font-size: 14px;
}

.profile-card.add-profile {
  border: 2px dashed #cbd5e1;
  background: transparent;
}

.profile-card.add-profile .profile-avatar {
  font-size: 32px;
}

/* === PROFILE FORM === */
.profile-form {
  max-width: 400px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 16px;
}

.form-group input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 18px;
  font-family: 'Nunito', sans-serif;
  transition: border-color 0.2s;
}

.form-group input[type="text"]:focus {
  border-color: var(--primary);
  outline: none;
}

.age-selector {
  display: flex;
  gap: 8px;
}

.age-btn {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  background: white;
  border: 2px solid #e2e8f0;
  font-size: 18px;
  font-weight: 700;
  transition: all 0.2s;
}

.age-btn.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.avatar-selector {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.avatar-option {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  background: white;
  border: 2px solid #e2e8f0;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.avatar-option.selected {
  border-color: var(--primary);
  background: #dcfce7;
}

/* === HOME SCREEN === */
.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-large {
  font-size: 48px;
}

.profile-name {
  font-size: 22px;
  font-weight: 800;
}

.level-badge {
  font-size: 14px;
  color: var(--primary-dark);
  font-weight: 600;
}

.xp-bar-container {
  background: #e2e8f0;
  border-radius: 20px;
  height: 24px;
  position: relative;
  margin-bottom: 20px;
  overflow: hidden;
}

.xp-bar {
  background: linear-gradient(90deg, var(--primary), #4ade80);
  height: 100%;
  border-radius: 20px;
  transition: width 0.5s ease;
}

.xp-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-emoji {
  font-size: 24px;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-dark);
}

.stat-label {
  font-size: 11px;
  color: var(--text-light);
}

.main-menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.menu-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
  text-align: left;
  transition: all 0.2s;
}

.menu-btn:hover {
  transform: translateY(-2px);
}

.menu-emoji {
  font-size: 40px;
}

.menu-text {
  font-size: 18px;
  font-weight: 700;
  display: block;
}

.menu-sub {
  font-size: 13px;
  color: var(--text-light);
}

.learn-btn { border-left: 4px solid var(--primary); }
.play-btn { border-left: 4px solid var(--secondary); }
.read-btn { border-left: 4px solid var(--accent); }

.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  background: white;
  border-top: 1px solid #e2e8f0;
  padding: 8px 0;
  z-index: 100;
}

.bottom-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  background: none;
  font-size: 12px;
  color: var(--text-light);
}

.bottom-btn.active {
  color: var(--primary);
}

.bottom-btn span:first-child {
  font-size: 20px;
}

/* === TOPICS GRID === */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.topic-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px 8px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
}

.topic-card:hover {
  transform: translateY(-2px);
}

.topic-emoji {
  font-size: 36px;
  margin-bottom: 8px;
}

.topic-name {
  font-size: 13px;
  font-weight: 700;
}

.topic-count {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 4px;
}

.topic-progress-bar {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.topic-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.3s;
}

/* === FLASHCARD === */
.flashcard-container {
  perspective: 1000px;
  margin: 20px 0;
}

.flashcard {
  width: 100%;
  height: 300px;
  position: relative;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.6s;
}

.flashcard.flipped {
  transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-shadow: var(--shadow);
}

.flashcard-front {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
}

.flashcard-back {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  transform: rotateY(180deg);
}

.card-emoji {
  font-size: 72px;
  margin-bottom: 16px;
}

.card-word {
  font-size: 36px;
  font-weight: 800;
}

.card-hint {
  font-size: 14px;
  color: var(--text-light);
  margin-top: 16px;
}

.card-meaning {
  font-size: 32px;
  font-weight: 800;
  color: var(--secondary);
}

.card-pronunciation {
  font-size: 18px;
  color: var(--text-light);
  margin: 8px 0;
}

.card-example {
  font-size: 16px;
  text-align: center;
  margin-top: 12px;
}

.card-example-vi {
  font-size: 14px;
  color: var(--text-light);
  text-align: center;
}

/* === SRS BUTTONS === */
.srs-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.srs-btn {
  flex: 1;
  padding: 16px 8px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.srs-btn.hard {
  background: #fee2e2;
  color: #dc2626;
}

.srs-btn.good {
  background: #fef3c7;
  color: #d97706;
}

.srs-btn.easy {
  background: #dcfce7;
  color: #16a34a;
}

.srs-btn:hover {
  transform: translateY(-2px);
}

.progress-dots {
  display: flex;
  gap: 4px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e2e8f0;
}

.dot.active {
  background: var(--primary);
  transform: scale(1.3);
}

.dot.done {
  background: #86efac;
}

.card-count {
  font-size: 14px;
  color: var(--text-light);
}

/* === QUIZ === */
.quiz-progress {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.quiz-progress-bar {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s;
}

.quiz-question {
  text-align: center;
  padding: 20px;
}

.quiz-emoji {
  font-size: 72px;
  margin-bottom: 16px;
}

.quiz-question h3 {
  font-size: 22px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-option {
  padding: 16px 20px;
  border-radius: 12px;
  background: white;
  border: 2px solid #e2e8f0;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  transition: all 0.2s;
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--primary);
  background: #f0fdf4;
}

.quiz-option.correct {
  background: #dcfce7;
  border-color: var(--primary);
  color: var(--primary-dark);
}

.quiz-option.wrong {
  background: #fee2e2;
  border-color: var(--danger);
  color: #dc2626;
}

/* === GAMES === */
.games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.game-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
}

.game-card:hover {
  transform: translateY(-4px);
}

.game-emoji {
  font-size: 48px;
  margin-bottom: 12px;
}

.game-name {
  font-size: 18px;
  font-weight: 700;
}

.game-desc {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
}

.game-method {
  font-size: 11px;
  color: var(--secondary);
  margin-top: 8px;
  font-weight: 600;
}

/* === MATCH GAME === */
.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.match-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.match-item {
  padding: 14px;
  border-radius: 12px;
  background: white;
  border: 2px solid #e2e8f0;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.match-item.selected {
  border-color: var(--secondary);
  background: #dbeafe;
}

.match-item.matched {
  background: #dcfce7;
  border-color: var(--primary);
  opacity: 0.7;
  pointer-events: none;
}

/* === TPR GAME === */
.tpr-game {
  text-align: center;
  padding: 20px;
}

.tpr-character {
  font-size: 120px;
  margin-bottom: 20px;
}

.tpr-command {
  margin-bottom: 24px;
}

.tpr-word {
  font-size: 42px;
  font-weight: 800;
  color: var(--primary-dark);
}

.tpr-meaning {
  font-size: 20px;
  color: var(--text-light);
  margin-top: 8px;
}

.tpr-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.tpr-btn {
  flex: 1;
  padding: 18px 24px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
}

.tpr-btn.done {
  background: var(--primary);
  color: white;
}

.tpr-btn.skip {
  background: #e2e8f0;
  color: var(--text);
}

/* === WORD SEARCH === */
.word-list {
  margin-bottom: 16px;
}

.word-list h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.word-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.word-chip {
  padding: 6px 14px;
  border-radius: 20px;
  background: white;
  border: 2px solid #e2e8f0;
  font-size: 14px;
  font-weight: 700;
}

.word-chip.found {
  background: #dcfce7;
  border-color: var(--primary);
  text-decoration: line-through;
}

.wordsearch-grid {
  display: grid;
  gap: 4px;
  max-width: 350px;
  margin: 0 auto;
}

.ws-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid #e2e8f0;
}

.ws-cell.selected {
  background: #dbeafe;
  border-color: var(--secondary);
}

.ws-cell.found {
  background: #dcfce7;
  border-color: var(--primary);
}

/* === STORIES === */
.story-levels {
  margin-bottom: 24px;
}

.level-section {
  margin-bottom: 24px;
}

.level-section h3 {
  font-size: 18px;
  margin-bottom: 12px;
}

.stories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.story-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.story-card:hover {
  transform: translateY(-2px);
}

.story-card.completed {
  opacity: 0.8;
}

.story-emoji {
  font-size: 40px;
  margin-bottom: 8px;
}

.story-title {
  font-size: 14px;
  font-weight: 700;
}

.story-title-vi {
  font-size: 12px;
  color: var(--text-light);
}

.story-check {
  position: absolute;
  top: 8px;
  right: 8px;
}

/* === STORY READER === */
.story-reader {
  margin-bottom: 24px;
}

.story-text {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  font-size: 20px;
  line-height: 1.8;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.story-word {
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.2s;
}

.story-word:hover {
  background: #e2e8f0;
}

.story-word.keyword {
  color: var(--primary-dark);
  font-weight: 700;
  border-bottom: 2px solid var(--primary);
}

.story-translation {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}

.translation-toggle {
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  background: #f8fafc;
}

.translation-text {
  padding: 0 16px;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s;
  color: var(--text-light);
  font-style: italic;
}

.story-translation.show .translation-text {
  padding: 12px 16px;
  max-height: 200px;
}

.story-keywords {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.story-keywords h4 {
  margin-bottom: 12px;
}

.keyword-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.keyword-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.keyword-item:hover {
  background: #f0fdf4;
}

.kw-emoji {
  font-size: 20px;
}

.kw-word {
  font-weight: 700;
  flex: 1;
}

.kw-meaning {
  color: var(--text-light);
  font-size: 14px;
}

.kw-speak {
  font-size: 16px;
}

.story-quiz {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.story-question {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}

.story-question:last-child {
  border-bottom: none;
}

.sq-text {
  font-weight: 700;
  margin-bottom: 4px;
}

.sq-text-vi {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 8px;
}

.sq-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sq-option {
  padding: 10px 16px;
  border-radius: 10px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.sq-option.correct {
  background: #dcfce7;
  border-color: var(--primary);
}

.sq-option.wrong {
  background: #fee2e2;
  border-color: var(--danger);
}

.story-complete {
  text-align: center;
  padding: 20px 0;
}

/* === PROGRESS === */
.progress-overview {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.level-display {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.level-emoji {
  font-size: 56px;
}

.level-info h3 {
  font-size: 22px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card.large {
  padding: 16px;
}

.srs-breakdown {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.srs-breakdown h3 {
  margin-bottom: 12px;
}

.srs-boxes {
  display: flex;
  gap: 8px;
}

.srs-box {
  flex: 1;
  padding: 12px 8px;
  border-radius: 10px;
  text-align: center;
  border: 2px solid;
}

.srs-box-label {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
}

.srs-box-count {
  font-size: 20px;
  font-weight: 800;
}

.badges-section {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.badges-section h3 {
  margin-bottom: 12px;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.badge {
  text-align: center;
  padding: 12px 4px;
  border-radius: 10px;
  background: #f8fafc;
  transition: all 0.2s;
}

.badge.earned {
  background: #fef3c7;
}

.badge.locked {
  opacity: 0.4;
  filter: grayscale(1);
}

.badge-emoji {
  font-size: 28px;
}

.badge-name {
  font-size: 10px;
  font-weight: 700;
  margin-top: 4px;
}

/* === PARENT DASHBOARD === */
.pin-input {
  text-align: center;
  padding: 40px 0;
}

.pin-input p {
  margin-bottom: 16px;
  font-size: 16px;
}

.pin-field {
  width: 200px;
  padding: 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 24px;
  text-align: center;
  letter-spacing: 8px;
  font-family: 'Nunito', sans-serif;
  margin-bottom: 16px;
}

.pin-hint {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 12px;
}

.parent-dashboard {
  padding-bottom: 20px;
}

.child-overview {
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.child-avatar {
  font-size: 56px;
}

.report-section, .daily-chart, .goal-section, .settings-section {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.report-section h3, .daily-chart h3, .goal-section h3, .settings-section h3 {
  margin-bottom: 12px;
}

.report-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.report-stat {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}

.rs-value {
  font-weight: 700;
  color: var(--primary-dark);
}

.chart-bars {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  height: 120px;
  padding: 8px 0;
}

.chart-bar-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  width: 100%;
  background: linear-gradient(180deg, var(--primary), #4ade80);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.3s;
}

.chart-label {
  font-size: 12px;
  margin-top: 4px;
}

.chart-value {
  font-size: 10px;
  color: var(--text-light);
}

.goal-setting {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.goal-setting label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.goal-setting input {
  width: 80px;
  padding: 8px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 16px;
  font-family: 'Nunito', sans-serif;
}

.pin-change {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pin-change input {
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 16px;
  font-family: 'Nunito', sans-serif;
}

/* === SETTINGS === */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.toggle {
  position: relative;
  width: 52px;
  height: 28px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #cbd5e1;
  border-radius: 14px;
  transition: 0.3s;
}

.slider:before {
  position: absolute;
  content: '';
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle input:checked + .slider {
  background: var(--primary);
}

.toggle input:checked + .slider:before {
  transform: translateX(24px);
}

.setting-item select {
  padding: 8px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
}

/* === COMPLETE SCREEN === */
.complete-screen {
  text-align: center;
  padding: 60px 20px;
}

.complete-emoji {
  font-size: 80px;
  margin-bottom: 20px;
  animation: bounce 0.6s ease;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.complete-screen h2 {
  font-size: 28px;
  margin-bottom: 12px;
}

.complete-screen p {
  color: var(--text-light);
  margin-bottom: 24px;
}

.quiz-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.screen-actions {
  padding: 16px 0;
}

/* === BADGE POPUP === */
.badge-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s;
}

.badge-popup-content {
  background: white;
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  max-width: 300px;
  animation: popIn 0.4s ease;
}

@keyframes popIn {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.badge-popup-emoji {
  font-size: 72px;
  margin-bottom: 16px;
}

.badge-popup-content h3 {
  font-size: 22px;
  margin-bottom: 8px;
}

.badge-popup-content p {
  color: var(--text-light);
}

.badge-desc {
  font-size: 14px;
  margin-bottom: 16px;
}

.badge-popup-content button {
  padding: 12px 24px;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  font-size: 16px;
  font-weight: 700;
}

/* === RESPONSIVE === */
@media (max-width: 360px) {
  .topics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .badges-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  #app {
    margin-top: 20px;
    border-radius: 24px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.1);
    min-height: calc(100vh - 40px);
  }
}

/* === OFFLINE === */
.online-status {
  position: fixed;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  z-index: 1000;
  transition: all 0.3s;
}

.online-status.online {
  background: #dcfce7;
  color: #16a34a;
}

.online-status.offline {
  background: #fee2e2;
  color: #dc2626;
}

.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 8px 16px;
  background: #fef3c7;
  color: #92400e;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  z-index: 999;
}

.sync-notification {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  border-radius: 12px;
  font-weight: 700;
  box-shadow: var(--shadow);
  z-index: 1000;
  animation: slideUp 0.3s ease;
}

.sync-notification.fade-out {
  opacity: 0;
  transition: opacity 0.3s;
}

@keyframes slideUp {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
