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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: #14181f;
  color: #d7dde6;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* ---------- Toolbar ---------- */
#toolbar {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
  padding: 0.6rem 1rem;
  background: linear-gradient(180deg, #1e242e, #191e26);
  border-bottom: 1px solid #2b3340;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-icon {
  font-size: 1.9rem;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ff8a5c;
  letter-spacing: 0.02em;
}

.brand-sub {
  font-size: 0.72rem;
  color: #7d8794;
  font-style: italic;
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tool-group.palettes { flex-wrap: wrap; }

.slider-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #9aa4b1;
}

.slider-label input[type="range"] {
  width: 8rem;
  accent-color: #ff8a5c;
  cursor: pointer;
}

/* ---------- Palette swatches ---------- */
.swatch {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  transition: transform 0.1s ease, border-color 0.1s ease;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.15);
}

.swatch:hover { transform: translateY(-2px) scale(1.05); }

.swatch.active {
  border-color: #f4f7fb;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15), 0 2px 8px rgba(0, 0, 0, 0.4);
}

.swatch.rainbow {
  background: conic-gradient(#ff5c5c, #ffb15c, #ffe75c, #6cff8a, #5cc8ff, #b98aff, #ff5cf0, #ff5c5c);
}

/* ---------- Buttons ---------- */
.tool-group.buttons { margin-left: auto; }

#toolbar button {
  font-size: 0.82rem;
  font-weight: 600;
  color: #d7dde6;
  background: #2a323d;
  border: 1px solid #3a4552;
  border-radius: 7px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.08s ease;
}

#toolbar button:hover { background: #343e4b; }
#toolbar button:active { transform: translateY(1px); }

#saveBtn {
  background: #ff8a5c;
  border-color: #ff8a5c;
  color: #1a1206;
}
#saveBtn:hover { background: #ff9d75; }

/* ---------- Stage ---------- */
#stage {
  position: relative;
  flex: 1;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, #1b2733, #131820 70%);
}

#board {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

#hint {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  color: #6f7a87;
  background: rgba(15, 19, 25, 0.7);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#hint.hidden { opacity: 0; }
