* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #2d3748;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
#app {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  width: 100%;
  max-width: 560px;
  padding: 30px;
  min-height: 480px;
}
h1, h2 { margin-bottom: 16px; color: #4a5568; text-align: center; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }

input[type=text], input[type=password] {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1rem;
  margin-bottom: 12px;
  transition: border-color .2s;
  color: #2d3748;
  background: #fff;
}
input:focus { outline: none; border-color: #667eea; }

button {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  background: #667eea;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .1s;
}
button:hover { background: #5a67d8; }
button:active { transform: scale(0.98); }
button.secondary { background: #a0aec0; color: #fff; }
button.secondary:hover { background: #718096; }

.login-form { margin-top: 20px; }
.error { color: #e53e3e; font-size: .9rem; text-align: center; margin-top: 8px; min-height: 1.2em; }

/* Menu poziomów */
.user-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 2px solid #edf2f7;
  margin-bottom: 20px;
}
.user-bar span { font-weight: 600; color: #4a5568; }
.user-bar button { width: auto; padding: 8px 16px; font-size: .85rem; background: #e53e3e; }
.user-bar button:hover { background: #c53030; }

.levels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
}
.level-btn {
  padding: 16px 8px;
  border-radius: 12px;
  background: #edf2f7;
  color: #2d3748;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  text-align: center;
  font-size: .9rem;
  transition: all .2s;
}
.level-btn:hover { background: #e2e8f0; transform: translateY(-2px); }
.level-btn.done { background: #c6f6d5; color: #22543d; border-color: #48bb78; }
.level-btn .prog { font-size: .7rem; font-weight: 400; display: block; margin-top: 4px; color: #718096; }

/* Gra */
.task-area { margin: 24px 0; text-align: center; }
.task-label { font-size: .9rem; color: #718096; margin-bottom: 8px; }
.task-prompt {
  font-size: 1.8rem;
  font-weight: 700;
  color: #2d3748;
  padding: 16px;
  background: #f7fafc;
  border-radius: 12px;
  margin-bottom: 16px;
  word-break: break-word;
}
.task-inputs { display: flex; gap: 10px; margin-bottom: 12px; }
.task-inputs input { margin-bottom: 0; text-align: center; font-weight: 600; }

/* ===== OPCJE WYBORU (KOLOR POPRAWIONY) ===== */
.mc-options { display: flex; flex-direction: column; gap: 8px; }
.mc-option {
  padding: 12px 16px;
  background: #edf2f7;
  color: #2d3748;
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  text-align: left;
  transition: all .2s;
  font-weight: 500;
  width: 100%;
}
.mc-option:hover { background: #e2e8f0; color: #2d3748; }
.mc-option.correct,
.mc-option.correct:hover {
  background: #c6f6d5;
  border-color: #48bb78;
  color: #22543d;
}
.mc-option.wrong,
.mc-option.wrong:hover {
  background: #fed7d7;
  border-color: #e53e3e;
  color: #742a2a;
}

.feedback { min-height: 1.5em; text-align: center; font-weight: 600; margin: 8px 0; }
.feedback.ok { color: #38a169; }
.feedback.err { color: #e53e3e; }

.progress-bar {
  height: 8px;
  background: #edf2f7;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 20px;
}
.progress-bar > div {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transition: width .3s;
}

.summary-box { text-align: center; }
.summary-box p { margin: 12px 0; color: #4a5568; }
.summary-box .big { font-size: 2.5rem; font-weight: 800; color: #667eea; }

/* ===== GŁOŚNIK (wymowa) ===== */
button.speak-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 40px;
  height: 36px;
  padding: 0 10px;
  margin-left: 10px;
  font-size: 1.2rem;
  line-height: 1;
  vertical-align: middle;
  background: #edf2f7;
  color: #2d3748;
  border: 2px solid #cbd5e0;
  border-radius: 10px;
}
button.speak-btn:hover { background: #e2e8f0; }
