* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background: #f0f4ff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.app-container {
  background: #ffffff;
  padding: 20px 24px;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
  width: 100%;
  max-width: 480px;
}

h1 {
  text-align: center;
  margin-bottom: 16px;
  color: #1a2a6c;
  font-size: 22px;
}

h2 {
  text-align: center;
  margin-bottom: 12px;
  color: #1a2a6c;
}

#intro p {
  margin-bottom: 16px;
  line-height: 1.5;
  text-align: center;
}

button {
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
}

#start-btn,
#restart-btn {
  display: block;
  margin: 0 auto;
  background: #1a73e8;
  color: #fff;
}

#start-btn:hover,
#restart-btn:hover {
  filter: brightness(0.95);
}

.hidden {
  display: none;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
}

#timer {
  font-weight: bold;
  color: #d32f2f;
}

#score {
  font-weight: bold;
  color: #1b5e20;
}

.question-box {
  background: #f7f9ff;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 8px;
  border: 1px solid #e0e7ff;
}

#question {
  font-size: 16px;
}

/* Hình minh họa câu hỏi (biển báo) */
.question-image {
  text-align: center;
  margin-bottom: 8px;
}

.question-image img {
  max-width: 100%;
  height: auto;
  display: inline-block;
}

.answers {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.answer-btn {
  text-align: left;
  background: #f5f5f5;
}

.answer-btn:hover {
  background: #e4f0ff;
}

.answer-btn.correct {
  background: #c8e6c9;
}

.answer-btn.wrong {
  background: #ffcdd2;
}

.answer-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.feedback {
  min-height: 24px;
  margin-bottom: 10px;
  font-weight: 500;
}

#next-btn {
  background: #ff9800;
  color: #fff;
  width: 100%;
}

#next-btn:hover {
  filter: brightness(0.95);
}

#result-container p {
  text-align: center;
  margin-bottom: 8px;
}
/* NICKNAME + MENU */
  #nickname-screen,
  #lesson-menu {
    text-align: center;
  }

  #nickname-screen input {
    width: 80%;
    padding: 8px;
    margin-bottom: 12px;
    border-radius: 8px;
    border: 1px solid #bbb;
  }

  /* DANH SÁCH CÂU SAI – COLLAPSE */
  .wrong-item {
    background: #fff3e0;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #ffcc80;
  }

  .wrong-detail {
    display: none;
    padding: 8px;
    background: #fff;
    border-left: 3px solid #ffa726;
    margin-top: 6px;
  }
  #question-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 12px;
    margin-top: 20px;
  }

  .question-btn {
      padding: 14px 0;
      background: #f1f1f1;
      border-radius: 8px;
      border: 1px solid #ccc;
      font-weight: bold;
      cursor: pointer;
      transition: 0.2s;
  }

  .question-btn:hover {
      background: #dfe8ff;
      border-color: #5b83ff;
  }

  .question-btn.done {
      background: #d4ffd4;
      border-color: #32cd32;
  }

  .question-btn.current {
      background: #ffe9a7;
      border-color: #ffb300;
  }
  .question-btn.locked {
    background: #ddd;
    border-color: #bbb;
    color: #777;
  }

  .question-btn.correct-done {
      background: #c8ffc8;
      border-color: #2ecc71;
  }

  .question-btn.wrong-done {
      background: #ffd0d0;
      border-color: #e74c3c;
  }
#back-to-picker {
  margin-top: 15px;
  padding: 8px 16px;
  border-radius: 6px;
  background: #eee;
}

/* ============================
   RESPONSIVE CHO ĐIỆN THOẠI
   ============================ */
@media (max-width: 480px) {

  .app-container {
    padding: 16px;
    border-radius: 12px;
    width: 95%;
  }

  h1 {
    font-size: 18px;
    margin-bottom: 12px;
  }

  #question {
    font-size: 15px;
    line-height: 1.4;
  }

  .top-bar {
    font-size: 12px;
    flex-direction: column;
    gap: 4px;
  }

  .answer-btn {
    font-size: 15px;
    padding: 12px;
    border-radius: 10px;
  }

  #next-btn {
    padding: 12px;
    font-size: 16px;
  }

  /* Hình minh họa tự thu nhỏ gọn gàng */
  .question-image img {
    max-width: 90%;
  }

}
