@media (max-width: 600px) {
  .game-layout {
    flex-direction: column !important;
    gap: 10px !important;
  }
  .left-panel, .right-panel, .game-board, .panel-card, .game-info {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }
  .panel-card h2 {
    font-size: 18px !important;
  }
  .panel-card h3 {
    font-size: 14px !important;
  }
  .game-board {
    width: 220px !important;
    height: 220px !important;
    gap: 2px !important;
    padding: 4px !important;
  }
  .game-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 40px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin: 0;
    margin-bottom: 20px;
    gap: 30px;
    width: 100%;
    flex-wrap: wrap;
  }
  .control-group, .stats {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
}
/* Memory Match Styles - panels aligned with Vegetable Blast */
.game-layout { display: flex; gap: 20px; align-items: flex-start; }
.left-panel { width: 280px; display: flex; flex-direction: column; gap: 15px; }
.panel-card { background: white; padding: 20px; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.panel-card h2 { color: #667eea; font-size: 24px; margin: 0 0 10px; text-align: center; }
.panel-card h3 { color: #667eea; font-size: 18px; margin: 0 0 15px; }
.game-description { text-align: center; color: #666; font-size: 14px; margin: 0; }
.instructions-list { list-style: none; padding: 0; margin: 0; }
.instructions-list li { padding: 10px; margin-bottom: 8px; background: linear-gradient(135deg,#f8f9fa,#e9ecef); border-radius: 8px; font-size: 14px; border-left: 4px solid #667eea; }
.middle-panel { flex: 1; background: white; padding: 20px; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; min-height: 600px; }
.right-panel { width: 220px; display: flex; flex-direction: column; gap: 15px; }
.ad-container { background: white; padding: 15px; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); height: 150px; }
.ad-placeholder { width: 100%; height: 100%; background: linear-gradient(135deg,#667eea,#764ba2); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; font-size: 14px; }
.game-board-container { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; width: 100%; }
.hint-bar { margin-top: 12px; display: flex; align-items: center; gap: 10px; }
.hint-text { color: #444; }

.memory-board {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 680px;
  padding: 22px;
  border-radius: 26px;
  background: radial-gradient(1200px 800px at 10% 10%, #7aa2ff 0%, #667eea 35%, #5a54b0 100%);
  box-shadow: 0 18px 46px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.25), inset 0 -6px 18px rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.15);
}

.card {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  transform-style: preserve-3d;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
  cursor: pointer;
}
.card:hover { transform: translateY(-4px) scale(1.02); }
.card.flipped { transform: rotateY(180deg); }
.card.matched { filter: saturate(115%); box-shadow: 0 12px 28px rgba(40,223,153,0.45); }

.face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: 16px;
}
.front {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg,#fff5e1,#ffe8c4);
  border: 3px solid #ffb700;
  font-size: 42px;
}
.back {
  transform: rotateY(180deg);
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg,#667eea,#764ba2);
  color: white; font-size: 28px; font-weight: 800; letter-spacing: 0.5px;
}

@media (max-width: 900px) {
  .game-layout { flex-direction: column; }
  .left-panel, .right-panel { width: 100%; }
  .middle-panel { min-height: 520px; }
}