/* =========================
   RESET
========================= */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

/* =========================
   BACKGROUND FULLSCREEN
========================= */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("../images/background.jpeg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -1;
}

/* =========================
   HUD — ALTURA MÍNIMA
========================= */
#hud {
  position: fixed;
  top: 10px;
  left: 10px;
  padding: 8px 10px; /* 🔥 mínimo */
  background: rgba(0, 40, 90, 0.8);
  border-radius: 10px;
  color: #fff;
  font-size: 0.75rem;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(5px);
  z-index: 10;
}

#hud h2 {
  margin: 0 0 4px;
  font-size: 0.8rem;
  color: #ffd700;
  text-align: center;
}

#hud table {
  width: 100%;
  border-collapse: collapse;
}

#hud th,
#hud td {
  padding: 2px 4px; /* 🔥 super compacto */
  text-align: center;
  font-weight: 600;
}

#hud th {
  font-size: 0.65rem;
  color: #7fd8ff;
}

#result {
  margin-top: 4px;
  font-size: 0.65rem;
  text-align: center;
}

/* =========================
   BOARD — GRID ULTRA JUSTO
========================= */
.board {
  display: grid;
  grid-template-columns: repeat(6, 1fr); /* 6 por linha */
  gap: 4px; /* 🔥 mínimo afastamento */
  width: 65%;
  min-height: 100vh;
  margin-left: auto;
  padding: 10px; /* 🔥 reduzido */
}

/* =========================
   CARTAS — BAIXAS
========================= */
.classImage {
  width: 100%;
  aspect-ratio: 1 / 1; /* 🔥 quadradas e compactas */
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.classImage:hover {
  transform: scale(1.04);
}

/* =========================
   TABLET
========================= */
@media (max-width: 1024px) {
  .board {
    grid-template-columns: repeat(4, 1fr);
    width: 90%;
    margin: 90px auto 0;
    gap: 6px;
  }

  #hud {
    position: relative;
    margin: 8px auto;
    left: auto;
    top: auto;
  }
}

/* =========================
   MOBILE
========================= */
@media (max-width: 600px) {
  .board {
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    margin-top: 8px;
    gap: 6px;
  }

  #hud {
    font-size: 0.7rem;
  }
}

@media (max-width: 400px) {
  .board {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
}
