@font-face{
  font-family:"VelaSans";
  src:url("../assets/fonts/VelaSans-Regular.ttf") format("truetype");
  font-weight:400;
  font-style:normal;
  font-display:swap;
}

:root{
  --text:#0e0e0e;
  --muted:#6b7280;
  --border:#d7d9df;
  --border2:#e7e8ec;
  --radius:16px;
  --container:1360px;
  --black:#0e0e0e;
  --bg:#ffffff;
  --soft:#f7f7f8;
  --soft2:#faf7ef;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family:"VelaSans",system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--text);
  background:var(--bg);
}

a{ color:inherit; }
button{ font:inherit; }

.page{
  width:min(var(--container), calc(100% - 64px));
  margin:0 auto;
  padding:24px 0 76px;
}

/* =========================
   TOPBAR
   ========================= */

.topbar{
  width:100%;
  margin:0;
  padding:22px 0;
  display:block;
}

.topbar__inner{
  width:min(var(--container), calc(100% - 64px));
  margin:0 auto;
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
}

.topbar__left{ justify-self:start; }
.topbar__right{ justify-self:end; }

.brand{
  display:flex;
  align-items:center;
  gap:20px;
  justify-self:center;
}

.brand__logo{
  height:24px;
  display:block;
}

.brand__divider{
  width:1px;
  height:42px;
  background:#c9c9c9;
}

.brand__title{
  font-weight:700;
  font-size:32px;
  line-height:1;
}

.pillBtn{
  height:42px;
  padding:0 30px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
  color:#111;
  font-size:13px;
  font-weight:900;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  white-space:nowrap;
  transition:transform .03s ease, opacity .15s ease, background .15s ease;
}

.pillBtn:active{
  transform:translateY(1px);
}

.pillBtn--dark{
  background:var(--black);
  border-color:var(--black);
  color:#fff;
}

.pillBtn--dark:hover{
  opacity:.94;
}

.pillBtn--light{
  background:#fff;
  border-color:var(--border);
  color:#111;
}

.pillBtn--light:hover{
  background:#f9fafb;
  opacity:.98;
}

/* =========================
   HERO
   ========================= */

.hero{
  display:grid;
  grid-template-columns:minmax(0, 1fr) 300px;
  gap:42px;
  align-items:start;
  margin-top:12px;
}

.profileHero{
  min-width:0;
}

.profileHero__top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:28px;
}

.profileHero__main{
  display:grid;
  grid-template-columns:132px minmax(0, 1fr);
  gap:26px;
  align-items:start;
  min-width:0;
}

.avatar{
  width:132px;
  height:132px;
  border-radius:999px;
  background:#f0f0f0;
  flex-shrink:0;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}

.avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.profileMeta{
  min-width:0;
  padding-top:6px;
}

.profileName{
  font-size:30px;
  font-weight:900;
  line-height:1.08;
  letter-spacing:-0.02em;
  word-break:break-word;
}

.profileLoc{
  margin-top:8px;
  color:#5f6169;
  font-size:14px;
  line-height:1.35;
}

.profileContacts{
  margin-top:16px;
  display:grid;
  gap:9px;
}

.contactLink{
  position:relative;
  padding-left:0;
  text-decoration:none;
  font-size:13px;
  color:#2e2f35;
  line-height:1.35;
  word-break:break-word;
}

.contactLink:hover{
  text-decoration:underline;
}

.contactLink::before{
  display:none;
}

.contactLink--site::before{
  border-radius:999px;
}

.socialRow{
  margin-top:20px;
  display:flex;
  gap:18px;
  flex-wrap:wrap;
  align-items:flex-start;
}

.socialItem{
  display:grid;
  justify-items:center;
  gap:8px;
}

.soc{
  width:36px;
  height:36px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
}

.soc:hover{
  background:#fafafa;
}

.socialLabel{
  font-size:10px;
  color:#7a7d86;
  text-align:center;
  line-height:1.2;
  max-width:84px;
}

.profileHero__actions{
  display:flex;
  flex-direction:column;
  gap:12px;
  align-items:flex-end;
}

/* =========================
   BALANCE
   ========================= */

.balanceWrap{
  display:flex;
  justify-content:flex-end;
}

.balanceCard{
  width:100%;
  border:1px solid var(--border);
  border-radius:18px;
  background:#fff;
  padding:22px 20px 18px;
}

.balanceLabel{
  font-size:12px;
  color:#60636c;
  margin-bottom:8px;
}

.balanceAmount{
  font-size:42px;
  font-weight:900;
  letter-spacing:-0.02em;
  line-height:1.05;
}

.balanceActions{
  margin-top:16px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* =========================
   SECTIONS
   ========================= */

.section{
  margin-top:26px;
}

.section--line{
  border-top:1px solid var(--border2);
  padding-top:18px;
}

.section__head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:18px;
  margin-bottom:8px;
}

.section__title{
  font-size:14px;
  font-weight:900;
  line-height:1.2;
}

.section__hint{
  font-size:9px;
  color:#7a7d86;
  line-height:1.2;
}
.section:has(.showcaseLayout) .section__hint{
  display:none;
}

/* =========================
   SUBSCRIPTIONS
   ========================= */

.subsRow{
  margin-top:16px;
  display:grid;
  grid-template-columns:minmax(0, 1fr) minmax(0, 1fr) 190px;
  gap:16px;
  align-items:stretch;
}

.subCard{
  min-height:92px;
  border:1px solid var(--border);
  border-radius:16px;
  background:#fff;
  padding:16px 16px 14px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}

.subCard__body{
  min-width:0;
}

.subCard__name{
  font-size:14px;
  font-weight:900;
  line-height:1.25;
  word-break:break-word;
}

.subCard__meta{
  margin-top:12px;
  font-size:11px;
  color:#8a8d96;
  line-height:1.25;
}

.subCard__side{
  display:grid;
  justify-items:end;
  gap:12px;
  flex-shrink:0;
}

.subCard__note{
  font-size:10px;
  color:#d05656;
  line-height:1.2;
  text-align:right;
}

.dotsBtn{
  width:30px;
  height:30px;
  border-radius:10px;
  border:1px solid var(--border);
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  font-weight:900;
  font-size:15px;
  line-height:1;
}

.dotsBtn:hover{
  background:#fafafa;
}

.subCard--manage{
  justify-content:center;
  align-items:center;
  gap:10px;
  cursor:pointer;
  background:#fff;
  text-decoration:none;
  color:inherit;
}

.subCard__nameLink{
  color:inherit;
  text-decoration:none;
  font-weight:inherit;
}
.subCard__nameLink:hover{
  text-decoration:underline;
}

.manageIcon{
  width:28px;
  height:28px;
  border-radius:999px;
  border:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  font-size:15px;
  line-height:1;
}

.manageText{
  font-size:13px;
  font-weight:900;
  line-height:1.2;
  text-align:center;
}

/* =========================
   SHOWCASES
   ========================= */

.showcaseLayout{
  margin-top:12px;
  display:grid;
  grid-template-columns:minmax(0, 1fr) 300px;
  gap:16px;
}

.showcaseCard{
  border:1px solid var(--border);
  border-radius:18px;
  background:#fff;
  padding:14px 14px 12px;
}

.showcaseCard--books{
  min-height:172px;
}

.showcaseCard--author{
  min-height:152px;
}

.showcaseCard--recent{
  grid-column:1 / -1;
  min-height:164px;
}

.showcaseCard--wishlist{
  grid-column:1 / -1;
  min-height:164px;
}

.cardTitle{
  font-size:11px;
  font-weight:900;
  line-height:1.2;
  margin-bottom:12px;
}

.miniCovers{
  display:flex;
  gap:14px;
  align-items:flex-start;
  flex-wrap:wrap;
}

.miniCover{
  width:86px;
  display:grid;
  gap:7px;
}

.miniCover__thumb,
.miniCover img{
  width:86px;
  height:122px;
  border-radius:12px;
  border:1px solid var(--border2);
  overflow:hidden;
  background:#efefef;
  object-fit:cover;
  display:block;
}

.miniCover__title{
  font-size:11px;
  line-height:1.3;
  color:#2e2f35;
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  word-break:break-word;
}

.favAuthor{
  height:calc(100% - 20px);
  display:grid;
  justify-items:center;
  align-content:center;
  gap:12px;
  padding:4px 0 6px;
}

.favAvatar{
  width:108px;
  height:108px;
  border-radius:999px;
  background:#efefef center/cover no-repeat;
  border:1px solid var(--border2);
}

.favName{
  font-size:13px;
  font-weight:900;
  text-align:center;
  line-height:1.25;
}

.recentRow{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
}

.recentItem{
  width:86px;
  height:122px;
  border-radius:12px;
  border:1px solid var(--border2);
  overflow:hidden;
  background:#efefef;
  cursor:pointer;
}

.recentItem img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

/* =========================
   REVIEWS
   ========================= */

.reviews{
  margin-top:14px;
  display:grid;
}

.reviewItem{
  display:grid;
  grid-template-columns:78px minmax(0, 1fr);
  gap:20px;
  align-items:start;
  padding:16px 0;
  border-bottom:1px solid var(--border2);
}

.reviewCover{
  width:70px;
  height:98px;
  border-radius:10px;
  overflow:hidden;
  border:1px solid var(--border2);
  background:#efefef;
}

.reviewCover img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.reviewBody{
  padding-top:6px;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.reviewBookTitle{
  font-size:13px;
  font-weight:700;
  color:var(--text);
}

.reviewText{
  font-size:13px;
  line-height:1.5;
  color:#23242a;
  word-break:break-word;
}

.quote{
  quotes:"«" "»";
}

.quote::before{
  content:open-quote;
}

.quote::after{
  content:close-quote;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 1180px){
  .topbar__inner,
  .page{
    width:calc(100% - 40px);
  }

  .hero{
    grid-template-columns:minmax(0, 1fr) 280px;
    gap:28px;
  }

  .subsRow{
    grid-template-columns:1fr 1fr;
  }

  .subCard--manage{
    grid-column:1 / -1;
    min-height:74px;
  }

  .showcaseLayout{
    grid-template-columns:minmax(0, 1fr) 280px;
  }
}

@media (max-width: 900px){
  .topbar__inner,
  .page{
    width:calc(100% - 32px);
  }

  .hero{
    grid-template-columns:1fr;
    gap:22px;
  }

  .balanceWrap{
    justify-content:flex-start;
  }

  .balanceCard{
    max-width:360px;
  }

  .profileHero__top{
    flex-direction:column;
    gap:18px;
  }

  .subsRow{
    grid-template-columns:1fr;
  }

  .showcaseLayout{
    grid-template-columns:1fr;
  }

  .showcaseCard--recent{
    grid-column:auto;
  }
}

@media (max-width: 640px){
  .topbar__inner{
    grid-template-columns:1fr;
    gap:12px;
    justify-items:center;
  }

  .topbar__left,
  .topbar__right{
    justify-self:center;
  }

  .profileHero__main{
    grid-template-columns:1fr;
    gap:16px;
  }

  .avatarWrap{ width:112px; }

  .avatar{
    width:112px;
    height:112px;
  }

  .socialRow{
    gap:10px;
  }

  .reviewItem{
    grid-template-columns:70px minmax(0, 1fr);
    gap:14px;
  }
}

.modal[hidden]{
  display:none !important;
}

/* ── Avatar wrap ──────────────────────────────────────────── */
.avatarWrap {
  position: relative;
  width: 132px;
  flex-shrink: 0;
}

/* ── Profile name row (name + level circle) ───────────────── */
.profileNameRow {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Level circle ─────────────────────────────────────────── */
.profileLevel {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ccc;
  flex-shrink: 0;
  cursor: default;
  user-select: none;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
/* Бронза: уровни 2–4 */
.profileLevel[data-tier="bronze"] { background: #c8864e; color: #fff; border-color: #a06030; }
/* Серебро: уровни 5–9 */
.profileLevel[data-tier="silver"] { background: #9aa8b5; color: #fff; border-color: #6e8696; }
/* Золото: уровни 10–19 */
.profileLevel[data-tier="gold"]   { background: #e0a830; color: #fff; border-color: #b07820; }
/* Алмаз: уровень 20+ */
.profileLevel[data-tier="diamond"]{ background: #4a90d9; color: #fff; border-color: #2060a0; }

/* ── Activity heatmap ─────────────────────────────────────── */
.activityWrap {
  overflow-x: auto;
  padding-bottom: 4px;
}

.activityInner {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  min-width: fit-content;
}

.activityDays {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 20px;
  flex-shrink: 0;
}

.activityDays span {
  height: 12px;
  font-size: 10px;
  color: #9aa0aa;
  line-height: 12px;
  width: 18px;
  text-align: right;
}

.activityRight {
  min-width: 0;
}

.activityMonths {
  display: grid;
  grid-template-columns: repeat(53, 12px);
  gap: 2px;
  height: 16px;
  margin-bottom: 4px;
}

.activityMonths span {
  font-size: 10px;
  color: #9aa0aa;
  line-height: 16px;
  white-space: nowrap;
}

.activityGrid {
  display: grid;
  grid-template-rows: repeat(7, 12px);
  grid-auto-columns: 12px;
  grid-auto-flow: column;
  gap: 2px;
}

.activityCell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: #f0ece4;
  cursor: default;
}

.activityCell--empty {
  background: transparent !important;
}

.activityCell[data-level="0"] { background: #ede8df; }
.activityCell[data-level="1"] { background: #d4b896; }
.activityCell[data-level="2"] { background: #b08a5e; }
.activityCell[data-level="3"] { background: #7c5c38; }
.activityCell[data-level="4"] { background: #4a341e; }

.activityLegend {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 11px;
  color: #9aa0aa;
}

.activityLegend .activityCell {
  width: 12px;
  height: 12px;
}

.modal{
  position:fixed;
  inset:0;
  z-index:1000;
}

.modal__backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.34);
}

.modal__dialog{
  position:relative;
  width:min(760px, calc(100% - 32px));
  margin:60px auto;
  background:#fff;
  border:1px solid var(--border2);
  border-radius:20px;
  box-shadow:0 20px 60px rgba(0,0,0,.12);
  padding:18px;
}

.modal__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
}

.modal__title{
  font-size:20px;
  font-weight:900;
}

.modal__close{
  width:38px;
  height:38px;
  border-radius:999px;
  border:1px solid var(--border2);
  background:#fff;
  cursor:pointer;
  font-size:16px;
  font-weight:900;
}

.modal__close:hover{
  background:#fafafa;
}

.modal__body{
  display:grid;
  gap:14px;
}

.modal__hint{
  min-height:18px;
  margin:14px 0 0;
  font-size:12px;
  color:var(--muted);
}

.modal__hint.is-error{
  color:#c01818;
  font-weight:900;
}

.modal__hint.is-ok{
  color:#0b7a3b;
  font-weight:900;
}

.subsManageCard{
  border:1px solid var(--border2);
  border-radius:16px;
  padding:14px;
  background:#fff;
}

.subsManageCard__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
}

.subsManageCard__title{
  font-size:16px;
  font-weight:900;
}

.subsManageCard__desc{
  margin-top:6px;
  font-size:12px;
  color:var(--muted);
  line-height:1.35;
}

.subsManageCard__price{
  white-space:nowrap;
  font-size:15px;
  font-weight:900;
}

.subsManageCard__actions{
  margin-top:14px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.subsManageCard__status{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:0 14px;
  border-radius:12px;
  background:#eef9f1;
  border:1px solid #cfe9d6;
  color:#0b7a3b;
  font-size:12px;
  font-weight:900;
}

.subCardMenuWrap{
  position:relative;
  display:inline-flex;
  justify-content:flex-end;
}

.subCardMenu{
  position:absolute;
  top:calc(100% + 8px);
  right:0;
  min-width:190px;
  padding:8px;
  border:1px solid #d6d8de;
  border-radius:12px;
  background:#fff;
  box-shadow:0 14px 30px rgba(0,0,0,.10);
  z-index:20;
}

.subCardMenu__item{
  width:100%;
  min-height:40px;
  border:0;
  border-radius:10px;
  background:#fff;
  text-align:left;
  padding:0 12px;
  font:inherit;
  font-size:13px;
  font-weight:800;
  cursor:pointer;
}

.subCardMenu__item:hover{
  background:#f8f8f8;
}

.subCardMenu__item--danger{
  color:#991b1b;
}

/* =========================
   DANGER BUTTON
   ========================= */

.pillBtn--danger{
  background:#fff;
  border-color:#fecaca;
  color:#b91c1c;
}
.pillBtn--danger:hover{
  background:#fef2f2;
}

/* =========================
   ACHIEVEMENTS
   ========================= */

.achRow{
  margin-top:14px;
  display:flex;
  gap:14px;
  flex-wrap:wrap;
}

.achCard{
  flex:1 1 260px;
  min-width:0;
  border:1px solid var(--border);
  border-radius:16px;
  background:#fff;
  padding:16px;
  display:flex;
  gap:14px;
  align-items:flex-start;
}

.achCard--locked{
  opacity:.5;
}

.achCard__icon{
  font-size:28px;
  flex-shrink:0;
  line-height:1;
}

.achCard__title{
  font-size:14px;
  font-weight:900;
  line-height:1.2;
  margin-bottom:6px;
}

.achCard__desc{
  font-size:12px;
  color:var(--muted);
  line-height:1.4;
}

.achCard__date{
  margin-top:8px;
  font-size:11px;
  color:#0b7a3b;
  font-weight:600;
}

/* =========================
   MODAL CODE BOX
   ========================= */

.modal .code-box{
  background:#f0fdf4;
  border:1.5px solid #86efac;
  border-radius:12px;
  padding:14px 16px 12px;
  text-align:center;
  margin-bottom:14px;
}

.modal .code-box__label{
  margin:0 0 6px;
  font-size:12px;
  font-weight:600;
  color:#15803d;
}

.modal .code-box__value{
  margin:0;
  font-size:28px;
  font-weight:700;
  letter-spacing:0.3em;
  color:#166534;
  font-family:monospace;
}

.modal__input{
  display:block;
  width:100%;
  height:52px;
  border:1px solid var(--border);
  border-radius:10px;
  padding:0 14px;
  font-size:22px;
  font-family:monospace;
  letter-spacing:0.25em;
  text-align:center;
  outline:none;
  transition:border-color .15s, box-shadow .15s;
  margin-bottom:14px;
  box-sizing:border-box;
}

.modal__input:focus{
  border-color:#cbd5e1;
  box-shadow:0 0 0 3px rgba(2,2,2,.08);
}

.subCodeButtons{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}