.game-container { max-width: 1200px; margin: 24px auto; padding: 0 20px; }

body { text-transform: uppercase; }

.hidden { display: none !important; }

.level-buttons {
  display: flex;
  gap: 16px;
  margin: 20px 0;
}

.btn-level {
  flex: 1;
  padding: 20px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  cursor: pointer;
  transition: all 120ms ease;
  text-align: center;
}

.btn-level:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.level-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
}

.level-desc {
  font-size: 14px;
  opacity: 0.9;
}

.game-board { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); 
  gap: 12px; 
  margin: 20px 0;
}

.memory-card { 
  position: relative;
  height: 180px;
  cursor: pointer;
  perspective: 1000px;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.4s;
  transform-style: preserve-3d;
}

.memory-card.flipped .card-inner { transform: rotateY(180deg); }
.memory-card.matched { opacity: 0.5; pointer-events: none; }

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.card-back {
  background: linear-gradient(135deg, #475569 0%, #334155 100%);
  border: 2px solid #1e293b;
}

.card-front {
  transform: rotateY(180deg);
}

.card-front.hint,
.card-front.name {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-align: center;
  font-size: 14px;
  line-height: 1.4;
  padding: 16px;
}

.card-front.image {
  background: #ffffff;
  border: 2px solid #d1d5db;
}

.card-front.image svg { max-width: 100px; max-height: 100px; }

.feedback { margin-top: 10px; font-weight: 700; text-align: center; min-height: 24px; }
.ok { color: #16a34a; }
.bad { color: #dc2626; }

.row-actions { 
  display: flex; 
  justify-content: space-between; 
  margin-top: 16px; 
  gap: 12px;
}
.btn-next { 
  padding: 12px 16px; 
  border-radius: 999px; 
  background: linear-gradient(180deg, #22c55e, #16a34a); 
  color: #052e16; 
  font-weight: 800; 
  border: none; 
  box-shadow: 0 10px 20px rgba(34,197,94,0.35); 
  cursor: pointer;
}
.btn-back { 
  padding: 12px 16px; 
  border-radius: 999px; 
  background: linear-gradient(180deg, #6b7280, #4b5563); 
  color: white; 
  font-weight: 800; 
  border: none; 
  box-shadow: 0 10px 20px rgba(107,114,128,0.35); 
  cursor: pointer;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(34,197,94,0.15);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.overlay.show { display: flex; animation: pop 300ms ease-out; }
.overlay .burst { font-size: 72px; background: #22c55e; color: white; padding: 20px 28px; border-radius: 16px; box-shadow: 0 20px 60px rgba(34,197,94,0.4); }

.rotate-overlay { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; text-align: center; padding: 24px; background: #0f172a; color: #fff; z-index: 60; }
.rotate-overlay .card { background: #111827; border: 1px solid rgba(255,255,255,0.12); padding: 16px 20px; border-radius: 14px; }
@media (orientation: portrait) and (max-width: 900px) {
  .rotate-overlay { display: flex; }
}

@keyframes pop {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

