:root {
  /* Layout: one-screen card table. Portrait stacks HUD / board / boosters; wide screens turn HUD and boosters into side rails. */
  color-scheme: dark;
  --t1: #3a2350;
  --t2: #1a0f2b;
  --b1: #e0566b;
  --b2: #b8364d;
  --txt: #fff7ef;
  --txt2: rgba(255, 247, 239, 0.72);
  --line: rgba(255, 255, 255, 0.13);
  --glass: rgba(12, 5, 24, 0.42);
  --gold: #ffc94a;
  --ink: #2b1d3d;
  --mint: #3fd6a6;
  --red: #ff5468;
  --f-display: "Baloo 2", "Fredoka", system-ui, sans-serif;
  --f-card: "Fredoka", "Nunito", system-ui, sans-serif;
  --f-body: "Nunito", "Fredoka", system-ui, sans-serif;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  overflow: hidden;
  background: var(--t2);
  color: var(--txt);
  font-family: var(--f-body);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
  touch-action: manipulation;
}
button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
svg {
  display: block;
}
#bg,
#fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#bg {
  z-index: 0;
}
#fx {
  z-index: 60;
}
#fxl {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 61;
  overflow: hidden;
}
#app {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0;
}
.screen {
  grid-area: 1/1;
  min-width: 0;
  min-height: 0;
  position: relative;
}

/* ---------- shared pieces */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 13px 0 7px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  font: 700 18px/1 var(--f-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.coin {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex: none;
  display: inline-block;
  position: relative;
  background: radial-gradient(circle at 34% 30%, #fff7c8 0 10%, #ffd84f 28%, #f2a51c 68%, #b8690a 100%);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.35),
    inset 0 -2px 0 rgba(120, 60, 0, 0.35),
    0 2px 0 rgba(0, 0, 0, 0.25);
}
.coin::after {
  content: "";
  position: absolute;
  inset: 27%;
  border-radius: 50%;
  border: 2px solid rgba(150, 82, 0, 0.45);
}
.coin.fly {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
}
.coinpill .plus {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--mint);
  margin-left: 2px;
  font-size: 0;
  color: transparent;
}
.coinpill .plus::before,
.coinpill .plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: #053d2c;
  border-radius: 2px;
  transform: translate(-50%, -50%);
}
.coinpill .plus::before {
  width: 11px;
  height: 3px;
}
.coinpill .plus::after {
  width: 3px;
  height: 11px;
}
.iconbtn {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--glass);
  border: 1px solid var(--line);
  transition: transform 0.15s var(--spring);
}
.iconbtn:active {
  transform: scale(0.9);
}
.iconbtn svg {
  width: 24px;
  height: 24px;
}
.btn {
  --c1: #62dd93;
  --c2: #1fa65a;
  --c3: #12743d;
  --bo: #0a4624;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 22px;
  border-radius: 18px;
  font: 800 21px/1 var(--f-display);
  color: #fff;
  background: linear-gradient(var(--c1), var(--c2));
  box-shadow:
    0 5px 0 var(--c3),
    0 10px 18px rgba(0, 0, 0, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.4);
  text-shadow:
    0 0.1em 0 var(--bo),
    0.065em 0.065em 0 var(--bo),
    -0.065em 0.065em 0 var(--bo),
    0.08em 0 0 var(--bo),
    -0.08em 0 0 var(--bo),
    0.055em -0.055em 0 var(--bo),
    -0.055em -0.055em 0 var(--bo),
    0 -0.065em 0 var(--bo),
    0 0.16em 0 var(--bo);
  transition:
    transform 0.1s,
    box-shadow 0.1s,
    filter 0.2s;
  position: relative;
}
.btn small {
  text-shadow:
    0 0.1em 0 var(--bo),
    0.065em 0.065em 0 var(--bo),
    -0.065em 0.065em 0 var(--bo),
    0.08em 0 0 var(--bo),
    -0.08em 0 0 var(--bo),
    0.055em -0.055em 0 var(--bo),
    -0.055em -0.055em 0 var(--bo),
    0 -0.065em 0 var(--bo),
    0 0.16em 0 var(--bo);
}
.btn.gold small,
.btn.ghost small {
  text-shadow: inherit;
}
.btn:active {
  transform: translateY(4px);
  box-shadow:
    0 1px 0 var(--c3),
    0 4px 8px rgba(0, 0, 0, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.4);
}
.btn svg {
  width: 22px;
  height: 22px;
}
.btn:not(.gold):not(.ghost) > svg,
.btn:not(.gold):not(.ghost) .pl svg {
  filter: drop-shadow(0 0.1em 0 var(--bo));
}
.btn small {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: 700 15px/1 var(--f-card);
  opacity: 0.95;
}
.btn small .coin {
  width: 20px;
  height: 20px;
}
.btn.gold {
  --c1: #ffe07a;
  --c2: #f5a623;
  --c3: #b86e0a;
  color: #5a2a00;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn.blue {
  --c1: #64b6fb;
  --c2: #2272d6;
  --c3: #164f98;
  --bo: #0b2f63;
}
.btn.purple {
  --c1: #b48cff;
  --c2: #7646e0;
  --c3: #4f28a2;
  --bo: #2e1468;
}
.btn.ghost {
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 0 0 1px var(--line);
  text-shadow: none;
  font: 700 16px/1 var(--f-card);
  min-height: 46px;
}
.btn.ghost:active {
  transform: scale(0.97);
}
.btn.wide {
  width: 100%;
}
.btn.sm {
  min-height: 38px;
  padding: 0 12px;
  font: 700 15px/1 var(--f-card);
  border-radius: 13px;
  gap: 5px;
  box-shadow:
    0 3px 0 var(--c3),
    inset 0 2px 0 rgba(255, 255, 255, 0.4);
}
.btn.sm .coin {
  width: 18px;
  height: 18px;
}
.btn.sm svg {
  width: 17px;
  height: 17px;
}
.btn[disabled] {
  filter: grayscale(0.85) brightness(0.85);
  pointer-events: none;
}

/* ---------- home */
#home {
  display: flex;
  flex-direction: column;
  padding-block: 12px 16px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.homeMain {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 4.5vh, 44px);
}
.logoWrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  --lc: clamp(58px, 14.5vmin, 112px);
}
.logoCards {
  position: relative;
  width: calc(var(--lc) * 2.7);
  height: calc(var(--lc) * 1.5);
  margin-bottom: calc(var(--lc) * -0.26);
}
.lc {
  --r: 0deg;
  position: absolute;
  left: 50%;
  bottom: 0;
  width: var(--lc);
  height: calc(var(--lc) * 1.39);
  margin-left: calc(var(--lc) * -0.5);
  border-radius: calc(var(--lc) * 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6%;
  font: 600 calc(var(--lc) * 0.18)/1 var(--f-card);
  color: var(--ink);
  background: linear-gradient(170deg, #fffdf8, #f3e6cf);
  box-shadow:
    inset 0 0 0 1px rgba(80, 50, 20, 0.12),
    0 3px 0 rgba(30, 10, 40, 0.4),
    0 14px 24px rgba(0, 0, 0, 0.35);
  transform-origin: 50% 130%;
  transform: rotate(var(--r));
  animation: lcf 4.2s ease-in-out infinite;
}
.lc1 {
  --r: -13deg;
  margin-left: calc(var(--lc) * -1.28);
}
.lc3 {
  --r: 13deg;
  margin-left: calc(var(--lc) * 0.28);
  animation-delay: -2.1s;
}
.lc2 {
  z-index: 2;
  background: linear-gradient(165deg, #fff1b0, #ffd35a 40%, #f5a524);
  color: #5b2a00;
  font-weight: 700;
  animation-delay: -1s;
}
.lc2 i {
  width: 34%;
  color: #b8650a;
}
@keyframes lcf {
  50% {
    transform: rotate(var(--r)) translateY(-7px);
  }
}
.logo {
  margin: 0;
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.9;
}
.logo .lt {
  font: 800 clamp(46px, 12.5vmin, 100px)/1 var(--f-display);
  background: linear-gradient(180deg, #fff6c9 0%, #ffd35a 42%, #f39a1e 76%, #d9700c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 #7a3500) drop-shadow(0 10px 16px rgba(0, 0, 0, 0.45));
  padding: 0 0.08em;
}
.ribbon {
  margin-top: -0.1em;
  filter: drop-shadow(0 3px 0 #8e1f33) drop-shadow(0 8px 10px rgba(0, 0, 0, 0.3));
  transform: rotate(-2.5deg);
}
.ribbon span {
  display: block;
  padding: 0.24em 1.5em 0.26em;
  font: 700 clamp(15px, 3.6vmin, 27px)/1 var(--f-card);
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: #fff;
  background: linear-gradient(#ff7a8d, #d63f58);
  clip-path: polygon(0 0, 100% 0, 94% 50%, 100% 100%, 0 100%, 6% 50%);
}
.homePanel {
  width: min(360px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.worldCard {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 13px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wcTop {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.wcLabel {
  font: 700 11px/1 var(--f-card);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--txt2);
}
.wcTop b {
  font: 700 17px/1.1 var(--f-card);
  text-align: right;
}
.dots {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}
.dots i {
  flex: 1;
  height: 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.12);
}
.dots i.done {
  background: linear-gradient(90deg, #ffd35a, #f5a524);
}
.dots i.cur {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
  animation: curDot 1.2s ease-in-out infinite;
}
@keyframes curDot {
  50% {
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.08);
  }
}
.btn.play {
  min-height: 74px;
  border-radius: 24px;
  font-size: 32px;
  gap: 14px;
  animation: breathe 2.4s ease-in-out infinite;
}
.btn.play > span:last-child {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.btn.play small {
  font-size: 14px;
  letter-spacing: 0.06em;
}
.btn.play .pl svg {
  width: 34px;
  height: 34px;
}
@keyframes breathe {
  50% {
    transform: scale(1.035);
  }
}
.btn.play:active {
  animation: none;
}
.homeRow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.htile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 4px 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  font: 700 13px/1.1 var(--f-card);
  transition: transform 0.15s var(--spring);
}
.htile:active {
  transform: scale(0.93);
}
.htile i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
}
.htile i svg {
  width: 100%;
  height: 100%;
}
.htile .dot {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 84, 104, 0.3);
  animation: curDot 1s infinite;
}
@media (min-aspect-ratio: 5/4) {
  .homeMain {
    flex-direction: row;
    gap: clamp(28px, 7vw, 110px);
  }
  .logoWrap {
    --lc: clamp(54px, 15vmin, 120px);
  }
}

/* ---------- game layout */
#game {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "hud" "board" "bar";
  gap: 8px;
  padding-block: 10px 12px;
}
#hud {
  grid-area: hud;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 3;
}
#hud .lvl {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
#hud {
  padding-inline: 4px;
}
.menuBtn {
  width: auto;
  min-width: 50px;
  height: 50px;
  padding: 0 6px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.menuBtn svg {
  width: 22px;
  height: 22px;
}
.menuBtn .ml {
  font: 700 11px/1 var(--f-card);
  letter-spacing: 0.03em;
  color: var(--txt);
}
/* portrait tablets have room in the top row for a pill; phones and the landscape side column keep icon over label */
@media (min-width: 600px) and (max-aspect-ratio: 1249/1000) {
  .menuBtn {
    flex-direction: row;
    gap: 7px;
    height: 44px;
    border-radius: 999px;
    padding: 0 15px 0 11px;
  }
  .menuBtn .ml {
    font-size: 17px;
    letter-spacing: 0;
  }
}
@media (max-width: 374px) {
  #hud {
    gap: 6px;
    padding-inline: 2px;
  }
  #hLevel {
    font-size: 19px;
  }
}
#hLevel {
  font: 800 21px/1 var(--f-display);
  white-space: nowrap;
}
#hWorld {
  font: 700 10.5px/1 var(--f-card);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--txt2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.progRow {
  display: flex;
  align-items: center;
  gap: 6px;
  width: min(150px, 100%);
}
.prog {
  flex: 1;
  height: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.prog i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ffd35a, #ff8a3d);
  border-radius: 4px;
  transition: width 0.7s var(--spring);
}
#hCats {
  font: 700 11px/1 var(--f-card);
  color: var(--txt2);
  font-style: normal;
  font-variant-numeric: tabular-nums;
}
.moves {
  padding: 0 14px 0 9px;
  transition:
    background 0.3s,
    border-color 0.3s;
}
.moves .mvi {
  width: 22px;
  height: 22px;
  opacity: 0.85;
}
.moves.low {
  background: rgba(255, 60, 90, 0.38);
  border-color: var(--red);
  animation: lowPulse 0.9s ease-in-out infinite;
}
@keyframes lowPulse {
  50% {
    box-shadow: 0 0 0 6px rgba(255, 84, 104, 0.22);
  }
}
#board {
  grid-area: board;
  position: relative;
  min-width: 0;
  min-height: 0;
  z-index: 4;
  touch-action: none;
}
#cards {
  position: absolute;
  inset: 0;
  --cw: 80px;
  --ch: 111px;
}
#bar {
  grid-area: bar;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(18px, 8vw, 46px);
  position: relative;
  z-index: 3;
  padding-top: 4px;
}
.boost {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.boost .ic {
  --c1: #7cc8ff;
  --c2: #2f86e8;
  --c3: #1d5aa6;
  width: clamp(54px, 14vw, 64px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(var(--c1), var(--c2));
  box-shadow:
    0 5px 0 var(--c3),
    0 9px 16px rgba(0, 0, 0, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.45);
  transition:
    transform 0.1s,
    box-shadow 0.1s;
}
.boost:active .ic {
  transform: translateY(4px);
  box-shadow:
    0 1px 0 var(--c3),
    0 3px 6px rgba(0, 0, 0, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.45);
}
.boost .ic svg {
  width: 52%;
  height: 52%;
}
.boost .nm {
  font: 700 12px/1 var(--f-card);
  letter-spacing: 0.04em;
  color: var(--txt2);
}
.boost .badge {
  position: absolute;
  top: -5px;
  right: -8px;
  min-width: 25px;
  height: 25px;
  padding: 0 6px;
  border-radius: 13px;
  background: #dc2449;
  border: 2px solid #fff;
  display: grid;
  place-items: center;
  font: 700 13px/1 var(--f-card);
  font-style: normal;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}
/* boosters rest while the level-1 lesson runs */
#bar.locked .boost:not(.b-restart) {
  opacity: 0.4;
  filter: grayscale(0.75);
}
#bar .boost {
  transition:
    opacity 0.4s,
    filter 0.4s;
}
.boost .badge.price {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 7px 0 3px;
  right: -18px;
  background: #2b1752;
  color: #ffe9a0;
  border-color: #ffd34d;
  font-size: 12px;
}
.boost .badge.price .coin {
  width: 16px;
  height: 16px;
}
.boost.tutOn .ic {
  animation: tutPulse 0.9s ease-in-out infinite;
}
@keyframes tutPulse {
  50% {
    transform: scale(1.13);
    box-shadow:
      0 5px 0 var(--c3),
      0 0 0 5px rgba(255, 255, 255, 0.55),
      0 0 26px 8px rgba(125, 255, 210, 0.75);
  }
}
#bar.locked .boost.tutOn {
  opacity: 1;
  filter: none;
}
.b-undo .ic {
  --c1: #c9a2ff;
  --c2: #8b5cf0;
  --c3: #5b33b0;
}
.b-joker .ic {
  --c1: #ffd96a;
  --c2: #f5a524;
  --c3: #b86e0a;
}
.boost.b-restart .ic {
  --c1: #6f5a9a;
  --c2: #4a3872;
  --c3: #2c2048;
  width: clamp(42px, min(11vw, 8vh), 60px);
  color: #e9defc;
}
.b-restart .ic svg {
  width: 48%;
  height: 48%;
}
@media not (min-aspect-ratio: 5/4) {
  #bar:has(.b-more:not([hidden])) {
    gap: clamp(10px, 4vw, 46px);
  }
}
.boost.active .ic {
  animation: boostOn 0.9s ease-in-out infinite;
}
@keyframes boostOn {
  50% {
    box-shadow:
      0 5px 0 var(--c3),
      0 0 0 8px rgba(255, 214, 90, 0.35),
      inset 0 2px 0 rgba(255, 255, 255, 0.45);
  }
}
@media (min-aspect-ratio: 5/4) {
  #game {
    grid-template-rows: minmax(0, 1fr);
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "hud board bar";
    gap: clamp(10px, 2vw, 30px);
    padding-block: 12px;
  }
  #hud {
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    width: clamp(100px, 11vw, 150px);
  }
  #hud .lvl {
    flex: none;
  }
  #hud .menuBtn {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: max-content;
  }
  #bar {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: clamp(84px, 10vw, 130px);
    gap: 22px;
    padding-top: 0;
  }
}

/* ---------- cards */
.card {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--cw);
  height: var(--ch);
  touch-action: none;
  cursor: pointer;
}
.card .sq {
  width: 100%;
  height: 100%;
  perspective: 900px;
  transition: transform 0.22s var(--spring);
}
.card .inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.44s cubic-bezier(0.3, 1.3, 0.5, 1);
}
.card.down .inner {
  transform: rotateY(180deg);
}
.face {
  position: absolute;
  inset: 0;
  border-radius: calc(var(--cw) * 0.11);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}
.front {
  color: var(--ink);
  background: linear-gradient(170deg, #fffdf8, #f4e8d3);
  box-shadow:
    inset 0 0 0 1px rgba(80, 50, 20, 0.13),
    inset 0 -3px 0 rgba(120, 80, 40, 0.1),
    0 2px 0 rgba(40, 15, 50, 0.38),
    0 5px 12px rgba(20, 5, 35, 0.3);
}
.front::before {
  content: "";
  position: absolute;
  inset: calc(var(--cw) * 0.05);
  border-radius: calc(var(--cw) * 0.075);
  border: 1px solid rgba(120, 80, 40, 0.15);
  pointer-events: none;
}
.back {
  transform: rotateY(180deg);
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.17) 0 22%, transparent 24%) 0 0 / calc(var(--cw) * 0.19)
      calc(var(--cw) * 0.19),
    linear-gradient(155deg, var(--b1), var(--b2));
  box-shadow:
    inset 0 0 0 calc(var(--cw) * 0.045) #fff6e8,
    inset 0 0 0 calc(var(--cw) * 0.065) rgba(0, 0, 0, 0.14),
    0 2px 0 rgba(40, 15, 50, 0.38),
    0 5px 12px rgba(20, 5, 35, 0.3);
}
.back::after {
  content: "";
  position: absolute;
  inset: 31% 24%;
  background: var(--linkSvg) center/contain no-repeat;
  opacity: 0.92;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.2));
}
.lbl {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 8%;
  font: 600 calc(var(--cw) * var(--fs, 0.18))/1.05 var(--f-card);
  overflow-wrap: break-word;
  letter-spacing: -0.01em;
}
.card.covered .lbl {
  display: block;
  padding: calc(var(--ch) * 0.045) 5% 0;
  font-size: min(calc(var(--cw) * var(--fc, var(--fs, 0.18))), calc(var(--ch) * 0.15));
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card.covered .lbl.two {
  white-space: normal;
  overflow-wrap: normal;
  line-height: 1;
  text-overflow: clip;
}
.card.covered.tight .lbl.two {
  white-space: nowrap;
  font-size: min(calc(var(--cw) * var(--fc1, 0.1)), calc(var(--ch) * 0.15));
  line-height: 1.15;
  text-overflow: ellipsis;
}
.card.pic .lbl {
  font-size: calc(var(--cw) * 0.5);
  line-height: 1;
}
.card.pic.covered .lbl {
  font-size: calc(var(--ch) * 0.15);
  padding-top: calc(var(--ch) * 0.035);
}
.k-c .front {
  color: #5b2a00;
  background: linear-gradient(165deg, #fff1b0, #ffd35a 40%, #f5a524);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.55),
    inset 0 -4px 0 rgba(170, 90, 0, 0.25),
    0 2px 0 rgba(90, 40, 0, 0.45),
    0 6px 14px rgba(40, 10, 0, 0.35);
}
.k-c .front::before {
  border-color: rgba(150, 80, 0, 0.28);
}
.k-c .crown {
  position: absolute;
  top: 8%;
  left: 50%;
  width: 30%;
  transform: translateX(-50%);
  color: #b8650a;
}
.k-c .lbl {
  font-weight: 700;
  padding-top: 6%;
}
.k-c .cnt {
  position: absolute;
  bottom: 7.5%;
  left: 50%;
  translate: -50% 0;
  padding: 0.12em 0.55em;
  border-radius: 99px;
  background: var(--cc, #c47a12);
  background: color-mix(in srgb, var(--cc, #c47a12) 60%, #000);
  color: #fff;
  font: 700 max(10px, calc(var(--cw) * 0.15))/1.1 var(--f-card);
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  font-variant-numeric: tabular-nums;
}
.k-c.covered .crown,
.k-c.covered .cnt {
  display: none;
}
.k-c.covered .lbl {
  padding-top: calc(var(--ch) * 0.045);
}
.card.inF .front {
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.55),
    0 0 0 3px var(--cc),
    0 2px 0 rgba(90, 40, 0, 0.45),
    0 6px 18px rgba(40, 10, 0, 0.4);
}
.card.glow .front {
  animation: catGlow 0.5s ease-in-out infinite alternate;
}
@keyframes catGlow {
  to {
    box-shadow:
      0 0 0 4px #fff,
      0 0 30px 8px var(--cc);
  }
}
.k-j .front {
  color: #fff;
  background: linear-gradient(155deg, #9a6bff, #ff5fa2 55%, #ffb347);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.5),
    0 2px 0 rgba(60, 10, 60, 0.45),
    0 6px 14px rgba(40, 0, 40, 0.35);
}
.k-j .front::before {
  border-color: rgba(255, 255, 255, 0.35);
}
.k-j .front::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.5) 50%, transparent 60%);
  animation: shine 2.6s ease-in-out infinite;
}
@keyframes shine {
  0% {
    transform: translateX(-60%);
  }
  60%,
  100% {
    transform: translateX(60%);
  }
}
.k-j .jstar {
  position: absolute;
  top: 17%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
}
.k-j .jstar svg {
  width: 46%;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.2));
}
.k-j .lbl {
  align-items: flex-end;
  padding: 0 4% 13%;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: calc(var(--cw) * var(--fs, 0.15));
  white-space: nowrap;
}
.k-j.covered .jstar {
  display: none;
}
.card.deep .back {
  box-shadow:
    inset 0 0 0 calc(var(--cw) * 0.045) #fff6e8,
    0 1px 0 rgba(40, 15, 50, 0.3);
}
.card.deep .front {
  box-shadow: 0 1px 0 rgba(40, 15, 50, 0.3);
}
.card.lifted {
  cursor: grabbing;
}
.card.lifted .sq {
  transform: scale(1.07) rotate(var(--tilt, 0deg));
}
.card.lifted .front {
  box-shadow:
    inset 0 0 0 1px rgba(80, 50, 20, 0.13),
    0 18px 30px rgba(10, 0, 25, 0.5),
    0 0 0 2px rgba(255, 255, 255, 0.5);
}
.card.hint .front {
  animation: hintGlow 0.8s ease-in-out infinite alternate;
}
@keyframes hintGlow {
  to {
    box-shadow:
      0 0 0 3px var(--mint),
      0 0 22px 6px rgba(63, 214, 166, 0.75);
  }
}
@media (hover: hover) {
  .card.mv:not(.lifted):hover .sq {
    transform: translateY(-4px);
  }
}
.slot {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--cw);
  height: var(--ch);
  border-radius: calc(var(--cw) * 0.11);
  pointer-events: none;
  z-index: 1;
}
.slot.f {
  border: 2px dashed rgba(255, 214, 120, 0.38);
  background: rgba(255, 200, 80, 0.06);
  display: grid;
  place-items: center;
  color: rgba(255, 214, 120, 0.42);
}
.slot.f svg {
  width: 40%;
}
.slot.c {
  background: rgba(0, 0, 0, 0.16);
  border: 2px solid rgba(255, 255, 255, 0.07);
}
.slot.w {
  border: 2px dashed rgba(255, 255, 255, 0.1);
}
.slot.s {
  border: 2px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.22);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.75);
  pointer-events: auto;
  cursor: pointer;
}
.slot.s svg {
  width: 44%;
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
  transition:
    opacity 0.3s,
    transform 0.5s var(--spring);
}
.slot.s.empty svg {
  opacity: 0.9;
  transform: none;
}
.slot.s.dead svg {
  opacity: 0;
}
.slot.s.hint {
  animation: hintGlow 0.8s ease-in-out infinite alternate;
}
.sbadge {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 400;
  margin: -13px 0 0 -19px;
  min-width: 38px;
  height: 26px;
  padding: 0 8px;
  border-radius: 13px;
  background: #1e1230;
  border: 2px solid rgba(255, 255, 255, 0.75);
  display: grid;
  place-items: center;
  font: 700 13px/1 var(--f-card);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}
.tglow {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--cw);
  height: var(--ch);
  border-radius: calc(var(--cw) * 0.11);
  pointer-events: none;
  z-index: 1500;
  box-shadow:
    0 0 0 3px rgba(63, 214, 166, 0.75),
    0 0 18px 3px rgba(63, 214, 166, 0.45);
  opacity: 0.5;
  transition:
    opacity 0.15s,
    box-shadow 0.15s;
}
.tglow.on {
  opacity: 1;
  box-shadow:
    0 0 0 4px #7dffd2,
    0 0 30px 8px rgba(63, 214, 166, 0.75);
}
.tglow.joker {
  box-shadow:
    0 0 0 3px rgba(255, 200, 90, 0.85),
    0 0 22px 5px rgba(255, 170, 60, 0.55);
  animation: jglow 0.8s ease-in-out infinite alternate;
}
@keyframes jglow {
  to {
    opacity: 1;
  }
}
#hand {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3500;
  pointer-events: none;
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45));
}
#hand.fix {
  position: fixed;
  z-index: 9000;
}
.lbl .cI {
  font-family: Georgia, "Noto Serif", "DejaVu Serif", serif;
  font-weight: 700;
}
#cards .card.tgt .front {
  animation: tgtGlow 0.8s ease-in-out infinite alternate;
}
@keyframes tgtGlow {
  from {
    box-shadow:
      0 0 0 2px rgba(125, 255, 210, 0.6),
      0 0 10px 2px rgba(63, 214, 166, 0.35);
  }
  to {
    box-shadow:
      0 0 0 4px #7dffd2,
      0 0 26px 8px rgba(63, 214, 166, 0.75);
  }
}
#cards .card.dropok .front {
  box-shadow:
    0 0 0 3px rgba(125, 255, 210, 0.55),
    0 0 12px 2px rgba(63, 214, 166, 0.3);
}
#cards .card.dropon .front {
  box-shadow:
    0 0 0 4px #7dffd2,
    0 0 28px 8px rgba(63, 214, 166, 0.75);
}
.card.ghost {
  pointer-events: none;
  filter: drop-shadow(0 10px 12px rgba(10, 0, 25, 0.45));
}
#coach {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(92%, 440px);
  background: #fffaf1;
  color: var(--ink);
  font: 600 15px/1.3 var(--f-card);
  padding: 10px 16px;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  z-index: 1800;
  pointer-events: none;
  text-align: center;
}
#coach.joker {
  background: linear-gradient(#ffe7a0, #ffc94a);
  color: #5b2a00;
}

/* ---------- floating fx */
.ftxt {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  font: 800 28px/1 var(--f-display);
  color: #fff;
  text-shadow:
    0 3px 0 rgba(0, 0, 0, 0.35),
    0 0 18px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  animation: ftxt 1.15s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}
.ftxt.gold {
  color: #ffd84f;
}
.ftxt.combo {
  font-size: 32px;
  color: #ffb0e0;
}
.ftxt.mint {
  color: #7dffd2;
}
@keyframes ftxt {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.4);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -70%) scale(1.18);
  }
  32% {
    transform: translate(-50%, -75%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -170%) scale(1);
  }
}
.banner {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  width: 90%;
}
.banner .bt {
  font: 800 clamp(34px, 9vmin, 64px)/1 var(--f-display);
  color: #fff;
  text-shadow:
    0 4px 0 rgba(0, 0, 0, 0.3),
    0 0 34px rgba(255, 200, 80, 0.7);
}
.banner .bn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 99px;
  background: var(--cc, #f5a524);
  font: 700 clamp(17px, 4vmin, 24px)/1 var(--f-card);
  color: #fff;
  box-shadow:
    0 4px 0 rgba(0, 0, 0, 0.25),
    0 10px 24px rgba(0, 0, 0, 0.3);
  --bo: color-mix(in srgb, var(--cc, #f5a524) 40%, #000);
  text-shadow:
    0 0.09em 0 var(--bo),
    0.06em 0.06em 0 var(--bo),
    -0.06em 0.06em 0 var(--bo),
    0.07em 0 0 var(--bo),
    -0.07em 0 0 var(--bo),
    0.05em -0.05em 0 var(--bo),
    -0.05em -0.05em 0 var(--bo),
    0 -0.06em 0 var(--bo);
}
#toasts {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: calc(100% - 32px);
}
.toast {
  background: #fffaf1;
  color: var(--ink);
  font: 600 15px/1.25 var(--f-card);
  padding: 10px 18px;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  animation: tin 0.4s var(--spring);
  text-align: center;
}
.toast.out {
  transition:
    opacity 0.3s,
    transform 0.3s;
  opacity: 0;
  transform: translateY(-10px);
}
@keyframes tin {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.9);
  }
}

/* ---------- modal sheets */
#modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
    max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: rgba(12, 5, 24, 0.62);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.sheet {
  position: relative;
  width: min(440px, 100%);
  max-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  background: linear-gradient(170deg, #3d2a5c, #221538);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 28px;
  padding: 24px 20px 20px;
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
}
.sheet h2 {
  font: 800 30px/1.05 var(--f-display);
  margin: 0;
  text-wrap: balance;
}
.sheet h3 {
  font: 700 14px/1 var(--f-card);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--txt2);
  margin: 6px 0 0;
}
.sheet .sub {
  color: var(--txt2);
  font: 700 15px/1.35 var(--f-body);
  margin: 0;
  text-wrap: balance;
}
.sheet .x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  z-index: 2;
}
.sheet .x svg {
  width: 18px;
  height: 18px;
}
.sheetCoins {
  align-self: center;
}
.slist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.srow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  text-align: left;
}
.srow > i {
  width: 26px;
  height: 26px;
  flex: none;
  opacity: 0.9;
}
.srow > span {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font: 700 16px/1.2 var(--f-card);
}
.srow small {
  font: 700 12px/1.2 var(--f-body);
  color: var(--txt2);
}
.sw {
  width: 50px;
  height: 30px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.18);
  position: relative;
  flex: none;
  transition: background 0.25s;
}
.sw::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s var(--spring);
}
.sw.on {
  background: var(--mint);
}
.sw.on::after {
  transform: translateX(20px);
}
.langs {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 52px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
}
.langs [data-icon] {
  width: 22px;
  height: 22px;
  flex: none;
  opacity: 0.9;
}
.lgsel {
  flex: 1;
  height: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  font: 700 17px/1 var(--f-card);
  padding-right: 26px;
  cursor: pointer;
  outline: none;
}
.lgsel option {
  color: #221538;
  background: #fff;
}
.langs::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
  opacity: 0.8;
}
.sbtns {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}
.sbtns .btn:only-child,
.sbtns .btn:last-child:nth-child(odd) {
  grid-column: 1/-1;
}
.sbtns .btn {
  padding: 0 10px;
  white-space: nowrap;
}
.sbtns .btn i {
  width: 20px;
  height: 20px;
}
.how {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}
.how li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}
.how p {
  margin: 0;
  font: 700 15px/1.3 var(--f-body);
}
.hv {
  --cw: 42px;
  --ch: 58px;
  flex: none;
  width: 104px;
  height: 66px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.mini {
  position: relative;
  width: var(--cw);
  height: var(--ch);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font: 600 10px/1 var(--f-card);
  color: var(--ink);
  background: linear-gradient(170deg, #fffdf8, #f4e8d3);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
  flex: none;
  text-align: center;
  padding: 2px;
}
.mini.cat {
  background: linear-gradient(165deg, #fff1b0, #ffd35a 40%, #f5a524);
  color: #5b2a00;
  font-weight: 700;
}
.mini.cat svg {
  position: absolute;
  top: 5px;
  width: 14px;
  color: #b8650a;
}
.mini.cat em {
  position: absolute;
  bottom: 4px;
  font: 700 8px/1 var(--f-card);
  background: #ff7a59;
  color: #fff;
  border-radius: 6px;
  padding: 1px 4px;
  font-style: normal;
}
.mini.slotm {
  background: rgba(255, 200, 80, 0.08);
  border: 2px dashed rgba(255, 214, 120, 0.45);
  box-shadow: none;
}
.mini.backm {
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.17) 0 22%, transparent 24%) 0 0/8px 8px,
    linear-gradient(155deg, var(--b1), var(--b2));
  box-shadow:
    inset 0 0 0 2px #fff6e8,
    0 2px 0 rgba(0, 0, 0, 0.3);
}
.mini.jok {
  background: linear-gradient(155deg, #9a6bff, #ff5fa2 55%, #ffb347);
  color: #fff;
}
.mini.jok svg {
  width: 20px;
}
.hv .arw {
  font: 800 18px/1 var(--f-card);
  color: var(--gold);
}
.hv .stk {
  position: relative;
  width: var(--cw);
  height: var(--ch);
}
.hv .stk .mini {
  position: absolute;
  left: 0;
}
.hv .stk .mini:nth-child(2) {
  top: 16px;
}
.pgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.ptile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 6px 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
}
.ptile > b {
  font: 700 17px/1 var(--f-card);
  font-variant-numeric: tabular-nums;
}
.ptile .btn {
  width: 100%;
  white-space: nowrap;
  padding: 0 6px;
  font-size: 14px;
}
.tag {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 8px;
  border-radius: 8px;
  background: #d4233f;
  font: 700 11px/1 var(--f-card);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-style: normal;
  white-space: nowrap;
}
.best .tag {
  background: #6a3fd0;
}
.pile {
  height: 40px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.pile .coin {
  width: 28px;
  height: 28px;
  margin: 0 -9px;
}
.pile .coin:nth-child(2) {
  transform: translateY(-6px);
}
.pile .coin:nth-child(4) {
  transform: translateY(-10px);
}
.bgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.btile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
}
.btile > b {
  font: 700 14px/1 var(--f-card);
}
.btile .btn {
  width: 100%;
}
.bic {
  --c1: #7cc8ff;
  --c2: #2f86e8;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(var(--c1), var(--c2));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45);
}
.bic svg {
  width: 55%;
  height: 55%;
}
.bic.b-undo {
  --c1: #c9a2ff;
  --c2: #8b5cf0;
}
.bic.b-joker {
  --c1: #ffd96a;
  --c2: #f5a524;
}
.bic.big {
  width: 84px;
  height: 84px;
  align-self: center;
}
.dgrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.dtile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 4px 9px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 2px solid transparent;
}
.dtile small {
  font: 700 11px/1 var(--f-card);
  color: var(--txt2);
}
.dtile b {
  font: 700 13px/1 var(--f-card);
}
.dtile .drw {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.dtile .drw .coin {
  width: 24px;
  height: 24px;
}
.dtile .drw .bic {
  width: 30px;
  height: 30px;
}
.dtile.big {
  grid-column: span 2;
  background: rgba(255, 201, 74, 0.12);
}
.dtile.today {
  border-color: var(--gold);
  background: rgba(255, 201, 74, 0.18);
  animation: todayP 1.2s ease-in-out infinite;
}
@keyframes todayP {
  50% {
    box-shadow: 0 0 0 5px rgba(255, 201, 74, 0.18);
  }
}
.dtile.done {
  opacity: 0.55;
}
.dtile .chk {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--mint);
  display: grid;
  place-items: center;
}
.dtile .chk svg {
  width: 12px;
  height: 12px;
}
.win {
  padding-top: 30px;
  overflow: visible;
}
.ribbonTitle {
  align-self: center;
  margin-top: -50px;
  filter: drop-shadow(0 4px 0 #8e1f33) drop-shadow(0 10px 14px rgba(0, 0, 0, 0.35));
}
.ribbonTitle span {
  display: block;
  padding: 12px 40px 14px;
  font: 800 clamp(22px, 6vw, 30px)/1 var(--f-display);
  color: #fff;
  background: linear-gradient(#ff7a8d, #d63f58);
  clip-path: polygon(0 0, 100% 0, 95% 50%, 100% 100%, 0 100%, 5% 50%);
  white-space: nowrap;
}
.stars {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 4px;
  margin: 6px 0 0;
  height: 96px;
}
.st {
  width: 70px;
  height: 70px;
  color: rgba(0, 0, 0, 0.35);
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.25));
  transition: color 0.2s;
}
.st.s1 {
  width: 92px;
  height: 92px;
  margin-bottom: 12px;
}
.st svg {
  width: 100%;
  height: 100%;
}
.st.on {
  color: #ffd84f;
  animation: starIn 0.55s var(--spring);
}
@keyframes starIn {
  0% {
    transform: scale(2.4) rotate(-30deg);
    opacity: 0;
  }
  100% {
    transform: none;
    opacity: 1;
  }
}
.reward {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.28);
  font: 800 26px/1 var(--f-display);
}
.reward .coin {
  width: 30px;
  height: 30px;
}
.wbtns {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 4px;
}
.bigic {
  width: 84px;
  height: 84px;
  align-self: center;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(#ff8a9b, #e0405a);
  box-shadow:
    0 5px 0 #8e1f33,
    inset 0 2px 0 rgba(255, 255, 255, 0.4);
}
.bigic svg {
  width: 46px;
  height: 46px;
}
.bigic.amber {
  background: linear-gradient(#ffd96a, #f5a524);
  box-shadow:
    0 5px 0 #b86e0a,
    inset 0 2px 0 rgba(255, 255, 255, 0.4);
}
.spin {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 5px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--gold);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.loadOv {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(12, 5, 24, 0.74);
}
.loadOv p {
  margin: 0;
  font: 700 16px/1.2 var(--f-card);
  color: #fff;
  text-align: center;
  padding: 0 24px;
}
#ad {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: #0c0716;
  display: grid;
  place-items: center;
  padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px));
}
.adbox {
  width: min(480px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.adhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: 700 13px/1 var(--f-card);
  color: var(--txt2);
}
.adtag {
  padding: 4px 8px;
  border-radius: 6px;
  background: #ffc94a;
  color: #3a1d00;
}
.adart {
  aspect-ratio: 16/10;
  max-width: 100%;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #2f86e8, #8b5cf0 50%, #ff5fa2);
  background-size: 200% 200%;
  animation: adbg 3s ease-in-out infinite alternate;
  text-align: center;
  padding: 16px;
}
.adart b {
  font: 800 34px/1 var(--f-display);
}
.adart p {
  margin: 0;
  font: 700 15px/1.3 var(--f-body);
  opacity: 0.9;
}
@keyframes adbg {
  to {
    background-position: 100% 100%;
  }
}
.adskip {
  align-self: flex-end;
}
@media (min-width: 1100px) and (min-height: 720px) {
  .pill {
    height: 50px;
    font-size: 23px;
    padding: 0 17px 0 8px;
  }
  .pill .coin {
    width: 34px;
    height: 34px;
  }
  .moves .mvi {
    width: 28px;
    height: 28px;
  }
  .iconbtn {
    width: 54px;
    height: 54px;
    border-radius: 17px;
  }
  .iconbtn svg {
    width: 28px;
    height: 28px;
  }
  .menuBtn {
    flex-direction: column;
    min-width: 64px;
    height: 64px;
    padding: 0 8px;
    gap: 5px;
    border-radius: 19px;
  }
  .menuBtn svg {
    width: 28px;
    height: 28px;
  }
  .menuBtn .ml {
    font-size: 13.5px;
    letter-spacing: 0.03em;
  }
  #hLevel {
    font-size: 32px;
  }
  #hWorld {
    font-size: 12.5px;
  }
  .progRow {
    width: min(170px, 100%);
  }
  .boost .ic {
    width: 80px;
  }
  .boost .nm {
    font-size: 15px;
  }
  .boost .badge {
    min-width: 30px;
    height: 30px;
    font-size: 15px;
  }
  #coach {
    font-size: 18px;
    padding: 12px 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .btn.play,
  .lc,
  .dots i.cur,
  .k-j .front::after {
    animation: none;
  }
}
body.calm .btn.play,
body.calm .lc,
body.calm .k-j .front::after {
  animation: none;
}

#coach.joker {
  background: none;
}
.ftxt.warn {
  color: #ff9aa8;
  font-size: 22px;
}
.cmbTxt {
  font-size: clamp(15px, 4.8vw, 20px);
}
@media (min-aspect-ratio: 5/4) {
  .cmbTxt {
    font-size: clamp(14px, 1.6vw, 22px);
  }
}
.chal .mascRow .masc {
  --ms: 64px;
}
.chal .mascRow .bub {
  font-size: 14px;
}
.sheet.chal {
  gap: 10px;
}
/* End of css/base.css */
