/* Sticky Wall / Neocities front-end */

:root {
  --bg: #ffffff;
  --ink: #141414;
  --muted: rgba(20, 20, 20, 0.52);
  --line: rgba(20, 20, 20, 0.16);
  --panel: rgba(255, 255, 255, 0.82);
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.12);
  --world-width: 4200px;
  --world-height: 3000px;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 11px;
  cursor: pointer;
}

button:hover {
  border-color: rgba(20, 20, 20, 0.42);
}

button.active {
  background: #141414;
  color: #fff;
}

.toolbar {
  position: relative;
}

.toolbar label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: rgba(20, 20, 20, 0.72);
}

.color-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(20, 20, 20, 0.16);
  background: #111;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.color-dot:focus-visible {
  outline: 2px solid rgba(20, 20, 20, 0.7);
  outline-offset: 2px;
}

.hsl-picker {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(20, 20, 20, 0.14);
  box-shadow: 0 18px 50px rgba(10, 10, 10, 0.12);
  align-items: center;
}

.hsl-picker.bubble {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  transform: none;
  z-index: 15;
  width: 220px;
}

.hsl-picker.hidden {
  display: none;
}

.hsl-surface {
  position: relative;
  width: 100%;
  max-width: 220px;
  height: 120px;
  border-radius: 14px;
  overflow: hidden;
  cursor: crosshair;
  background: linear-gradient(to right, #fff, #fff);
  box-shadow: inset 0 0 0 1px rgba(20, 20, 20, 0.08);
}

.hsl-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(20, 20, 20, 0.9);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hsl-controls {
  display: grid;
  gap: 8px;
  width: 100%;
  align-items: center;
}

.hsl-range-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hsl-range-label input {
  flex: 1;
  width: 100%;
}

.color-preview {
  width: 100%;
  max-width: 220px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(20, 20, 20, 0.12);
  background: #111;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sr-only {
  position: absolute;
  left: -9999px;
}

.hidden {
  display: none !important;
}

.note-actions {
  position: absolute;
  top: -52px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0;
  z-index: 12;
}

.note-actions button {
  pointer-events: auto;
}

.note-action {
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid rgba(20, 20, 20, 0.12);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 999px;
  color: #141414;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
  transition: all 130ms ease;
}

.note-action:hover,
.note-action:focus-visible {
  transform: translateY(-1px);
  background: #fff;
}

.note-action-refresh {
  color: #2d6bff;
}

.note-action-refresh .note-action-text,
.note-action-refresh .note-action-check {
  display: none;
}

.note-action-refresh.confirm-pending {
  padding-right: 10px;
}

.note-action-refresh.confirm-pending .note-action-text,
.note-action-refresh.confirm-pending .note-action-check {
  display: inline;
}

.note-action-refresh.confirm-pending .note-action-icon {
  margin-left: 0;
}

.note-action-check {
  color: #2d6bff;
  font-weight: 700;
}

.gate {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #fff;
  z-index: 10;
  transition:
    opacity 720ms ease,
    filter 900ms ease,
    transform 900ms cubic-bezier(.15,.9,.2,1);
}

.gate.melting {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(34px) scaleY(0.92);
  pointer-events: none;
}

.password-card {
  position: relative;
  width: min(270px, calc(100vw - 40px));
  transform-origin: center bottom;
  transition:
    transform 780ms cubic-bezier(.16,.84,.25,1),
    opacity 500ms ease,
    border-radius 500ms ease;
}

.gate.melting .password-card {
  transform: scaleX(0.92) scaleY(0.72) translateY(28px);
  opacity: 0;
}

.password-card::after {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% - 3px);
  width: 12px;
  height: 0;
  border-radius: 0 0 999px 999px;
  background: #111;
  transform: translateX(-50%);
  opacity: 0;
  transition: height 780ms ease 80ms, opacity 300ms ease 80ms;
}

.gate.melting .password-card::after {
  height: 80px;
  opacity: 1;
}

#passwordInput {
  width: 100%;
  height: 46px;
  border: 1px solid rgba(20, 20, 20, 0.28);
  background: transparent;
  border-radius: 4px;
  text-align: center;
  color: var(--ink);
  outline: none;
  letter-spacing: 0.05em;
}

#passwordInput:focus {
  border-color: rgba(20, 20, 20, 0.68);
}

#passwordInput::placeholder {
  color: rgba(20, 20, 20, 0.42);
}

.gate-message {
  height: 18px;
  margin: 10px 0 0;
  text-align: center;
  font-size: 12px;
  color: rgba(20, 20, 20, 0.48);
}

.wall-screen {
  position: fixed;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 850ms ease 200ms;
}

.wall-screen.visible {
  opacity: 1;
  pointer-events: auto;
}

.prompt-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  z-index: 20;
}

.prompt-layer.hidden {
  display: none;
}

.prompt-card {
  width: min(320px, calc(100vw - 32px));
  padding: 22px 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.14);
  border: 1px solid rgba(20, 20, 20, 0.08);
  text-align: center;
}

.prompt-message {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
}

.prompt-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.button-primary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  font: inherit;
  border-radius: 999px;
  padding: 10px 18px;
  border: 1px solid rgba(20, 20, 20, 0.08);
  cursor: pointer;
}

.button-primary {
  background: #141414;
  color: #fff;
}

.button-secondary {
  background: #fff;
  color: var(--ink);
}

.button-secondary:hover,
.button-primary:hover {
  opacity: 0.94;
}

.viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: default;
  background:
    linear-gradient(rgba(20,20,20,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20,20,20,0.025) 1px, transparent 1px),
    #fff;
  background-size: 42px 42px;
}

.viewport.panning {
  cursor: grabbing;
}

.bounds-indicator {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.bounds-indicator .edge {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transition: opacity 140ms ease;
}

.bounds-indicator .edge.top,
.bounds-indicator .edge.bottom {
  left: 0;
  width: 100%;
  height: 12px;
  background: linear-gradient(to bottom, rgba(20,20,20,0.22), transparent);
}

.bounds-indicator .edge.bottom {
  top: auto;
  bottom: 0;
  background: linear-gradient(to top, rgba(20,20,20,0.22), transparent);
}

.bounds-indicator .edge.left,
.bounds-indicator .edge.right {
  top: 0;
  width: 12px;
  height: 100%;
  background: linear-gradient(to right, rgba(20,20,20,0.22), transparent);
}

.bounds-indicator .edge.right {
  left: auto;
  right: 0;
  background: linear-gradient(to left, rgba(20,20,20,0.22), transparent);
}

.viewport.edge-top .bounds-indicator .edge.top,
.viewport.edge-bottom .bounds-indicator .edge.bottom,
.viewport.edge-left .bounds-indicator .edge.left,
.viewport.edge-right .bounds-indicator .edge.right {
  opacity: 1;
}

.world {
  position: absolute;
  width: var(--world-width);
  height: var(--world-height);
  left: 0;
  top: 0;
  background:
    radial-gradient(circle at center, rgba(20,20,20,0.03), transparent 60%),
    rgba(255,255,255,0.98);
  border: 1px solid rgba(20,20,20,0.08);
  transform-origin: 0 0;
}

.mini-map {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 160px;
  height: 110px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(20, 20, 20, 0.08);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
  z-index: 30;
  backdrop-filter: blur(14px);
}

.mini-map canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 12px;
  background: rgba(255,255,255,0.9);
}

.placed-notes-layer,
.draft-layer {
  position: absolute;
  inset: 0;
}

.note {
  position: absolute;
  width: 240px;
  height: 240px;
  background: var(--note-color, #fff39a);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
  border-radius: 2px 2px 10px 2px;
  overflow: visible;
  user-select: none;
}

.note-slam {
  animation: slam-down 420ms cubic-bezier(0.33, 1.5, 0.55, 1.05) forwards;
}

@keyframes slam-down {
  0% {
    transform: translateY(-24px) scale(1.045);
    box-shadow: 0 28px 48px rgba(0, 0, 0, 0.22);
  }
  42% {
    transform: translateY(14px) scale(0.94);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.20);
  }
  70% {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 22px 36px rgba(0, 0, 0, 0.18);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
  }
}

.note.active {
  position: relative;
}

.note.active::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 4px 4px 12px 4px;
  pointer-events: none;
  box-shadow: 0 0 0 2px rgba(255, 90, 90, 0.35), 0 0 18px rgba(255, 90, 90, 0.18);
  opacity: 0.95;
  animation: pulse-outline 1.6s ease-in-out infinite;
}

@keyframes pulse-outline {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(255, 90, 90, 0.35), 0 0 18px rgba(255, 90, 90, 0.18);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(255, 90, 90, 0.16), 0 0 24px rgba(255, 90, 90, 0.24);
  }
}

.note::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255,255,255,.28), transparent 45%),
    radial-gradient(circle at 70% 120%, rgba(0,0,0,.08), transparent 34%);
  pointer-events: none;
  border-radius: inherit;
}

.note.placed {
  cursor: default;
}

.note.active .pin {
  border-color: rgba(20, 20, 20, 0.25);
  box-shadow: 0 5px 12px rgba(0,0,0,.18);
}

.note.admin-delete-target {
  outline: 2px dashed rgba(255, 0, 80, 0.85);
  cursor: not-allowed;
}

.note.admin-delete-selected {
  outline: 3px solid rgba(255, 70, 70, 0.85);
  box-shadow: 0 0 0 4px rgba(255, 70, 70, 0.14);
}

.note-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
  z-index: 2;
}

.pin {
  position: absolute;
  left: 50%;
  top: -14px;
  width: 26px;
  height: 26px;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff, transparent 18%),
    var(--pin-color, #e64b4b);
  border: 1px solid rgba(20,20,20,.25);
  box-shadow: 0 5px 12px rgba(0,0,0,.18);
  z-index: 5;
  cursor: grab;
}

.pin:active {
  cursor: grabbing;
}

.pin::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 17px;
  width: 2px;
  height: 18px;
  background: rgba(20, 20, 20, 0.55);
  transform: translateX(-50%);
}

.toolbar {
  position: fixed;
  left: 14px;
  top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(760px, calc(100vw - 28px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  z-index: 7;
  flex-wrap: wrap;
}

.toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.toolbar input[type="range"] {
  width: 92px;
}

.toolbar input[type="color"] {
  width: 34px;
  height: 28px;
  border: 0;
  background: transparent;
  padding: 0;
}

.microcopy {
  width: 100%;
  margin: 0;
  font-size: 11px;
  color: rgba(20,20,20,.42);
}

.admin-panel {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: 260px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  z-index: 8;
}

.admin-title {
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .08em;
}

.admin-panel button,
.admin-panel input,
.admin-panel select {
  width: 100%;
  margin-bottom: 8px;
}

.admin-panel input,
.admin-panel select {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: #fff;
  color: var(--ink);
}

.admin-panel button.active {
  background: #141414;
  color: #fff;
}

.code-options {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px);
  transition: max-height 240ms ease, opacity 240ms ease, transform 240ms ease;
}

.code-options.expanded {
  max-height: 240px;
  opacity: 1;
  transform: translateY(0);
}

.codes-panel {
  margin-top: 6px;
  padding: 10px;
  border: 1px solid rgba(20,20,20,.08);
  border-radius: 14px;
  background: #fff;
  max-height: 240px;
  overflow: auto;
  font-size: 12px;
  color: var(--ink);
}

.code-row {
  margin-bottom: 10px;
}

.code-row:last-child {
  margin-bottom: 0;
}

.code-meta-line {
  font-weight: 700;
  line-height: 1.4;
  word-break: break-word;
}

.code-hidden {
  margin-top: 4px;
  color: rgba(20,20,20,.52);
  font-size: 11px;
}

.code-meta-item {
  color: rgba(20,20,20,.76);
  font-size: 12px;
}

.admin-message {
  min-height: 16px;
  margin: 0;
  font-size: 11px;
  color: rgba(20,20,20,.52);
}

.corner-help {
  position: fixed;
  right: 14px;
  top: 14px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(20,20,20,.12);
  color: rgba(20,20,20,.45);
  font-size: 11px;
  z-index: 6;
}

@media (max-width: 760px) {
  .toolbar {
    right: 14px;
  }

  .corner-help {
    display: none;
  }

  .admin-panel {
    left: 14px;
    right: 14px;
    width: auto;
  }
}
