/* The profiles library (/profiles), the share form (/share) and the review page (/review).
   Colors, sizes and speeds come from tokens.css; frames from frames.css; controls from controls.css. */

.lib-hero { padding: 72px 0 0; }
.lib-hero .wrap { display: flex; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.lib-hero .words { flex: 1 1 520px; }
.lib-hero h1 { font-size: clamp(36px, 5.2vw, 60px); line-height: 1.06; }
.lib-hero h1 .g { background: var(--accent); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lib-hero .lead { margin: 18px 0 0; max-width: 600px; }
.lib-hero .lead kbd, .how kbd { font: 600 13px var(--font-game); color: var(--mid); background: rgba(242, 238, 230, 0.06); padding: 1px 6px; border-radius: 4px; }

/* ---- W.Input: a dark box with a 1 px edge; the edge takes the accent on focus ---- */
.winput {
  width: 100%; height: 36px; padding: 0 12px; border: 0; border-radius: 6px; outline: none;
  font: 15px var(--font-body); color: var(--ink-value); background: #0e0e10; box-shadow: inset 0 0 0 1px var(--chip-edge);
  transition: box-shadow var(--fast) var(--ease);
}
.winput::placeholder { color: var(--ink-off); }
.winput:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mid) 50%, var(--chip-edge)); }
.winput:focus, .winput:focus-visible { box-shadow: inset 0 0 0 1px var(--mid), 0 0 0 3px color-mix(in srgb, var(--mid) 18%, transparent); outline: none; }
textarea.winput { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.55; resize: vertical; }
textarea.winput.code { font: 12.5px/1.5 ui-monospace, 'Cascadia Code', Consolas, monospace; min-height: 120px; word-break: break-all; }
.search { position: relative; }
.search .winput { padding-left: 36px; }
.search svg { position: absolute; left: 12px; top: 10px; width: 16px; height: 16px; color: var(--ink-label); pointer-events: none; }

/* ---- the bar over the list ---- */
.toolbar { margin-top: 44px; display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: 14px 28px; align-items: center; }
.toolbar .sorts { display: flex; gap: 22px; justify-self: end; }
.chiprow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chiprow .lbl { color: var(--ink-label); font-size: 13px; margin-right: 6px; min-width: 40px; }
.filters { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 10px; }
.chip .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--dot); }

/* ---- the grid of profiles ---- */
.lib { padding-top: 28px; }
.count { color: var(--ink-label); font-size: 13px; margin: 18px 0 14px; min-height: 21px; }
/* the library page runs wider than the others so the screenshots are big enough to read */
.wide .wrap { max-width: 1680px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(460px, 100%), 1fr)); gap: 22px; }
.pcard { display: flex; cursor: pointer; outline: none; text-align: left; border: 0; padding: 0; background: none; color: inherit; font: inherit;
  transition: transform var(--fast) var(--ease); }
.pcard > .in { position: relative; inset: auto; margin: var(--t); flex: 1; display: flex; flex-direction: column; overflow: hidden; border-radius: 2px; }
.pcard > .sh.b { transition: border-color var(--fast) var(--ease); }
.pcard:hover, .pcard:focus-visible { transform: translateY(-3px); }
.pcard:hover > .sh.b, .pcard:focus-visible > .sh.b { border-image: linear-gradient(90deg, var(--lo), var(--hi)) 1; }
.pic { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #0e0e10; }
.pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--normal) var(--ease), transform var(--slow) var(--ease); }
.pic img.in { opacity: 1; }
.pcard:hover .pic img { transform: scale(1.03); }
.pic .none { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(135deg, var(--plo, var(--lo)), var(--phi, var(--hi))); opacity: 0.55; }
.pic .none span { font: 300 44px var(--font-head); color: var(--ink-value); text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4); }
.pcard .body { padding: 14px 16px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.pcard h3 { font-size: 17px; font-weight: 400; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .by { font-size: 13px; color: var(--ink-label); }
.meta { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; font: 600 13px var(--font-game); letter-spacing: 0.02em; color: var(--ink-label); }
.meta .cls { color: var(--cc, var(--ink-text)); }
.meta .nums { margin-left: auto; display: flex; gap: 12px; }
.meta .n { color: var(--mid); }
.meta svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; color: var(--ink-label); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.tag { height: 20px; padding: 0 8px; border-radius: 6px; font: 600 12px/20px var(--font-game); color: var(--ink-label); background: var(--chip-off); box-shadow: inset 0 0 0 1px var(--chip-edge); }

.empty { padding: 60px 0; text-align: center; color: var(--ink-label); font-size: 15px; }
.empty .wbtn { margin-top: 18px; }
.loadmore { display: flex; justify-content: center; margin-top: 28px; }
.loadmore[hidden] { display: none; }

/* cards come in like the addon's list rows: fade and lift 4 px, a little apart */
.js .pcard.enter { opacity: 0; transform: translateY(4px); }
.pcard.enter.on { opacity: 1; transform: none; transition: opacity var(--normal) var(--ease), transform var(--normal) var(--ease); }
.skel { aspect-ratio: 16 / 13; border-radius: 6px; background: linear-gradient(90deg, #17171a, #1d1c1f, #17171a); background-size: 200% 100%; animation: skel 1.4s linear infinite; }
@keyframes skel { to { background-position: -200% 0; } }

/* ---- a profile, opened (a window: Win.Feel, fade on a sine and rise 8 px; leaves with a fade) ---- */
dialog.peek { padding: 0; border: 0; background: none; color: inherit; max-width: min(920px, calc(100vw - 32px)); width: 100%; max-height: calc(100dvh - 32px); overflow: visible; }
dialog.peek::backdrop { background: rgba(8, 8, 10, 0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity var(--open) var(--ease-sine); }
dialog.peek[open].on::backdrop { opacity: 1; }
dialog.peek > .win { opacity: 0; transform: translateY(8px); transition: opacity var(--open) var(--ease-sine), transform var(--open) var(--ease); }
dialog.peek.on > .win { opacity: 1; transform: none; }
dialog.peek.leaving > .win { opacity: 0; transform: none; transition: opacity var(--close) var(--ease); }
dialog.peek.leaving::backdrop { opacity: 0; transition: opacity var(--close) var(--ease); }
.win > .in { position: relative; inset: auto; margin: var(--t); max-height: calc(100dvh - 48px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--band-lit) transparent; }
.peek .pic { aspect-ratio: 16 / 9; }
.peek .pic img { cursor: zoom-in; }
.peek .top { padding: 20px 24px 0; display: flex; align-items: flex-start; gap: 16px; }
.peek h2 { font-size: 26px; line-height: 1.15; }
.peek .by { margin-top: 4px; color: var(--ink-label); font-size: 14px; }
.peek .grid2 { display: grid; grid-template-columns: 1fr 260px; gap: 28px; padding: 16px 24px 24px; }
.peek .about { white-space: pre-line; font-size: 15px; line-height: 1.65; color: var(--ink-text); }
.peek .about:empty { display: none; }
.peek dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.peek dt { color: var(--ink-label); }
.peek dd { margin: 0; color: var(--ink-value); }
.peek dd .n { color: var(--mid); font-weight: 600; }
.peek .acts { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.peek .acts .row { display: flex; gap: 10px; }
.peek .acts .row .wbtn { flex: 1; min-width: 0; }
.how { margin-top: 14px; font-size: 13px; line-height: 1.6; color: var(--ink-label); }
.how b { color: var(--ink-text); font-weight: 500; }

/* W.Close: the X, top right; tan, the accent on hover */
.wclose { flex: none; margin-left: auto; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 6px; cursor: pointer;
  background: none; color: var(--ink-label); transition: color var(--fast) var(--ease), background-color var(--fast) var(--ease); }
.wclose:hover, .wclose:focus-visible { color: var(--mid); background: rgba(242, 238, 230, 0.05); outline: none; }
.wclose svg { width: 14px; height: 14px; }

.wbtn.liked .lbl { color: var(--mid); }
.wbtn .lbl svg { width: 15px; height: 15px; margin-right: 7px; vertical-align: -2px; }
.wbtn[disabled] { cursor: default; opacity: 0.5; }

/* a short line that fades in under a button ("Copied", an error) */
.say { min-height: 21px; font-size: 13px; color: var(--ink-label); opacity: 0; transition: opacity var(--normal) var(--ease); }
.say.on { opacity: 1; }
.say.good { color: var(--ink-good); }
.say.bad { color: var(--ink-bad); }

/* ---- the share form ---- */
.form-wrap { padding-top: 44px; }
.form { max-width: 760px; }
.form > .in { position: relative; inset: auto; margin: var(--t); padding: 28px 32px 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px 22px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field > label, .field > .lbl { font-size: 13px; color: var(--ink-label); font-weight: 500; }
.field .hint { font-size: 12.5px; color: var(--ink-off); line-height: 1.5; }
.field .hint b { color: var(--ink-label); font-weight: 500; }
.drop { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 7; border-radius: 6px; cursor: pointer; overflow: hidden;
  background: #0e0e10; box-shadow: inset 0 0 0 1px var(--chip-edge); color: var(--ink-label); font-size: 14px; text-align: center; padding: 16px;
  transition: box-shadow var(--fast) var(--ease); }
.drop:hover, .drop.over, .drop:focus-within { box-shadow: inset 0 0 0 1px var(--mid); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.drop .x { position: absolute; top: 8px; right: 8px; z-index: 2; background: rgba(14, 14, 16, 0.8); }
.form .end { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.done > .in { position: relative; inset: auto; margin: var(--t); padding: 28px 32px; }
.done h2 { font-size: 28px; }
.done p { margin-top: 12px; color: var(--ink-text); }
.done .keep { margin-top: 18px; display: flex; gap: 10px; }
.done .keep .winput { font: 13px ui-monospace, Consolas, monospace; color: var(--mid); }
.warnline { color: var(--ink-label); }
.warnline b { color: var(--ink-warn); font-weight: 600; }

/* ---- the review page ---- */
.review-list { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.rrow > .in { position: relative; inset: auto; margin: var(--t); display: grid; grid-template-columns: 240px 1fr auto; gap: 18px; padding: 14px; align-items: start; }
.rrow .pic { border-radius: 4px; }
.rrow h3 { font-size: 18px; font-weight: 400; }
.rrow .about { font-size: 14px; color: var(--ink-text); white-space: pre-line; margin-top: 6px; max-height: 6.5em; overflow: auto; }
.rrow .acts { display: flex; flex-direction: column; gap: 8px; }
.keybox { display: flex; gap: 10px; max-width: 520px; margin-top: 20px; }

@media (max-width: 860px) {
  .toolbar { grid-template-columns: 1fr; }
  .toolbar .sorts { justify-self: start; }
  .peek .grid2 { grid-template-columns: 1fr; }
  .rrow > .in { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .lib-hero { padding-top: 48px; }
  .form > .in { grid-template-columns: 1fr; padding: 22px 18px; }
  .peek .top, .peek .grid2 { padding-left: 16px; padding-right: 16px; }
  .chiprow .lbl { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .pcard, .pcard.enter, .pic img, dialog.peek > .win { transition: none; transform: none; }
  .skel { animation: none; }
}
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
dialog.peek:focus, dialog.peek:focus-visible { outline: none; }
/* the copy button stays in view: the big screenshot gives up height first */
.peek .pic { max-height: 46vh; width: 100%; }
.wbtn[hidden] { display: none; }

/* ---- big screens: the screenshot fills the window, the details sit beside it ---- */
@media (min-width: 1100px) {
  dialog.peek { max-width: min(1640px, calc(100vw - 48px)); }
  .win > .in { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto 1fr; overflow: hidden; }
  .peek .pic { grid-row: 1 / span 2; align-self: center; max-height: calc(100dvh - 64px); }
  .peek .top { grid-column: 2; padding: 22px 22px 0; }
  .peek .grid2 { grid-column: 2; grid-template-columns: 1fr; gap: 18px; padding: 14px 22px 22px; overflow-y: auto; align-content: start; }
}
/* the opened screenshot shows whole, never cropped (ultrawide shots too) */
.peek .pic img { object-fit: contain; }

/* "Click to enlarge": a small chip that fades in over the picture */
.peek .pic .enlarge { position: absolute; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border: 0; border-radius: 7px; cursor: zoom-in; font: 600 13px var(--font-game); letter-spacing: 0.02em; color: var(--ink-text);
  background: rgba(14, 14, 16, 0.78); box-shadow: inset 0 0 0 1px var(--chip-edge); opacity: 0; transition: opacity var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
.peek .pic .enlarge svg { width: 14px; height: 14px; }
.peek .pic:hover .enlarge, .peek .pic .enlarge:focus-visible { opacity: 1; }
.peek .pic .enlarge:hover, .peek .pic .enlarge:focus-visible { box-shadow: inset 0 0 0 1px var(--mid); outline: none; }
@media (hover: none) { .peek .pic .enlarge { opacity: 1; } }

/* the screenshot full screen: fades in over everything, any click or Esc goes back */
.zoomview { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; cursor: zoom-out;
  background: rgba(8, 8, 10, 0.94); opacity: 0; pointer-events: none; transition: opacity var(--normal) var(--ease); }
.zoomview img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  transform: scale(0.97); transition: transform var(--normal) var(--ease); }
.peek.zoomed .zoomview { opacity: 1; pointer-events: auto; }
.peek.zoomed .zoomview img { transform: none; }
.zoomview .wclose { position: absolute; top: 16px; right: 16px; background: rgba(14, 14, 16, 0.8); }
@media (prefers-reduced-motion: reduce) { .zoomview, .zoomview img { transition: none; transform: none; } }
.peek .pic .enlarge .touch { display: none; }
@media (hover: none) { .peek .pic .enlarge .mouse { display: none; } .peek .pic .enlarge .touch { display: inline; } }

/* ---- the Patreon banner under the hero: the sun, a thin rule, the words, one button ---- */
.patron-wrap { margin-top: 36px; }
.patron { animation: patron-in var(--open) var(--ease) both; }
.patron > .in { position: relative; inset: auto; margin: var(--t, 0); overflow: hidden;
  display: grid; grid-template-columns: auto 1px 1fr auto; align-items: center; gap: 32px; padding: 30px 40px; }
.patron .glow { position: absolute; inset: -40% -10% -40% auto; width: 60%; pointer-events: none; opacity: 0.18;
  background: radial-gradient(closest-side, var(--hi), transparent), radial-gradient(closest-side at 30% 60%, var(--lo), transparent);
  filter: blur(30px); transition: opacity var(--slow) var(--ease); }
.patron:hover .glow { opacity: 0.3; }
.patron .sun { width: 76px; height: auto; position: relative; filter: drop-shadow(0 0 18px rgba(230, 90, 114, 0.25));
  transition: transform var(--slow) var(--ease), filter var(--slow) var(--ease); }
.patron:hover .sun { transform: translateY(-3px); filter: drop-shadow(0 0 26px rgba(255, 160, 60, 0.4)); }
.patron .rule { align-self: stretch; background: linear-gradient(180deg, transparent, var(--line) 20%, var(--line) 80%, transparent); width: 1px; }
.patron .words { position: relative; min-width: 0; }
.patron .eyebrow { font: 600 12px var(--font-game); letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-label); }
.patron h2 { margin-top: 8px; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.15; font-weight: 400; color: var(--ink-value); }
.patron h2 .g { background: var(--accent); -webkit-background-clip: text; background-clip: text; color: transparent; }
.patron p { margin-top: 8px; font-size: 15px; line-height: 1.5; color: var(--ink-text); max-width: 560px; }
.patron .wbtn { position: relative; white-space: nowrap; }
.patron .wbtn .arrow { display: inline-block; margin-left: 6px; transition: transform var(--fast) var(--ease); }
.patron .wbtn:hover .arrow, .patron .wbtn:focus-visible .arrow { transform: translateX(3px); }
@keyframes patron-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 860px) {
  .patron > .in { grid-template-columns: auto 1fr; gap: 18px 22px; padding: 24px 24px; }
  .patron .rule { display: none; }
  .patron .wbtn { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 640px) {
  .patron-wrap { margin-top: 28px; }
  .patron > .in { grid-template-columns: 1fr; }
  .patron .sun { width: 60px; }
  .patron .wbtn { justify-self: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  .patron, .patron .sun, .patron .glow, .patron .wbtn .arrow { animation: none; transition: none; transform: none; }
}
