* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: IBM Plex Sans Thai Looped, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, #fff4e6, transparent 30%),
    linear-gradient(135deg, #fff7ed, #f8fafc);
  color: #111827;
  min-height: 100vh;
}
.ibm-plex-sans-thai-looped-thin {
  font-family: "IBM Plex Sans Thai Looped", sans-serif;
  font-weight: 100;
  font-style: normal;
}

.ibm-plex-sans-thai-looped-extralight {
  font-family: "IBM Plex Sans Thai Looped", sans-serif;
  font-weight: 200;
  font-style: normal;
}

.ibm-plex-sans-thai-looped-light {
  font-family: "IBM Plex Sans Thai Looped", sans-serif;
  font-weight: 300;
  font-style: normal;
}

.ibm-plex-sans-thai-looped-regular {
  font-family: "IBM Plex Sans Thai Looped", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.ibm-plex-sans-thai-looped-medium {
  font-family: "IBM Plex Sans Thai Looped", sans-serif;
  font-weight: 500;
  font-style: normal;
}

.ibm-plex-sans-thai-looped-semibold {
  font-family: "IBM Plex Sans Thai Looped", sans-serif;
  font-weight: 600;
  font-style: normal;
}

.ibm-plex-sans-thai-looped-bold {
  font-family: "IBM Plex Sans Thai Looped", sans-serif;
  font-weight: 700;
  font-style: normal;
}
.ibm-plex-sans-thai-thin {
  font-family: "IBM Plex Sans Thai", sans-serif;
  font-weight: 100;
  font-style: normal;
}

.ibm-plex-sans-thai-extralight {
  font-family: "IBM Plex Sans Thai", sans-serif;
  font-weight: 200;
  font-style: normal;
}

.ibm-plex-sans-thai-light {
  font-family: "IBM Plex Sans Thai", sans-serif;
  font-weight: 300;
  font-style: normal;
}

.ibm-plex-sans-thai-regular {
  font-family: "IBM Plex Sans Thai", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.ibm-plex-sans-thai-medium {
  font-family: "IBM Plex Sans Thai", sans-serif;
  font-weight: 500;
  font-style: normal;
}

.ibm-plex-sans-thai-semibold {
  font-family: "IBM Plex Sans Thai", sans-serif;
  font-weight: 600;
  font-style: normal;
}

.ibm-plex-sans-thai-bold {
  font-family: "IBM Plex Sans Thai", sans-serif;
  font-weight: 700;
  font-style: normal;
}
.kanit-thin {
  font-family: "Kanit", sans-serif;
  font-weight: 100;
  font-style: normal;
}

.kanit-extralight {
  font-family: "Kanit", sans-serif;
  font-weight: 200;
  font-style: normal;
}

.kanit-light {
  font-family: "Kanit", sans-serif;
  font-weight: 300;
  font-style: normal;
}

.kanit-regular {
  font-family: "Kanit", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.kanit-medium {
  font-family: "Kanit", sans-serif;
  font-weight: 500;
  font-style: normal;
}

.kanit-semibold {
  font-family: "Kanit", sans-serif;
  font-weight: 600;
  font-style: normal;
}

.kanit-bold {
  font-family: "Kanit", sans-serif;
  font-weight: 700;
  font-style: normal;
}

.kanit-extrabold {
  font-family: "Kanit", sans-serif;
  font-weight: 800;
  font-style: normal;
}

.kanit-black {
  font-family: "Kanit", sans-serif;
  font-weight: 900;
  font-style: normal;
}

.kanit-thin-italic {
  font-family: "Kanit", sans-serif;
  font-weight: 100;
  font-style: italic;
}

.kanit-extralight-italic {
  font-family: "Kanit", sans-serif;
  font-weight: 200;
  font-style: italic;
}

.kanit-light-italic {
  font-family: "Kanit", sans-serif;
  font-weight: 300;
  font-style: italic;
}

.kanit-regular-italic {
  font-family: "Kanit", sans-serif;
  font-weight: 400;
  font-style: italic;
}

.kanit-medium-italic {
  font-family: "Kanit", sans-serif;
  font-weight: 500;
  font-style: italic;
}

.kanit-semibold-italic {
  font-family: "Kanit", sans-serif;
  font-weight: 600;
  font-style: italic;
}

.kanit-bold-italic {
  font-family: "Kanit", sans-serif;
  font-weight: 700;
  font-style: italic;
}

.kanit-extrabold-italic {
  font-family: "Kanit", sans-serif;
  font-weight: 800;
  font-style: italic;
}

.kanit-black-italic {
  font-family: "Kanit", sans-serif;
  font-weight: 900;
  font-style: italic;
}

.app {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

.hidden {
  display: none;
}

.badge {
  display: inline-flex;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff7ed;
  color: #ea580c;
  font-weight: 700;
  margin-bottom: 12px;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.1;
}

h2 {
  margin-top: 24px;
}

.subtitle {
  color: #64748b;
  font-size: 18px;
  margin-bottom: 24px;
}

label {
  display: block;
  margin-top: 18px;
  margin-bottom: 8px;
  font-weight: 700;
  font-family: IBM Plex Sans Thai Looped;
}

input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #cbd5e1;
  font-size: 16px;
  font-family: IBM Plex Sans Thai Looped;
}

.choice-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-family: IBM Plex Sans Thai Looped;
    
}

.select-btn,
.level-btn {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  padding: 12px 18px;
  border-radius: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: IBM Plex Sans Thai Looped;

}

.select-btn.active,
.level-btn.active {
  background: #f97316;
  color: white;
  border-color: #f97316;
}

.primary-btn {
  width: 100%;
  margin-top: 24px;
  padding: 15px 20px;
  border: 0;
  border-radius: 18px;
  background: #f97316;
  color: white;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  font-family: IBM Plex Sans Thai Looped;
}
.primary-btn:hover {
  filter: brightness(0.96);
}
.primary-btn:disabled,
.primaryBtn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  margin-bottom: 12px;
}

.progress {
  height: 12px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-bottom: 24px;
}

#progressFill {
  height: 100%;
  width: 0%;
  background: #f97316;
  transition: width 0.2s ease;
}

.food-box {
  text-align: center;
}

.food-box img {
  width: min(420px, 100%);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.16);
}

.food-box h2 {
  font-size: 30px;
  margin: 18px 0;
}

.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
  font-family: "IBM Plex Sans Thai Looped", "Kanit", sans-serif;
}

.option-btn,
.optionBtn {
  position: relative;
  min-height: 72px;
  padding: 18px 20px;
  border-radius: 22px;
  border: 2px solid #fed7aa;
  background:
    linear-gradient(180deg, #ffffff 0%, #fff7ed 100%);
  color: #1f2937;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.35;
  cursor: pointer;
  font-family: "IBM Plex Sans Thai Looped", "Kanit", sans-serif;
  box-shadow:
    0 10px 22px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

.option-btn::before,
.optionBtn::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #fb923c;
  transform: translateY(-50%);
  box-shadow: 0 0 0 6px #ffedd5;
}

.option-btn:hover,
.optionBtn:hover {
  transform: translateY(-3px);
  border-color: #f97316;
  background:
    linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
  box-shadow:
    0 16px 30px rgba(249, 115, 22, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.option-btn:active,
.optionBtn:active {
  transform: translateY(-1px) scale(0.99);
}

.option-btn:disabled,
.optionBtn:disabled {
  cursor: not-allowed;
  opacity: 0.9;
  transform: none;
}

.option-btn.selectedCorrect,
.optionBtn.selectedCorrect {
  border-color: #22c55e;
  background: linear-gradient(180deg, #ecfdf5 0%, #dcfce7 100%);
  color: #166534;
  box-shadow: 0 14px 28px rgba(34, 197, 94, 0.18);
}

.option-btn.selectedCorrect::before,
.optionBtn.selectedCorrect::before {
  content: "✓";
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #ffffff;
  background: #22c55e;
  box-shadow: none;
  font-size: 18px;
  font-weight: 900;
}

.option-btn.selectedWrong,
.optionBtn.selectedWrong {
  border-color: #ef4444;
  background: linear-gradient(180deg, #fff1f2 0%, #fee2e2 100%);
  color: #991b1b;
  box-shadow: 0 14px 28px rgba(239, 68, 68, 0.16);
}

.option-btn.selectedWrong::before,
.optionBtn.selectedWrong::before {
  content: "×";
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #ffffff;
  background: #ef4444;
  box-shadow: none;
  font-size: 20px;
  font-weight: 900;
}
.feedback {
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  font-size: 20px;
  font-weight: 900;
  text-align: center;
}

.feedback.correct {
  background: #dcfce7;
  color: #166534;
}

.feedback.wrong {
  background: #fee2e2;
  color: #991b1b;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 24px;
}

.summary-grid div {
  background: #f8fafc;
  border-radius: 18px;
  padding: 18px;
  text-align: center;
}

.summary-grid strong {
  display: block;
  font-size: 30px;
  color: #f97316;
}

.summary-grid span {
  color: #64748b;
  font-weight: 700;
}

#leaderboardBox {
  margin-top: 16px;
  overflow-x: auto;
  border-radius: 24px;
}

.leaderboard-table,
#leaderboardBox table {
  width: 100%;
  min-width: 680px;
  border-collapse: separate;
  border-spacing: 0 10px;
  font-family: "IBM Plex Sans Thai Looped", "Kanit", sans-serif;
}

.leaderboard-table thead tr,
#leaderboardBox table thead tr {
  background: transparent;
}

.leaderboard-table th,
#leaderboardBox table th {
  padding: 14px 16px;
  color: #9a3412;
  background: #fff7ed;
  font-size: 15px;
  font-weight: 900;
  text-align: center;
  border: 0;
}

.leaderboard-table th:first-child,
#leaderboardBox table th:first-child {
  border-radius: 18px 0 0 18px;
}

.leaderboard-table th:last-child,
#leaderboardBox table th:last-child {
  border-radius: 0 18px 18px 0;
}

.leaderboard-table tbody tr,
#leaderboardBox table tbody tr {
  background: #F2F2F2;
}

.leaderboard-table tbody tr:hover,
#leaderboardBox table tbody tr:hover {
  transform: translateY(-2px);
}

.leaderboard-table td,
#leaderboardBox table td {
  padding: 16px;
  border: 0;
  color: #334155;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  background: #ffffff;
}

.leaderboard-table td:first-child,
#leaderboardBox table td:first-child {
  border-radius: 18px 0 0 18px;
  color: #f97316;
  font-size: 18px;
  font-weight: 900;
}

.leaderboard-table td:last-child,
#leaderboardBox table td:last-child {
  border-radius: 0 18px 18px 0;
}

.leaderboard-table tbody tr:first-child td,
#leaderboardBox table tbody tr:first-child td {
  background: #fff;
}

.leaderboard-table tbody tr:first-child td:first-child::before,
#leaderboardBox table tbody tr:first-child td:first-child::before {
  content: "🏆 ";
}

.leaderboard-table tbody tr:nth-child(2) td:first-child::before,
#leaderboardBox table tbody tr:nth-child(2) td:first-child::before {
  content: "🥈 ";
}

.leaderboard-table tbody tr:nth-child(3) td:first-child::before,
#leaderboardBox table tbody tr:nth-child(3) td:first-child::before {
  content: "🥉 ";
}
@media (max-width: 640px) {
  .app {
    padding: 14px;
  }

  .card {
    padding: 20px;
    border-radius: 24px;
  }

  .options {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .option-btn,
  .optionBtn {
    min-height: 64px;
    padding: 16px 18px 16px 56px;
    font-size: 17px;
    text-align: left;
  }

  .option-btn::before,
  .optionBtn::before {
    left: 18px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  #leaderboardBox {
    margin-left: -4px;
    margin-right: -4px;
    padding-bottom: 8px;
  }

  .leaderboard-table,
  #leaderboardBox table {
    min-width: 620px;
  }
}