/* Star Jar: the shelf, one jar on the projector, the moment it fills. The jar itself and the editor are in kit/jar.css. */
.brand-ico svg { width: 40px; height: 42px; }

/* ---------- the first visit ---------- */
.sj-intro { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: center; gap: 24px 40px; min-height: min(78vh, 720px); padding-block: 10px 20px; }
.sj-intro-copy { display: flex; flex-direction: column; gap: 16px; animation: rise .6s cubic-bezier(.2,.9,.3,1) both; }
.sj-title { font-size: clamp(40px, 5.4vw, 76px); }
.sj-lead { margin: 0; max-width: 46ch; color: var(--muted); font-size: clamp(17px, 1.5vw, 20px); font-weight: 700; }
.sj-points { display: grid; gap: 10px; margin: 4px 0 6px; padding: 0; list-style: none; font-size: 17px; font-weight: 800; }
.sj-points li { display: flex; align-items: center; gap: 12px; }
.sj-point-ico { flex: none; width: 30px; height: 30px; }
.sj-intro-go { display: flex; flex-wrap: wrap; gap: 10px; }
.sj-intro-art { position: relative; height: min(64vh, 560px); min-height: 320px; border-radius: var(--r-lg);
  background: radial-gradient(60% 50% at 50% 62%, var(--surface-3), transparent 70%); padding: 30px 30px 26px; }

/* ---------- the shelf ---------- */
.sj-shelf-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 14px 0 6px; }
.sj-h { margin: 0; font-size: clamp(28px, 3vw, 40px); font-weight: 900; letter-spacing: -.01em; }
.sj-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 58px 0; padding: 20px 14px 36px; }
.sj-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; padding: 0 16px; border: 0; background: none; color: var(--fg); font: inherit; text-align: center; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sj-card-jar { position: relative; display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 210px; margin-bottom: 30px; }
.sj-card-jar > span { position: relative; display: block; width: 100%; margin-bottom: -6px; transition: transform .35s cubic-bezier(.2,1.4,.4,1); }
.sj-card-jar::after { content: ""; position: absolute; left: -16px; right: -16px; bottom: -16px; height: 16px; z-index: -1;
  background: linear-gradient(180deg, #E8BD84, #C88D4E); box-shadow: 0 6px 0 #9C6A36, 0 18px 24px -14px rgba(40,20,0,.55); }
.sj-card:hover .sj-card-jar > span, .sj-card:focus-visible .sj-card-jar > span { transform: translateY(-7px); }
.sj-card:focus-visible { outline-offset: 6px; border-radius: 20px; }
.sj-card-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; max-width: 100%; font-size: 18px; font-weight: 900; line-height: 1.2; }
.sj-card-n { color: var(--muted); font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sj-card-full { position: absolute; top: -8px; right: 6%; z-index: 3; padding: 3px 10px; border-radius: var(--r-pill); background: var(--gold); color: var(--forest); font-size: 13px; font-weight: 1000; transform: rotate(8deg); box-shadow: 0 3px 0 #C98A12; }
.sj-card-new { color: var(--muted); }
.sj-card-new .sj-card-name { font-size: 16px; }
.sj-ghost { height: 72% !important; display: grid !important; place-items: end center; }
.sj-ghost svg { height: 100%; width: auto; opacity: .55; transition: opacity .2s; }
.sj-card-new:hover .sj-ghost svg { opacity: .9; }
.sj-private { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 8px 0 0; color: var(--muted); font-size: 14px; font-weight: 700; text-align: center; }
.sj-private svg { flex: none; width: 18px; height: 18px; color: var(--link); }

/* ---------- one jar ---------- */
.sj-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 6px 0 14px; }
.sj-bar-r { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.sj-mini-ico svg { width: 22px; height: 23px; display: block; }
.sj-room { display: grid; grid-template-columns: minmax(250px, 320px) minmax(0, 1fr) minmax(250px, 320px); grid-template-rows: auto auto 1fr auto;
  grid-template-areas: "head stage reward" "rules stage reward" "rules stage log" "rules ctrl log"; gap: 18px 30px; min-height: calc(100dvh - 170px); }
.sj-head { grid-area: head; display: flex; flex-direction: column; gap: 6px; }
.sj-goal { font-size: clamp(30px, 3.2vw, 52px); overflow-wrap: anywhere; }
.sj-count { display: flex; align-items: baseline; gap: 6px; margin: 4px 0 0; font-variant-numeric: tabular-nums; }
.sj-count b { display: inline-block; font-size: clamp(46px, 5vw, 86px); font-weight: 1000; line-height: .95; letter-spacing: -.03em; color: var(--accent-text); }
.sj-count span { color: var(--muted); font-size: clamp(20px, 2vw, 30px); font-weight: 900; }
.sj-togo { align-self: flex-start; margin: 0; padding: 4px 12px; border-radius: var(--r-pill); background: var(--surface-2); font-size: 15px; font-weight: 900; }
.sj-togo.is-full { background: var(--gold); color: var(--forest); }
.sj-stage { grid-area: stage; position: relative; min-height: 420px; padding: 18px 10px 10px; border-radius: var(--r-lg); cursor: pointer; outline-offset: 4px;
  background: radial-gradient(52% 42% at 50% 66%, var(--surface-3), transparent 72%); -webkit-tap-highlight-color: transparent; }
.sj-stage.is-full { cursor: default; }
.sj-ctrl { grid-area: ctrl; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; }
.sj-add { display: inline-flex; align-items: center; gap: 14px; padding: 12px 30px 12px 16px; border: 0; border-radius: var(--r-pill); background: var(--fox); color: var(--on-fox);
  box-shadow: 0 6px 0 var(--press), var(--shadow); cursor: pointer; transition: transform .08s; }
.sj-add:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--press), var(--shadow); }
.sj-add:disabled { opacity: .55; cursor: default; transform: none; }
.sj-add-ico { width: 48px; height: 48px; flex: none; transition: transform .3s cubic-bezier(.2,1.5,.4,1); }
.sj-add:not(:disabled):hover .sj-add-ico { transform: rotate(-12deg) scale(1.1); }
.sj-add-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.sj-add-txt b { font-size: 30px; font-weight: 1000; }
.sj-add-txt span { font-size: 14px; font-weight: 900; }
.sj-take svg { width: 18px; height: 18px; }
.sj-rules-card { grid-area: rules; align-self: start; }
.sj-rule-list { display: flex; flex-direction: column; gap: 8px; }
.sj-rule { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px 11px 14px; border: 0; border-radius: 16px; background: var(--surface-2); color: var(--fg); font-size: 15px; font-weight: 800; line-height: 1.3; text-align: left; cursor: pointer;
  transition: transform .2s cubic-bezier(.2,1.4,.4,1), background .15s; }
.sj-rule:hover:not(:disabled) { background: var(--hover); transform: translateY(-2px); }
.sj-rule:active:not(:disabled) { transform: scale(.98); }
.sj-rule:disabled { opacity: .5; cursor: default; }
.sj-rule span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sj-rule b { flex: none; padding: 2px 10px; border-radius: var(--r-pill); background: var(--gold); color: var(--forest); font-size: 15px; font-weight: 1000; font-variant-numeric: tabular-nums; }
.sj-rule kbd { flex: none; color: var(--muted); }
.sj-reward-card { grid-area: reward; align-self: start; gap: 10px; }
.sj-reward { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 700; font-size: clamp(21px, 1.8vw, 28px); line-height: 1.2; overflow-wrap: anywhere; }
.sj-reward.is-empty { font-family: var(--font); font-style: normal; font-size: 16px; color: var(--muted); }
.sj-reward-card.is-full { background: radial-gradient(circle at 100% 0%, rgba(243,181,48,.32), transparent 60%), var(--surface); box-shadow: 0 0 0 3px var(--gold), var(--shadow); }
.sj-log-card { grid-area: log; align-self: end; gap: 10px; }
.sj-log { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.sj-log li { display: flex; align-items: baseline; gap: 10px; font-size: 14px; font-weight: 700; }
.sj-log li b { flex: none; min-width: 34px; color: var(--link); font-weight: 1000; font-variant-numeric: tabular-nums; }
.sj-log li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sj-log li time { flex: none; color: var(--muted); font-size: 12px; font-weight: 800; }
.sj-log li.is-minus b { color: var(--muted); }
.sj-log li.is-none { color: var(--muted); }
.sj-keys { margin-top: 14px; text-align: center; }

/* ---------- presenting: the jar fills the screen ---------- */
body.presenting { padding: 0; overflow: hidden; }
body.presenting :is(.top, .sj-bar, .foot, .sj-log-card, .sj-keys) { display: none !important; }
body.presenting main { max-width: none; padding: clamp(14px, 2vw, 32px); }
body.presenting .sj-room { height: calc(100dvh - 2 * clamp(14px, 2vw, 32px)); min-height: 0; grid-template-rows: auto 1fr auto; grid-template-areas: "head stage reward" "rules stage reward" "rules ctrl reward"; }
body.presenting .sj-goal { font-size: clamp(34px, 3.8vw, 72px); }
.sj-exit { position: fixed; right: max(14px, env(safe-area-inset-right, 0px)); bottom: max(14px, env(safe-area-inset-bottom, 0px)); z-index: 40; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 0; border-radius: var(--r-pill);
  background: var(--surface); color: var(--fg); font-weight: 800; box-shadow: var(--shadow); opacity: .35; cursor: pointer; transition: opacity .2s; }
.sj-exit:hover, .sj-exit:focus-visible { opacity: 1; }
.sj-exit svg { width: 18px; height: 18px; }

/* ---------- the moment it fills ---------- */
.sj-done { position: fixed; inset: 0; z-index: 70; display: grid; place-items: end center; padding: 20px 16px max(28px, env(safe-area-inset-bottom, 0px)); background: linear-gradient(180deg, transparent 30%, var(--scrim)); }
.sj-done:not([hidden]) { animation: fade .35s ease-out both; }
.sj-done-card { display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(620px, 100%); padding: clamp(22px, 4vw, 34px); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-pop); text-align: center; }
.sj-done:not([hidden]) .sj-done-card { animation: doneIn .6s cubic-bezier(.2,1.35,.4,1) .1s both; }
@keyframes fade { from { opacity: 0; } }
@keyframes doneIn { from { opacity: 0; transform: translateY(40px) scale(.94); } }
.sj-done-title { font-size: clamp(36px, 5vw, 64px); }
.sj-done-lead { margin: 0; color: var(--muted); font-size: 18px; font-weight: 800; }
.sj-done-reward { margin: 4px 0; padding: 14px 22px; border-radius: 20px; background: var(--surface-2); font-family: var(--serif); font-style: italic; font-weight: 700; font-size: clamp(22px, 2.6vw, 32px); line-height: 1.2; overflow-wrap: anywhere; }
.sj-done-go { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* ---------- narrower screens ---------- */
@media (max-width: 1060px) {
  .sj-room { grid-template-columns: minmax(0, 1fr) minmax(250px, 320px); grid-template-rows: auto auto auto 1fr; grid-template-areas: "head head" "stage reward" "stage rules" "ctrl log"; }
  body.presenting .sj-room { grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); grid-template-areas: "head head" "stage reward" "stage rules" "ctrl rules"; grid-template-rows: auto auto 1fr auto; }
}
@media (max-width: 760px) {
  .sj-intro { grid-template-columns: 1fr; min-height: 0; }
  .sj-intro-art { order: -1; height: 46vh; min-height: 260px; }
  .sj-shelf { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 50px 0; }
  .sj-card-jar { height: 170px; }
  .sj-room { grid-template-columns: 1fr; grid-template-areas: "head" "stage" "ctrl" "rules" "reward" "log"; grid-template-rows: none; min-height: 0; }
  .sj-stage { height: auto; aspect-ratio: var(--ar, .8); max-height: 62vh; min-height: 0; padding: 12px 6px 6px; }
  .sj-count b { font-size: 52px; }
  .sj-rule kbd, .sj-keys { display: none; }
  .sj-bar-r .sw span:last-child { display: none; }
  #boardBtn span:last-child { display: none; }
  body.presenting .sj-room { height: auto; grid-template-columns: 1fr; grid-template-areas: "head" "stage" "ctrl" "rules" "reward"; }
  body.presenting { overflow: auto; }
}
