:root {
  --bg: #0d1027;
  --bg2: #141838;
  --card: rgba(255, 255, 255, 0.06);
  --stroke: rgba(255, 255, 255, 0.12);
  --text: #eef0ff;
  --muted: #9aa1cc;
  --accent: #7c5cff;
  --accent2: #ff5ca8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Rubik", system-ui, sans-serif;
  background:
    radial-gradient(1000px 600px at 80% -10%, #241a55 0%, transparent 60%),
    radial-gradient(800px 500px at -10% 30%, #12325a 0%, transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---------- фоновые блобы ---------- */
.bg-decor { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .35; animation: float 14s ease-in-out infinite; }
.b1 { width: 340px; height: 340px; background: #7c5cff; top: -80px; left: -60px; }
.b2 { width: 300px; height: 300px; background: #ff5ca8; bottom: -100px; right: -60px; animation-delay: -5s; }
.b3 { width: 260px; height: 260px; background: #3ec7ff; top: 45%; left: 55%; animation-delay: -9s; }
@keyframes float { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-40px) scale(1.08); } }

/* ---------- шапка ---------- */
.hero { position: relative; z-index: 1; text-align: center; padding: 56px 20px 28px; }
.hero-badge {
  display: inline-block; font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  padding: 7px 16px; border-radius: 999px; background: rgba(124, 92, 255, .18);
  border: 1px solid rgba(124, 92, 255, .5); color: #c9bcff; margin-bottom: 18px;
}
h1 { font-family: "Unbounded", sans-serif; font-size: clamp(34px, 6vw, 60px); font-weight: 700; line-height: 1.05; }
.accent {
  background: linear-gradient(90deg, #7c5cff, #ff5ca8, #3ec7ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.subtitle { color: var(--muted); max-width: 560px; margin: 14px auto 0; font-size: 17px; }

.stats { display: flex; gap: 14px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.stat {
  background: var(--card); border: 1px solid var(--stroke); border-radius: 16px;
  padding: 12px 22px; min-width: 110px; backdrop-filter: blur(10px);
}
.stat-num { display: block; font-family: "Unbounded"; font-size: 26px; font-weight: 700; color: #ffd76a; }
.stat-label { font-size: 13px; color: var(--muted); }

/* ---------- сетка ---------- */
.layout {
  position: relative; z-index: 1; display: grid; grid-template-columns: 340px 1fr;
  gap: 26px; max-width: 1180px; margin: 34px auto 0; padding: 0 20px 60px;
  align-items: start;
}
@media (max-width: 880px) { .layout { grid-template-columns: 1fr; } }

.card {
  background: rgba(20, 24, 56, .75); border: 1px solid var(--stroke);
  border-radius: 24px; padding: 24px; backdrop-filter: blur(14px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}

/* ---------- форма ---------- */
.composer { position: sticky; top: 20px; }
.composer h2, .feed-head h2 { font-family: "Unbounded"; font-size: 19px; margin-bottom: 18px; }
.field { display: block; margin-bottom: 16px; position: relative; }
.field > span:first-child { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; }
input[type="text"], textarea {
  width: 100%; background: rgba(255, 255, 255, .05); border: 1.5px solid var(--stroke);
  border-radius: 14px; padding: 12px 14px; color: var(--text); font: inherit; font-size: 15px;
  transition: border-color .2s, box-shadow .2s; resize: vertical;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(124, 92, 255, .18); }
input::placeholder, textarea::placeholder { color: #6b72a8; }
.counter { position: absolute; right: 4px; bottom: -18px; font-size: 12px; color: var(--muted); }
.counter b { color: #ffd76a; }

.palette { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; transition: transform .18s, border-color .18s; position: relative;
}
.swatch:hover { transform: scale(1.14); }
.swatch.active { border-color: #fff; transform: scale(1.14); }
.swatch.active::after {
  content: "✓"; position: absolute; inset: 0; display: grid; place-items: center;
  color: #1b1030; font-size: 15px; font-weight: 700;
}

.emoji-row { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.emoji-btn {
  font-size: 19px; background: rgba(255, 255, 255, .06); border: 1px solid var(--stroke);
  border-radius: 12px; width: 42px; height: 42px; cursor: pointer; transition: .18s;
}
.emoji-btn:hover { transform: translateY(-3px) scale(1.1); background: rgba(255, 255, 255, .14); }

.publish {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 9px;
  font: inherit; font-weight: 600; font-size: 16px; color: #fff; cursor: pointer;
  padding: 14px; border: none; border-radius: 16px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  box-shadow: 0 10px 26px rgba(124, 92, 255, .4);
  transition: transform .16s, box-shadow .16s, filter .16s;
}
.publish:hover { transform: translateY(-2px); filter: brightness(1.1); box-shadow: 0 14px 32px rgba(124, 92, 255, .55); }
.publish:active { transform: scale(.97); }
.publish:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.hint { font-size: 13px; color: #ff8f8f; min-height: 18px; margin-top: 10px; text-align: center; }

/* ---------- лента ---------- */
.feed-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.feed-head h2 { margin-bottom: 0; }
.filters { display: flex; gap: 8px; }
.chip {
  font: inherit; font-size: 13.5px; padding: 8px 15px; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--stroke); color: var(--muted);
  transition: .18s;
}
.chip:hover { color: var(--text); border-color: rgba(255, 255, 255, .3); }
.chip.active { background: linear-gradient(90deg, var(--accent), var(--accent2)); color: #fff; border-color: transparent; }

.wall { columns: 3 240px; column-gap: 16px; }
.note {
  break-inside: avoid; margin-bottom: 16px; border-radius: 18px; padding: 16px;
  color: #1b1030; position: relative; box-shadow: 0 12px 26px rgba(0, 0, 0, .3);
  transform: rotate(var(--rot, 0deg));
  animation: pop .4s cubic-bezier(.2, 1.4, .4, 1) both;
  transition: transform .2s, box-shadow .2s;
}
.note:hover { transform: rotate(0deg) translateY(-4px) scale(1.02); box-shadow: 0 18px 36px rgba(0, 0, 0, .45); z-index: 2; }
@keyframes pop { from { opacity: 0; transform: scale(.7) rotate(var(--rot, 0deg)); } to { opacity: 1; } }

.note::after {
  content: ""; position: absolute; top: -7px; left: 50%; transform: translateX(-50%) rotate(45deg);
  width: 14px; height: 14px; background: inherit; border-radius: 3px; box-shadow: 0 -3px 6px rgba(0,0,0,.15);
}
.note-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.note-author { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 7px; }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; background: rgba(0, 0, 0, .22);
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff;
}
.note-time { font-size: 11.5px; opacity: .65; }
.note-body { font-size: 15.5px; line-height: 1.45; word-wrap: break-word; white-space: pre-wrap; }

.note-actions { display: flex; gap: 8px; margin-top: 12px; align-items: center; flex-wrap: wrap; }
.react {
  display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: 13px;
  background: rgba(0, 0, 0, .16); color: inherit; border: 1.5px solid transparent;
  border-radius: 999px; padding: 5px 11px; cursor: pointer; transition: .15s;
}
.react:hover { background: rgba(0, 0, 0, .3); transform: translateY(-2px); }
.react.on { border-color: rgba(0, 0, 0, .45); background: rgba(255, 255, 255, .5); }
.react-add { opacity: .55; }
.react-add:hover { opacity: 1; }
.burst { position: absolute; pointer-events: none; font-size: 22px; animation: fly .8s ease-out forwards; }
@keyframes fly { to { transform: translateY(-70px) scale(1.8); opacity: 0; } }

.feed-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.local-badge {
  font-size: 12.5px; color: #9ef0c8; background: rgba(52, 211, 153, .12);
  border: 1px solid rgba(52, 211, 153, .4); padding: 7px 14px; border-radius: 999px;
}

.empty {
  text-align: center; color: var(--muted); padding: 50px 10px; font-size: 16px;
  background: var(--card); border: 1.5px dashed var(--stroke); border-radius: 22px;
}

/* ---------- удаление записок ---------- */
.note-del {
  width: 26px; height: 26px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(180, 20, 40, .85); color: #fff; font-size: 14px; line-height: 1;
  display: none; place-items: center; transition: transform .15s, background .15s;
}
.note-del.visible { display: grid; animation: pop .3s cubic-bezier(.2, 1.4, .4, 1) both; }
.note-del:hover { background: #ff2d4d; transform: scale(1.15); }

.wall.deleting .note { outline: 2px dashed rgba(255, 45, 77, .7); outline-offset: 3px; animation: shake .5s ease-in-out infinite; cursor: pointer; }
.wall.deleting .note:hover { outline-color: #ff2d4d; }
@keyframes shake {
  0%, 100% { transform: rotate(-1.2deg); }
  50% { transform: rotate(1.2deg); }
}
body.deleting .note::after { background: #ff2d4d; }

.feed-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-top: 18px;
}
.local-badge {
  font-size: 12.5px; color: var(--muted);
  background: var(--card); border: 1px solid var(--stroke);
  padding: 7px 14px; border-radius: 999px;
}

.footer { position: relative; z-index: 1; text-align: center; color: #6b72a8; font-size: 13px; padding: 0 20px 34px; }

/* ---------- тост ---------- */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 120px);
  background: linear-gradient(90deg, var(--accent), var(--accent2)); color: #fff;
  padding: 13px 26px; border-radius: 999px; font-weight: 500; font-size: 15px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .4); transition: transform .35s cubic-bezier(.2, 1.3, .4, 1);
  z-index: 50; text-align: center;
}
.toast.show { transform: translate(-50%, 0); }

@media (max-width: 520px) {
  .composer { position: static; }
  .wall { columns: 1; }
}
