:root{
  --bg: #0b1220;
  --panel: rgba(17,24,39,0.55);
  --border: rgba(255,255,255,0.08);
  --text: #e5e7eb;
  --muted: rgba(229,231,235,0.78);
  --accent: #7dd3fc;
}

*{ box-sizing: border-box; }
html, body{ height:100%; scroll-behavior: smooth; }

body{
  margin:0;
  color-scheme: dark;
  background: var(--bg) !important;
  background-image:
    radial-gradient(1200px 700px at 20% 10%, rgba(125,211,252,0.10), transparent 55%),
    radial-gradient(900px 600px at 75% 30%, rgba(167,139,250,0.10), transparent 50%),
    linear-gradient(180deg, rgba(0,0,0,0.10), rgba(0,0,0,0.55)) !important;
  color: var(--text) !important;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif !important;
}

.wrap{
  max-width: 1100px;
  margin: 22px auto;
  padding: 0 16px 36px;
}

.hero{
  display:flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(10,12,18,0.70);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 60px rgba(0,0,0,0.35);
}

.hero h1{
  margin:0;
  font-size: clamp(24px, 3.2vw, 42px);
  letter-spacing: .2px;
}

.sub{
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 62ch;
  font-size: clamp(14px, 1.6vw, 16px);
}

.chips{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.chip{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  user-select:none;
}
.chip b{ color: var(--accent); }

.hero-right{
  display:flex;
  align-items:flex-start;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: transform .08s ease, background .12s ease;
}
.btn:hover{ background: rgba(255,255,255,0.10); }
.btn:active{ transform: translateY(1px); }
.btn.primary{
  border-color: rgba(125,211,252,0.35);
  background: linear-gradient(180deg, rgba(125,211,252,0.16), rgba(125,211,252,0.06));
}

.fileBtn input{ display:none; }

/* Board (Forever rolling) */
.board{
  position: relative;
  margin-top: 14px;

  /* big starting canvas; JS grows it forever */
  min-height: 1400px;
  height: auto;

  border-radius: 18px;
  background: rgba(17,24,39,0.35);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 60px rgba(0,0,0,0.25);

  /* keep notes contained visually */
  overflow: hidden;
}

/* Sticky notes */
.note{
  position:absolute;
  width: 240px;
  min-height: 150px;
  padding: 12px 12px 10px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.18);
  box-shadow: 0 18px 45px rgba(0,0,0,0.35);
  cursor: grab;
  user-select: none;
  transform-origin: center;
  touch-action: none; /* helps dragging on touch */
}
.note:active{ cursor: grabbing; }

.note .top{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.pin{
  width: 10px; height:10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.35);
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}

.note .meta{
  font-size: 11px;
  opacity: 0.7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note .text{
  font-size: 14px;
  line-height: 1.25;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Edit mode */
.note.editing{
  cursor: default;
  user-select: text;
}
.note textarea{
  width: 100%;
  min-height: 110px;
  resize: vertical;
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
  line-height: 1.25;
  background: rgba(255,255,255,0.35);
  color: #0b1220;
  outline: none;
}

/* Toast */
.toast{
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.toast.show{ opacity: 1; }

/* Responsive */
@media (max-width: 900px){
  .hero{ flex-direction: column; }
  .hero-right{ justify-content: flex-start; }
  .note{ width: 220px; }
}
@media (max-width: 520px){
  .note{ width: 200px; }
  .board{ min-height: 1500px; } /* slightly larger start on phones */
}
