/* Pickle Rocket v2 - screen styles. One marked section per owner; builders append ONLY inside their own section.
   Tokens come from style.css (:root). Card = portrait 3:4, 44 px tap targets, no overflow, safe-area aware. */

/* core */
/* owner: SHELL (pm-core.js companion). Standard card, skeleton, screen host, rows, grids, segmented control. */
#screens { flex: 1; width: 100%; min-width: 0; }
#screens[hidden], .screen[hidden] { display: none !important; }
.screen { width: 100%; min-width: 0; }
.pm-page { width: 100%; max-width: var(--content-max, 1280px); margin: 0 auto; padding: 12px var(--gutter) 24px; }
.pm-card { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--text); text-decoration: none; border-radius: 16px; outline-offset: 3px; }
.pm-card:focus-visible { outline: 2px solid var(--focus); }
.pm-cover { position: relative; aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden; background: var(--card2); border: 1px solid var(--line); isolation: isolate; transition: transform .2s ease-out, border-color .2s ease-out, box-shadow .2s ease-out; }
.pm-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; display: block; transition: transform .25s ease-out; }
.pm-title { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 10px 8px; font-size: 14px; font-weight: 800; line-height: 1.2; color: var(--text-inverse); text-shadow: 0 1px 2px var(--image-scrim); background: linear-gradient(180deg, color-mix(in srgb, var(--title-scrim) 72%, transparent) 0%, var(--title-scrim) 100%); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; pointer-events: none; }
.pm-level { position: absolute; right: 8px; top: 8px; padding: 2px 8px; border-radius: 999px; background: var(--image-scrim); color: var(--text-inverse); font-size: 12px; font-weight: 700; }
.pm-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 0 4px; }
.pm-creator { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-plays { font-size: 12px; color: var(--muted); white-space: nowrap; }
@media (hover: hover) { .pm-card:hover .pm-cover img { transform: scale(1.04); } .pm-card:hover .pm-cover { border-color: var(--gold-text); transform: translateY(-3px); box-shadow: var(--shadow); } }
/* Skeleton shimmer: a static var(--card) block plus a highlight band on ::after that only moves by transform, so the
   loading state runs on the compositor (no repaint per frame). Same band as the old 200% background sweep: the
   var(--card2) peak travels from -50% to 150% of the width in 1.4 s; reduced motion parks it at the right edge. */
.pm-skel .pm-cover, .pm-skel .pm-creator, .pm-skel .pm-plays, .pm-play-poster.pm-skel { background: var(--card); border-radius: 8px; overflow: hidden; }
.pm-skel .pm-creator, .pm-skel .pm-plays { position: relative; }
.pm-skel .pm-cover::after, .pm-skel .pm-creator::after, .pm-skel .pm-plays::after, .pm-play-poster.pm-skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 10%, var(--card2) 50%, transparent 90%); transform: translateX(-100%); animation: pmShimmer 1.4s linear infinite; pointer-events: none; }
.pm-skel .pm-creator { width: 70%; height: 13px; } .pm-skel .pm-plays { width: 40%; height: 11px; }
@keyframes pmShimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .pm-skel .pm-cover::after, .pm-skel .pm-creator::after, .pm-skel .pm-plays::after, .pm-play-poster.pm-skel::after { animation: none; transform: translateX(50%); } .pm-cover, .pm-cover img { transition: none; } .pm-card:hover .pm-cover { transform: none; } .pm-card:hover .pm-cover img { transform: none; } }
.pm-row { margin: 0 calc(-1 * var(--gutter)) 18px; }
.pm-row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 var(--gutter); margin-bottom: 8px; }
.pm-row-head h2 { margin: 0; font-size: 17px; }
.pm-row-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(132px, 38vw, 176px); gap: 10px; padding: 2px var(--gutter) 6px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); scrollbar-width: none; overscroll-behavior-x: contain; }
.pm-row-scroll::-webkit-scrollbar { display: none; }
.pm-row-scroll > .pm-card { scroll-snap-align: start; }
.pm-grid { display: grid; gap: 12px 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 148px), 1fr)); }
@media (min-width: 721px) { .pm-row-scroll { grid-auto-columns: 180px; gap: 14px; } .pm-grid { gap: 16px 14px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } }
@media (min-width: 1101px) { .pm-row-scroll { grid-auto-columns: 196px; } .pm-grid { grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); } }
.pm-all .pm-row-head { padding: 0; }
.pm-sentinel { height: 1px; }
.pm-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 4px 0 14px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); }
.pm-seg-btn { display: flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 0 12px; border-radius: 999px; color: var(--muted); font-weight: 700; font-size: 15px; white-space: nowrap; }
.pm-seg-btn.on { background: var(--text); color: var(--bg); }
.pm-seg-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pm-empty { text-align: center; padding: 40px 16px; }
.pm-empty .btn { margin-top: 14px; }
.pm-stub { padding: 12px 0; }
.pm-stub svg { width: 16px; height: 16px; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 2; }
body.pm-pull::before { content: "Release to refresh"; position: fixed; top: calc(var(--top-h) + 8px); left: 50%; transform: translateX(-50%); z-index: 40; padding: 6px 14px; border-radius: 999px; background: var(--card2); color: var(--text); font-size: 13px; font-weight: 700; }
/* end core */

/* home */
/* owner: HOME builder - append below this line only */
.pm-home { padding-top: 10px; }
.pm-home-rows { display: flex; flex-direction: column; min-width: 0; }
/* Rows from the 4th on start below the first screen on every viewport: the browser skips their layout and paint until
   they come near the viewport. The placeholder height is the real row height (head 48 + padding 8 + 3:4 cover +
   meta 43 = 99 px + 4/3 of the card width), and "auto" keeps the measured height once a row was rendered. */
.pm-home-row:nth-child(n+4) { content-visibility: auto; padding-top: 4px; margin-top: -4px; /* paint containment clips the focus outline at the row top; keep 4 px inside, same footprint */ contain-intrinsic-block-size: auto calc(99px + clamp(132px, 38vw, 176px) * 4 / 3); }
@media (min-width: 721px) { .pm-home-row:nth-child(n+4) { contain-intrinsic-block-size: auto calc(99px + 180px * 4 / 3); } }
@media (min-width: 1101px) { .pm-home-row:nth-child(n+4) { contain-intrinsic-block-size: auto calc(99px + 196px * 4 / 3); } }
.pm-home-row .pm-row-head { min-height: var(--tap); margin-bottom: 4px; }
.pm-home-row-tools { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.pm-home-seeall { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 10px; border-radius: 10px; color: var(--gold-text); font-weight: 700; font-size: 14px; white-space: nowrap; }
.pm-home-seeall:hover { background: var(--bg2); }
.pm-home-seeall:focus-visible, .pm-row-arrow:focus-visible, .pm-home-end .btn:focus-visible, .pm-home-err .btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pm-row-arrow { display: none; align-items: center; justify-content: center; width: var(--tap); height: var(--tap); padding: 0; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); color: var(--text); cursor: pointer; }
.pm-row-arrow svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pm-row-arrow:hover { border-color: var(--muted); }
.pm-row-arrow[aria-disabled="true"] { opacity: .4; cursor: default; }
@media (hover: hover) and (min-width: 721px) { .pm-row-arrow { display: inline-flex; } }
.pm-home-row .pm-row-scroll { scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }
@media (prefers-reduced-motion: reduce) { .pm-home-row .pm-row-scroll { scroll-behavior: auto; } }
.pm-home-all { margin-top: 6px; }
.pm-home-all .pm-row-head { min-height: var(--tap); align-items: baseline; }
.pm-home-sub { white-space: nowrap; }
.pm-home-foot { min-height: 1px; margin-top: 16px; }
.pm-home-loading { text-align: center; padding: 12px 0; }
.pm-home-end, .pm-home-err { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; max-width: 640px; margin-inline: auto; padding: 28px 16px; text-align: center; border: 1px dashed var(--line); border-radius: var(--card-radius, 16px); background: var(--bg2); }
.pm-home-end > svg { width: 36px; height: 36px; fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 4px; }
.pm-home-end h3 { margin: 0; font-size: 18px; font-weight: 800; color: var(--text); text-transform: none; letter-spacing: 0; }
.pm-home-end p, .pm-home-err p { margin: 0; font-size: 15px; }
.pm-home-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }
.pm-home-acts .btn svg, .pm-home-err .btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pm-home-err { border-color: var(--bad); }
.pm-home-rows > .pm-home-err { margin: 0 auto 18px; }
.pm-home-row-skel .pm-row-head h2 { color: var(--muted); }
/* end home */

/* play */
/* owner: PLAY builder - append below this line only */
.screen-play { position: relative; }
.pm-play { position: relative; height: calc(100svh - var(--top-h) - var(--tab-h)); overflow-y: auto; overflow-x: hidden; scroll-snap-type: y mandatory; overscroll-behavior-y: contain; scrollbar-width: none; outline: none; }
.pm-play::-webkit-scrollbar { display: none; }
.pm-play-card { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: grid; grid-template-rows: minmax(0, 1fr) auto; row-gap: 8px; padding: 8px max(var(--gutter), env(safe-area-inset-right, 0px)) 10px max(var(--gutter), env(safe-area-inset-left, 0px)); }
.pm-play-stage { position: relative; min-height: 0; border-radius: 20px; overflow: hidden; background: var(--stage); border: 1px solid var(--line); isolation: isolate; }
.pm-play-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; transition: opacity .3s ease-out; }
.pm-play-card.is-loaded .pm-play-poster { opacity: 0; }
.pm-play-stage .game-frame { z-index: 1; }
.pm-play-shade { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, color-mix(in srgb, var(--image-scrim) 70%, transparent) 0%, transparent 34%, transparent 72%, color-mix(in srgb, var(--image-scrim) 65%, transparent) 100%); transition: opacity .25s ease-in; }
.pm-play-head { position: absolute; left: 14px; right: 14px; top: 12px; z-index: 2; pointer-events: none; display: flex; flex-direction: column; gap: 2px; transition: opacity .25s ease-in; }
.pm-play-title { font-size: 20px; font-weight: 900; line-height: 1.15; color: var(--text-inverse); text-shadow: 0 1px 3px var(--image-scrim); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pm-play-genre { font-size: 13px; font-weight: 700; color: var(--text-inverse); opacity: .9; text-shadow: 0 1px 2px var(--image-scrim); }
.pm-play-stage .pm-level { z-index: 2; right: 12px; top: 12px; }
.pm-play-card.is-active .pm-play-shade, .pm-play-card.is-active .pm-play-head { opacity: 0; }
.pm-play-btn { position: absolute; left: 50%; top: 50%; z-index: 2; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 8px; min-height: 56px; min-width: 132px; padding: 0 26px 0 20px; border-radius: 999px; border: 0; background: var(--gold); color: var(--on-accent); font: inherit; font-size: 18px; font-weight: 900; cursor: pointer; box-shadow: var(--shadow); transition: transform .15s ease-out; }
.pm-play-btn svg { width: 26px; height: 26px; fill: currentColor; stroke: none; }
.pm-play-btn:active { transform: translate(-50%, -50%) scale(.96); }
@media (hover: hover) { .pm-play-btn:hover { background: var(--gold2); } }
.pm-play-card.is-active .pm-play-btn { display: none; }
.pm-play-load { position: absolute; left: 50%; bottom: 14px; z-index: 2; transform: translateX(-50%); display: none; padding: 6px 14px; border-radius: 999px; background: var(--image-scrim); color: var(--text-inverse); font-size: 13px; font-weight: 700; pointer-events: none; white-space: nowrap; }
.pm-play-card.is-active:not(.is-loaded) .pm-play-load { display: block; }
.pm-play-info { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who follow" "acts acts"; column-gap: 10px; row-gap: 6px; align-items: center; }
.pm-play-who { grid-area: who; display: flex; align-items: center; gap: 10px; min-height: var(--tap); min-width: 0; color: var(--text); border-radius: 12px; }
.pm-play-who:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pm-play-who .av { width: 40px; height: 40px; font-size: 16px; }
.pm-play-text { display: flex; flex-direction: column; min-width: 0; }
.pm-play-tname { font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-play-cname { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-play-follow { grid-area: follow; }
.btn.follow.pm-play-follow { justify-self: end; min-width: 0; min-height: 44px; height: 44px; padding: 0 14px; border-radius: 12px; font-size: 13px; font-weight: 700; background: color-mix(in srgb, var(--gold) 12%, var(--card)); border-color: color-mix(in srgb, var(--line) 45%, var(--card)); color: var(--text); }
.btn.follow.pm-play-follow.on { background: var(--card2); color: var(--text); }
.pm-play-desc { display: none; grid-area: desc; margin: 0; font-size: 14px; color: var(--muted); overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.pm-play-acts { grid-area: acts; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.pm-act { flex: 1 0 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 2px 4px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--line) 45%, var(--card)); background: var(--card); color: var(--text); font: inherit; font-weight: 600; font-size: 13px; line-height: 16px; cursor: pointer; white-space: nowrap; }
.pm-act svg { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pm-act-metric { flex-direction: column; gap: 2px; min-width: max(44px, calc(5.5ch + 10px)); }
.pm-act-count { flex: 0 0 auto; font-size: 13px; line-height: 16px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pm-play-acts > [data-act="tools"] { flex: 0 0 44px; padding: 0; }
.pm-play-acts .game-create-actions { flex: 0 0 auto; margin: 0; }
.pm-play-acts .game-create-actions .remix-action { min-height: 44px; padding: 0 10px; border-radius: 12px; background: var(--card2); border-color: color-mix(in srgb, var(--line) 45%, var(--card)); font-size: 13px; }
.pm-act.on { color: var(--bad-text); background: color-mix(in srgb, var(--bad) 8%, var(--card)); border-color: color-mix(in srgb, var(--bad) 35%, var(--card)); } .pm-act.on svg { fill: currentColor; }
.pm-act:focus-visible, .pm-play-btn:focus-visible, .pm-play-nav .btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (hover: hover) { .pm-act:hover { border-color: var(--muted); } }
.pm-act-label { display: none; }
.pm-act-next { flex: 0 0 var(--tap); padding: 0; }
.pm-play-nav { display: none; grid-area: nav; gap: 8px; }
.pm-play-card.pm-play-state { display: flex; align-items: center; justify-content: center; padding: 16px var(--gutter); }
.pm-play-empty { max-width: 360px; }
.pm-play-empty h2 { margin: 10px 0 6px; font-size: 22px; }
.pm-play-ico { display: inline-flex; width: 56px; height: 56px; align-items: center; justify-content: center; border-radius: 50%; background: var(--card2); border: 1px solid var(--line); }
.pm-play-ico svg { width: 28px; height: 28px; fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pm-play-empty-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.pm-play-empty-acts .btn { margin-top: 0; min-width: 140px; }
.pm-play-empty-acts .btn svg { fill: none; }
@media (prefers-reduced-motion: reduce) { .pm-play { scroll-behavior: auto; } .pm-play-poster, .pm-play-shade, .pm-play-head, .pm-play-btn { transition: none; } }
@media (max-height: 560px) { .pm-play-card { row-gap: 4px; padding-top: 4px; padding-bottom: 6px; } .pm-play-info { row-gap: 4px; } }
/* tablet (721-1100): one centred 9:16 column, info under it */
@media (min-width: 721px) {
  .pm-play-card { padding: 14px 24px 16px; row-gap: 12px; justify-items: center; }
  .pm-play-stage { height: 100%; width: auto; max-width: 100%; aspect-ratio: 9 / 16; justify-self: center; }
  .pm-play-info { width: 100%; max-width: 480px; }
}
/* desktop (>1100): stage + side panel (creator, title, description, actions, prev/next) */
@media (min-width: 1101px) {
  .pm-play-card { grid-template-columns: auto minmax(220px, 280px); grid-template-rows: minmax(0, 1fr); column-gap: 24px; justify-content: center; align-items: stretch; padding: 16px 32px 20px; }
  .pm-play-stage { max-width: 480px; }
  .pm-play-info { grid-template-columns: 1fr; grid-template-areas: "who" "follow" "desc" "acts" "nav"; align-content: start; row-gap: 12px; max-width: none; padding-top: 6px; }
  .pm-play-who .av { width: 48px; height: 48px; font-size: 19px; }
  .pm-play-tname { font-size: 18px; white-space: normal; }
  .btn.follow.pm-play-follow { justify-self: start; }
  .pm-play-desc { display: -webkit-box; }
  .pm-play-acts { flex-direction: column; align-items: stretch; gap: 8px; }
  .pm-act, .pm-play-acts > [data-act="tools"] { flex: 0 0 auto; justify-content: flex-start; min-height: 44px; padding: 0 12px; }
  .pm-act-metric { flex-direction: row; gap: 8px; }
  .pm-act-label { display: inline; }
  .pm-act-count { min-width: 34px; text-align: left; }
  .pm-act-next { display: none; }
  .pm-play-nav { display: flex; }
  .pm-play-nav .btn { flex: 0 0 var(--tap); width: var(--tap); padding: 0; }
  .pm-play-nav .btn svg { fill: none; }
  .pm-play-head { left: 18px; right: 18px; top: 16px; }
}
/* short landscape (phone rotated / small laptop window, height <= 560): the top bar is hidden by style.css, the stage
   fills the height and any aspect (games re-lay out live), creator + actions + prev/next sit in a side column */
@media (min-width: 721px) and (max-height: 560px) {
  .pm-play-card { grid-template-columns: minmax(0, 1fr) minmax(200px, 250px); grid-template-rows: minmax(0, 1fr); grid-template-areas: none; column-gap: 14px; row-gap: 0; justify-content: stretch; justify-items: stretch; align-items: stretch; padding: 8px 16px 8px; }
  .pm-play-stage { height: 100%; width: 100%; max-width: none; aspect-ratio: auto; justify-self: stretch; border-radius: 16px; }
  .pm-play-info { grid-template-columns: 1fr; grid-template-areas: "who" "follow" "acts" "nav"; align-content: start; row-gap: 8px; width: auto; max-width: none; padding-top: 2px; }
  .pm-play-who .av { width: 40px; height: 40px; font-size: 16px; }
  .pm-play-tname { font-size: 15px; white-space: nowrap; }
  .btn.follow.pm-play-follow { justify-self: start; }
  .pm-play-desc { display: none; }
  .pm-play-acts { flex-direction: row; gap: 6px; }
  .pm-act { flex: 1 0 44px; justify-content: center; min-height: 44px; padding: 2px 4px; }
  .pm-act-metric { flex-direction: column; gap: 2px; }
  .pm-act-count { min-width: 0; text-align: center; }
  .pm-act-label, .pm-act-next { display: none; }
  .pm-play-nav { display: flex; }
  .pm-play-nav .btn { flex: 0 0 var(--tap); width: var(--tap); padding: 0; }
  .pm-play-nav .btn svg { fill: none; }
  .pm-play-head { left: 14px; right: 14px; top: 12px; }
}
.pm-play-tname { display: flex; align-items: center; gap: 6px; }
.pm-play-game-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-play-tname > .mature-badge { align-self: center; }
@media (min-width: 1101px) and (min-height: 561px) { .pm-play-game-name { white-space: normal; overflow-wrap: anywhere; } }
/* end play */

/* library */
/* owner: LIBRARY+PROFILE builder - append below this line only */
.pm-library-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.pm-library-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-height: 0; }
.pm-library-h1 { margin: 0; font-size: 22px; line-height: 1.2; }
.pm-library-count { font-size: 13px; font-weight: 600; white-space: nowrap; }
.pm-library-seg { max-width: 520px; }
.pm-library-panel { min-height: 240px; }
.pm-library-foot { padding: 8px 0 0; }
.pm-library-loading { margin-top: 12px; }
.pm-library-end { text-align: center; font-size: 13px; padding: 16px 0 0; }
.pm-library-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 420px; margin: 0 auto; padding: 36px 8px 24px; }
.pm-library-empty h2 { margin: 6px 0 0; font-size: 20px; }
.pm-library-empty p { margin: 0; }
.pm-library-empty-ic { display: inline-flex; width: 64px; height: 64px; align-items: center; justify-content: center; border-radius: 50%; background: var(--card2); border: 1px solid var(--line); color: var(--gold-text); }
.pm-library-empty-ic svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pm-library-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; width: 100%; }
.pm-library-cta .btn { flex: 1 1 150px; max-width: 240px; padding-inline: 14px; }
.pm-library-error { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; padding: 20px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg2); text-align: center; }
@media (max-width: 720px) { .pm-library-head { margin: 2px 0 10px; } .pm-library-h1 { font-size: 22px; } }
@media (min-width: 721px) { .pm-library-head { margin: 4px 0 10px; } .pm-library-h1 { font-size: 26px; } .pm-library-seg { margin-bottom: 18px; } }
/* end library */

/* profile */
/* owner: LIBRARY+PROFILE builder - append below this line only */
.pm-profile-head { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 0 8px; text-align: center; }
.pm-pav { border: 3px solid var(--line); box-shadow: var(--shadow); }
.pm-profile-name { margin: 4px 0 0; font-size: clamp(24px, 4vw, 32px); line-height: 1.15; overflow-wrap: anywhere; }
.pm-profile-name .pm-last { font-weight: 600; }
.pm-profile-avwrap { position: relative; width: 128px; height: 128px; }
.pm-profile-avwrap .av { display: block; }
.pm-profile-avbtn { position: absolute; right: -4px; bottom: -4px; width: var(--tap); height: var(--tap); border-radius: 50%; border: 3px solid var(--bg); background: var(--gold); color: var(--on-accent); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; box-shadow: var(--shadow); }
.pm-profile-avbtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pm-profile-avbtn:hover { background: var(--gold2); }
.pm-profile-avbtn:disabled { opacity: .6; cursor: default; }
.pm-profile-avbtn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.pm-profile-handle { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; }
.pm-profile-verified { display: inline-flex; width: 18px; height: 18px; border-radius: 50%; background: var(--gold); color: var(--on-accent); align-items: center; justify-content: center; }
.pm-profile-verified svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.pm-profile-src { margin: 0; overflow-wrap: anywhere; }
.pm-profile-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; width: 100%; }
.pm-profile-actions .btn { flex: 1 1 150px; max-width: 240px; }
.pm-profile-edit { width: 100%; max-width: 480px; margin: 8px auto 0; padding: 14px; text-align: start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.pm-profile-edit-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.pm-profile-edit .field { margin-bottom: 10px; }
.pm-profile-edit .alert { margin-bottom: 10px; }
.pm-profile-edit-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.pm-profile-edit-btns .btn { flex: 1 1 120px; }
.pm-profile-edit p { margin: 10px 0 0; }
.pm-profile-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 10px 0 0; }
.pm-profile-stat { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: 10px 6px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); text-align: center; }
.pm-profile-stat strong { font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pm-profile-stat span { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pm-profile-follow { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); margin-top: 4px; color: var(--muted); font-size: 14px; border-radius: 10px; }
.pm-profile-follow strong { color: var(--text); }
.pm-profile-follow:hover { background: var(--bg2); }
.pm-profile-verify { margin-top: 12px; }
.pm-profile-menuwrap { margin-top: 22px; }
.pm-profile-menu { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.pm-profile-item { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 14px; width: 100%; color: var(--text); font: inherit; font-weight: 600; font-size: 15px; text-align: start; background: transparent; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.pm-profile-item:last-child { border-bottom: 0; }
.pm-profile-item:hover { background: var(--card2); }
.pm-profile-item:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.pm-profile-item-ic { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 10px; background: var(--bg2); color: var(--gold-text); flex: 0 0 auto; }
.pm-profile-item-ic svg, .pm-profile-item-chev svg, .pm-profile-actions .btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pm-profile-item-txt { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-profile-item-chev { display: inline-flex; color: var(--muted); flex: 0 0 auto; }
.pm-profile-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--gold); color: var(--on-accent); font-size: 12px; font-weight: 800; }
.pm-profile-out { color: var(--bad); } .pm-profile-out .pm-profile-item-ic { color: var(--bad); }
.pm-profile-games { margin-top: 22px; }
.pm-profile-games .pm-row-head { padding: 0; margin-bottom: 10px; }
.pm-profile-nogames { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px 12px; border: 1px dashed var(--line); border-radius: var(--radius); }
.pm-profile-nogames p { margin: 0 0 8px; }
.pm-profile-error { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg2); text-align: center; }
.pm-profile-guest { max-width: 440px; margin: 24px auto; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 28px 20px 20px; }
.pm-profile-guest h1 { margin: 4px 0 0; font-size: 26px; }
.pm-profile-guest p { margin: 0 0 6px; }
.pm-profile-guest .btn { margin: 0; }
.pm-profile-guest-foot { margin-top: 8px !important; }
.pm-profile-guest-ic { display: inline-flex; width: 96px; height: 96px; align-items: center; justify-content: center; border-radius: 50%; background: var(--card2); border: 3px solid var(--line); color: var(--gold-text); }
.pm-profile-guest-ic svg { width: 52px; height: 52px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 721px) { .pm-profile-side, .pm-profile-menuwrap { max-width: 560px; margin-left: auto; margin-right: auto; width: 100%; } .pm-profile-games { margin-top: 28px; } }
@media (min-width: 1101px) {
  .pm-profile-layout { display: grid; grid-template-columns: 372px minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 32px; row-gap: 0; align-items: start; }
  .pm-profile-side { grid-column: 1; grid-row: 1; max-width: none; margin: 0; }
  .pm-profile-menuwrap { grid-column: 1; grid-row: 2; max-width: none; margin: 18px 0 0; }
  .pm-profile-main { grid-column: 2; grid-row: 1 / span 2; min-width: 0; }
  .pm-profile-head { padding-top: 8px; }
  .pm-profile-games { margin-top: 8px; }
}
/* guest: Settings (Sound, feedback, About) and the legal links stay reachable without an account */
.pm-profile-guest-more { max-width: 440px; margin: -8px auto 24px; display: flex; flex-direction: column; gap: 8px; }
.pm-profile-guest-more .pm-legal-links { justify-content: center; }
@media (prefers-reduced-motion: no-preference) { .pm-profile-item, .pm-profile-avbtn { transition: background-color .15s ease-out; } }
/* end profile */

/* share QR: the symbol stays dark on a light tile in either app theme. */
.share-qr-sheet { max-width: 420px; }
.share-qr { display: flex; flex-direction: column; align-items: center; gap: 12px; min-width: 0; }
.share-qr-tile { width: min(100%, 264px); padding: 12px; border-radius: 12px; background: var(--text-inverse); }
.share-qr-canvas { display: block; width: 100%; height: auto; aspect-ratio: 1; image-rendering: pixelated; }
.share-qr-canvas[hidden] { display: none; }
.share-qr-title { width: 100%; text-align: center; overflow-wrap: anywhere; line-height: 1.4; }
.share-qr-hint { margin: 0; text-align: center; }
.share-qr-error { width: 100%; margin: 0; }
.share-qr-actions { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; }
.share-qr-actions .btn { flex: 1 1 130px; min-height: 44px; }
.share-qr-link { width: 100%; margin: 0; }
.sico.share-qr-icon { background: var(--bg2); color: var(--text); border: 1px solid var(--line); }
.sico.share-qr-icon svg { stroke: currentColor; }
@media (max-height: 640px) {
  .share-qr { gap: 10px; }
  .share-qr-tile { width: min(100%, 224px); }
  .share-qr-hint { display: none; }
}
@media (min-width: 560px) and (max-height: 560px) {
  .share-qr-sheet { max-width: 560px; }
  .share-qr { display: grid; grid-template-columns: 204px minmax(0, 1fr); gap: 10px 16px; align-items: start; }
  .share-qr-tile { grid-column: 1; grid-row: 1; width: 204px; min-height: 204px; }
  .share-qr-title { grid-column: 1; grid-row: 2; }
  .share-qr-actions { grid-column: 2; grid-row: 1; align-self: start; }
  .share-qr-link { grid-column: 2; grid-row: 1; align-self: end; }
  .share-qr-error { grid-column: 2; grid-row: 2; }
}
/* end share QR */
