/* Memory (기억력 짝 맞추기) — card grid only.
   The page shell, buttons, difficulty screen, overlay and switcher come from
   css/game.css, which is linked first. Shared by all 8 languages. */

.container {
  max-width: 520px;
}

/* Game screen */
.status-bar {
  font-weight: bold;
  color: var(--text-mid);
}

.moves-label {
  color: var(--accent);
}

.board-wrap {
  max-width: 460px;
}

/* Column count is set inline by script.js (gridTemplateColumns). */
.memory-board {
  display: grid;
  gap: 8px;
  width: 100%;
}

.card {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  border: none;
  border-radius: var(--radius-btn-sm);
  background: var(--accent);
  color: transparent;
  font-size: clamp(1.3rem, 9vw, 2.2rem);
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, transform 0.12s ease;
}

/* 6-column boards (normal/hard) get smaller cards, so shrink the glyph. */
.memory-board.cols-6 .card {
  font-size: clamp(1rem, 6vw, 1.8rem);
  border-radius: 10px;
}

/* Face-down back: a "?" mark drawn with ::before so the emoji can stay in the
   button's text content, revealed by toggling the .show class. */
.card::before {
  content: "?";
  color: #ffffff;
  font-weight: 700;
  font-size: 1.1rem;
}

.card:hover {
  background: var(--accent-hover);
}

.card.show {
  background: #ffffff;
  border: 2px solid var(--accent-tint-strong);
  color: var(--text);
  cursor: default;
}

.card.show::before {
  content: none;
}

.card.matched {
  background: #fff7e0;
  border: 2px solid #ffb300;
  cursor: default;
  transform: scale(0.94);
}

.card:disabled {
  cursor: default;
}

/* Phone portrait: tighten spacing so the board fits without page scroll. */
@media (max-width: 560px) {
  body { padding: 12px; }
  .container { padding: 18px 14px; }
  h1 { font-size: 1.5rem; margin: 0 0 12px; }
  .status-bar { margin-bottom: 10px; }
  .memory-board { gap: 6px; }
  .game-actions { margin-top: 10px; gap: 6px; }
  .btn-secondary { padding: 9px 14px; min-height: 40px; }
}
