@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@600;800&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Nunito', sans-serif;
  background-color: #f0f8ff;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  color: #333;
  perspective: 1000px;
}

.container {
  background-color: white;
  width: 100%;
  max-width: 600px;
  border-radius: 24px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  text-align: center;
  padding: 30px 20px;
  position: relative;
}

h1 {
  color: #ff6b6b;
  font-size: 28px;
  margin-bottom: 20px;
}

.subtitle {
  font-size: 18px;
  margin-bottom: 25px;
  color: #666;
}

.screen {
  display: none;
  animation: fadeIn 0.5s ease;
}

.screen.active {
  display: block;
}

/* Khu vực chọn ngôn ngữ */
.lang-selector {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 30px;
}

.btn-lang {
  background-color: #e9ecef;
  color: #495057;
  font-size: 16px;
  padding: 10px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 0 #ced4da;
  max-width: fit-content;
  margin: 0;
}

.btn-lang.active {
  background-color: #ffd93b;
  color: #d35400;
  box-shadow: 0 4px 0 #d9b327;
}

/* Khu vực hiển thị text và loa */
.text-container {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
  text-align: left;
}

.btn-speak {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #ffd93b;
  font-size: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  margin: 0;
  box-shadow: 0 4px 0 #d9b327;
  flex-shrink: 0;
}

/* Nút Tự động đọc Toggle */
.btn-toggle {
  background-color: #f1f3f5;
  color: #868e96;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 12px;
  margin: -10px auto 20px auto;
  display: block;
  width: fit-content;
  box-shadow: 0 4px 0 #dee2e6;
}

.btn-toggle.active {
  background-color: #4ecdc4;
  color: white;
  box-shadow: 0 4px 0 #3b9b95;
}

/* Nút bấm chung */
button {
  font-family: 'Nunito', sans-serif;
  font-size: 18px;
  font-weight: 800;
  border: none;
  border-radius: 16px;
  padding: 15px 30px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

button:active {
  transform: scale(0.95);
}

.btn-start {
  background-color: #4ecdc4;
  color: white;
  box-shadow: 0 6px 0 #3b9b95;
  width: 100%;
  max-width: 250px;
  margin: 0 auto;
  display: block;
}

.btn-correct {
  background-color: #a8e6cf;
  color: #2d6a4f;
  box-shadow: 0 6px 0 #7eb8a5;
  width: 45%;
  margin: 0;
}

.btn-wrong {
  background-color: #ff8b94;
  color: white;
  box-shadow: 0 6px 0 #d66a72;
  width: 45%;
  margin: 0;
}

.btn-finish {
  background-color: #ffd3b6;
  color: #d35400;
  box-shadow: 0 6px 0 #e6b79a;
  margin-top: 30px;
  width: 100%;
  max-width: 250px;
}

.buttons-row {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

/* Thẻ Flashcard */
.flashcard {
  background-color: #fff9c4;
  border: 4px dashed #ffb74d;
  border-radius: 20px;
  padding: 15px;
  font-size: 20px;
  color: #d35400;
  line-height: 1.5;
  flex: 1;
  transform-style: preserve-3d;
}

.question-box {
  background-color: #e1f5fe;
  border-radius: 16px;
  padding: 15px;
  font-size: 18px;
  font-weight: bold;
  color: #0277bd;
  flex: 1;
  transform-style: preserve-3d;
}

.score-board {
  display: flex;
  justify-content: space-around;
  margin-bottom: 25px;
  font-size: 18px;
  font-weight: bold;
}

.score-correct {
  color: #2ea371;
}

.score-wrong {
  color: #e63946;
}

.result-stats {
  font-size: 22px;
  margin: 20px 0;
  line-height: 1.8;
}

.feedback {
  font-size: 20px;
  margin-bottom: 30px;
  color: #d35400;
}

/* Hiệu ứng Fade và lật thẻ 3D */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes flipCard {
  0% {
    transform: rotateX(0);
    opacity: 1;
  }

  50% {
    transform: rotateX(90deg);
    opacity: 0;
  }

  100% {
    transform: rotateX(0);
    opacity: 1;
  }
}

.flip-animation {
  animation: flipCard 0.6s ease-in-out;
}