/* =========================================
   🌟 ETHEREAL LUMINESCENCE THEME (FIXED)
   ========================================= */

body {
  margin: 0;
  overflow: hidden;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: #333; 
  background: linear-gradient(45deg, #f0faff, #e6f0ff, #fff0f5, #f5f5dc, #e0ffff);
  background-size: 400% 400%;
  animation: fluidLight 25s ease infinite alternate;
  display: flex;
  justify-content: center;
}

@keyframes fluidLight {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 100%; }
  100% { background-position: 0% 50%; }
}

body::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,0.8) 0%, transparent 60%),
              radial-gradient(circle at 20% 80%, rgba(255, 255, 240, 0.6) 0%, transparent 50%);
  mix-blend-mode: overlay;
  pointer-events: none;
  animation: pulseLight 12s ease-in-out infinite alternate;
  z-index: 1;
}

@keyframes pulseLight {
  0% { opacity: 0.4; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1.05); }
}

/* --- CANVAS FIX HERE --- */
canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: #ffffff;
  
  /* FIX: 
     1. ViewBox is set to 32 32. 
     2. Center circle is at cx=16 cy=16.
     3. Crosshairs cross at 16, 16.
     4. CSS Hotspot is set to '16 16' to match.
  */
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cdefs%3E%3Cfilter id='shadow'%3E%3CfeDropShadow dx='0' dy='0' stdDeviation='1.5' flood-color='%23000' flood-opacity='0.3'/%3E%3C/filter%3E%3C/defs%3E%3Cg filter='url(%23shadow)'%3E%3Ccircle cx='16' cy='16' r='13' fill='none' stroke='%2300c6ff' stroke-width='2'/%3E%3Ccircle cx='16' cy='16' r='2' fill='%2300c6ff'/%3E%3Cline x1='16' y1='8' x2='16' y2='24' stroke='%2300c6ff' stroke-width='2' stroke-linecap='round'/%3E%3Cline x1='8' y1='16' x2='24' y2='16' stroke='%2300c6ff' stroke-width='2' stroke-linecap='round'/%3E%3C/g%3E%3C/svg%3E") 16 16, crosshair;
  
  box-shadow: inset 0 0 100px rgba(255, 255, 255, 0.5);
  z-index: 0;
}

/* Toolbar */
.toolbar {
  position: fixed;
  bottom: 40px;
  top: auto;
  width: auto;
  height: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 25px;
  padding: 15px 30px;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(30px) saturate(150%);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  border-radius: 60px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-bottom-color: rgba(255, 255, 255, 0.2);
  box-shadow: 
    0 15px 40px rgba(0, 100, 255, 0.1),
    inset 0 5px 15px rgba(255, 255, 255, 0.8);
  z-index: 10;
  animation: floatDeck 5s ease-in-out infinite alternate;
}

@keyframes floatDeck {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-12px); }
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar label {
  margin: 0 5px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Color Picker */
.toolbar-left input[type="color"] {
  -webkit-appearance: none;
  border: 3px solid rgba(255,255,255,0.8);
  width: 42px; height: 42px;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  background: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
}
.toolbar-left input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.toolbar-left input[type="color"]::-webkit-color-swatch { 
  border: none; 
  border-radius: 50%; 
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}
.toolbar-left input[type="color"]:hover { 
  transform: scale(1.15) rotate(10deg);
  box-shadow: 0 8px 20px rgba(0, 198, 255, 0.25);
  border-color: #00c6ff;
}

/* Range Slider */
.toolbar-left input[type="range"] {
  -webkit-appearance: none;
  width: 120px;
  height: 8px;
  background: rgba(0, 198, 255, 0.15);
  border-radius: 10px;
  outline: none;
  border: 1px solid rgba(255,255,255,0.5);
}
.toolbar-left input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  background: #fff;
  border: 3px solid #00c6ff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 198, 255, 0.3);
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.toolbar-left input[type="range"]::-webkit-slider-thumb:hover {
  background: #00c6ff;
  border-color: #fff;
  transform: scale(1.2);
  box-shadow: 0 0 15px rgba(0, 198, 255, 0.6);
}

/* Room ID */
#boardId {
  padding: 10px 18px;
  border-radius: 30px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.4);
  outline: none;
  width: 140px;
  color: #333;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}
#boardId:focus {
  background: rgba(255, 255, 255, 0.8);
  border-color: #00c6ff;
  width: 160px;
  box-shadow: 0 0 15px rgba(0, 198, 255, 0.3);
}

/* Buttons */
button {
  background: linear-gradient(145deg, #ffffff, #e3f2fd);
  border: 2px solid rgba(255,255,255,0.8);
  color: #0072ff;
  padding: 10px 24px;
  border-radius: 40px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 
    0 5px 15px rgba(0, 0, 0, 0.05),
    inset 0 3px 5px rgba(255,255,255,1),
    inset 0 -3px 10px rgba(0, 114, 255, 0.05);
}

button:hover {
  background: linear-gradient(145deg, #e0f7fa, #f3e5f5);
  color: #004a99;
  border-color: #00c6ff;
  transform: translateY(-4px) scale(1.05);
  box-shadow: 
    0 12px 30px rgba(0, 198, 255, 0.3),
    inset 0 2px 5px rgba(255,255,255,1);
}

button:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* Clear Button */
#clearBoardBtn {
    color: #ff3366;
    background: linear-gradient(145deg, #ffffff, #ffebee);
}
#clearBoardBtn:hover {
    color: #c70039;
    border-color: #ff3366;
    background: linear-gradient(145deg, #ffebee, #ffcdd2);
    box-shadow: 
      0 12px 30px rgba(255, 51, 102, 0.3),
      inset 0 2px 5px rgba(255,255,255,1);
}