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

html, body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #000;
  width: 100%;
  height: 100%;
  font-family: "DejaVu Sans", sans-serif;
}

canvas {
  position: fixed;
  top: 0;
  left: 0;
  display: block;
}

/* ── Settings gear button ── */
#settings-btn {
  position: fixed;
  bottom: 12px;
  right: 14px;
  background: none;
  border: none;
  color: #606070;
  font-size: 22px;
  cursor: pointer;
  z-index: 10;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s;
}
#settings-btn:hover { color: #a0a0b0; }

/* ── Settings overlay ── */
#settings-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.80);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
#settings-overlay.visible { display: flex; }

#settings-box {
  background: #16161f;
  border: 1px solid #44aacc;
  border-radius: 10px;
  padding: 32px 36px;
  width: 400px;
  color: #c0c0d0;
  box-shadow: 0 0 40px rgba(0,0,0,0.8);
}

#settings-box h2 {
  margin: 0 0 24px;
  color: #e8e8f8;
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid #2c2c3c;
  padding-bottom: 14px;
}

#settings-box label {
  display: block;
  font-size: 11px;
  margin-bottom: 5px;
  color: #7070a0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#settings-box input {
  display: block;
  width: 100%;
  background: #0c0c14;
  border: 1px solid #404058;
  border-radius: 4px;
  color: #e8e8f8;
  font-size: 15px;
  font-family: "DejaVu Sans", sans-serif;
  padding: 8px 10px;
  margin-bottom: 18px;
  outline: none;
  transition: border-color 0.15s;
}
#settings-box input:focus { border-color: #44aacc; }

.settings-row {
  display: flex;
  flex-direction: row;
  gap: 16px;
}
.settings-row > div { flex: 1; min-width: 0; }

.detect-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -6px 0 14px;
}

#btn-detect {
  background: none;
  border: 1px solid #404058;
  border-radius: 4px;
  color: #44aacc;
  font-size: 12px;
  padding: 5px 12px;
  cursor: pointer;
  font-family: "DejaVu Sans", sans-serif;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}
#btn-detect:hover { border-color: #44aacc; color: #66bbdd; }
#btn-detect:disabled { color: #484860; border-color: #2c2c3c; cursor: default; }

#detect-status {
  font-size: 11px;
  color: #7070a0;
}

.hint {
  font-size: 11px;
  color: #484860;
  margin: -12px 0 18px;
}

.btn-row {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

#btn-cancel {
  background: none;
  border: 1px solid #404058;
  border-radius: 4px;
  color: #8080a0;
  font-size: 13px;
  padding: 8px 20px;
  cursor: pointer;
  font-family: "DejaVu Sans", sans-serif;
  transition: color 0.15s, border-color 0.15s;
}
#btn-cancel:hover { color: #c0c0d0; border-color: #606080; }

#btn-save {
  background: #44aacc;
  border: 1px solid #44aacc;
  border-radius: 4px;
  color: #000;
  font-size: 13px;
  font-weight: bold;
  padding: 8px 22px;
  cursor: pointer;
  font-family: "DejaVu Sans", sans-serif;
  transition: background 0.15s;
}
#btn-save:hover { background: #66bbdd; }
