* {
  box-sizing: border-box;
  touch-action: manipulation;
}

body {
  margin: 0;
  background: #111;
  color: #eee;
  font-family: system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100svh;

}

/* ---------- TOP ---------- */
#top {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  padding: 8px;
  font-size: 14px;
  text-align: center;
}

/* ---------- BOARD ---------- */
#game {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

#board {
  width: min(60vw, 60svh);
  aspect-ratio: 1 / 1;
  height: 60vmin;
  max-width: 60vw;
  max-height: 60vw;

  display: grid;
  grid-template-columns: repeat(12, 1fr);
  /* Mobile */
  background: #777;
}

.cell {
  aspect-ratio: 1 / 1;
  border: 1px solid #222;
  background-size: cover;
  background-position: center;
}

/* ---------- HAND ---------- */
#hand {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 8px;
  overflow-x: auto;
}

.hand-tile {
  min-width: 56px;
  min-height: 56px;
  background-size: cover;
  background-position: center;
  border-radius: 6px;
  border: 2px solid transparent;
  flex-shrink: 0;
}

.hand-tile.selected {
  border-color: gold;
}

/* ---------- CONTROLS ---------- */
#controls {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 8px;
}

#controls button {
  flex: 1;
  padding: 12px;
  font-size: 16px;
}

/* ---------- DESKTOP ---------- */
@media (min-width: 700px) {
  #board {
    grid-template-columns: repeat(20, 1fr);
  }

  #top {
    font-size: 16px;
  }
}