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

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #1a1a2e;
  color: #eee;
  height: 100vh;
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

#lobby {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  gap: 20px;
  padding: 20px;
}

#lobby h1 {
  font-size: 2.5rem;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
}

#room-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

#room-input {
  padding: 10px 16px;
  border: 2px solid #444;
  border-radius: 8px;
  background: #16213e;
  color: #eee;
  font-size: 1rem;
  width: 220px;
  text-transform: uppercase;
}

#room-input:focus {
  outline: none;
  border-color: #667eea;
}

#join-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s;
}

#join-btn:hover { transform: scale(1.03); }
#join-btn:active { transform: scale(0.97); }

#name-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  max-width: 400px;
}

#name-input {
  padding: 10px 16px;
  border: 2px solid #444;
  border-radius: 8px;
  background: #16213e;
  color: #eee;
  font-size: 1rem;
  width: 100%;
}

#name-input:focus {
  outline: none;
  border-color: #667eea;
}

#color-picker-container {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

#color-picker-container label {
  display: flex;
  align-items: center;
  gap: 8px;
}

#color-picker { width: 40px; height: 40px; border: none; border-radius: 6px; cursor: pointer; }
#brush-size { cursor: pointer; }

#canvas-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

#toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #16213e;
  border-bottom: 1px solid #333;
  flex-wrap: wrap;
}

#room-label { font-size: 0.85rem; color: #888; margin-right: 4px; }
#room-label strong { color: #eee; }

#tools-group {
  display: flex;
  gap: 2px;
  background: #0f1a2e;
  border-radius: 8px;
  padding: 3px;
}

.tool-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #888;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.tool-btn:hover { color: #eee; background: rgba(255,255,255,0.1); }
.tool-btn.active { background: #667eea; color: #fff; }

#toolbar-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toolbar-color input {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  background: none;
}

.toolbar-size input {
  width: 60px;
  cursor: pointer;
}

#size-label {
  font-size: 0.75rem;
  color: #888;
  min-width: 16px;
  text-align: center;
}

#toolbar button {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
}

#clear-btn { background: #e74c3c; color: #fff; }
#leave-btn { background: #555; color: #eee; margin-left: auto; }

#canvas-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #fff;
}

#draw-canvas, #cursor-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#draw-canvas { cursor: crosshair; z-index: 1; touch-action: none; }
#cursor-canvas { pointer-events: none; z-index: 2; touch-action: none; }

#stroke-tooltip {
  display: none;
  position: absolute;
  padding: 3px 8px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 12px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
}

#zoom-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 10px;
  background: #16213e;
  border-top: 1px solid #333;
}

#zoom-bar button {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  background: #0f1a2e;
  color: #ccc;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#zoom-bar button:hover { background: #333; }
#zoom-level { font-size: 0.75rem; color: #888; min-width: 40px; text-align: center; }

#users-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: #16213e;
  border-top: 1px solid #333;
  font-size: 0.8rem;
  color: #888;
}

#user-indicators {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.user-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid #555;
  flex-shrink: 0;
}

.user-name {
  font-size: 0.75rem;
  color: #ccc;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#footer {
  display: none;
  text-align: center;
  padding: 4px 12px;
  font-size: 0.75rem;
  color: #666;
  background: #16213e;
  border-top: 1px solid #333;
  flex-shrink: 0;
}

#footer strong { color: #888; }

@media (max-width: 600px) {
  #lobby h1 { font-size: 1.8rem; }
  #room-input { width: 160px; font-size: 0.9rem; }
  #join-btn { font-size: 0.9rem; padding: 8px 16px; }
  #toolbar { padding: 4px 6px; gap: 4px; }
  #room-label { font-size: 0.75rem; }
  .tool-btn { width: 32px; height: 32px; font-size: 0.85rem; }
  .toolbar-color input { width: 28px; height: 28px; }
  .toolbar-size input { width: 50px; }
  #toolbar button { padding: 4px 8px; font-size: 0.75rem; }
  #zoom-bar button { width: 24px; height: 24px; }
}

@media (min-width: 601px) {
  #footer { display: block; }
}
