/* ═══════════════════════════════════
   Memory Game — game.css v1.0
   ═══════════════════════════════════ */

#memg-wrapper * { box-sizing: border-box; }

/* ── Wrapper ── */
#memg-wrapper {
  font-family: 'Segoe UI', Arial, sans-serif;
  max-width: 480px;
  margin: 40px auto;
  background: #fff;
  border-radius: 24px;
  padding: 28px 24px 24px;
  box-shadow: 0 8px 40px rgba(106,27,154,.13);
  user-select: none;
}

#memg-wrapper h1 {
  font-size: 24px;
  text-align: center;
  color: #6a1b9a;
  margin: 0 0 20px;
  letter-spacing: -.3px;
}

/* ── Setup card ── */
#memg-setup {
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  border-radius: 16px;
  padding: 18px 16px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#memg-setup label {
  font-size: 11px;
  font-weight: 700;
  color: #7c3aed;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 4px;
  display: block;
}

#memg-setup input,
#memg-setup select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1.5px solid #ddd6fe;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: #3b0764;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
  appearance: none;
}

#memg-setup input:focus,
#memg-setup select:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124,58,237,.1);
}

#memg-setup input.memg-error,
#memg-setup select.memg-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}

.memg-setup-row {
  display: flex;
  gap: 10px;
}
.memg-setup-row > div { flex: 1; }

/* ── Status bar ── */
#memg-status-bar {
  display: flex;
  justify-content: space-around;
  background: #faf5ff;
  border-radius: 14px;
  padding: 12px 10px;
  margin-bottom: 14px;
}

.memg-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.memg-stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #a78bfa;
}

.memg-stat span:last-child {
  font-size: 20px;
  font-weight: 800;
  color: #6a1b9a;
}

/* ── Start button ── */
#memg-start-button {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #7c3aed, #6a1b9a);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .3px;
  transition: opacity .2s, transform .15s;
  box-shadow: 0 4px 16px rgba(106,27,154,.25);
  font-family: inherit;
  margin-bottom: 14px;
}

#memg-start-button:hover:not(:disabled) {
  opacity: .92;
  transform: translateY(-1px);
}

#memg-start-button:disabled {
  opacity: .5;
  cursor: default;
  transform: none;
}

/* ── Info message ── */
#memg-info {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #6a1b9a;
  min-height: 22px;
  margin-bottom: 14px;
}

/* ── Game board ── */
#memg-board {
  display: grid;
  gap: 10px;
  justify-content: center;
  margin-bottom: 6px;
}

/* ── Cards ── */
.memg-card {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  cursor: pointer;
  position: relative;
  transform-style: preserve-3d;
  transition: transform .4s ease;
}

.memg-card.flipped,
.memg-card.matched {
  transform: rotateY(180deg);
}

.memg-card.matched .memg-card-front {
  box-shadow: 0 0 0 3px #a78bfa, 0 4px 16px rgba(124,58,237,.3);
}

/* Card faces */
.memg-card-back,
.memg-card-front {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.memg-card-back {
  background: linear-gradient(135deg, #9d4edd, #6a1b9a);
  font-size: 26px;
  color: rgba(255,255,255,.35);
}

.memg-card-front {
  background: #faf5ff;
  border: 2px solid #e9d5ff;
  font-size: 38px;
  transform: rotateY(180deg);
}

/* ── Match burst animation ── */
@keyframes memg-match-burst {
  0%   { box-shadow: 0 0 0 0 rgba(167,139,250,.6); }
  60%  { box-shadow: 0 0 0 14px rgba(167,139,250,0); }
  100% { box-shadow: 0 0 0 0 rgba(167,139,250,0); }
}

.memg-card.matched .memg-card-front {
  animation: memg-match-burst .5s ease forwards;
}

/* ── Wrong card shake ── */
@keyframes memg-shake {
  0%,100% { transform: rotateY(180deg) translateX(0); }
  25%      { transform: rotateY(180deg) translateX(-6px); }
  75%      { transform: rotateY(180deg) translateX(6px); }
}

.memg-card.wrong {
  animation: memg-shake .35s ease;
}

/* ── Divider ── */
.memg-divider {
  border: none;
  border-top: 1px solid #f0e6ff;
  margin: 22px 0;
}

/* ── Leaderboard ── */
#memg-high-scores h3 {
  text-align: center;
  color: #6a1b9a;
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 4px;
}

#memg-lb-subtitle {
  font-size: 11px;
  font-weight: 400;
  color: #a78bfa;
}

#memg-score-filter,
#memg-diff-filter {
  display: flex;
  background: #faf5ff;
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  margin: 10px 0 0;
}

#memg-score-filter button,
#memg-diff-filter button {
  flex: 1;
  padding: 7px 0;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: #7c3aed;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  transition: background .2s, color .2s;
  font-family: inherit;
}

#memg-score-filter button.active,
#memg-diff-filter button.active {
  background: #7c3aed;
  color: #fff;
  box-shadow: 0 2px 8px rgba(124,58,237,.2);
}

#memg-score-list {
  list-style: none;
  padding: 0;
  padding-right: 6px;
  margin: 10px 0 0;
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #e9d5ff #faf5ff;
  -ms-overflow-style: auto;
}

#memg-score-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  margin-bottom: 5px;
  border-radius: 10px;
  background: #faf5ff;
  border: 1px solid #f0e6ff;
}

#memg-score-list li:first-child  { border-color: #fbbf24; background: #fffbeb; }
#memg-score-list li:nth-child(2) { border-color: #9ca3af; background: #f9fafb; }
#memg-score-list li:nth-child(3) { border-color: #cd7c2f; background: #fff7ed; }

#memg-score-list li.memg-loading {
  justify-content: center;
  color: #aaa;
  background: transparent;
  border: none;
}

.memg-score-left  { display: flex; align-items: center; gap: 8px; }
.memg-score-right { display: flex; align-items: center; gap: 6px; }

.memg-rank { font-size: 14px; font-weight: 700; color: #6b7280; min-width: 24px; }
#memg-score-list li:first-child  .memg-rank { color: #d97706; }
#memg-score-list li:nth-child(2) .memg-rank { color: #6b7280; }
#memg-score-list li:nth-child(3) .memg-rank { color: #cd7c2f; }

.memg-score-name    { font-weight: 600; color: #3b0764; font-size: 14px; }
.memg-score-country { font-size: 11px; color: #9ca3af; }

.memg-diff-badge {
  font-size: 11px;
  color: #a78bfa;
  font-weight: 600;
  text-transform: capitalize;
}

.memg-moves-badge {
  background: linear-gradient(135deg, #7c3aed, #6a1b9a);
  color: #fff;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
}

.memg-time-badge {
  font-size: 11px;
  color: #6b7280;
}

/* ── Confetti ── */
#memg-confetti {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* ── Win overlay ── */
#memg-win-overlay {
  text-align: center;
  padding: 20px 16px;
  background: linear-gradient(135deg, #faf5ff, #ede9fe);
  border-radius: 16px;
  border: 2px solid #c4b5fd;
  margin-bottom: 14px;
  display: none;
}

#memg-win-overlay h2 {
  color: #6a1b9a;
  font-size: 22px;
  margin: 0 0 6px;
}

#memg-win-overlay p {
  color: #4a148c;
  margin: 4px 0;
  font-size: 15px;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  #memg-wrapper { padding: 18px 12px; }
  .memg-card { width: 60px; height: 60px; }
  .memg-card-front { font-size: 30px; }
  .memg-setup-row { flex-direction: column; }
}

#mg-score-list::-webkit-scrollbar,
#memg-score-list::-webkit-scrollbar { display: none; }

/* ── GeneratePress spacing fix ── */
.inside-article,
.entry-content,
.page-content {
  padding: 0 !important;
  margin: 0 !important;
}
.site-main,
#primary {
  padding-top: 0 !important;
  margin-top: 0 !important;
}
