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

body {
  background: #0d1117;
  color: #e6edf3;
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#app {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: start;
}

.side { display: flex; flex-direction: column; gap: 16px; }

.panel {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 12px;
}

.panel h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #8b949e;
  margin-bottom: 8px;
}

.stats { display: flex; flex-direction: column; gap: 8px; }
.stat { display: flex; justify-content: space-between; }
.label { color: #8b949e; font-size: 13px; }
.value { font-weight: bold; font-size: 16px; font-variant-numeric: tabular-nums; }

#board-wrap { display: flex; justify-content: center; }

#board-container { position: relative; }

#board {
  display: block;
  border: 2px solid #30363d;
  border-radius: 4px;
  background: #010409;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(1, 4, 9, 0.85);
  border-radius: 4px;
  gap: 12px;
  text-align: center;
}

.overlay.hidden { display: none; }

.overlay h1 { font-size: 32px; letter-spacing: 4px; }
.overlay p { color: #8b949e; }
.overlay button {
  background: #238636;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 24px;
  font-size: 16px;
  cursor: pointer;
}
.overlay button:hover { background: #2ea043; }

#touch-controls {
  display: none;
  gap: 8px;
  margin-top: 16px;
}

#touch-controls button {
  background: #21262d;
  border: 1px solid #30363d;
  color: #e6edf3;
  border-radius: 8px;
  padding: 16px 20px;
  font-size: 18px;
  cursor: pointer;
}
#touch-controls button:active { background: #30363d; }

@media (max-width: 700px) {
  #app {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  .side {
    flex-direction: row;
    justify-content: center;
  }
  #touch-controls { display: flex; }
}
