* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

body {
  background: #0C0D14;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  font-family: 'Courier New', monospace;
  color: #fff;
  overflow: auto;
}

#game-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 480px;
  padding: 12px;
  gap: 8px;
}

#hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 8px 16px;
  background: #13141D;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.hud-group {
  display: flex;
  flex-direction: column;
}

.hud-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #888;
}

.hud-value {
  font-size: 16px;
  font-weight: 700;
  color: #00ff88;
}

.hud-btn {
  background: #1a1a2e;
  color: #00ff88;
  border: 1px solid rgba(0, 255, 136, 0.3);
  padding: 6px 14px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.hud-btn:hover {
  background: #00ff88;
  color: #0C0D14;
}

.captured {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  min-height: 28px;
  width: 100%;
  padding: 4px 8px;
  font-size: 20px;
}

#board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  overflow: hidden;
}

.cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: min(6vw, 40px);
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
}

.cell.light { background: #3d3d55; }
.cell.dark { background: #2a2a3e; }
.cell.selected { background: rgba(0, 255, 136, 0.3) !important; }
.cell.last-move { background: rgba(255, 204, 0, 0.15) !important; }
.cell.check { background: rgba(255, 68, 102, 0.4) !important; }

.cell.valid-move::after {
  content: '';
  position: absolute;
  width: 28%;
  height: 28%;
  background: rgba(0, 255, 136, 0.5);
  border-radius: 50%;
}

.cell.valid-capture {
  box-shadow: inset 0 0 0 3px rgba(0, 255, 136, 0.5);
}

.cell .piece {
  z-index: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  line-height: 1;
}

#overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

#overlay.hidden { display: none; }

#overlay-box {
  background: #13141D;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  max-width: 400px;
}

#overlay-box h1 {
  font-size: 36px;
  margin-bottom: 12px;
  letter-spacing: 4px;
  color: #00ff88;
}

.subtitle { color: #aaa; font-size: 14px; margin-bottom: 8px; }
.controls-hint { color: #666; font-size: 12px; margin-bottom: 24px; }

.game-btn {
  background: #00ff88;
  color: #0C0D14;
  border: none;
  padding: 14px 28px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 2px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.game-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.hidden { display: none !important; }
