/* ---------- generated art (assets/game). Every rule is scoped to html.art so the code-drawn look stays as fallback when the files are missing. */
#artBg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  display: none;
}
.art #artBg {
  display: block;
}
#artBg > i {
  position: absolute;
  inset: 0;
  background: center/cover no-repeat;
  opacity: 0;
  transition: opacity 0.7s ease;
}
#artBg .ab-home {
  inset: -4%;
  background-image: url(../assets/game/bg-home.webp);
  animation: kenB 34s ease-in-out infinite alternate;
}
#artBg .ab-home::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    70% 55% at 50% 55%,
    rgba(26, 12, 40, 0.5),
    rgba(26, 12, 40, 0.15) 70%,
    rgba(10, 4, 20, 0.55)
  );
}
#artBg .ab-w {
  transform: scale(1.06);
}
#artBg .ab-w::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(14, 6, 26, var(--abDim, 0.42));
}
body[data-scr="home"] #artBg .ab-home {
  opacity: 1;
}
body[data-scr="map"] #artBg .ab-w.on,
body[data-scr="game"] #artBg .ab-w.on {
  opacity: 1;
}
body[data-scr="game"] #artBg {
  --abDim: 0.5;
}
@keyframes kenB {
  0% {
    transform: scale(1) translate(0, 0);
  }
  100% {
    transform: scale(1.07) translate(-1.2%, 1%);
  }
}

/* logo */
.logoArt {
  display: none;
}
.art .logoArt {
  display: block;
  position: relative;
  width: min(88vw, 430px, 52vh);
  aspect-ratio: 900/611;
  cursor: pointer;
  animation: logoIn 0.9s var(--spring) both;
}
.art .logoArt > img {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.5));
  animation: logoF 4.2s ease-in-out 0.9s infinite;
  transform-origin: 50% 80%;
}
.art .logoArt .shine {
  position: absolute;
  inset: 0;
  overflow: hidden;
  -webkit-mask: url(../assets/game/logo.webp) center/100% 100% no-repeat;
  mask: url(../assets/game/logo.webp) center/100% 100% no-repeat;
  animation: logoF 4.2s ease-in-out 0.9s infinite;
  transform-origin: 50% 80%;
  pointer-events: none;
}
.art .logoArt .shine::before {
  content: "";
  position: absolute;
  top: -10%;
  bottom: -10%;
  width: 34%;
  left: 0;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.75) 50%, transparent);
  transform: translateX(-120%) skewX(-12deg);
  animation: shine 5.5s ease-in-out 1.4s infinite;
}
.art.nomask .logoArt .shine {
  display: none;
}
.art .logoCards {
  display: none;
}
.art .logo {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
@keyframes logoIn {
  0% {
    opacity: 0;
    transform: translateY(-40px) scale(0.6);
  }
  60% {
    opacity: 1;
  }
  100% {
    transform: none;
  }
}
@keyframes logoF {
  50% {
    transform: translateY(-6px) rotate(-0.6deg);
  }
}
@keyframes shine {
  0% {
    transform: translateX(-120%) skewX(-12deg);
  }
  28%,
  100% {
    transform: translateX(400%) skewX(-12deg);
  }
}
@media (min-aspect-ratio: 5/4) {
  .art .logoArt {
    width: min(40vw, 560px, 74vh);
  }
}
/* portrait: the logo takes whatever height is left, and the panel keeps a clear band above it for Linky */
@media not (min-aspect-ratio: 5/4) {
  .art .homeMain {
    justify-content: flex-start;
    gap: 18px;
  }
  .art .logoWrap {
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    justify-content: center;
    padding-top: 8px;
  }
  .art .logoArt {
    width: auto;
    height: min(100%, calc(min(88vw, 430px) / 1.473));
    max-width: min(88vw, 430px);
  }
  .art .homePanel {
    margin-top: clamp(76px, 9vh, 100px);
  }
}
@media (max-height: 500px) and (min-aspect-ratio: 5/4) {
  .art .logoArt {
    width: min(40vw, 72vh);
  }
}

/* coin */
.art .coin {
  background: url(../assets/game/coin.webp) center/100% 100% no-repeat;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 1.5px 1px rgba(60, 20, 0, 0.35));
}
.art .coin::after {
  display: none;
}
.art .coinpill > .coin {
  animation: coinFlip 7s ease-in-out 2s infinite;
}
@keyframes coinFlip {
  0%,
  88% {
    transform: none;
  }
  94% {
    transform: scaleX(-1) scale(1.12);
  }
  100% {
    transform: none;
  }
}

/* home tiles */
.art .htile i {
  width: 52px;
  height: 52px;
  margin: -6px 0 -2px;
  background: center/contain no-repeat;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.3));
  animation: tileB 3.6s ease-in-out infinite;
}
.art .htile i svg {
  display: none;
}
.art .htile[data-act="daily"] i {
  background-image: url(../assets/game/gift-closed.webp);
}
.art .htile[data-act="chal"] i {
  background-image: url(../assets/game/tile-challenge.webp);
  animation-delay: -0.9s;
}
.art .htile[data-act="shop"] i {
  background-image: url(../assets/game/tile-shop.webp);
  animation-delay: -1.8s;
}
.art .htile[data-act="daily"]:has(.dot:not([hidden])) i {
  animation: giftWig 2.2s ease-in-out infinite;
}
.art .htile {
  background: rgba(20, 8, 36, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.art .worldCard {
  background: rgba(20, 8, 36, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
@keyframes tileB {
  50% {
    transform: translateY(-3px);
  }
}
@keyframes giftWig {
  0%,
  55%,
  100% {
    transform: none;
  }
  62% {
    transform: rotate(-10deg) scale(1.08);
  }
  70% {
    transform: rotate(9deg) scale(1.1);
  }
  78% {
    transform: rotate(-6deg) scale(1.06);
  }
  86% {
    transform: rotate(3deg);
  }
}
@media (min-width: 1100px) and (min-height: 720px) {
  .art .htile i {
    width: 62px;
    height: 62px;
  }
}
@media (max-height: 500px) {
  .art .htile i {
    width: 40px;
    height: 40px;
    margin: -4px 0 -2px;
  }
}

/* boosters: generated icon on top of the colored button */
.art .boost:not(.b-more) .ic svg,
.art .bic svg {
  display: none;
}
.art .boost:not(.b-more) .ic::before,
.art .bic::before {
  content: "";
  width: 72%;
  height: 72%;
  background: var(--bimg) center/contain no-repeat;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.28));
}
.art .b-hint {
  --bimg: url(../assets/game/hint.webp);
}
.art .b-undo {
  --bimg: url(../assets/game/undo.webp);
}
.art .b-joker {
  --bimg: url(../assets/game/joker.webp);
}
.art .b-restart {
  --bimg: url(../assets/game/restart.webp);
}
.art .boost.b-restart .ic::before {
  width: 66%;
  height: 66%;
}
.art .b-joker .ic,
.art .bic.b-joker {
  --c1: #ff9ad0;
  --c2: #d9479a;
  --c3: #8e1f62;
}
.art .bic::before {
  width: 80%;
  height: 80%;
}
.art .boost.active .ic::before {
  animation: icoPulse 0.9s ease-in-out infinite;
}
@keyframes icoPulse {
  50% {
    transform: scale(1.14) rotate(-6deg);
  }
}
.art .bimg {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: none;
  background: var(--bimg) center/contain no-repeat;
}

/* win stars + map node stars */
.art .st svg,
.art .node .ns svg {
  display: none;
}
.art .st {
  background: url(../assets/game/star.webp) center/contain no-repeat;
  filter: grayscale(1) brightness(0.32) opacity(0.75);
}
.art .st.on {
  filter: drop-shadow(0 4px 6px rgba(120, 60, 0, 0.45));
}
.art .node .ns i {
  background: url(../assets/game/star.webp) center/contain no-repeat;
  filter: grayscale(1) brightness(0.35);
  width: 17px;
  height: 17px;
}
.art .node .ns i.on {
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5));
}

/* map: one painted backdrop per world */
.wimg {
  position: absolute;
  inset: 0;
  background: center/cover no-repeat;
  pointer-events: none;
}
.wimg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    rgba(10, 4, 20, 0.25),
    rgba(10, 4, 20, 0) 20%,
    rgba(10, 4, 20, 0) 80%,
    rgba(10, 4, 20, 0.35)
  );
}
.art .wblk {
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.16),
    0 14px 34px rgba(0, 0, 0, 0.5);
}
.art .wblk svg.path polyline:first-child {
  stroke: rgba(20, 8, 30, 0.42);
}
.art .wsign {
  background: rgba(10, 4, 22, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* shop */
.art .pile {
  height: 64px;
  align-items: center;
}
.art .pile > .coin:only-child {
  width: 46px;
  height: 46px;
}
.art .starter li .bimg {
  width: 16px;
  height: 16px;
}

/* daily gift */
.dhead {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.giftArt {
  width: 74px;
  height: 74px;
  flex: none;
  position: relative;
  display: none;
}
.art .giftArt {
  display: block;
}
.giftArt img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.4));
}
.giftArt.shake img {
  animation: giftWig 1.6s ease-in-out infinite;
}
.giftArt.pop img {
  animation: giftPop 0.7s var(--spring);
}
@keyframes giftPop {
  0% {
    transform: scale(0.4) rotate(-14deg);
  }
  100% {
    transform: none;
  }
}
@media (max-height: 500px) {
  .giftArt {
    width: 44px;
    height: 44px;
    margin-block: -10px;
  }
}

.art body.calm .logoArt,
.art body.calm .logoArt > img,
.art body.calm .logoArt .shine,
.art body.calm .logoArt .shine::before,
.art body.calm .htile i,
.art body.calm #artBg .ab-home,
.art body.calm .coinpill > .coin,
.art body.calm .giftArt img,
.art body.calm .ptile.best .pk {
  animation: none !important;
}
@media (max-height: 500px) {
  .dtile {
    padding: 6px 4px;
    gap: 3px;
  }
  .dtile .drw {
    height: 28px;
  }
}

/* picture cards drawn with WebP art instead of emoji */
.card.pic .lbl .cimg {
  display: block;
  width: 78%;
  height: 68%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 calc(var(--cw) * 0.015) calc(var(--cw) * 0.02) rgba(60, 30, 10, 0.25));
}
.card.pic.covered .lbl {
  padding-top: calc(var(--ch) * 0.022);
}
.card.pic.covered .lbl .cimg {
  width: 88%;
  height: calc(var(--ch) * 0.19);
  margin: 0 auto;
}
/* End of css/art.css */
