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

body.markings-room {
  background: #f6f2ea;
  font-family: Georgia, serif;
  color: #333;
  height: 100vh;
  overflow: hidden;
}

/* HEADER */
.markings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
}

.markings-header h1 {
  font-weight: normal;
  font-size: 1.1rem;
}

.back-btn {
  background: none;
  border: none;
  font-size: 0.95rem;
  cursor: pointer;
  color: #777;
}

.top-tools {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.top-tools button {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #999;
}

.top-tools button:hover {
  color: #666;
}

.tool-btn {
  position: relative;
}

.tool-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 6px;
  background: #555;
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s;
  pointer-events: none;
}

.tool-btn:hover::after {
  opacity: 1;
  visibility: visible;
}

.size-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.size-dots .dot {
  background: #999;
  border-radius: 50%;
}

.size-dots .dot.small { width: 6px; height: 6px; }
.size-dots .dot.medium { width: 8px; height: 8px; }
.size-dots .dot.large { width: 10px; height: 10px; }

.size-dots .dot.active {
  background: #555;
}

/* INVITES */
.invites {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.invites button {
  background: none;
  border: none;
  cursor: pointer;
  color: #777;
}

.divider {
  color: #aaa;
}

/* PROMPT */
.prompt-box {
  text-align: center;
  margin-bottom: 0.5rem;
  opacity: 0.85;
}

.hidden {
  display: none;
}

/* SOUND PANEL */
.sound-panel {
  position: absolute;
  top: 6rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(246,242,234,0.95);
  padding: 1rem;
  border-radius: 12px;
  text-align: center;
  z-index: 20;
}

.sound-panel button {
  display: block;
  width: 100%;
  background: none;
  border: none;
  margin: 0.25rem 0;
  cursor: pointer;
}

.volume {
  display: flex;
  justify-content: space-around;
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

/* CANVAS */
#drawingCanvas {
  width: 100%;
  height: calc(100vh - 140px);
  display: block;
}

/* FLOATING TOOL */
.tool-wrapper {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
}

.tool-toggle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #555;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-dots {
  line-height: 1;
}

.tool-panel {
  position: absolute;
  bottom: 60px;
  right: 0;
  background: #fff;
  border-radius: 16px;
  padding: 0.5rem 0;
  min-width: 180px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.tool-wrapper:hover .tool-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.tool-row {
  display: flex;
  align-items: center;
  padding: 0.7rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
}

.tool-row:hover {
  background: rgba(0,0,0,0.03);
}

.tool-icon {
  width: 24px;
  font-size: 1.1rem;
  color: #888;
  display: flex;
  align-items: center;
}

.palette-icon {
  display: flex;
  gap: 2px;
}

.p-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.tool-text {
  flex: 1;
  margin-left: 0.5rem;
  font-size: 0.95rem;
  color: #555;
}

.tool-arrow {
  color: #bbb;
  font-size: 1.2rem;
}

.tool-submenu {
  display: none;
  padding: 0.25rem 1rem 0.5rem 2.5rem;
  border-bottom: 1px solid #f0f0f0;
}

.tool-submenu.open {
  display: block;
}

.tool-submenu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  border-radius: 6px;
  color: #666;
  font-size: 0.9rem;
}

.tool-submenu button:hover {
  background: rgba(0,0,0,0.04);
}

.tool-submenu button.active {
  background: rgba(201,162,39,0.12);
  color: #6a5a42;
}

.color-swatches {
  display: flex;
  gap: 6px;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s;
}

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

.color-swatch.active {
  border-color: #333;
}

/* MOBILE RESPONSIVE */
@media (max-width: 600px) {
  .markings-header {
    padding: 0.75rem 1rem;
  }

  .markings-header h1 {
    font-size: 1.25rem;
  }

  .back-btn {
    font-size: 0.85rem;
  }

  .top-tools {
    gap: 0.6rem;
  }

  .top-tools button {
    font-size: 1.1rem;
    padding: 0.25rem;
    min-width: 32px;
    min-height: 32px;
  }

  .invites {
    font-size: 0.9rem;
  }

  #drawingCanvas {
    height: calc(100vh - 120px);
    touch-action: none;
  }

  .tool-wrapper {
    bottom: 1rem;
    right: 1rem;
  }

  .tool-toggle {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }

  .tool-panel {
    bottom: 54px;
    min-width: 160px;
  }

  .tool-row {
    padding: 0.6rem 0.75rem;
  }

  .tool-text {
    font-size: 0.9rem;
  }

  .color-swatch {
    width: 28px;
    height: 28px;
  }

  .sound-panel {
    top: 5rem;
    width: 80%;
    max-width: 200px;
  }
}

/* Touch device: panel stays open when active */
.tool-panel.touch-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}