/* Sour Year v2: the night sugar desert of the owner's avatar and banner. One stylesheet for every page.
   Layout system: one container (--wrap), one left edge, spacing 8/16/24/32/48/64/96, one section head
   (H2 + one line), one card (violet glass, r20), one primary button (lime pill), one secondary (glass outline). */

@font-face { font-family: "Onest"; src: url("../fonts/onest-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Onest"; src: url("../fonts/onest-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Onest"; src: url("../fonts/onest-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Onest"; src: url("../fonts/onest-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --sky-0: #140c46; --sky-1: #2e1a7a; --sky-2: #4a2a9e;
  --dune: #5a3bc4; --lime: #d4ff3a; --lime-2: #c8ff2e;
  --lilac: #c89bff; --pink: #f0a0e8; --edge: #2a1466;
  --text: #ede6ff; --text-2: #c9bdf2; --text-3: #a798dc;
  --glass: rgba(30, 18, 90, .6); --line: rgba(200, 155, 255, .38);
  --wrap: 1320px; --gut: 16px;
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 64px; --s7: 96px;
  --sans: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
@media (min-width: 700px) { :root { --gut: 32px; } }
@media (min-width: 1700px) { :root { --wrap: 1560px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--sky-0); }
body {
  margin: 0; min-height: 100svh; color: var(--text);
  font: 400 18px/1.55 var(--sans); font-variant-numeric: tabular-nums; font-feature-settings: "liga" 0, "calt" 0;
  background: linear-gradient(180deg, var(--sky-0) 0, var(--sky-1) 70vh, #22125f 100%) var(--sky-0);
}
img, canvas { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; border-radius: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gut)); margin: 0 auto; padding: 0 var(--gut); }
.mono { font-family: var(--mono); font-weight: 500; }
b, strong { font-weight: 700; color: #fff; }

/* sugar numbers (CSS, live) and page titles (generated PNG wordmarks) */
.sugar { font-weight: 800; color: #fff; -webkit-text-stroke: 6px var(--edge); paint-order: stroke fill; text-shadow: 0 0 18px rgba(212, 255, 58, .45); letter-spacing: -.01em; }
.wm { display: block; height: auto; filter: drop-shadow(0 0 14px rgba(212, 255, 58, .5)); }

/* ---------- header: one dark glass pill on every page ---------- */
.bar { position: relative; z-index: 20; padding-top: 16px; }
.pill {
  display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 8px 10px 8px 14px;
  background: rgba(20, 12, 70, .78); border: 1px solid var(--line); border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 10px 30px rgba(10, 4, 40, .35);
}
.sign { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.sign img { width: 40px; height: 40px; border-radius: 10px; }
.sign span { font: 800 19px/1 var(--sans); letter-spacing: -.01em; }
.nav { display: flex; gap: 4px; margin: 0 0 0 8px; padding: 0; list-style: none; flex: 1; min-width: 0; }
.nav a { display: flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; text-decoration: none; font: 600 17px/1 var(--sans); color: var(--text-2); }
.nav a:hover { color: #fff; background: rgba(200, 155, 255, .12); }
.nav a[aria-current="page"] { color: var(--edge); background: var(--lime); }
.tools { display: flex; align-items: center; gap: 8px; flex: none; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  font: 600 16px/1 var(--sans); color: var(--text); text-decoration: none; background: transparent; border: 1px solid var(--line);
}
.chip:hover { background: rgba(200, 155, 255, .12); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.chip[aria-pressed="true"] { background: rgba(212, 255, 58, .16); border-color: var(--lime); }
.rh-line { margin: 10px 0 0; padding: 0 8px; font: 400 16px/1.45 var(--sans); color: var(--text-2); }
@media (max-width: 960px) {
  .pill { flex-wrap: wrap; border-radius: 28px; padding: 10px 12px; row-gap: 6px; }
  .nav { order: 3; flex-basis: 100%; margin: 0; justify-content: space-between; }
  .nav a { padding: 0 12px; font-size: 16px; }
  .tools { margin-left: auto; }
}
@media (max-width: 420px) { .nav a { padding: 0 9px; } .chip { padding: 0 12px; } .sign span { font-size: 17px; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px;
  border-radius: 999px; cursor: pointer; text-decoration: none; font: 700 18px/1 var(--sans); color: var(--text);
  background: rgba(46, 26, 122, .35); border: 1.5px solid var(--lilac); transition: transform .08s ease-out, background .15s;
}
.btn:hover { background: rgba(200, 155, 255, .16); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.go { color: #1c0e4f; border-color: transparent; background: radial-gradient(120% 140% at 30% 10%, #f4ffb0 0, var(--lime) 38%, #a8d81c 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .6), inset 0 -3px 0 rgba(70, 90, 0, .35), 0 0 22px rgba(212, 255, 58, .35); }
.btn.go:hover { filter: brightness(1.05); }
.btn[disabled], .btn[aria-disabled="true"] { cursor: not-allowed; color: var(--text-3); border-color: rgba(200, 155, 255, .25); background: rgba(46, 26, 122, .25); box-shadow: none; filter: none; transform: none; }
.btn.sm { min-height: 44px; padding: 0 18px; font-size: 16px; }

/* ---------- glass card ---------- */
.card {
  position: relative; border-radius: 20px; padding: 20px 24px; color: var(--text);
  background: linear-gradient(135deg, rgba(255, 255, 255, .08) 0, rgba(255, 255, 255, 0) 38%), var(--glass);
  border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 12px 40px rgba(8, 3, 34, .35);
}
.card .k { margin: 0 0 8px; font: 700 16px/1.3 var(--sans); color: var(--text-2); }

/* ---------- the scene: sky + dunes picture, moon, hourglass, one particle canvas ---------- */
.scene { position: relative; overflow: hidden; isolation: isolate; }
.scene .bg { position: absolute; inset: 0; z-index: -3; background: var(--sky-1) url("../img/sky-wide.webp") center bottom / cover no-repeat; }
.scene .front { position: absolute; left: 0; right: 0; bottom: 0; height: var(--hz, 30%); z-index: -1; pointer-events: none; background: url("../img/sky-wide.webp") center bottom / cover no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 26%); mask-image: linear-gradient(to bottom, transparent 0, #000 26%); }
.scene .fxc { position: absolute; inset: 0; z-index: 3; pointer-events: none; width: 100%; height: 100%; }
.moon { position: absolute; z-index: -2; width: var(--mw, 220px); left: var(--mx, 45%); bottom: var(--my, 30%); transform: translate(-50%, var(--mt, 0px)); transition: transform 1.2s cubic-bezier(.2, .7, .2, 1); }
.moon .halo { position: absolute; inset: -70%; border-radius: 50%; background: radial-gradient(closest-side, rgba(212, 255, 58, .5), rgba(212, 255, 58, .16) 55%, rgba(212, 255, 58, 0) 100%); opacity: var(--glow, .6); transition: opacity 1.2s; }
.moon img { position: relative; width: 100%; animation: moonpulse 5s ease-in-out infinite; }
@keyframes moonpulse { 50% { transform: scale(1.025); } }
.moon.flash img { animation: moonflash .8s ease-out 1; }
@keyframes moonflash { 0% { filter: brightness(1); } 25% { filter: brightness(1.8); } 100% { filter: brightness(1); } }
.hg { position: absolute; z-index: 2; width: var(--hw, 200px); right: var(--hx, 8%); bottom: var(--hy, 14%); transform-origin: 50% 55%; }
.hg img { width: 100%; filter: drop-shadow(0 0 24px rgba(212, 255, 58, .35)); }
.hg.turning { animation: turn 1s cubic-bezier(.3, 0, .2, 1) 1 both; }
@keyframes turn { 0% { transform: rotate(0); } 10% { transform: rotate(-5deg) scale(1.02); } 16% { transform: rotate(4deg); } 22% { transform: rotate(-2deg); } 100% { transform: rotate(180deg); } }

/* ---------- Pot: the first screen ---------- */
.pot { min-height: 100svh; display: flex; flex-direction: column; --hz: 34%; }
.pot .stage { flex: 1; position: relative; min-height: 600px; }
.lede { position: relative; z-index: 4; max-width: 560px; padding-top: 22px; }
.lede .wm { width: min(500px, 100%); margin-left: -10px; }
.head { margin: 8px 0 0; font: 800 34px/1.15 var(--sans); color: #fff; letter-spacing: -.01em; }
.head em { display: block; font-style: normal; color: var(--lime); text-shadow: 0 0 16px rgba(212, 255, 58, .35); }
.copy { margin: 12px 0 0; font-size: 18px; color: var(--text-2); max-width: 31em; }
.acts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.ca { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; padding: 8px; border-radius: 28px; background: rgba(20, 12, 70, .72); border: 1px solid var(--line); width: fit-content; max-width: 100%; }
.ca .addr { min-width: 0; padding: 0 12px; font: 500 16px/1.2 var(--mono); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: all; max-width: 30ch; }
.ca .addr.empty { font: 600 16px/1.2 var(--sans); color: var(--text-2); user-select: none; white-space: normal; }
.lk { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 14px; border-radius: 999px; text-decoration: none; font: 700 16px/1 var(--sans); color: #fff; background: #241463; border: 1px solid rgba(200, 155, 255, .5); }
.lk img { width: 18px; height: 18px; object-fit: contain; }
.lk:hover { background: #321c86; }
.lk[aria-disabled="true"] { cursor: not-allowed; color: var(--text-2); background: #1d1150; }
.lk[aria-disabled="true"] img { opacity: .7; }
.lk .lock { font-size: 16px; }
.links { display: flex; flex-wrap: wrap; gap: 6px; }

.potnum { position: absolute; z-index: 4; transform: translate(-50%, 0); text-align: center; pointer-events: none; white-space: nowrap; transition: bottom 1.2s cubic-bezier(.2, .7, .2, 1); }
.potnum .n { display: block; font-size: 60px; line-height: 1; }
.potnum .of { display: block; margin-top: 4px; font: 700 18px/1.2 var(--sans); color: var(--text); text-shadow: 0 2px 8px rgba(10, 4, 40, .9); }
.potnum .rp { display: block; margin-top: 6px; font: 600 16px/1.2 var(--sans); color: var(--lime); text-shadow: 0 2px 8px rgba(10, 4, 40, .9); }
.potnum .rp:empty { display: none; }

.nx { position: absolute; z-index: 5; width: 300px; }
.nx .who { display: flex; align-items: center; gap: 6px; }
.nx .who .mono { font-size: 17px; }
.nx .loss { display: block; margin-top: 6px; font: 800 28px/1.1 var(--sans); color: #fff; }
.nx p { margin: 6px 0 0; font: 600 16px/1.4 var(--sans); color: var(--text-2); }
.nx .empty { margin: 0; font: 600 16px/1.45 var(--sans); color: var(--text); }
.nx .paid { margin: 10px 0 0; padding: 8px 12px; border-radius: 12px; font: 700 16px/1.3 var(--sans); color: #1c0e4f; background: var(--lime); }
.nx .paid.carry { color: var(--text); background: rgba(200, 155, 255, .2); }
.nx .paid[hidden] { display: none; }

.player { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.player .lab { font: 600 16px/1.3 var(--sans); color: var(--text-2); }
.pot .player { position: absolute; z-index: 5; }

/* ---------- inner page heads: their own scene, at most 480 px ---------- */
.phead { --hz: 40%; }
.phead .stage { position: relative; height: clamp(380px, 50vh, 480px); }
.phead .stage-wrap { position: relative; z-index: 4; max-width: 640px; }
.phead .wm { width: auto; height: clamp(60px, 7vw, 96px); margin: 18px 0 0 -8px; }
.phead .sub { margin: 10px 0 0; max-width: 34em; color: var(--text-2); }
.figs { display: flex; flex-wrap: wrap; gap: 10px 36px; margin-top: 14px; }
.fig b { display: block; font: 800 30px/1.1 var(--sans); color: #fff; }
.fig span { font: 600 16px/1.3 var(--sans); color: var(--text-2); }
.phead .player { margin-top: 14px; }
.phead .obj { position: absolute; z-index: 2; right: 7%; bottom: 10%; }

/* ---------- sections below ---------- */
.below { padding: var(--s6) 0 var(--s7); }
.sec + .sec { margin-top: var(--s7); }
.sec-h { margin: 0 0 var(--s3); }
.sec-h h2 { margin: 0; font: 800 36px/1.1 var(--sans); color: #fff; letter-spacing: -.01em; text-shadow: 0 0 18px rgba(212, 255, 58, .22); }
.sec-h p { margin: 6px 0 0; font-size: 17px; color: var(--text-2); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.steps .card { display: flex; flex-direction: column; gap: 10px; }
.steps .card img { height: 96px; width: auto; align-self: flex-start; object-fit: contain; }
.steps h3 { margin: 0; font: 800 21px/1.25 var(--sans); color: #fff; }
.steps p { margin: 0; color: var(--text-2); font-size: 17px; }

/* tables: rows 52-56 px, numbers right, sticky head */
.tbl-box { border-radius: 20px; overflow: clip; background: var(--glass); border: 1px solid var(--line); }
.tbl { width: 100%; border-collapse: collapse; font-size: 17px; }
.tbl th { position: sticky; top: 0; z-index: 1; text-align: left; font: 600 16px/1.2 var(--sans); color: var(--text-2); background: #22115e; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.tbl td { height: 54px; padding: 0 16px; border-bottom: 1px solid rgba(200, 155, 255, .14); white-space: nowrap; }
.tbl .r { text-align: right; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover, .tbl tbody tr.hot { background: rgba(212, 255, 58, .12); }
.tbl tr.flash { animation: rowflash 1.2s ease-out 1; }
@keyframes rowflash { from { background: rgba(212, 255, 58, .45); } to { background: transparent; } }
.tbl .addr { font: 500 16px/1 var(--mono); color: var(--text); }
.tbl .ic { display: inline-flex; align-items: center; gap: 4px; }
.tag { display: inline-block; padding: 5px 12px; border-radius: 999px; font: 600 16px/1.1 var(--sans); border: 1px solid var(--line); }
.tag.dead { color: #1c0e4f; background: var(--lime); border-color: var(--lime); }
.tag.alive { color: var(--text); background: rgba(200, 155, 255, .18); }
.tag.ex { color: var(--text-2); }
.dash { cursor: help; border-bottom: 1px dotted var(--text-3); }
.tbl-note { margin: 0 0 12px; font: 600 16px/1.4 var(--sans); color: var(--text-2); }
.more { display: flex; justify-content: center; padding: 16px; }
.copy-ic { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; cursor: pointer; background: none; border: 0; border-radius: 8px; color: var(--text-2); font: 700 16px/1 var(--sans); }
.copy-ic:hover { background: rgba(200, 155, 255, .16); color: #fff; }

/* the contract line at the end of every page */
.ca-line { padding: var(--s3) 0 var(--s4); border-top: 1px solid rgba(200, 155, 255, .18); }
.ca-line .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; font: 600 16px/1.4 var(--sans); color: var(--text-2); }
.ca-line .mono { color: var(--text); overflow-wrap: anywhere; }

/* toast, flyers, skeleton */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 160%); padding: 14px 22px; border-radius: 999px; font: 700 16px/1.3 var(--sans); color: #1c0e4f; background: var(--lime); box-shadow: 0 10px 30px rgba(8, 3, 34, .5); transition: transform .22s ease-out; pointer-events: none; }
.toast.on { transform: translate(-50%, 0); }
.flyer { position: fixed; z-index: 50; width: 7px; height: 7px; border-radius: 2px; background: var(--lime); box-shadow: 0 0 8px var(--lime); pointer-events: none; }
.skel { display: inline-block; min-width: 4em; height: .9em; border-radius: 8px; background: linear-gradient(90deg, rgba(200, 155, 255, .12), rgba(200, 155, 255, .3), rgba(200, 155, 255, .12)); background-size: 200% 100%; animation: skel 1.2s linear infinite; vertical-align: middle; }
@keyframes skel { to { background-position: -200% 0; } }

/* forms and calculators */
.field { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.field input { flex: 1 1 280px; min-width: 0; min-height: 52px; padding: 0 20px; border-radius: 999px; font: 500 16px/1 var(--mono); color: var(--text); background: rgba(20, 12, 70, .75); border: 1.5px solid var(--line); }
.field input::placeholder { font-family: var(--sans); color: var(--text-3); }
.hint { margin: 10px 0 0; font: 600 16px/1.4 var(--sans); color: var(--text-2); }
.err { margin: 10px 0 0; font: 700 16px/1.4 var(--sans); color: #ffd08a; }
.formula { margin: 14px 0 0; padding: 12px 16px; border-radius: 14px; font: 600 16px/1.5 var(--sans); color: var(--text); background: rgba(20, 12, 70, .55); border: 1px dashed var(--line); }

@media (max-width: 899px) {
  .pot { min-height: 0; }
  .pot .stage { min-height: 0; }
  .lede { padding-top: 8px; max-width: none; }
  .lede .wm { width: min(340px, 100%); }
  .head { font-size: 27px; }
  .nx { position: static; width: auto; margin-top: 20px; }
  .pot .player { position: static; margin-top: 12px; }
  .phead .stage { height: auto; }
  .phead .obj { position: relative; right: auto; bottom: auto; margin: 16px auto 0; }
  .steps { grid-template-columns: 1fr; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { padding: 12px 18px; border-bottom: 1px solid rgba(200, 155, 255, .18); }
  .tbl td { height: auto; padding: 4px 0; border: 0; white-space: normal; display: flex; justify-content: space-between; gap: 16px; }
  .tbl td::before { content: attr(data-k); font: 600 16px/1.4 var(--sans); color: var(--text-2); }
}
@media (max-width: 699px) { .sec-h h2 { font-size: 28px; } .below { padding: var(--s5) 0 var(--s6); } .sec + .sec { margin-top: var(--s6); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Wrap ---------- */
.wrapobj { position: relative; width: clamp(260px, 30vw, 460px); }
.wrapobj img { width: 100%; filter: drop-shadow(0 0 24px rgba(212, 255, 58, .3)); }
.wrapobj .wrapped { animation: bob 6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-1.5deg); } }
.wrapobj.reading .wrapped { animation: twist .5s steps(2) infinite; }
@keyframes twist { 50% { transform: scaleX(-1); } }
.wrapobj.open .opened { animation: unfold .5s cubic-bezier(.2, .8, .2, 1) 1 both; }
@keyframes unfold { from { transform: scaleX(.35) scaleY(.7); opacity: .2; } to { transform: none; opacity: 1; } }
.yearcard { position: relative; padding: 28px; border-radius: 28px; background: url("../img/wrapper.webp") center / 100% 100% no-repeat, linear-gradient(135deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, 0) 40%), var(--glass); border: 1px solid var(--line); }
.yc-figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.yc-figs .card { display: flex; flex-direction: column; gap: 6px; background: rgba(20, 12, 70, .78); }
.yc-figs .big { font-size: 40px; line-height: 1.05; -webkit-text-stroke-width: 5px; }
.yc-figs span { font: 600 16px/1.4 var(--sans); color: var(--text-2); }
.acts .hint { margin: 0; align-self: center; }
@media (max-width: 999px) { .yc-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 459px) { .yc-figs { grid-template-columns: 1fr; } .yearcard { padding: 16px; } }

/* ---------- Jar ---------- */
.jarobj { position: relative; width: clamp(200px, 20vw, 300px); aspect-ratio: 560 / 966; }
.jarobj .jarimg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.candies { position: absolute; z-index: 1; left: 12%; right: 12%; top: 30%; bottom: 6%; }
.candies img { position: absolute; width: 30%; cursor: pointer; transition: transform .25s, filter .25s, opacity .6s; }
.candies img.top { filter: drop-shadow(0 0 10px var(--lime)) drop-shadow(0 0 4px var(--lime)); }
.candies img.hot { filter: drop-shadow(0 0 8px #fff) brightness(1.2); transform: scale(1.12); z-index: 3; }
.candies img.in { animation: dropin .7s cubic-bezier(.3, 0, .3, 1.3) 1 both; }
@keyframes dropin { from { transform: translateY(-260%); } }
.candies img.out { opacity: 0; filter: grayscale(1) blur(2px); }
.jarobj .glass-front { position: absolute; inset: 0; z-index: 3; pointer-events: none; }

/* ---------- Paid: wrappers as a constellation ---------- */
.phead .obj.sky { left: 46%; right: 4%; top: 120px; bottom: 34%; }
.sky-wrappers { position: absolute; inset: 0; }
.sw { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; background: none; border: 0; cursor: pointer; transform: translate(-50%, -50%); }
.sw img { width: clamp(110px, 11vw, 170px); filter: drop-shadow(0 0 12px rgba(200, 155, 255, .6)); transition: transform .2s, filter .2s; animation: drift 7s ease-in-out infinite; }
.sw:nth-child(2n) img { animation-delay: -3s; }
.sw span { font: 700 16px/1.2 var(--sans); color: #fff; text-shadow: 0 2px 8px rgba(10, 4, 40, .9); }
.sw small { font: 600 16px/1.2 var(--sans); color: var(--text-2); }
.sw:hover img, .sw.hot img { transform: scale(1.08); filter: drop-shadow(0 0 16px var(--lime)); }
.sw.carry img { opacity: .55; filter: grayscale(.5) drop-shadow(0 0 10px rgba(200, 155, 255, .4)); }
@keyframes drift { 50% { transform: translateY(-6px) rotate(2deg); } }
.sky-wrappers .line { position: absolute; height: 1px; background: linear-gradient(90deg, rgba(200, 155, 255, 0), rgba(200, 155, 255, .55), rgba(200, 155, 255, 0)); transform-origin: 0 50%; }

/* ---------- Rules ---------- */
.rulesobj { position: relative; width: clamp(240px, 24vw, 360px); height: clamp(300px, 34vh, 380px); }
.rulesobj .moon.mini { --mw: 42%; --mx: 30%; --my: 34%; }
.rulesobj .hg.mini { --hw: 44%; --hx: 0; --hy: 0; }
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 16px 24px; margin-top: 16px; padding: 18px 22px; }
.calc-in { display: flex; flex-direction: column; gap: 6px; }
.calc-in label { font: 600 16px/1.3 var(--sans); color: var(--text-2); }
.calc-in input { min-height: 46px; padding: 0 16px; border-radius: 999px; font: 700 18px/1 var(--sans); color: var(--text); background: rgba(20, 12, 70, .78); border: 1.5px solid var(--line); width: 100%; }
.calc-res p { margin: 0 0 4px; font: 600 16px/1.4 var(--sans); color: var(--text); }
.calc-res p:first-child { font: 800 20px/1.3 var(--sans); color: #fff; }
.calc-res .btn { margin-top: 6px; }
.rules .cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3) var(--s5); }
.rules .cols p, .rules .note { margin: 0; font-size: 18px; color: var(--text); max-width: 38em; }
.rules .note { margin-top: var(--s3); color: var(--text-2); }
.rules .sec + .sec { margin-top: var(--s6); }
.checks { margin: 0; padding: 0; list-style: none; counter-reset: c; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.checks li { counter-increment: c; position: relative; padding: 18px 22px 18px 70px; border-radius: 20px; background: var(--glass); border: 1px solid var(--line); font-size: 18px; color: var(--text); }
.checks li::before { content: counter(c); position: absolute; left: 20px; top: 16px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 800 18px/1 var(--sans); color: #1c0e4f; background: var(--lime); box-shadow: 0 0 12px rgba(212, 255, 58, .4); }
.lost .obj img { width: clamp(240px, 30vw, 420px); filter: drop-shadow(0 0 20px rgba(200, 155, 255, .5)); animation: drift 7s ease-in-out infinite; }
@media (max-width: 899px) {
  .rules .cols, .checks { grid-template-columns: 1fr; }
  .calc { grid-template-columns: 1fr; }
  .phead .obj.sky { position: relative; left: auto; right: auto; top: auto; bottom: auto; height: 220px; margin: 0 var(--gut); }
}
@media (max-width: 899px) {

  .potnum .n { font-size: 42px; -webkit-text-stroke-width: 4px; }
  .potnum .of { font-size: 16px; }
  .pot .player { position: static; margin: 16px 0 0; }
}
.player .btn { background: rgba(20, 12, 70, .82); }
.player .btn[disabled] { background: rgba(20, 12, 70, .6); color: var(--text-3); }
.phead .bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20, 12, 70, .86) 0, rgba(20, 12, 70, .62) 38%, rgba(20, 12, 70, 0) 62%); }
@media (max-width: 899px) { .phead .bg::after { background: linear-gradient(180deg, rgba(20, 12, 70, .2) 0, rgba(20, 12, 70, .85) 55%); } }
.hg .heap { position: absolute; left: 22%; right: 22%; bottom: 9.5%; height: 0; border-radius: 50% 50% 6px 6px / 70% 70% 6px 6px; background: radial-gradient(circle at 30% 30%, #f4ffb0 0 1.5px, transparent 2px) 0 0 / 7px 7px, radial-gradient(circle at 70% 60%, #c89bff 0 1.5px, transparent 2px) 0 0 / 9px 9px, linear-gradient(180deg, #d4ff3a, #a98cf0); box-shadow: 0 0 18px rgba(212, 255, 58, .5); transition: height .6s ease-out; }
[hidden] { display: none !important; }
.phead .bg::after { background: linear-gradient(90deg, rgba(20, 12, 70, .92) 0, rgba(20, 12, 70, .8) 34%, rgba(20, 12, 70, .35) 52%, rgba(20, 12, 70, 0) 64%); }
.sw img { width: clamp(150px, 13vw, 220px); }
.sw small, .sw span { background: rgba(20, 12, 70, .72); padding: 2px 10px; border-radius: 999px; }
.sw { width: clamp(150px, 13vw, 220px); }
.sw img { width: 100%; }
.phead .bg::after { background: linear-gradient(90deg, rgba(20, 12, 70, .95) 0, rgba(20, 12, 70, .88) 40%, rgba(20, 12, 70, .3) 54%, rgba(20, 12, 70, 0) 64%); }
@media (max-width: 899px) {
  .phead .stage { display: flex; flex-direction: column; }
  .phead .obj { order: -1; display: flex; justify-content: center; margin: 8px 0 0; min-height: 200px; align-items: flex-end; }
  .phead .obj.sky { order: -1; }
  .phead .stage > .wrap { order: 1; padding-bottom: 24px; }
  .phead .front { display: none; }
  .jarobj { width: 170px; }
  .rulesobj { height: 260px; width: 260px; }
  .yearcard { background: var(--glass); }
}
@media (max-width: 899px) {
  .phead .bg { background: var(--sky-0) url("../img/sky-tall.webp") center top / 100% auto no-repeat; }
  .phead .bg::after { background: linear-gradient(180deg, rgba(20, 12, 70, 0) 0, rgba(20, 12, 70, 0) 52%, rgba(20, 12, 70, .96) 66%); }
}
.pot .moon, .pot .hg, .pot .potnum, .pot .nx, .pot [data-player], .pot .front { visibility: hidden; }
.pot.ready .moon, .pot.ready .hg, .pot.ready .potnum, .pot.ready .nx, .pot.ready [data-player], .pot.ready .front { visibility: visible; }
@media (max-width: 899px) { .pot .stage { padding-top: 408px; } }
.potnum, .pot [data-player] { transition: transform 1.2s cubic-bezier(.2, .7, .2, 1); }

/* ===================== v2.1: readable heads, one world below, sugar titles ===================== */
@font-face { font-family: "Fredoka"; src: url("../fonts/fredoka-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* inner heads: the text column always sits on dark sky; the dunes are a strip below the text */
@media (min-width: 900px) {
  .phead { --dh: clamp(150px, 14vw, 230px); }
  .phead .bg { background: linear-gradient(180deg, #140c46 0, #23136a 55%, #3b2290 100%); }
  .phead .bg::after { background: linear-gradient(90deg, rgba(20, 10, 70, .75) 0, rgba(20, 10, 70, .45) 30%, rgba(20, 10, 70, 0) 52%); }
  .phead .front { display: block; top: auto; bottom: 0; height: var(--dh); z-index: -1; background: url("../img/dunes-strip.webp") center top / cover no-repeat;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%); mask-image: linear-gradient(to bottom, transparent 0, #000 22%); }
  .phead .stage { height: auto; padding-bottom: calc(var(--dh) + 8px); }
  .phead .obj { bottom: calc(var(--dh) * .3); }
}

/* the player buttons: opaque glass pills with white text */
.player .btn, .player .btn[disabled] { background: rgba(24, 14, 82, .96); color: #fff; border-color: rgba(200, 155, 255, .6); box-shadow: 0 6px 18px rgba(8, 3, 34, .45); }
.player .btn[disabled] { color: rgba(255, 255, 255, .62); }

/* below the head: the same night sky with rare stars, low dunes between sections */
.below { position: relative; isolation: isolate; background: url("../img/stars-tile.png") 0 0 / 640px 640px repeat, linear-gradient(180deg, #1a0e52 0, #23136a 100%); overflow: hidden; }
.below::before { content: ""; position: absolute; inset: 0; z-index: -1; background: url("../img/stars-tile.png") 320px 200px / 520px 520px repeat; opacity: .5; animation: twinkle 6s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .15; } to { opacity: .6; } }
.sec + .sec::before { content: ""; display: block; width: 100vw; margin: 0 0 var(--s5) calc(50% - 50vw); height: 72px; background: url("../img/dunes-band.webp") center 40% / cover no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 35%, #000 70%, transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 35%, #000 70%, transparent 100%); }
.sec + .sec { margin-top: var(--s5); }
.ca-line { background: #1f1060; }

/* sugar section titles: the banner lettering in a rounded face, filled with real sugar texture */
.sh { position: relative; isolation: isolate; display: inline-block; margin: 0; font: 700 56px/1.08 "Fredoka", var(--sans) !important; letter-spacing: .005em;
  color: #fff; background: url("../img/sugar-tex.webp") 0 0 / 120px 120px; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; text-shadow: none !important; }
.sh::before { content: attr(data-text); position: absolute; inset: 0; z-index: -1; color: var(--edge); -webkit-text-fill-color: var(--edge); -webkit-text-stroke: 12px var(--edge); paint-order: stroke fill; filter: drop-shadow(0 0 14px rgba(212, 255, 58, .45)); }
.sec-h p { margin-top: 10px; }
@media (max-width: 699px) { .sh { font-size: 36px !important; } .sh::before { -webkit-text-stroke-width: 8px; } }

/* How the hourglass pays: one 160 px frame per picture, cards of one height */
.steps { align-items: stretch; }
.steps .card .pic { height: 160px; display: flex; align-items: center; justify-content: center; }
.steps .card .pic img { max-height: 150px; max-width: 100%; width: auto; height: auto; }

/* Jar: the queue in layers, place 1 on top, lit and pulsing; the paid one is an open wrapper beside the jar */
.candies img.top { animation: toppulse 2.4s ease-in-out infinite; }
@keyframes toppulse { 50% { filter: drop-shadow(0 0 16px var(--lime)) drop-shadow(0 0 6px var(--lime)) brightness(1.15); } }
.paidwrap { position: absolute; z-index: 3; left: -78%; bottom: 4%; width: 72%; transform: rotate(-10deg); filter: drop-shadow(0 0 10px rgba(200, 155, 255, .55)); }
.paid-line { margin: 14px 0 0; font: 600 17px/1.4 var(--sans); color: var(--text-2); }
.tag.no { color: var(--text-2); background: rgba(160, 150, 200, .14); border-color: rgba(200, 190, 230, .35); cursor: help; }
.tag.ok { color: #1c0e4f; background: var(--lime); border-color: var(--lime); }

/* Wrap: the year card is a postcard for X: dark sky, sugar title left, four numbers right, the wrapper only at the edges */
.yearcard { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 40px; padding: 48px 15%; border-radius: 28px; aspect-ratio: 16 / 9;
  background: url("../img/dunes-band.webp") center bottom / 100% auto no-repeat, url("../img/stars-tile.png") 0 0 / 520px repeat, linear-gradient(180deg, #140c46 0, #2e1a7a 70%, #4a2a9e 100%); border: 1px solid var(--line); }
.yearcard .end { position: absolute; top: 50%; height: 78%; width: auto; transform: translateY(-50%); filter: drop-shadow(0 0 12px rgba(200, 155, 255, .5)); pointer-events: none; }
.yearcard .end.l { left: -2%; }
.yearcard .end.r { right: -2%; }
.yc-title { position: relative; isolation: isolate; margin: 0; font: 700 clamp(48px, 5.4vw, 84px)/1 "Fredoka", var(--sans); color: #fff; background: url("../img/sugar-tex.webp") 0 0 / 120px 120px; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.yc-title::before { content: attr(data-text); position: absolute; inset: 0; z-index: -1; -webkit-text-fill-color: var(--edge); -webkit-text-stroke: 14px var(--edge); paint-order: stroke fill; filter: drop-shadow(0 0 16px rgba(212, 255, 58, .5)); }
.yc-who { margin: 16px 0 0; font: 600 17px/1.4 var(--sans); color: var(--text); }
.yc-flav { margin: 8px 0 0; font: 800 22px/1.3 var(--sans); color: var(--lime); }
.yc-figs { display: flex; flex-direction: column; gap: 4px; padding: 20px 24px; border-radius: 20px; background: rgba(20, 12, 70, .82); border: 1px solid var(--line); }
.yc-row { display: grid; grid-template-columns: 1fr auto; align-items: baseline; column-gap: 16px; padding: 8px 0; border-bottom: 1px solid rgba(200, 155, 255, .16); }
.yc-row:last-child { border-bottom: 0; }
.yc-row .k { font: 700 16px/1.3 var(--sans); color: var(--text-2); }
.yc-row b { grid-row: span 2; font-size: 34px; line-height: 1; -webkit-text-stroke-width: 5px; text-align: right; }
.yc-row .d { font: 600 16px/1.3 var(--sans); color: var(--text-3); }
.yc-row b.in { animation: countin .45s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes countin { from { transform: translateY(10px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 999px) { .yearcard { grid-template-columns: 1fr; aspect-ratio: auto; padding: 32px 24px; } .yearcard .end { display: none; } }

/* Paid: one line under each wrapper, all plates one width */
.sw { width: clamp(170px, 14vw, 230px); }
.sw .plate { min-width: 280px; text-align: center; white-space: nowrap; font: 700 16px/1.2 var(--sans); color: #fff; background: rgba(20, 12, 70, .9); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; }
.sw.carry .plate { color: var(--text-2); }

/* Rules: the calculator in its own section, fields left, result right, the hourglass beside */
.calcbox { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: center; }
.calcbox .calc { margin: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); padding: 24px 28px; }
.calcbox .rulesobj { width: 280px; height: 340px; }
.moonobj { position: relative; width: clamp(160px, 14vw, 230px); }
.moonobj .halo { position: absolute; inset: -60%; border-radius: 50%; background: radial-gradient(closest-side, rgba(212, 255, 58, .45), rgba(212, 255, 58, 0)); }
.moonobj img { position: relative; animation: moonpulse 5s ease-in-out infinite; }
@media (max-width: 899px) { .calcbox { grid-template-columns: 1fr; } .calcbox .rulesobj { margin: 0 auto; width: 240px; height: 280px; } }
.sh, .yc-title { background: none !important; -webkit-background-clip: border-box !important; background-clip: border-box !important; -webkit-text-fill-color: #fff !important; color: #fff !important;
  -webkit-text-stroke: 10px var(--edge); paint-order: stroke fill; filter: drop-shadow(0 0 14px rgba(212, 255, 58, .4)); }
.yc-title { -webkit-text-stroke-width: 12px; }
.sh::before, .yc-title::before { content: none !important; }
@media (max-width: 699px) { .sh { -webkit-text-stroke-width: 7px; } }
.yearcard { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); padding: 48px 11%; }
.yearcard .end { height: 44%; opacity: .95; }
.yearcard .end.l { left: -5%; -webkit-mask-image: linear-gradient(90deg, #000 55%, transparent 100%); mask-image: linear-gradient(90deg, #000 55%, transparent 100%); }
.yearcard .end.r { right: -5%; -webkit-mask-image: linear-gradient(270deg, #000 55%, transparent 100%); mask-image: linear-gradient(270deg, #000 55%, transparent 100%); }
.yc-figs { position: relative; z-index: 1; }
.yc-row b { white-space: nowrap; }
.below { background-size: 900px 900px, auto; }
.below::before { background-size: 700px 700px; }
.yearcard { background: url("../img/dunes-band.webp") center bottom / 100% auto no-repeat, linear-gradient(180deg, #140c46 0, #2e1a7a 70%, #4a2a9e 100%); }
.candies img { width: 42%; }
@media (max-width: 999px) {
  .yearcard { grid-template-columns: 1fr; padding: 28px 22px; gap: 24px; }
  .yearcard .end { display: none; }
}
@media (max-width: 899px) {
  .calcbox .calc { grid-template-columns: 1fr; }
  .sw .plate { min-width: 0; max-width: 42vw; white-space: normal; }
}
@media (max-width: 599px) {
  .yc-row { grid-template-columns: 1fr; row-gap: 4px; }
  .yc-row b { grid-row: auto; text-align: left; font-size: 30px; order: 2; }
  .yc-row .k { order: 1; }
  .yc-row .d { order: 3; }
}

/* ===================== v2.2: compact inner heads, one object each, a flip ribbon ===================== */
@media (min-width: 900px) {
  .phead { --dh: 120px; }
  .phead .front { height: var(--dh); background: url("../img/dunes-far.webp") center bottom / 100% 100% no-repeat; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 30%); mask-image: linear-gradient(to bottom, transparent 0, #000 30%); }
  .phead .stage { padding-bottom: calc(var(--dh) + 4px); max-height: 520px; }
  .phead .wm { height: clamp(56px, 5.6vw, 84px); margin-top: 12px; }
  .phead .sub { margin-top: 8px; font-size: 17px; }
  .figs { margin-top: 12px; }
  .phead .player { margin-top: 12px; }
  .phead .obj { right: 8%; bottom: calc(var(--dh) * .55); }
}
/* one middle-sized object per head, whole in frame */
.wrapobj { width: 260px; }
.jarobj { width: auto; height: 340px; aspect-ratio: 560 / 966; }
.moonobj { width: clamp(160px, 15vw, 220px); }
.paidobj { width: 150px; }
.paidobj img { width: 100%; filter: drop-shadow(0 0 20px rgba(212, 255, 58, .35)); }
.paidwrap { display: none !important; }

/* Jar: one tidy column by place, place 1 on top */
.candies { left: 20%; right: 20%; top: 34%; bottom: 6%; }
.candies img { width: 64%; left: 18% !important; }
.candies .pn { position: absolute; right: -14%; transform: translateY(-50%); min-width: 26px; padding: 2px 7px; border-radius: 999px; font: 800 16px/1.1 var(--sans); color: #1c0e4f; background: var(--lime); text-align: center; pointer-events: none; }
.candies .pn.no { color: #fff; background: rgba(20, 12, 70, .9); border: 1px solid var(--line); }

/* Wrap: the year card is compact and always filled */
.yearcard { aspect-ratio: auto !important; min-height: 0; padding: 32px 12% !important; gap: 32px; }
.yearcard .end { height: 70%; }
.yc-title { font-size: clamp(44px, 4.4vw, 68px); }
.yc-row b.in { animation: countin2 .45s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes countin2 { from { transform: translateY(12px) scale(.86); } to { transform: none; } }

/* Paid: a ribbon of flips under the title */
.ribbon { display: flex; align-items: stretch; gap: 0; overflow: visible; }
.rb { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 0; background: none; border: 0; text-align: left; cursor: pointer; }
.rb .hg-mini { width: 64px; transition: transform .2s; }
.rb .hg-mini.turning { animation: turn 1s cubic-bezier(.3, 0, .2, 1) 1 both; }
.rb .card { width: 100%; padding: 16px 20px; }
.rb .card h3 { margin: 0 0 6px; font: 800 20px/1.2 var(--sans); color: #fff; }
.rb .card p { margin: 0; font: 600 16px/1.5 var(--sans); color: var(--text-2); }
.rb .card p b { color: #fff; }
.rb .card .who { color: var(--lime); }
.rb:hover .card, .rb.hot .card, .rb:focus-visible .card { border-color: var(--lime); box-shadow: 0 0 0 1px var(--lime), 0 12px 40px rgba(8, 3, 34, .35); }
.rb.next { cursor: default; }
.rb.next .hg-mini { opacity: .45; }
.rb.next .card { background: transparent; border: 1.5px dashed var(--line); box-shadow: none; }
.rb-arrow { flex: 0 0 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding-bottom: 40px; font: 700 16px/1.2 var(--sans); color: var(--text-2); text-align: center; }
.rb-arrow i { display: block; width: 100%; height: 2px; background: linear-gradient(90deg, rgba(200, 155, 255, .2), var(--lilac)); position: relative; }
.rb-arrow i::after { content: ""; position: absolute; right: -2px; top: -5px; border: 6px solid transparent; border-left: 9px solid var(--lilac); }
.spark { position: fixed; z-index: 50; width: 6px; height: 6px; border-radius: 2px; pointer-events: none; }
@media (max-width: 899px) {
  .ribbon { flex-direction: column; }
  .rb-arrow { flex-basis: auto; padding: 8px 0; }
  .rb-arrow i { width: 2px; height: 32px; background: linear-gradient(180deg, rgba(200, 155, 255, .2), var(--lilac)); }
  .rb-arrow i::after { right: -5px; top: auto; bottom: -10px; border: 6px solid transparent; border-top: 9px solid var(--lilac); }
  .jarobj { height: 280px; }
}

/* Rules: the calculator objects centred on the card */
.calcbox { align-items: center; }
.calcbox .rulesobj { height: 300px; }
@media (max-width: 999px) { .yearcard { padding: 28px 22px !important; } }
.rb .card { display: block; }
.rb .card .t { display: block; margin: 0 0 6px; font: 800 20px/1.2 var(--sans); color: #fff; }
.rb .card .l { display: block; font: 600 16px/1.5 var(--sans); color: var(--text-2); }
.rb .card .l b { color: #fff; }
@media (min-width: 900px) {
  .phead .stage-wrap { max-width: 720px; }
  .phead .sub { max-width: 44em; }
  .phead .wm { height: clamp(52px, 5vw, 72px); margin-top: 8px; }
  .phead .stage { padding-bottom: calc(var(--dh) - 28px); }
  .phead .figs { margin-top: 8px; gap: 8px 32px; }
  .phead .player { margin-top: 10px; }
  .phead .field { margin-top: 12px; }
  .phead .hint { margin-top: 8px; }
  .rh-line { margin-top: 8px; }
}
.jarobj { height: 320px; }
@media (max-width: 899px) { .jarobj { height: 280px; } }
.yearcard { background: url("../img/dunes-far.webp") center bottom / 100% 56px no-repeat, linear-gradient(180deg, #140c46 0, #2e1a7a 70%, #4a2a9e 100%) !important; padding-bottom: 72px !important; }
.yearcard .end { height: 62%; top: 45%; }
@media (min-width: 900px) { body[data-page="rules"] .phead .stage { padding-bottom: calc(var(--dh) + 12px); } }
@media (max-width: 999px) { .yearcard { padding: 28px 22px 72px !important; } }

/* ===================== v3: effects rebuilt ===================== */
/* rolling digits of the pot (0.4 s) */
.dg { display: inline-block; }
.dg.roll { position: relative; overflow: hidden; height: 1.08em; vertical-align: top; padding: 0 1px; }
.dg.roll .o, .dg.roll .n { display: block; animation: roll .4s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes roll { from { transform: translateY(0); } to { transform: translateY(-100%); } }

/* the moon breathes (4 s), bursts and is born again */
.moon img { animation: moonpulse 4s ease-in-out infinite; }
@keyframes moonpulse { 50% { transform: scale(1.03); } }
.moon.burst img { opacity: 0; transform: scale(1.25); transition: opacity .18s, transform .18s; animation: none; }
.moon.burst .halo { opacity: 0 !important; transition: opacity .2s; }
.moon.reborn img { animation: reborn .6s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes reborn { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* the hourglass: a flash, a spring turn (0.8 s), a short settle */
.hg { isolation: isolate; }
.hg-glow { position: absolute; inset: -18%; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, rgba(212, 255, 58, .55), rgba(212, 255, 58, 0)); opacity: 0; pointer-events: none; }
.hg.flashing .hg-glow { animation: glowflash .7s cubic-bezier(.2, .8, .2, 1) 1; }
@keyframes glowflash { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
.hg.flashing img { animation: imgflash .5s ease-out 1; }
@keyframes imgflash { 30% { filter: drop-shadow(0 0 24px rgba(212, 255, 58, .7)) brightness(1.35); } }
.hg.turning { animation: spring .8s cubic-bezier(.2, .8, .2, 1) 1 both; }
@keyframes spring { 0% { transform: rotate(0); } 55% { transform: rotate(198deg); } 75% { transform: rotate(175deg); } 90% { transform: rotate(182deg); } 100% { transform: rotate(180deg); } }
.pot .hg .heap { left: 24%; right: 24%; bottom: 10%; transition: height .6s cubic-bezier(.2, .8, .2, 1); }

/* the card that takes the 70% lights up */
.nx.lit { animation: cardlit 1s cubic-bezier(.2, .8, .2, 1) 1; }
@keyframes cardlit { 0% { box-shadow: 0 0 0 0 rgba(212, 255, 58, 0); } 30% { box-shadow: 0 0 0 2px var(--lime), 0 0 40px rgba(212, 255, 58, .55); } 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 12px 40px rgba(8, 3, 34, .35); } }
.roller { position: absolute; z-index: 2; width: 54px; pointer-events: none; }
.risetext { position: absolute; z-index: 6; transform: translate(-50%, 0); font: 800 20px/1 var(--sans); color: #fff; text-shadow: 0 0 12px rgba(200, 155, 255, .9), 0 2px 6px rgba(10, 4, 40, .9); pointer-events: none; white-space: nowrap; }

/* Pot layout: the contract block on a solid dark plate */
.pot .ca { background: rgba(18, 10, 62, .96); border-color: rgba(200, 155, 255, .5); }

/* the ?fx=1 test panel */
.fxpanel { position: fixed; left: 12px; bottom: 12px; z-index: 70; display: flex; flex-wrap: wrap; gap: 6px; max-width: 560px; padding: 10px; border-radius: 18px; background: rgba(14, 8, 48, .94); border: 1px solid var(--line); }
.fxpanel .btn { min-height: 40px; padding: 0 14px; font-size: 16px; }

/* How the hourglass pays: one 160 x 120 frame per picture */
.steps .card .pic { width: 160px; height: 120px; align-self: center; }
.steps .card .pic img { max-width: 150px; max-height: 110px; }

/* Jar: place 1 lit and swaying; a round badge in the candy colour */
.candies img { transition: transform .5s cubic-bezier(.2, .8, .2, 1), opacity .5s, filter .5s; top: 0 !important; }
.candies img.top { animation: sway 3s ease-in-out infinite; filter: drop-shadow(0 0 14px var(--lime)) drop-shadow(0 0 5px var(--lime)) brightness(1.15); }
@keyframes sway { 50% { rotate: 4deg; } }
.candies img.in { animation: dropspring .75s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes dropspring { from { translate: 0 -260%; } to { translate: 0 0; } }
.candies img.out { opacity: 0; filter: grayscale(1) brightness(.6); }
.candies .pn { top: 0 !important; width: 26px; height: 26px; min-width: 0; padding: 0; border-radius: 50%; display: grid; place-items: center; transition: transform .5s cubic-bezier(.2, .8, .2, 1); color: #1c0e4f; border: 2px solid rgba(20, 12, 70, .8); }
.candies .pn.flip { animation: pnflip .4s cubic-bezier(.2, .8, .2, 1); }
@keyframes pnflip { from { rotate: x 90deg; opacity: .2; } to { rotate: x 0deg; opacity: 1; } }

/* Paid: a lower head so the ribbon shows on the first screen */
@media (min-width: 900px) {
  body[data-page="paid"] .phead .sub { display: none; }
  body[data-page="paid"] .phead .player { display: inline-flex; margin-left: 24px; vertical-align: middle; }
  body[data-page="paid"] .phead .figs { display: inline-flex; }
}
.rb .hg-mini.turning { animation: spring .8s cubic-bezier(.2, .8, .2, 1) 1 both; }

/* Rules: the calculator scene is one column next to the card, as tall as the card */
.calcbox { align-items: stretch; }
.calcbox .rulesobj { position: relative; height: auto !important; width: 240px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.calcbox .rulesobj .moon.mini { position: relative; left: auto; bottom: auto; top: auto; width: 84px; transform: none !important; }
.calcbox .rulesobj .moon.mini .halo { inset: -50%; }
.calcbox .rulesobj .hg.mini { position: relative; right: auto; bottom: auto; top: auto; width: auto; height: 210px; }
.calcbox .rulesobj .hg.mini img { height: 100%; width: auto; }
.calcbox .rulesobj .hg.mini .heap { left: 24%; right: 24%; bottom: 10%; }
@media (max-width: 899px) { .calcbox .rulesobj { width: 100%; height: 300px !important; } }
.rulesobj .fxc { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); pointer-events: none; z-index: 3; }
.pot .hg .heap { left: 22%; right: 22%; bottom: 10%; border-radius: 50% 50% 0 0 / 100% 100% 0 0; background: radial-gradient(ellipse at 50% 100%, rgba(232, 255, 140, .55), rgba(212, 255, 58, .18) 55%, rgba(212, 255, 58, 0) 75%); box-shadow: none; }
.calcbox .calc { min-height: 300px; align-content: center; }
.calcbox .rulesobj { min-height: 300px; }
.calcbox .rulesobj .hg.mini { height: 200px; }
.candies .pn { z-index: 4; }
.jarobj .candies { z-index: 3; }
.risetext { font-size: 16px; }
.paidobj { width: 110px; }
/* v3.1 */
.yc-row b { -webkit-text-stroke: 0 !important; color: #fff; -webkit-text-fill-color: #fff; text-shadow: 0 0 14px rgba(212, 255, 58, .35), 0 2px 0 var(--edge); }
.pot .ca { background: rgba(20, 10, 70, .92); box-shadow: 0 10px 30px rgba(8, 3, 34, .5); }
.calcbox .calc { min-height: 0; align-content: start; }
.calcbox .rulesobj { min-height: 0; height: auto !important; justify-content: center; }
.calcbox .rulesobj .moon.mini { width: 64px; flex: none; }
.calcbox .rulesobj .hg.mini { flex: 1 1 auto; height: auto; min-height: 120px; max-height: 200px; display: flex; justify-content: center; }
.calcbox .rulesobj .hg.mini img { height: 100%; width: auto; max-height: 200px; }
