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

/* ===== BASE ===== */
body {
  font-family: Arial, sans-serif;
  background: #faf8ef;
  height: 100vh;
}

/* ===== LAYOUT ===== */
.layout {
  display: flex;
  height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 240px;
  background: #1e1e1e;
  color: white;
  padding: 20px;
}

.sidebar h2 {
  margin-bottom: 10px;
}

.sidebar h3 {
  margin: 20px 0 10px;
}

.sidebar button {
  width: 100%;
  margin: 8px 0;
  padding: 10px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: bold;
  background: linear-gradient(135deg, #4facfe, #00f2fe);
  color: white;
  transition: 0.2s;
}

.sidebar button:hover:not(:disabled) {
  transform: scale(1.05);
}

.sidebar button:disabled {
  background: #555;
  cursor: not-allowed;
}

#walletAddress {
  margin: 10px 0;
  font-size: 14px;
  word-break: break-all;
}

/* ===== LEADERBOARD ===== */
#leaderboard {
  list-style: none;
  font-size: 14px;
}

#leaderboard li {
  margin: 4px 0;
}

/* ===== GAME AREA ===== */
.game {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.game h1 {
  font-size: 48px;
  margin-bottom: 10px;
}

.game > div {
  margin-bottom: 10px;
}

/* ===== BOARD ===== */
.board {
  width: 320px;
  background: #bbada0;
  padding: 10px;
  border-radius: 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

/* ===== TILE (FIXED SIZE) ===== */
.tile {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background: #cdc1b4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: bold;
}

/* Tile colors */
.tile[data-value="2"] { background: #eee4da; }
.tile[data-value="4"] { background: #ede0c8; }
.tile[data-value="8"] { background: #f2b179; color: #fff; }
.tile[data-value="16"] { background: #f59563; color: #fff; }
.tile[data-value="32"] { background: #f67c5f; color: #fff; }
.tile[data-value="64"] { background: #f65e3b; color: #fff; }
.tile[data-value="128"] { background: #edcf72; color: #fff; }
.tile[data-value="256"] { background: #edcc61; color: #fff; }
.tile[data-value="512"] { background: #edc850; color: #fff; }
.tile[data-value="1024"] { background: #edc53f; color: #fff; }
.tile[data-value="2048"] { background: #edc22e; color: #fff; }

/* ===== MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #222;
  color: white;
  padding: 25px;
  border-radius: 16px;
  width: 300px;
  text-align: center;
}

.modal-content button {
  margin: 10px 5px;
  padding: 10px 15px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
}

/* ===== UTIL ===== */
.hidden {
  display: none !important;
}
