/* =========================
   SOLID GAME: DRAWING BOARD
========================= */

.draw-game {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: "Fredoka", Arial, sans-serif;
  color: #000;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.draw-toolbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(280px, auto) minmax(220px, auto) auto;
  gap: 12px;
  align-items: stretch;
}

.draw-title-block,
.draw-tool-card,
.draw-actions {
  background: #fff0a8;
  border: 6px solid #000;
  border-radius: 22px;
  box-shadow: 6px 6px 0 rgba(0,0,0,0.24);
}

.draw-title-block {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.draw-title-icon {
  width: 60px;
  height: 60px;
  border: 5px solid #000;
  border-radius: 18px;
  background: #d3ff00;
  display: grid;
  place-items: center;
  font-size: 32px;
}

.draw-title-block h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.draw-title-block p {
  margin: 5px 0 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;
}

.draw-tool-card {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  background: #bff1ea;
}

.draw-tool-label {
  display: block;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.draw-color-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.draw-color-btn {
  width: 36px;
  height: 36px;
  border: 4px solid #000;
  border-radius: 12px;
  background: var(--draw-color);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.22);
  cursor: pointer;
  padding: 0;
  touch-action: manipulation;
}

.draw-color-btn.active {
  outline: 5px solid #23d8ff;
  transform: translateY(-2px);
}

.draw-size-row {
  display: grid;
  grid-template-columns: 1fr 54px;
  gap: 10px;
  align-items: center;
}

#draw-size {
  width: 100%;
  accent-color: #23d8ff;
  cursor: pointer;
}

.draw-size-label {
  height: 40px;
  background: #fff;
  border: 4px solid #000;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 900;
}

.draw-actions {
  padding: 10px;
  display: flex;
  gap: 9px;
  align-items: center;
  background: #f7d3ff;
}

.draw-action-btn {
  min-width: 96px;
  height: 52px;
  border: 5px solid #000;
  border-radius: 16px;
  background: #fff;
  color: #000;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.25);
  touch-action: manipulation;
}

.draw-action-btn.active {
  background: #23d8ff;
}

.draw-action-btn.danger {
  background: #ff7676;
}

.draw-action-btn:active,
.draw-color-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 rgba(0,0,0,0.25);
}

.draw-canvas-wrap {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  border: 8px solid #000;
  border-radius: 30px;
  background:
    radial-gradient(circle at 18px 18px, rgba(0,0,0,0.08) 0 2px, transparent 3px),
    #ffffff;
  box-shadow: 10px 10px 0 rgba(0,0,0,0.25);
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;
}

.draw-canvas-wrap.erase-mode {
  cursor: cell;
}

.draw-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

.draw-cursor {
  position: absolute;
  pointer-events: none;
  left: 0;
  top: 0;
  width: 16px;
  height: 16px;
  border: 3px solid #000;
  border-radius: 50%;
  background: rgba(35,216,255,0.18);
  transform: translate(-50%, -50%);
  opacity: 0;
  z-index: 5;
}

.draw-cursor.show {
  opacity: 1;
}

.draw-cursor.eraser {
  background: rgba(255,255,255,0.72);
  border-style: dashed;
}

@media (max-width: 1050px) {
  .draw-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .draw-actions {
    justify-content: center;
  }
}

@media (max-width: 700px) {
  .draw-toolbar {
    grid-template-columns: 1fr;
  }

  .draw-title-block {
    grid-template-columns: 54px 1fr;
    padding: 10px;
  }

  .draw-title-icon {
    width: 50px;
    height: 50px;
    font-size: 26px;
  }

  .draw-title-block h2 {
    font-size: 23px;
  }

  .draw-actions {
    flex-wrap: wrap;
  }

  .draw-action-btn {
    flex: 1 1 120px;
  }
}
