
:root{
  --bg-1: #40a0f3;
  --bg-2: #e6e6fa;
  --card-back: #ddd;
  --muted: #333;
  --accent: #007bff;
  --matched-border: gold;
}

* { box-sizing: border-box; }
html,body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2));
  color: var(--muted);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Header ---- */
h1{
  margin: 22px 8px 8px;
  font-size: 1.8rem;
  letter-spacing: 0.2px;
}

/* ---- Game container (supports both id and class) ---- */
#game-container,
.game-container {
  display: grid;
  grid-template-columns: repeat(6, 100px); /* adjust columns for desired layout */
  gap: 14px;
  justify-content: center;
  align-items: center;
  margin: 26px auto;
  max-width: 720px;
  padding: 6px;
}

/* ---- Card basic ---- */
.card {
  width: 100px;
  height: 100px;
  border-radius: 10px;
  background: var(--card-back);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  color: rgba(0,0,0,0.75);
  cursor: pointer;
  user-select: none;
  transition: transform 220ms ease, box-shadow 220ms ease, background-color 150ms linear;
  box-shadow: 0 6px 14px rgba(20,20,20,0.08);
}

/* small press feedback */
.card:active {
  transform: translateY(2px) scale(0.995);
}

/* hover effect */
.card:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 20px rgba(20,20,20,0.12);
}

/* When the JS reveals a color you set inline backgroundColor.
   But in case you want a revealed class triggered by JS, handle it: */
.card.revealed {
  color: #fff;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* ---- Matched cards ---- */
.card.matched {
  transform: scale(1.06);
  opacity: 0.95;
  border: 3px solid var(--matched-border);
  box-shadow: 0 0 18px rgba(255,215,0,0.18);
}

/* ---- Controls (score/timer/button) ---- */
.startMain {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.startMain p {
  margin: 0;
  padding: 6px 10px;
  background: rgba(255,255,255,0.6);
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(10,10,10,0.03);
}

#score, #timer {
  font-size: 1rem;
}

#startbtn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.98rem;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,123,255,0.12);
  transition: transform 140ms ease, background-color 160ms ease;
}

#startbtn:hover { transform: translateY(-2px); }
#startbtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ---- Responsive ---- */
@media (max-width: 820px) {
  #game-container, .game-container {
    grid-template-columns: repeat(4, 90px);
    gap: 12px;
    max-width: 420px;
  }

  .card { width: 90px; height: 90px; font-size: 1.05rem; }
}

@media (max-width: 420px) {
  #game-container, .game-container {
    grid-template-columns: repeat(3, 78px);
    gap: 10px;
    max-width: 260px;
  }

  .card { width: 78px; height: 78px; font-size: 0.95rem; }
  h1 { font-size: 1.2rem; }
  #startbtn { padding: 8px 12px; font-size: 0.92rem; }
}
