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

html, body {
  width: 100%; height: 100%;
  background: #000;
  overflow: hidden;
  font-family: "Noto Sans Mono", "Courier New", monospace;
  font-size: 17px;
}

#canvas { display: block; cursor: crosshair; outline: none; }

#ui {
  position: fixed; top: 0; left: 0; width: 100%;
  padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
  pointer-events: none; z-index: 10;
}

#ui h1 {
  color: #fff; font-size: 17px; letter-spacing: 0.2em;
  text-transform: uppercase; border: 1px solid #fff;
  padding: 6px 14px; pointer-events: none;
}

.btn {
  background: #000; color: #fff; border: 1px solid #fff;
  font-family: "Noto Sans Mono", "Courier New", monospace; font-size: 17px;
  letter-spacing: 0.15em; text-transform: uppercase;
  padding: 6px 16px; cursor: pointer; pointer-events: all;
  transition: background 0.08s, color 0.08s;
}
.btn:hover { background: #fff; color: #000; }
.btn:active { background: #ccc; color: #000; }
.btn.active { background: #fff; color: #000; }


#save-indicator {
  margin-left: auto;
  color: #333; font-size: 17px; letter-spacing: 0.1em;
  text-transform: uppercase; pointer-events: none;
  transition: color 0.4s;
}
#save-indicator.active { color: #666; }

#controls {
  position: fixed; bottom: 18px; left: 18px; z-index: 10;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
}

#controls-panel {
  display: none;
  flex-direction: column; gap: 0;
  border: 1px solid #333;
  background: #000;
  padding: 10px 16px 12px;
  min-width: 240px;
}
#controls.open #controls-panel { display: flex; }

.ctrl-row {
  color: #555; font-size: 13px; letter-spacing: 0.08em;
  text-transform: uppercase; line-height: 2;
  pointer-events: none;
}
.ctrl-types { color: #444; }
.ctrl-divider {
  width: 100%; height: 1px; background: #222; margin: 4px 0;
}

#type-picker {
  position: fixed;
  display: flex;
  gap: 6px;
  z-index: 101;
}

.type-btn {
  background: #000; color: #fff; border: 1px solid #333;
  font-family: "Noto Sans Mono", "Courier New", monospace; font-size: 17px;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 12px; cursor: pointer;
  transition: background 0.08s, color 0.08s;
}
.type-btn:hover { border-color: #fff; }
.type-btn.active { background: #fff; color: #000; border-color: #fff; }

#ui-right {
  position: fixed; top: 14px; right: 18px; z-index: 10;
  display: flex; gap: 8px;
}

#ui-export {
  position: fixed; bottom: 18px; right: 18px; z-index: 10;
}
#create-panel input::placeholder { color: #333; }

#ui-auth { display: flex; align-items: center; margin-left: 8px; }
a.btn { text-decoration: none; }

.auth-menu { position: relative; }
.auth-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px); right: 0;
  background: #000; border: 1px solid #333;
  padding: 10px 14px;
  flex-direction: column; gap: 8px;
  white-space: nowrap; z-index: 100;
}
.auth-dropdown.open { display: flex; }
.auth-email {
  color: #555; font-size: 13px;
  letter-spacing: 0.08em; text-transform: uppercase;
  pointer-events: none;
}

/* ─── CONFIG MODAL ─────────────────────────────────────────── */
#cfg-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
}
#cfg-modal {
  background: #000; border: 1px solid #fff;
  width: 540px; max-width: 92vw; max-height: 80vh;
  overflow-y: auto; font-family: "Noto Sans Mono", "Courier New", monospace;
}
.cfg-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px; border-bottom: 1px solid #222;
  color: #fff; font-size: 17px; letter-spacing: 0.2em; text-transform: uppercase;
}
.cfg-header .btn { border: none; padding: 2px 10px; font-size: 20px; }
.cfg-body { padding: 18px; }
.cfg-section-title {
  color: #555; font-size: 11px; letter-spacing: 0.15em;
  text-transform: uppercase; margin-bottom: 10px;
}
.cfg-row {
  display: grid;
  grid-template-columns: 110px 1fr 50px 50px;
  align-items: center; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid #111;
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
}
.cfg-col { color: #aaa; }
.cfg-col-id { color: #fff; }
.cfg-sample {
  display: flex; align-items: center; justify-content: center;
  height: 30px; padding: 0 10px;
  font-family: "Noto Sans Mono", "Courier New", monospace;
  font-size: 11px; letter-spacing: 0.12em;
  box-sizing: border-box;
}
.cfg-action-btn { font-size: 11px; padding: 3px 8px; letter-spacing: 0.1em; }
.cfg-form {
  border: 1px solid #222; padding: 14px 16px; margin: 12px 0;
}
.cfg-form-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
}
.cfg-form-row:last-child { margin-bottom: 0; }
.cfg-form label {
  color: #555; font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; width: 110px; flex-shrink: 0;
}
.cfg-form input[type="text"] {
  background: #000; color: #fff; border: 1px solid #333;
  font-family: "Noto Sans Mono", "Courier New", monospace; font-size: 13px;
  padding: 4px 8px; flex: 1; text-transform: uppercase;
}
.cfg-form input[type="text"]:disabled { color: #444; }
.cfg-form-actions { gap: 8px; margin-top: 4px; }

.cfg-border-pick { display: flex; gap: 6px; flex: 1; }
.cfg-border-opt {
  flex: 1; height: 32px; background: #000; cursor: pointer;
  border: none; border-bottom: 2px solid #444;
  font-family: "Noto Sans Mono", "Courier New", monospace;
  font-size: 10px; color: #444; letter-spacing: 0.12em; text-transform: uppercase;
  transition: color 0.08s, background 0.08s, border-color 0.08s;
}
.cfg-border-opt.active { color: #fff; background: #111; border-bottom-color: #fff; }

.cfg-color-pick { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; align-content: flex-start; }
.cfg-color-chip {
  width: 22px; height: 22px; border: 1px solid #333;
  cursor: pointer; padding: 0; flex-shrink: 0;
}
.cfg-color-chip.active { outline: 2px solid #fff; outline-offset: 2px; }
