/* ======================= Bean Squad Rush: on top of the shared UI kit base ======================= */
:root {
  --navy: #1d2a5c;
  --row: #f0d6a6;
}
html,
body {
  background: #7cc4ff;
}
.btn.pink {
  border-image-source: url(../assets/img/btn-pink.webp);
  border-image-slice: 0 74 fill;
}
.btn.yellow span {
  color: #fff;
}
/* number that pops when it changes (coins, keys, upgrades) */
.bump {
  animation: bump 0.32s cubic-bezier(0.3, 1.8, 0.5, 1);
}
@keyframes bump {
  40% {
    scale: 1.18;
  }
}
.shake {
  animation: shake 0.35s;
}

/* ---------- start ---------- */
#title .logo {
  width: min(58vw, 58vh);
  top: calc(1.5vh + env(safe-area-inset-top));
}
#title .count.coins {
  top: calc(2.4 * var(--u) + env(safe-area-inset-top));
}
.titleBtns {
  position: absolute;
  right: calc(5 * var(--u) + env(safe-area-inset-right));
  top: 44vh;
  display: flex;
  flex-direction: column;
  gap: calc(2.4 * var(--u));
  width: calc(46 * var(--u));
}
.titleBtns .btn.big {
  height: calc(17 * var(--u));
  font-size: calc(9 * var(--u));
  animation: pulse 1.7s ease-in-out infinite;
}
.titleBtns .btn.big img {
  height: calc(10 * var(--u));
}
.titleBtns .btn.pink {
  height: calc(12 * var(--u));
  font-size: calc(6.4 * var(--u));
  width: 84%;
  align-self: center;
}
.ups {
  position: absolute;
  left: 50%;
  bottom: calc(2.4 * var(--u) + env(safe-area-inset-bottom));
  translate: -50% 0;
  display: grid;
  grid-template-columns: repeat(4, calc(30 * var(--u)));
  gap: calc(2 * var(--u));
}
.up {
  position: relative;
  height: calc(26 * var(--u));
  box-sizing: border-box;
  border-radius: calc(4 * var(--u));
  background: linear-gradient(#fffaf0, #f1dcb3);
  border: calc(0.6 * var(--u)) solid #a8682c;
  box-shadow: 0 calc(0.8 * var(--u)) 0 rgba(29, 42, 92, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(1 * var(--u)) calc(1.2 * var(--u)) 0;
  gap: 0;
  transition: transform 0.08s;
}
.up > img {
  height: calc(8.4 * var(--u));
  max-width: 70%;
  object-fit: contain;
}
.up b {
  font-size: calc(4.2 * var(--u));
  max-width: 100%;
}
.up small {
  font-size: calc(3.1 * var(--u));
  max-width: 100%;
  color: #fff;
}
.up .ol {
  -webkit-text-stroke-width: calc(0.6 * var(--u));
  text-shadow: none;
}
.up .price {
  position: absolute;
  left: calc(1.2 * var(--u));
  right: calc(1.2 * var(--u));
  bottom: calc(1.2 * var(--u));
  height: calc(6 * var(--u));
  border-radius: calc(3 * var(--u));
  background: linear-gradient(#7be36b, #3fae2a);
  border: calc(0.4 * var(--u)) solid #fff;
  box-shadow: 0 0 0 calc(0.35 * var(--u)) var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(0.8 * var(--u));
  font-size: calc(3.8 * var(--u));
}
.up .price img {
  height: calc(4 * var(--u));
}
.up.poor .price {
  background: linear-gradient(#b7c0d2, #8d97ad);
}
.up.max .price {
  background: linear-gradient(#b08cff, #7a5cff);
}
.up:active {
  transform: translateY(3%) scale(0.97);
}
@media (orientation: portrait) {
  #title .logo {
    width: 84vw;
    top: calc(13 * var(--u) + env(safe-area-inset-top));
  }
  .titleBtns {
    right: auto;
    left: 50%;
    translate: -50% 0;
    top: auto;
    bottom: calc(64 * var(--u) + env(safe-area-inset-bottom));
    width: calc(58 * var(--u));
  }
  .ups {
    grid-template-columns: repeat(2, calc(44 * var(--u)));
    gap: calc(2.4 * var(--u));
  }
  .up {
    height: calc(27 * var(--u));
  }
}

/* ---------- map: nodes with a square base ---------- */
.node {
  width: calc(13 * var(--u));
  aspect-ratio: 256/217;
  translate: -50% -62%;
}
.node.lock {
  width: calc(11 * var(--u));
  aspect-ratio: 256/217;
}
.node.cur {
  width: calc(15.5 * var(--u));
  aspect-ratio: 256/218;
}
.node.boss {
  background-image: url(../assets/img/node-boss.webp) !important;
  width: calc(16 * var(--u));
  aspect-ratio: 237/256;
  translate: -50% -70%;
}
.node b,
.node.cur b,
.node.lock b {
  top: 36%;
}
.node.boss b {
  top: 52%;
}
.node .me {
  position: absolute;
  width: calc(9 * var(--u));
  left: 72%;
  top: -34%;
  animation: bob2 1s ease-in-out infinite;
}
@keyframes bob2 {
  50% {
    translate: 0 calc(-1 * var(--u));
  }
}
@keyframes bob {
  50% {
    translate: -50% -68%;
  }
}

/* ---------- HUD ---------- */
#hud {
  inset: 0;
  display: none;
  pointer-events: none;
}
[data-screen='play'] #hud {
  display: block;
}
#hud .hudPause {
  position: absolute;
  left: calc(2.4 * var(--u) + env(safe-area-inset-left));
  top: calc(2.4 * var(--u) + env(safe-area-inset-top));
  width: calc(11 * var(--u));
  height: calc(11 * var(--u));
}
.prog {
  position: absolute;
  left: 50%;
  top: calc(3 * var(--u) + env(safe-area-inset-top));
  translate: -50% 0;
  width: calc(62 * var(--u));
  height: calc(10 * var(--u));
  display: flex;
  align-items: center;
}
.prog .bar {
  flex: 1;
  height: calc(4.2 * var(--u));
  margin: 0 calc(-1.5 * var(--u));
  border-radius: calc(3 * var(--u));
  background: rgba(29, 42, 92, 0.55);
  border: calc(0.55 * var(--u)) solid #fff;
  box-shadow: 0 0 0 calc(0.4 * var(--u)) var(--navy);
  overflow: hidden;
}
.prog .bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(#7fd0ff, #2a8cf0);
  border-radius: inherit;
}
.prog .lvl {
  position: relative;
  z-index: 1;
  flex: none;
  width: calc(10 * var(--u));
  height: calc(10 * var(--u));
  border-radius: 50%;
  background: linear-gradient(#5fb2ff, #2468d8);
  border: calc(0.6 * var(--u)) solid #fff;
  box-shadow: 0 0 0 calc(0.45 * var(--u)) var(--navy);
  display: grid;
  place-items: center;
  font-size: calc(5.2 * var(--u));
  padding: 0;
  box-sizing: border-box;
}
.prog .fin {
  position: relative;
  z-index: 1;
  flex: none;
  height: calc(10 * var(--u));
  width: calc(10 * var(--u));
  object-fit: contain;
}
.hudRight {
  position: absolute;
  right: calc(2.4 * var(--u) + env(safe-area-inset-right));
  top: calc(2.4 * var(--u) + env(safe-area-inset-top));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: calc(1 * var(--u));
}
.hudRight .count {
  position: static;
  min-width: calc(26 * var(--u));
}
.keys {
  display: flex;
  gap: calc(0.6 * var(--u));
}
.keys img {
  height: calc(6 * var(--u));
  opacity: 0.3;
  filter: grayscale(1);
}
.keys img.on {
  opacity: 1;
  filter: none;
}
/* fight: the two big numbers */
.vs {
  position: absolute;
  left: 50%;
  top: calc(15 * var(--u) + env(safe-area-inset-top));
  translate: -50% 0;
  display: none;
  align-items: center;
  gap: calc(1.6 * var(--u));
}
.fight .vs {
  display: flex;
  animation: pop 0.26s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.vs b {
  min-width: calc(17 * var(--u));
  height: calc(10 * var(--u));
  display: grid;
  place-items: center;
  border-radius: calc(3 * var(--u));
  border: calc(0.6 * var(--u)) solid #fff;
  box-shadow: 0 0 0 calc(0.45 * var(--u)) var(--navy);
  font-size: calc(7 * var(--u));
  padding: 0 calc(2 * var(--u));
  box-sizing: border-box;
}
.vs b.blue {
  background: linear-gradient(#5fb2ff, #2468d8);
}
.vs b.red {
  background: linear-gradient(#ff7480, #d8283c);
}
.vs span {
  color: var(--gold);
  font-size: calc(7.4 * var(--u));
}
/* boss: health bar */
.bossBar {
  position: absolute;
  left: 50%;
  top: calc(15 * var(--u) + env(safe-area-inset-top));
  translate: -50% 0;
  width: calc(70 * var(--u));
  display: none;
  align-items: center;
  gap: calc(1.4 * var(--u));
  font-size: calc(4.6 * var(--u));
}
.boss .bossBar {
  display: flex;
}
.bossBar img {
  height: calc(8 * var(--u));
  flex: none;
}
.bossBar span {
  flex: none;
}
.bossBar .bar {
  flex: 1;
  height: calc(5 * var(--u));
  border-radius: calc(3 * var(--u));
  background: rgba(29, 42, 92, 0.6);
  border: calc(0.55 * var(--u)) solid #fff;
  box-shadow: 0 0 0 calc(0.4 * var(--u)) var(--navy);
  overflow: hidden;
}
.bossBar .bar i {
  display: block;
  height: 100%;
  background: linear-gradient(#ff7480, #d8283c);
  transition: width 0.15s;
}
.ballDist {
  position: absolute;
  left: 50%;
  top: calc(14 * var(--u) + env(safe-area-inset-top));
  translate: -50% 0;
  display: none;
  font-size: calc(11 * var(--u));
  color: var(--gold);
  -webkit-text-stroke-width: calc(1.2 * var(--u));
}
.ball .ballDist {
  display: block;
}
[data-panel='clear'] #hud,
[data-panel='fail'] #hud,
[data-panel='chest'] #hud,
[data-panel='champ'] #hud {
  display: none;
}
@media (orientation: portrait) {
  .prog {
    top: calc(16 * var(--u) + env(safe-area-inset-top));
    width: calc(70 * var(--u));
  }
  .vs,
  .bossBar,
  .ballDist {
    top: calc(30 * var(--u) + env(safe-area-inset-top));
  }
  .bossBar {
    width: calc(82 * var(--u));
  }
}

/* ---------- panels ---------- */
.msg {
  margin: 0;
  align-self: center;
  font-size: calc(4.8 * var(--u));
  text-align: center;
  max-width: 100%;
}
#fail {
  --rw: calc(62 * var(--u));
  --py: 56%;
}
#fail .failImg {
  align-self: center;
  width: calc(24 * var(--u));
  margin-top: calc(-2 * var(--u));
  animation: stamp 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
#fail .btns .btn.green,
#clear .btns .btn.yellow {
  flex: 1.4 1 0;
}
[data-panel='fail'] #fail,
[data-panel='chest'] #chest,
[data-panel='daily'] #daily {
  display: flex;
  animation: pop 0.26s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.beanRow {
  align-self: center;
  display: flex;
  align-items: center;
  gap: calc(2 * var(--u));
  padding: calc(0.4 * var(--u)) calc(5 * var(--u));
  border-radius: calc(5 * var(--u));
  background: #6b3f1f;
  font-size: calc(7.6 * var(--u));
  margin-top: calc(-1 * var(--u));
}
.beanRow img {
  height: calc(7 * var(--u));
}
#clear .goals .row img {
  width: calc(7 * var(--u));
  height: calc(5 * var(--u));
  object-fit: contain;
}
#clear .goals .row i.ok {
  margin-left: auto;
}
#clear .goals .row {
  height: calc(5.6 * var(--u));
}
#clear .coinRow {
  gap: calc(1.6 * var(--u));
}
#clear .coinRow .mult {
  font-size: calc(5.4 * var(--u));
  color: var(--gold);
  padding: 0 calc(1.4 * var(--u));
  border-radius: calc(2 * var(--u));
  background: linear-gradient(#e070ff, #a52fd8);
}
#clear .coinRow .mult:empty {
  display: none;
}
/* ability wheel */
.roul {
  position: relative;
  height: calc(7.6 * var(--u));
  margin-top: calc(0.4 * var(--u)) !important;
  border-radius: calc(3 * var(--u));
  border: calc(0.5 * var(--u)) solid #fff;
  box-shadow: 0 0 0 calc(0.4 * var(--u)) var(--navy);
}
.roul .zones {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  height: 100%;
  border-radius: calc(2.6 * var(--u));
  overflow: hidden;
}
.roul .zones b {
  display: grid;
  place-items: center;
  font-size: calc(4.2 * var(--u));
  -webkit-text-stroke-width: calc(0.6 * var(--u));
  text-shadow: none;
  padding: 0;
}
.roul .z2 {
  background: #7fb6ff;
}
.roul .z3 {
  background: #5fe39a;
}
.roul .z4 {
  background: #ffc21a;
}
.roul .z5 {
  background: #ff5e6c;
}
.roul .zones b.hit {
  animation: bump 0.4s 3;
  box-shadow: inset 0 0 0 calc(0.6 * var(--u)) #fff;
}
.roul .needle {
  position: absolute;
  top: calc(-2.6 * var(--u));
  left: 50%;
  width: 0;
  height: 0;
  translate: -50% 0;
  border-left: calc(2.2 * var(--u)) solid transparent;
  border-right: calc(2.2 * var(--u)) solid transparent;
  border-top: calc(4 * var(--u)) solid #fff;
  filter: drop-shadow(0 0 calc(0.3 * var(--u)) var(--navy)) drop-shadow(0 0 calc(0.3 * var(--u)) var(--navy));
}
#clear .btns .after {
  display: none;
}
#clear.done .btns .after {
  display: flex;
}
#clear.done .stopBtn {
  display: none;
}
#clear .stopBtn {
  animation: pulse 1s ease-in-out infinite;
}
/* chest */
#chest {
  --rw: calc(64 * var(--u));
  --py: 56%;
  align-items: center;
}
.chestKeys {
  display: flex;
  gap: calc(1 * var(--u));
  margin-top: calc(-3 * var(--u));
}
.chestKeys img {
  height: calc(7 * var(--u));
  opacity: 0.3;
  filter: grayscale(1);
  transition: opacity 0.3s;
}
.chestKeys img.on {
  opacity: 1;
  filter: none;
}
.chestBox {
  position: relative;
  width: calc(36 * var(--u));
  aspect-ratio: 640/564;
}
.chestBox img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.chestBox .opened,
#chest.opened .chestBox .closed {
  display: none;
}
#chest.opened .chestBox .opened {
  display: block;
  animation: stamp 0.45s cubic-bezier(0.3, 1.6, 0.5, 1);
}
#chest:not(.opened) .chestBox .closed {
  animation: wiggle 0.35s ease-in-out infinite;
}
@keyframes wiggle {
  25% {
    rotate: -3deg;
  }
  75% {
    rotate: 3deg;
  }
}
#ui .chestBox canvas {
  position: absolute;
  left: 50%;
  top: -12%;
  translate: -50% 0;
  width: 60%;
  height: auto;
  display: none;
}
#chest.opened .chestBox canvas {
  display: block;
}
.prizeTxt {
  min-height: calc(8 * var(--u));
  display: flex;
  align-items: center;
  gap: calc(1.4 * var(--u));
  font-size: calc(6.4 * var(--u));
  color: var(--gold);
}
.prizeTxt img {
  height: calc(7 * var(--u));
}
#chest .btns {
  width: 70%;
}
/* daily reward */
#daily {
  --pw: calc(110 * var(--u));
  --rw: calc(64 * var(--u));
  --py: 55%;
}
.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: calc(1.2 * var(--u));
}
.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(0.4 * var(--u));
  padding: calc(1 * var(--u)) 0;
  border-radius: calc(2.6 * var(--u));
  background: #f0d6a6;
  box-shadow: inset 0 0 0 calc(0.35 * var(--u)) #d8b47a;
  min-width: 0;
}
.day small {
  font-size: calc(3 * var(--u));
  max-width: 100%;
}
.day img {
  height: calc(6 * var(--u));
}
.day b {
  font-size: calc(3.8 * var(--u));
}
.day .ol {
  -webkit-text-stroke-width: calc(0.55 * var(--u));
  text-shadow: none;
}
.day.got {
  background: #9fe08a;
  opacity: 0.75;
}
.day.today {
  background: linear-gradient(#ffe98a, #ffc928);
  box-shadow: inset 0 0 0 calc(0.5 * var(--u)) var(--navy);
  animation: pulse 1.2s ease-in-out infinite;
}
#daily .btns {
  width: 60%;
  align-self: center;
}
@media (orientation: portrait) {
  #daily {
    --pw: 90vw;
  }
  .days {
    grid-template-columns: repeat(4, 1fr);
  }
  #chest .btns,
  #daily .btns {
    flex-direction: row;
  }
}
/* shop: item name on the card; preview with the city in the background */
.card .nm {
  font-size: calc(3.3 * var(--u));
  max-width: 100%;
  -webkit-text-stroke-width: calc(0.5 * var(--u));
  text-shadow: none;
}
.preview {
  background:
    linear-gradient(transparent 74%, #d9dee8 74%, #b8c0d0),
    url(../assets/img/par-sunny.webp) center 70% / auto 100% no-repeat,
    linear-gradient(#7fc4ff, #d6ecff);
}
#ui .card canvas {
  width: auto;
  height: calc(15.5 * var(--u));
}
#shop {
  --py: 57%;
}
/* long shop names on up to 2 lines; wider champion ribbon; map notice on a single line */
.card .nm {
  white-space: normal;
  text-align: center;
  line-height: 1;
  min-height: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
}
#champ {
  --rw: calc(76 * var(--u));
}
#mapNeed {
  white-space: nowrap;
}
/* (phone): lower title ribbon; the shop fits on screen and the list scrolls with the finger */
.panel {
  --rh: calc(var(--rw) / 4.3);
}
#settings label.row span {
  width: calc(24 * var(--u));
}
#shop .cards {
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  min-height: 0;
}
#shop .shopBody,
#shop .shopRight {
  min-height: 0;
}
@media (orientation: portrait) {
  .panel {
    --rw: calc(50 * var(--u));
  }
  #shop {
    --rw: calc(42 * var(--u));
    --py: 52%;
    max-height: 86vh;
  }
  #shop .shopBody {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
  }
  #shop .shopRight {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
  }
  #shop .cards {
    flex: 1 1 auto;
    padding-bottom: calc(1 * var(--u));
  }
  #shop .preview {
    height: calc(22 * var(--u));
    flex: none;
  }
  #ui #shop .preview canvas {
    height: calc(19 * var(--u));
  }
}
/* no yellow rays */
.node.cur::before,
.node.cur::after,
.rays::before,
.rays::after,
.badge::before,
.badge::after {
  content: none !important;
  display: none !important;
}
/* PLAY and SHOP centered on one row above the upgrades (previously stuck to the right, misaligned) */
.titleBtns {
  right: auto;
  left: 50%;
  translate: -50% 0;
  top: auto;
  bottom: calc(31 * var(--u) + env(safe-area-inset-bottom));
  flex-direction: row;
  align-items: center;
  width: auto;
  gap: calc(2.4 * var(--u));
}
.titleBtns .btn.big {
  width: calc(48 * var(--u));
  height: calc(15 * var(--u));
  font-size: calc(8.4 * var(--u));
}
.titleBtns .btn.pink {
  width: calc(36 * var(--u));
  height: calc(12.4 * var(--u));
  font-size: calc(6.4 * var(--u));
  align-self: center;
}
@media (orientation: portrait) {
  .titleBtns {
    bottom: calc(64 * var(--u) + env(safe-area-inset-bottom));
    flex-direction: column;
  }
  .titleBtns .btn.big {
    width: calc(58 * var(--u));
    height: calc(17 * var(--u));
  }
  .titleBtns .btn.pink {
    width: calc(46 * var(--u));
  }
}
/* PLAY and SHOP the same size */
.titleBtns .btn.big,
.titleBtns .btn.pink {
  width: calc(42 * var(--u));
  height: calc(14 * var(--u));
  font-size: calc(7.4 * var(--u));
  animation: none;
}
.titleBtns .btn img {
  height: calc(8.4 * var(--u));
}
@media (orientation: portrait) {
  .titleBtns .btn.big,
  .titleBtns .btn.pink {
    width: calc(56 * var(--u));
    height: calc(15 * var(--u));
    font-size: calc(7.6 * var(--u));
  }
}
/* ultra-wide screen (wider than 2:1): the art fits fully in height (the nodes stay on the squares); on the sides, the art itself blurred */
#map::before {
  content: '';
  position: absolute;
  inset: -40px;
  background: var(--mapbg) center/cover no-repeat;
  filter: blur(22px) brightness(0.8);
}
@media (min-aspect-ratio: 2/1) {
  .mapArt {
    width: 177.8vh;
  }
}
@media (max-aspect-ratio: 1/2) {
  .mapArt {
    width: 56.25vh;
  }
}
/* chest: opens with a short hop (previously it spun and grew in, looking like another chest on top) */
#chest.opened .chestBox .opened {
  animation: chestOpen 0.28s ease-out;
}
@keyframes chestOpen {
  from {
    scale: 0.9;
    opacity: 0.5;
  }
}
#ui .chestBox canvas {
  top: 2%;
  width: 46%;
}
/* crowd on top of the current level button (previously it sat beside it, outside the button) */
.node .me {
  left: 50%;
  top: -30%;
  translate: -50% 0;
  width: calc(10 * var(--u));
}
.node {
  transition: none;
}

/* ======================= Pastel look =======================
   Panel, ribbons, buttons and rows in CSS (flat colors with a soft gradient): matches the game and has no
   9-slice seams. Only the maps, the level buttons and the icons are bitmap art. */
:root {
  --navy: #2a3a7a;
  --ink: #2a3a7a;
  --card: #fbfaff;
  --card2: #efedfa;
  --line: #d8d3f0;
  --soft: rgba(70, 60, 140, 0.22);
}
#shade {
  background: rgba(70, 80, 150, 0.32);
}
/* panel: white-lilac card with a soft shadow */
.panel {
  border-image: none !important;
  border: calc(0.55 * var(--u)) solid var(--line);
  border-radius: calc(5 * var(--u));
  background: linear-gradient(var(--card), var(--card2));
  box-shadow:
    0 calc(1 * var(--u)) 0 #cfc8ee,
    0 calc(3 * var(--u)) calc(7 * var(--u)) var(--soft);
  padding: calc(10.5 * var(--u)) calc(4.4 * var(--u)) calc(4.6 * var(--u));
}
.panel::before {
  margin-top: 0;
}
.panel > :not(.ribbon):not(.close):not(.badge) {
  margin-left: 0;
  margin-right: 0;
}
.panel > :last-child {
  margin-bottom: 0;
}
#pause > .btn {
  margin-left: 0;
  margin-right: 0;
}
#over .btns,
#clear .btns {
  margin-left: 0;
  margin-right: 0;
}
/* title ribbon: pastel pill with a white rim, attached to the top of the card */
.ribbon {
  border-image: none !important;
  border: calc(0.6 * var(--u)) solid #fff;
  border-radius: calc(var(--rh) / 2);
  padding: 0 calc(var(--rh) * 0.45);
  top: calc(var(--rh) * -0.5);
  box-shadow:
    0 0 0 calc(0.4 * var(--u)) var(--ink),
    0 calc(0.9 * var(--u)) 0 calc(0.4 * var(--u)) rgba(42, 58, 122, 0.35);
  font-size: calc(var(--rh) * 0.48);
}
.ribbon span {
  max-width: 100%;
  margin: 0;
}
.ribbon.green {
  background: linear-gradient(#b5f2d6, #6ed4ac);
}
.ribbon.blue {
  background: linear-gradient(#c3e2ff, #79b6f2);
}
.ribbon.red {
  background: linear-gradient(#ffc3bc, #f4807f);
}
.ribbon.yellow {
  background: linear-gradient(#ffeca8, #f6c64e);
}
.panel {
  --rh: calc(var(--rw) / 5.4);
}
.close {
  top: calc(var(--rh) * -0.62);
  right: calc(-3.6 * var(--u));
}
#shop .close {
  top: calc(var(--rh) * -0.62);
  right: calc(-3.6 * var(--u));
}
/* wide buttons: pastel pill with a thin outline and a darker "foot" */
.btn {
  border-image: none !important;
  border: calc(0.5 * var(--u)) solid #4f82c8;
  border-radius: calc(8 * var(--u));
  padding: 0 calc(3 * var(--u));
  background: linear-gradient(#c6e4ff, #7fb8f3);
  box-shadow:
    inset 0 calc(-1.1 * var(--u)) 0 rgba(30, 40, 110, 0.14),
    inset 0 calc(0.7 * var(--u)) 0 rgba(255, 255, 255, 0.65),
    0 calc(0.8 * var(--u)) 0 rgba(42, 58, 122, 0.28);
}
.btn.green {
  background: linear-gradient(#c4f5b0, #72d46a);
  border-color: #3f9a45;
}
.btn.yellow {
  background: linear-gradient(#fff0b0, #f7c955);
  border-color: #c79528;
}
.btn.pink {
  background: linear-gradient(#ffd0ea, #f497cb);
  border-color: #c3609a;
}
.btn img,
.btn span {
  margin: 0;
}
.btn img {
  max-height: 62%;
}
/* round button */
.rbtn {
  background: radial-gradient(circle at 50% 35%, #cfe7ff, #79b4f1 70%);
  border: calc(0.5 * var(--u)) solid #fff;
  border-radius: 50%;
  box-shadow:
    0 0 0 calc(0.4 * var(--u)) var(--ink),
    0 calc(0.8 * var(--u)) 0 calc(0.3 * var(--u)) rgba(42, 58, 122, 0.3);
  box-sizing: border-box;
}
.rbtn.red {
  background: radial-gradient(circle at 50% 35%, #ffd2cc, #f2807d 70%);
}
#ui .mapBack img {
  filter: none;
}
/* rows and counters inside the cards */
.panel .row,
.coinRow,
#settings .row {
  background: #eceefb;
  box-shadow: inset 0 0 0 calc(0.3 * var(--u)) #d6daf3;
  border: 0;
}
#clear .goals .row:nth-child(1) {
  background: #e4f0ff;
}
#clear .goals .row:nth-child(2) {
  background: #fff0e6;
}
#clear .goals .row:nth-child(3) {
  background: #e6f7ee;
}
.beanRow {
  background: #dfe3fb;
  box-shadow: inset 0 0 0 calc(0.3 * var(--u)) #cdd3f3;
}
.ico {
  background: radial-gradient(circle at 50% 35%, #cfe7ff, #79b4f1 70%);
  border-radius: 50%;
  box-shadow:
    0 0 0 calc(0.35 * var(--u)) #fff,
    0 0 0 calc(0.7 * var(--u)) var(--ink);
}
.pill {
  background: linear-gradient(#ffffff, #e9ecfb);
  border-color: #9aa6d8;
}
.count {
  background: linear-gradient(#9bcdff, #5f9ff0);
}
/* shop, upgrades, daily reward */
.card {
  background: linear-gradient(#ffffff, #f0eefb);
  border-color: var(--line);
}
.card.eq {
  border-color: #6ed4ac;
  box-shadow: 0 0 0 calc(0.5 * var(--u)) #6ed4ac;
}
.tabs .tab {
  background: linear-gradient(#c3e2ff, #79b6f2);
  border-color: var(--ink);
}
.tabs .tab.on {
  background: linear-gradient(#b5f2d6, #6ed4ac);
}
.preview {
  border-color: var(--line) !important;
  box-shadow: none !important;
}
.up {
  background: linear-gradient(#ffffff, #eeecfa);
  border-color: #c9c2ea;
  box-shadow: 0 calc(0.8 * var(--u)) 0 rgba(42, 58, 122, 0.18);
}
.up .price {
  background: linear-gradient(#c4f5b0, #72d46a);
}
.day {
  background: #eceefb;
  box-shadow: inset 0 0 0 calc(0.35 * var(--u)) #d6daf3;
}
.day.got {
  background: #dff5e8;
}
.day.today {
  background: linear-gradient(#fff0b0, #f7c955);
}
.roul {
  border-color: #fff;
}
.roul .z2 {
  background: #a9cdff;
}
.roul .z3 {
  background: #9ee6c3;
}
.roul .z4 {
  background: #ffe08a;
}
.roul .z5 {
  background: #ffa3b8;
}
#clear .coinRow .mult {
  background: linear-gradient(#e9b8ff, #c37fe8);
}
/* map: title ribbon in a blue pill */
#map .mapRibbon {
  --rw: calc(60 * var(--u));
  --rh: calc(var(--rw) / 5.4);
  top: calc(2.2 * var(--u) + env(safe-area-inset-top));
}
@media (orientation: portrait) {
  #map .mapRibbon {
    --rw: calc(60 * var(--u));
    --rh: calc(var(--rw) / 5.4);
    top: calc(15 * var(--u) + env(safe-area-inset-top));
  }
}
.panel {
  --rh: calc(var(--rw) / 4.6);
}
.ribbon {
  font-size: calc(var(--rh) * 0.52);
}
.panel {
  padding-top: calc(var(--rh) * 0.5 + 6 * var(--u));
}
/* upgrade card: price in the flow, with room from the text (previously the price sat over the description) */
.up {
  height: auto;
  padding: calc(1.2 * var(--u)) calc(1.4 * var(--u)) calc(1.4 * var(--u));
  gap: calc(0.5 * var(--u));
}
.up > img {
  height: calc(7 * var(--u));
}
.up small {
  margin-bottom: calc(0.6 * var(--u));
}
.up .price {
  position: static;
  width: 100%;
  box-sizing: border-box;
  flex: none;
  margin-top: auto;
}
@media (orientation: portrait) {
  .up {
    height: auto;
  }
}
/* shop: padlock in the top corner of the card (previously it fell over the name) */
.card .lk {
  top: calc(1 * var(--u));
  right: calc(1 * var(--u));
  bottom: auto;
  width: calc(4 * var(--u));
}
.card .nm {
  min-height: 2.1em;
  font-size: calc(3.1 * var(--u));
}
/* portrait: larger upgrade card texts */
@media (orientation: portrait) {
  .up > img {
    height: calc(9 * var(--u));
  }
  .up b {
    font-size: calc(5.4 * var(--u));
  }
  .up small {
    font-size: calc(3.9 * var(--u));
  }
  .up .price {
    height: calc(7.4 * var(--u));
    font-size: calc(4.8 * var(--u));
  }
  .up .price img {
    height: calc(5 * var(--u));
  }
  .card .nm {
    font-size: calc(3.8 * var(--u));
  }
  .card .lk {
    width: calc(5.4 * var(--u));
  }
}
/* reworked shop: ribbon the same size as the others, fits on screen, bigger beans on the cards */
#shop {
  --rw: calc(46 * var(--u));
  --py: 54%;
  max-height: 92vh;
}
#shop .shopBody {
  margin-top: 0;
  min-height: 0;
}
#ui .card canvas {
  width: auto;
  height: calc(15 * var(--u));
}
.card {
  padding: calc(0.8 * var(--u)) calc(0.8 * var(--u)) calc(1.2 * var(--u));
  gap: calc(0.4 * var(--u));
}
.card .tag {
  height: calc(5.2 * var(--u));
  font-size: calc(3.4 * var(--u));
}
@media (orientation: portrait) {
  #shop {
    --rw: calc(46 * var(--u));
    --pw: 92vw;
    max-height: 84vh;
    --py: 53%;
  }
  .tabs .tab {
    height: calc(10 * var(--u));
    font-size: calc(4.4 * var(--u));
  }
  .tabs .tab img {
    height: 60%;
  }
  #ui .card canvas {
    height: calc(20 * var(--u));
  }
  .card .tag {
    height: calc(6.6 * var(--u));
    font-size: calc(4.4 * var(--u));
  }
  .card .tag img {
    height: calc(4.6 * var(--u));
  }
  .card .nm {
    font-size: calc(4.2 * var(--u));
  }
  #shop .preview {
    height: calc(26 * var(--u));
  }
  #ui #shop .preview canvas {
    height: calc(23 * var(--u));
  }
}
@media (orientation: portrait) {
  #shop {
    --rw: calc(56 * var(--u));
  }
}
.mapPlay {
  padding-top: calc(1.2 * var(--u)) !important;
}
/* layout fixes */
@media (orientation: portrait) {
  .titleBtns {
    bottom: calc(68 * var(--u) + env(safe-area-inset-bottom));
  }
}
.tabs .tab img {
  left: 4%;
  height: 50%;
}
.tabs .tab span {
  padding: 0 calc(3 * var(--u)) 0 calc(6.6 * var(--u));
}
.hudRight .keys {
  margin-top: calc(0.6 * var(--u));
}
.prog {
  width: calc(56 * var(--u));
}
#fail .btns .btn,
#fail .btns .btn.green {
  flex: 1 1 0;
}
.ico {
  width: calc(8 * var(--u));
  height: calc(8 * var(--u));
}
#shop {
  max-height: 94vh;
}
@media (orientation: landscape) {
  #shop {
    --py: 53%;
    max-height: 90vh;
  }
}
.node.lock::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 58%;
  translate: -50% -50%;
  width: 34%;
  aspect-ratio: 1;
  background: url(../assets/img/lock-white.webp) center/contain no-repeat;
  filter: drop-shadow(0 0 2px rgba(42, 58, 122, 0.6));
}
.node.lock b {
  display: none;
}
@media (orientation: landscape) and (max-height: 500px) {
  #shop {
    --rw: calc(40 * var(--u));
    --py: 56%;
    max-height: 84vh;
  }
}
/* chest: only one image at a time (the general #ui img rule showed the closed and open ones together) */
#ui #chest .chestBox .opened,
#ui #chest.opened .chestBox .closed {
  display: none;
}
#ui #chest.opened .chestBox .opened,
#ui #chest:not(.opened) .chestBox .closed {
  display: block;
}
/* map crowd: right in the middle of the button, only bobbing up and down slowly (previously the animation removed the -50% and it drifted sideways) */
.node .me {
  left: 50%;
  top: -34%;
  translate: -50% 0;
  animation: meBob 1.6s ease-in-out infinite;
}
@keyframes meBob {
  50% {
    translate: -50% calc(-1.2 * var(--u));
  }
}
.node.cur {
  animation: none;
}

/* shortcuts between levels: upgrades and shop straight from level end and defeat (without going back to the menu) */
.quick {
  display: flex;
  gap: calc(1.6 * var(--u));
}
.quick .btn {
  flex: 1 1 0;
  height: calc(9.4 * var(--u));
  font-size: calc(4.6 * var(--u));
  min-width: 0;
}
.quick .btn img {
  height: calc(6 * var(--u));
}
#clear .quick {
  display: none;
}
#clear.done .quick {
  display: flex;
}
#upg {
  --rw: calc(54 * var(--u));
  --pw: calc(76 * var(--u));
}
#upg .ups {
  position: static;
  translate: none;
  left: auto;
  bottom: auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(2 * var(--u));
}
#upg .up {
  height: auto;
}
[data-panel='upg'] #upg {
  display: flex;
  animation: pop 0.26s cubic-bezier(0.3, 1.5, 0.5, 1);
}
[data-panel='upg'] .shopCount {
  display: flex;
}
@media (orientation: portrait) {
  #upg {
    --pw: 90vw;
  }
}
/* map crowd: right in the middle of the button, only bobbing up and down slowly */
.node .me {
  left: 50%;
  top: -34%;
  translate: -50% 0;
  animation: meBob 1.6s ease-in-out infinite;
}
@keyframes meBob {
  50% {
    translate: -50% calc(-1.2 * var(--u));
  }
}
.node.cur {
  animation: none;
}
[data-panel='upg'] #hud,
[data-panel='shop'] #hud {
  display: none;
}
/* level end in landscape: more compact to fit with the shortcuts */
@media (orientation: landscape) {
  #clear {
    --py: 52%;
    gap: calc(0.9 * var(--u));
  }
  #clear .starsRow {
    margin-top: calc(-2 * var(--u));
  }
  #clear .starsRow img {
    width: calc(9 * var(--u));
  }
  #clear .beanRow {
    font-size: calc(5.4 * var(--u));
  }
  #clear .beanRow img {
    height: calc(5 * var(--u));
  }
  #clear .goals .row {
    height: calc(4.8 * var(--u));
    font-size: calc(3.8 * var(--u));
  }
  #clear .roul {
    height: calc(6 * var(--u));
  }
  #clear .coinRow {
    font-size: calc(5 * var(--u));
  }
  #clear .coinRow b {
    font-size: calc(5.6 * var(--u));
  }
  #clear .coinRow img {
    height: calc(5 * var(--u));
  }
  #clear .quick .btn {
    height: calc(8 * var(--u));
  }
  #clear .btns .btn {
    height: calc(10 * var(--u));
  }
}
/* stars under the node: smaller and stuck to the base (previously they spilled into the next square) */
.node .nst {
  bottom: calc(-1.6 * var(--u));
}
.node .nst img {
  width: calc(3.2 * var(--u));
}

#chest:not(.opened) [data-act='collect'] {
  opacity: 0.5;
  pointer-events: none;
}

/* shop without a scrollbar: nothing overflows to the sides and, in landscape, the cards fit without scrolling */
#shop .cards {
  overflow-x: hidden;
  scrollbar-width: none;
}
#shop .cards::-webkit-scrollbar {
  display: none;
}
@media (orientation: landscape) {
  #shop .cards {
    overflow-y: hidden;
  }
  #ui #shop .card canvas {
    height: calc(11.5 * var(--u));
  }
  #shop .card {
    gap: 0;
  }
}

/* map: the crowd is small, sitting on top of the dome (does not cover the level above); nodes lower in front */
.node.cur {
  width: calc(14 * var(--u));
}
.node .me {
  width: calc(7 * var(--u));
  top: -12%;
}
/* slightly smaller nodes so they do not touch each other; on the boss the crowd sits next to the crown */
.node {
  width: calc(11.5 * var(--u));
}
.node.lock {
  width: calc(10 * var(--u));
}
.node.cur {
  width: calc(12.5 * var(--u));
}
.node.boss {
  width: calc(14 * var(--u));
}
.node b,
.node.cur b,
.node.lock b {
  font-size: calc(4.8 * var(--u));
}
.node .nst img {
  width: calc(2.8 * var(--u));
}
.node .nst {
  bottom: calc(-1.2 * var(--u));
}
.node.boss .me {
  left: -8%;
  top: 8%;
}
/* phone in landscape: the shop moves down a bit so the title ribbon fits fully at the top of the screen */
@media (orientation: landscape) and (max-height: 500px) {
  #shop {
    --py: 57%;
    max-height: 80vh;
    --rw: calc(36 * var(--u));
  }
  #ui #shop .card canvas {
    height: calc(10 * var(--u));
  }
}

/* End of src/style-game.css (complete file, part 2 of 2: this game's own layer). */
