* {
  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: 500px;
  padding: 12px;
  gap: 10px;
}

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

.hud-group { display: flex; flex-direction: column; align-items: center; }
.hud-label { font-size: 10px; font-weight: 700; letter-spacing: 3px; color: #888; }
.hud-value { font-size: 20px; font-weight: 700; color: #00ff88; }

.hud-buttons { display: flex; gap: 6px; }

.hud-btn {
  background: #1a1a2e;
  color: #00ff88;
  border: 1px solid rgba(0, 255, 136, 0.3);
  padding: 6px 12px;
  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; }

#current-clue {
  width: 100%;
  padding: 10px 14px;
  background: #13141D;
  border: 1px solid rgba(0, 255, 136, 0.2);
  border-radius: 6px;
  font-size: 13px;
  color: #fff;
  min-height: 40px;
  line-height: 1.4;
}

#board {
  display: inline-grid;
  gap: 2px;
  padding: 4px;
  background: #0C0D14;
  border-radius: 4px;
}

.cell {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  position: relative;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.1s;
}

.cell.letter {
  background: #1a1a2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cell.black {
  background: #0C0D14;
  cursor: default;
}

.cell.selected {
  background: #00ff88 !important;
  color: #0C0D14;
}

.cell.highlighted {
  background: #2a2a3e !important;
}

.cell.wrong {
  color: #ff4466 !important;
}

.cell .clue-number {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 9px;
  font-weight: 400;
  color: #666;
  line-height: 1;
}

.cell.selected .clue-number,
.cell.highlighted .clue-number {
  color: #888;
}

.cell input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

#clues-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  max-height: 200px;
  overflow-y: auto;
}

#clues-panel h3 {
  font-size: 12px;
  letter-spacing: 3px;
  color: #00ff88;
  margin-bottom: 8px;
}

.clue-item {
  font-size: 12px;
  color: #aaa;
  padding: 4px 0;
  cursor: pointer;
  line-height: 1.4;
  transition: color 0.15s;
}

.clue-item:hover { color: #fff; }
.clue-item.active { color: #00ff88; font-weight: 700; }
.clue-item.completed { color: #555; text-decoration: line-through; }

#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; }

@media (max-width: 420px) {
  .cell { width: 32px; height: 32px; font-size: 15px; }
  .cell .clue-number { font-size: 8px; }
}
