/*
 * The big "Pick your colour" logo sheet (logo-sheet.js). It bursts out of the rainbow expand button on
 * Account settings → Your logo, and peeks out of the header logo when you rest the mouse on it.
 */
html.lg-sheet-lock { overflow: hidden; }
.lg-sheet { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; }
.lg-sheet[hidden] { display: none; }
.lg-sheet-backdrop { position: absolute; inset: 0; background: rgba(5, 8, 12, 0.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.lg-sheet-panel {
  position: relative; width: min(1000px, 100%); height: min(800px, calc(100vh - 48px)); height: min(800px, calc(100dvh - 48px));
  display: flex; flex-direction: column; overflow: hidden; outline: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
.lg-sheet-inner { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.lg-sheet-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px 12px; }
.lg-sheet-preview { width: 52px; height: 52px; flex: none; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.2)); }
.lg-sheet-titles { flex: 1; min-width: 0; }
.lg-sheet-titles h3 { margin: 0; font-size: 1.12rem; font-weight: 900; letter-spacing: -0.02em; color: var(--text); }
.lg-sheet-sub { margin: 2px 0 0; line-height: 1.35; font-size: 0.84rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-sheet-jump { display: flex; gap: 6px; overflow-x: auto; padding: 0 18px 12px; border-bottom: 1px solid var(--border); scrollbar-width: none; flex: none; }
.lg-sheet-jump::-webkit-scrollbar { display: none; }
.lg-jump {
  flex: none; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-2); font: inherit; font-size: 0.78rem; font-weight: 700; white-space: nowrap; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.lg-jump:hover { border-color: var(--border-strong); color: var(--text); }
.lg-jump.is-active { background: var(--brand-soft); border-color: var(--brand); color: var(--text); }
.lg-sheet-body { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 18px 28px; }
.lg-sec { padding-top: 16px; scroll-margin-top: 4px; }
.lg-sec-title { margin: 0 0 10px; font-family: var(--mono); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.lg-sec-artsy .lg-sec-title, .lg-sec-featured .lg-sec-title { background: linear-gradient(90deg, #ff2d55, #ff8a00, #34c759, #0a84ff, #bf5af2); -webkit-background-clip: text; background-clip: text; color: transparent; display: inline-block; }
.lg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.lg-grid-fancy { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }

/* Featured designs: big cards showing the whole pattern */
.lg-card {
  position: relative; height: 112px; padding: 0; border: 0; border-radius: 16px; overflow: hidden; isolation: isolate; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font: inherit; background: #111;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.lg-card-bg { position: absolute; inset: -2px; z-index: -1; background-size: cover; background-position: center; transition: transform 0.7s cubic-bezier(.2, .8, .3, 1); }
.lg-card::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.5) 50%, transparent 65%);
  transform: translateX(-130%); transition: transform 0.8s ease;
}
.lg-card:hover { transform: translateY(-2px); }
.lg-card:hover .lg-card-bg { transform: scale(1.14) rotate(3deg); }
.lg-card:hover::after { transform: translateX(130%); }
.lg-card-mask { width: 64px; height: 64px; margin-top: -16px; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.28)); }
.lg-card-name {
  position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); padding: 3px 9px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.72); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); font-size: 0.74rem; font-weight: 800; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.lg-card[aria-checked="true"] { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--brand); }
.lg-card[aria-checked="true"]::before {
  content: '✓'; position: absolute; top: 8px; right: 8px; z-index: 2; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; color: #111; font-size: 0.78rem; font-weight: 900; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.lg-card:focus-visible, .lg-chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

/* Plain colours */
.lg-chip {
  min-width: 0; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 9px 4px 7px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit;
  transition: border-color 0.12s ease, transform 0.12s ease;
}
.lg-chip:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.lg-chip-img { width: 40px; height: 40px; display: block; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.15)); }
.lg-chip-name { display: block; max-width: 100%; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 1.35; padding: 0 2px; }
.lg-chip-name { font-size: 0.72rem; font-weight: 700; text-align: center; }
.lg-chip[aria-checked="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; color: var(--text); }

/* Phones: the sheet slides up from the bottom as one stacked, scrolling list */
@media (max-width: 560px) {
  .lg-sheet { padding: 0; place-items: end stretch; }
  .lg-sheet-panel { width: 100%; height: 92vh; height: 92dvh; border-radius: 22px 22px 0 0; border-bottom: 0; }
  .lg-sheet-panel::before { content: ''; position: absolute; top: 6px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: var(--border-strong); }
  .lg-sheet-head { padding: 18px 14px 10px; gap: 10px; }
  .lg-sheet-preview { width: 44px; height: 44px; }
  .lg-sheet-jump { padding: 0 14px 10px; }
  .lg-sheet-body { padding: 0 14px calc(24px + env(safe-area-inset-bottom)); }
  .lg-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .lg-grid-fancy { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .lg-card { height: 96px; }
  .lg-card-mask { width: 54px; height: 54px; }
  .lg-chip-img { width: 34px; height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .lg-card-bg, .lg-card::after, .lg-card, .lg-chip { transition: none; }
}

/* The header logo's door: while the sheet is only peeking out of the logo it lets the mouse through
   (so the hover isn't lost), skips the dimmed backdrop, and gets a soft shadow round its wave edge */
.lg-sheet.is-peek { pointer-events: none; }
.lg-sheet.is-peek .lg-sheet-backdrop { visibility: hidden; }
/* The jelly the mouse pulls out of the blob: a layer of glass under the sheet (logo-sheet.js computes its
   refraction map and shading every frame), and the canvas of light on top of it */
.lg-jelly, .lg-jelly-skin, .lg-jelly-shine { position: absolute; pointer-events: none; }
.lg-jelly { -webkit-backdrop-filter: url(#lg-refract); backdrop-filter: url(#lg-refract); }
.lg-jelly[hidden], .lg-jelly-skin[hidden], .lg-jelly-shine[hidden] { display: none; }
.lg-sheet.is-peek .lg-sheet-panel { visibility: hidden; } /* the sheet only appears once the jelly is clicked */
.lg-jelly-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
img.lg-escape-logo { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
/* Jelly Ball's header ball is grabbed and pulled (logo-sheet.js wireLogo): a finger dragging it pulls the jelly (the
   browser would otherwise take the drag as a scroll and cancel it) */
html[data-brand="jellyball"] img.lg-escape-logo { touch-action: none; cursor: grab; }
.page-brand, .brand { -webkit-touch-callout: none; }

/* The loose jelly logo (logo-blob.js): a canvas over the whole page that only the blob itself reacts on */
.lg-blob { position: fixed; inset: 0; z-index: 1002; pointer-events: none; }
body.lg-blob-grab { cursor: grabbing; -webkit-user-select: none; user-select: none; }
body.lg-blob-grab * { cursor: grabbing !important; }

/* the home page's big jelly (mountHero): its glass layers sit in a zero-size fixed box at the viewport's corner, so
   they're placed in viewport px like the header jelly's, over the page and under the bar */
.lg-hero-glass { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 5; pointer-events: none; }
.lg-hero-still { width: 100%; height: 100%; display: block; border-radius: 50%; opacity: 0.92; user-select: none; -webkit-user-drag: none; }
/* playjellyball.com: "Your ball" at the top of the colour sheet (client-src/04i-myball.js) */
.mb-section { padding: 4px 0 14px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.mb-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.mb-row.is-own { border-color: #8b5cf6; box-shadow: 0 0 0 3px color-mix(in srgb, #8b5cf6 18%, transparent); }
.mb-row.is-busy { opacity: 0.7; pointer-events: none; }
.mb-preview { width: 52px; height: 52px; flex: none; display: grid; place-items: center; }
.mb-preview .mb-ball { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; font-size: 40px; line-height: 52px; }
.mb-text { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.25; }
.mb-status { font-size: 0.82rem; color: var(--muted); }
.mb-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mb-btn { cursor: pointer; }
.mb-fine { margin: 6px 2px 0; font-size: 0.74rem; color: var(--muted); }
