/* Cubo Blocks — Aventure, star chests, Boutique bonus rows. */
/* ---------- aventure ---------- */
.star path { fill: var(--sunken); }
.star.on path { fill: #ffc83d; stroke: #d99a00; stroke-width: 1.2; stroke-linejoin: round; }
.star-pill { display: inline-flex; align-items: center; gap: 4px; padding: 7px 10px 5px; border-radius: 999px; background: var(--panel-2);
  font-family: var(--font-display); font-style: var(--display-style); font-weight: 700; font-size: 18px; line-height: 1; font-variant-numeric: tabular-nums; }
.worlds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* Aventure: world strip on top (scrolls sideways), picked world below. */
.world-strip { display: flex; gap: 8px; margin: 0 -16px 14px; padding: 4px 16px 6px; overflow-x: auto; scroll-snap-type: x proximity;
  scrollbar-width: none; overscroll-behavior-x: contain; }
.world-strip::-webkit-scrollbar { display: none; }
.world-strip .world-tile { flex: none; width: 82px; padding: 4px 4px 6px; scroll-snap-align: center; transition: transform 120ms; }
.world-strip .world-tile:active { transform: scale(.95); }
.world-strip .world-tile.locked { cursor: pointer; }
.world-strip .world-tile .name { display: block; margin-top: 4px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.world-strip .world-tile .meta { margin-top: 1px; font-size: 12px; }
.world-strip .world-tile .meta svg { width: 12px; height: 12px; }
.world-tile .crown { position: absolute; top: 2px; right: 2px; line-height: 0; color: #f5b700; filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); pointer-events: none; }
.world-strip .world-tile.pick { background: var(--panel); box-shadow: inset 0 0 0 3px var(--accent); }
.world-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.world-title h3 { flex: 1; min-width: 0; margin: 0; text-align: left; font-family: var(--font-display); font-style: var(--display-style); font-weight: 700;
  font-size: 26px; line-height: 1; text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.world-title .close { width: 34px; height: 34px; flex: none; }
.world-title .star-pill { font-size: 16px; padding: 6px 9px 4px; }
.world-lock { margin-bottom: 10px; }
.world-lock:empty { display: none; }
.world-page.locked .rules, .world-page.locked .path-wrap { opacity: .55; }
.world-page.from-right { animation: slide-r 240ms cubic-bezier(.2,.8,.2,1); }
.world-page.from-left { animation: slide-l 240ms cubic-bezier(.2,.8,.2,1); }
@media (prefers-reduced-motion: reduce) { .world-page.from-right, .world-page.from-left { animation: none; } }
.world-tile { position: relative; padding: 6px 6px 8px; border: 0; border-radius: calc(var(--radius) - 2px); background: var(--panel-2); color: var(--text); cursor: pointer; text-align: center; }
.world-tile canvas { width: 100%; aspect-ratio: 4 / 3; border-radius: calc(var(--radius) - 6px); display: block; }
.world-tile .name { margin-top: 6px; font-family: var(--font-display); font-style: var(--display-style); font-weight: 700; font-size: 17px; line-height: 1.1; }
.world-tile .meta { display: inline-flex; align-items: center; gap: 3px; margin-top: 3px; font-size: 13px; font-weight: 700; color: var(--muted); }
.world-tile.locked { cursor: default; }
.world-tile.locked canvas { filter: grayscale(1) brightness(0.9); opacity: .5; }
.world-tile .lock { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%; background: var(--panel); color: var(--text); box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.rules { display: grid; gap: 6px; margin-bottom: 14px; text-align: left; font-size: 14px; font-weight: 700; line-height: 1.3; }
.rules div { display: flex; gap: 8px; align-items: flex-start; padding: 9px 11px; border-radius: calc(var(--radius) - 6px); background: var(--panel-2); }
.rules b { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 17px; line-height: 1; color: #fff; }
.rules .plus b { background: var(--good); }
.rules .minus b { background: #ff5d7a; }
.rules .info b { background: var(--accent); color: var(--on-accent); font-size: 14px; font-style: normal; }
.rules .twist { align-items: center; }
.rules .twist .kind-icon, .stage-twist .kind-icon { flex: none; }
.rules .twist em, .stage-twist b { display: block; font-style: normal; font-weight: 800; color: var(--accent); }
.stage-twist { display: flex; gap: 10px; align-items: center; margin: 10px auto 2px; max-width: 300px; padding: 9px 11px; border-radius: calc(var(--radius) - 6px);
  background: var(--panel-2); text-align: left; font-size: 13px; font-weight: 700; line-height: 1.35; }
.pz-pack { margin: 16px 2px 10px; display: flex; align-items: baseline; justify-content: space-between; }
.pz-pack h3 { margin: 0; font-family: var(--font-display); font-style: var(--display-style); font-weight: 700; font-size: 20px; }
.pz-pack span { font-size: 13px; font-weight: 800; color: var(--muted); }
.pz-pack:first-child { margin-top: 4px; }
/* Mondes screen: world tiles, then the picked world's rules, record, prime and Play. */
.fw-intro { margin: -4px 2px 12px; }
.world-tile.pick { box-shadow: inset 0 0 0 3px var(--accent); }
.fw-facts { display: flex; gap: 8px; margin-bottom: 12px; }
.fw-facts div { flex: 1; padding: 8px 10px; border-radius: calc(var(--radius) - 6px); background: var(--panel-2); text-align: left; }
.fw-facts small { display: block; font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.fw-facts b { font-size: 18px; font-weight: 800; }
.fw-locked { padding: 12px; border-radius: calc(var(--radius) - 6px); background: var(--panel-2); font-weight: 700; font-size: 14px; color: var(--muted); }
/* Boutique, Bonus tab: one row per bonus with its level and the next upgrade. */
.ups { display: grid; gap: 8px; }
.up { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: calc(var(--radius) - 2px); background: var(--panel-2); text-align: left; }
.up.just-bought { animation: bump 420ms cubic-bezier(.2,1.6,.4,1); }
.up canvas { flex: none; width: 40px; height: 40px; }
.up .txt { flex: 1; min-width: 0; }
.up .txt b { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; }
.up .txt > span { display: block; font-size: 13px; font-weight: 700; color: var(--muted); line-height: 1.3; }
.up .lv { display: inline-flex; gap: 3px; }
.up .lv i { width: 12px; height: 6px; border-radius: 3px; background: var(--hairline); }
.up .lv i.on { background: var(--accent); }
.up button { flex: none; padding: 8px 12px; border: 0; border-radius: 999px; font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; background: var(--accent); color: var(--on-accent); }
.up button:disabled { opacity: .45; cursor: default; }
.up button.max { background: transparent; color: var(--good); }
.up button .coin { margin: 0 0 2px; }
.ups-note { margin: 10px 2px 0; text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); line-height: 1.35; }
.levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px 8px; }
.lvl { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 0; border: 0; background: none; color: var(--text); cursor: pointer; }
.lvl .num { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
  font-family: var(--font-display); font-style: var(--display-style); font-weight: 700; font-size: 20px; box-shadow: 0 4px 0 rgba(0,0,0,.18); }
.lvl.done .num { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 2px var(--good), 0 4px 0 rgba(0,0,0,.12); }
.lvl.boss .num { border-radius: 16px; width: 54px; }
.lvl.trial .num { border-radius: 14px; box-shadow: inset 0 0 0 3px #ffd166, 0 4px 0 rgba(0,0,0,.12); }
.lvl.trial.done .num { box-shadow: inset 0 0 0 3px #ffd166, 0 4px 0 rgba(0,0,0,.12); }
.stage-note { margin: 8px auto 2px; max-width: 280px; font-size: 13px; font-weight: 700; line-height: 1.35; color: var(--muted); }
/* Star chests: a bar of the world's stars with 3 chests sitting on it. */
.chests { position: relative; height: 62px; margin: 4px 22px 14px; }
.chest-bar { position: absolute; left: 0; right: 0; top: 14px; height: 8px; border-radius: 4px; background: var(--sunken); overflow: hidden; }
.chest-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #ffd166, #ff9f43); }
.chest { position: absolute; top: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 0; padding: 0; background: none; cursor: pointer; color: var(--muted); }
.chest svg { filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
.chest small { font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.chest small .star, .chest small .coin { margin: 0; }
.chest.locked svg { filter: grayscale(1) opacity(.55); }
.chest.ready small { color: var(--accent); }
.chest.ready svg { animation: chest-wiggle 1.4s ease-in-out infinite; }
.chest.open svg { opacity: .45; }
.chest.burst svg { animation: bump 380ms cubic-bezier(.2,1.6,.4,1); opacity: 1; }
.chest.burst small { color: var(--good); }
@keyframes chest-wiggle { 0%, 70%, 100% { transform: rotate(0); } 78% { transform: rotate(-9deg); } 86% { transform: rotate(8deg); } 94% { transform: rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .chest.ready svg, .chest.burst svg { animation: none; } }
.lvl.locked { cursor: default; }
.lvl.locked .num { background: var(--panel-2); color: var(--muted); box-shadow: inset 0 0 0 2px var(--hairline); }
.lvl .stars { display: flex; gap: 1px; }
.lvl small { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: -2px; }
.stage-goal { margin: 6px 0 4px; font-size: 18px; font-weight: 800; }
.stage-sub { color: var(--muted); font-size: 14px; font-weight: 700; }
.stage-stars { display: flex; justify-content: center; gap: 6px; margin: 14px 0 6px; }
.stage-stars .star { animation: star-in 420ms cubic-bezier(.2,1.6,.4,1) both; }
.stage-stars .star:nth-child(2) { animation-delay: 180ms; }
.stage-stars .star:nth-child(3) { animation-delay: 360ms; }
@keyframes star-in { from { transform: scale(0) rotate(-40deg); opacity: 0; } }
.opt { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; margin-top: 10px; padding: 11px 14px; border: 0;
  border-radius: calc(var(--radius) - 6px); background: var(--panel-2); color: var(--text); font-weight: 800; font-size: 15px; text-align: left; cursor: pointer; }
.opt .price { display: inline-flex; align-items: center; gap: 2px; font-family: var(--font-display); font-style: var(--display-style); font-size: 17px; }
.opt.on { box-shadow: inset 0 0 0 2.5px var(--accent); }
.opt:disabled { opacity: .45; cursor: default; }
.actions > .btn { min-width: 0; }
.actions:has(> .btn:nth-child(3)) { gap: 8px; }
.actions:has(> .btn:nth-child(3)) > .btn { flex: 1; font-size: 17px; padding-inline: 4px; }
.unlock { margin-top: 12px; padding: 10px 12px; border-radius: calc(var(--radius) - 6px); box-shadow: inset 0 0 0 2px var(--good); font-weight: 800; color: var(--good); }
