/* style.css - estética coherente con tu web */
:root{
  --primary:#0d6efd;
  --card-bg: #ffffff;
  --accent: #ffd166;
  --muted: #6c757d;
  --shadow: 0 12px 30px rgba(0,0,0,0.12);
  --radius: 12px;
  --font-main: "Fredoka One", "Comic Neue", sans-serif;
}

/* Base */
body{
  font-family: "Comic Neue", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: linear-gradient(135deg,#f6f8ff 0%, rgba(255,241,166,0.1) 100%);
  margin:0;
  color:#222;
}

/* Header */
.school-header{
  background: linear-gradient(90deg, rgba(13,110,253,0.95), rgba(0,123,255,0.85));
}

/* Stats */
.stat{
  font-weight:700;
  background: rgba(255,255,255,0.9);
  padding:10px 14px;
  border-radius:10px;
  display:inline-block;
  box-shadow: var(--shadow);
}

/* Game area */
.game-area{
  background: rgba(255,255,255,0.9);
  padding:18px;
  border-radius:14px;
  box-shadow: var(--shadow);
}

/* Board grid */
.board {
  display: grid;
  gap: 10px;
  justify-content: center;
  width: 100%;
}


/* responsive grid columns depending on card count */
.board.cols-6  { grid-template-columns: repeat(6, 1fr); }
.board.cols-8  { grid-template-columns: repeat(8, 1fr); }
.board.cols-10 { grid-template-columns: repeat(10, 1fr); }


/* Card */
.card-memory{
  width: 120px;
  height: 160px;
  perspective: 1200px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* inner flipping element */
.card-inner{
  position: relative;
  width:100%;
  height:100%;
  transform-style: preserve-3d;
  transition: transform 400ms cubic-bezier(.2,.9,.2,1);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

/* flipped */
.card-memory.flipped .card-inner{
  transform: rotateY(180deg);
}

/* front and back faces */
.card-face{
  position:absolute;
  width:100%;
  height:100%;
  backface-visibility: hidden;
  border-radius: 10px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:8px;
  box-sizing: border-box;
}

/* back (visible when face-down) */
.card-back{
  background: linear-gradient(135deg,#a8e6ff,#d4f1ff);
  color:#123;
  font-weight:700;
  font-size:1.1rem;
}

/* front (revealed face) */
.card-front{
  background: var(--card-bg);
  transform: rotateY(180deg);
  border: 2px solid #eee;
  font-weight:700;
  text-align:center;
  padding:10px;
  line-height:1.2;
  font-size: 1.05rem;
}

/* styling for small labels (type+accent) */
.label-compact{
  font-size:0.85rem;
  color:#333;
}

/* when matched: shrink and fade a bit */
.card-memory.matched{
  transform: scale(0.85);
  opacity: 0.75;
  pointer-events: none;
  transition: all 300ms ease;
}

/* placed mini inside category: not used here but keep for consistency */
.mini {
  width: 60px;
  height: 60px;
  object-fit: contain;
  display:block;
  margin:6px auto 0;
}
.card-back .back-content {
  width: 100%;
  height:100%;
  background-image: url("../../assets/img/cartaMemory.png"); /* <-- tu imagen */
  background-size: cover;
  background-position: center;
  border-radius: 8px; /* igual que tus cartas */
}


/* hover / touch */
.card-memory:active .card-inner { transform: scale(0.99); }

/* small screens: reduce card size */
@media (max-width: 600px){
  .card-memory{ width: 88px; height:120px; }
  .board.cols-4 { grid-template-columns: repeat(4, minmax(70px, 88px)); }
  .board.cols-3 { grid-template-columns: repeat(3, minmax(70px, 88px)); }
  .card-front { font-size:0.95rem; }
}

/* Utility */
.center {
  display:flex;
  align-items:center;
  justify-content:center;
}

/* show all reveal button effect */
.showing .card-memory:not(.matched) .card-inner {
  transform: rotateY(180deg) !important;
}
