/* Drawing Board Panel (draggable, no overlay) */
.drawing-board-overlay {
  display: none;
  position: fixed;
  z-index: 2000;
  /* Default position - will be overridden by JS when dragging */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.drawing-board-overlay.show {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Drawing Board Container */
.drawing-board-container {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  width: 440px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.drawing-board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  cursor: grab;
  user-select: none;
}

.drawing-board-header:active {
  cursor: grabbing;
}

.drawing-board-header h3 {
  margin: 0;
  font-size: 18px;
  color: #2c3e50;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.drag-icon {
  color: #95a5a6;
  flex-shrink: 0;
}

.drawing-close-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: #ecf0f1;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7f8c8d;
  transition: all 0.2s;
}

.drawing-close-btn:hover {
  background: #e74c3c;
  color: #fff;
}

/* Drawing Canvas */
.drawing-canvas-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
}

.drawing-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: #fff;
  touch-action: none;
  cursor: crosshair;
  box-shadow: inset 0 0 0 1px #e0e0e0;
}

/* Drawing Tools */
.drawing-tools {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* Color Picker Section */
.color-picker-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.color-wheel-wrapper {
  position: relative;
}

.color-wheel {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  cursor: crosshair;
}

.color-wheel-indicator {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.current-color {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 2px solid #ddd;
  box-shadow: inset 0 0 0 2px #fff;
}

/* Preset Colors */
.preset-colors {
  display: flex;
  gap: 6px;
}

.preset-color {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #ddd;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.preset-color:hover {
  transform: scale(1.1);
}

.preset-color.selected {
  border-color: #3498db;
}

.preset-color.black {
  background: #000;
}

.preset-color.white {
  background: #fff;
}

.preset-color.gray {
  background: #808080;
}

/* Size Slider Section */
.size-slider-section {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 120px;
}

.size-slider-section label {
  font-size: 12px;
  color: #7f8c8d;
  white-space: nowrap;
}

.size-slider {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #ecf0f1;
  border-radius: 3px;
  outline: none;
}

.size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: #3498db;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s;
}

.size-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.size-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #3498db;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.size-preview {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.size-preview-dot {
  background: #2c3e50;
  border-radius: 50%;
  transition: width 0.1s, height 0.1s;
}

/* Drawing Actions */
.drawing-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.drawing-actions .action-btn {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  color: #2c3e50;
}

.drawing-actions .action-btn:hover {
  background: #ecf0f1;
  border-color: #bdc3c7;
}

.drawing-actions .action-btn.clear {
  color: #e74c3c;
  border-color: #e74c3c;
}

.drawing-actions .action-btn.clear:hover {
  background: #e74c3c;
  color: #fff;
}

/* Games Badge Notification */
.games-picker-wrapper {
  position: relative;
}

.games-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background: #e74c3c;
  border-radius: 50%;
  border: 2px solid #fff;
  display: none;
  z-index: 1;
}

.games-badge.show {
  display: block;
  animation: badgePulse 1.5s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(231, 76, 60, 0);
  }
}

/* Drawing Invite Message */
.drawing-invite {
  color: #3498db;
  cursor: pointer;
  text-decoration: underline;
}

.drawing-invite:hover {
  color: #2980b9;
}

.message.clickable {
  cursor: pointer;
  transition: background 0.2s;
}

.message.clickable:hover {
  background: #e8f4fc;
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .drawing-board-container {
    padding: 16px;
    border-radius: 12px;
  }

  .drawing-board-header h3 {
    font-size: 16px;
  }

  .color-wheel {
    width: 64px;
    height: 64px;
  }

  .drawing-tools {
    gap: 12px;
  }

  .size-slider-section {
    min-width: 100px;
  }

  .preset-color {
    width: 24px;
    height: 24px;
  }
}

/* Very small screens */
@media (max-width: 400px) {
  .drawing-board-overlay {
    padding: 8px;
  }

  .drawing-board-container {
    padding: 12px;
  }

  .drawing-tools {
    flex-direction: column;
    align-items: stretch;
  }

  .color-picker-section {
    justify-content: center;
  }

  .size-slider-section {
    width: 100%;
  }
}
