:root {
  --cell-size: 80px;
  --font-size: 24px;
  --primary-bg: #1e293b;
  --board-bg: #334155;
  --text-color: #f8fafc;
  --accent: #3b82f6;
}
* { box-sizing: border-box; }
body {
  background-color: var(--primary-bg);
  color: var(--text-color);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  min-height: 100vh;
  touch-action: none;
}
h1 {
  font-size: 2rem;
  margin-bottom: 10px;
  color: var(--accent);
}
#score {
  margin-bottom: 10px;
}
#best {
  margin-bottom: 10px;
}
#board {
  position: relative;
  background-color: var(--board-bg);
  padding: 10px;
  border-radius: 6px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, var(--cell-size));
  grid-template-rows: repeat(4, var(--cell-size));
}

.cell {
  width: var(--cell-size);
  height: var(--cell-size);
  background-color: #475569;
  border-radius: 4px;
}

#tile-container {
  position: absolute;
  top: 10px;
  left: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  pointer-events: none;
}

.tile {
  position: absolute;
  width: var(--cell-size);
  height: var(--cell-size);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size);
  background-color: #475569;
  border-radius: 4px;
  color: #fff;
  transition: transform 0.3s ease;
}
#game-over {
  margin-top: 15px;
  font-size: 1.5rem;
  color: var(--accent);
  display: none;
}
button {
  margin-top: 10px;
  padding: 8px 16px;
  font-size: 1rem;
  border: none;
  border-radius: 4px;
  background-color: var(--accent);
  color: white;
  cursor: pointer;
}
@media (max-width: 600px) {
  :root {
    --cell-size: 60px;
    --font-size: 20px;
  }
}

/* Match navigation button style from BarnCrush */
.nav-button + .nav-button {
  margin-left: 10px;
}

.nav-button {
  background-color: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 4px;

  font-size: 1rem;
  display: inline-block;
  padding: 6px 12px;
  text-decoration: none;
  cursor: pointer;
}

.nav-button:hover {
  background-color: #2563eb;
}
