/* card type ladder (OFL, Cyrillic): Rubik (Папір) → Unbounded (Вініл) → Rubik Mono One (Карбон) → Dela Gothic One (Фрост)
   → Rubik Iso (Призма); Tektur for the algorithms on the back. Loaded only here. */
@import url('https://fonts.googleapis.com/css2?family=Dela+Gothic+One&family=Rubik+Iso&family=Rubik+Mono+One&family=Tektur:wght@500&display=swap');

/* cards — 2026-12-01, owner's choice from the moodboard (hub/vault/07 Дизайн/Мудборд рамок і карток 2026-12-01.html):
   3A «Герой-кубик» + 2A physical sticker materials. The card is a 250x350 picture (.art: surface + hero cube + pips,
   SVG, cached per card) with HTML text over it; every size is in --u = 1/250 of the card width (container units), so the
   same card works in the grid, on a phone and in the profile showcase. Tiers: Папір → Вініл → Карбон → Фрост → Призма
   (classes stay rar-bronze…diamond). On Призма the hero's top layer breaks out over the card's top edge. No glow, no
   filters (133 cards scroll). Locked = a dim silhouette. Click / Enter / F flips to the algorithms. */

/* metal chips of the page header (.rarity) */
.rar-bronze { --rar: #e9e4d8; } .rar-silver { --rar: #7fc2ad; } .rar-gold { --rar: #EFC54B; } .rar-platinum { --rar: #b9c6ef; }
.rar-diamond { --rar: #1f9e6e; }   /* Смарагд (owner 2026-12-01) */

.cards { grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 22px 18px; }
.acard { --u: .4cqw; container-type: inline-size; padding: 0; background: none; border-radius: calc(22 * var(--u)); isolation: isolate;
  transition: transform .28s var(--ease); outline-offset: 4px;
  --fg: #23262E; --mute: #80848d; --line: #e4dfd3; --acc: #288267; --acc-ink: #F8F6F0; --chip: #288267; --chip-ink: #F8F6F0; --floor: #e9e4d8; }
.acard.t1 { --fg: #F8F6F0; --mute: #b3d6cb; --line: #21705a; --acc: #F8F6F0; --acc-ink: #288267; --chip: #F8F6F0; --chip-ink: #288267; --floor: rgba(0,0,0,.2); }
.acard.t2 { --fg: #F8F6F0; --mute: #9aa0ab; --line: #3a3f4b; --acc: #EFC54B; --acc-ink: #23262E; --chip: #EFC54B; --chip-ink: #23262E; --floor: rgba(0,0,0,.32); }
.acard.t3 { --fg: #F8F6F0; --mute: #e2e7fa; --line: rgba(255,255,255,.3); --acc: #F8F6F0; --acc-ink: #4E69C1; --chip: #F8F6F0; --chip-ink: #4E69C1; --floor: rgba(20,24,48,.25); }
.acard.t4 { --fg: #F8F6F0; --mute: #9aa0ab; --line: #3a3f4b; --acc: #EFC54B; --acc-ink: #23262E; }
.acard.locked { --fg: rgba(248,246,240,.42); --mute: rgba(248,246,240,.28); --line: #2c2f37; --acc: #3a3f4b; --acc-ink: #888; --chip: #2a2d34; --chip-ink: rgba(248,246,240,.4); --floor: rgba(0,0,0,.25); }

.acard .in { position: relative; height: 100%; padding: 0; background: none; border-radius: inherit; display: grid; perspective: 900px; overflow: visible; }
.acard .face { grid-area: 1 / 1; position: relative; min-height: 0; border-radius: inherit; backface-visibility: hidden; transition: transform .5s var(--ease); color: var(--fg); }
.acard .art { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.acard .art .floor { fill: var(--floor); }
.acard.locked .art .hero { opacity: .3; }
.acard .back { transform: rotateY(180deg); pointer-events: none; }
.acard.flipped .front { transform: rotateY(-180deg); pointer-events: none; }
.acard.flipped .back { transform: none; pointer-events: auto; }
.acard[data-open] { cursor: pointer; }
.acard:hover, .acard:focus-visible { transform: translateY(-5px) rotate(-.6deg); }
.acard.locked:hover { transform: none; }

/* front: chip / № badge, then name, other names, three numbers (moodboard 3A coordinates in --u) */
.acard .cchip, .acard .cno { position: absolute; left: calc(16 * var(--u)); top: calc(16 * var(--u)); height: calc(24 * var(--u)); padding: 0 calc(10 * var(--u));
  display: inline-flex; align-items: center; border-radius: calc(7 * var(--u)); background: var(--chip); color: var(--chip-ink);
  font: 700 calc(10 * var(--u))/1 Rubik, sans-serif; letter-spacing: calc(1.2 * var(--u)); white-space: nowrap; }
.acard .cno { left: calc(14 * var(--u)); background: #F8F6F0; color: #23262E; font-weight: 800; font-size: calc(11 * var(--u)); letter-spacing: 0; }
.acard .cpin { position: absolute; right: calc(16 * var(--u)); top: calc(36 * var(--u)); font-size: calc(18 * var(--u)); color: var(--acc); }
.acard .meta { position: absolute; left: calc(10 * var(--u)); right: calc(10 * var(--u)); top: calc(204 * var(--u)); bottom: calc(15 * var(--u)); display: flex; flex-direction: column; align-items: stretch; text-align: center; }
.acard .cname { flex: 1; display: flex; align-items: center; justify-content: center; margin: 0; text-wrap: balance; overflow-wrap: anywhere; color: var(--fg);
  font: 700 calc(44 * var(--u))/1 Rubik, sans-serif; letter-spacing: -.01em; }
.acard .cname.nm { font-size: calc(31 * var(--u)); } .acard .cname.nl { font-size: calc(23 * var(--u)); line-height: 1.04; }
.acard.t1 .cname { font-family: Unbounded, sans-serif; font-weight: 800; font-size: calc(36 * var(--u)); letter-spacing: -.02em; }
.acard.t1 .cname.nm { font-size: calc(25 * var(--u)); } .acard.t1 .cname.nl { font-size: calc(18.5 * var(--u)); }
.acard.t2 .cname { font-family: 'Rubik Mono One', Rubik, sans-serif; font-weight: 400; text-transform: uppercase; color: #EFC54B; font-size: calc(30 * var(--u)); letter-spacing: -.03em; }
.acard.t2 .cname.nm { font-size: calc(20 * var(--u)); } .acard.t2 .cname.nl { font-size: calc(15.5 * var(--u)); line-height: 1.1; }
.acard.t3 .cname { font-family: 'Dela Gothic One', sans-serif; font-weight: 400; font-size: calc(40 * var(--u)); }
.acard.t3 .cname.nm { font-size: calc(28 * var(--u)); } .acard.t3 .cname.nl { font-size: calc(21 * var(--u)); line-height: 1.06; }
.acard.t4 .meta { top: calc(222 * var(--u)); }
.acard.t4 .cname { font-family: 'Rubik Iso', Rubik, sans-serif; font-weight: 400; text-transform: uppercase; font-size: calc(46 * var(--u)); letter-spacing: 0; line-height: .95; }
.acard.t4 .cname.nm { font-size: calc(30 * var(--u)); } .acard.t4 .cname.nl { font-size: calc(21 * var(--u)); line-height: 1.02; }
.acard.locked .cname { font-size: calc(30 * var(--u)); } .acard.locked .cname.nm { font-size: calc(24 * var(--u)); } .acard.locked .cname.nl { font-size: calc(19 * var(--u)); }
.acard .alt { margin: calc(4 * var(--u)) 0 0; font: 500 calc(9.5 * var(--u))/1.25 Rubik, sans-serif; letter-spacing: calc(1.4 * var(--u)); text-transform: uppercase; color: var(--mute);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.acard .cnums { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: calc(10 * var(--u)); }
.acard .cnums span { display: grid; gap: calc(3 * var(--u)); }
.acard .cnums b { font: 700 calc(17 * var(--u))/1 Rubik, sans-serif; font-variant-numeric: tabular-nums; color: var(--fg); }
.acard .cnums i { font: 500 calc(8.5 * var(--u))/1 Rubik, sans-serif; font-style: normal; letter-spacing: calc(.6 * var(--u)); text-transform: uppercase; color: var(--mute); }

/* back: header with the case picture, the algorithms (✓ performed, «мій»), opened date and «знаєш k/n» */
.acard .bk { position: absolute; inset: 0; padding: calc(24 * var(--u)) calc(22 * var(--u)) calc(18 * var(--u)); display: flex; flex-direction: column; min-height: 0; }
.acard .bk header { display: flex; gap: calc(8 * var(--u)); align-items: flex-start; justify-content: space-between; padding-bottom: calc(10 * var(--u)); }
.acard .bk header > div { min-width: 0; }
.acard .ctier { font: 700 calc(9.5 * var(--u))/1.2 Rubik, sans-serif; letter-spacing: calc(1.5 * var(--u)); text-transform: uppercase; color: var(--mute); }
.acard .back h4 { margin: calc(4 * var(--u)) 0 0; font: 700 calc(19 * var(--u))/1.05 Rubik, sans-serif; color: var(--fg); overflow-wrap: anywhere; }
.acard.t1 .back h4 { font-family: Unbounded, sans-serif; font-weight: 800; } .acard.t2 .back h4 { font-family: 'Rubik Mono One', sans-serif; font-weight: 400; text-transform: uppercase; color: #EFC54B; font-size: calc(15 * var(--u)); }
.acard.t3 .back h4 { font-family: 'Dela Gothic One', sans-serif; font-weight: 400; } .acard.t4 .back h4 { font-family: 'Rubik Iso', sans-serif; font-weight: 400; text-transform: uppercase; font-size: calc(21 * var(--u)); }
.acard .back .alt { text-align: left; -webkit-line-clamp: 1; }
.acard .bpic { flex: none; width: calc(56 * var(--u)); height: calc(56 * var(--u)); border-radius: calc(12 * var(--u)); background: #121318; display: grid; place-items: center; padding: calc(4 * var(--u)); }
.acard .bpic svg { width: 100%; height: 100%; display: block; }
.acard .calgs { list-style: none; margin: 0; padding: 0; flex: 1; min-height: 0; overflow: auto; scrollbar-width: none; }
.acard .calgs li { position: relative; display: grid; gap: calc(3 * var(--u)); padding: calc(9 * var(--u)) calc(34 * var(--u)) calc(9 * var(--u)) calc(22 * var(--u)); border-top: 1px solid var(--line); }
.acard .calgs li::before { content: ''; position: absolute; left: 0; top: calc(10 * var(--u)); width: calc(12 * var(--u)); height: calc(12 * var(--u)); border-radius: calc(3 * var(--u)); box-shadow: inset 0 0 0 1.3px var(--mute); }
.acard .calgs li.done::before { content: '✓'; box-shadow: none; background: var(--acc); color: var(--acc-ink); display: grid; place-items: center; font: 800 calc(10 * var(--u))/1 Rubik, sans-serif; }
.acard .calgs b { font: 500 calc(12.5 * var(--u))/1.15 Tektur, Rubik, monospace; word-spacing: calc(2.5 * var(--u)); color: var(--fg); }
.acard .calgs i { font: 500 calc(9 * var(--u))/1 Rubik, sans-serif; font-style: normal; letter-spacing: calc(.5 * var(--u)); color: var(--mute); }
.acard .calgs em { position: absolute; right: 0; top: calc(9 * var(--u)); font: 800 calc(8.5 * var(--u))/1 Rubik, sans-serif; font-style: normal; letter-spacing: calc(.8 * var(--u));
  padding: calc(4 * var(--u)) calc(6 * var(--u)); border-radius: calc(4 * var(--u)); background: var(--acc); color: var(--acc-ink); }
.acard .chint { margin-top: calc(8 * var(--u)); font: 700 calc(9 * var(--u))/1.2 Rubik, sans-serif; letter-spacing: calc(1 * var(--u)); text-transform: uppercase; color: var(--mute); }
.acard .moves { display: flex; flex-wrap: wrap; gap: calc(6 * var(--u)) calc(5 * var(--u)); margin: 0 0 calc(8 * var(--u)); }
.acard .mv { display: grid; justify-items: center; gap: 1px; width: calc(30 * var(--u)); }
.acard .mv svg { width: calc(26 * var(--u)); height: calc(26 * var(--u)); display: block; }
.acard .mv b { font: 700 calc(14 * var(--u))/1 Handjet, monospace; color: var(--fg); }
.acard.locked .mv { opacity: .4; }

/* the old rarity frames (frameSVG) are no longer drawn on the card; their sticker rows still animate where used */
.fr .run { animation: fr-x 2.6s linear infinite; }
.fr .run.ry { animation-name: fr-y; }
@keyframes fr-x { to { transform: translateX(var(--p)); } }
@keyframes fr-y { to { transform: translateY(var(--p)); } }

/* off-screen groups are not painted (133 cards); the Prism top layer stays inside its group's box */
.cgroup { content-visibility: auto; contain-intrinsic-size: auto 640px; }

/* collection: one toolbar (scrolls sideways on a phone instead of wrapping), groups */
.chead { display: flex; align-items: center; gap: 20px; margin-bottom: 10px; }
.chead h2 { margin: 0; flex: none; font-size: clamp(20px, 2vw, 28px); }
.chead .ctools { min-width: 0; margin: 0; padding: 0; align-items: center; }
.chead .cf > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.chead .cf select { max-width: 190px; padding: 8px 10px; }
.ctools { display: flex; gap: 10px; align-items: flex-end; overflow-x: auto; scrollbar-width: none; padding: 2px 0 6px; margin-bottom: 6px; }
.cf { display: grid; gap: 4px; flex: none; color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.cf select { text-transform: none; letter-spacing: 0; font-size: 14px; max-width: 170px; }
.cf select, select[data-sel="names"], select[data-sel="layer"] { padding: 9px 12px; border-radius: 12px; background: var(--card); border: 0; color: var(--milk); }
.cflat { margin-top: 18px; }
.cset { margin: 38px 0 0; }
.cgroup header { display: flex; align-items: center; gap: 14px; margin: 26px 0 14px; }
.cgroup .gpic { width: 54px; height: 54px; flex: none; display: grid; place-items: center; }
.cgroup .gpic svg { width: 54px; height: 54px; display: block; }
.cgroup header h3 { font-size: 18px; }
.cgroup .gprog { font-family: Handjet, monospace; font-size: 20px; color: var(--muted); } .cgroup .gprog b { color: var(--milk); }

/* profile frames: the avatar ring is cut into stickers (a gap every 22.5°); the gold ring turns slowly like a layer */
@property --fa { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.soul .ava[style*="--frame"]::after, .mecard .ava[style*="--frame"]::after, .pava[style*="--frame"]::after {
  -webkit-mask: repeating-conic-gradient(from var(--fa), #000 0 19deg, transparent 19deg 22.5deg), linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: source-in, xor;
  mask: repeating-conic-gradient(from var(--fa), #000 0 19deg, transparent 19deg 22.5deg), linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: intersect, exclude;
}
.ava[style*="#f6d36a"]::after { animation: ring-turn 30s linear infinite; }
@keyframes ring-turn { to { --fa: 360deg; } }


@media (prefers-reduced-motion: reduce) { .fr .run, .ava::after { animation: none !important; } .acard, .acard .face { transition: none; } .acard:hover { transform: none; } }
@media (max-width: 560px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; } .cgroup .gpic, .cgroup .gpic svg { width: 44px; height: 44px; } }

/* ------------------------------------------------------------------ the card front (owner 2026-12-01): generated frames
   Бронза → Смарагд, a guilloché dial, the 3D cube, the name engraved along the ribbon (Tenor Sans), the numbers centred */
.acard { aspect-ratio: 379 / 457; }
.acard .front .mcard { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mcard .rname { font-family: 'Tenor Sans', Rubik, sans-serif; letter-spacing: .6px; }
.mcard .snum { font: 700 20px Rubik, sans-serif; fill: #F8F6F0; font-variant-numeric: tabular-nums; }
.mcard .slab { font: 400 10px 'Tenor Sans', Rubik, sans-serif; letter-spacing: .8px; text-transform: uppercase; fill: #F8F6F0; opacity: .8; }
.mcard .marrows line { stroke: #111318; stroke-width: 2.4; stroke-linecap: round; }
.mcard .marrows polygon { fill: #111318; }
.acard.locked .mcard { filter: grayscale(1) brightness(.6); }   /* locked: the whole card in grey, the case still visible */

/* ------------------------------------------------------------------ the card page (owner 2026-12-01): card and text in
   about equal parts over the working area */
.cpage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(20px, 3vw, 44px); align-items: start; padding: 72px clamp(16px, 3vw, 40px) 40px; max-width: 1400px; margin: 0 auto; }
.cp-card { position: sticky; top: 108px; display: grid; place-items: center; }
.cp-card .acard { width: min(100%, calc((100vh - 150px) * 379 / 457)); }
.cp-card .acard:hover { transform: none; }
.cp-info { display: grid; gap: 14px; align-content: start; min-width: 0; }
.cp-top { display: flex; align-items: center; gap: 8px; }
.cp-kick { flex: 1; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cp-nav { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--card2); color: var(--milk); font-size: 18px; text-decoration: none; }
.cp-nav.off { visibility: hidden; }
.cp-info h1 { margin: 0; font: 400 clamp(30px, 3.4vw, 48px)/1.05 'Tenor Sans', Rubik, sans-serif; letter-spacing: .02em; text-transform: uppercase; }
.cp-info h2 { margin: 10px 0 0; font-size: 15px; letter-spacing: .02em; }
.cp-names { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; }
.cp-names div { display: grid; gap: 2px; } .cp-names dt { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); } .cp-names dd { margin: 0; font-weight: 700; }
.cp-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; color: #c9ccd2; font-size: 14px; }
.cp-tier { padding: 5px 12px; border-radius: 10px; background: var(--rar, #3a3f4b); color: #F8F6F0; font: 800 12px Unbounded, sans-serif; }
.cp-tier.rar-bronze { background: #9a5a32; } .cp-tier.rar-silver { background: #8b929c; color: #23262E; } .cp-tier.rar-gold { background: #d9a92e; color: #23262E; } .cp-tier.rar-platinum { background: #5d6b7a; } .cp-tier.rar-diamond { background: #1f9e6e; }
.cp-tier.lock { background: #3a3f4b; }
.cp-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cp-stat { padding: 12px; border-radius: 14px; background: var(--card); } .cp-stat b { display: block; font: 700 22px Rubik, sans-serif; } .cp-stat span { font-size: 12px; color: var(--muted); }
.cp-views { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cp-views figure { margin: 0; padding: 14px; border-radius: 16px; background: var(--card); display: grid; justify-items: center; gap: 8px; }
.cp-views svg { width: 100%; max-width: 170px; height: auto; } .cp-views figcaption { font-size: 12px; color: var(--muted); }
.cp-algs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cp-algs li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 12px 8px 8px; border-radius: 14px; background: var(--card); }
.cp-algs li b { font: 600 15px Rubik, sans-serif; letter-spacing: .02em; overflow-wrap: anywhere; } .cp-algs li i { font-style: normal; font-size: 12px; color: var(--muted); white-space: nowrap; }
.cp-algs li.done i { color: #6fd3a6; }
.cp-play { width: 36px; height: 36px; border-radius: 11px; background: var(--card2); color: var(--milk); }
.cp-same { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.cp-same a { display: grid; justify-items: center; gap: 6px; padding: 10px 6px; border-radius: 14px; background: var(--card); color: inherit; text-decoration: none; font-size: 12px; text-align: center; }
.cp-same a svg { width: 64px; height: 64px; } .cp-same a.locked svg { filter: grayscale(1) opacity(.55); }
.cpage.locked .cp-views svg { filter: grayscale(1) opacity(.7); }
@media (max-width: 900px) {
  .cpage { grid-template-columns: minmax(0, 1fr); padding-top: 64px; }
  .cp-card { position: static; } .cp-card .acard { width: min(100%, 360px); }
  .cp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.cp-card { width: 100%; }
.cp-card .acard { display: block; width: min(100%, calc((100vh - 150px) * 379 / 457)) !important; max-width: none; }
.acard.locked .mcard { filter: grayscale(1) brightness(.72); }
/* the live cube over the card's window (owner 2026-12-01); the static picture hides under it */
.cp-card .face.front { position: relative; }
.cp-live { position: absolute; z-index: 2; pointer-events: none; }
.cp-card image.m3d, .cp-card .marrows { display: none; }
.cp-speed { display: flex; align-items: center; gap: 12px; width: min(100%, 360px); margin: 14px auto 0; padding: 10px 14px; border-radius: 14px; background: var(--card); font-size: 13px; color: var(--muted); }
.cp-speed input { flex: 1; accent-color: #EFC54B; } .cp-speed b { color: var(--milk); font: 700 14px Rubik, sans-serif; min-width: 3.2em; text-align: right; }
.cp-play.on { background: #EFC54B; color: #23262E; }
/* phones: the collection title and the filters wrap, nothing sticks out */
@media (max-width: 700px) { .chead { flex-wrap: wrap; } .chead .ctools { max-width: 100%; } .chead .cf select { max-width: 46vw; } }
