/* Profile: 1A frames (everywhere the avatar is), 4B banner, 5A showcase (moodboard 2026-12-01). Crisp, no glow. */

/* ---------- the framed avatar (frames.js framedAvatar) — overrides the old ring styles of .ava / .pava */
.fr { position: relative; display: inline-block; container-type: size; overflow: visible !important; background: none !important; box-shadow: none !important; border-radius: 0 !important; font-size: 0; }
.fr::after { content: none !important; }
.fr > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.fr-in { position: absolute; display: grid; place-items: center; overflow: hidden; font-style: normal; font: 800 34cqw/1 Unbounded, sans-serif; background: #4E69C1; color: #F8F6F0; }
.fr-0 .fr-in { inset: 0; border-radius: 22%; }
.fr-in img { width: 100%; height: 100%; object-fit: cover; }
.fr-bob { animation: fr-bob 3.4s ease-in-out infinite; }
@keyframes fr-bob { 50% { transform: translateY(-3px); } }
.fr-rock { animation: fr-rock 4.2s ease-in-out infinite alternate; }
@keyframes fr-rock { from { transform: rotate(-8deg); } to { transform: rotate(-11deg); } }
.fr-float { animation: fr-float 3.6s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes fr-float { from { transform: translate(0, 0) rotate(0); } to { transform: translate(-2px, -4px) rotate(-8deg); } }
.fr-shine polygon { animation: fr-shine 5.5s cubic-bezier(.5, 0, .3, 1) infinite; }
@keyframes fr-shine { 0% { transform: translateX(0); } 22%, 100% { transform: translateX(280px); } }

/* ---------- the unlock (1·∞): F-turn → left layer → right layer → crest → tab → one hard highlight, ~1.4 s */
.fr-unlock { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; align-content: center; gap: 28px; background: rgba(18, 19, 24, .9); cursor: pointer; }
.fr-unlock .fr { width: min(62vw, 280px); height: min(62vw, 280px); }
.fr-unlock-t { text-align: center; color: #F8F6F0; } .fr-unlock-t b { display: block; font: 800 22px Unbounded, sans-serif; } .fr-unlock-t span { color: #a2a7b1; font-size: 14px; }
.fr .u0 { transform-box: view-box; transform-origin: 80px 80px; }
.run .u0 { animation: uF .34s cubic-bezier(.2, 1.45, .45, 1) both; }
@keyframes uF { from { transform: rotate(-90deg); } to { transform: rotate(0); } }
.run .u1 { animation: uL .3s .34s cubic-bezier(.3, 1.25, .5, 1) both; }
@keyframes uL { from { transform: translateY(-144px); } to { transform: translateY(0); } }
.run .u2 { animation: uR .3s .62s cubic-bezier(.3, 1.25, .5, 1) both; }
@keyframes uR { from { transform: translateY(144px); } to { transform: translateY(0); } }
.run .u3 { animation: uC .3s .9s cubic-bezier(.3, 1.7, .5, 1) both; }
@keyframes uC { from { transform: translateY(-46px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.run .u4 { animation: uT .2s 1s ease-out both; }
@keyframes uT { from { transform: translateY(-16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.run .u5 polygon { animation: uS .32s 1.08s ease-in both; }
@keyframes uS { from { transform: translateX(0); } to { transform: translateX(280px); } }
@media (prefers-reduced-motion: reduce) { .fr-bob, .fr-rock, .fr-float, .fr-shine polygon, .run *, .bento.editing .sb { animation: none !important; } }
body.power .fr-bob, body.power .fr-rock, body.power .fr-float, body.power .fr-shine polygon { animation: none; }

/* ---------- page */
.pv { padding: 14px 24px 18px; color: #F8F6F0; }
.pv-show { height: var(--pvh, calc(100vh - 92px)); display: flex; flex-direction: column; overflow: hidden; }
.pv-head { --av: clamp(96px, 15vh, 136px); position: relative; display: grid; grid-template-columns: var(--av) auto minmax(0, 1fr); column-gap: 20px; align-items: center; }
.pv-banner { grid-column: 1 / -1; height: clamp(84px, 18vh, 168px); border-radius: 24px; overflow: hidden; background: #23262E; }
.pv-banner svg { width: 100%; height: 100%; display: block; }
.pv-ava { grid-row: 2; position: relative; z-index: 1; width: var(--av); height: var(--av); margin: calc(var(--av) * -.56) 0 0 16px; display: block; }
.pv-ava .ava { width: 100%; height: 100%; }
.pv-who { grid-row: 2; min-width: 0; padding-top: 10px; }
.pv-who h1 { max-width: 36vw; font: 800 clamp(22px, 2.6vw, 38px)/1.05 Unbounded, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-ok { color: #288267; font-size: .6em; }
.pv-who p { display: flex; gap: 8px; align-items: center; margin-top: 6px; color: #c9ccd2; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tiertab { flex: none; background: #F8F6F0; color: #23262E; font: 800 11px Rubik, sans-serif; letter-spacing: .1em; text-transform: uppercase; padding: 4px 8px; border-radius: 6px; }
.tiertab.t5 { background: #EFC54B; } .tiertab.t0 { background: #3a3f4b; color: #F8F6F0; }
.pv-tabs { grid-row: 2; grid-column: 3; display: flex; gap: 6px; padding-top: 10px; overflow-x: auto; scrollbar-width: none; justify-self: end; max-width: 100%; }
.pv-head { margin-bottom: 12px; }
.pv-tabs .ed { background: #F8F6F0; color: #23262E; font-weight: 700; } .pv-tabs .ed.on { background: #EFC54B; }
.pv-tabs .pick { flex: none; padding: 7px 14px; font-size: 14px; }
.pv-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pv-id { margin-top: 26px; }

/* ---------- 5A bento: two rows on desktop, columns from the chosen blocks; one screen */
.bento { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); grid-auto-flow: row dense; gap: 14px; }
.sb { position: relative; min-height: 0; min-width: 0; overflow: hidden; container-type: size; display: flex; flex-direction: column; gap: 6px; background: #2c3039; border-radius: 22px; padding: 14px 16px; color: #F8F6F0; text-align: left; border: 0; font: inherit; }
.sb.w2 { grid-column: span 2; } .sb.h2 { grid-row: span 2; }
.sb .t { font: 700 11px Rubik, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: #9aa0ab; flex: none; }
.sb-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.sb .big { font: 800 clamp(22px, 30cqh, 62px)/1 Unbounded, sans-serif; } .sb .big.y { color: #EFC54B; }
.sb .mid { font: 800 clamp(14px, 13cqh, 22px)/1.15 Unbounded, sans-serif; }
.sb .sub { color: #a2a7b1; font-size: 13px; } .sub b { color: #F8F6F0; font-weight: 500; } .sub.c { text-align: center; }
.bars { flex: 1; min-height: 0; display: flex; align-items: flex-end; gap: 4px; }
.bars i { flex: 1; max-width: 18px; border-radius: 4px; background: #288267; } .bars i.on, .bars.y i { background: #EFC54B; }
.bars.y i { max-width: 6px; border-radius: 3px; }
.sb-empty { color: #a2a7b1; font-size: 13px; line-height: 1.4; }
.sb-go { align-self: flex-start; margin-top: auto; background: #353a45; border-radius: 10px; padding: 6px 12px; font-size: 13px; font-weight: 700; }
.favc { flex: 1; min-height: 0; display: flex; justify-content: center; align-items: center; }
.favc .acard { width: min(100%, 60cqh); flex: none; }
.fname { font: 800 13px Unbounded, sans-serif; flex: none; }
.badges { flex: 1; min-height: 0; display: flex; gap: 10px; align-items: center; }
.badge { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.badge svg { width: 100%; max-width: 64px; max-height: calc(100% - 20px); }
.badge i { font-style: normal; font-size: 11.5px; color: #a2a7b1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cube { flex: 1; min-height: 0; position: relative; } .cube svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chips3 { display: flex; gap: 6px; } .chips3 i { width: min(40px, 22cqh); aspect-ratio: 1; border-radius: 10px; }
.frs { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; justify-items: center; }
.frs > span { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; color: #c9ccd2; } .frs i { font-style: normal; }
.frs .sfa { width: min(56px, 38cqh); height: min(56px, 38cqh); }

/* ---------- edit mode: jiggle, ×, «+» slots, the drawer */
.bento.editing .sb:not(.sb-plus) { animation: jig .5s ease-in-out infinite alternate; cursor: grab; }
.bento.editing .sb:nth-child(2n) { animation-delay: -.25s; }
@keyframes jig { from { transform: rotate(-.6deg); } to { transform: rotate(.6deg); } }
.sb-x { position: absolute; top: 8px; right: 8px; z-index: 2; width: 28px; height: 28px; border-radius: 8px; border: 0; background: #F8F6F0; color: #23262E; font: 800 16px/1 Rubik, sans-serif; cursor: pointer; }
.sb-plus { background: transparent; outline: 2px dashed #4a4f5c; outline-offset: -2px; align-items: center; justify-content: center; color: #8f95a1; cursor: pointer; }
.sb-plus b { width: 44px; height: 44px; border-radius: 11px; background: #353a45; display: grid; place-items: center; font: 800 26px Unbounded, sans-serif; color: #F8F6F0; }
.sb-plus span { font-size: 11px; }
.drawer { position: fixed; z-index: 70; left: 50%; bottom: 0; transform: translateX(-50%); width: min(820px, 100%); max-height: 46vh; overflow-y: auto; background: #2c3039; border-radius: 28px 28px 0 0; padding: 16px 20px 20px; animation: sheet .34s var(--spring, ease-out); box-shadow: 0 -1px 0 #3a3f4b; }
.dr-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 10px 0 8px; } .dr-h b { font: 800 14px Unbounded, sans-serif; } .dr-h span { font: 700 12px Rubik, sans-serif; color: #EFC54B; }
.dr-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.libb { width: 120px; text-align: left; background: #353a45; border: 0; border-radius: 14px; padding: 10px; color: #F8F6F0; cursor: grab; font: inherit; }
.libb i { display: block; width: 22px; height: 22px; border-radius: 6px; background: #8f95a1; }
.libb .lb-pb, .libb .lb-guide { background: #288267; } .libb .lb-rhythm, .libb .lb-streak { background: #EFC54B; } .libb .lb-ach, .libb .lb-fav { background: #DF4D56; } .libb .lb-friends, .libb .lb-skin { background: #4E69C1; }
.libb b { display: block; font: 700 12px Rubik, sans-serif; margin-top: 8px; } .libb span { font-size: 10.5px; color: #8f95a1; }
.frpick { display: flex; flex-direction: column; align-items: center; gap: 8px; background: #353a45; border: 0; border-radius: 14px; padding: 14px 10px 8px; color: #F8F6F0; font: 700 11px Rubik, sans-serif; cursor: pointer; }
.frpick.on { outline: 2px solid #EFC54B; } .frpick:disabled { opacity: .45; cursor: default; }
.frpick .frmini { width: 44px; height: 44px; } .fr0 { width: 44px; height: 44px; display: grid; place-items: center; font-size: 22px; }
.drawer select { background: #353a45; color: #F8F6F0; border: 0; border-radius: 10px; padding: 8px 10px; font: inherit; }

/* ---------- phone: header like the moodboard, 2 columns, rows fill the height */
main:has(.pv-show) { min-height: 0; }
@media (max-width: 900px) { body:has(.pv-show) .side { padding-bottom: 0; } }
@media (max-width: 700px) {
  .pv { padding: 8px 12px 10px; }
  .pv-head { --av: 84px; column-gap: 12px; }
  .pv-banner { height: 92px; border-radius: 18px; }
  .pv-ava { margin: calc(var(--av) * -.5) 0 0 8px; }
  .pv-who { padding-top: 6px; } .pv-who h1 { font-size: 21px; } .pv-who p { font-size: 12px; }
  .pv-tabs { grid-row: 3; grid-column: 1 / -1; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; max-width: none; padding-top: 8px; }
  .pv-head { margin-bottom: 8px; } .pv-tabs .pick { padding: 6px 12px; font-size: 13px; }
  .bento { grid-template-columns: 1fr 1fr; grid-template-rows: none; grid-auto-rows: minmax(0, 1fr); gap: 10px; }
  .sb.w2 { grid-column: span 1; } .sb { padding: 10px 12px; border-radius: 18px; gap: 4px; }
  .sb .big { font-size: clamp(18px, 28cqh, 40px); } .sb .sub { font-size: 11.5px; }
  .badges { gap: 4px; } .badge i { display: none; } .badge:nth-child(n + 4) { display: none; }
  .frs { grid-template-columns: 1fr 1fr; } .frs i { display: none; }
  .drawer { max-height: 52vh; padding: 12px 14px 16px; }
  .libb { width: calc(33.3% - 6px); }
}

/* ------------------------------------------------------------------ round 2 (owner 2026-12-01) */
/* image frames: the avatar fills the round window, the generated frame lies over it */
.frimg { position: relative; display: inline-block; aspect-ratio: 1; container-type: inline-size; line-height: 0; }
.frimg .frpic { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.frimg .fr-in { position: absolute; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: #4E69C1; color: #F8F6F0; font: 800 34cqw/1 Unbounded, sans-serif; font-style: normal; }
.frimg .fr-in img { width: 100%; height: 100%; object-fit: cover; }
.pv-head { --av: clamp(130px, 21vh, 190px); }
.pv-ava { margin-top: calc(var(--av) * -.62); }
/* the showcase: the favourite card fits one cell; achievements = their jewel icons */
.favc .acard { width: auto; height: 100%; max-width: 100%; }
.badge img { width: 100%; max-width: 64px; max-height: calc(100% - 28px); object-fit: contain; }
.bpips { display: flex; gap: 3px; } .bpips i { width: 7px; height: 7px; border-radius: 2px; background: #4a4f5c; } .bpips i.on { background: #EFC54B; }
.sb .frs { display: flex; gap: 12px; align-items: center; background: none; border: 0; color: inherit; cursor: pointer; padding: 0; }
.sb .frs .sfa { width: 56px; }
/* edit mode: a bar that says what you are doing + «Готово»; the library sits beside the showcase (never over it) */
.pv-editbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 12px; padding: 12px 14px 12px 18px; border-radius: 18px; background: #EFC54B; color: #23262E; }
.pv-editbar b { font: 800 16px Unbounded, sans-serif; } .pv-editbar span { font-size: 13px; flex: 1; min-width: 200px; }
.pv-editbar .btn.main { background: #23262E; color: #F8F6F0; padding: 10px 22px; font: 800 14px Unbounded, sans-serif; }
.pv-editing.pv-show { height: auto; }
.pv-editgrid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; min-height: 0; }
.pv-editgrid .bento { min-height: 520px; height: calc(100vh - 360px); }
.pv-editgrid .drawer { position: static; transform: none; left: auto; bottom: auto; width: auto; max-height: calc(100vh - 220px); border-radius: 22px; animation: none; box-shadow: none; position: sticky; top: 110px; }
.dr-frames { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.dr-frames .frpick { padding: 8px 6px; gap: 4px; }
.dr-frames .frpick img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.dr-frames .frpick span { font-size: 10.5px; line-height: 1.2; text-align: center; }
.dr-frames .frpick small { font-size: 9.5px; color: #a2a7b1; text-align: center; line-height: 1.2; }
.dr-frames .frpick.locked img { filter: grayscale(1) brightness(.5); }
.dr-frames .frpick:disabled { opacity: 1; }
/* drag: the ghost under the pointer, the target lights up */
.bento.editing .sb { touch-action: none; user-select: none; }
.drawer .libb { touch-action: none; user-select: none; }
.dragghost { position: fixed; left: 0; top: 0; z-index: 300; pointer-events: none; opacity: .92; border-radius: 22px; box-shadow: 0 24px 60px rgba(0,0,0,.5); animation: none !important; }
.sb.dragging { opacity: .35; }
.sb.over { outline: 3px solid #EFC54B; outline-offset: -3px; }
.is-dragging .bento.editing .sb { animation: none; }
@media (max-width: 900px) {
  .pv-editgrid { grid-template-columns: minmax(0, 1fr); }
  .pv-editgrid .bento { height: auto; min-height: 0; grid-auto-rows: 150px; }
  .pv-editgrid .drawer { position: static; max-height: none; }
  .dr-frames { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.pv-editgrid .bento { --cols: 3 !important; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: none; grid-auto-rows: 190px; height: auto; min-height: 0; }
.pv-editgrid .bento .sb.w2 { grid-column: span 2; } .pv-editgrid .bento .sb.h2 { grid-row: span 1; }

/* ------------------------------------------------------------------ phones (owner 2026-12-01): header in two columns
   (avatar | name), the tabs on their own rows (wrap, every tab reachable), the avatar below the Back corner */
@media (max-width: 700px), (max-height: 500px) {
  .pv-head { --av: 88px; grid-template-columns: var(--av) minmax(0, 1fr); column-gap: 12px; }
  .pv-banner { height: 88px; border-radius: 18px; }
  .pv-ava { margin: calc(var(--av) * -.42) 0 0 10px; }
  .pv-who { grid-column: 2; padding-top: 6px; } .pv-who h1 { max-width: none; font-size: 21px; }
  .pv-who p { font-size: 12px; }
  .pv-tabs { grid-row: 3; grid-column: 1 / -1; justify-self: stretch; flex-wrap: wrap; overflow: visible; max-width: none; padding-top: 10px; gap: 6px; }
  .pv-tabs .pick { padding: 7px 12px; font-size: 13px; min-height: 36px; }
}
@media (max-height: 500px) and (min-width: 701px) {
  .pv-head { --av: 72px; } .pv-banner { height: 64px; }
  .pv-tabs { flex-wrap: nowrap; overflow-x: auto; }
}
/* all profile tabs reachable on desktop too (owner 2026-12-01): they wrap instead of hiding behind a scroll */
@media (min-width: 701px) { .pv-tabs { flex-wrap: wrap; overflow: visible; justify-content: flex-end; row-gap: 6px; } }
