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

body {
  background: #0a0a0a;
  font-family: 'Segoe UI', 'Helvetica Neue', sans-serif;
  overflow: hidden;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

/* === MENU === */
#menu {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  background: #0a0a0a;
}

#menu.hidden { display: none; }

.menu-title {
  font-size: clamp(32px, 6vw, 64px);
  font-weight: 900;
  letter-spacing: 4px;
  color: #c4392a;
  text-shadow: 0 0 30px rgba(200, 50, 40, 0.4);
  margin-bottom: 8px;
}

.menu-subtitle {
  font-size: clamp(12px, 2vw, 18px);
  color: rgba(255,255,255,0.3);
  letter-spacing: 6px;
  text-transform: uppercase;
  margin-bottom: 48px;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(300px, 80vw);
}

.menu-btn {
  background: rgba(200, 50, 40, 0.1);
  border: 1px solid rgba(200, 50, 40, 0.3);
  color: #c4392a;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 16px 24px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}

.menu-btn:hover {
  background: rgba(200, 50, 40, 0.2);
  border-color: rgba(200, 50, 40, 0.6);
  box-shadow: 0 0 20px rgba(200, 50, 40, 0.2);
}

.menu-btn:active {
  transform: scale(0.97);
}

.menu-btn.secondary {
  background: rgba(58, 122, 189, 0.1);
  border-color: rgba(58, 122, 189, 0.3);
  color: #3a7abd;
}

.menu-btn.secondary:hover {
  background: rgba(58, 122, 189, 0.2);
  border-color: rgba(58, 122, 189, 0.6);
  box-shadow: 0 0 20px rgba(58, 122, 189, 0.2);
}

/* === CONTROLS INFO === */
.controls-info {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(300px, 80vw);
}

.controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.controls-label {
  font-size: 13px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.controls-keys {
  display: flex;
  gap: 6px;
}

.controls-keys kbd {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  padding: 4px 10px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  min-width: 32px;
  text-align: center;
}

/* === ONLINE LOBBY === */
#online-lobby, #waiting-room, #connecting-overlay, #disconnect-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  background: #0a0a0a;
}

#online-lobby.hidden, #waiting-room.hidden,
#connecting-overlay.hidden, #disconnect-overlay.hidden { display: none; }

#disconnect-overlay {
  z-index: 25;
  background: rgba(0, 0, 0, 0.85);
}

.room-input {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(200, 50, 40, 0.3);
  color: #c4392a;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 8px;
  padding: 14px 16px;
  border-radius: 8px;
  text-align: center;
  width: 150px;
  text-transform: uppercase;
  font-family: 'Courier New', monospace;
  outline: none;
}

.room-input:focus {
  border-color: rgba(200, 50, 40, 0.6);
  box-shadow: 0 0 15px rgba(200, 50, 40, 0.2);
}

.room-input::placeholder {
  color: rgba(255,255,255,0.15);
  letter-spacing: 4px;
}

.join-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.join-btn {
  flex-shrink: 0;
}

.room-code-display {
  font-size: clamp(40px, 8vw, 72px);
  font-weight: 900;
  letter-spacing: 12px;
  color: #c4392a;
  text-shadow: 0 0 30px rgba(200, 50, 40, 0.6);
  font-family: 'Courier New', monospace;
  margin: 20px 0;
}

.room-hint {
  font-size: 14px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 1px;
  margin-bottom: 24px;
}

/* === DIFFICULTY SELECT === */
#difficulty-select {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  background: #0a0a0a;
}

#difficulty-select.hidden { display: none; }

.diff-title {
  font-size: clamp(20px, 4vw, 36px);
  color: #c4392a;
  letter-spacing: 3px;
  margin-bottom: 32px;
  text-transform: uppercase;
}

/* === GAME CANVAS === */
#game-container {
  display: none;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
}

#game-container.active {
  display: flex;
}

#gameCanvas {
  display: block;
}

/* === GAME OVER OVERLAY === */
#game-over {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
  background: rgba(0, 0, 0, 0.85);
}

#game-over.hidden { display: none; }

.go-title {
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 900;
  letter-spacing: 4px;
  margin-bottom: 12px;
}

.go-title.win { color: #3a7abd; text-shadow: 0 0 30px rgba(58, 122, 189, 0.5); }
.go-title.lose { color: #c4392a; text-shadow: 0 0 30px rgba(200, 50, 40, 0.5); }

.go-score {
  font-size: clamp(18px, 3vw, 28px);
  color: rgba(255,255,255,0.5);
  margin-bottom: 40px;
  letter-spacing: 2px;
}

/* === PAUSE === */
#pause-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 15;
  background: rgba(0, 0, 0, 0.7);
}

#pause-overlay.hidden { display: none; }

.pause-title {
  font-size: clamp(28px, 5vw, 48px);
  color: rgba(255,255,255,0.6);
  letter-spacing: 6px;
  margin-bottom: 32px;
}
