html,
body {
  margin: 0;
  height: 100%;
  width: 100%;
  font-size: 14px;
  font-family: "Helvetica Neue",Helvetica,Arial,Sans-serif;
  font-weight: 300;
  text-align: center;
  cursor: default;

  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -o-user-select: none;
  user-select: none;

  -ms-touch-action: none;
}

div {
  cursor: inherit;
}

a {
  color: steelBlue;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

#center {
  position: relative;
  height: 100%;
  width: 512px;
  margin: 0 auto;
}

#cont {
  position: absolute;
  top: 50%;
  margin-top: -340px;
  width:  512px;
  height: 680px;
}

/* Hamburger button */
#hamburgerBtn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1001;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#hamburgerBtn:hover {
  background: #f5f5f5;
}

.hamburger-line {
  display: block;
  width: 20px;
  height: 2px;
  background: #333;
  border-radius: 1px;
}

/* Dev Settings panel */
#devSettingsPanel {
  position: fixed;
  top: 0;
  right: 0;
  width: 330px;
  max-width: 90vw;
  height: 100%;
  background: #fff;
  box-shadow: -4px 0 16px rgba(0,0,0,0.15);
  z-index: 1002;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

#devSettingsPanel.open {
  transform: translateX(0);
}

.dev-settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 16px;
  border-bottom: 1px solid #eee;
  background: #f9f9f9;
}

.dev-settings-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

#closeDevSettings {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: #666;
  cursor: pointer;
}

#closeDevSettings:hover {
  color: #333;
}

.dev-settings-card {
  margin: 12px 16px;
  padding: 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #e8e8e8;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.dev-settings-card h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
  color: #555;
}

.dev-settings-card label {
  display: block;
  font-weight: 500;
  margin: 8px 0 4px 0;
}

.dev-settings-card label:first-of-type {
  margin-top: 0;
}

.dev-settings-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
  margin-top: 10px;
  cursor: pointer;
}

.dev-settings-checkbox input[type=checkbox] {
  margin: 0;
  cursor: pointer;
}

#colorOverrideInput {
  display: block;
  margin-bottom: 12px;
  width: 100%;
  max-width: 240px;
}

#paletteSetSelect,
#dropToleranceSelect,
#gridStartSelect,
#gridHintSelect,
#timerSelect,
#completionEffectSelect {
  display: block;
  margin: 4px 0 8px 0;
  min-width: 200px;
  font-size: 14px;
  padding: 4px 8px;
}

.grid-start-fields {
  margin: 8px 0 0 0;
}

.grid-start-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 5px 0;
  font-size: 14px;
}

.grid-start-row label {
  width: 52px;
  margin: 0;
  font-weight: 500;
  flex-shrink: 0;
}

.grid-start-row input[type=number] {
  width: 52px;
  font-size: 14px;
  padding: 3px 6px;
}

#initGridBtn {
  display: block;
  margin-top: 10px;
  padding: 5px 14px;
  font-size: 14px;
  cursor: pointer;
}

#downloadPaletteJson {
  display: block;
  margin-top: 12px;
  color: steelblue;
  text-decoration: none;
  font-size: 14px;
}

#downloadPaletteJson:hover {
  text-decoration: underline;
}

#devSettingsPanel #palettePicker {
  margin: 0;
}

#devSettingsOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.3);
  z-index: 1001;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#devSettingsOverlay.visible {
  opacity: 1;
  pointer-events: auto;
}

#palettePicker {
  margin-bottom: 12px;
  text-align: left;
}

#palettePicker label {
  font-weight: 500;
  margin-right: 8px;
}

#paletteSelect {
  font-size: 14px;
  padding: 4px 8px;
  min-width: 160px;
}

#dot {
  width:  512px;
  height: 512px;
}

svg,
circle {
  pointer-events: none;
}

#next {
  padding-top: 30px;
}

#next input {
  width: 480px;
  border: 1px solid #ccc;
  outline: none;
}

#next .err {
  color: red;
}

div.not-found {
  text-align: center;
  margin-top: 200px;
  font-size: 32px;
}

/* Piece tray (below #dots) */
#pieceTray {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 32px;
  padding: 24px;
  margin-top: 24px;
  background: #fff;
  border: 2px solid #333;
  border-radius: 4px;
  height: 200px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#pieceTray .piece {
  cursor: grab;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.15s ease;
  touch-action: none;
}

#pieceTray .piece:hover {
  background: rgba(0,0,0,0.04);
}

#pieceTray .piece.dragging {
  opacity: 0.8;
  cursor: grabbing;
  z-index: 1000;
}

#pieceTray .piece svg {
  display: block;
}

#pieceTray .piece.dragging circle {
  filter: brightness(1.1);
}

/* Encouragement bubble */
#encouragementBubble {
  position: fixed;
  top: calc(50vh - 255px);
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 320px;
  padding: 12px 20px;
  border-radius: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  font-size: 30px;
  font-weight: 300;
  text-align: center;
  pointer-events: none;
  z-index: 900;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#encouragementBubble.fade-in {
  opacity: 1;
}

#encouragementBubble.fade-out {
  opacity: 0;
}

/* Timer progress bar */
#timerBar {
  display: none;
  width: 512px;
  height: 6px;
  background: #ddd;
  border-radius: 3px;
  margin: 8px 0;
  overflow: hidden;
}

#timerBar.active {
  display: block;
}

#timerBarFill {
  height: 100%;
  width: 0%;
  background: #7bafd4;
  border-radius: 3px;
  transition: width 1s linear;
}

#dots svg.hide-base-level .base-level { visibility: hidden; }

/* Grid Hint: highlight mode — glow on target-size circles */
#dots svg circle.hint-glow {
  filter: drop-shadow(0 0 6px currentColor);
  opacity: 1 !important;
}
