/* Star Jar's jar (jar.js) and its editor (jaredit.js), shared by Star Jar and the Classboard widget.
   The glass takes the ink of the page (currentColor) so it suits the light and the dark theme; the lid takes --lid. */
.sj { --glass: rgba(191,224,255,.34); --glass2: rgba(205,232,255,.72); --tag: #F4E4C4; --tag-ink: #6B4A2B;
  position: relative; width: 100%; height: 100%; color: var(--fg); container-type: size; -webkit-tap-highlight-color: transparent; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sj { --glass: rgba(160,205,255,.12); --glass2: rgba(170,210,255,.34); } }
:root[data-theme="dark"] .sj { --glass: rgba(160,205,255,.12); --glass2: rgba(170,210,255,.34); }
.sj-svg { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; overflow: visible; }
.sj-glass { fill: var(--glass); }
.sj-glass2 { fill: var(--glass2); }
.sj-ln { stroke: currentColor; stroke-width: var(--sw); stroke-linejoin: round; }
.sj-edge { fill: none; }
.sj-neck { stroke: currentColor; stroke-width: calc(var(--sw) * .55); opacity: .35; }
.sj-shadow { fill: currentColor; opacity: .1; }
.sj-lidc { fill: var(--lid); }
.sj-lidd { fill: var(--lid-d); }
.sj-lidl { fill: var(--lid-l); }
.sj-ridge { stroke: var(--lid-d); stroke-width: 2.4; stroke-linecap: round; fill: none; }
.sj-tag { fill: var(--tag); stroke: #B07A4F; stroke-width: 1.6; stroke-linejoin: round; }
.sj-tagt { fill: var(--tag-ink); font-family: "Caveat", "Patrick Hand", var(--font); font-weight: 700; font-variant-numeric: tabular-nums; }
/* what moves turns about its own middle; the jar about its foot, the lid about its back corner, the tag about its knot */
.sj-im, .sj-sp, .sj-tagt { transform-box: fill-box; transform-origin: center; }
.sj-wob { transform-box: fill-box; transform-origin: 50% 100%; }
.sj-lid { transform-box: fill-box; transform-origin: 100% 100%; }
.sj-swing { transform-box: fill-box; transform-origin: 50% 0; }
.sj-shine { transform: translateX(-400px); }
.sj-fx { position: absolute; inset: 0; z-index: 2; pointer-events: none; }

/* a full jar: a halo and slow rays behind it (HTML, so the compositor turns them) */
.sj-glow { position: absolute; left: 50%; top: 50%; width: 0; height: 0; z-index: 0; pointer-events: none; translate: -50% -50%; opacity: 0; }
.sj-glow.is-on { opacity: 1; }
.sj-glow i { position: absolute; inset: 0; border-radius: 50%; }
.sj-halo { background: radial-gradient(closest-side, rgba(255,220,110,.85), rgba(255,206,84,.35) 48%, rgba(255,206,84,0) 100%); }
.sj-rays { background: repeating-conic-gradient(from 0deg, rgba(255,200,70,.34) 0deg 8deg, rgba(255,200,70,0) 8deg 24deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 25%, transparent 100%); mask-image: radial-gradient(closest-side, #000 25%, transparent 100%); }

/* the +3 and the badges */
.sj-plus { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 2px; white-space: nowrap; pointer-events: none; }
.sj-plus b { font-size: clamp(18px, 13cqmin, 64px); font-weight: 1000; line-height: 1; color: var(--fox); letter-spacing: -.02em;
  text-shadow: 2px 0 0 var(--surface), -2px 0 0 var(--surface), 0 2px 0 var(--surface), 0 -2px 0 var(--surface), 0 4px 0 var(--surface); }
.sj-plus span { max-width: 60cqw; overflow: hidden; text-overflow: ellipsis; padding: 3px 10px; border-radius: var(--r-pill); background: var(--forest); color: var(--paper); font-size: clamp(11px, 4.4cqmin, 20px); font-weight: 900; }
.sj-plus.is-minus b { color: var(--muted); }
.sj-badge { position: absolute; padding: .3em .8em .35em; border-radius: 16px; background: var(--gold); color: var(--forest); white-space: nowrap; pointer-events: none;
  font-size: clamp(15px, 9cqmin, 46px); font-weight: 1000; letter-spacing: -.01em; box-shadow: 0 5px 0 #C98A12, 0 14px 30px -10px rgba(20,48,44,.45); }
.sj-badge.is-big { background: var(--fox); box-shadow: 0 5px 0 var(--press), 0 14px 30px -10px rgba(20,48,44,.45); font-size: clamp(20px, 13cqmin, 72px); }

/* confetti over the whole page */
.sj-confetti { position: fixed; inset: 0; z-index: 90; overflow: hidden; pointer-events: none; }
.sj-confetti i { position: absolute; width: 9px; height: 9px; margin: -5px 0 0 -5px; border-radius: 2px; }
.sj-confetti i.is-strip { width: 7px; height: 15px; margin: -8px 0 0 -4px; border-radius: 3px; }
.sj-confetti i.is-dot { border-radius: 50%; }
.sj-confetti i.is-item { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
.sj-confetti i.is-item svg { display: block; width: 100%; height: 100%; overflow: visible; }
.sj-ico { display: block; width: 100%; height: 100%; overflow: visible; }

/* ---------- the editor (jaredit.js), in the class editor's dialog ---------- */
.sj-dialog { width: min(980px, calc(100% - 32px)); }
.sj-ed { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 290px); gap: 26px; align-items: start; }
.sj-ed-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sj-ed-main > .field-label { margin-top: 12px; }
.sj-ed-main > .field-label:first-child { margin-top: 0; }
.sj-ed-main > .field-label + .fine { margin-top: -6px; }
.sj-ed-side { position: sticky; top: 0; }
.sj-ed-prev { height: 340px; padding: 22px 14px 12px; border-radius: var(--r-md); background: radial-gradient(60% 50% at 50% 64%, var(--surface-3), var(--surface-2)); }
.sj-ed-cap { margin: 10px 0 0; text-align: center; color: var(--muted); font-weight: 900; }
.sj-hint { color: var(--muted); font-size: 13px; font-weight: 700; }
.sj-kinds { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.sj-kind { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 10px 4px 8px; border: 2px solid transparent; border-radius: 18px; background: var(--surface-2); color: var(--fg); font-size: 13px; font-weight: 800; line-height: 1.15; cursor: pointer; transition: transform .2s; }
.sj-kind:hover { transform: translateY(-2px); }
.sj-kind[aria-checked="true"] { border-color: var(--fg); background: var(--surface-3); }
.sj-kind b { font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.sj-kind-pic { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 76px; }
.sj-kind-pic > span { display: block; width: 100%; }
.sj-pick { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.sj-item { aspect-ratio: 1; padding: 9px; border: 2px solid transparent; border-radius: 14px; background: var(--surface-2); cursor: pointer; }
.sj-item .sj-ico { transition: transform .25s cubic-bezier(.2,1.5,.4,1); }
.sj-item:hover .sj-ico { transform: scale(1.12) rotate(-8deg); }
.sj-item[aria-checked="true"] { border-color: var(--fg); background: var(--surface-3); }
#sjColors .sw-dot[aria-checked="true"] { box-shadow: 0 0 0 3px var(--fg); }
.sj-rules { display: flex; flex-direction: column; gap: 6px; margin: 2px 0 0; padding: 0; list-style: none; }
.sj-rules:empty { display: none; }
.sj-rules li { display: flex; align-items: center; gap: 8px; }
.sj-rules .field { flex: 1; min-width: 0; padding: 9px 13px; font-size: 15px; }
.sj-step { display: inline-flex; align-items: center; flex: none; padding: 3px; border-radius: var(--r-pill); background: var(--surface-2); }
.sj-step button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--fg); font-size: 18px; font-weight: 900; line-height: 1; cursor: pointer; }
.sj-step button:hover:not(:disabled) { background: var(--hover); }
.sj-step button:disabled { opacity: .3; cursor: default; }
.sj-n { min-width: 34px; text-align: center; color: var(--accent-text); font-weight: 1000; font-variant-numeric: tabular-nums; }
.sj-del { display: grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.sj-del:hover { background: var(--hover); color: var(--danger); }
.sj-del svg { width: 18px; height: 18px; }
.sj-rule-add { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.sj-ideas { display: contents; }
.sj-idea { padding: 5px 12px; border: 2px dashed var(--border-strong); border-radius: var(--r-pill); background: none; color: var(--muted); font-size: 13px; font-weight: 800; cursor: pointer; }
.sj-idea::before { content: "+ "; }
.sj-idea:hover { border-style: solid; color: var(--fg); }
textarea.field.sj-reward { min-height: 84px; }
.sj-after { align-self: flex-start; margin-top: 4px; }
@media (max-width: 760px) {
  .sj-ed { grid-template-columns: 1fr; gap: 14px; }
  .sj-ed-side { order: -1; position: static; }
  .sj-ed-prev { height: 210px; }
  .sj-kind { font-size: 11px; padding: 8px 2px 6px; }
  .sj-kind-pic { height: 58px; }
  .sj-pick { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
