/* ===== КЛУБОЧЕК — детский блог ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --ink: #22203a;
  --card: #ffffff;
  --brand: #6c4cff;
  --brand2: #ff4fa3;
  --mint: #16d5a8;
  --sun: #ffd23f;
  --shadow: 0 8px 24px rgba(60, 40, 160, .14);
}
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background: linear-gradient(160deg, #eef1ff 0%, #ffeef8 45%, #e9fff8 100%);
  padding-bottom: 40px;
}
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

/* фоновые стикеры */
.bg-stickers { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.float-sticker { position: absolute; font-size: 44px; opacity: .35; animation: floaty 7s ease-in-out infinite; }
.s1 { top: 12%; left: 4%; } .s2 { top: 65%; left: 8%; animation-delay: 1.2s; }
.s3 { top: 20%; right: 6%; animation-delay: .6s; } .s4 { top: 75%; right: 4%; animation-delay: 2s; }
.s5 { top: 45%; left: 48%; animation-delay: 1.6s; }
@keyframes floaty { 0%,100% { transform: translateY(0) rotate(-6deg);} 50% { transform: translateY(-26px) rotate(8deg);} }

/* шапка */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.85); backdrop-filter: blur(8px); box-shadow: 0 2px 14px rgba(60,40,160,.12); }
.topbar__inner { max-width: 1180px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.logo__badge { width: 42px; height: 42px; display: grid; place-items: center; font-size: 22px; background: var(--sun); border: 3px solid var(--ink); border-radius: 14px; transform: rotate(-6deg); box-shadow: 3px 3px 0 var(--ink); }
.logo__text { font-weight: 900; font-size: 22px; letter-spacing: .5px; }
.logo__text em { color: var(--brand); font-style: normal; }
.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav__btn { padding: 9px 14px; border-radius: 999px; font-weight: 700; background: #f1eefe; transition: .15s; }
.nav__btn:hover { transform: translateY(-2px); }
.nav__btn.is-active { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(108,76,255,.4); }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 18px; border-radius: 14px; font-weight: 800; transition: .15s; }
.btn--primary { background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff; box-shadow: 0 6px 16px rgba(108,76,255,.4); }
.btn--primary:hover { transform: translateY(-2px) scale(1.02); }
.btn--ghost { background: #fff; border: 2px dashed var(--brand); color: var(--brand); }
.btn--ghost:hover { background: #f1eefe; }

/* раскладка */
.layout { position: relative; z-index: 1; max-width: 1180px; margin: 24px auto 0; padding: 0 20px; display: grid; grid-template-columns: 260px 1fr 260px; gap: 20px; align-items: start; }
.content { min-width: 0; }
.side { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 84px; }

/* карточки */
.card { background: var(--card); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); border: 2px solid #fff; }
.card__title { font-size: 16px; margin-bottom: 12px; }
.muted { color: #7b7a99; font-size: 13px; }

/* профиль */
.profile { text-align: center; }
.profile__avatar { position: relative; width: 92px; height: 92px; margin: 0 auto 10px; display: grid; place-items: center; font-size: 46px; background: linear-gradient(135deg, #ffe9f4, #e9fff8); border: 4px solid var(--brand); border-radius: 50%; transition: .2s; overflow: visible; }
.profile__avatar:hover { transform: rotate(4deg) scale(1.06); }
.profile__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-cam { position: absolute; right: -8px; bottom: -4px; width: 30px; height: 30px; display: grid; place-items: center; font-size: 15px; background: #fff; border: 2px solid var(--ink); border-radius: 50%; box-shadow: 2px 2px 0 var(--ink); }
.avatar-reset { display: block; margin: -4px auto 8px; font-size: 12px; font-weight: 700; color: var(--brand); text-decoration: underline; }
.avatar-reset[hidden] { display: none; }
.profile__name { display: block; width: 100%; text-align: center; font-weight: 900; font-size: 18px; border: 2px dashed transparent; border-radius: 10px; padding: 4px; background: #f7f6ff; }
.profile__name:focus { outline: none; border-color: var(--brand); }
.profile__bio { font-size: 13px; color: #7b7a99; margin: 6px 0 14px; }
.profile__stats { display: flex; justify-content: space-around; background: #f7f6ff; border-radius: 14px; padding: 10px 6px; }
.stat b { display: block; font-size: 18px; color: var(--brand); }
.stat span { font-size: 11px; color: #7b7a99; }

/* достижения */
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { font-size: 12px; font-weight: 700; background: #f1eefe; border: 2px solid #ded8ff; border-radius: 999px; padding: 6px 10px; opacity: .55; filter: grayscale(1); transition: .2s; }
.badge.is-on { opacity: 1; filter: none; background: var(--sun); border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }

/* баннер */
.banner { display: flex; gap: 16px; align-items: center; background: linear-gradient(135deg, var(--brand) 0%, var(--brand2) 100%); color: #fff; border-radius: 22px; padding: 22px; box-shadow: var(--shadow); margin-bottom: 20px; }
.banner__emoji { font-size: 54px; animation: wiggle 2.4s ease-in-out infinite; }
.banner h1 { font-size: 24px; margin-bottom: 6px; }
.banner p { font-size: 14px; opacity: .95; }
.accent { color: var(--sun); }
@keyframes wiggle { 0%,100% { transform: rotate(-8deg);} 50% { transform: rotate(10deg) scale(1.1);} }

/* вкладки */
.tab { display: none; }
.tab.is-active { display: block; animation: popin .25s ease; }
.tab__title { font-size: 22px; margin-bottom: 8px; }
@keyframes popin { from { opacity: 0; transform: translateY(10px);} to { opacity: 1; transform: none;} }

/* фильтры */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { padding: 8px 14px; border-radius: 999px; background: #fff; font-weight: 700; font-size: 13px; box-shadow: 0 3px 10px rgba(60,40,160,.1); transition: .15s; }
.chip:hover { transform: translateY(-2px); }
.chip.is-active { background: var(--ink); color: #fff; }

/* посты */
.feed { display: flex; flex-direction: column; gap: 18px; }
.post { background: var(--card); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); animation: popin .3s ease; }
.post__cover { height: 120px; display: grid; place-items: center; position: relative; }
.post__emoji { font-size: 64px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.2)); animation: floaty 5s ease-in-out infinite; }
.post__cat { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,.92); border-radius: 999px; font-size: 12px; font-weight: 800; padding: 5px 12px; }
.post__head { padding: 16px 18px 0; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.post__title { font-size: 20px; cursor: pointer; }
.post__title:hover { color: var(--brand); }
.post__date { font-size: 12px; color: #7b7a99; white-space: nowrap; }
.post__body { padding: 10px 18px 0; font-size: 15px; line-height: 1.55; white-space: pre-line; }
.post__tags { padding: 10px 18px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; font-weight: 700; color: var(--brand); background: #f1eefe; padding: 4px 9px; border-radius: 999px; }
.post__actions { display: flex; gap: 8px; padding: 14px 18px; flex-wrap: wrap; align-items: center; }
.act { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 999px; background: #f7f6ff; font-weight: 700; font-size: 13px; transition: .15s; }
.act:hover { background: #edeaff; transform: translateY(-2px); }
.act--like.is-on { background: #ffe9f1; color: #ff2e7e; }
.act--del { color: #d33; background: #fff0f0; margin-left: auto; }
.act--del:hover { background: #ffdcdc; }
.beat { animation: beat .35s ease; }
@keyframes beat { 0% { transform: scale(1);} 40% { transform: scale(1.5) rotate(-10deg);} 100% { transform: scale(1);} }
.post__views { font-size: 12px; color: #7b7a99; padding: 0 18px 6px; }

/* комменты */
.comments { background: #faf9ff; border-top: 2px dashed #e7e3ff; padding: 14px 18px; }
.cmt-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.comment { background: #fff; border-radius: 12px; padding: 8px 12px; font-size: 14px; box-shadow: 0 2px 6px rgba(60,40,160,.08); }
.comment b { color: var(--brand); }
.comment-form { display: flex; gap: 8px; }
.comment-form input { flex: 1; min-width: 0; border: 2px solid #e7e3ff; border-radius: 999px; padding: 9px 14px; background: #fff; }
.comment-form input:focus { outline: none; border-color: var(--brand); }
.comment-form button { background: var(--mint); color: #053a2e; font-weight: 800; border-radius: 999px; padding: 9px 16px; }
.comment-form button:hover { filter: brightness(1.05); }

/* пустое состояние */
.empty { text-align: center; padding: 40px 18px; }
.empty__emoji { font-size: 56px; animation: wiggle 2s infinite; margin-bottom: 10px; }

/* идеи */
.idea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 16px; }
.idea-card { text-align: left; background: #fff; border-radius: 16px; padding: 14px; box-shadow: var(--shadow); font-weight: 700; font-size: 14px; border: 2px solid transparent; transition: .15s; }
.idea-card:hover { transform: translateY(-4px) rotate(-1deg); border-color: var(--brand); }
.idea-card b { display: block; font-size: 22px; margin-bottom: 6px; }
.idea-out { margin-top: 16px; background: var(--sun); border: 3px solid var(--ink); border-radius: 18px; padding: 18px; box-shadow: 5px 5px 0 var(--ink); animation: popin .25s ease; }
.idea-out .big { font-size: 34px; margin-bottom: 8px; display: block; }
.idea-out h3 { font-size: 19px; margin-bottom: 6px; }
.idea-out p { font-size: 14px; margin-bottom: 12px; }

/* советы */
.tip-day { background: linear-gradient(135deg, #16d5a8, #0fa9c9); color: #04303a; border-radius: 18px; padding: 18px; font-size: 17px; font-weight: 800; margin: 14px 0; box-shadow: var(--shadow); }
.tips { display: flex; flex-direction: column; gap: 10px; }
.tip { background: #fff; border-radius: 14px; padding: 13px 15px; font-size: 14px; line-height: 1.5; box-shadow: 0 3px 10px rgba(60,40,160,.1); border-left: 5px solid var(--brand2); }
.tip b { display: block; margin-bottom: 3px; }

/* чек-лист */
.checklist-card { margin-top: 20px; }
.checklist { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: center; background: #f7f6ff; border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 600; }
.checklist li::before { content: "⬜"; }
.checklist li.done { text-decoration: line-through; opacity: .6; }
.checklist li.done::before { content: "✅"; }

/* тренд */
.trend { list-style: none; counter-reset: tr; display: flex; flex-direction: column; gap: 8px; }
.trend li { counter-increment: tr; display: flex; gap: 8px; font-size: 13px; font-weight: 700; background: #f7f6ff; border-radius: 12px; padding: 9px 11px; }
.trend li::before { content: counter(tr); background: var(--brand2); color: #fff; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; flex: none; }

/* модалка */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(34,32,58,.55); display: grid; place-items: center; padding: 20px; backdrop-filter: blur(3px); }
.modal[hidden] { display: none; }
.modal__card { width: min(640px, 100%); max-height: 92vh; overflow: auto; background: #fff; border-radius: 22px; padding: 22px; animation: popin .25s ease; }
.modal__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; background: #f1eefe; font-weight: 800; }
.icon-btn:hover { background: #ded8ff; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 11px; font-weight: 800; letter-spacing: .8px; color: #7b7a99; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; border: 2px solid #e7e3ff; border-radius: 12px; padding: 11px 13px; background: #faf9ff; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); }
.field-row { display: grid; grid-template-columns: 1fr 160px; gap: 12px; }
.emoji-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-pick button { font-size: 22px; width: 40px; height: 40px; border-radius: 10px; background: #f7f6ff; transition: .1s; }
.emoji-pick button.is-on { background: var(--sun); box-shadow: 2px 2px 0 var(--ink); transform: scale(1.1); }
.modal__foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.modal__actions { display: flex; gap: 10px; }

/* тост */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 200; background: var(--ink); color: #fff; font-weight: 700; font-size: 14px; padding: 13px 20px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.3); animation: popin .25s ease; }
.toast[hidden] { display: none; }

.footer { max-width: 1180px; margin: 34px auto 0; padding: 0 20px; text-align: center; font-size: 13px; color: #7b7a99; }

/* адаптив */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; }
  .side:last-child { order: 3; }
  .field-row { grid-template-columns: 1fr; }
}
