:root {
  --panel-color: #ffd7a0;
  --brightness: 1;
}
* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--panel-color);
  filter: brightness(var(--brightness));
  transition: background-color 120ms linear, filter 80ms linear;
  cursor: none; /* hide cursor for light effect; UI will bring it back */
}
/* The panel just fills the screen; background is applied on body */
.panel {
  height: 100%;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.annotation-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.annotation-overlay.active {
  pointer-events: auto;
}

.annotation-overlay.type-mode {
  cursor: text;
}

.annotation-overlay.draw-mode {
  cursor: crosshair;
}

.annotation-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  touch-action: none;
}

.annotation-text-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-family: inherit;
}

.text-note {
  position: absolute;
  min-width: 120px;
  min-height: 36px;
  padding: 4px 6px;
  color: rgba(15, 15, 18, 0.92);
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.75);
  font-size: clamp(18px, 3vw, 42px);
  line-height: 1.3;
  border: none;
  outline: none;
  background: transparent;
  pointer-events: auto;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
}

.text-note:focus {
  box-shadow: 0 0 0 2px rgba(15, 15, 18, 0.2);
  border-radius: 6px;
}

.text-note[data-empty="true"] {
  opacity: 0.65;
}

/* Controls bar */
.controls {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(15, 15, 18, 0.92);
  color: #f5f5f7;
  padding: 10px 12px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, sans-serif;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transform: translateY(-100%);
  transition: transform 160ms ease;
  z-index: 10;
  cursor: default;
}
.controls.visible {
  transform: translateY(0);
}
.controls .row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.label {
  opacity: 0.85;
  font-size: 12px;
  letter-spacing: .02em;
}
.value {
  min-width: 60px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}
input[type="color"] {
  appearance: none;
  border: none;
  width: 34px;
  height: 28px;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
input[type="range"] {
  width: 200px;
  cursor: pointer;
}
.select {
  background: #2b2f36;
  color: #fff;
  border: 1px solid #3a3f47;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
}
.select:hover {
  background: #323844;
}
.select:focus {
  outline: none;
  border-color: #4a90ff;
  box-shadow: 0 0 0 2px rgba(74, 144, 255, 0.25);
}
.btn {
  background: #2b2f36;
  color: #fff;
  border: 1px solid #3a3f47;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover {
  background: #323844;
}
.btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.btn.icon-btn {
  width: 34px;
  height: 34px;
  padding: 6px;
  justify-content: center;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* Show cursor while hovering UI */
.controls:hover ~ .panel, .controls.visible ~ .panel {
  cursor: default;
}
