:root {
  color-scheme: light;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #f4f6fb;
  color: #111827;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.619), rgba(255, 255, 255, 0.92)),
    url("img/fondo.png") center / cover no-repeat fixed;
  transition: background 300ms ease;
}

body.match {
  background:
    linear-gradient(180deg, rgba(72, 255, 0, 0.619), rgba(255, 255, 255, 0.92)),
    url("img/fondo.png") center / cover no-repeat fixed;
}

body.error {
  background:
    linear-gradient(180deg, rgba(255, 0, 0, 0.619), rgba(255, 255, 255, 0.92)),
    url("img/fondo.png") center / cover no-repeat fixed;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.title h1 {
  margin: 0 0 4px;
  font-size: 28px;
}

.title p {
  margin: 0;
  color: #4b5563;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

button {
  border: none;
  background: #2563eb;
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

button:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

.stats {
  display: flex;
  gap: 12px;
  color: #111827;
  font-weight: 600;
}

.board {
  flex: 1;
  justify-content: center;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  perspective: 1000px;
}

.card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  border-radius: 14px;
  transform-style: preserve-3d;
  transition: transform 240ms ease;
}

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

.card.locked {
  cursor: default;
}

.card.match {
  background-color: rgba(34, 197, 94, 0.3);
  transition: background-color 200ms ease;
}

.card.error {
  background-color: rgba(239, 68, 68, 0.3);
  transition: background-color 200ms ease;
}

.face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  backface-visibility: hidden;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.front {
  background: url("img/bandera.png") center / cover no-repeat;
  border: 2px solid #c7d2fe;
  font-weight: 700;
  color: #1e3a8a;
  font-size: 20px;
}

.back {
  transform: rotateY(180deg);
  background: #fff;
}

.back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.curiosidades {
  margin-top: 24px;
  background: rgba(189, 238, 255, 0.72);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(6px);
}

.curiosidades h2 {
  margin: 0 0 4px;
}

.curiosidades__hint {
  margin: 0 0 12px;
  color: #4b5563;
}

.curiosidades-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  font-size: 1.7rem;
}

.curio-card {
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.curio-card strong {
  display: inline-block;
  margin-bottom: 6px;
  color: #1d4ed8;
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
}

.overlay.hidden {
  display: none;
}

.overlay__card {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.overlay__card h3 {
  margin: 0 0 16px;
  font-size: 28px;
  color: #1d4ed8;
}

.overlay__card p {
  margin: 0 0 24px;
  font-size: 18px;
  color: #4b5563;
}

.overlay__card button {
  width: 100%;
  font-size: 16px;
}

@media (max-width: 600px) {
  .app {
    padding: 16px;
  }

  .stats {
    width: 100%;
    justify-content: space-between;
  }

  .overlay__card {
    padding: 24px;
    margin: 16px;
  }
}

