/* ==========================================================================
   Susidėk rinkinį (page-rinkinys.php, assets/rinkinys.js)

   3.31.0 (owner, 2026-11-05: "kaip darėm su dėžute… iš kraštų pašviesintas
   ir per daug info neturintis"). Two panels, as in Kaching's bundle builder:
   the stage, with the real Sushi Lounge box standing open in the middle and
   halftone light rising at its sides; and beside it the size, the rolls under
   two tabs and one button that carries the price. On a phone the box comes
   first, the list under it, and the button stays at the foot of the window.
   Loaded on this page only, after the theme's stylesheet.
   ========================================================================== */
.rk { padding-bottom: var(--s-8); }
.rk--closed { padding-block: var(--s-8) var(--s-9); }
.rk__t {
  margin: 0; padding: 6px 0 20px; font: 700 clamp(2rem, 1.4rem + 2vw, 3rem)/1 var(--font-display);
  letter-spacing: -0.035em; color: var(--ink); text-wrap: balance;
}
.rk__lead { margin: 0 0 var(--s-5); font: 400 1rem/1.45 var(--font-body); color: var(--ink-dim); max-width: 56ch; }

/* --- the two panels ------------------------------------------------------------ */
.rk-panel {
  --stage-h: clamp(480px, calc(100svh - 230px), 780px);
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(340px, 30vw, 420px); gap: 14px;
  height: var(--stage-h);
}

/* --- the stage: the box in the middle, light at the sides ---------------------- */
.rk-stage {
  position: relative; isolation: isolate; overflow: hidden; min-width: 0;
  display: grid; place-items: center; padding: 22px;
  border-radius: 28px; box-shadow: inset 0 0 0 1px var(--line);
  background:
    radial-gradient(42% 60% at 0% 100%, rgba(245,243,240,0.08), transparent 72%),
    radial-gradient(42% 60% at 100% 100%, rgba(245,243,240,0.08), transparent 72%),
    #0C0C0C;
}
/* halftone light, a dot every 3 px (assets/rinkinys/edge.png, drawn by dev/rinkinys-box.py) */
.rk-stage::before, .rk-stage::after {
  content: ""; position: absolute; top: 0; bottom: 0; z-index: -1; width: 34%; max-width: 360px; pointer-events: none;
  background: url("rinkinys/edge.png") 0 100% / 360px 1200px no-repeat; image-rendering: pixelated; opacity: 0.22;
  /* a narrow stage cuts the texture short: fade its inner side out whatever the width */
  -webkit-mask-image: linear-gradient(90deg, #000 35%, transparent); mask-image: linear-gradient(90deg, #000 35%, transparent);
}
.rk-stage::before { left: 0; }
.rk-stage::after { right: 0; transform: scaleX(-1); }

/* the picture, whole here; on a phone its top is cut off (--keep) */
.rk-boxclip {
  --keep: 1;
  position: relative; aspect-ratio: calc(var(--ratio) / var(--keep));
  width: min(100%, calc((var(--stage-h) - 44px) * var(--ratio) / var(--keep)));
}
.rk-box { position: absolute; left: 0; right: 0; bottom: 0; aspect-ratio: var(--ratio); }
/* the pool of light the box stands in */
.rk-box::before {
  content: ""; position: absolute; inset: 8% -16% -6%; z-index: -1; pointer-events: none;
  background: radial-gradient(48% 46% at 50% 60%, rgba(245,243,240,0.1), rgba(245,243,240,0.025) 55%, transparent 72%);
}
.rk-box__pic {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; pointer-events: none; user-select: none; -webkit-user-drag: none;
  /* the shadow is cut at the picture's sides: let it fade there */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 93%, transparent);
}
.rk-box.is-nudge { animation: rk-nudge 0.42s var(--ease-out); }
@keyframes rk-nudge { 30% { transform: translateX(-7px); } 60% { transform: translateX(5px); } }

/* the places of the insert, laid over the picture (quads in box.json) */
.rk-cells { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
.rk-cell { position: absolute; }
.rk-cell:not(.rk-cell--free) .rk-cell__shape { display: none; }
.rk-cell__shape { position: absolute; inset: 0; z-index: var(--z); width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.rk-cell__shape polygon {
  fill: rgba(245,243,240,0); stroke: rgba(245,243,240,0.18); stroke-width: 1.5; stroke-dasharray: 5 6;
  vector-effect: non-scaling-stroke; transition: fill var(--t-fast) var(--ease-out), stroke var(--t-fast) var(--ease-out);
}
.rk-cell--free:hover .rk-cell__shape polygon, .rk-cell__free:focus-visible + .rk-cell__shape polygon { fill: rgba(245,243,240,0.05); stroke: rgba(245,243,240,0.5); }
.rk-cell--next .rk-cell__shape polygon { stroke: rgba(245,243,240,0.6); fill: rgba(245,243,240,0.04); }
.rk-cell--next .rk-cell__shape { animation: rk-breathe 2.4s ease-in-out infinite; }
@keyframes rk-breathe { 50% { opacity: 0.45; } }
.rk-cell__free {
  position: absolute; inset: 0; z-index: var(--z); display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 6px; background: none; color: var(--ink-faint); cursor: pointer;
}
.rk-cell__free:hover, .rk-cell--next .rk-cell__free { color: var(--ink); }
.rk-cell__plus { width: 30px; height: 30px; border-radius: 50%; position: relative; box-shadow: inset 0 0 0 1.5px currentColor; }
.rk-cell__plus::before, .rk-cell__plus::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 1.5px; margin: -0.75px 0 0 -6px; background: currentColor;
}
.rk-cell__plus::after { rotate: 90deg; }
/* the roll stands on the floor of its place: its middle on the place's middle.
   A 3:2 frame with the photo fitted to its foot: the hot rolls are cut out
   nearly square, and sized by width alone they stood twice a place's height,
   over the place behind and out of the box */
.rk-cell__img {
  position: absolute; left: var(--mx); top: var(--my); width: var(--sw); max-width: none; height: auto;
  aspect-ratio: 3 / 2; object-fit: contain; object-position: 50% 100%;
  z-index: var(--z); transform: translate(-50%, -56%); pointer-events: none;
  filter: drop-shadow(0 9px 8px rgba(0,0,0,0.75)) drop-shadow(0 2px 2px rgba(0,0,0,0.6));
}
.rk-cell__flat { position: absolute; inset: 0; z-index: var(--z); width: 100%; height: 100%; max-width: none; object-fit: cover; pointer-events: none; }
.rk-cell__name {
  position: absolute; left: 50%; bottom: 14%; z-index: 101; transform: translateX(-50%); max-width: 92%;
  padding: 4px 9px; border-radius: var(--r-pill); background: rgba(10,10,10,0.84);
  font: 600 0.75rem/1.2 var(--font-display); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.rk-cell__x {
  position: absolute; top: 2%; right: 2%; z-index: 102; width: 30px; height: 30px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 50%; background: rgba(10,10,10,0.84); color: var(--ink); cursor: pointer;
  transition: background var(--t-fast) var(--ease-out);
}
.rk-cell__x:hover { background: var(--accent); color: var(--accent-ink); }
.rk-cell.is-new .rk-cell__img { animation: rk-land 0.6s var(--ease-out); }
/* the row a click on an empty place leads to (toList() in rinkinys.js) */
.rk-roll.is-flash { animation: rk-flash 0.9s var(--ease-out); }
@keyframes rk-flash { 0%, 35% { background: var(--raise-2); box-shadow: inset 0 0 0 1px var(--line-strong); } }
@keyframes rk-land {
  0% { transform: translate(-50%, -56%) translateY(-18px) scale(1.12); opacity: 0; }
  55% { transform: translate(-50%, -56%) scale(0.97); opacity: 1; }
  100% { transform: translate(-50%, -56%); }
}
.rk-ghost {
  position: fixed; z-index: 90; max-width: none; pointer-events: none; transform-origin: 50% 50%;
  filter: drop-shadow(0 22px 22px rgba(0,0,0,0.6));
}

/* --- beside the box: the size, the rolls and the button ------------------------- */
.rk-side {
  min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 28px; background: var(--raise); box-shadow: inset 0 0 0 1px var(--line);
}

.rk-size { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px 14px 0; }
.rk-size__b {
  display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 54px; padding: 0 12px;
  border: 0; border-radius: 16px; background: var(--ground); color: var(--ink-dim); cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--line);
  font: 700 1.0625rem/1 var(--font-display); letter-spacing: -0.01em;
  transition: box-shadow var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
.rk-size__b:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.rk-size__b[aria-checked="true"] { color: var(--ink); background: var(--raise-2); box-shadow: inset 0 0 0 2px var(--ink); }
.rk-size__b[aria-disabled="true"] { opacity: 0.45; }
/* the places, drawn small: two by two, or three by two */
.rk-size__g { display: grid; grid-template-columns: repeat(2, 8px); gap: 2px; }
.rk-size__g--6 { grid-template-columns: repeat(3, 8px); }
.rk-size__g i { height: 7px; border-radius: 2px; background: currentColor; opacity: 0.55; }
.rk-size__b[aria-checked="true"] .rk-size__g i { opacity: 1; }

.rk-tabs {
  flex: none; display: flex; gap: 4px; margin: 12px 14px 0; padding: 4px;
  border-radius: var(--r-pill); background: var(--ground); box-shadow: inset 0 0 0 1px var(--line);
}
.rk-tab {
  flex: 1; min-height: 40px; padding: 0 12px; border: 0; border-radius: var(--r-pill);
  background: none; color: var(--ink-dim); cursor: pointer; white-space: nowrap;
  font: 600 0.875rem/1 var(--font-display);
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.rk-tab:hover { color: var(--ink); }
.rk-tab[aria-selected="true"] { background: var(--ink); color: var(--ground); }

.rk-pane { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.rk-list { list-style: none; margin: 0; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.rk-roll {
  display: grid; grid-template-columns: 68px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  min-height: 64px; padding: 6px 8px 6px 6px; border-radius: 16px;
  background: var(--ground); box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
.rk-roll[hidden] { display: none; }
.rk-roll.is-in { background: var(--raise-2); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.rk-roll__img {
  position: relative; width: 68px; height: 52px; border-radius: 12px;
  background: radial-gradient(70% 70% at 50% 55%, #222, #121212);
}
.rk-roll__img img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(0,0,0,0.6)); }
.rk-roll__img--photo { overflow: hidden; }
.rk-roll__img--photo img { object-fit: cover; filter: none; }
.rk-roll__t { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.rk-roll__name {
  min-width: 0; font: 600 0.9375rem/1.2 var(--font-display); color: var(--ink); letter-spacing: -0.01em;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; text-wrap: balance;
}
.rk-roll__p { font: 500 0.8125rem/1 var(--font-mono); color: var(--ink-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rk-roll__act { display: flex; justify-content: flex-end; }

.rk-add, .rk-step__b {
  width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0;
  border-radius: 50%; background: none; color: var(--ink); cursor: pointer;
  transition: background var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out), opacity var(--t-fast) var(--ease-out);
}
.rk-add { box-shadow: inset 0 0 0 1px var(--line-strong); }
.rk-add:hover { background: var(--ink); color: var(--ground); box-shadow: none; }
.rk-add[aria-disabled="true"], .rk-step__b[aria-disabled="true"] { opacity: 0.3; }
.rk-add[aria-disabled="true"]:hover { background: none; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.rk-add:active, .rk-step__b:active { transform: scale(0.92); }
.rk-add svg, .rk-step__b svg, .rk-cell__x svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.rk-cell__x svg { width: 14px; height: 14px; }
.rk-step { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--ground); box-shadow: inset 0 0 0 1px var(--line); }
.rk-step__b { width: 34px; height: 34px; }
.rk-step__b:hover { background: var(--raise-2); }
.rk-step__n { min-width: 18px; text-align: center; font: 600 0.875rem/1 var(--font-mono); font-variant-numeric: tabular-nums; }

/* the button carries the price; it lights up once the box is full */
.rk-pay { flex: none; padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.rk-hint { margin: 0 2px 10px; font: 400 0.9375rem/1.4 var(--font-body); color: var(--ink-dim); }
.rk-hint[hidden] { display: none; }
.rk-hint__b {
  padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer;
  font: 600 0.9375rem/1.4 var(--font-display); text-decoration: underline; text-underline-offset: 3px;
}
.rk-cta {
  width: 100%; min-height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 22px;
  border: 0; border-radius: 18px; background: var(--raise-2); color: var(--ink-dim); cursor: default;
  font: 600 0.8125rem/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.rk-cta.is-ready { background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.rk-cta.is-ready:hover { background: var(--accent-lift); transform: translateY(-1px); }
.rk-cta.is-added { transform: scale(0.98); }
.rk-cta__t { flex: 1; text-align: left; white-space: nowrap; }
.rk-cta__p { font: 700 1.125rem/1 var(--font-display); letter-spacing: -0.01em; text-transform: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rk-cta__dots { display: none; }

@media (max-width: 1179px) {
  .rk-roll { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; }
  .rk-roll__img { width: 56px; height: 46px; }
}

/* --- phone: the box first, the list under it, the button at the foot ------------ */
@media (max-width: 999px) {
  .rk__t { padding: 2px 0 14px; }
  .rk-panel { display: block; height: auto; }
  .rk-stage { margin-inline: calc(var(--gutter) * -1); padding: 6px var(--gutter) 0; border-radius: 0; box-shadow: none; }
  .rk-stage::before, .rk-stage::after { width: 32%; opacity: 0.18; }
  /* the top of the standing lid goes, so the tray is large; the cut fades into the stage */
  .rk-boxclip {
    --keep: 0.64; width: min(100%, 520px); overflow: hidden;
    -webkit-mask-image: linear-gradient(transparent, #000 16%); mask-image: linear-gradient(transparent, #000 16%);
  }
  .rk-boxclip[data-size="XL"] { --keep: 0.62; }

  .rk-side { margin-top: 14px; overflow: visible; border-radius: 22px; }
  .rk-size { padding: 12px 12px 0; }
  .rk-tabs { position: sticky; top: 64px; z-index: 5; margin: 10px 12px 0; box-shadow: inset 0 0 0 1px var(--line), 0 10px 24px rgba(0,0,0,0.5); }
  .rk-pane { overflow: visible; }
  .rk-list { padding: 10px 12px 14px; }
  .rk-roll { min-height: 60px; }

  /* the button stays in reach, the places it still needs drawn on it */
  .rk.is-live .rk-pay {
    position: fixed; z-index: 75; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    padding: 6px; border: 0; border-radius: 22px;
    background: color-mix(in srgb, var(--raise-2) 94%, transparent);
    box-shadow: inset 0 0 0 1px var(--line-strong), 0 18px 44px rgba(0,0,0,0.55);
  }
  .rk.is-live .rk-hint { margin: 6px 10px 8px; font-size: 0.875rem; }
  .rk.is-live .rk-cta { min-height: 54px; padding: 0 18px; border-radius: 17px; }
  .rk-cta__dots { display: inline-flex; gap: 4px; flex: none; }
  .rk-cta__dots i { width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px currentColor; opacity: 0.7; }
  .rk-cta__dots i.on { background: currentColor; opacity: 1; }
  .rk-pay.is-bump { animation: rk-bump 320ms var(--ease-out); }
  @keyframes rk-bump { 40% { transform: translateY(-4px) scale(1.015); } }
  .rk.is-live { padding-bottom: 104px; }
  /* over the bar, however tall a hint makes it: --rk-pay-h from rinkinys.js */
  body:has(.rk.is-live) .cartpill { bottom: calc(20px + var(--rk-pay-h, 66px) + env(safe-area-inset-bottom, 0px)); }
  /* and the bar does not stand over the open menu */
  html.has-sheet .rk.is-live .rk-pay { visibility: hidden; }
}
/* on a wide screen the cart pill keeps off the box: at the end of the title's row */
@media (min-width: 1000px) {
  body:has(.rk.is-live) .cartpill {
    position: absolute; top: var(--rk-pill-y, 177px); bottom: auto; left: auto; translate: 0 -50%;
    right: max(var(--gutter), calc((100% - 1280px) / 2 + var(--gutter)));
  }
}
@media (min-width: 861px) and (max-width: 999px) { .rk-tabs { top: 76px; } }
@media (max-width: 560px) {
  .rk-cell__name { font-size: 0.625rem; padding: 3px 6px; }
  .rk-cell__x { width: 26px; height: 26px; top: 0; right: 0; }
  .rk-cells--6 .rk-cell__name { display: none; }
  .rk-cell__plus { width: 26px; height: 26px; }
  .rk-roll__name { font-size: 0.875rem; }
}

.rk-add:focus-visible, .rk-step__b:focus-visible, .rk-cell__x:focus-visible, .rk-cta:focus-visible,
.rk-size__b:focus-visible, .rk-hint__b:focus-visible, .rk-tab:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 2px;
}
.rk-cell__free:focus-visible { outline: 2px solid var(--ink); outline-offset: -4px; }

@media (prefers-reduced-motion: reduce) {
  .rk-add, .rk-step__b, .rk-tab, .rk-size__b, .rk-roll, .rk-cta, .rk-cell__x, .rk-cell__shape polygon { transition: none !important; }
  .rk-cell.is-new .rk-cell__img, .rk-pay.is-bump, .rk-box.is-nudge, .rk-cell--next .rk-cell__shape, .rk-roll.is-flash { animation: none; }
}
