/* =========================================================
   Plant.Garden — Games Section Styles
   Scoped with .games-* prefix; uses global CSS variables
   ========================================================= */

/* ── Hub: hero ── */
.games-hero {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg) var(--space-2xl);
  background: linear-gradient(135deg, var(--primary-50) 0%, #ecfdf5 60%, var(--neutral-50) 100%);
}
.games-hero-icon {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: var(--space-md);
  display: block;
  animation: games-bounce 2s ease-in-out infinite;
}
@keyframes games-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.games-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--primary-800);
  margin-bottom: var(--space-sm);
}
.games-hero p {
  font-size: 1.1rem;
  color: var(--neutral-600);
  max-width: 580px;
  margin: 0 auto;
}

/* ── Hub: game cards grid ── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-xl);
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg) var(--space-3xl);
}
.games-card {
  background: #fff;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  display: flex;
  flex-direction: column;
  position: relative;
}
.games-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
}
.games-card-banner {
  height: 6px;
  background: linear-gradient(90deg, var(--primary-400), var(--primary-600));
}
.games-card-banner.quiz   { background: linear-gradient(90deg, #4ade80, #16a34a); }
.games-card-banner.match  { background: linear-gradient(90deg, #60a5fa, #2563eb); }
.games-card-banner.guess  { background: linear-gradient(90deg, #fb923c, #ea580c); }
.games-card-body {
  padding: var(--space-xl);
  flex: 1;
  display: flex;
  flex-direction: column;
}
.games-card-emoji {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  line-height: 1;
}
.games-card h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--primary-800);
  margin-bottom: var(--space-sm);
}
.games-card p {
  color: var(--neutral-600);
  font-size: 0.97rem;
  line-height: 1.6;
  flex: 1;
  margin-bottom: var(--space-lg);
}
.games-card-meta {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}
.games-badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--primary-100);
  color: var(--primary-700);
}
.games-badge.blue   { background: #dbeafe; color: #1d4ed8; }
.games-badge.orange { background: #ffedd5; color: #c2410c; }
.games-badge.green  { background: var(--primary-100); color: var(--primary-700); }
.games-card-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  background: var(--primary-600);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.97rem;
  padding: 12px 24px;
  border-radius: 50px;
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.games-card-cta:hover {
  background: var(--primary-700);
  transform: scale(1.03);
}
.games-card-cta.blue   { background: #2563eb; }
.games-card-cta.blue:hover { background: #1d4ed8; }
.games-card-cta.orange { background: #ea580c; }
.games-card-cta.orange:hover { background: #c2410c; }

/* ── Shared game page layout ── */
.game-page {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg) var(--space-3xl);
}
.game-page-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}
.game-page-header .game-icon {
  font-size: 3.5rem;
  line-height: 1;
  display: block;
  margin-bottom: var(--space-md);
}
.game-page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  color: var(--primary-800);
  margin-bottom: var(--space-sm);
}
.game-page-header p {
  color: var(--neutral-600);
  font-size: 1rem;
}
.game-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary-600);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: var(--space-xl);
}
.game-back-link:hover { text-decoration: underline; }

/* ── Score / stats bar ── */
.game-stats {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
}
.game-stat {
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-xl);
  padding: 10px 20px;
  text-align: center;
  min-width: 90px;
  box-shadow: var(--shadow-sm);
}
.game-stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-700);
  display: block;
}
.game-stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--neutral-500);
  display: block;
}

/* ── Progress bar ── */
.game-progress-wrap {
  background: var(--neutral-200);
  border-radius: 99px;
  height: 8px;
  margin-bottom: var(--space-xl);
  overflow: hidden;
}
.game-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-400), var(--primary-600));
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* ── Quiz card ── */
.quiz-card {
  background: #fff;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2xl);
  margin-bottom: var(--space-xl);
}
.quiz-question-number {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-600);
  margin-bottom: var(--space-md);
}
.quiz-question-text {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  color: var(--neutral-800);
  margin-bottom: var(--space-xl);
  line-height: 1.4;
}
.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}
@media (max-width: 520px) {
  .quiz-options { grid-template-columns: 1fr; }
}
.quiz-option {
  background: var(--neutral-50);
  border: 2px solid var(--neutral-200);
  border-radius: var(--radius-xl);
  padding: 14px 18px;
  cursor: pointer;
  font-size: 0.97rem;
  font-weight: 500;
  color: var(--neutral-700);
  text-align: left;
  transition: all var(--transition-fast);
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}
.quiz-option:hover:not(:disabled) {
  border-color: var(--primary-400);
  background: var(--primary-50);
  color: var(--primary-700);
}
.quiz-option .opt-letter {
  font-weight: 700;
  font-size: 0.85rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--neutral-200);
  color: var(--neutral-600);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}
.quiz-option:hover:not(:disabled) .opt-letter {
  background: var(--primary-600);
  color: #fff;
}
.quiz-option.correct {
  border-color: var(--success);
  background: #f0fdf4;
  color: #166534;
}
.quiz-option.correct .opt-letter { background: var(--success); color: #fff; }
.quiz-option.wrong {
  border-color: var(--error);
  background: #fff1f2;
  color: #9f1239;
}
.quiz-option.wrong .opt-letter { background: var(--error); color: #fff; }
.quiz-option:disabled { cursor: default; }
.quiz-feedback {
  margin-top: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  display: none;
}
.quiz-feedback.show { display: block; }
.quiz-feedback.correct { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.quiz-feedback.wrong   { background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; }
.quiz-next-btn {
  display: block;
  margin: var(--space-lg) auto 0;
  background: var(--primary-600);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 12px 36px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
  display: none;
}
.quiz-next-btn.show { display: block; }
.quiz-next-btn:hover { background: var(--primary-700); transform: scale(1.03); }

/* ── Result screen (shared by all games) ── */
.game-result {
  text-align: center;
  background: #fff;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-3xl) var(--space-xl);
  display: none;
}
.game-result.show { display: block; }
.game-result-trophy {
  font-size: 5rem;
  display: block;
  margin-bottom: var(--space-lg);
  animation: games-bounce 1.5s ease-in-out infinite;
}
.game-result h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--primary-800);
  margin-bottom: var(--space-sm);
}
.game-result-score {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--primary-600);
  display: block;
  margin: var(--space-md) 0;
}
.game-result p {
  color: var(--neutral-600);
  margin-bottom: var(--space-xl);
}
.game-result-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}
.btn-play-again {
  background: var(--primary-600);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 12px 32px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.btn-play-again:hover { background: var(--primary-700); }
.btn-more-games {
  background: transparent;
  color: var(--primary-600);
  border: 2px solid var(--primary-400);
  border-radius: 50px;
  padding: 12px 32px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: all var(--transition-fast);
}
.btn-more-games:hover { background: var(--primary-50); }

/* ── Memory match game ── */
.match-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
@media (max-width: 560px) {
  .match-grid { grid-template-columns: repeat(3, 1fr); gap: var(--space-sm); }
}
@media (max-width: 380px) {
  .match-grid { grid-template-columns: repeat(2, 1fr); }
}
.match-card {
  aspect-ratio: 3 / 4;
  cursor: pointer;
  perspective: 800px;
  border-radius: var(--radius-xl);
  min-height: 90px;
}
.match-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.45s ease;
  border-radius: var(--radius-xl);
}
.match-card.flipped .match-card-inner,
.match-card.matched .match-card-inner {
  transform: rotateY(180deg);
}
.match-card-face {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.3;
  box-shadow: var(--shadow-md);
}
.match-card-back {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
  color: #fff;
  font-size: 1.8rem;
}
.match-card-front {
  background: #fff;
  border: 2px solid var(--neutral-200);
  color: var(--neutral-700);
  transform: rotateY(180deg);
}
.match-card-front .card-emoji {
  font-size: 1.6rem;
  display: block;
  margin-bottom: 4px;
}
.match-card.matched .match-card-front {
  border-color: var(--success);
  background: #f0fdf4;
  color: var(--primary-700);
}
.match-card.wrong-flash .match-card-inner {
  animation: wrong-shake 0.4s ease;
}
@keyframes wrong-shake {
  0%, 100% { transform: rotateY(180deg) translateX(0); }
  25% { transform: rotateY(180deg) translateX(-6px); }
  75% { transform: rotateY(180deg) translateX(6px); }
}
.match-start-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.95);
  border-radius: var(--radius-2xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  z-index: 10;
  text-align: center;
  padding: var(--space-xl);
}
.match-start-overlay h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--primary-800);
}
.match-start-overlay p { color: var(--neutral-600); }
.match-container {
  position: relative;
  background: var(--neutral-50);
  border-radius: var(--radius-2xl);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
  box-shadow: var(--shadow-md);
}

/* ── Guess the plant ── */
.guess-clue-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
.guess-clue-item {
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-xl);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.guess-clue-item.visible {
  opacity: 1;
  transform: translateY(0);
}
.guess-clue-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}
.guess-clue-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-600);
  margin-bottom: 2px;
}
.guess-clue-value {
  color: var(--neutral-700);
  font-size: 0.97rem;
}
.guess-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
@media (max-width: 480px) {
  .guess-options { grid-template-columns: 1fr; }
}
.guess-option {
  background: #fff;
  border: 2px solid var(--neutral-200);
  border-radius: var(--radius-xl);
  padding: 14px 18px;
  cursor: pointer;
  font-size: 0.97rem;
  font-weight: 500;
  color: var(--neutral-700);
  text-align: left;
  transition: all var(--transition-fast);
}
.guess-option:hover:not(:disabled) {
  border-color: var(--primary-400);
  background: var(--primary-50);
  color: var(--primary-700);
}
.guess-option.correct {
  border-color: var(--success);
  background: #f0fdf4;
  color: #166534;
}
.guess-option.wrong {
  border-color: var(--error);
  background: #fff1f2;
  color: #9f1239;
}
.guess-option:disabled { cursor: default; }
.guess-clue-btn {
  display: block;
  margin: 0 auto var(--space-lg);
  background: transparent;
  color: var(--primary-600);
  border: 2px solid var(--primary-400);
  border-radius: 50px;
  padding: 10px 28px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.guess-clue-btn:hover { background: var(--primary-50); }
.guess-clue-btn:disabled { opacity: 0.5; cursor: default; }
.guess-points-banner {
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary-700);
  background: var(--primary-50);
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-lg);
  padding: 8px 16px;
  margin-bottom: var(--space-xl);
}
.guess-round-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--neutral-600);
  margin-bottom: var(--space-lg);
}

/* ── Word Search ── */
.ws-layout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-xl);
  align-items: start;
}
@media (max-width: 700px) {
  .ws-layout { grid-template-columns: 1fr; }
}
:root {
  --ws-color-0: #ef4444; --ws-color-1: #f97316; --ws-color-2: #eab308; --ws-color-3: #22c55e;
  --ws-color-4: #06b6d4; --ws-color-5: #3b82f6; --ws-color-6: #8b5cf6; --ws-color-7: #ec4899;
  --ws-color-8: #14b8a6; --ws-color-9: #f59e0b;
}
.ws-grid {
  display: grid;
  gap: 3px;
  user-select: none;
  touch-action: none;
}
.ws-cell {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; font-weight: 700;
  border-radius: 6px;
  background: var(--neutral-50);
  border: 1.5px solid var(--neutral-200);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  color: var(--neutral-700);
}
@media (max-width: 500px) {
  .ws-cell { width: 26px; height: 26px; font-size: 0.78rem; border-radius: 4px; }
  .ws-grid { gap: 2px; }
}
.ws-cell.ws-selecting { background: var(--primary-100); border-color: var(--primary-400); color: var(--primary-800); }
.ws-cell.ws-found-0  { background: color-mix(in srgb, var(--ws-color-0) 20%, white); border-color: var(--ws-color-0); color: var(--ws-color-0); }
.ws-cell.ws-found-1  { background: color-mix(in srgb, var(--ws-color-1) 20%, white); border-color: var(--ws-color-1); color: var(--ws-color-1); }
.ws-cell.ws-found-2  { background: color-mix(in srgb, var(--ws-color-2) 20%, white); border-color: var(--ws-color-2); color: var(--ws-color-2); }
.ws-cell.ws-found-3  { background: color-mix(in srgb, var(--ws-color-3) 20%, white); border-color: var(--ws-color-3); color: var(--ws-color-3); }
.ws-cell.ws-found-4  { background: color-mix(in srgb, var(--ws-color-4) 20%, white); border-color: var(--ws-color-4); color: var(--ws-color-4); }
.ws-cell.ws-found-5  { background: color-mix(in srgb, var(--ws-color-5) 20%, white); border-color: var(--ws-color-5); color: var(--ws-color-5); }
.ws-cell.ws-found-6  { background: color-mix(in srgb, var(--ws-color-6) 20%, white); border-color: var(--ws-color-6); color: var(--ws-color-6); }
.ws-cell.ws-found-7  { background: color-mix(in srgb, var(--ws-color-7) 20%, white); border-color: var(--ws-color-7); color: var(--ws-color-7); }
.ws-cell.ws-found-8  { background: color-mix(in srgb, var(--ws-color-8) 20%, white); border-color: var(--ws-color-8); color: var(--ws-color-8); }
.ws-cell.ws-found-9  { background: color-mix(in srgb, var(--ws-color-9) 20%, white); border-color: var(--ws-color-9); color: var(--ws-color-9); }
.ws-sidebar {
  min-width: 160px;
}
.ws-word-list {
  background: #fff;
  border-radius: var(--radius-xl);
  border: 1px solid var(--neutral-200);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}
.ws-word-list h3 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--neutral-500);
  margin-bottom: var(--space-md);
}
.ws-word {
  font-weight: 600;
  font-size: 0.97rem;
  color: var(--neutral-700);
  padding: 4px 0;
  border-bottom: 1px solid var(--neutral-100);
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ws-word:last-child { border-bottom: none; }
.ws-word.found { text-decoration: line-through; color: var(--neutral-400); }
.ws-found-label {
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary-600);
  margin-bottom: var(--space-md);
}

/* ── True or False ── */
.tf-card {
  background: #fff;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2xl);
  margin-bottom: var(--space-xl);
}
.tf-question-num {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--neutral-500);
  margin-bottom: var(--space-md);
  text-align: center;
}
.tf-statement {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  color: var(--neutral-800);
  text-align: center;
  line-height: 1.5;
  min-height: 4rem;
  margin-bottom: var(--space-xl);
}
.tf-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}
@media (max-width: 420px) {
  .tf-btns { grid-template-columns: 1fr; }
}
.tf-btn {
  padding: 18px 24px;
  border: 2px solid transparent;
  border-radius: var(--radius-xl);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.tf-btn-true {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}
.tf-btn-true:hover:not(:disabled) {
  background: #dcfce7;
  border-color: var(--success);
  transform: scale(1.02);
}
.tf-btn-false {
  background: #fff1f2;
  border-color: #fda4af;
  color: #9f1239;
}
.tf-btn-false:hover:not(:disabled) {
  background: #ffe4e6;
  border-color: var(--error);
  transform: scale(1.02);
}
.tf-btn:disabled { cursor: default; opacity: 0.7; }
.tf-btn.tf-selected-correct {
  background: #dcfce7 !important;
  border-color: var(--success) !important;
  color: #166534 !important;
  transform: scale(1.04);
}
.tf-btn.tf-selected-wrong {
  background: #ffe4e6 !important;
  border-color: var(--error) !important;
  color: #9f1239 !important;
}

/* ── Plant Sort ── */
.sort-plant-card {
  background: #fff;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2xl);
  text-align: center;
  margin-bottom: var(--space-xl);
}
.sort-plant-emoji { font-size: 3.5rem; line-height: 1; margin-bottom: var(--space-md); display: block; }
.sort-plant-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--primary-800);
  margin-bottom: 4px;
}
.sort-plant-sci {
  color: var(--neutral-500);
  font-size: 0.9rem;
  display: block;
  margin-bottom: var(--space-lg);
}
.sort-plant-clues {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  text-align: left;
  max-width: 480px;
  margin: 0 auto;
}
.sort-clue {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--neutral-50);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  padding: 8px 14px;
  font-size: 0.92rem;
  color: var(--neutral-700);
}
.sort-bins {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
@media (max-width: 480px) {
  .sort-bins { grid-template-columns: 1fr 1fr; gap: var(--space-sm); }
}
.sort-bin-btn {
  background: #fff;
  border: 2px solid var(--neutral-200);
  border-radius: var(--radius-xl);
  padding: var(--space-lg) var(--space-md);
  cursor: pointer;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--neutral-700);
  transition: all var(--transition-fast);
  line-height: 1.4;
}
.sort-bin-btn:hover:not(:disabled) {
  border-color: var(--primary-400);
  background: var(--primary-50);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.sort-bin-btn:disabled { cursor: default; }
.sort-bin-btn.sort-correct {
  border-color: var(--success);
  background: #f0fdf4;
  color: #166534;
}
.sort-bin-btn.sort-wrong {
  border-color: var(--error);
  background: #fff1f2;
  color: #9f1239;
}

/* ── Crossword ── */
.cw-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-2xl);
  align-items: start;
  margin-bottom: var(--space-xl);
}
@media (max-width: 640px) {
  .cw-layout { grid-template-columns: 1fr; }
}
.cw-grid {
  display: grid;
  grid-template-columns: repeat(6, 52px);
  grid-template-rows: repeat(5, 52px);
  gap: 3px;
}
@media (max-width: 440px) {
  .cw-grid {
    grid-template-columns: repeat(6, 42px);
    grid-template-rows: repeat(5, 42px);
  }
}
.cw-cell-wrap {
  position: relative;
  width: 52px; height: 52px;
}
@media (max-width: 440px) {
  .cw-cell-wrap { width: 42px; height: 42px; }
}
.cw-cell {
  width: 100%; height: 100%;
  border: 2px solid var(--neutral-300);
  border-radius: 6px;
  background: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  color: var(--neutral-800);
  text-transform: uppercase;
  caret-color: var(--primary-600);
  transition: border-color 0.15s, background 0.15s;
  outline: none;
  padding: 0;
}
.cw-cell:focus { border-color: var(--primary-500); background: var(--primary-50); }
.cw-cell.cw-correct { border-color: var(--success) !important; background: #f0fdf4 !important; color: #166534 !important; }
.cw-cell.cw-wrong   { border-color: var(--error)   !important; background: #fff1f2 !important; color: #9f1239  !important; }
.cw-black {
  background: var(--neutral-800);
  border-color: var(--neutral-800);
  border-radius: 6px;
}
.cw-num {
  position: absolute;
  top: 2px; left: 4px;
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--primary-700);
  line-height: 1;
  z-index: 2;
  pointer-events: none;
}
.cw-clues { min-width: 220px; }
.cw-clue-section { margin-bottom: var(--space-xl); }
.cw-clue-heading {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-600);
  margin-bottom: var(--space-sm);
  padding-bottom: 4px;
  border-bottom: 2px solid var(--primary-200);
}
.cw-clue-item {
  display: flex;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--neutral-700);
  padding: 5px 0;
  border-bottom: 1px solid var(--neutral-100);
  line-height: 1.4;
}
.cw-clue-item:last-child { border-bottom: none; }
.cw-clue-num {
  font-weight: 700;
  color: var(--primary-600);
  min-width: 22px;
  flex-shrink: 0;
}

/* ── Spot the Mistake ── */
.mistake-card {
  background: #fff;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2xl);
  margin-bottom: var(--space-xl);
}
.mistake-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 2px solid var(--neutral-100);
}
.mistake-stmt {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--neutral-50);
  border: 2px solid var(--neutral-200);
  border-radius: var(--radius-xl);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-md);
  cursor: pointer;
  font-size: 0.97rem;
  color: var(--neutral-700);
  line-height: 1.5;
  transition: all var(--transition-fast);
  user-select: none;
}
.mistake-stmt:hover { border-color: var(--primary-400); background: var(--primary-50); }
.mistake-dot {
  font-size: 1.1rem;
  flex-shrink: 0;
  color: var(--neutral-400);
  margin-top: 2px;
  line-height: 1;
  width: 20px;
  text-align: center;
}
.mistake-stmt.mistake-found {
  border-color: var(--success);
  background: #f0fdf4;
  color: #166534;
  cursor: default;
  pointer-events: none;
}
.mistake-stmt.mistake-found .mistake-dot { color: var(--success); }
.mistake-stmt.mistake-wrong {
  border-color: var(--error);
  background: #fff1f2;
  animation: mistake-shake 0.4s ease;
}
@keyframes mistake-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  60%       { transform: translateX(6px); }
  80%       { transform: translateX(-3px); }
}
.mistake-fix {
  margin-top: var(--space-sm);
  font-size: 0.85rem;
  color: #166534;
  background: #dcfce7;
  border-radius: var(--radius-md);
  padding: 6px 10px;
  font-style: italic;
}

/* ── Anagram ── */
.anagram-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
  margin: var(--space-xl) 0;
  min-height: 64px;
  align-items: center;
}
.anagram-tile {
  width: 52px; height: 60px;
  background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 0 rgba(0,0,0,0.2);
  letter-spacing: 0;
  transition: transform 0.2s;
}
@media (max-width: 480px) {
  .anagram-tile { width: 40px; height: 48px; font-size: 1.3rem; }
}
.anagram-tile.anagram-tile-correct {
  background: linear-gradient(135deg, var(--success), #15803d);
}
.anagram-input-wrap { text-align: center; }
.anagram-input {
  width: 100%;
  max-width: 320px;
  padding: 14px 20px;
  font-size: 1.3rem;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 2px solid var(--neutral-300);
  border-radius: var(--radius-xl);
  background: #fff;
  color: var(--neutral-800);
  outline: none;
  transition: border-color var(--transition-fast);
}
.anagram-input:focus { border-color: var(--primary-500); box-shadow: 0 0 0 3px var(--primary-100); }
.anagram-input.correct { border-color: var(--success); background: #f0fdf4; }
.anagram-input.wrong   { border-color: var(--error); background: #fff1f2; }

/* ── Extra banner colour variants for game cards ── */
.games-card-banner.search   { background: linear-gradient(90deg, #a855f7, #7c3aed); }
.games-card-banner.tf       { background: linear-gradient(90deg, #fbbf24, #d97706); }
.games-card-banner.sort     { background: linear-gradient(90deg, #34d399, #059669); }
.games-card-banner.crossword{ background: linear-gradient(90deg, #818cf8, #4338ca); }
.games-card-banner.mistake  { background: linear-gradient(90deg, #f87171, #dc2626); }
.games-card-banner.anagram  { background: linear-gradient(90deg, #f472b6, #be185d); }
.games-card-cta.purple  { background: #7c3aed; } .games-card-cta.purple:hover  { background: #6d28d9; }
.games-card-cta.amber   { background: #d97706; } .games-card-cta.amber:hover   { background: #b45309; }
.games-card-cta.teal    { background: #059669; } .games-card-cta.teal:hover    { background: #047857; }
.games-card-cta.indigo  { background: #4338ca; } .games-card-cta.indigo:hover  { background: #3730a3; }
.games-card-cta.red     { background: #dc2626; } .games-card-cta.red:hover     { background: #b91c1c; }
.games-card-cta.pink    { background: #be185d; } .games-card-cta.pink:hover    { background: #9d174d; }
.games-badge.purple { background: #f5f3ff; color: #6d28d9; }
.games-badge.amber  { background: #fffbeb; color: #b45309; }
.games-badge.teal   { background: #f0fdfa; color: #047857; }
.games-badge.indigo { background: #eef2ff; color: #3730a3; }
.games-badge.red    { background: #fef2f2; color: #b91c1c; }
.games-badge.pink   { background: #fdf2f8; color: #9d174d; }

/* ── Leaderboard ── */
.lb-section {
  border-top: 2px solid var(--neutral-100);
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
}
.lb-board { margin-bottom: var(--space-lg); }
.lb-board-heading {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--primary-800);
  margin-bottom: var(--space-md);
  text-align: center;
}
.lb-save-form {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}
.lb-name-input {
  flex: 1;
  min-width: 180px;
  max-width: 260px;
  padding: 10px 18px;
  border: 2px solid var(--neutral-300);
  border-radius: 50px;
  font-size: 0.97rem;
  outline: none;
  transition: border-color var(--transition-fast);
  color: var(--neutral-800);
  background: #fff;
}
.lb-name-input:focus { border-color: var(--primary-500); }
.lb-submit-btn {
  background: var(--primary-600);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 10px 26px;
  font-weight: 600;
  font-size: 0.97rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition-fast);
}
.lb-submit-btn:hover { background: var(--primary-700); }
.lb-submit-btn:disabled { opacity: 0.6; cursor: default; }
.lb-saved {
  text-align: center;
  color: #166534;
  font-weight: 600;
  margin-bottom: var(--space-md);
  padding: 8px 16px;
  background: #f0fdf4;
  border-radius: var(--radius-lg);
}
.lb-error {
  width: 100%;
  text-align: center;
  color: var(--error);
  font-size: 0.88rem;
  margin-top: 4px;
}
.lb-rows {
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  scrollbar-width: thin;
  scrollbar-color: var(--primary-300) transparent;
}
.lb-table { width: 100%; }
.lb-row {
  display: grid;
  grid-template-columns: 56px 1fr 84px 76px;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 14px;
  border-bottom: 1px solid var(--neutral-100);
  font-size: 0.875rem;
}
.lb-row:last-child { border-bottom: none; }
.lb-header {
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--neutral-500);
  background: var(--neutral-50);
  position: sticky;
  top: 0;
  z-index: 1;
}
.lb-row.lb-mine {
  background: var(--primary-50);
  font-weight: 600;
  color: var(--primary-800);
  border-left: 3px solid var(--primary-500);
}
.lb-rank { font-weight: 700; color: var(--neutral-500); }
.lb-row.lb-top3 .lb-rank { font-size: 1.1rem; }
.lb-row.lb-mine .lb-rank { color: var(--primary-600); }
.lb-score { text-align: right; font-weight: 600; color: var(--primary-700); }
.lb-date  { text-align: right; color: var(--neutral-400); font-size: 0.78rem; }
.lb-empty {
  text-align: center;
  color: var(--neutral-400);
  padding: var(--space-xl);
  font-style: italic;
  font-size: 0.9rem;
}

/* ── Social sharing ── */
.share-section {
  text-align: center;
  border-top: 1px solid var(--neutral-100);
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
}
.share-heading {
  font-weight: 700;
  color: var(--neutral-700);
  font-size: 0.9rem;
  margin-bottom: var(--space-md);
}
.share-btns {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  border: none;
  color: #fff;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}
.share-btn:hover { opacity: 0.88; transform: scale(1.04); }
.share-twitter  { background: #000; }
.share-facebook { background: #1877f2; }
.share-whatsapp { background: #25d366; }
.share-copy     { background: var(--neutral-600); }

/* ── Dark mode overrides ── */
@media (prefers-color-scheme: dark) {
  .games-card,
  .quiz-card,
  .match-container,
  .game-result {
    background: var(--neutral-800);
    border-color: var(--neutral-700);
  }
  .games-hero { background: linear-gradient(135deg, #052e12 0%, #0f1a0f 100%); }
  .games-hero h1, .game-page-header h1 { color: var(--primary-200); }
  .games-hero p, .game-page-header p { color: var(--neutral-400); }
  .games-card h2, .quiz-card h2 { color: var(--primary-200); }
  .quiz-question-text { color: var(--neutral-200); }
  .quiz-option {
    background: var(--neutral-700);
    border-color: var(--neutral-600);
    color: var(--neutral-200);
  }
  .quiz-option:hover:not(:disabled) {
    background: #14532d;
    border-color: var(--primary-500);
  }
  .quiz-option .opt-letter { background: var(--neutral-600); color: var(--neutral-300); }
  .game-stat { background: var(--neutral-800); border-color: var(--neutral-700); }
  .match-card-front {
    background: var(--neutral-700);
    border-color: var(--neutral-600);
    color: var(--neutral-200);
  }
  .match-container { background: var(--neutral-900); }
  .guess-clue-item, .guess-option {
    background: var(--neutral-800);
    border-color: var(--neutral-700);
  }
  .guess-option:hover:not(:disabled) { background: #14532d; border-color: var(--primary-500); }
  .guess-clue-value { color: var(--neutral-300); }
  .game-result h2 { color: var(--primary-200); }
  .match-start-overlay { background: rgba(30,30,30,0.97); }
  .match-start-overlay h2 { color: var(--primary-200); }
}
