.games-container { max-width: 760px; margin: 0 auto; padding: 20px; }

/* The admin app's styles.css sets html,body{overflow:hidden} for the SPA layout.
   The games page is a normal scrolling page, so re-enable overflow here. */
body:has(.games-container),
html:has(.games-container) {
  overflow: visible !important;
  height: auto !important;
}

.games-header { text-align: center; margin-bottom: 24px; }
.games-logo { height: 60px; margin-bottom: 8px; }
.games-save-status { font-size: 12px; min-height: 18px; margin: 4px 0 0; }
.games-save-status.ok { color: var(--green, #3f8a5c); }
.games-save-status.saving { color: var(--navy-light, #338866); }
.games-save-status.err { color: var(--red, #d32f2f); }
.games-save-status.muted { color: var(--muted, #888); }

.games-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.game-card {
  border: 1px solid var(--border, #ddd);
  border-radius: 12px;
  padding: 20px;
  background: var(--panel-bg, #fff);
  cursor: pointer;
  text-align: center;
  transition: transform .15s ease, box-shadow .15s ease;
}
.game-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.game-icon { font-size: 36px; display: block; margin-bottom: 8px; }
.game-card h3 { margin: 0 0 6px; }
.game-card p { margin: 0; font-size: 13px; color: #666; }

.game-area { border: 1px solid var(--border, #ddd); border-radius: 12px; overflow: hidden; }
.game-topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: var(--accent-bg, #f0f6ff); border-bottom: 1px solid var(--border, #ddd);
}
.game-topbar h3 { margin: 0; }
.game-score { font-weight: 600; }
.game-body { padding: 24px; text-align: center; }
.game-question { font-size: 22px; font-weight: 600; margin-bottom: 20px; }
.game-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 460px; margin: 0 auto 16px; }
.game-option {
  padding: 12px; border: 1px solid var(--border, #ddd); border-radius: 8px;
  background: #fff; cursor: pointer; font-size: 16px; transition: background .15s;
}
.game-option:hover { background: var(--accent-bg, #e7f3ef); }
.game-option.correct { background: #d4edda; border-color: #28a745; }
.game-option.wrong { background: #f8d7da; border-color: #dc3545; }
.game-option:disabled { cursor: default; }
.game-feedback { min-height: 24px; margin-bottom: 12px; font-weight: 500; }
.game-done h2 { margin: 0 0 16px; }
.game-done { padding: 24px 0; }

.memory-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 420px; margin: 0 auto; }
.memory-card {
  aspect-ratio: 1; border: 1px solid var(--border, #ddd); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  background: linear-gradient(135deg, #226655, #1a4a3f); cursor: pointer;
  color: transparent; user-select: none; transition: transform .2s ease;
}
.memory-card.flipped, .memory-card.matched { background: #fff; color: inherit; }
.memory-card.matched { background: #d4edda; border-color: #28a745; cursor: default; }
.memory-card.matched span { visibility: hidden; }
@media (max-width: 480px) {
  .game-options { grid-template-columns: 1fr; }
}