* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Noto Sans KR",
    sans-serif;
}

body {
  margin: 0;
  background: #0f172a;
  color: #f9fafb;
}

.header {
  padding: 16px;
  background: linear-gradient(90deg, #1d4ed8, #0ea5e9);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.header h1 {
  margin: 0;
  font-size: 1.4rem;
}

.whale-panel {
  background: rgba(15, 23, 42, 0.2);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 280px;
}

.whale-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.whale-level {
  font-size: 0.8rem;
}

.xp-bar {
  width: 100%;
  height: 8px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 999px;
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  width: 0%;
  background: #22c55e;
  transition: width 0.4s ease;
}

.whale-message {
  font-size: 0.8rem;
  opacity: 0.9;
}

.main {
  max-width: 900px;
  margin: 0 auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.7);
}

.panel h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.form-row {
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-row label {
  font-size: 0.9rem;
}

.form-row input,
.form-row select {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #1f2937;
  background: #020617;
  color: #f9fafb;
}

.hint {
  font-size: 0.75rem;
  color: #9ca3af;
}

.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.button-row.center {
  justify-content: center;
}

.btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  background: #111827;
  color: #e5e7eb;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.08s ease;
}

.btn.primary {
  background: #3b82f6;
  color: #eff6ff;
}

.btn.secondary {
  background: #1f2937;
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
  transform: none;
}

.btn:not(:disabled):active {
  transform: translateY(1px);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.question-text {
  background: #020617;
  border-radius: 10px;
  padding: 12px;
  min-height: 64px;
  font-size: 1rem;
  margin-bottom: 10px;
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.choice-btn {
  text-align: left;
  width: 100%;
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px solid #1f2937;
  background: #020617;
  cursor: pointer;
  font-size: 0.9rem;
  color: #f9fafb;
}

.choice-btn.selected {
  border-color: #3b82f6;
  background: #1e293b;
}

.choice-btn.correct {
  border-color: #22c55e;
}

.choice-btn.wrong {
  border-color: #ef4444;
}

.feedback {
  min-height: 24px;
  font-size: 0.9rem;
}

.feedback.correct {
  color: #22c55e;
}

.feedback.wrong {
  color: #f97316;
}

#wrong-list {
  font-size: 0.85rem;
  max-height: 240px;
  overflow-y: auto;
}

.wrong-item {
  padding: 4px 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.5);
}

.footer {
  text-align: center;
  padding: 12px;
  font-size: 0.75rem;
  color: #6b7280;
}

/* 큰 화면에서 조금 넓게 */
@media (min-width: 768px) {
  .header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* 언어 선택 버튼 */
.lang-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.lang-btn {
  font-size: 0.85rem;
  padding: 6px 10px;
}

.lang-btn.active {
  background: #0ea5e9;
  color: #eff6ff;
}