@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Manrope:wght@600;700;800&display=swap');

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: 'Manrope', system-ui, sans-serif;
  color: #1e293b;
  background: #fdf6ec url('../../../../../assets/image/clean-plain-bg.webp?v=4') center/cover no-repeat fixed;
}
.game-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 20px 32px;
}
.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.chap-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px 10px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(180deg, #b91c1c 0%, #851013 52%, #5a0a0c 100%);
  border: 2.5px solid #f59e0b;
  border-bottom: 5px solid #3d0607;
  border-radius: 15px;
  box-shadow: 0 6px 16px rgba(61, 6, 7, 0.28);
}
.chap-back-btn:hover {
  transform: translateY(-2px);
  border-color: #fde68a;
  color: #fff;
}
.lvl-badge {
  background: #fff7ed;
  border: 2px solid #f59e0b;
  color: #851013;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 14px;
}
.title-banner {
  text-align: center;
  margin-bottom: 18px;
}
.title-banner h1 {
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(22px, 2.6vw, 32px);
  color: #851013;
  margin: 0 0 6px;
}
.title-banner p {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #475569;
}
.mode-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.mode-tab {
  font-family: 'Fredoka', sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: 999px;
  border: 2px solid #e2e8f0;
  background: #fff;
  color: #334155;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}
.mode-tab.active {
  background: linear-gradient(135deg, #851013, #b91c1c);
  color: #fff;
  border-color: #f59e0b;
}
.board-card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 14px 34px rgba(61, 6, 7, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.28);
}
.puzzle-layout {
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 260px);
  justify-content: center;
  gap: 24px;
  align-items: start;
}
.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: #fde68a;
  padding: 8px;
  border-radius: 16px;
  aspect-ratio: 3 / 4;
}
.tile {
  border: 2px solid #fff;
  border-radius: 10px;
  background-repeat: no-repeat;
  background-size: 300% 300%;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
}
.tile.selected {
  outline: 4px solid #851013;
  transform: scale(0.96);
  z-index: 2;
}
.puzzle-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ref-preview {
  width: 100%;
  border-radius: 14px;
  border: 2px solid #e2e8f0;
}
.act-btn {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 0;
  background: #851013;
  color: #fff;
  cursor: pointer;
}
.act-btn.secondary {
  background: #f1f5f9;
  color: #1e293b;
}
.status-msg {
  font-weight: 800;
  color: #15803d;
  min-height: 22px;
  font-size: 14px;
}
.quiz-box {
  max-width: 740px;
  margin: 0 auto;
}
.quiz-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-weight: 800;
  color: #64748b;
}
.quiz-q {
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(19px, 2.2vw, 25px);
  color: #0f172a;
  margin: 0 0 16px;
}
.quiz-opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.opt-btn {
  padding: 14px 16px;
  border-radius: 14px;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  font-family: 'Fredoka', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  text-align: left;
}
.opt-btn:hover:not(:disabled) {
  border-color: #f59e0b;
  background: #fffbeb;
}
.opt-btn.correct {
  background: #dcfce7;
  border-color: #16a34a;
  color: #14532d;
}
.opt-btn.wrong {
  background: #fee2e2;
  border-color: #dc2626;
  color: #7f1d1d;
}
.quiz-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
@media (max-width: 760px) {
  .puzzle-layout { grid-template-columns: 1fr; }
  .quiz-opts { grid-template-columns: 1fr; }
}
