:root {
  --bg: #0f1320;
  --panel: rgba(0, 0, 0, 0.2);
  --text: #e7ecff;
  --muted: #cfd6ff;
  --accent: #6ea8fe;
  --danger: #ff6b6b;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial,
    'Apple Color Emoji', 'Segoe UI Emoji';
}

/* Smaller, translucent banner floating on top */
#topbar {
  position: fixed;
  top: 10px;
  left: 10px;
  right: 10px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  background: var(--panel);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 20;
}

#topbar .title {
  font-weight: 600;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

#topbar .controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-chip {
  font-size: 12px;
  color: var(--muted);
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
}

.icon-btn:hover {
  filter: brightness(1.1);
}

.export-scale {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.export-scale input {
  width: 54px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 0 8px;
}

/* The canvas fills the entire screen behind the floating banner */
#canvasWrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #ffffff;
}

.spinner {
  position: absolute;
  top: 56px;
  left: 12px;
  background: rgba(22, 27, 46, 0.85);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  z-index: 10;
}

#colorPicker {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: rgba(22, 27, 46, 0.9);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  border: 1px solid #273053;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  z-index: 15;
}

/* Quick palette */
.palette {
  position: absolute;
  min-width: 220px;
  padding: 10px;
  background: rgba(22, 27, 46, 0.98);
  border: 1px solid #2a3357;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  z-index: 12;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(8, 22px);
  gap: 6px;
  margin-bottom: 8px;
}

.palette-swatch {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.palette-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn {
  background: #273053;
  color: var(--text);
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid #334075;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.1);
}

.btn.btn-muted {
  background: #1d233b;
  border-color: #2b355f;
}