/* Профиль: карточка героя — плакат ризографа (краска героя, растровые точки, печатная тень), её же видят друзья
   в приглашениях; под ней — квест недели, статистика и ачивки. */
.prof { gap: 16px; }
.prof .h-sec small { font: 500 13px var(--f-body); color: var(--muted); }

/* ---------- карточка ---------- */
.pcard { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 40%; grid-template-areas: "head head" "info hero" "pins hero" "stats stats";
  gap: 6px 10px; padding: 14px 14px 0; border-radius: 22px; overflow: hidden; background: var(--ink); color: #1c1719;
  border: 2.5px solid #1c1719; box-shadow: 5px 5px 0 #1c1719; }
.pc-dots { position: absolute; inset: 0; pointer-events: none; opacity: .22; mix-blend-mode: multiply;
  background: radial-gradient(#1c1719 1.4px, transparent 1.6px) 0 0 / 9px 9px;
  -webkit-mask: linear-gradient(115deg, transparent 38%, #000 70%); mask: linear-gradient(115deg, transparent 38%, #000 70%); }
.pc-head { grid-area: head; position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pc-tag { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.pc-swap { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 12px; border-radius: 99px; background: #f4efe6; border: 2px solid #1c1719;
  font-size: 13px; font-weight: 800; box-shadow: 2px 2px 0 #1c1719; }
.pc-swap svg { width: 16px; height: 16px; }
.pc-hero { grid-area: hero; position: relative; display: flex; align-items: flex-end; justify-content: center; margin-bottom: -2px; cursor: pointer; }
.hero-pic { height: var(--h); max-width: 100%; object-fit: contain; }
.pc-hero { min-width: 0; }
.pc-hero img, .pc-hero svg { max-width: 100%; object-fit: contain; filter: drop-shadow(4px 4px 0 rgba(28, 23, 25, .35)); }
/* герои стоят во весь рост — по бокам квадратной картинки пусто: даём ей выйти за узкую колонку (бока прозрачные),
   иначе она ужимается по ширине колонки и герой мелкий. Нажатия ловит сама колонка, не картинка поверх имени. */
.pc-hero .hero-pic { width: auto; max-width: none; pointer-events: none; }
.pc-info { grid-area: info; position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pc-name { align-self: flex-start; max-width: 100%; font: 900 clamp(28px, 10vw, 40px)/0.95 var(--f-head); text-align: left; overflow-wrap: normal; } /* длинное имя — мельче (fitText), а не рвётся посреди */
.pc-name i { font-style: normal; font-size: 16px; margin-left: 4px; opacity: .6; vertical-align: middle; }
.pc-rank { font-size: 13px; font-weight: 600; }
.pc-bar { display: block; height: 8px; border-radius: 99px; background: rgba(28, 23, 25, .18); overflow: hidden; }
.pc-bar b { display: block; height: 100%; background: #1c1719; }
.pc-pins { grid-area: pins; position: relative; min-width: 0; display: flex; gap: 6px; align-self: end; padding-bottom: 10px; }
.pc-pin { flex: 1 1 0; min-width: 0; max-width: 62px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px 5px; border-radius: 14px; background: #f4efe6; border: 2px solid #1c1719; }
.pc-pin i { font-style: normal; font-size: 24px; line-height: 1; }
/* подпись ачивки в узкой плашке: длинное слово («Завсегдатай») целиком — шрифт подгоняется (fitText в profile.js), а не режется */
.pc-pin small { width: 100%; font-size: 9.5px; font-weight: 700; line-height: 1.1; text-align: center; overflow-wrap: normal; hyphens: manual; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pc-pin.empty { background: transparent; border-style: dashed; }
.pc-pin.empty i { font-weight: 800; }
.pc-stats { grid-area: stats; position: relative; display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 -14px; border-top: 2.5px solid #1c1719; background: #f4efe6; }
.pc-stats span { min-width: 0; text-align: center; display: flex; flex-direction: column; align-items: center; padding: 8px 4px; font-size: 11.5px; color: #75696b; }
.pc-stats span + span { border-left: 2px solid #1c1719; }
.pc-stats b { font: 900 24px/1 var(--f-head); color: #1c1719; }

.prof-form { display: flex; gap: 8px; margin-top: 10px; }
.prof-form input { flex: 1; min-width: 0; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 2px solid var(--ink); background: var(--bg); font: inherit; color: var(--ink); }

/* смена героя */
.hero-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.hg { min-width: 0; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 16px; border: 2px solid var(--ink); background: var(--bg); }
.hg.own { background: var(--ink); }
.hg img, .hg svg { max-width: 100%; height: auto; max-height: 84px; object-fit: contain; }
.hg b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hg b { font-size: 13px; color: #1c1719; }
.hg small { font-size: 10.5px; color: var(--muted); text-align: center; line-height: 1.15; }
.hg.locked { border-style: dashed; border-color: var(--line); }
.hg.locked img, .hg.locked svg { filter: brightness(0); opacity: .25; }
.hg.locked b { color: var(--muted); }
.hg.on { box-shadow: 3px 3px 0 #1c1719; outline: 3px solid #1c1719; outline-offset: -6px; }

/* ---------- квест недели ---------- */
/* аккаунт: вход через Telegram — строка под карточкой */
.acct { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-radius: 18px; background: var(--bg); border: 2.5px solid var(--ink); }
.acct[hidden] { display: none; }
.acct div { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.acct b { font-size: 15px; }
.acct small { font-size: 12.5px; color: var(--muted); }
.acct button { flex: none; }
.acct-wait { font-weight: 700; }
.pq { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px 44px 14px 16px; border-radius: 18px; background: var(--mint); border: 2.5px solid var(--ink); box-shadow: var(--hard); }
.pq-k { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.pq b { font: 800 22px/1.1 var(--f-head); }
.pq small { font-size: 12.5px; }
.pq svg { position: absolute; right: 14px; top: 50%; translate: 0 -50%; width: 22px; height: 22px; }

/* ---------- статистика ---------- */
.prof-stats, .pa { display: flex; flex-direction: column; gap: 10px; }
.st-top { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--amber); border: 2px solid var(--ink); box-shadow: var(--hard); }
.st-week { margin: 0; color: var(--muted); font-size: 13px; }
.st-kinds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.st-kinds li { display: grid; grid-template-columns: 96px 1fr 24px; align-items: center; gap: 8px; font-size: 13px; }
.st-kinds i { height: 10px; border-radius: 99px; background: linear-gradient(var(--mint), var(--mint)) 0 0 / var(--w) 100% no-repeat, var(--surface); }
.st-kinds b { text-align: right; }
.st-h { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 0; font: 800 20px var(--f-head); }
.st-h small { font: 500 13px var(--f-body); color: var(--muted); }
.st-places { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.st-places li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.st-places li div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.st-places small { color: var(--muted); font-size: 12px; }
.st-places span { font: 900 20px/1 var(--f-head); }

/* ---------- ачивки: полученные — плашками, закрытые — свёрнутым списком ---------- */
.pa-got { display: flex; flex-wrap: wrap; gap: 6px; }
.pa-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px 0 8px; border-radius: 99px; border: 2px solid var(--ink); background: var(--bg); font-size: 13px; font-weight: 700; }
.pa-chip i { font-style: normal; font-size: 18px; }
.pa-chip.on { box-shadow: 2px 2px 0 var(--ink); }
.pin-pick .pa-chip { box-shadow: none; opacity: .55; border-style: dashed; }
.pin-pick .pa-chip.on { opacity: 1; border-style: solid; background: var(--amber); box-shadow: 2px 2px 0 var(--ink); }
.pins-done { margin-top: 14px; width: 100%; }
.pa-more summary { cursor: pointer; padding: 10px 0; color: var(--muted); font-weight: 700; font-size: 14px; }
.pa-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pa-list li { display: flex; align-items: center; gap: 10px; padding: 7px 2px; border-bottom: 1px dashed var(--line); }
.pa-list li > i { width: 26px; font-style: normal; font-size: 20px; text-align: center; filter: grayscale(1); opacity: .55; }
.pa-list li div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pa-list b { font-size: 13.5px; }
.pa-list small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.pa-hero img, .pa-hero svg { height: 30px; filter: brightness(0); opacity: .3; }
/* «Ачивки» сворачиваются по заголовку */
.pa-box > summary { list-style: none; cursor: pointer; }
.pa-box > summary::-webkit-details-marker { display: none; }
.pa-box > * + * { margin-top: 10px; }
.pa-chev { display: inline-block; font-style: normal; transition: transform .2s; }
.pa-box:not([open]) .pa-chev { transform: rotate(-90deg); }
/* героя на карточке можно пожамкать: сплющился, вытянулся, отпружинил — и сказал своё */
.pc-hero > :first-child { transform-origin: 50% 100%; }
.pc-hero > .squish { animation: squish .65s cubic-bezier(.3, 0, .3, 1); }
@keyframes squish { 0% { transform: scale(1); } 18% { transform: scale(1.18, .78); } 42% { transform: scale(.9, 1.12) translateY(-8px); } 64% { transform: scale(1.06, .95); } 82% { transform: scale(.98, 1.02); } 100% { transform: scale(1); } }
.pc-say { position: absolute; z-index: 3; right: 6px; bottom: calc(100% - 40px); width: max-content; max-width: 190px; padding: 8px 11px; border-radius: 16px 16px 4px 16px;
  font-size: 12.5px; font-weight: 600; line-height: 1.3; background: #fff8ec; color: #1c1719; box-shadow: 0 8px 16px rgba(0, 0, 0, .25); animation: say-pop .3s var(--spring); pointer-events: none; }
@keyframes say-pop { from { transform: scale(.6) translateY(8px); opacity: 0; } }
