body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: #f7f8fb;
  color: #333;
}

/* =========================
   Layout
========================= */
.container {
  max-width: 980px;
  margin: auto;
  padding: 40px 16px;
  text-align: center;
}

.page-container {
  max-width: 640px; /* tighter = better reading */
}

/* =========================
   Header
========================= */
h1 {
  font-size: 34px;
  margin-bottom: 8px;
}

.subtitle {
  color: #666;
  margin-bottom: 28px;
  font-size: 15px;
}

/* =========================
   Card Grid (Home)
========================= */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.card {
  background: white;
  padding: 26px 20px;
  border-radius: 18px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
}

.emoji {
  font-size: 28px;
  margin-bottom: 10px;
}

.title {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 6px;
}

.desc {
  font-size: 14px;
  color: #777;
  line-height: 1.4;
}

/* =========================
   Puzzle Page
========================= */
.back-link {
  display: inline-block;
  margin-bottom: 20px;
  text-decoration: none;
  color: #666;
  font-weight: 600;
}

.page-header {
  text-align: center;
  margin-bottom: 24px;
}

.page-emoji {
  font-size: 34px;
  margin-bottom: 6px;
}

/* =========================
   Puzzle Card
========================= */
.riddle-card {
  background: white;
  border-radius: 20px;
  padding: 28px 20px 22px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.07);
  max-width: 560px;
  margin: 0 auto;
}

.riddle-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #666;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
  background: #f3f4f7;
  padding: 6px 10px;
  border-radius: 999px;
}

/* 🔥 FIXED FONT SIZE */
.riddle-question {
  font-size: clamp(0.95rem, 2vw, 1.08rem);
  line-height: 1.55;
  text-align: left;
}

/* =========================
   Logic Puzzle Formatting
========================= */
.logic-puzzle-ui {
  font-size: 0.92rem;
}

.logic-section {
  margin-bottom: 12px;
}

.logic-heading {
  font-weight: 700;
  margin-bottom: 4px;
}

.logic-clue-list {
  padding-left: 18px;
  margin: 0;
}

.logic-clue-list li {
  margin-bottom: 6px;
}

/* =========================
   Buttons
========================= */
.action-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.answer-btn,
.share-btn,
.nav-btn {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.answer-btn {
  background: #222;
  color: white;
}

.share-btn {
  background: #f1f3f7;
}

.answer-btn:hover,
.share-btn:hover,
.nav-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

/* =========================
   Answer Box
========================= */
.answer-box {
  display: none;
  margin-top: 16px;
  padding: 14px;
  background: #f4f6fa;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
}

/* =========================
   Navigation
========================= */
.nav-row.modern-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  margin-top: 20px;
  align-items: center;
}

.nav-btn.prev,
.nav-btn.next {
  background: white;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.modern-shuffle {
  background: #222;
  color: white;
}

.nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.share-status {
  margin-top: 12px;
  font-size: 13px;
  color: #777;
}

/* =========================
   Mobile Fix (IMPORTANT)
========================= */
@media (max-width: 600px) {
  .riddle-question {
    font-size: 0.95rem; /* smaller, not 20px anymore */
  }

  .logic-puzzle-ui {
    font-size: 0.9rem;
  }

  .nav-row.modern-nav {
    grid-template-columns: 1fr;
  }

  .nav-btn {
    width: 100%;
  }

  .action-row {
    flex-direction: column;
  }

  .answer-btn,
  .share-btn {
    width: 100%;
  }
}



/* =========================
   Who Am I / Clue Reveal
========================= */

.riddle-question {
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  line-height: 1.6;
  text-align: left;
  white-space: normal;
}

.logic-puzzle-ui {
  font-size: 0.95rem;
  text-align: left;
}

.logic-section {
  margin-bottom: 14px;
}

.logic-heading {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #666;
  margin-bottom: 6px;
}

.logic-text {
  line-height: 1.6;
  color: #333;
}

.clue-toggle-btn,
.reveal-clue-btn {
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.clue-toggle-btn {
  background: #f1f3f7;
  color: #222;
  width: 100%;
  text-align: left;
}

.reveal-clue-btn {
  background: #222;
  color: white;
  margin-top: 10px;
  width: 100%;
}

.clue-toggle-btn:hover,
.reveal-clue-btn:hover {
  transform: translateY(-1px);
}

.clues-panel {
  margin-top: 10px;
  padding: 12px 14px;
  background: #f7f8fb;
  border-radius: 12px;
  border: 1px solid #eceff4;
}

.logic-clue-list {
  margin: 0;
  padding-left: 18px;
}

.logic-clue-list li {
  margin-bottom: 8px;
  line-height: 1.55;
}

.all-clues-shown {
  margin-top: 10px;
  font-size: 13px;
  color: #777;
  font-weight: 600;
}

/* mobile */
@media (max-width: 600px) {
  .riddle-question {
    font-size: 0.95rem;
  }

  .logic-puzzle-ui {
    font-size: 0.92rem;
  }
}

