/* MyWall — “on steroids” modern retro wall */

:root {
  --bg0: #070815;
  --bg1: #0b1231;
  --glass: rgba(255, 255, 255, 0.07);
  --glass-2: rgba(255, 255, 255, 0.1);
  --stroke: rgba(255, 255, 255, 0.16);
  --stroke-2: rgba(255, 255, 255, 0.24);
  --shadow: rgba(0, 0, 0, 0.45);
  --ink: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.7);
  --muted-2: rgba(255, 255, 255, 0.55);
  --focus: #7c3aed;
  --accent: #22c55e;
  --accent2: #60a5fa;
  --danger: #fb7185;

  --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans",
    "Apple Color Emoji", "Segoe UI Emoji";
  --font-note: ui-rounded, "SF Pro Rounded", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --sidebar: 21rem;
  --radius: 18px;
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(1200px 900px at 15% 10%, rgba(124, 58, 237, 0.32), transparent 55%),
    radial-gradient(900px 700px at 85% 15%, rgba(96, 165, 250, 0.22), transparent 60%),
    radial-gradient(900px 700px at 55% 95%, rgba(34, 197, 94, 0.16), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

/* Ambient drift + noise overlay */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: -20%;
  pointer-events: none;
  z-index: -1;
}

body::before {
  background:
    radial-gradient(600px 420px at 20% 20%, rgba(124, 58, 237, 0.24), transparent 60%),
    radial-gradient(520px 420px at 80% 30%, rgba(96, 165, 250, 0.2), transparent 62%),
    radial-gradient(560px 520px at 60% 85%, rgba(34, 197, 94, 0.16), transparent 60%);
  filter: blur(10px) saturate(1.3);
  opacity: 0.9;
  animation: drift 18s ease-in-out infinite alternate;
}

body::after {
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    radial-gradient(rgba(0, 0, 0, 0.06) 1px, transparent 1px);
  background-size: 3px 3px, 5px 5px;
  mix-blend-mode: overlay;
  opacity: 0.25;
  animation: noiseShift 1.2s steps(2, end) infinite;
}

@keyframes drift {
  0% {
    transform: translate3d(-2%, -1%, 0) rotate(-1deg);
  }
  100% {
    transform: translate3d(2.5%, 2%, 0) rotate(1.2deg);
  }
}

@keyframes noiseShift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  25% {
    transform: translate3d(-1%, 0.6%, 0);
  }
  50% {
    transform: translate3d(0.8%, -0.7%, 0);
  }
  75% {
    transform: translate3d(-0.4%, -0.9%, 0);
  }
  100% {
    transform: translate3d(0.6%, 0.2%, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after {
    animation: none !important;
  }
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -100%;
  z-index: 9999;
  padding: 0.35rem 0.6rem;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 0.9rem;
  border-radius: 999px;
  backdrop-filter: blur(10px);
}

.skip-link:focus {
  top: 0.75rem;
  outline: 3px solid rgba(124, 58, 237, 0.5);
  outline-offset: 3px;
}

/* Top bar — modern glass with retro sparkle */
.topbar {
  position: sticky;
  top: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.9rem;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.topbar__home {
  font-weight: 800;
  text-decoration: none;
  color: var(--ink);
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.topbar__home:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.topbar__brand {
  display: grid;
  line-height: 1.05;
}

.topbar__title {
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
}

.topbar__tag {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  letter-spacing: 0.03em;
}

.topbar__right {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ui-btn,
.ui-file {
  font-family: var(--font-ui);
  font-weight: 900;
  font-size: 0.85rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.ui-btn:hover,
.ui-file:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
}

.ui-btn:active,
.ui-file:active {
  transform: translateY(0px) scale(0.99);
}

.ui-btn:focus-visible,
.ui-file:focus-within {
  outline: 3px solid rgba(124, 58, 237, 0.55);
  outline-offset: 3px;
}

.ui-file {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.ui-file input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* App layout */
.app {
  height: calc(100% - 0px);
  display: grid;
  grid-template-columns: 1fr var(--sidebar);
  min-height: 0;
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: -1;
  }
}

/* Wall */
.wall {
  position: relative;
  overflow: auto;
  background: transparent;
}

/* Animated “web 1.0 meets cyber” grid + noise */
.wall::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 700px at 40% 20%, rgba(124, 58, 237, 0.18), transparent 58%),
    radial-gradient(900px 700px at 70% 65%, rgba(96, 165, 250, 0.14), transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: auto, auto, 26px 26px, 26px 26px;
  opacity: 0.55;
  pointer-events: none;
  filter: saturate(1.2);
}

.wall__surface {
  position: relative;
  width: 2200px;
  height: 1600px;
  min-width: 100%;
  min-height: 100%;
}

/* HUD chips */
.wall__hud {
  position: sticky;
  top: 0.75rem;
  left: 0.75rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem;
  pointer-events: none;
  z-index: 5;
}

.hud-chip {
  pointer-events: none;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.92);
  font-weight: 900;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  backdrop-filter: blur(10px);
}

.hud-chip--muted {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

/* Sidebar */
.sidebar {
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.12);
  padding: 1rem;
  overflow: auto;
  backdrop-filter: blur(14px);
}

.sidebar__section {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  padding: 0.95rem;
  margin-bottom: 0.9rem;
  border-radius: var(--radius);
}

.sidebar__section--small {
  padding: 0.6rem 0.75rem;
}

.sidebar__heading {
  margin: 0 0 0.35rem;
  font-size: 0.98rem;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.92);
}

.sidebar__hint {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

.templates {
  display: grid;
  gap: 0.5rem;
}

.template {
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  padding: 0.7rem 0.75rem;
  cursor: grab;
  user-select: none;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, filter 0.12s ease;
}

.template:active {
  cursor: grabbing;
}

.template:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.45);
  filter: saturate(1.06);
}

.template__title {
  display: block;
  font-weight: 950;
  font-size: 0.95rem;
  color: rgba(0, 0, 0, 0.9);
}

.template__sub {
  display: block;
  font-size: 0.82rem;
  opacity: 0.78;
  color: rgba(0, 0, 0, 0.75);
}

.template__meta {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  opacity: 0.85;
  color: rgba(0, 0, 0, 0.72);
}

/* Template previews */
.template--sticky-a {
  background:
    radial-gradient(100px 60px at 25% 20%, rgba(255, 255, 255, 0.65), transparent 60%),
    linear-gradient(135deg, #fff6a8, #ffd24b);
}

.template--sticky-b {
  background:
    radial-gradient(110px 70px at 25% 20%, rgba(255, 255, 255, 0.6), transparent 60%),
    linear-gradient(135deg, #b6ffe6, #5ce6b0);
}

.template--sticky-c {
  background:
    radial-gradient(110px 70px at 25% 20%, rgba(255, 255, 255, 0.6), transparent 60%),
    linear-gradient(135deg, #ffd0e6, #ff77b7);
}

.template--paper {
  background:
    radial-gradient(120px 70px at 25% 20%, rgba(255, 255, 255, 0.75), transparent 60%),
    linear-gradient(180deg, #ffffff, #f4f6ff);
}

.howto {
  margin: 0.25rem 0 0;
  padding-left: 1.05rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.78);
}

.howto strong {
  font-weight: 900;
}

.status {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  min-height: 1.15rem;
}

/* Notes */
.note {
  position: absolute;
  left: 80px;
  top: 80px;
  width: 240px;
  height: 220px;
  border: 1px solid rgba(0, 0, 0, 0.22);
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.35),
    0 4px 0 rgba(0, 0, 0, 0.14);
  font-family: var(--font-note);
  color: rgba(0, 0, 0, 0.86);
  user-select: none;
  transform: rotate(var(--rot, 0deg));
  border-radius: 18px;
  overflow: hidden;
  transition: box-shadow 0.12s ease, transform 0.12s ease;
  background: #fff;
}

.note--pop {
  animation: notePop 520ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

@keyframes notePop {
  0% {
    transform: rotate(var(--rot, 0deg)) scale(0.92) translateY(6px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  }
  55% {
    transform: rotate(calc(var(--rot, 0deg) + 1.2deg)) scale(1.02) translateY(-2px);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
  }
  100% {
    transform: rotate(var(--rot, 0deg)) scale(1) translateY(0);
    box-shadow:
      0 22px 60px rgba(0, 0, 0, 0.35),
      0 4px 0 rgba(0, 0, 0, 0.14);
  }
}

.note.is-selected {
  outline: 3px solid rgba(124, 58, 237, 0.45);
  outline-offset: 4px;
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(124, 58, 237, 0.25);
}

.note__header {
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 0.35rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.16);
  cursor: grab;
  backdrop-filter: blur(10px);
}

.note__header:active {
  cursor: grabbing;
}

.note__title {
  font-size: 0.8rem;
  font-weight: 950;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note__x {
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: rgba(255, 255, 255, 0.75);
  font-weight: 900;
  width: 22px;
  height: 20px;
  line-height: 16px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  transition: transform 0.12s ease, background 0.12s ease;
}

.note__x:active {
  transform: scale(0.98);
}

.note__body {
  height: calc(100% - 26px);
  padding: 0.7rem 0.75rem;
  overflow: auto;
  font-size: 0.98rem;
  line-height: 1.25;
  user-select: text;
  white-space: pre-wrap;
}

.note__body:focus-visible {
  outline: 3px solid rgba(124, 58, 237, 0.4);
  outline-offset: 2px;
}

.note__resize {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.08));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  opacity: 0.85;
}

.note__resize::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.12));
  opacity: 0.75;
}

.note:hover .note__resize {
  opacity: 1;
}

/* Note looks */
.note--sticky-a {
  background:
    radial-gradient(140px 80px at 25% 10%, rgba(255, 255, 255, 0.62), transparent 60%),
    linear-gradient(135deg, #fff6a8, #ffd24b);
}

.note--sticky-a .note__header {
  background: rgba(255, 255, 255, 0.35);
}

.note--sticky-b {
  background:
    radial-gradient(140px 80px at 25% 10%, rgba(255, 255, 255, 0.6), transparent 60%),
    linear-gradient(135deg, #b6ffe6, #5ce6b0);
}

.note--sticky-b::after {
  content: "";
  position: absolute;
  right: 10px;
  top: -10px;
  width: 78px;
  height: 32px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(0, 0, 0, 0.22);
  transform: rotate(8deg);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  border-radius: 10px;
}

.note--sticky-c {
  background:
    radial-gradient(140px 80px at 25% 10%, rgba(255, 255, 255, 0.6), transparent 60%),
    linear-gradient(135deg, #ffd0e6, #ff77b7);
}

.note--sticky-c .note__body {
  background-image:
    radial-gradient(rgba(0, 0, 0, 0.08) 1px, transparent 1px);
  background-size: 14px 14px;
}

.note--paper {
  background: linear-gradient(180deg, #ffffff, #f4f6ff);
}

.note--paper .note__header {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.35));
}

.note--paper .note__body {
  background-image:
    linear-gradient(rgba(96, 165, 250, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(248, 113, 113, 0.28) 2px, transparent 2px);
  background-size: 100% 22px, 100% 100%;
  background-position: 0 6px, 34px 0;
}

/* Trash */
.trash {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 3000;
  width: 104px;
  height: 104px;
  user-select: none;
  cursor: default;
}

.trash__icon {
  width: 100%;
  height: 78px;
  display: grid;
  gap: 8px;
}

.trash__lid {
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.35);
  border-radius: 14px;
  backdrop-filter: blur(10px);
}

.trash__bin {
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.35);
  border-radius: 18px;
  backdrop-filter: blur(10px);
}

.trash__label {
  margin-top: 8px;
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.86);
  text-shadow: 0 10px 22px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.trash.is-hot .trash__lid,
.trash.is-hot .trash__bin {
  border-color: rgba(251, 113, 133, 0.6);
  box-shadow:
    0 26px 60px rgba(0, 0, 0, 0.42),
    0 0 0 2px rgba(251, 113, 133, 0.12),
    0 0 30px rgba(251, 113, 133, 0.28);
}

.trash.is-hot .trash__icon {
  animation: trashWiggle 420ms ease-in-out infinite;
}

@keyframes trashWiggle {
  0% {
    transform: rotate(0deg) translateY(0);
  }
  25% {
    transform: rotate(-3deg) translateY(-1px);
  }
  50% {
    transform: rotate(2deg) translateY(0);
  }
  75% {
    transform: rotate(-2deg) translateY(-1px);
  }
  100% {
    transform: rotate(0deg) translateY(0);
  }
}

/* Toast */
.toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 3500;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.5);
  padding: 0.7rem 0.75rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  max-width: min(520px, calc(100vw - 28px));
  border-radius: 16px;
  backdrop-filter: blur(12px);
}

.toast__msg {
  font-size: 0.9rem;
  font-weight: 850;
}

.toast__btn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(124, 58, 237, 0.22);
  color: rgba(255, 255, 255, 0.92);
  font-weight: 950;
  padding: 0.45rem 0.7rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  border-radius: 999px;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.toast__btn:active {
  transform: scale(0.99);
}

.toast__btn:focus-visible {
  outline: 3px solid rgba(124, 58, 237, 0.55);
  outline-offset: 3px;
}

/* Drag ghost */
.drag-ghost {
  position: fixed;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.85;
  transform: translate(-50%, -20%);
  border: 1px solid rgba(0, 0, 0, 0.22);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.4);
  border-radius: 18px;
}

/* Small screens: keep sidebar usable */
@media (max-width: 860px) {
  .sidebar {
    border-left: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }
}

