a.brand {
  text-decoration: none;
}

.merge-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  width: min(100%, 420px);
  margin: 0 auto;
  aspect-ratio: 1;
  padding: 0.55rem;
  border-radius: 12px;
  background: #0f141c;
  border: 1px solid var(--line);
}

.merge-cell {
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1rem, 4vw, 1.6rem);
  background: #1a2330;
  color: var(--text);
}

.merge-cell.v-2 { background: #243447; }
.merge-cell.v-4 { background: #2c4058; }
.merge-cell.v-8 { background: #3a5a4a; color: #d7ffe8; }
.merge-cell.v-16 { background: #4a6b3d; }
.merge-cell.v-32 { background: #6b5a2e; color: #ffe7a8; }
.merge-cell.v-64 { background: #8a4e28; color: #ffd7b8; }
.merge-cell.v-128,
.merge-cell.v-256,
.merge-cell.v-512,
.merge-cell.v-1024,
.merge-cell.v-2048 {
  background: #2f6f68;
  color: #d9fff8;
}

.memory-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  width: min(100%, 420px);
  margin: 0 auto;
}

.memory-card {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #182130;
  color: transparent;
  font-size: clamp(1.2rem, 5vw, 1.8rem);
  cursor: pointer;
}

.memory-card.open,
.memory-card.matched {
  color: var(--text);
  background: #243447;
}

.memory-card.matched {
  border-color: rgba(122, 162, 255, 0.7);
  background: #1e2f4a;
}

.mines-board {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 0.2rem;
  width: min(100%, 420px);
  margin: 0 auto;
}

.mine-cell {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #1a2330;
  color: var(--text);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

.mine-cell.revealed {
  background: #121820;
  cursor: default;
}

.mine-cell.flagged {
  color: var(--warn);
}

.mine-cell.boom {
  background: #4a2430;
  color: #ffb4b4;
}

.mine-cell[data-n="1"] { color: #7aa2ff; }
.mine-cell[data-n="2"] { color: #3dd6c6; }
.mine-cell[data-n="3"] { color: #ff7a59; }
.mine-cell[data-n="4"] { color: #c084fc; }
.mine-cell[data-n="5"] { color: #f0b429; }
