﻿/* ============================================================
   Hero Loot Vault вЂ” styles
   ============================================================ */

:root {
  --c-common: #eef4ff;
  --c-rare:   #4ad36a;
  --c-epic:   #57a3ff;
  --c-mythic: #8b63ff;
  --c-gold:   #ffd84a;
  --c-legend: #ff5136;
  --bg-1: #ff6a3d;
  --bg-2: #ff2e63;
  --bg-3: #5a189a;
  --gold: #ffc94d;
  --gem:  #4ade80;
  --ink:  #1b1b3a;
  --ui-panel-top: rgba(29, 32, 40, 0.96);
  --ui-panel-bottom: rgba(9, 11, 16, 0.98);
  --ui-panel-soft-top: rgba(24, 26, 34, 0.96);
  --ui-panel-soft-bottom: rgba(10, 12, 17, 0.98);
  --ui-border: rgba(255, 129, 76, 0.18);
  --ui-border-strong: rgba(255, 138, 85, 0.40);
  --ui-text: #f6efeb;
  --ui-text-dim: #d0c2be;
  --ui-alert-1: #ffd3b4;
  --ui-alert-2: #ff824a;
  --ui-alert-3: #5b170f;
  --ui-glow: rgba(255, 104, 46, 0.28);
  --ui-glow-strong: rgba(255, 104, 46, 0.42);
  --page-bg-desktop: none;
  --page-bg-mobile: none;
  --page-bg-current: var(--page-bg-desktop);
  --page-bg-position: center center;
  --mini-bg-desktop: none;
  --mini-bg-mobile: none;
  --mini-stage-bg-desktop: none;
  --mini-stage-bg-mobile: none;
  --boss-bg-desktop: none;
  --boss-bg-mobile: none;
  --boss-arena-bg-desktop: none;
  --boss-arena-bg-mobile: none;
  --pass-bg-rewards-desktop: none;
  --pass-bg-rewards-mobile: none;
  --pass-bg-quests-desktop: none;
  --pass-bg-quests-mobile: none;
  --shop-bg-desktop: none;
  --shop-bg-mobile: none;
  --pass-ticket-image: none;
  --currency-coin-image: none;
  --currency-crystal-image: none;
  --currency-power-image: none;
  --yandex-debug-top-inset: 0px;
  --yandex-debug-right-inset: 0px;
  --yandex-debug-bottom-inset: 0px;
  --yandex-debug-left-inset: 0px;
  --yandex-debug-safe-width: calc(100vw - var(--yandex-debug-left-inset) - var(--yandex-debug-right-inset));
  --yandex-debug-safe-height: calc(100dvh - var(--yandex-debug-top-inset) - var(--yandex-debug-bottom-inset));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  font-family: 'Trebuchet MS', system-ui, sans-serif;
  color: var(--ui-text);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
img {
  -webkit-user-drag: none;
}
#app,
#app img,
#app svg,
#app canvas,
#app button,
#app a,
#app [role="button"] {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#app img,
#app svg,
#app canvas {
  -webkit-user-drag: none;
}

input,
textarea,
select,
[contenteditable="true"] {
  user-select: auto;
  -webkit-user-select: auto;
  -webkit-touch-callout: default;
}

body {
  background-color: #05070d;
  background-image:
    linear-gradient(180deg, rgba(4, 8, 15, 0.78) 0%, rgba(7, 11, 18, 0.56) 36%, rgba(2, 4, 8, 0.84) 100%),
    var(--page-bg-current);
  background-position: center center, var(--page-bg-position);
  background-repeat: no-repeat, no-repeat;
  background-size: cover, cover;
  background-attachment: fixed, fixed;
}
body.ad-paused #app {
  pointer-events: none;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 50% 18%, rgba(118, 39, 33, 0.18), transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(0, 0, 0, 0.46), transparent 42%);
}

#yandexDebugChrome {
  position: fixed;
  inset: 0;
  display: none;
  pointer-events: none;
  z-index: 1700;
}

html[data-yandex-debug-boot="mock"] #yandexDebugChrome,
body.yandex-debug-ads-mock #yandexDebugChrome {
  display: block;
}

#yandexDebugChrome::before {
  content: "";
  position: absolute;
  left: var(--yandex-debug-left-inset);
  top: var(--yandex-debug-top-inset);
  width: var(--yandex-debug-safe-width);
  height: var(--yandex-debug-safe-height);
  border: 2px dashed rgba(112, 238, 190, 0.86);
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(112, 238, 190, 0.26);
}

.yandex-debug-shell__safe-label,
.yandex-debug-shell__safe-note {
  display: none;
}

.yandex-debug-shell__desktop,
.yandex-debug-shell__bottom {
  position: absolute;
}

.yandex-debug-shell__desktop {
  top: 0;
  right: 0;
  bottom: var(--yandex-debug-bottom-inset);
  width: var(--yandex-debug-right-inset);
  pointer-events: auto;
}

.yandex-debug-shell__right {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 12px 12px 6px;
  background:
    linear-gradient(180deg, rgba(15, 18, 28, 0.98), rgba(6, 8, 14, 0.98));
  box-shadow: inset 1px 0 0 rgba(255,255,255,.06);
}

.yandex-debug-shell__panel {
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.1);
  background: linear-gradient(180deg, rgba(114, 86, 255, 0.98), rgba(128, 72, 255, 0.94));
  color: #fff;
  text-align: center;
  cursor: pointer;
}

.yandex-debug-shell__panel--cta {
  min-height: 46px;
  display: grid;
  place-items: center;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 1000;
}

.yandex-debug-shell__panel--ad {
  flex: 1 1 auto;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px 14px;
  overflow: hidden;
  position: relative;
}

.yandex-debug-shell__panel--ad::before {
  content: "";
  min-height: 160px;
  border-radius: 18px;
  display: block;
  background:
    radial-gradient(circle at 74% 22%, rgba(255, 220, 94, 0.92), transparent 18%),
    radial-gradient(circle at 20% 78%, rgba(94, 223, 255, 0.82), transparent 20%),
    linear-gradient(135deg, rgba(255, 154, 88, 0.88), rgba(102, 77, 255, 0.94) 60%, rgba(35, 16, 79, 0.98));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}

.yandex-debug-shell__panel--ad::after {
  content: "AD";
  position: absolute;
  top: 30px;
  right: 26px;
  min-width: 40px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(9, 12, 22, 0.84);
  border: 1px solid rgba(255,255,255,.16);
  color: #fff;
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: .14em;
}

.yandex-debug-shell__brand {
  font-size: 18px;
  font-weight: 1000;
  letter-spacing: .03em;
}

.yandex-debug-shell__title {
  font-size: 18px;
  font-weight: 1000;
  line-height: 1.15;
}

.yandex-debug-shell__copy {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.yandex-debug-shell__button {
  margin-top: auto;
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255,255,255,.22);
  font-size: 13px;
  font-weight: 1000;
  cursor: pointer;
  border: 0;
  color: #fff;
}

.yandex-debug-shell__bottom {
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--yandex-debug-bottom-inset);
  padding: 8px 10px 10px;
  background:
    linear-gradient(180deg, rgba(10, 12, 18, 0.94), rgba(6, 8, 14, 0.98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  pointer-events: auto;
}

.yandex-debug-shell__carousel {
  display: grid;
  grid-template-columns: repeat(6, minmax(72px, 1fr)) minmax(112px, 148px);
  gap: 8px;
  height: 100%;
  align-items: stretch;
}

.yandex-debug-shell__tile,
.yandex-debug-shell__more {
  min-width: 0;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 1000;
  text-align: center;
  line-height: 1.08;
  cursor: pointer;
  appearance: none;
  border: 1px solid rgba(255,255,255,.08);
}

.yandex-debug-shell__tile {
  position: relative;
  align-content: end;
  padding: 10px 6px;
  background:
    linear-gradient(180deg, rgba(89, 157, 255, 0.36), rgba(255, 184, 86, 0.26)),
    linear-gradient(180deg, rgba(48, 54, 74, 0.98), rgba(14, 18, 28, 0.98));
  color: #fff4ef;
  font-size: 12px;
}

.yandex-debug-shell__tile::before {
  content: "";
  position: absolute;
  inset: 8px 8px 32px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 24% 26%, rgba(255,255,255,.62), transparent 18%),
    linear-gradient(135deg, rgba(255, 201, 88, 0.82), rgba(89, 157, 255, 0.88) 55%, rgba(127, 73, 255, 0.9));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}

.yandex-debug-shell__tile > * {
  position: relative;
  z-index: 1;
}

.yandex-debug-shell__more {
  background: linear-gradient(180deg, rgba(70, 74, 88, 0.98), rgba(48, 50, 60, 0.98));
  color: #fff;
  font-size: 14px;
}

html[data-yandex-debug-boot-layout="bottom"] #yandexDebugChrome::before,
body.yandex-debug-ads-bottom-only #yandexDebugChrome::before {
  border-radius: 18px 18px 0 0;
}

html[data-yandex-debug-boot-layout="bottom"] .yandex-debug-shell__desktop,
body.yandex-debug-ads-bottom-only .yandex-debug-shell__desktop {
  display: none;
}

body.yandex-debug-ads-bottom-only .yandex-debug-shell__safe-label,
body.yandex-debug-ads-bottom-only .yandex-debug-shell__safe-note {
  left: 12px;
}

body.yandex-debug-ads-bottom-only .yandex-debug-shell__safe-label {
  top: 12px;
}

body.yandex-debug-ads-bottom-only .yandex-debug-shell__safe-note {
  top: 50px;
  max-width: min(280px, calc(100vw - 24px));
}

@media (max-width: 900px) {
  .yandex-debug-shell__carousel {
    grid-template-columns: repeat(4, minmax(72px, 1fr)) minmax(112px, 132px);
  }
}

@media (max-width: 640px) {
  .yandex-debug-shell__safe-label {
    padding: 7px 10px;
    font-size: 10px;
  }

  .yandex-debug-shell__safe-note {
    max-width: min(250px, calc(100vw - 24px));
    font-size: 9px;
  }

  .yandex-debug-shell__bottom {
    padding: 8px 8px 10px;
  }

  .yandex-debug-shell__carousel {
    grid-template-columns: repeat(4, minmax(58px, 1fr)) minmax(86px, 108px);
    gap: 6px;
  }

  .yandex-debug-shell__tile,
  .yandex-debug-shell__more {
    border-radius: 12px;
  }

  .yandex-debug-shell__tile {
    font-size: 10px;
  }

  .yandex-debug-shell__more {
    font-size: 12px;
  }
}

#appMain {
  position: relative;
  width: 100vw;
  height: 100dvh;
  min-height: 100svh;
  padding:
    var(--yandex-debug-top-inset)
    var(--yandex-debug-right-inset)
    var(--yandex-debug-bottom-inset)
    var(--yandex-debug-left-inset);
  box-sizing: border-box;
  overflow: hidden;
  z-index: 1;
}

@media (max-width: 768px) and (orientation: portrait) {
  :root {
    --page-bg-current: var(--page-bg-mobile);
    --page-bg-position: center top;
  }

  body {
    background-attachment: scroll, scroll;
  }
}

#app {
  position: relative; width: 100%; height: 100%; min-height: 0; max-width: 100%; max-height: 100%;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
}

.seo-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.screen {
  position: absolute; inset: 0;
  display: none; flex-direction: column;
  padding: 14px;
  min-width: 0;
  min-height: 0;
}
.screen:not(.active) { display: none !important; }
.screen.active { display: flex; }
#lobby {
  container-type: inline-size;
}

body.yandex-debug-ads-active #appMain {
  transition: padding .18s ease-out;
}

body.yandex-debug-ads-active #lobby,
body.yandex-debug-ads-active #heroes,
body.yandex-debug-ads-active #heroDetail,
body.yandex-debug-ads-active #shop,
body.yandex-debug-ads-active #pass,
body.yandex-debug-ads-active #mini,
body.yandex-debug-ads-active #mini-crit,
body.yandex-debug-ads-active #mini-wheel,
body.yandex-debug-ads-active #mini-mem,
body.yandex-debug-ads-active #mini-signal,
body.yandex-debug-ads-active #mini-wall,
body.yandex-debug-ads-active #boss,
body.yandex-debug-ads-active #bossArena,
body.yandex-debug-ads-active #trophyRoad,
body.yandex-debug-ads-active #profile,
body.yandex-debug-ads-active #leaderProfile {
  min-height: 100%;
  height: 100%;
  max-height: 100%;
}

/* ----- Pills & HUD ----- */
.top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px; align-items: center;
}
#lobby .top {
  container-type: inline-size;
}
#lobby .top > * {
  min-width: 0;
}
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(180deg, var(--ui-panel-top), var(--ui-panel-bottom));
  border: 1px solid var(--ui-border);
  border-radius: 18px;
  padding: 8px 14px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 10px 28px rgba(0,0,0,.28);
}
.pill .val  { font-size: 18px; letter-spacing: .08em; }

.player-pill {
  background: linear-gradient(180deg, rgba(35, 38, 48, 0.98), rgba(10, 13, 18, 0.98));
  padding: 8px 16px 8px 72px;
  position: relative;
  min-width: 140px;
  border-color: rgba(255, 131, 78, 0.24);
  overflow: visible;
}
.player-pill .avatar {
  --avatar-accent: #ff824a;
  position: absolute; left: -10px; top: -10px;
  width: 64px; height: 64px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(38, 41, 52, 0.98), rgba(14, 17, 24, 0.98));
  border: 1px solid rgba(255, 141, 88, 0.28);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 18px rgba(255, 106, 50, 0.18), 0 8px 18px rgba(0,0,0,.34);
  overflow: hidden;
}
.player-pill .avatar-ring {
  position: absolute;
  inset: 5px;
  border-radius: 11px;
  border: 1px solid var(--avatar-accent);
  box-shadow: 0 0 14px rgba(255, 104, 46, 0.18);
}
.player-pill .avatar-glyph {
  position: relative;
  z-index: 1;
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(255, 125, 68, 0.24));
}
.player-pill .avatar-art {
  position: relative;
  z-index: 1;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  object-fit: contain;
  object-position: center top;
  transform: scale(1.02);
  transform-origin: center top;
  filter: drop-shadow(0 0 8px rgba(255, 125, 68, 0.22));
}
.player-pill .nm { font-size: 13px; opacity: .82; color: var(--ui-text-dim); letter-spacing: .08em; text-transform: uppercase; }
.player-pill .lv { font-size: 18px; font-weight: 900; display: inline-flex; align-items: center; gap: 8px; letter-spacing: .08em; }
.lobby-heroes-pill {
  display: none;
}
.currencies { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; min-width: 0; }
.menu-right { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.currency-pill {
  min-width: 102px;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}
.currency-pill .val {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-icon,
.ui-glyph {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
}
.hud-icon {
  width: 18px;
  height: 18px;
}
.hud-icon.coin,
.hud-icon.gem {
  width: 26px;
  height: 26px;
}
.currency-pill .hud-icon.coin,
.currency-pill .hud-icon.gem {
  width: 50px;
  height: 50px;
}
.ui-glyph {
  width: 20px;
  height: 20px;
}
.hud-icon::before,
.hud-icon::after,
.ui-glyph::before,
.ui-glyph::after {
  content: "";
  position: absolute;
}

.hud-icon.coin::before {
  inset: 1px;
  border-radius: 50%;
  border: 2px solid var(--ui-alert-2);
  background: radial-gradient(circle at 35% 35%, rgba(255, 214, 186, 0.34), rgba(255, 103, 40, 0.08));
  box-shadow: 0 0 12px var(--ui-glow), inset 0 0 10px rgba(255, 130, 74, 0.16);
}
.hud-icon.coin::after {
  top: 4px;
  bottom: 4px;
  left: 7px;
  right: 7px;
  border-left: 2px solid rgba(255, 236, 221, 0.9);
  border-right: 2px solid rgba(255, 236, 221, 0.9);
  border-radius: 999px;
}
.hud-icon.gem::before {
  inset: 1px 3px 2px;
  clip-path: polygon(50% 0%, 90% 35%, 72% 100%, 28% 100%, 10% 35%);
  background: linear-gradient(180deg, rgba(255, 215, 190, 0.96), rgba(255, 96, 34, 0.34));
  box-shadow: 0 0 12px var(--ui-glow);
}
.hud-icon.gem::after {
  inset: 5px 6px 7px;
  clip-path: polygon(50% 0%, 84% 35%, 66% 100%, 34% 100%, 16% 35%);
  background: rgba(255,255,255,.24);
}
.hud-icon.trophy::before {
  left: 4px;
  right: 4px;
  top: 2px;
  height: 8px;
  border: 2px solid var(--ui-alert-2);
  border-bottom: 0;
  border-radius: 4px 4px 8px 8px;
  box-shadow: 0 0 10px rgba(255, 112, 49, 0.18);
}
.hud-icon.trophy::after {
  left: 8px;
  right: 8px;
  top: 11px;
  bottom: 1px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--ui-alert-1), var(--ui-alert-2));
}
.hud-icon.gear::before {
  inset: 0;
  clip-path: polygon(
    38% 0%, 62% 0%,
    66% 10%, 78% 6%,
    86% 14%, 82% 26%,
    92% 38%, 100% 38%,
    100% 62%, 92% 62%,
    82% 74%, 86% 86%,
    78% 94%, 66% 90%,
    62% 100%, 38% 100%,
    34% 90%, 22% 94%,
    14% 86%, 18% 74%,
    8% 62%, 0% 62%,
    0% 38%, 8% 38%,
    18% 26%, 14% 14%,
    22% 6%, 34% 10%
  );
  background: linear-gradient(180deg, rgba(255, 223, 204, 0.96), rgba(255, 129, 76, 0.70));
  box-shadow: 0 0 10px rgba(255, 112, 49, 0.16);
}
.hud-icon.gear::after {
  inset: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(10, 12, 17, 0.98) 0 58%, rgba(255, 220, 197, 0.18) 59% 100%);
  box-shadow: 0 0 0 1px rgba(255, 220, 197, 0.74);
}

.ui-glyph::before {
  inset: 2px;
  border-radius: 6px;
  border: 1px solid rgba(255, 176, 132, 0.72);
  box-shadow: 0 0 10px rgba(255, 102, 44, 0.16);
}
.ui-glyph.heroes::after {
  inset: 4px 5px 3px;
  border-radius: 8px 8px 6px 6px;
  background: radial-gradient(circle at 50% 20%, rgba(255, 226, 207, 0.96) 0 26%, transparent 29%), rgba(255, 214, 190, 0.9);
}
.ui-glyph.quests::after {
  inset: 4px 6px 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(255, 223, 202, 0.95), rgba(255, 132, 84, 0.58));
  box-shadow: inset 0 0 0 1px rgba(44, 14, 9, 0.42);
}
.ui-glyph.shop::after {
  inset: 5px 4px 3px;
  border-radius: 3px;
  border: 2px solid rgba(255, 223, 202, 0.94);
}
.ui-glyph.raid::after {
  inset: 3px 8px 2px;
  transform: skewX(-18deg);
  background: linear-gradient(180deg, rgba(255, 218, 193, 0.96), rgba(255, 131, 78, 0.55));
}
.ui-glyph.trophy-road::after {
  inset: 5px 6px 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--ui-alert-1), var(--ui-alert-2));
}
.ui-glyph.clock::after {
  inset: 4px;
  border-radius: 50%;
  border: 2px solid rgba(255, 223, 202, 0.94);
}
.ui-glyph.pass::after {
  inset: 5px 3px;
  border-radius: 4px;
  border: 2px solid rgba(255, 223, 202, 0.94);
  transform: rotate(-8deg);
}
.ui-glyph.arcade::after {
  inset: 5px 4px 3px;
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(255, 223, 202, 0.92), rgba(255, 126, 70, 0.44));
  box-shadow: inset 0 -3px 0 rgba(37, 15, 14, 0.42);
}
.ui-glyph.menu::after {
  left: 4px;
  right: 4px;
  top: 5px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 232, 216, 0.96);
  box-shadow:
    0 4px 0 rgba(255, 232, 216, 0.96),
    0 8px 0 rgba(255, 232, 216, 0.96);
}

/* ----- Buttons ----- */
.icon-btn {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(40, 28, 28, 0.98), rgba(15, 11, 14, 0.98));
  border: 1px solid var(--ui-border-strong);
  box-shadow: 0 0 0 1px rgba(255, 102, 44, 0.08), 0 0 22px rgba(255, 102, 44, 0.16), 0 8px 20px rgba(0,0,0,.28);
  color: var(--ui-text);
  font-size: 22px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.icon-btn:hover  { transform: translateY(-1px); border-color: rgba(255, 166, 122, 0.7); }
.icon-btn:active { transform: translateY(2px); box-shadow: 0 0 0 1px rgba(255, 102, 44, 0.08), 0 0 14px rgba(255, 102, 44, 0.14), 0 4px 12px rgba(0,0,0,.24); }

.mobile-main-menu-toggle {
  display: none;
}

.side-menu {
  display: flex; flex-direction: column; gap: 10px;
  align-self: flex-start; margin-top: 12px;
}
.side-btn {
  background: linear-gradient(180deg, var(--ui-panel-soft-top), var(--ui-panel-soft-bottom));
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px;
  padding: 10px 14px;
  color: var(--ui-text); font-weight: 900; font-size: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 8px 20px rgba(0,0,0,.3);
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; min-width: 130px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.side-btn:hover  { transform: translateY(-1px); border-color: rgba(255, 170, 127, 0.58); }
.side-btn:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 4px 12px rgba(0,0,0,.28); }
.side-btn .ic    { width: 20px; height: 20px; }
.side-btn--panel {
  border-radius: 13px;
  border-color: rgba(255, 127, 76, 0.24);
  box-shadow: 0 0 0 1px rgba(255, 102, 44, 0.08), 0 0 22px rgba(255, 102, 44, 0.16), 0 8px 20px rgba(0,0,0,.28);
}
.side-btn--capsule {
  border-radius: 999px;
}

.btn {
  background: linear-gradient(180deg, rgba(41, 24, 26, 0.98), rgba(15, 11, 16, 0.98));
  color: var(--ui-text);
  border: 1px solid var(--ui-border-strong);
  border-radius: 14px;
  padding: 10px 30px;
  font-size: 18px; font-weight: 900;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255, 102, 44, 0.08), 0 0 22px rgba(255, 102, 44, 0.16), 0 8px 20px rgba(0,0,0,.28);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.btn:active { transform: translateY(2px); box-shadow: 0 0 0 1px rgba(255, 102, 44, 0.08), 0 0 14px rgba(255, 102, 44, 0.14), 0 4px 12px rgba(0,0,0,.24); }
.btn.alt,
.btn.gold { background: linear-gradient(180deg, rgba(41, 24, 26, 0.98), rgba(15, 11, 16, 0.98)); color: var(--ui-text); }
.btn.sm   { padding: 6px 14px; font-size: 14px; }

/* ----- Lobby body ----- */
#lobby .body {
  flex: 1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  container-type: inline-size;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#lobby .body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.vault-row {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(24px, 1.8vw, 42px); flex-wrap: wrap;
  padding: 12px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.vault-row.starter-guided {
  gap: 42px;
}
.vault-row.starter-guided .vault:not(.starter-pending) {
  opacity: .34;
  filter: saturate(.42) brightness(.7);
  transform: scale(.88);
}
.vault-row.starter-guided .vault:not(.starter-pending):hover,
.vault-row.starter-guided .vault:not(.starter-pending):active {
  transform: scale(.88);
}
.vault-row.starter-guided .vault.starter-locked {
  cursor: not-allowed;
}
.vault-row.starter-guided .vault.starter-locked .chest {
  --chest-glow: rgba(154, 162, 178, 0.2);
}
.vault-row.starter-guided .vault.starter-locked .chest::before {
  background: radial-gradient(circle, rgba(154, 162, 178, 0.28), transparent 72%);
  filter: blur(20px);
  opacity: .58;
}
.vault-row.starter-guided .vault.starter-locked .chest-image {
  filter: grayscale(1) saturate(0) brightness(.62);
}
.vault-row.starter-guided .vault.starter-locked .label {
  color: rgba(222, 227, 238, 0.76);
  border-color: rgba(171, 181, 201, 0.18);
  background: linear-gradient(180deg, rgba(34, 37, 46, 0.96), rgba(16, 18, 24, 0.98));
}
.vault-row.starter-guided .vault.starter-locked .info {
  color: rgba(232, 236, 244, 0.76);
  border-color: rgba(171, 181, 201, 0.24);
  box-shadow: 0 0 12px rgba(122, 132, 152, 0.12);
}
.vault-row.starter-guided .vault.starter-locked .hud-icon,
.vault-row.starter-guided .vault.starter-locked .free-ad-btn,
.vault-row.starter-guided .vault.starter-locked .free-ad-meta,
.vault-row.starter-guided .vault.starter-locked .chest-ad-btn,
.vault-row.starter-guided .vault.starter-locked .chest-ad-timer {
  filter: grayscale(1);
  opacity: .7;
}
body.starter-skip-focus-active #lobby .side-menu,
body.starter-skip-focus-active #lobby .footer-row {
  display: none;
}
body.starter-skip-focus-active #lobby .menu-right,
body.starter-skip-focus-active #lobby .mobile-main-menu-toggle {
  display: none;
}
body.starter-skip-focus-active #lobby .top {
  grid-template-columns: minmax(196px, max-content) minmax(74px, max-content) minmax(220px, max-content);
  grid-template-areas: "player heroes currencies";
  justify-content: space-between;
  align-items: start;
  gap: 10px 12px;
}
body.starter-skip-focus-active #lobby .player-pill {
  grid-area: player;
}
body.starter-skip-focus-active #lobby .lobby-heroes-pill {
  grid-area: heroes;
  justify-self: start;
}
body.starter-skip-focus-active #lobby .currencies {
  grid-area: currencies;
  justify-self: end;
}
body.starter-skip-focus-active #lobby .body {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  min-height: 0;
  align-items: center;
  justify-items: center;
  padding: clamp(12px, 4vh, 32px) 0;
  overflow: visible;
}
body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided {
  width: min(100%, 1040px);
  min-height: fit-content;
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  grid-template-areas:
    ". starter ."
    "small large equip";
  justify-items: center;
  align-content: center;
  align-items: start;
  gap: clamp(14px, 2vw, 28px) clamp(12px, 2.4vw, 36px);
  padding: clamp(10px, 3vh, 26px) clamp(12px, 3vw, 32px) clamp(18px, 4vh, 36px);
  overflow: visible;
}
body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault[data-box="smallChest"] { grid-area: small; }
body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault[data-box="bigChest"] { grid-area: starter; }
body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault[data-box="largeChest"] { grid-area: large; }
body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault[data-box="equipChest"] { grid-area: equip; }
body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-pending {
  width: clamp(226px, 26vw, 304px);
  height: auto;
  min-height: clamp(298px, 34vw, 372px);
  margin: 0 auto;
  padding-top: 22px;
  padding-bottom: 18px;
  justify-content: flex-start;
}
body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-pending .starter-callout {
  position: static;
  left: auto;
  top: auto;
  order: -1;
  width: min(100%, 300px);
  min-width: 0;
  margin: 0 0 clamp(12px, 2vh, 18px);
  transform: none;
  white-space: normal;
  line-height: 1.05;
}
body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-locked {
  width: clamp(132px, 16vw, 176px);
  min-height: 0;
  height: auto;
  padding-top: 20px;
  padding-bottom: 12px;
}
body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-locked .chest {
  width: clamp(110px, 13vw, 140px);
  height: clamp(110px, 13vw, 140px);
  border-radius: 22px;
}
body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault .label {
  width: min(100%, 260px);
}
body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-pending .label {
  min-height: 50px;
  font-size: clamp(16px, 1.55vw, 20px);
  line-height: 1.08;
}
body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-locked .label {
  width: min(100%, 166px);
  min-height: 42px;
  margin-top: 8px;
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.04;
  letter-spacing: .04em;
}
body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-locked .label .hud-icon.coin,
body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-locked .label .hud-icon.gem {
  width: 18px;
  height: 18px;
}
body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-locked:hover,
body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-locked:active {
  transform: scale(.88);
}

/* ----- Chest ----- */
.vault {
  position: relative;
  width: 218px; height: 236px;
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer;
  transition: transform .15s ease;
}
.vault:hover  { transform: translateY(-4px) scale(1.02); }
.vault:active { transform: translateY(2px) scale(.98); }
.chest {
  --chest-glow: rgba(196, 117, 62, 0.28);
  width: 184px; height: 184px;
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  filter: drop-shadow(0 18px 26px rgba(0,0,0,.56));
  animation: floaty 2.6s ease-in-out infinite;
  isolation: isolate;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes starter-burn {
  0%, 100% {
    filter: drop-shadow(0 0 22px rgba(255, 84, 72, 0.68)) drop-shadow(0 0 44px rgba(255, 42, 42, 0.42)) drop-shadow(0 18px 26px rgba(0,0,0,.56));
  }
  50% {
    filter: drop-shadow(0 0 34px rgba(255, 106, 92, 0.92)) drop-shadow(0 0 70px rgba(255, 32, 32, 0.58)) drop-shadow(0 22px 30px rgba(0,0,0,.6));
  }
}
@keyframes starter-callout-flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: .84; }
}
.chest::before {
  content: "";
  position: absolute;
  left: 10%; right: 10%; bottom: 6px;
  height: 24%;
  background: radial-gradient(circle, var(--chest-glow), transparent 72%);
  filter: blur(18px);
  z-index: 0;
  opacity: .9;
}
.chest::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 14%, rgba(255,255,255,.12), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.06), transparent 34%, rgba(0,0,0,.18) 100%);
  z-index: 2;
  pointer-events: none;
}
.chest-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 52%;
  transform: scale(1.04);
  transition: transform .42s ease, filter .32s ease, opacity .28s ease;
  position: relative;
  z-index: 1;
  user-select: none;
  -webkit-user-drag: none;
}
.vault:hover .chest-image {
  transform: scale(1.08);
  filter: brightness(1.08) saturate(1.08);
}
.chest-art--smallChest,
.vault.tier-smallChest .chest { --chest-glow: rgba(178, 134, 98, 0.26); }
.chest-art--bigChest,
.vault.tier-bigChest .chest { --chest-glow: rgba(169, 130, 255, 0.32); }
.chest-art--largeChest,
.vault.tier-largeChest .chest { --chest-glow: rgba(255, 101, 45, 0.42); }
.chest-art--equipChest,
.vault.tier-equipChest .chest { --chest-glow: rgba(255, 216, 74, 0.34); }

.vault.tier-smallChest:hover .chest-image { filter: brightness(1.04) saturate(1.02); }
.vault.tier-bigChest:hover .chest-image { filter: brightness(1.08) saturate(1.06); }
.vault.tier-largeChest:hover .chest-image { filter: brightness(1.14) saturate(1.18); }
.vault.tier-equipChest:hover .chest-image { filter: brightness(1.12) saturate(1.12); }

.vault-preview {
  width: auto;
  height: auto;
  cursor: auto;
}
.vault-preview:hover,
.vault-preview:active {
  transform: none;
}

.vault.tier-smallChest { --col-light:#cfe7ff; --col-mid:#7fc5ff; --col-dark:#3a8edb; }
.vault.tier-bigChest   { --col-light:#e6c8ff; --col-mid:#a982ff; --col-dark:#6a3fc5; }
.vault.tier-largeChest { --col-light:#ffe39a; --col-mid:#ffae3a; --col-dark:#d96a14; }
.vault.tier-equipChest { --col-light:#fff2a8; --col-mid:#d7a848; --col-dark:#65411e; }

.vault .label {
  margin-top: 12px;
  background: linear-gradient(180deg, rgba(31, 33, 42, 0.96), rgba(10, 12, 17, 0.98));
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  box-sizing: border-box;
  width: min(100%, 214px);
  max-width: 100%;
  padding: 8px 14px;
  font-weight: 900; font-size: 18px; letter-spacing: .08em;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 10px 20px rgba(0,0,0,.26);
  overflow: hidden;
}
.vault .label > span:first-child {
  min-width: 0;
}
.vault.tier-equipChest .label > span:first-child {
  white-space: nowrap;
}
.free-vault-top {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 3;
}
.free-stack-host {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  width: auto;
}
.free-vault-status {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}
.free-ad-btn,
.chest-ad-btn {
  flex: 0 0 auto;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  width: min(100%, 214px);
  max-width: 100%;
  min-height: 48px;
  padding: 6px 8px;
  font-size: 11px;
  letter-spacing: .045em;
  line-height: 1;
  text-align: center;
  border-radius: 14px;
  box-sizing: border-box;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
}
.free-ad-btn__line {
  display: block;
  width: 100%;
  max-width: 100%;
  white-space: normal;
}
.free-ad-btn__line:last-child {
  font-size: .92em;
  letter-spacing: .04em;
}
.free-ad-btn[hidden] {
  display: none !important;
}
.chest-ad-btn[hidden],
.chest-ad-timer[hidden] {
  display: none !important;
}
.free-ad-meta {
  margin-top: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 231, 214, 0.84);
  text-align: center;
  text-shadow: 0 1px 0 rgba(0,0,0,.5);
}
.vault .info {
  appearance: none;
  position: absolute; right: 10px; top: -6px;
  width: 32px; height: 32px; border-radius: 50%;
  padding: 0;
  background: linear-gradient(180deg, rgba(41, 24, 26, 0.98), rgba(15, 11, 16, 0.98)); color: var(--ui-text);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-style: italic;
  border: 1px solid var(--ui-border-strong);
  cursor: pointer;
  box-shadow: 0 0 14px rgba(255, 102, 44, 0.18);
  z-index: 12;
  pointer-events: auto;
  touch-action: manipulation;
}
.vault .label .hud-icon { width: 18px; height: 18px; }
.vault .label .hud-icon.coin,
.vault .label .hud-icon.gem {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 0 14px rgba(255, 205, 120, 0.34));
}
.vault.locked { filter: grayscale(.5) brightness(.7); }
.vault.locked .timer-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 900; font-size: 16px;
  text-shadow: 0 2px 0 #000;
  pointer-events: none;
}
@keyframes free-ad-cta-pulse {
  0%, 100% {
    box-shadow: 0 0 0 rgba(255, 122, 76, 0), 0 18px 26px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.14);
    text-shadow: 0 0 0 rgba(255, 232, 205, 0);
  }
  50% {
    box-shadow: 0 0 28px rgba(255, 122, 76, 0.42), 0 22px 30px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.2);
    text-shadow: 0 0 14px rgba(255, 232, 205, 0.42);
  }
}
.starter-callout {
  position: absolute;
  left: 50%;
  top: -62px;
  transform: translateX(-50%) scale(.9);
  min-width: 270px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 132, 122, 0.58);
  background: linear-gradient(180deg, rgba(126, 18, 18, 0.96), rgba(56, 8, 8, 0.98));
  box-shadow: 0 0 28px rgba(255, 61, 46, 0.36), 0 10px 22px rgba(0,0,0,.34);
  color: #fff3ef;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: .18em;
  text-align: center;
  text-shadow: 0 0 16px rgba(255, 205, 194, 0.28), 0 2px 0 rgba(77, 8, 8, 0.96);
  pointer-events: none;
  opacity: 0;
  z-index: 4;
  transition: opacity .22s ease, transform .22s ease;
}
.vault.starter-pending {
  z-index: 3;
  transform: translateY(-8px) scale(1.12);
}
.vault.starter-pending:hover {
  transform: translateY(-10px) scale(1.14);
}
.vault.starter-pending:active {
  transform: translateY(-2px) scale(1.08);
}
.vault.starter-pending .starter-callout {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  animation: starter-callout-flicker 1.18s ease-in-out infinite;
}
.vault.starter-pending .chest {
  --chest-glow: rgba(255, 42, 42, 0.72);
  animation: floaty 2.6s ease-in-out infinite, starter-burn 1.36s ease-in-out infinite;
}
.vault.starter-pending .chest::before {
  background: radial-gradient(circle, rgba(255, 50, 42, 0.84), transparent 72%);
  filter: blur(26px);
}
.vault.starter-pending .chest::after {
  background:
    radial-gradient(circle at 50% 14%, rgba(255,255,255,.24), transparent 30%),
    linear-gradient(180deg, rgba(255, 120, 120, 0.2), transparent 34%, rgba(80, 0, 0, 0.18) 100%);
}
.vault.starter-pending .chest-image {
  transform: scale(1.1);
  filter: brightness(1.18) saturate(1.26);
}
.vault.starter-pending .label {
  border-color: rgba(255, 118, 118, 0.66);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 0 18px rgba(255, 79, 66, 0.26), 0 12px 26px rgba(0,0,0,.34);
}
.vault.starter-pending .info {
  border-color: rgba(255, 118, 118, 0.7);
  box-shadow: 0 0 18px rgba(255, 79, 66, 0.3);
}
.starter-tag {
  color: #fff3ef;
  text-shadow: 0 0 14px rgba(255, 110, 96, 0.28);
}

.vault[data-box="bigChest"],
.vault[data-box="largeChest"],
.vault[data-box="equipChest"] {
  min-height: 312px;
  height: auto;
}

.chest-ad-btn {
  margin-top: 10px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .045em;
  color: #fff3e8;
  border: 1px solid rgba(255, 118, 98, 0.68);
  background:
    linear-gradient(180deg, rgba(132, 23, 18, 0.98), rgba(58, 8, 10, 0.98)),
    radial-gradient(circle at 50% 0%, rgba(255, 171, 138, 0.22), transparent 58%);
  box-shadow: 0 16px 24px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.12);
  animation: free-ad-cta-pulse 1.4s ease-in-out infinite;
}

.chest-ad-timer {
  min-height: 16px;
  margin-top: 10px;
  color: rgba(255, 231, 214, 0.9);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-align: center;
  text-shadow: 0 1px 0 rgba(0,0,0,.6);
}

.vault[data-box="smallChest"] {
  min-height: 312px;
  height: auto;
  padding-top: 54px;
}

.vault[data-box="smallChest"] .chest {
  margin-top: -24px;
}

.vault[data-box="smallChest"] .free-vault-top {
  top: 0;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: 186px;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
}

.vault[data-box="smallChest"] .free-vault-status {
  flex: 1 1 auto;
  align-items: flex-start;
}

.vault[data-box="smallChest"] .free-stack-host {
  width: auto;
  min-width: 0;
}

.vault[data-box="smallChest"] .stack-badge,
.vault[data-box="smallChest"] .free-ad-meta {
  width: auto;
}

.vault[data-box="smallChest"] .free-ad-meta {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 160, 120, 0.22);
  background: linear-gradient(180deg, rgba(27, 18, 22, 0.96), rgba(10, 11, 16, 0.98));
  white-space: nowrap;
}

.vault[data-box="smallChest"] .free-ad-btn {
  position: static;
  left: auto;
  top: auto;
  transform: none;
  width: min(100%, 214px);
  min-height: 48px;
  margin-top: 10px;
  padding: 6px 8px;
  border-radius: 14px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .045em;
  color: #fff3e8;
  border: 1px solid rgba(255, 178, 126, 0.62);
  background:
    linear-gradient(180deg, rgba(135, 34, 18, 0.96), rgba(68, 10, 8, 0.98)),
    radial-gradient(circle at 50% 0%, rgba(255, 180, 123, 0.24), transparent 58%);
  box-shadow: 0 18px 26px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.14);
  z-index: 5;
  animation: free-ad-cta-pulse 1.4s ease-in-out infinite;
}

.vault[data-box="smallChest"].free-stack-full .free-vault-top {
  width: 78px;
}

.vault[data-box="smallChest"] .timer-overlay,
.vault[data-box="smallChest"].locked .timer-overlay {
  position: absolute;
  left: 50%;
  top: 30px;
  width: min(calc(100% - 22px), 184px);
  aspect-ratio: 1 / 1;
  transform: translateX(-50%);
  margin-top: 0;
  min-height: 0;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 231, 214, 0.9);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-shadow: 0 1px 0 rgba(0,0,0,.6);
  pointer-events: none;
  z-index: 4;
}

.vault[data-box="smallChest"] .label {
  margin-top: 8px;
}

@media (max-width: 900px) {
  .vault[data-box="smallChest"] {
    min-height: 288px;
  }

  .vault[data-box="bigChest"],
  .vault[data-box="largeChest"],
  .vault[data-box="equipChest"] {
    min-height: 288px;
  }

  .chest-ad-btn {
    width: min(100%, 166px);
    min-height: 48px;
    border-radius: 13px;
    font-size: 9px;
    padding: 6px 8px;
  }

  .vault-row.starter-guided { gap: 18px; }
  .starter-callout {
    top: -48px;
    min-width: 218px;
    font-size: 20px;
    letter-spacing: .14em;
  }
  .vault.starter-pending {
    transform: translateY(-6px) scale(1.07);
  }
  .vault.starter-pending:hover {
    transform: translateY(-8px) scale(1.09);
  }
}

@media (max-width: 640px) {
  .vault-row.starter-guided .vault:not(.starter-pending) {
    opacity: .22;
    transform: scale(.76);
  }
  .starter-callout {
    top: -38px;
    min-width: 188px;
    padding: 6px 12px;
    font-size: 16px;
    letter-spacing: .12em;
  }
}

/* ----- Banners (footer) ----- */
.footer-row {
  display: flex; gap: 10px; justify-content: space-between; align-items: end;
}
.banner {
  background: linear-gradient(180deg, var(--ui-panel-soft-top), var(--ui-panel-soft-bottom));
  border: 1px solid var(--ui-border);
  border-radius: 18px;
  padding: 12px 18px;
  color: var(--ui-text); font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 10px 24px rgba(0,0,0,.3);
  cursor: pointer;
  font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.banner--capsule { border-radius: 999px; }
.banner .ui-glyph { width: 18px; height: 18px; }

/* ----- Inner screens ----- */
.screen-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.screen-header .right { margin-left: auto; }
.back-btn {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(31, 22, 24, 0.98), rgba(13, 10, 14, 0.98)); color: var(--ui-text);
  border: 1px solid var(--ui-border);
  font-size: 22px; font-weight: 900; cursor: pointer;
  box-shadow: 0 0 14px rgba(255, 102, 44, 0.12), 0 8px 18px rgba(0,0,0,.26);
}
.screen-title {
  font-size: 24px; font-weight: 900;
  text-shadow: 2px 2px 0 var(--ink);
  letter-spacing: 1px;
}
.muted  { opacity: .75; font-size: 14px; }
.center { text-align: center; }

.tabs {
  display: flex; gap: 6px; margin-bottom: 10px;
}
.tab {
  background: rgba(0,0,0,.35);
  color: #fff;
  border: 2px solid rgba(255,255,255,.2);
  border-radius: 12px;
  padding: 6px 14px;
  font-weight: 800; font-size: 14px;
  cursor: pointer;
}
.tab.active {
  background: linear-gradient(180deg, #ffd76a, #ff9d2c);
  color: #4a2400; border-color: #fff;
}

.grid {
  flex: 1; overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 200px));
  justify-content: center;
  align-content: start;
  gap: 14px;
  padding: 10px 10px 30px;
}
#shopGrid {
  flex: 1;
  min-height: 0;
  width: 100%;
  align-self: stretch;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  max-width: 1380px;
  margin: 0 auto;
  justify-content: stretch;
  align-content: start;
  align-items: stretch;
  gap: 18px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px 8px 24px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-width: none;
}
#shopGrid.drag-scroll-enabled {
  touch-action: pan-y;
  cursor: default;
}
#shopGrid.drag-scroll-enabled.is-dragging {
  cursor: default;
  user-select: auto;
}
#shopGrid::-webkit-scrollbar { display: none; width: 0; height: 0; }
#shopGrid::-webkit-scrollbar-track {
  background: rgba(4, 3, 4, 0.9);
  border-radius: 999px;
}
#shopGrid::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, rgba(40, 12, 12, 0.98), rgba(105, 28, 22, 0.96));
  border: 2px solid rgba(4, 3, 4, 0.9);
  border-radius: 999px;
}
.grid::-webkit-scrollbar { width: 8px; }
.grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,.3); border-radius: 4px; }

/* ----- Cards ----- */
.card {
  position: relative;
  border-radius: 14px;
  background: linear-gradient(180deg, #2d3553, #1b2138);
  border: 3px solid var(--rar-color, #2a7aff);
  box-shadow: 0 4px 0 rgba(0,0,0,.3);
  cursor: pointer;
  padding-bottom: 10px;
  display: flex; flex-direction: column;
}
.card .btn {
  flex-shrink: 0;
  margin-top: auto;
}
.card.locked { opacity: .82; filter: none; }
.card .portrait {
  aspect-ratio: 1/1;
  background: linear-gradient(180deg, var(--rar-color, #2a7aff), #1b1b3a);
  display: flex; align-items: center; justify-content: center;
  font-size: 64px; position: relative;
  border-radius: 11px 11px 0 0;
  overflow: hidden;
  padding: 8px 8px 0;
  box-sizing: border-box;
}
.card .portrait::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,.4), transparent 60%);
  pointer-events: none;
}
.card.locked .portrait::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 10, 20, 0.24), rgba(4, 6, 12, 0.72));
  z-index: 1;
}
.card .portrait-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.28));
}
.card.locked .portrait-art {
  filter: grayscale(.3) brightness(.62) drop-shadow(0 6px 12px rgba(0,0,0,.28));
}
.card .portrait-glyph {
  position: relative;
  z-index: 1;
  line-height: 1;
}
.card .portrait-lock {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,.55);
}
.card.locked .portrait-lock {
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card .nm {
  text-align: center; padding: 6px 4px;
  font-weight: 900; font-size: 14px; letter-spacing: .5px;
  background: rgba(0,0,0,.35);
}
.card .meta {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 8px;
  background: #11152a;
  font-size: 12px; font-weight: 800;
}
.card .tag {
  position: absolute; top: 6px; left: 6px;
  background: var(--rar-color, #fff); color: var(--ink);
  font-size: 10px; font-weight: 900;
  padding: 2px 6px; border-radius: 8px;
  text-transform: uppercase;
}
.card .progress {
  height: 6px; background: rgba(0,0,0,.4); position: relative;
}
.card .progress > div {
  height: 100%;
  background: linear-gradient(90deg, #6cf08e, #22c358);
  transition: width .3s;
}
.shop-card {
  background: linear-gradient(180deg, rgba(8, 4, 5, 0.98), rgba(0, 0, 0, 0.98));
  border-color: rgba(255, 39, 39, 0.42);
  overflow: hidden;
  display: grid;
  grid-template-rows: minmax(188px, auto) minmax(40px, auto) minmax(40px, auto) minmax(42px, auto) auto;
  align-content: start;
}
#shopGrid .shop-card {
  width: 100%;
  min-width: 0;
  max-width: none;
  flex: none;
}
.shop-card .portrait {
  aspect-ratio: auto;
  padding: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 188px;
}
.shop-card .portrait::after {
  display: none;
}
.shop-card-visual {
  width: min(100%, 176px);
  height: min(100%, 176px);
  display: grid;
  place-items: center;
  margin: 0 auto;
}
.shop-card-visual--art {
  width: min(100%, 186px);
  height: min(100%, 186px);
}
.shop-card-visual--currency {
  width: min(100%, 166px);
  height: min(100%, 166px);
}
.shop-card-visual--currency .currency-mark {
  --currency-icon-limit: min(100%, 172px);
}
@media (min-width: 1025px) {
  #shopGrid {
    align-items: stretch;
  }

  #shopGrid .shop-card {
    height: 526px;
    grid-template-rows: 212px 68px 72px 74px 64px;
    align-content: stretch;
  }

  .shop-card .portrait {
    min-height: 212px;
    max-height: 212px;
  }

  .shop-card .nm {
    min-height: 0;
    padding: 10px 10px 6px;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1.18;
  }

  .shop-card-desc {
    min-height: 0;
    padding: 8px 10px 4px;
    font-size: 11px;
    line-height: 1.22;
    display: flex;
    align-items: flex-start;
    justify-content: center;
  }

  .shop-card .meta.meta--price-only {
    min-height: 0;
    height: 74px;
    padding: 8px 10px 10px;
    align-items: center;
  }

  .shop-card-price-label {
    align-self: center;
  }

  .shop-card-price-value {
    min-height: 0;
  }

  .shop-card .btn {
    width: calc(100% - 18px);
    min-height: 48px;
    margin: 8px auto 10px;
    align-self: stretch;
  }

  .shop-card-visual--currency .currency-mark--crystal {
    background-size: 186%;
    transform: translateY(40px);
  }

  .shop-card-visual--currency .currency-mark--coin {
    background-size: 168%;
    transform: translateY(52px);
  }

  #shopGrid .shop-card[data-shop-item="s_boss_refill"] .shop-card-visual--art {
    transform: translateY(50px);
  }

  #shopGrid .shop-card:not([data-shop-item="s_pp"]) .nm {
    align-items: center;
  }

  #shopGrid .shop-card.deal .nm {
    min-height: 0;
    padding-top: 10px;
    font-size: 15px;
  }

  #shopGrid .shop-card.deal .shop-card-desc {
    min-height: 0;
    padding: 8px 10px 4px;
    font-size: 10px;
    line-height: 1.15;
  }

  #shopGrid .shop-card.deal .meta {
    min-height: 0;
  }

  #shopGrid .shop-card.deal > .btn {
    margin-bottom: 10px;
  }

  #shopGrid .shop-card.deal .shop-card-price-value {
    gap: 2px;
    line-height: 1.05;
  }
}
.shop-card-visual--emoji {
  width: min(100%, 166px);
  height: min(100%, 166px);
  font-size: clamp(72px, 7.4vw, 102px);
  line-height: 1;
  filter: drop-shadow(0 0 16px rgba(255, 145, 87, 0.24));
}
.shop-card-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  margin: 0 auto;
  user-select: none;
  -webkit-user-drag: none;
}
.shop-card .nm,
.shop-card .meta {
  background: rgba(0, 0, 0, 0.92);
  color: #fff1e8;
}
.shop-card .meta {
  min-height: 40px;
}
.shop-card .meta.meta--price-only {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.shop-card-price-main {
  width: 100%;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-wrap: nowrap;
}
.shop-card-price-label {
  flex: 0 0 auto;
  color: rgba(255, 226, 197, 0.78);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.shop-card-price-value {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: normal;
}
.shop-card-price-orig {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  flex-wrap: wrap;
}
.shop-card .nm {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
  padding-inline: 8px;
}
.shop-card .meta .currency-mark {
  --currency-icon-limit: 32px;
}
.shop-card .meta .currency-inline {
  gap: 8px;
  font-size: 18px;
}
.shop-card:not([data-shop-item="s_ad_gems"]) .meta .currency-inline {
  gap: 6px;
  flex: 0 0 auto;
}
.shop-card-desc {
  min-height: 42px;
  padding: 8px 10px 0;
  background: rgba(0, 0, 0, 0.92);
  color: #ffe2c5;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
}
.shop-card-desc.is-empty {
  color: transparent;
}
.shop-card > .btn {
  display: block;
  width: calc(100% - 18px);
  min-height: 48px;
  margin: 12px auto 12px;
  padding: 10px 16px;
  font-size: 14px;
  border-radius: 14px;
}
.shop-card .meta .orig {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: #ff4b4b;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: #ff2727;
  margin-right: 10px;
  opacity: .95;
}
.shop-card .meta .orig::after {
  content: "";
  position: absolute;
  left: -6%;
  right: -6%;
  top: 50%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #ff2727 12%, #ff2727 88%, transparent);
  transform: rotate(-18deg);
  box-shadow: 0 0 10px rgba(255, 39, 39, .34);
  pointer-events: none;
}
.shop-card .meta .orig .currency-mark {
  --currency-icon-limit: 46px;
}
.shop-card.deal .shop-card-price-main,
.shop-card.deal .shop-card-price-value,
.shop-card.deal .shop-card-price-orig {
  color: #fff4c2;
  font-weight: 900;
  text-shadow: 0 0 12px rgba(255, 170, 114, .24);
}
.shop-ad-cost,
.shop-ad-meta {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: #fff1e8;
  font-weight: 900;
  letter-spacing: .04em;
}
.shop-card[data-shop-item="s_ad_gems"] .meta {
  position: relative;
  overflow: hidden;
}
.shop-card[data-shop-item="s_ad_gems"] .shop-ad-meta {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 4px 8px;
  box-sizing: border-box;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: center;
  line-height: 1.25;
  font-size: 11px;
}
@media (max-width: 1024px) {
  .shop-card[data-shop-item="s_ad_gems"] .shop-ad-meta {
    position: absolute;
    left: 50%;
    top: -16px;
    transform: translateX(-50%);
    display: inline-block;
    max-width: 150px;
    width: 150px;
    padding: 0;
    font-size: inherit;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
  }
}
.mini-game-card {
  --rar-color: #ff2727;
  cursor: pointer;
  border-color: rgba(255, 39, 39, 0.72);
  background: linear-gradient(180deg, #050303, #000);
  box-shadow: 0 0 0 1px rgba(255, 39, 39, 0.26), 0 14px 28px rgba(0,0,0,.42);
  overflow: hidden;
}
.mini-game-card:focus-visible {
  outline: 2px solid rgba(255, 214, 162, 0.92);
  outline-offset: 2px;
}
.mini-game-card .mini-game-portrait {
  aspect-ratio: 1 / 1;
  width: 100%;
  padding: 0;
  background: #000;
}
.mini-game-card .mini-game-portrait::after {
  display: none;
}
.mini-card-art-wrap,
.mini-card-img {
  display: block;
  width: 100%;
  height: 100%;
}
.mini-card-img {
  object-fit: cover;
  object-position: center center;
  transform: scale(1.08);
  filter: saturate(1.12) contrast(1.08) brightness(0.92);
  user-select: none;
  -webkit-user-drag: none;
}
.mini-game-card .nm {
  color: #fff0e8;
  background: #000;
  text-shadow: 0 2px 0 rgba(0,0,0,.8);
}
.mini-game-card .meta {
  color: #ffe6d4;
  background: rgba(0, 0, 0, 0.96);
  border-top: 0;
}
.mini-game-card .mini-game-status {
  background: rgba(0, 0, 0, 0.96);
  color: #fff1df;
}
.mini-game-card .btn {
  background: linear-gradient(180deg, rgba(5, 5, 5, 0.98), rgba(0, 0, 0, 0.98));
  border-color: rgba(255, 39, 39, 0.62);
  color: #fff5ee;
  box-shadow: inset 0 0 0 1px rgba(255, 39, 39, 0.14), 0 8px 14px rgba(0,0,0,.32);
}
.mini-game-card .btn:hover {
  box-shadow: inset 0 0 0 1px rgba(255, 39, 39, 0.2), 0 0 14px rgba(255, 0, 0, 0.18);
}

/* ----- Battle Pass (legacy .tier cell styles kept for any lingering use) ----- */
.tier {
  flex: 0 0 auto;
  width: 90px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.tier .lv {
  background: rgba(0,0,0,.45);
  border: 2px solid #fff;
  border-radius: 999px;
  padding: 2px 10px;
  font-weight: 900; font-size: 13px;
}
.tier-row {
  display: flex; flex-direction: column; gap: 6px; width: 100%;
}
.tier-cell {
  background: linear-gradient(180deg, #2d3553, #1b2138);
  border: 2px solid var(--rar-color, #fff);
  border-radius: 10px;
  padding: 6px;
  text-align: center;
  position: relative;
  min-height: 80px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.tier-cell.free    { --rar-color: #4ad36a; }
.tier-cell.premium { --rar-color: #ff5136; }
.tier-cell.locked    { opacity: .45; }
.tier-cell.claimed   { filter: grayscale(.6); opacity: .6; }
.tier-cell .ic { font-size: 28px; }
.tier-cell .v  { font-weight: 900; font-size: 12px; }
.tier-cell .badge {
  position: absolute; top: -8px; right: -6px;
  background: var(--rar-color); color: var(--ink);
  font-size: 9px; font-weight: 900;
  padding: 2px 5px; border-radius: 6px;
  border: 2px solid var(--ink);
  text-transform: uppercase;
}
.tier-cell .claim {
  margin-top: 4px;
  background: linear-gradient(180deg, #6cf08e, #22c358);
  color: #033; border: 2px solid #fff;
  border-radius: 8px;
  font-weight: 900; font-size: 11px;
  padding: 2px 8px; cursor: pointer;
}

#mini {
  --mini-bg-current: var(--mini-bg-desktop);
  background:
    linear-gradient(180deg, rgba(3, 5, 10, 0.58), rgba(5, 5, 9, 0.34) 38%, rgba(2, 3, 6, 0.82)),
    var(--mini-bg-current);
  background-position: center center, center center;
  background-repeat: no-repeat, no-repeat;
  background-size: cover, cover;
}

#mini-crit,
#mini-wheel,
#mini-mem,
#mini-signal,
#mini-wall {
  --mini-stage-bg-current: var(--mini-stage-bg-desktop);
  background:
    linear-gradient(180deg, rgba(3, 5, 10, 0.68), rgba(5, 5, 9, 0.48) 38%, rgba(2, 3, 6, 0.9)),
    radial-gradient(circle at 50% 18%, rgba(255, 39, 39, 0.16), transparent 34%),
    var(--mini-stage-bg-current);
  background-position: center center, center center, center center;
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-size: cover, cover, cover;
}

@media (max-width: 768px) and (orientation: portrait) {
  #mini {
    --mini-bg-current: var(--mini-bg-mobile);
    background-position: center top, center center;
  }

  #mini-crit,
  #mini-wheel,
  #mini-mem,
  #mini-signal,
  #mini-wall {
    --mini-stage-bg-current: var(--mini-stage-bg-mobile);
    background-position: center top, center top, center top;
  }
}

/* ----- Mini-game stages ----- */
.mini-stage {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: min(100%, 940px);
  margin: 0 auto;
  padding: 28px 24px 30px;
  border-radius: 28px;
  border: 1px solid rgba(246, 126, 90, 0.26);
  background:
    linear-gradient(180deg, rgba(29, 10, 12, 0.9), rgba(6, 6, 10, 0.96)),
    radial-gradient(circle at 50% 0, rgba(255, 92, 44, 0.12), transparent 34%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 0 28px rgba(255, 52, 52, 0.12),
    0 20px 42px rgba(0,0,0,.34);
  overflow: hidden;
}
.mini-stage::before,
.mini-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.mini-stage::before {
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 124, 78, 0.12), transparent 18%),
    radial-gradient(circle at 82% 78%, rgba(255, 62, 62, 0.1), transparent 22%);
}
.mini-stage::after {
  background:
    linear-gradient(120deg, transparent 0 18%, rgba(255,255,255,.03) 19%, transparent 21% 100%),
    repeating-linear-gradient(180deg, rgba(255,255,255,.02) 0 1px, transparent 1px 4px);
  opacity: .52;
}
.mini-stage > * {
  position: relative;
  z-index: 1;
}
.mini-emoji {
  display: grid;
  place-items: center;
  width: 108px;
  height: 108px;
  border-radius: 26px;
  border: 1px solid rgba(255, 214, 176, 0.18);
  background:
    radial-gradient(circle at 50% 30%, rgba(255,255,255,.12), transparent 34%),
    linear-gradient(180deg, rgba(45, 16, 16, 0.98), rgba(8, 7, 10, 0.98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 16px 30px rgba(0,0,0,.28);
  font-size: 64px;
}
.mini-bar {
  width: 80%; max-width: 420px; height: 36px;
  background: linear-gradient(180deg, rgba(9, 9, 14, 0.96), rgba(22, 8, 9, 0.96));
  border: 2px solid rgba(247, 145, 100, 0.28);
  border-radius: 18px;
  position: relative; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 12px 24px rgba(0,0,0,.28);
}
#critTarget {
  position: absolute; top: 0; bottom: 0; left: 43%; width: 14%;
  background: linear-gradient(180deg, #6cf08e, #22c358);
}
#critIndicator {
  position: absolute; top: -4px; bottom: -4px; width: 6px;
  background: #fff; left: 0;
}
.mini-info {
  min-width: min(100%, 420px);
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 151, 112, 0.22);
  background: linear-gradient(180deg, rgba(26, 11, 12, 0.94), rgba(8, 8, 12, 0.96));
  font-weight: 900;
  font-size: 18px;
  text-align: center;
  box-shadow: 0 14px 26px rgba(0,0,0,.24);
}
#mini .muted,
#mini-crit .muted,
#mini-wheel .muted,
#mini-mem .muted,
#mini-signal .muted,
#mini-wall .muted {
  max-width: 520px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .44);
  border: 1px solid rgba(255,255,255,.05);
  color: #e8d2c5;
  text-align: center;
}

.signal-stage { gap: 16px; }
.signal-readout {
  min-height: 24px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(121, 202, 255, 0.22);
  background: linear-gradient(180deg, rgba(12, 18, 28, 0.94), rgba(7, 10, 18, 0.98));
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #ffd8b7;
  text-align: center;
}
.signal-bar {
  overflow: hidden;
  background: linear-gradient(180deg, rgba(12, 17, 29, 0.94), rgba(5, 8, 15, 0.98));
}
.signal-noise {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0 8%, rgba(255,255,255,.07) 9% 12%, transparent 13% 100%),
    linear-gradient(180deg, rgba(123, 179, 255, 0.06), rgba(255, 112, 49, 0.05));
  opacity: .8;
}
#signalZone {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 41%;
  width: 18%;
  background: linear-gradient(180deg, rgba(117, 238, 180, 0.95), rgba(40, 176, 116, 0.92));
  box-shadow: 0 0 16px rgba(117, 238, 180, 0.26);
}
#signalIndicator {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 6px;
  left: 0;
  background: #fff3ea;
  box-shadow: 0 0 12px rgba(255,255,255,.28);
}

.wall-stage { gap: 16px; }
.wall-readout {
  min-height: 24px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 202, 122, 0.24);
  background: linear-gradient(180deg, rgba(34, 18, 12, 0.94), rgba(12, 8, 9, 0.98));
  text-align: center;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #ffe0b8;
}
.wall-board {
  width: min(420px, 100%);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.wall-light {
  min-height: 68px;
  border-radius: 16px;
  border: 1px solid rgba(255, 188, 138, 0.28);
  background: linear-gradient(180deg, rgba(45, 20, 20, 0.96), rgba(14, 9, 12, 0.98));
  color: #f8e7dc;
  font-size: 28px;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 10px 18px rgba(0,0,0,.24);
}
.wall-light.active {
  border-color: rgba(255, 220, 133, 0.72);
  background: linear-gradient(180deg, rgba(255, 214, 132, 0.98), rgba(255, 147, 70, 0.94));
  color: #351309;
  box-shadow: 0 0 18px rgba(255, 191, 93, 0.34), 0 10px 18px rgba(0,0,0,.22);
}
.wall-light:disabled {
  opacity: .92;
  cursor: default;
}

/* Wheel */
.wheel-wrap {
  position: relative;
  width: 300px;
  height: 300px;
  padding: 14px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 120, 86, 0.2), rgba(31, 8, 10, 0.96) 58%, rgba(5, 4, 8, 1) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.04),
    inset 0 0 32px rgba(255, 56, 56, 0.12),
    0 0 28px rgba(186, 28, 28, 0.18),
    0 22px 38px rgba(0,0,0,.42);
}
.wheel-wrap::before,
.wheel-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}
.wheel-wrap::before {
  inset: 9px;
  border: 1px solid rgba(255, 139, 103, 0.24);
  box-shadow: inset 0 0 24px rgba(255, 82, 82, 0.16);
}
.wheel-wrap::after {
  inset: 22px;
  border: 1px dashed rgba(255, 190, 150, 0.18);
  opacity: .7;
}
.wheel-pointer {
  position: absolute;
  top: -18px;
  left: 50%;
  width: 48px;
  height: 64px;
  transform: translateX(-50%);
  font-size: 0;
  color: transparent;
  z-index: 5;
}
.wheel-pointer::before,
.wheel-pointer::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.wheel-pointer::before {
  top: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 244, 221, 0.96), rgba(255, 130, 82, 0.92) 42%, rgba(93, 16, 12, 0.98) 100%);
  border: 2px solid rgba(255, 228, 200, 0.72);
  box-shadow:
    0 0 20px rgba(255, 120, 84, 0.26),
    0 8px 18px rgba(0,0,0,.34);
}
.wheel-pointer::after {
  top: 28px;
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 28px solid #ffd08d;
  filter: drop-shadow(0 0 10px rgba(255, 146, 96, 0.24));
}
.wheel {
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 6px solid rgba(255, 232, 217, 0.92);
  box-shadow:
    0 0 0 4px rgba(45, 10, 12, 0.96),
    0 0 28px rgba(255, 87, 59, 0.18),
    0 12px 0 rgba(0,0,0,.3);
  position: relative;
  transition: transform 4s cubic-bezier(.2,.8,.2,1);
  background: conic-gradient(
    #611416 0deg 60deg,
    #9b2b22 60deg 120deg,
    #1b2437 120deg 180deg,
    #7d1f26 180deg 240deg,
    #3c1021 240deg 300deg,
    #d14f27 300deg 360deg
  );
}
.wheel::before,
.wheel::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.wheel::before {
  left: 50%;
  top: 50%;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 248, 230, 0.96), rgba(255, 126, 79, 0.88) 42%, rgba(43, 10, 11, 0.98) 100%);
  border: 2px solid rgba(255, 228, 205, 0.72);
  box-shadow: 0 0 18px rgba(255, 100, 68, 0.22);
  z-index: 2;
}
.wheel::after {
  inset: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255, 236, 224, 0.08);
}
.wheel-seg {
  position: absolute; left: 50%; top: 50%;
  transform-origin: 0 0;
  width: 84px;
  max-width: 84px;
  min-height: 58px;
  display: grid;
  place-items: center;
  text-align: center;
  font-weight: 1000;
  color: #fff5e8;
  font-size: 16px;
  line-height: 1.08;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-shadow:
    0 2px 10px rgba(0,0,0,.72),
    0 0 10px rgba(255, 110, 80, 0.12);
  pointer-events: none;
}
.wheel-seg__content {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
}

/* Memory game */
.mem-info {
  width: min(100%, 520px);
  text-align: center;
  font-weight: 900;
  margin-bottom: 10px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 138, 88, 0.22);
  background: linear-gradient(180deg, rgba(26, 11, 12, 0.94), rgba(8, 8, 12, 0.96));
}
.mem-grid {
  flex: 1; display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 12px;
  max-width: 480px; margin: 0 auto; width: 100%;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(8, 8, 12, 0.8), rgba(31, 10, 12, 0.76));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 16px 30px rgba(0,0,0,.24);
}
.mem-card {
  aspect-ratio: 1/1;
  position: relative;
  cursor: pointer;
  perspective: 600px;
}
.mem-inner {
  position: absolute; inset: 0;
  transition: transform .35s;
  transform-style: preserve-3d;
}
.mem-card.flipped .mem-inner,
.mem-card.matched .mem-inner { transform: rotateY(180deg); }
.mem-front, .mem-back {
  position: absolute; inset: 0;
  border-radius: 12px;
  border: 3px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; font-weight: 900;
  backface-visibility: hidden;
  box-shadow: 0 4px 0 rgba(0,0,0,.3);
}
.mem-front { background: linear-gradient(180deg, #3f1820, #110b12); color: #ffd7bf; border-color: rgba(255, 126, 90, 0.42); }
.mem-back  { background: linear-gradient(180deg, #ffcf78, #ff7d39); transform: rotateY(180deg); color: #33130c; }
.mem-card.matched .mem-back { background: linear-gradient(180deg, #9ae8b0, #2cc36d); }

@media (max-width: 1024px) {
  #mini-mem {
    padding: max(6px, env(safe-area-inset-top, 0px)) 12px max(10px, env(safe-area-inset-bottom, 0px));
    align-items: center;
    overflow-y: auto;
  }

  #mini-mem .screen-header,
  #mini-mem .mem-info,
  #mini-mem .mem-grid,
  #mini-mem .muted {
    width: min(100%, 430px);
  }

  #mini-mem .screen-header {
    margin-bottom: 8px;
  }

  #mini-mem .mem-info {
    margin-bottom: 8px;
    padding: 10px 12px;
    font-size: 13px;
  }

  #mini-mem .mem-grid {
    flex: 0 0 auto;
    gap: 8px;
    padding: 10px;
    max-width: min(100%, 400px);
  }

  #mini-mem .mem-front,
  #mini-mem .mem-back {
    font-size: clamp(26px, 4.6vw, 38px);
    border-width: 2px;
  }

  #mini-mem .muted {
    margin-top: 8px;
    padding: 8px 10px;
    font-size: 11px;
    line-height: 1.28;
  }
}

@media (max-width: 640px) {
  #mini-mem {
    padding: max(4px, env(safe-area-inset-top, 0px)) 8px max(8px, env(safe-area-inset-bottom, 0px));
  }

  #mini-mem .screen-header {
    margin-bottom: 6px;
  }

  #mini-mem .mem-info {
    margin-bottom: 6px;
    padding: 8px 10px;
    font-size: 11.5px;
  }

  #mini-mem .mem-grid {
    gap: 6px;
    padding: 8px;
    max-width: min(100%, 340px);
  }

  #mini-mem .mem-front,
  #mini-mem .mem-back {
    border-radius: 10px;
    font-size: clamp(22px, 7vw, 30px);
  }

  #mini-mem .muted {
    font-size: 10px;
  }
}

/* ----- Box opening overlay ----- */
#opening {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at 50% 50%, var(--ink), #000);
  display: none;
  align-items: center; justify-content: center;
  z-index: 1200; overflow: hidden;
}
#opening.active { display: flex; }
#opening .scene {
  width: 100%; height: 100%;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
}
#opening .rays {
  position: absolute; inset: 0;
  background:
    conic-gradient(from 0deg,
      transparent 0deg, rgba(255,255,255,.18) 8deg, transparent 16deg,
      transparent 24deg, rgba(255,255,255,.12) 32deg, transparent 40deg);
  animation: spin 12s linear infinite;
  opacity: 0; transition: opacity .4s;
}
#opening.with-rays .rays { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

#opening .stage {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  text-align: center;
  width: min(92vw, 760px);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 8px 4px 132px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#opening .stage::-webkit-scrollbar { width: 0; height: 0; display: none; }
#opening .vault-preview .chest {
  animation: none;
  transition: filter .24s ease, box-shadow .24s ease, transform .24s ease;
}
#opening .vault-preview {
  cursor: pointer;
}
#opening .vault-preview:hover .chest,
#opening .vault-preview .chest:hover {
  transform: translateY(-2px) scale(1.02);
  filter:
    drop-shadow(0 0 14px rgba(255, 112, 112, 0.42))
    drop-shadow(0 0 32px rgba(255, 78, 78, 0.38))
    drop-shadow(0 0 54px rgba(255, 52, 52, 0.22));
  box-shadow:
    0 0 0 1px rgba(255, 126, 126, 0.22),
    0 0 26px rgba(255, 88, 88, 0.26),
    0 0 52px rgba(255, 52, 52, 0.16);
}
#opening .vault-preview:hover .chest::before,
#opening .vault-preview .chest:hover::before {
  background: radial-gradient(circle, rgba(255, 74, 74, 0.78), rgba(255, 74, 74, 0.22) 48%, transparent 76%);
  filter: blur(24px);
  opacity: 1;
}
#opening .vault-preview:hover .chest-image,
#opening .vault-preview .chest:hover .chest-image {
  filter: brightness(1.08) saturate(1.08) drop-shadow(0 0 14px rgba(255, 96, 96, 0.28));
}
#opening .chest-big {
  width: clamp(220px, 26vw, 360px);
  height: auto;
  aspect-ratio: 2 / 3;
  margin-bottom: 12px;
  border-radius: 0;
  overflow: visible;
  filter: drop-shadow(0 28px 38px rgba(0,0,0,.7));
}
#opening .chest-big::before {
  left: 8%;
  right: 8%;
  bottom: 12px;
  height: 28%;
  filter: blur(24px);
}
#opening.shaking .chest-big { animation: chest-shake .38s linear; }
#opening .chest-big.is-opening .chest-image {
  animation: chest-charge .36s ease-out forwards;
  filter: brightness(1.2) saturate(1.24);
}
#opening .chest-big.is-opened .chest-image {
  animation: chest-opened .42s cubic-bezier(.2,.9,.22,1) forwards;
}
#opening .chest-big .chest-image {
  object-fit: contain;
  object-position: center center;
  transform: scale(1);
}
#opening .vault-preview:hover .chest-big .chest-image,
#opening .vault-preview .chest-big:hover .chest-image {
  transform: scale(1.02);
}
@keyframes chest-shake {
  0%, 100% { transform: translate(0,0) rotate(0) scale(1); }
  18% { transform: translate(-8px,-3px) rotate(-2.4deg) scale(1.02); }
  36% { transform: translate(8px,2px) rotate(2.1deg) scale(1.03); }
  54% { transform: translate(-6px,3px) rotate(-1.6deg) scale(1.02); }
  72% { transform: translate(6px,-2px) rotate(1.4deg) scale(1.03); }
}
@keyframes chest-charge {
  0% { transform: scale(1.04) translateY(0) rotate(0); opacity: 1; }
  45% { transform: scale(1.08) translateY(-6px) rotate(-1.2deg); opacity: 1; }
  100% { transform: scale(1.12) translateY(-10px) rotate(1.2deg); opacity: .92; }
}
@keyframes chest-opened {
  0% { transform: scale(.92) translateY(10px); opacity: .5; }
  55% { transform: scale(1.08) translateY(-10px); opacity: 1; }
  100% { transform: scale(1.12) translateY(-6px); opacity: 1; }
}

#opening.hero-reveal-active {
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.10), transparent 22%),
    radial-gradient(circle at 50% 44%, rgba(255, 87, 74, 0.24), transparent 30%),
    radial-gradient(circle at 50% 58%, rgba(137, 81, 255, 0.24), rgba(2, 4, 8, 0.98) 66%);
}
#opening.hero-reveal-active .scene {
  cursor: pointer;
}
#opening.hero-reveal-active .stage {
  width: min(94vw, 680px);
  gap: 12px;
}
#opening.hero-reveal-active .remaining-pill {
  top: 18px;
  right: 18px;
  bottom: auto;
  background: linear-gradient(180deg, rgba(34, 18, 25, 0.94), rgba(10, 9, 14, 0.98));
  border: 1px solid rgba(255, 190, 154, 0.24);
  border-radius: 999px;
  padding: 8px 12px;
  box-shadow: 0 0 24px rgba(255, 94, 57, 0.12), 0 14px 24px rgba(0,0,0,.34);
}
#opening.hero-reveal-active .remaining-pill .num {
  width: 44px;
  height: 44px;
  background: linear-gradient(180deg, #ffb59b, #ff5b35);
  border-color: rgba(255,255,255,.92);
  box-shadow: 0 0 18px rgba(255, 102, 44, 0.28);
}
#opening.hero-reveal-active .tap-hint {
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: #ffe7d8;
  text-shadow: 0 2px 0 rgba(0,0,0,.55), 0 0 18px rgba(255, 255, 255, 0.18);
}

.hero-reveal {
  position: relative;
  width: min(92vw, 620px);
  min-height: min(76vh, 660px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px 56px;
  isolation: isolate;
}
.hero-reveal__halo,
.hero-reveal__flash {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  border-radius: 50%;
}
.hero-reveal__halo {
  width: min(66vw, 520px);
  height: min(66vw, 520px);
  background:
    radial-gradient(circle, rgba(255,255,255,.24) 0 12%, rgba(255,255,255,.10) 18%, transparent 60%),
    radial-gradient(circle, rgba(255, 91, 59, 0.22), rgba(139, 99, 255, 0.12) 42%, transparent 72%);
  filter: blur(8px);
  opacity: .95;
  animation: hero-reveal-halo 4.8s ease-in-out infinite;
}
.hero-reveal__flash {
  width: min(44vw, 340px);
  height: min(44vw, 340px);
  background: radial-gradient(circle, rgba(255,255,255,.92) 0 18%, rgba(255,255,255,.35) 34%, transparent 72%);
  mix-blend-mode: screen;
  opacity: 0;
}
.hero-reveal__card {
  position: relative;
  width: min(100%, 460px);
  padding: 22px 18px 24px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(28, 24, 40, 0.96), rgba(11, 12, 20, 0.98));
  border: 1px solid rgba(255,255,255,.10);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.03),
    0 24px 40px rgba(0,0,0,.52),
    0 0 42px var(--hero-accent);
  overflow: hidden;
  text-align: center;
}
.hero-reveal__card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,.12), transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,.04), transparent 38%, rgba(0,0,0,.20));
  pointer-events: none;
}
.hero-reveal__card::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 30px;
  border: 1px solid var(--hero-accent);
  opacity: .6;
  pointer-events: none;
}
.hero-reveal__topline,
.hero-reveal__progress,
.hero-reveal__rarity {
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 900;
}
.hero-reveal__topline {
  color: #ffe9df;
  font-size: 13px;
  opacity: .88;
}
.hero-reveal__progress {
  margin-top: 6px;
  color: var(--hero-accent);
  font-size: 12px;
}
.hero-reveal__portrait {
  position: relative;
  width: min(100%, 310px);
  aspect-ratio: 0.9 / 1.18;
  margin: 18px auto 14px;
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 24%, rgba(255,255,255,.22), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.16), rgba(12, 13, 22, 0.96) 70%);
  border: 1px solid var(--hero-accent);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 0 24px rgba(255,255,255,.08),
    0 0 24px var(--hero-accent);
}
.hero-reveal__portrait::before,
.hero-reveal__portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-reveal__portrait::before {
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,.18), transparent 22%),
    linear-gradient(180deg, rgba(255,255,255,.08), transparent 36%);
  z-index: 2;
}
.hero-reveal__portrait::after {
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.hero-reveal__portrait--image {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px 18px 12px;
}
.hero-reveal__art {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  flex: 1 1 auto;
  align-self: stretch;
  object-fit: contain;
  object-position: center bottom;
  display: block;
  position: relative;
  z-index: 1;
  transform: scale(1);
  filter: saturate(1.08) contrast(1.08) brightness(.96);
}
.hero-reveal__silhouette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,.18), transparent 18%),
    linear-gradient(180deg, rgba(255,255,255,.12), rgba(0,0,0,.92) 65%);
  mix-blend-mode: multiply;
  opacity: .88;
}
.hero-reveal__portrait--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,.16), transparent 28%),
    linear-gradient(180deg, rgba(70, 36, 92, 0.96), rgba(15, 12, 24, 0.98));
}
.hero-reveal__fallbackMark {
  position: relative;
  z-index: 1;
  font-size: clamp(96px, 18vw, 160px);
  font-weight: 900;
  line-height: 1;
  color: #fff3ea;
  text-shadow:
    0 0 18px rgba(255,255,255,.28),
    0 0 38px rgba(255,255,255,.20);
}
.hero-reveal__name {
  margin-top: 6px;
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-shadow: 0 3px 0 rgba(0,0,0,.55), 0 0 18px rgba(255,255,255,.14);
}
.hero-reveal__rarity {
  margin-top: 8px;
  font-size: 13px;
  color: var(--hero-accent);
}

#opening.hero-reveal-active .hero-reveal--impact .hero-reveal__card {
  animation: hero-reveal-impact-pop .26s ease-out both;
}
#opening.hero-reveal-active .hero-reveal--impact .hero-reveal__flash {
  animation: hero-reveal-flash .42s ease-out both;
}
#opening.hero-reveal-active .hero-reveal--silhouette .hero-reveal__portrait,
#opening.hero-reveal-active .hero-reveal--impact .hero-reveal__portrait {
  animation: hero-reveal-silhouette-spin 1.1s linear infinite;
}
#opening.hero-reveal-active .hero-reveal--silhouette .hero-reveal__art,
#opening.hero-reveal-active .hero-reveal--impact .hero-reveal__art {
  filter: grayscale(1) brightness(.05) contrast(1.35);
}
#opening.hero-reveal-active .hero-reveal--silhouette .hero-reveal__silhouette,
#opening.hero-reveal-active .hero-reveal--impact .hero-reveal__silhouette {
  opacity: 1;
}
#opening.hero-reveal-active .hero-reveal--final .hero-reveal__card {
  animation: hero-reveal-final-pop .34s cubic-bezier(.2,.9,.22,1) both;
}
#opening.hero-reveal-active .hero-reveal--final .hero-reveal__flash {
  animation: hero-reveal-flash-final .52s ease-out both;
}
#opening.hero-reveal-active .hero-reveal--final .hero-reveal__art {
  animation: hero-reveal-art-pop .4s cubic-bezier(.2,.9,.22,1) both;
  filter: saturate(1.14) brightness(1.02) contrast(1.1);
}
#opening.hero-reveal-active .hero-reveal--final .hero-reveal__silhouette {
  opacity: 0;
}
#opening.hero-reveal-active .hero-reveal--final .hero-reveal__portrait--fallback .hero-reveal__fallbackMark {
  animation: hero-reveal-final-pop .34s cubic-bezier(.2,.9,.22,1) both;
}

@keyframes hero-reveal-halo {
  0%, 100% { transform: translate(-50%, -50%) scale(.96) rotate(0deg); opacity: .78; }
  50% { transform: translate(-50%, -50%) scale(1.05) rotate(10deg); opacity: 1; }
}
@keyframes hero-reveal-silhouette-spin {
  0% { transform: scale(1.02) rotate(0deg); }
  100% { transform: scale(1.02) rotate(360deg); }
}
@keyframes hero-reveal-impact-pop {
  0% { transform: translateY(18px) scale(.88); opacity: .35; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes hero-reveal-final-pop {
  0% { transform: scale(.88); }
  60% { transform: scale(1.03); }
  100% { transform: scale(1); }
}
@keyframes hero-reveal-art-pop {
  0% { transform: scale(1.08); opacity: .3; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes hero-reveal-flash {
  0% { transform: translate(-50%, -50%) scale(.24); opacity: 0; }
  35% { opacity: .94; }
  100% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; }
}
@keyframes hero-reveal-flash-final {
  0% { transform: translate(-50%, -50%) scale(.6); opacity: .08; }
  45% { opacity: .66; }
  100% { transform: translate(-50%, -50%) scale(2.4); opacity: 0; }
}

.reward-title {
  font-size: 36px; font-weight: 900; letter-spacing: 2px;
  text-shadow: 0 4px 0 var(--ink), 0 0 25px rgba(255,255,255,.5);
  line-height: .96;
  margin-bottom: 10px;
  max-width: min(92vw, 620px);
  text-wrap: balance;
}
.reward-art {
  width: 220px; height: 220px;
  display: flex; align-items: center; justify-content: center;
  font-size: 120px;
  filter: drop-shadow(0 0 30px rgba(255,255,200,.7));
  animation: pop .35s ease-out;
  margin-bottom: 6px;
}
@keyframes pop {
  0%   { transform: scale(.2); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.reward-amount {
  font-size: 56px; font-weight: 900;
  text-shadow: 0 4px 0 var(--ink);
  line-height: .95;
  margin-top: 0;
  max-width: min(88vw, 420px);
  text-align: center;
}
.reward-amount--pp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.reward-sub {
  background: linear-gradient(180deg, #7a3cdb, #3d1c70);
  border: 3px solid #fff; border-radius: 16px;
  padding: 6px 24px;
  font-size: 28px; font-weight: 900;
  box-shadow: 0 4px 0 rgba(0,0,0,.3);
  width: min(88vw, 420px);
  max-width: 100%;
  line-height: 1.08;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}
.progress-bar {
  width: min(88vw, 320px); height: 32px;
  background: rgba(0,0,0,.5);
  border: 3px solid var(--ink); border-radius: 16px;
  overflow: hidden; position: relative;
  box-shadow: 0 4px 0 rgba(0,0,0,.3);
}
.progress-bar > .fill {
  height: 100%;
  background: linear-gradient(90deg, #6cf08e, #22c358);
  transition: width .6s ease;
}
.progress-bar > .text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
}
.upgrade-tag {
  color: #ffd76a; font-weight: 900; font-size: 18px;
  margin-top: 4px;
  text-shadow: 0 2px 0 var(--ink);
  max-width: min(88vw, 420px);
  line-height: 1.15;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}
.remaining-pill {
  position: absolute; bottom: 30px; right: 24px; z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-weight: 900;
}
.remaining-pill .rp-label { font-size: 11px; opacity: .85; }
.remaining-pill .num {
  width: 40px; height: 40px;
  background: #ff5c2c; border: 3px solid #fff;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 0 rgba(0,0,0,.3);
}
.tap-hint {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  font-weight: 900; font-size: 16px; letter-spacing: 1px;
  width: min(88vw, 420px);
  max-width: calc(100vw - 120px);
  line-height: 1.15;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  opacity: .7; animation: blink 1.4s linear infinite;
}
#opening.opening-awaiting-open .tap-hint {
  top: auto;
  bottom: clamp(96px, 16vh, 156px);
  transform: translateX(-50%);
  opacity: .92;
  text-shadow: 0 2px 0 rgba(0,0,0,.58), 0 0 24px rgba(255,255,255,.14);
}
@keyframes blink { 50% { opacity: .25; } }

/* Summary */
.summary {
  display: flex; flex-direction: column; align-items: center; gap: 24px;
  text-align: center;
}
.summary .row {
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
}
.sum-card {
  background: linear-gradient(180deg, #2d3553, #1b2138);
  border: 3px solid #fff;
  border-radius: 12px;
  padding: 10px 8px;
  width: 112px;
  min-height: 112px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  box-shadow: 0 4px 0 rgba(0,0,0,.3);
}
.sum-card .ic { font-size: 52px; }
.sum-card .v  { font-weight: 900; font-size: 14px; }
.sum-card .ic--hero,
.sum-card .ic--equipment {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.46);
}
.sum-card-hero-art,
.sum-card-equipment-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(255, 120, 80, 0.28));
}
.sum-card-hero-fallback {
  font-size: 44px;
}

/* ----- Modal & Toast ----- */
.modal-bg {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.78);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.modal-bg.active { display: flex; }
.modal {
  background: linear-gradient(180deg, rgba(20, 22, 29, 0.98), rgba(11, 13, 18, 0.99));
  border: 1px solid rgba(255, 133, 78, 0.34);
  border-radius: 18px;
  max-width: 420px; width: 100%;
  padding: 18px; text-align: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 16px 34px rgba(0,0,0,.42);
}
.modal h2 {
  background: linear-gradient(180deg, rgba(53, 27, 25, 0.98), rgba(25, 14, 16, 0.99));
  margin: -18px -18px 14px;
  padding: 12px;
  border-radius: 14px 14px 0 0;
  font-size: 22px; letter-spacing: .08em;
  color: var(--ui-text);
}
.modal p { line-height: 1.5; margin: 8px 0; }
.modal.mini-result-modal {
  align-self: center;
  height: auto;
}
.modal.mini-result-modal > div {
  display: grid;
  gap: 8px;
}
.modal.mini-result-modal p {
  margin: 0;
}
.modal.time-played-modal {
  align-self: center;
  height: auto;
}
.modal.time-played-modal > div {
  display: grid;
  gap: 8px;
}
.modal.time-played-modal p {
  margin: 0;
}
.modal.boss-detail-modal {
  width: min(960px, calc(100vw - 24px));
  max-width: min(960px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: hidden;
}
.modal.boss-detail-modal > div {
  min-width: 0;
  max-height: min(640px, calc(100dvh - 236px));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(118, 34, 24, 0.96) rgba(6, 3, 4, 0.94);
}
.modal.boss-detail-modal > div::-webkit-scrollbar {
  width: 10px;
}
.modal.boss-detail-modal > div::-webkit-scrollbar-track {
  background: rgba(6, 3, 4, 0.94);
  border-radius: 999px;
}
.modal.boss-detail-modal > div::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(72, 18, 12, 0.98), rgba(140, 34, 24, 0.96));
  border: 2px solid rgba(6, 3, 4, 0.94);
  border-radius: 999px;
}
.modal.boss-victory-modal {
  width: min(520px, calc(100vw - 24px));
  max-width: min(520px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  align-self: center;
  overflow: hidden;
}
.modal.boss-victory-modal h2 {
  line-height: 1.15;
}
.modal.boss-victory-modal > div {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-height: calc(100dvh - 220px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
  scrollbar-width: thin;
}
.modal.boss-victory-modal p {
  margin: 0;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-wrap: balance;
}
.boss-rewarded-offer-modal {
  width: min(560px, 100%);
  max-width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  padding: 18px;
}
.boss-rewarded-offer-modal::-webkit-scrollbar {
  width: 0;
  height: 0;
}
.boss-rewarded-offer {
  display: grid;
  gap: clamp(14px, 2.4vw, 20px);
}
.boss-rewarded-offer__lead {
  margin: 0;
  color: #fff2ea;
  font-size: clamp(16px, 2.4vw, 22px);
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
  text-wrap: balance;
}
.boss-rewarded-offer__visual {
  display: flex;
  justify-content: center;
}
.boss-rewarded-offer__chest {
  --chest-glow: rgba(255, 101, 45, 0.42);
  position: relative;
  width: clamp(200px, 42vw, 310px);
  aspect-ratio: 2 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 24px 34px rgba(0,0,0,.56));
}
.boss-rewarded-offer__chest::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 14px;
  height: 28%;
  background: radial-gradient(circle, rgba(255, 92, 46, 0.82), rgba(255, 92, 46, 0.18) 48%, transparent 76%);
  filter: blur(24px);
  opacity: .96;
  pointer-events: none;
}
.boss-rewarded-offer__image {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}
.boss-rewarded-offer__actions {
  display: grid;
  gap: 10px;
  width: min(100%, 320px);
  margin: 0 auto;
}
.boss-rewarded-offer__watch,
.boss-rewarded-offer__decline {
  width: 100%;
  min-height: 54px;
  padding-inline: 16px;
  font-size: clamp(14px, 2vw, 18px);
}
.boss-rewarded-offer__watch {
  border-color: rgba(255, 134, 116, 0.72);
  background: linear-gradient(180deg, #ff6657, #b51212);
  box-shadow: 0 0 0 1px rgba(255,255,255,.06) inset, 0 0 24px rgba(255, 69, 69, 0.22), 0 12px 24px rgba(0,0,0,.28);
}
.boss-rewarded-offer__decline {
  border-color: rgba(183, 189, 204, 0.26);
  background: linear-gradient(180deg, rgba(88, 94, 110, 0.98), rgba(49, 53, 63, 0.98));
  color: #f2f4f8;
  box-shadow: 0 10px 20px rgba(0,0,0,.22);
}
.boss-rewarded-offer__watch:disabled,
.boss-rewarded-offer__decline:disabled {
  opacity: .72;
  cursor: wait;
}
@media (min-width: 1024px) {
  .boss-rewarded-offer-modal {
    width: min(620px, calc(100vw - 40px));
    max-width: min(620px, calc(100vw - 40px));
    max-height: calc(100dvh - 32px);
    padding: 16px 20px 18px;
  }
  .boss-rewarded-offer {
    gap: 12px;
  }
  .boss-rewarded-offer__lead {
    font-size: clamp(17px, 1.45vw, 21px);
    line-height: 1.28;
  }
  .boss-rewarded-offer__chest {
    width: clamp(190px, 24vh, 270px);
  }
  .boss-rewarded-offer__actions {
    gap: 8px;
    width: min(100%, 360px);
  }
  .boss-rewarded-offer__watch,
  .boss-rewarded-offer__decline {
    min-height: 50px;
  }
}
.chest-info-card {
  text-align: left;
}
.chest-info-lead {
  color: rgba(255, 236, 222, 0.88);
}
.chest-info-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.chest-info-row {
  display: grid;
  grid-template-columns: minmax(96px, 112px) 1fr;
  gap: 10px;
  align-items: start;
  padding: 8px 10px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(35, 22, 24, 0.82), rgba(14, 12, 18, 0.88));
  border: 1px solid rgba(255, 151, 110, 0.16);
}
.chest-info-row__label {
  color: #ffbf8d;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 12px;
}
.chest-info-row__value {
  color: #fff7ef;
  line-height: 1.45;
}
.modal-back-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 151, 110, 0.34);
  background: linear-gradient(180deg, rgba(31, 22, 24, 0.98), rgba(13, 10, 14, 0.98));
  color: #fff3ea;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(255, 102, 44, 0.12), 0 8px 18px rgba(0,0,0,.26);
}
.modal.settings {
  max-width: 520px;
  max-height: calc(100dvh - max(20px, env(safe-area-inset-top, 0px)) - max(20px, env(safe-area-inset-bottom, 0px)));
  text-align: left;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal.settings h2 {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.settings-modal__title {
  display: block;
  min-width: 0;
  text-align: center;
}
.settings-modal__spacer {
  display: block;
  width: 40px;
  height: 40px;
}
.modal.settings > div {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.modal.settings > div::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

body.yandex-debug-ads-active .modal {
  max-width: min(420px, calc(var(--yandex-debug-safe-width) - 24px));
}

body.yandex-debug-ads-active .modal.boss-detail-modal {
  width: min(960px, calc(var(--yandex-debug-safe-width) - 24px));
  max-width: min(960px, calc(var(--yandex-debug-safe-width) - 24px));
  max-height: calc(var(--yandex-debug-safe-height) - 24px);
}

body.yandex-debug-ads-active .modal.boss-detail-modal > div {
  max-height: min(640px, calc(var(--yandex-debug-safe-height) - 236px));
}

body.yandex-debug-ads-active .modal.boss-victory-modal {
  width: min(520px, calc(var(--yandex-debug-safe-width) - 24px));
  max-width: min(520px, calc(var(--yandex-debug-safe-width) - 24px));
  max-height: calc(var(--yandex-debug-safe-height) - 24px);
}

body.yandex-debug-ads-active .modal.boss-victory-modal > div {
  max-height: calc(var(--yandex-debug-safe-height) - 220px);
}

body.yandex-debug-ads-active .boss-rewarded-offer-modal {
  max-width: min(560px, calc(var(--yandex-debug-safe-width) - 24px));
  max-height: calc(var(--yandex-debug-safe-height) - 24px);
}
.settings-modal__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  position: absolute; left: 50%; top: 80px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(28, 18, 21, 0.98), rgba(13, 10, 14, 0.99));
  color: var(--ui-text); padding: 10px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 127, 71, 0.32);
  font-weight: 900; z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity .25s, top .25s;
  box-shadow: 0 0 18px rgba(255, 95, 35, 0.18), 0 12px 24px rgba(0,0,0,.28);
}
.toast.show { opacity: 1; top: 96px; }

/* ----- Particles ----- */
.particles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.particle {
  position: absolute; width: 12px; height: 12px;
  border-radius: 50%; will-change: transform, opacity;
}

/* ----- Responsive ----- */
@media (max-width: 720px) {
  .vault { width: 150px; height: 186px; }
  .chest { width: 138px; height: 138px; }
  .reward-art { font-size: 90px; width: 160px; height: 160px; }
  .reward-amount { font-size: 42px; }
  .reward-title  { font-size: 28px; }
  .reward-sub { width: min(90vw, 360px); font-size: 22px; padding: 8px 18px; }
  .progress-bar { width: min(90vw, 280px); }
  .upgrade-tag { font-size: 16px; max-width: min(90vw, 360px); }
  .vault-row { gap: 10px; }
  .side-btn  { min-width: 0; padding: 8px 10px; font-size: 12px; }
  .side-btn .ic { font-size: 18px; }
  .player-pill { min-width: 110px; }
  .banner { font-size: 13px; padding: 10px; }
  .hero-reveal { width: min(94vw, 560px); min-height: min(74vh, 620px); padding: 20px 12px 52px; }
  .hero-reveal__card { width: min(100%, 400px); border-radius: 24px; }
  .hero-reveal__portrait { width: min(100%, 280px); }
  .hero-reveal__portrait--image { padding: 16px 14px 10px; }
  .hero-reveal__name { font-size: clamp(22px, 4.4vw, 32px); }
  .hero-reveal__rarity { font-size: 12px; }
  #opening.hero-reveal-active .remaining-pill { top: 14px; right: 14px; }
  #opening .chest-big { width: min(62vw, 300px); }
}
@media (min-width: 1400px) {
  .vault-row {
    gap: clamp(34px, 2.4vw, 58px);
  }
  .vault {
    width: 232px;
  }
  .vault .label {
    width: min(100%, 224px);
  }
}

/* Narrow PC / laptop viewports: four lobby vaults in one row (below 1025px compact lobby unchanged; scoped to #lobby only) */
@media (min-width: 1025px) and (max-width: 1399px) {
  #lobby .vault-row {
    min-width: 0;
    flex-wrap: nowrap;
    gap: clamp(10px, 1.1vw, 22px);
  }

  #lobby .vault-row.starter-guided {
    gap: clamp(10px, 1.5vw, 26px);
  }

  #lobby .vault {
    width: 196px;
    height: 212px;
    flex: 0 0 auto;
  }

  #lobby .chest {
    width: 166px;
    height: 166px;
    border-radius: 24px;
  }

  #lobby .vault[data-box="bigChest"],
  #lobby .vault[data-box="largeChest"],
  #lobby .vault[data-box="equipChest"] {
    min-height: 282px;
  }

  #lobby .vault[data-box="smallChest"] {
    min-height: 282px;
    padding-top: 48px;
  }

  #lobby .vault[data-box="smallChest"] .chest {
    margin-top: -22px;
  }

  #lobby .vault[data-box="smallChest"] .free-vault-top {
    width: 170px;
  }

  #lobby .vault[data-box="smallChest"] .timer-overlay,
  #lobby .vault[data-box="smallChest"].locked .timer-overlay {
    width: min(calc(100% - 22px), 166px);
  }

  #lobby .vault .label {
    width: min(100%, 196px);
    font-size: 16px;
    padding: 6px 12px;
  }

  #lobby .vault .label .hud-icon.coin,
  #lobby .vault .label .hud-icon.gem {
    width: 38px;
    height: 38px;
  }

  #lobby .free-ad-btn,
  #lobby .chest-ad-btn {
    width: min(100%, 196px);
  }
}

@media (max-width: 520px) {
  .vault-row { gap: 6px; }
  .vault { width: 110px; height: 146px; }
  .chest { width: 104px; height: 104px; border-radius: 20px; }
  .vault .label  { font-size: 14px; padding: 4px 10px; }
  .vault .label .hud-icon.coin,
  .vault .label .hud-icon.gem { width: 34px; height: 34px; }
  .free-vault-top { gap: 6px; left: 10px; right: 40px; }
  .free-ad-btn { min-width: 54px; padding: 5px 8px; font-size: 10px; }
  .free-ad-meta { font-size: 9px; margin-top: 4px; }
  .mem-grid { gap: 6px; }
  .mem-front, .mem-back { font-size: 28px; }
  .hero-reveal { width: 100vw; min-height: min(72vh, 560px); padding: 16px 8px 46px; }
  .hero-reveal__card { width: min(100%, 340px); padding: 18px 14px 18px; border-radius: 22px; }
  .hero-reveal__portrait { width: min(100%, 240px); border-radius: 22px; margin: 14px auto 12px; }
  .hero-reveal__portrait--image { padding: 14px 12px 10px; }
  .hero-reveal__topline { font-size: 11px; }
  .hero-reveal__name { font-size: 22px; letter-spacing: .06em; }
  .hero-reveal__rarity { font-size: 11px; letter-spacing: .14em; }
  .hero-reveal__fallbackMark { font-size: 112px; }
  #opening .chest-big { width: min(66vw, 260px); }
  #opening.hero-reveal-active .remaining-pill { top: 10px; right: 10px; }
  #opening.hero-reveal-active .tap-hint { bottom: 12px; font-size: 13px; letter-spacing: .12em; }
}

/* ============== DAILY LOGIN ============== */
#dailyLogin {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 2.4vw, 18px);
  background:
    radial-gradient(circle at 50% 16%, rgba(170, 44, 29, 0.22), transparent 30%),
    linear-gradient(180deg, rgba(7, 5, 8, 0.95), rgba(4, 3, 5, 0.98));
  z-index: 1000;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#dailyLogin::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

#dailyLogin::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 30% 25%, rgba(255, 109, 70, 0.08), transparent 22%),
    radial-gradient(circle at 75% 70%, rgba(173, 34, 28, 0.06), transparent 20%);
  opacity: 0.16;
}

#dailyLogin.active { display: flex; }
#dailyLogin > * { position: relative; z-index: 1; }

.d-modal {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1040px, 100%);
  max-height: calc(100dvh - clamp(20px, 6vw, 40px));
  padding: 24px 20px 20px;
  border-radius: 24px;
  border: 1px solid rgba(236, 116, 90, 0.26);
  background: linear-gradient(180deg, rgba(22, 14, 18, 0.97), rgba(9, 7, 10, 0.99));
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03),
    0 18px 44px rgba(0, 0, 0, 0.52),
    0 0 40px rgba(181, 50, 32, 0.16);
  color: #f4ece7;
  text-align: center;
  overflow: hidden;
}

.d-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0 12%, rgba(255, 110, 72, 0.06) 13%, transparent 14% 48%, rgba(255, 110, 72, 0.04) 49%, transparent 50% 100%),
    radial-gradient(circle at 50% 0, rgba(255, 121, 84, 0.08), transparent 35%);
  opacity: 0.8;
}

.d-header {
  position: relative;
  margin-bottom: 16px;
}

.d-title {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #f5e4db;
  text-shadow: 0 0 20px rgba(212, 71, 48, 0.24);
}

.d-sub {
  max-width: 700px;
  margin: 8px auto 0;
  color: rgba(236, 221, 214, 0.78);
  font-weight: 600;
  line-height: 1.45;
}

.d-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
  margin-bottom: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 4px 6px 6px 0;
}

.d-card {
  position: relative;
  min-height: 228px;
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 126, 74, 0.16);
  background: linear-gradient(180deg, rgba(25, 20, 24, 0.96), rgba(11, 10, 13, 0.98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
  overflow: hidden;
}

.d-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 118, 74, 0.06), transparent 30%),
    radial-gradient(circle at 100% 0, rgba(255, 118, 74, 0.08), transparent 35%);
}

.d-card.is-now {
  transform: translateY(-4px);
  border-color: rgba(255, 149, 104, 0.46);
  box-shadow:
    0 0 0 1px rgba(255, 168, 122, 0.08),
    0 0 30px rgba(187, 59, 35, 0.20),
    0 16px 28px rgba(0, 0, 0, 0.36);
}
.d-card.is-claiming {
  border-color: rgba(255, 214, 160, 0.92);
  box-shadow:
    0 0 0 2px rgba(255, 214, 160, 0.22),
    0 0 42px rgba(255, 125, 72, 0.42),
    0 20px 36px rgba(0, 0, 0, 0.42);
  animation: daily-claim-pulse .72s ease forwards;
}
.d-card.is-claiming .d-card__tag {
  background: linear-gradient(180deg, #ffd7a8, #ff8357);
  border-color: rgba(255, 249, 240, 0.9);
  color: #2b0d07;
  box-shadow: 0 0 18px rgba(255, 144, 85, 0.34);
}
.d-card.is-claiming .d-card__effect {
  color: #ffe0bf;
  text-shadow: 0 0 18px rgba(255, 152, 96, 0.28);
}
.d-card.is-claiming .d-card__symbol {
  transform: scale(1.08);
  filter: drop-shadow(0 0 18px rgba(255, 152, 96, 0.34));
}

.d-card.is-past {
  opacity: 0.74;
  filter: saturate(0.76);
}

.d-card.is-future {
  opacity: 0.92;
}

.d-card__day {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(236, 221, 214, 0.56);
}

.d-card__tag {
  align-self: flex-start;
  margin-top: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 141, 97, 0.18);
  background: rgba(46, 18, 20, 0.86);
  color: #f0cabc;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.d-card.is-now .d-card__tag {
  background: linear-gradient(180deg, #ffb08b, #ff6d46);
  border-color: rgba(255, 231, 216, 0.72);
  color: #220c08;
}

.d-card__symbol {
  margin-top: 14px;
  font-size: 34px;
  line-height: 1;
}

.d-card__title {
  margin-top: 14px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #f5e7df;
}

.d-card__flavor {
  margin-top: 8px;
  min-height: 56px;
  color: rgba(236, 221, 214, 0.72);
  font-size: 13px;
  line-height: 1.35;
}

.d-card__effect {
  margin-top: auto;
  padding-top: 14px;
  color: #ffbe9e;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.d-streak {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 129, 80, 0.20);
  background: linear-gradient(180deg, rgba(41, 17, 20, 0.94), rgba(14, 10, 12, 0.98));
  color: #ffd7c3;
  font-weight: 700;
}

.d-streak.muted {
  color: rgba(236, 221, 214, 0.68);
  opacity: 1;
}

#dailyClaim {
  justify-self: center;
  min-width: 280px;
  margin-top: 16px;
  padding: 14px 28px;
  border-radius: 999px;
  border: 1px solid rgba(255, 136, 86, 0.36);
  background: linear-gradient(180deg, rgba(53, 22, 24, 0.98), rgba(15, 11, 14, 0.98));
  color: #f7ede8;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 0 24px rgba(190, 58, 37, 0.16), 0 10px 22px rgba(0,0,0,.30);
}

#dailyClaim:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 164, 121, 0.55);
}
#dailyClaim.is-busy {
  opacity: .78;
  cursor: wait;
}

@keyframes daily-claim-pulse {
  0% {
    transform: translateY(-4px) scale(1);
  }
  32% {
    transform: translateY(-8px) scale(1.03);
  }
  100% {
    transform: translateY(-4px) scale(1);
  }
}

@media (max-width: 1024px) {
  #dailyLogin {
    padding:
      max(8px, env(safe-area-inset-top, 0px))
      8px
      max(8px, env(safe-area-inset-bottom, 0px));
  }

  .d-modal {
    max-height: calc(100dvh - max(16px, env(safe-area-inset-top, 0px)) - max(16px, env(safe-area-inset-bottom, 0px)));
    padding: 20px 16px 18px;
  }

  .d-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .d-card {
    min-height: 212px;
    display: grid;
    grid-template-rows: auto auto auto auto minmax(48px, 1fr) auto;
    align-content: start;
    row-gap: 6px;
    padding: 12px 10px;
  }

  .d-card__tag,
  .d-card__symbol,
  .d-card__title,
  .d-card__flavor,
  .d-card__effect {
    margin-top: 0;
  }

  .d-card__symbol {
    font-size: 28px;
  }

  .d-card__title {
    font-size: 14px;
    line-height: 1.2;
  }

  .d-card__flavor {
    min-height: 48px;
    font-size: 11px;
    line-height: 1.3;
  }

  .d-card__effect {
    align-self: end;
    padding-top: 8px;
    font-size: 11px;
    line-height: 1.25;
  }
}

@media (max-width: 720px) {
  #dailyLogin {
    align-items: stretch;
  }

  .d-modal {
    max-height: calc(100dvh - max(12px, env(safe-area-inset-top, 0px)) - max(12px, env(safe-area-inset-bottom, 0px)));
    padding: 18px 14px 16px;
  }

  .d-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding-right: 2px;
  }

  .d-card {
    min-height: 188px;
    grid-template-rows: auto auto auto auto minmax(44px, 1fr) auto;
  }

  .d-title {
    font-size: clamp(22px, 6vw, 30px);
    letter-spacing: 0.10em;
  }

  .d-card__symbol {
    font-size: 30px;
  }

  .d-card__title {
    font-size: 15px;
  }

  .d-card__flavor {
    min-height: 44px;
    font-size: 12px;
  }

  .d-card__effect {
    padding-top: 10px;
    letter-spacing: 0.08em;
  }

  #dailyClaim {
    width: 100%;
    min-width: 0;
    margin-top: 14px;
  }
}

/* ============== TROPHY ROAD ============== */
#trophyRoad {
  position: relative;
  min-height: 0;
  overflow: hidden;
  padding: 20px 20px 28px;
  box-sizing: border-box;
  background:
    radial-gradient(circle at 50% 0, rgba(233, 89, 66, 0.16), transparent 28%),
    radial-gradient(circle at 18% 24%, rgba(255, 112, 79, 0.08), transparent 16%),
    radial-gradient(circle at 84% 20%, rgba(255, 128, 88, 0.06), transparent 14%),
    linear-gradient(180deg, rgba(8, 5, 7, 0.98), rgba(17, 8, 10, 0.98) 42%, rgba(8, 5, 6, 0.98));
}
#trophyRoad::before,
#trophyRoad::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#trophyRoad::before {
  background:
    radial-gradient(circle at 32% 38%, rgba(255,255,255,.035), transparent 2px) 0 0 / 180px 180px,
    radial-gradient(circle at 70% 68%, rgba(255,255,255,.03), transparent 2px) 0 0 / 220px 220px;
  opacity: .46;
  animation: tr-spores 12s linear infinite;
}
#trophyRoad::after {
  background:
    linear-gradient(112deg, transparent 0 18%, rgba(163, 46, 36, 0.12) 19%, transparent 20% 48%, rgba(163, 46, 36, 0.08) 49%, transparent 50% 100%),
    linear-gradient(64deg, transparent 0 22%, rgba(255, 127, 88, 0.06) 23%, transparent 24% 100%);
  opacity: .5;
  filter: blur(10px);
}
#trophyRoad > * { position: relative; z-index: 1; }
#trophyRoad .screen-header {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  grid-template-rows: auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 14px;
  padding-top: 4px;
}
#trophyRoad .screen-header .back-btn {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  position: relative;
  z-index: 3;
}
#trophyRoad .screen-title {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  width: 100%;
  padding: 0;
  justify-self: center;
  text-align: center;
  font-weight: 900;
  font-size: 26px;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-shadow: 0 0 22px rgba(233, 89, 66, 0.22);
  pointer-events: none;
}
.home-btn {
  width: 44px; height: 44px;
  border: 1px solid var(--ui-border-strong);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(31, 22, 24, 0.98), rgba(13, 10, 14, 0.98));
  color: var(--ui-text);
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(255, 102, 44, 0.14), 0 8px 18px rgba(0,0,0,.3);
}
.tr-sub {
  max-width: 960px;
  margin: 0 auto 22px;
  padding: 14px 18px;
  border-radius: 20px;
  text-align: center;
  color: #cdb9b1;
  font-weight: 700;
  line-height: 1.55;
  background: linear-gradient(180deg, rgba(31, 10, 12, 0.82), rgba(11, 7, 8, 0.9));
  border: 1px solid rgba(211, 84, 66, 0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
.tr-track {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  gap: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 34px 18px 46px;
  scroll-snap-type: x mandatory;
  align-items: flex-start;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(27, 10, 12, 0.7), rgba(9, 6, 7, 0.84)),
    radial-gradient(circle at 50% 0, rgba(233, 89, 66, 0.08), transparent 70%);
  border: 1px solid rgba(200, 76, 59, 0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 18px 36px rgba(0,0,0,.22);
}
.tr-track,
.tr-track * {
  touch-action: pan-x;
}
.tr-track.drag-scroll-enabled {
  touch-action: pan-x;
}
.drag-scroll-enabled {
  cursor: grab;
  touch-action: pan-y;
}
.drag-scroll-enabled.is-dragging {
  cursor: grabbing;
  user-select: none;
}
.tr-track.is-dragging {
  scroll-snap-type: none;
}
.tr-track::before,
.tr-track::after {
  content: "";
  position: absolute;
  left: 28px;
  right: 28px;
  border-radius: 999px;
  pointer-events: none;
}
.tr-track::before {
  top: 46%;
  height: 12px;
  background: linear-gradient(90deg, rgba(63, 20, 18, 0.18), rgba(178, 48, 40, 0.92), rgba(63, 20, 18, 0.18));
  box-shadow: 0 0 18px rgba(233, 89, 66, 0.22), 0 0 44px rgba(233, 89, 66, 0.12);
  animation: tr-vein-pulse 3.8s ease-in-out infinite;
}
.tr-track::after {
  top: calc(46% - 10px);
  bottom: calc(54% - 10px);
  border-top: 1px solid rgba(214, 84, 64, 0.24);
  border-bottom: 1px solid rgba(214, 84, 64, 0.16);
  filter: blur(4px);
}
.tr-track::-webkit-scrollbar { height: 8px; }
.tr-track::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 4px; }

.tr-node {
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 176px;
  position: relative;
  z-index: 1;
}
.tr-node.next { min-width: 228px; transform: translateY(-8px); }
.tr-badge {
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 900;
  color: #fff1ea;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  background: linear-gradient(180deg, rgba(104, 24, 19, 0.98), rgba(38, 11, 12, 0.98));
  border: 1px solid rgba(243, 129, 98, 0.42);
  box-shadow: 0 0 22px rgba(233, 89, 66, 0.16);
  margin-bottom: 4px;
}
.tr-card {
  width: 100%;
  min-height: 226px;
  padding: 16px 14px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,.04);
  background:
    linear-gradient(180deg, rgba(51, 13, 16, 0.98), rgba(15, 8, 10, 0.98)),
    radial-gradient(circle at 50% 0, rgba(255,255,255,.04), transparent 70%);
  box-shadow: 0 14px 28px rgba(0,0,0,.34);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, opacity .22s ease;
}
.tr-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 26%, rgba(241, 110, 83, 0.16), transparent 34%),
    linear-gradient(122deg, transparent 0 19%, rgba(255,255,255,.03) 20%, transparent 22% 100%);
  pointer-events: none;
}
.tr-card::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 10px;
  height: 16px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(241, 110, 83, 0.16), transparent 72%);
  filter: blur(12px);
  pointer-events: none;
}
.tr-node:hover .tr-card {
  transform: translateY(-4px);
  border-color: rgba(246, 132, 98, 0.26);
}
.tr-node.next .tr-card {
  border-color: rgba(244, 129, 96, 0.44);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.02),
    0 0 24px rgba(233, 89, 66, 0.18),
    0 18px 34px rgba(0,0,0,.38);
  animation: tr-next-breathe 2.8s ease-in-out infinite;
}
.tr-node.claimed .tr-card {
  opacity: .56;
  filter: grayscale(.18) saturate(.88);
}
.tr-node.future .tr-card {
  opacity: .82;
}
.tr-node.reachable:not(.next) .tr-card {
  border-color: rgba(230, 113, 88, 0.28);
  box-shadow: 0 0 18px rgba(233, 89, 66, 0.1), 0 14px 28px rgba(0,0,0,.34);
}

.tr-relic {
  width: 110px;
  height: 122px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 34%, rgba(255,255,255,.08), transparent 24%),
    linear-gradient(180deg, rgba(68, 19, 20, 0.98), rgba(18, 8, 10, 0.98));
  border: 1px solid rgba(255,255,255,.05);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.tr-relic::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.03);
}
.tr-node.next .tr-relic {
  width: 126px;
  height: 142px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 0 18px rgba(241, 110, 83, 0.16);
}
.tr-veins,
.tr-veins::before,
.tr-veins::after {
  content: "";
  position: absolute;
  display: block;
  border-radius: 999px;
  pointer-events: none;
}
.tr-veins {
  left: 12px;
  right: 12px;
  top: 28px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(127, 44, 37, 0.9), transparent);
}
.tr-veins::before {
  left: 10px;
  right: 18px;
  bottom: -44px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(127, 44, 37, 0.88), transparent);
}
.tr-veins::after {
  width: 2px;
  top: -16px;
  bottom: -56px;
  right: 24px;
  background: linear-gradient(180deg, transparent, rgba(127, 44, 37, 0.74), transparent);
}
.tr-core {
  width: 76px;
  height: 76px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
  box-shadow: inset 0 0 18px rgba(255,255,255,.08), 0 0 24px rgba(241, 110, 83, 0.18);
}
.tr-node.next .tr-core {
  width: 92px;
  height: 92px;
  border-radius: 28px;
}
.tr-core-glyph {
  font-size: 42px;
  line-height: 1;
  filter: drop-shadow(0 0 14px rgba(255,255,255,.08));
}
.tr-node.next .tr-core-glyph { font-size: 52px; }
.tr-core-image {
  width: 92%;
  height: 92%;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(255, 142, 90, 0.18));
}

.tr-card--coins .tr-core {
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 248, 207, 0.26), transparent 28%),
    radial-gradient(circle at 50% 50%, rgba(255, 190, 88, 0.92), rgba(118, 52, 12, 0.96));
}
.tr-card--gems .tr-core {
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,.24), transparent 24%),
    radial-gradient(circle at 50% 50%, rgba(119, 215, 255, 0.86), rgba(11, 57, 86, 0.96));
}
.tr-card--hero .tr-core {
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,.22), transparent 24%),
    radial-gradient(circle at 50% 50%, rgba(255, 157, 97, 0.88), rgba(97, 32, 18, 0.96));
}
.tr-card--box-small .tr-core {
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,.16), transparent 24%),
    radial-gradient(circle at 50% 50%, rgba(127, 197, 255, 0.56), rgba(33, 64, 104, 0.94));
}
.tr-card--box-big .tr-core {
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,.16), transparent 24%),
    radial-gradient(circle at 50% 50%, rgba(169, 130, 255, 0.54), rgba(49, 21, 85, 0.94));
}
.tr-card--box-large .tr-core {
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,.18), transparent 24%),
    radial-gradient(circle at 50% 50%, rgba(255, 174, 58, 0.78), rgba(98, 46, 12, 0.96));
}
.tr-card--box-apex .tr-core {
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,.18), transparent 24%),
    radial-gradient(circle at 50% 50%, rgba(255, 81, 54, 0.82), rgba(88, 20, 14, 0.96));
}

.tr-state {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(16, 8, 9, 0.88);
  border: 1px solid rgba(255,255,255,.05);
  color: #f2ddd2;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.tr-node.next .tr-state,
.tr-node.reachable:not(.claimed) .tr-state {
  background: linear-gradient(180deg, rgba(94, 24, 19, 0.98), rgba(35, 11, 12, 0.98));
  border-color: rgba(244, 129, 96, 0.34);
  box-shadow: 0 0 18px rgba(233, 89, 66, 0.12);
}
.tr-label {
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(43, 15, 16, 0.92), rgba(17, 9, 10, 0.96));
  border: 1px solid rgba(255,255,255,.05);
  color: #fff0e8;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: .08em;
  text-align: center;
  text-transform: uppercase;
  line-height: 1.35;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.tr-claim {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: 7px 12px;
  font-size: 10px;
  letter-spacing: .14em;
  border-radius: 10px;
  box-shadow: 0 0 14px rgba(233, 89, 66, 0.12);
}
.tr-check,
.tr-lock {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(12, 7, 8, 0.82);
  border: 1px solid rgba(255,255,255,.05);
}
.tr-check {
  color: #88f4aa;
  font-size: 18px;
}
.tr-lock {
  color: #f1dfd7;
  font-size: 16px;
  opacity: .94;
}
.tr-threshold {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(40, 12, 13, 0.96), rgba(13, 8, 9, 0.98));
  border: 1px solid rgba(224, 100, 76, 0.22);
  color: #ffdfcf;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: .12em;
  text-transform: uppercase;
  box-shadow: 0 10px 18px rgba(0,0,0,.24);
}
.tr-threshold-ic { font-size: 14px; }
.tr-counter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  align-self: flex-end;
  margin: 36px 0 10px auto;
  padding: 12px 18px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(88, 21, 18, 0.96), rgba(23, 8, 10, 0.98));
  border: 1px solid rgba(245, 125, 92, 0.34);
  color: #fff0e6;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: .08em;
  box-shadow: 0 0 22px rgba(233, 89, 66, 0.14), 0 12px 24px rgba(0,0,0,.24);
  z-index: 5;
  flex: 0 0 auto;
}
.tr-claim-all {
  position: sticky;
  right: auto;
  left: auto;
  bottom: 22px;
  align-self: flex-end;
  flex: 0 0 auto;
  margin: 18px 0 0 auto;
  max-width: min(320px, calc(100% - 8px));
  box-sizing: border-box;
  z-index: 5;
  transition: box-shadow .22s ease, opacity .22s ease, filter .22s ease, transform .18s ease;
}
@media (min-width: 1280px) and (pointer: fine) {
  #trophyRoad {
    padding: 26px 28px 38px;
  }
  #trophyRoad .screen-header {
    margin-bottom: 18px;
    padding-top: 6px;
  }
  .tr-sub {
    margin-bottom: 24px;
    padding: 16px 22px;
  }
  .tr-counter {
    margin-top: 40px;
    margin-bottom: 12px;
  }
  .tr-claim-all {
    bottom: 26px;
    margin-top: 20px;
  }
}

@media (min-width: 1700px) {
  #pass .pass-buy-col {
    flex: 0 0 236px;
  }

  #pass .pbc-card {
    max-width: 228px;
    width: 100%;
    background-size: 100% 100%, min(88%, 220px) auto;
    background-position: center, 50% calc(100% - 134px);
    background-repeat: no-repeat, no-repeat;
  }

  #pass .pass-col {
    min-width: 220px;
  }

  #pass .ptk-card {
    width: 220px;
  }

  #pass .ptk-relic {
    width: min(218px, 96%);
    min-height: 176px;
  }

  #pass .ptk-core {
    width: min(168px, 84%);
    height: min(168px, 84%);
  }

  #pass .ptk-ic {
    font-size: clamp(48px, 2.8vw, 66px);
  }

  #pass .ptk-coins .ptk-ic .currency-mark,
  #pass .ptk-gems .ptk-ic .currency-mark {
    --currency-icon-limit: 92px;
  }

  #pass[data-pass-view="rewards"] .pass-col {
    min-width: 220px;
  }

  #pass[data-pass-view="rewards"] .ptk-card {
    width: 220px;
  }

  #pass[data-pass-view="rewards"] .ptk-relic {
    width: min(218px, 96%);
    min-height: 176px;
  }

  #pass[data-pass-view="rewards"] .ptk-core {
    width: min(168px, 84%);
    height: min(168px, 84%);
  }

  #pass[data-pass-view="rewards"] .ptk-ic {
    font-size: clamp(48px, 2.8vw, 66px);
  }

  #pass[data-pass-view="rewards"] .ptk-coins .ptk-ic .currency-mark,
  #pass[data-pass-view="rewards"] .ptk-gems .ptk-ic .currency-mark {
    --currency-icon-limit: 92px;
  }
}

@media (min-width: 1900px) and (min-height: 1000px) and (pointer: fine) {
  #pass .pass-buy-col {
    flex: 0 0 244px;
  }

  #pass .pbc-card {
    max-width: 236px;
    background-size: 100% 100%, min(90%, 228px) auto;
    background-position: center, 50% calc(100% - 138px);
  }

  #pass .pass-col {
    min-width: 232px;
  }

  #pass .ptk-card {
    width: 232px;
  }

  #pass .ptk-relic {
    width: min(228px, 96%);
    min-height: 186px;
  }

  #pass .ptk-core {
    width: min(176px, 85%);
    height: min(176px, 85%);
  }

  #pass .ptk-ic {
    font-size: clamp(50px, 2.9vw, 70px);
  }

  #pass .ptk-coins .ptk-ic .currency-mark,
  #pass .ptk-gems .ptk-ic .currency-mark {
    --currency-icon-limit: 96px;
  }
}
.tr-claim-all.is-ready {
  box-shadow: 0 0 24px rgba(255, 112, 74, 0.34), 0 16px 28px rgba(0,0,0,.28);
  filter: saturate(1.06) brightness(1.03);
}
.tr-claim-all.is-idle {
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
  filter: saturate(.76) brightness(.9);
  opacity: .72;
}
@media (max-width: 1024px), (pointer: coarse) and (max-width: 1366px) {
  #trophyRoad {
    min-height: 100dvh;
    height: 100dvh;
    min-height: 100svh;
    padding: max(4px, env(safe-area-inset-top, 0px)) 10px calc(88px + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  #trophyRoad::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }
  #trophyRoad .screen-header {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    grid-template-rows: auto;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 4px;
    padding-top: calc(max(8px, env(safe-area-inset-top, 0px)) + 12px);
    padding-left: 12px;
    padding-right: 12px;
    min-height: 56px;
    width: 100%;
    box-sizing: border-box;
    background: linear-gradient(180deg, rgba(4, 5, 9, 0.96), rgba(3, 1, 2, 0.98));
  }
  #trophyRoad .screen-header .back-btn {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    z-index: 2;
  }
  #trophyRoad .screen-title {
    width: 100%;
    margin: 0 auto;
    padding: 0;
    font-size: clamp(19px, 2.8vw, 24px);
    line-height: 1.05;
    letter-spacing: .08em;
    text-wrap: balance;
    pointer-events: none;
  }
  .tr-sub {
    margin: 2px auto 8px;
    padding: 10px 12px;
    line-height: 1.35;
    text-align: center;
  }
  .tr-track {
    flex: 0 0 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
    scroll-snap-type: y proximity;
    padding: 20px 10px 18px;
    align-items: stretch;
  }
  .tr-track,
  .tr-track * {
    touch-action: auto;
  }
  .tr-track.drag-scroll-enabled {
    touch-action: auto;
  }
  .tr-track::before,
  .tr-track::after {
    content: none;
    display: none;
  }
  .tr-node {
    width: 100%;
    min-width: 0;
    max-width: none;
    scroll-snap-align: start;
  }
  .tr-node.next {
    min-width: 0;
    transform: none;
  }
  .tr-card {
    min-height: 224px;
  }
  .tr-counter {
    position: relative;
    right: auto;
    bottom: auto;
    align-self: center;
    margin: 14px auto 0;
  }
  .tr-counter + .tr-claim-all {
    margin-top: 18px;
  }
  .tr-claim-all {
    position: sticky;
    display: block;
    left: 0;
    right: 0;
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    margin: 18px auto 0;
    width: min(320px, calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    max-width: calc(100% - 8px);
    box-sizing: border-box;
    transform: none;
    z-index: 120;
    pointer-events: auto;
    touch-action: manipulation;
  }
  .tr-claim-all.is-ready {
    box-shadow: 0 0 26px rgba(255, 112, 74, 0.42), 0 18px 30px rgba(0,0,0,.32);
    opacity: 1;
  }
  .tr-claim-all.is-idle {
    box-shadow: 0 10px 18px rgba(0,0,0,.16);
    filter: saturate(.7) brightness(.88);
    opacity: .64;
  }
  .tr-claim-all:active {
    transform: translateY(2px);
  }
}

@keyframes tr-vein-pulse {
  0%, 100% { opacity: .82; transform: translateY(-50%) scaleX(1); }
  50% { opacity: 1; transform: translateY(-50%) scaleX(1.025); }
}
@keyframes tr-next-breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes tr-spores {
  from { transform: translateY(0); }
  to { transform: translateY(22px); }
}
@media (prefers-reduced-motion: reduce) {
  #trophyRoad::before,
  .tr-track::before,
  .tr-node.next .tr-card {
    animation: none;
  }
}

/* ============== PROFILE ============== */
#profile {
  padding: 14px;
  container-type: inline-size;
  overflow: hidden;
}
#profile .pf-tabs {
  flex: 0 0 auto;
}
#profile .pf-pane {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
#profile .screen-header {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center; gap: 10px;
  margin-bottom: 14px;
}
#profile .screen-title {
  text-align: center;
  font-weight: 900;
  font-size: 24px;
  letter-spacing: 1px;
  text-shadow: 0 3px 0 #0c1a4a;
}

.pf-tabs,
.pf-subtabs {
  display: flex;
  gap: 8px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto 14px;
}
.pf-tab,
.pf-subtab {
  flex: 1;
  border: 3px solid #0c1a4a;
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 900;
  letter-spacing: .8px;
  color: #f7ece8;
  background: linear-gradient(180deg, rgba(40, 12, 13, 0.96), rgba(13, 8, 9, 0.98));
}
.pf-tab.active,
.pf-subtab.active {
  color: #241108;
  background: linear-gradient(180deg, #ffcf45, #ff9a2e);
}
.pf-pane[hidden] { display: none !important; }
.pf-pane {
  min-height: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.pf-pane::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.pf-pane--equipment {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}
.pf-pane--leaderboard {
  min-height: 0;
}

.pf-top {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  align-items: center;
  background: rgba(0,0,0,.25);
  padding: 14px 16px 14px 18px;
  border-radius: 18px;
  border: 3px solid #0c1a4a;
  margin: 0 auto 14px;
  max-width: 720px;
  width: 100%;
}
.pf-avatar {
  --pf-avatar-accent: #7fb6ff;
  position: relative;
  width: 100px; height: 100px;
  border-radius: 18px;
  background: linear-gradient(180deg, #2d3553, #0f1530);
  display: flex; align-items: center; justify-content: center;
  font-size: 56px;
  overflow: visible;
  box-shadow: 0 8px 18px rgba(0,0,0,.22);
}
.pf-avatar::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 22px;
  border: 4px solid var(--pf-avatar-accent);
  box-shadow: 0 0 18px rgba(127, 182, 255, 0.18);
  pointer-events: none;
}
.pf-avatar-art {
  position: relative;
  z-index: 1;
  width: 118%;
  height: 118%;
  object-fit: cover;
  object-position: center 18%;
  transform: scale(1.02);
  clip-path: inset(0 round 18px);
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.28));
}
.pf-avatar-glyph {
  position: relative;
  z-index: 1;
  font-size: 56px;
  line-height: 1;
}
.pf-center { display: flex; flex-direction: column; gap: 8px; }
.pf-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pf-lvl {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(180deg,#ffcf45,#ff9a2e);
  color: #3a1b00;
  font-weight: 900; font-size: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 3px solid #0c1a4a;
}
.pf-name {
  flex: 1; min-width: 120px;
  background: rgba(0,0,0,.35);
  border: 2px solid rgba(255,255,255,.18);
  border-radius: 12px;
  padding: 8px 14px;
  font-weight: 900; font-size: 18px;
}
.pf-xpbar {
  position: relative;
  height: 22px;
  background: rgba(0,0,0,.35);
  border: 2px solid #0c1a4a;
  border-radius: 12px;
  overflow: hidden;
}
.pf-xpbar > div:first-child {
  height: 100%;
  background: linear-gradient(180deg,#4ade80,#1b9f4a);
  transition: width .2s ease;
}
.pf-xptext {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 13px;
  text-shadow: 0 1px 0 #000;
}
.pf-id {
  opacity: .75; font-weight: 800; font-size: 13px;
}

.pf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}
.pf-equipment {
  max-width: 1160px;
  width: 100%;
  margin: 0 auto;
}
.pf-equipment-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1.08fr) minmax(260px, .72fr);
  grid-template-areas: "card side";
  gap: 16px;
  align-items: start;
  min-height: 0;
}
.pf-equipment-layout--enhance {
  grid-template-columns: 1fr;
  grid-template-areas: none;
  gap: 12px;
}
.pf-enhance-workspace {
  display: grid;
  grid-template-columns: minmax(300px, .82fr) minmax(0, 1.18fr);
  gap: 12px;
  align-items: start;
  min-width: 0;
}
.pf-equipment-side {
  grid-area: side;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  align-content: start;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
}
@container (max-width: 1320px) {
  #profile .pf-equipment {
    max-width: 100%;
  }

  #profile .pf-equipment-layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, .88fr);
    gap: 12px;
  }

  #profile .pf-equipment-side {
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
  }

  #profile .pf-equipment-toolbar {
    padding: 10px;
    border-radius: 18px;
  }

  #profile .pf-equipment-card {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 14px;
    padding: 16px;
  }

  #profile .pf-equipment-copy {
    display: grid;
    gap: 8px;
    text-align: center;
  }

  #profile .pf-equipment-frame {
    width: min(100%, 430px);
    max-height: min(66vh, 760px);
  }

  #profile .pf-equipment-summary {
    justify-content: center;
    text-align: center;
  }

  #profile .pf-equipment-mode-tabs {
    gap: 6px;
  }

  #profile .pf-enhance-workspace {
    grid-template-columns: 1fr;
  }
}

@container (max-width: 1180px) {
  #profile .pf-equipment-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "side"
      "card";
    gap: 12px;
  }

  #profile .pf-equipment-side {
    grid-template-rows: auto auto;
    gap: 10px;
  }

  #profile .pf-equipment-toolbar {
    position: static;
    top: auto;
    z-index: auto;
    padding: 10px;
    border-radius: 18px;
  }

  #profile .pf-equipment-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
  }

  #profile .pf-equipment-copy {
    display: grid;
    gap: 8px;
    text-align: center;
  }

  #profile .pf-equipment-frame {
    width: min(100%, 420px);
    max-height: none;
    justify-self: center;
  }

  #profile .pf-equipment-summary {
    justify-content: center;
    text-align: center;
  }

  #profile .pf-equipment-inventory {
    margin-top: 0;
    max-height: min(48vh, 420px);
  }

  #profile .pf-equipment-inventory--enhance {
    min-height: 0;
    max-height: none;
  }
}
.pf-equipment-toolbar {
  display: grid;
  gap: 10px;
  align-self: start;
  padding: 12px;
  border-radius: 20px;
  border: 2px solid rgba(255, 39, 39, 0.28);
  background: linear-gradient(180deg, rgba(16, 8, 10, 0.94), rgba(0, 0, 0, 0.98));
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}
.pf-equipment-card {
  grid-area: card;
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1.1fr);
  gap: 18px;
  align-items: center;
  padding: 18px;
  border-radius: 24px;
  border: 3px solid rgba(255, 39, 39, 0.48);
  background: linear-gradient(180deg, rgba(8, 4, 5, 0.96), rgba(0, 0, 0, 0.98));
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.16), 0 18px 34px rgba(0,0,0,.38);
}
.pf-equipment-kicker {
  color: #ffb39a;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .18em;
}
.pf-equipment-title {
  margin-top: 8px;
  color: #fff3eb;
  font-size: 28px;
  font-weight: 900;
}
.pf-equipment-text {
  margin-top: 10px;
  color: #ffe8d5;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}
.pf-equipment-frame {
  --pf-slot-head-top: 15.2%;
  --pf-slot-hand-left: 24.8%;
  --pf-slot-hand-right: 75.2%;
  --pf-slot-hand-top: 40.7%;
  --pf-slot-legs-left: 28.8%;
  --pf-slot-shoes-left: 71.2%;
  --pf-slot-lower-top: 73%;
  --pf-slot-body-top: 47.3%;
  position: relative;
  align-self: start;
  width: min(100%, 500px);
  aspect-ratio: 1086 / 1448;
  min-height: 0;
  max-height: min(78vh, 980px);
  border-radius: 22px;
  border: 2px solid rgba(255, 39, 39, 0.45);
  background: #000;
  overflow: hidden;
  justify-self: center;
}
.pf-equipment-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
}
.pf-equipment-summary {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 215, 106, .32);
  background: rgba(0, 0, 0, .56);
  color: #fff7df;
  font-size: 14px;
  font-weight: 900;
}
.pf-equipment-summary span {
  color: #ffd76a;
}
.pf-equipment-slot-map {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.pf-equipment-slot {
  appearance: none;
  position: absolute;
  width: clamp(84px, 17%, 136px);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 10px 8px;
  border-radius: 20px;
  border: 2px dashed rgba(255, 39, 39, .18);
  background: rgba(0, 0, 0, .02);
  text-align: center;
  font: inherit;
  cursor: pointer;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  overflow: hidden;
  min-width: 0;
}
.pf-equipment-slot--head { left: 50%; top: var(--pf-slot-head-top); }
.pf-equipment-slot--handLeft { left: var(--pf-slot-hand-left); top: var(--pf-slot-hand-top); }
.pf-equipment-slot--handRight { left: var(--pf-slot-hand-right); top: var(--pf-slot-hand-top); }
.pf-equipment-slot--legs { left: var(--pf-slot-legs-left); top: var(--pf-slot-lower-top); }
.pf-equipment-slot--shoes { left: var(--pf-slot-shoes-left); top: var(--pf-slot-lower-top); }
.pf-equipment-slot--body {
  left: 50%;
  top: var(--pf-slot-body-top);
  width: clamp(72px, 13.4%, 116px);
  border-radius: 18px;
  background: rgba(0, 0, 0, .68);
  border-color: rgba(255, 39, 39, .26);
}
.pf-equipment-slot.filled {
  border-style: solid;
  border-color: var(--rar, #ffd76a);
  background: rgba(0, 0, 0, .86);
  box-shadow:
    inset 0 0 16px rgba(255,255,255,.05),
    0 0 16px color-mix(in srgb, var(--rar, #ffd76a) 32%, transparent);
}
.pf-equipment-slot-label {
  color: #ffb39a;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
}
.pf-equipment-slot-art {
  width: min(72%, 68px);
  height: min(72%, 68px);
  object-fit: contain;
  object-position: center center;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .45));
}
.pf-equipment-slot-name,
.pf-equipment-slot-power,
.pf-equipment-slot-empty {
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.1;
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
  max-width: 100%;
}
.pf-equipment-slot-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pf-equipment-slot-power {
  color: #ffd76a;
}
.pf-equipment-slot-empty {
  color: #8f7a70;
}
.pf-equipment-inventory {
  margin-top: 0;
  padding: 16px;
  border-radius: 22px;
  border: 2px solid rgba(255, 39, 39, 0.34);
  background: linear-gradient(180deg, rgba(5, 3, 4, 0.92), rgba(0, 0, 0, 0.98));
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
@media (min-width: 1025px) {
  .pf-equipment-layout {
    align-items: start;
    gap: 12px;
  }
  .pf-equipment-toolbar {
    position: static;
    top: auto;
    z-index: auto;
    padding: 10px 12px;
  }
  .pf-equipment-inventory {
    align-self: stretch;
    margin-top: -2px;
    min-height: clamp(340px, calc(100dvh - 320px), 760px);
    max-height: none;
  }
  .pf-equipment-layout--enhance > .pf-equipment-toolbar {
    position: static;
    top: auto;
    z-index: auto;
  }
  .pf-equipment-inventory--enhance {
    min-height: clamp(320px, calc(100dvh - 312px), 760px);
  }
}
.pf-equipment-inventory::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.pf-equipment-inventory-title {
  color: #ffe8d5;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.pf-equipment-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.pf-equipment-mode-btn {
  position: relative;
  background: linear-gradient(180deg, rgba(34, 17, 18, 0.98), rgba(12, 9, 11, 0.98));
  border-color: rgba(255, 95, 95, .24);
  transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.pf-equipment-mode-btn.is-active {
  color: #fff4ef;
  border-color: rgba(255, 74, 74, .9);
  background: linear-gradient(180deg, #ff5a43, #b31217);
  box-shadow: 0 0 0 1px rgba(255,255,255,.05) inset, 0 0 22px rgba(255, 52, 52, .28), 0 12px 22px rgba(0,0,0,.28);
}
.pf-equipment-mode-btn:not(.is-active) {
  color: #f6d8cf;
}
.pf-enhance-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 18px;
  border: 2px solid rgba(255, 215, 106, .34);
  background:
    radial-gradient(circle at 50% 0, rgba(255, 215, 106, .12), transparent 70%),
    linear-gradient(180deg, rgba(31, 12, 8, .94), rgba(0, 0, 0, .96));
}
.pf-enhance-panel--unified {
  margin-bottom: 0;
  align-self: start;
}
.pf-enhance-panel[hidden] {
  display: none;
}
.pf-enhance-copy {
  display: grid;
  gap: 4px;
  color: #ffe8d5;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}
.pf-enhance-copy b {
  color: #ffd76a;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.pf-enhance-panel--compact {
  gap: 12px;
}
.pf-enhance-help-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}
.pf-enhance-help-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #ffe8d5;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.pf-enhance-help-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd76a, #ff8f3a);
  box-shadow: 0 0 14px rgba(255, 162, 76, .42);
  flex: 0 0 auto;
  display: none;
}
.pf-enhance-help-toggle {
  order: -1;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255, 215, 106, .34);
  background: linear-gradient(180deg, rgba(46, 18, 12, .96), rgba(8, 7, 10, .98));
  color: #ffd76a;
  font: inherit;
  font-size: 16px;
  font-weight: 1000;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 10px 18px rgba(0,0,0,.24);
  flex: 0 0 auto;
}
.pf-enhance-help-bubble {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 215, 106, .28);
  background: rgba(0, 0, 0, .56);
  color: #fff0df;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.42;
}
.pf-enhance-help-bubble[hidden] {
  display: none;
}
.pf-enhance-slots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pf-enhance-slot {
  appearance: none;
  min-height: 172px;
  display: grid;
  grid-template-rows: auto minmax(58px, 1fr) auto auto;
  justify-items: center;
  align-content: start;
  gap: 8px;
  padding: 12px 10px;
  border-radius: 16px;
  border: 2px dashed rgba(255, 215, 106, .28);
  background: rgba(0, 0, 0, .58);
  color: #fff5e6;
  text-align: center;
  font: inherit;
  cursor: pointer;
  overflow: hidden;
  min-width: 0;
}
.pf-enhance-slot.filled {
  border-style: solid;
  border-color: var(--rar, #ffd76a);
  box-shadow: 0 0 18px color-mix(in srgb, var(--rar, #ffd76a) 28%, transparent);
}
.pf-enhance-slot.is-picking {
  border-color: #ffd76a;
  box-shadow: 0 0 0 2px rgba(255, 215, 106, .16), 0 0 20px rgba(255, 215, 106, .26);
}
.pf-enhance-slot:focus-visible,
.pf-enhance-slot:hover {
  border-color: rgba(255, 215, 106, .58);
}
.pf-enhance-slot-label,
.pf-enhance-meta {
  color: #ffb39a;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.pf-enhance-slot-art {
  width: clamp(64px, 5vw, 86px);
  height: clamp(64px, 5vw, 86px);
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  object-position: center center;
}
.pf-enhance-slot-name,
.pf-enhance-slot-power,
.pf-enhance-slot-empty {
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.12;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-wrap: balance;
}
.pf-enhance-slot-power,
.pf-enhance-meta {
  color: #ffd76a;
}
.pf-enhance-slot.filled .pf-enhance-slot-empty {
  color: #ffb39a;
}
.pf-enhance-btn {
  width: 100%;
  justify-content: center;
}
.pf-enhance-picker {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.pf-enhance-picker-copy {
  display: grid;
  gap: 4px;
  color: #ffe8d5;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}
.pf-enhance-picker-copy b {
  color: #ffd76a;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.pf-enhance-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
  min-width: 0;
}
.pf-enhance-picker-grid > * {
  min-width: 0;
}
.pf-enhance-picker-empty {
  padding: 12px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 215, 106, .26);
  background: rgba(0, 0, 0, .34);
  color: #d9b7a2;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.42;
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.pf-equipment-inventory--enhance {
  height: auto;
  min-height: clamp(320px, calc(100dvh - 330px), 760px);
  max-height: none;
}
.pf-equipment-item--picker {
  min-height: 0;
  height: 100%;
  align-self: start;
}
.pf-equipment-inventory-empty {
  color: #d9b7a2;
  font-size: 13px;
  font-weight: 800;
}
.pf-equipment-inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 12px;
}
.pf-equipment-inventory--enhance .pf-equipment-inventory-grid {
  grid-template-columns: repeat(auto-fit, minmax(88px, 104px));
  justify-content: start;
  align-content: start;
  gap: 10px;
}
.pf-equipment-item {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  border: 2px solid var(--rar, rgba(255,255,255,.32));
  background: radial-gradient(circle at 50% 20%, rgba(255,255,255,.1), rgba(0,0,0,.82) 62%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 10px 18px rgba(0,0,0,.28);
  position: relative;
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  min-width: 0;
  align-content: start;
}
.pf-equipment-item:hover {
  z-index: 10;
}
.pf-equipment-item-count {
  position: absolute;
  top: 6px;
  right: 7px;
  z-index: 2;
  min-width: 28px;
  padding: 2px 7px 1px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff4a4a, #b80f0f);
  color: #ffefef;
  font-size: 16px;
  font-weight: 1000;
  line-height: 1.05;
  text-align: center;
  text-shadow:
    -1px 0 #120404,
    0 1px #120404,
    1px 0 #120404,
    0 -1px #120404,
    0 0 6px rgba(0, 0, 0, .56);
  box-shadow: 0 0 0 1px rgba(255, 214, 214, .16), 0 8px 16px rgba(0, 0, 0, .24);
}
.pf-equipment-item.equipped {
  border-color: #ffd76a;
  box-shadow: inset 0 0 18px rgba(255,215,106,.08), 0 0 22px rgba(255,39,39,.18), 0 12px 22px rgba(0,0,0,.34);
}
.pf-equipment-item.enhance-selected {
  border-color: #ffd76a;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 215, 106, .22), rgba(0,0,0,.84) 64%),
    linear-gradient(180deg, rgba(40, 10, 8, .8), rgba(0,0,0,.9));
}
.pf-equipment-item-art {
  width: 100%;
  aspect-ratio: 1;
  max-width: 100%;
  display: block;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(0,0,0,.4);
  padding: 8px;
  box-sizing: border-box;
}
.pf-equipment-inventory--enhance .pf-equipment-item {
  gap: 5px;
  padding: 7px 7px 8px;
  border-radius: 14px;
}
.pf-equipment-inventory--enhance .pf-equipment-item-art {
  padding: 6px;
  aspect-ratio: .9;
  max-height: 92px;
}
.pf-equipment-inventory--enhance .pf-equipment-item-name {
  font-size: 10px;
  line-height: 1.08;
}
.pf-equipment-inventory--enhance .pf-equipment-item-rarity,
.pf-equipment-inventory--enhance .pf-equipment-item-slot,
.pf-equipment-inventory--enhance .pf-equipment-item-power,
.pf-equipment-inventory--enhance .pf-equipment-item-state {
  font-size: 9px;
  line-height: 1.08;
}
.pf-equipment-inventory--enhance .pf-equipment-item-count {
  top: 4px;
  right: 4px;
  min-width: 22px;
  padding: 2px 5px 1px;
  font-size: 13px;
}
.pf-equipment-item-name {
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.pf-equipment-item-rarity {
  color: var(--rar, #ffd84a);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.pf-equipment-item-slot {
  color: #ffb39a;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.pf-equipment-item-power,
.pf-equipment-item-state {
  color: #ffe8b4;
  font-size: 11px;
  font-weight: 900;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.pf-equipment-item-state {
  color: #ffb39a;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.pf-equipment-item:is(:hover, :focus-visible, :active)::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  z-index: 100;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 39, 39, .6);
  background: rgba(0, 0, 0, .94);
  color: #fff3d4;
  font-size: 12px;
  font-weight: 900;
  width: max-content;
  max-width: min(240px, calc(100vw - 40px));
  white-space: normal;
  line-height: 1.35;
  text-align: left;
  box-shadow: 0 0 18px rgba(255, 0, 0, .22);
  pointer-events: none;
}
#leaderProfile {
  overflow-y: auto;
}
@media (max-width: 1024px) {
  #leaderProfile {
    min-height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding:
      max(8px, env(safe-area-inset-top, 0px))
      12px
      calc(12px + env(safe-area-inset-bottom, 0px));
  }

  #profile {
    min-height: 100dvh;
    overflow: hidden;
    padding:
      max(8px, env(safe-area-inset-top, 0px))
      12px
      calc(12px + env(safe-area-inset-bottom, 0px));
  }

  #profile .pf-tabs {
    flex: 0 0 auto;
    margin-bottom: 10px;
  }

  #profile .pf-pane {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  #profile .pf-pane::-webkit-scrollbar {
    display: none;
  }

  #profile .pf-pane--summary {
    display: block;
  }

  #profile .pf-pane--leaderboard {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  #profile .pf-pane--leaderboard .pf-subtabs {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(180deg, rgba(20, 9, 10, 0.96), rgba(3, 1, 2, 0.98));
    border-radius: 14px;
    padding: 8px;
    margin: -8px -8px 2px;
  }

  #profile .pf-pane--equipment {
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }

  #profile .pf-leaderboard-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
  }

  .pf-leaderboard-card {
    grid-template-columns: 68px 52px minmax(0, 1fr) auto;
    gap: 6px;
    padding: 8px;
  }
  .pf-leaderboard-rank {
    font-size: 20px;
  }
  .pf-leaderboard-avatar {
    width: 52px;
    height: 52px;
    border-radius: 12px;
  }
  .pf-leaderboard-avatar .portrait-glyph {
    font-size: 28px;
  }
  .pf-leaderboard-name {
    font-size: 14px;
  }
  .pf-leaderboard-meta {
    font-size: 10px;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .pf-leaderboard-side {
    font-size: 10px;
    gap: 2px;
  }
  .pf-leaderboard-side > div {
    white-space: normal;
  }
  .pf-leaderboard-attack {
    min-width: 88px;
    padding: 6px 10px;
    font-size: 11px;
  }

  .pf-avatar-art {
    display: block;
    width: 92%;
    height: 92%;
    object-fit: contain;
    object-position: center top;
    transform: translateY(4px) scale(.98);
    transform-origin: center top;
    margin: 0 auto;
  }
  .pf-tabs,
  .pf-subtabs {
    max-width: 100%;
    gap: 10px;
  }
  .pf-tab,
  .pf-subtab {
    min-height: 48px;
    padding: 10px;
    font-size: 13px;
  }
  .pf-equipment-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "side"
      "card";
    gap: 12px;
  }
  .pf-equipment-layout--enhance {
    grid-template-columns: 1fr;
    grid-template-areas: none;
    gap: 10px;
  }
  .pf-enhance-workspace {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .pf-equipment-side {
    gap: 12px;
  }
  .pf-equipment-toolbar {
    position: static;
    top: auto;
    z-index: 5;
    padding: 10px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(20, 9, 10, 0.96), rgba(3, 1, 2, 0.98));
    backdrop-filter: blur(10px);
  }
  .pf-equipment-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
  }
  .pf-equipment-copy {
    display: grid;
    gap: 8px;
    text-align: center;
  }
  .pf-equipment-kicker {
    font-size: 11px;
  }
  .pf-equipment-title {
    margin-top: 2px;
    font-size: clamp(20px, 3vw, 26px);
  }
  .pf-equipment-text {
    margin-top: 0;
    font-size: 13px;
  }
  .pf-equipment-frame {
    width: min(100%, 420px);
    aspect-ratio: 1086 / 1448;
    min-height: 0;
    max-height: none;
    justify-self: center;
  }
  .pf-equipment-art {
    object-fit: contain;
    object-position: center top;
  }
  .pf-equipment-summary {
    justify-content: center;
    gap: 8px;
    text-align: center;
  }
  .pf-equipment-slot {
    align-content: start;
    justify-items: center;
    gap: 3px;
    padding: 8px 6px 6px;
  }
  .pf-equipment-inventory {
    position: static;
    bottom: auto;
    z-index: auto;
    padding: 12px 12px calc(14px + env(safe-area-inset-bottom, 0px));
    border-radius: 20px;
    max-height: none;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  }
  .pf-equipment-inventory-title {
    margin-bottom: 10px;
    font-size: 12px;
    text-align: center;
  }
  .pf-enhance-panel {
    gap: 8px;
    padding: 10px;
    margin-bottom: 0;
  }
  .pf-enhance-help-chip,
  .pf-enhance-help-bubble,
  .pf-enhance-picker-copy,
  .pf-enhance-picker-empty {
    font-size: 11px;
  }
  .pf-enhance-help-toggle {
    width: 30px;
    height: 30px;
    font-size: 15px;
  }
  .pf-enhance-slot {
    min-height: 144px;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(52px, 1fr) auto auto;
    padding: 10px 8px;
  }
  .pf-equipment-inventory--enhance {
    position: static;
    bottom: auto;
    z-index: auto;
    margin-top: 0;
    border-radius: 24px;
    min-height: 0;
    max-height: none;
    box-shadow: 0 18px 36px rgba(0, 0, 0, .32);
  }
  .pf-enhance-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pf-equipment-inventory-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }
  .pf-equipment-item {
    gap: 6px;
    padding: 8px;
    border-radius: 14px;
  }
  .pf-equipment-item-count {
    top: 5px;
    right: 5px;
    min-width: 24px;
    padding: 2px 6px 1px;
    font-size: 14px;
  }
  .pf-equipment-item-name {
    font-size: 11px;
  }
  .pf-equipment-item-rarity,
  .pf-equipment-item-slot,
  .pf-equipment-item-power,
  .pf-equipment-item-state {
    font-size: 10px;
  }
  .pf-equipment-item:is(:hover, :focus-visible, :active)::after {
    display: none;
  }
  .vault.tier-equipChest .label {
    gap: 6px;
    padding-inline: 10px;
  }
  .vault.tier-equipChest .label > span:first-child {
    font-size: 14px;
    letter-spacing: .03em;
  }
}
@media (max-width: 760px) {
  .pf-equipment-frame {
    width: min(100%, 360px);
  }
  .pf-equipment-slot {
    width: clamp(54px, 16vw, 84px);
    border-radius: 14px;
    padding: 6px;
  }
  .pf-equipment-slot--body {
    width: clamp(48px, 12vw, 74px);
  }
  .pf-equipment-slot-art {
    width: min(68%, 44px);
    height: min(68%, 44px);
  }
  .pf-equipment-slot-label,
  .pf-equipment-slot-name,
  .pf-equipment-slot-power,
  .pf-equipment-slot-empty {
    font-size: 8px;
  }
  .pf-equipment-inventory {
    max-height: min(32vh, 260px);
  }
  .pf-equipment-inventory--enhance {
    margin-top: 0;
    max-height: none;
  }
  .pf-equipment-inventory-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .pf-equipment-inventory--enhance .pf-equipment-inventory-grid {
    grid-template-columns: repeat(auto-fit, minmax(82px, 96px));
    gap: 8px;
  }
}
@media (max-width: 520px) {
  .pf-grid { grid-template-columns: repeat(2, 1fr); }
  .pf-top  { grid-template-columns: 80px 1fr; }
  .pf-avatar { width: 72px; height: 72px; font-size: 40px; }
  .pf-avatar-art {
    width: 90%;
    height: 90%;
    transform: translateY(3px) scale(.96);
  }
  .pf-tabs,
  .pf-subtabs {
    gap: 8px;
  }
  .pf-tab,
  .pf-subtab {
    min-height: 44px;
    padding: 9px 8px;
    font-size: 12px;
  }
  .pf-equipment-title { font-size: 21px; }
  .pf-equipment-text { font-size: 12px; }
  .pf-equipment-frame { width: min(100%, 304px); }
  .pf-equipment-inventory { padding: 10px 10px calc(12px + env(safe-area-inset-bottom, 0px)); max-height: min(30vh, 230px); }
  .pf-equipment-inventory--enhance { margin-top: 0; max-height: none; }
  .pf-equipment-inventory-title { font-size: 10px; letter-spacing: .08em; }
  .pf-enhance-slots { grid-template-columns: 1fr; gap: 8px; }
  .pf-enhance-slot { min-height: 132px; padding: 8px 6px; }
  .pf-enhance-slot-label,
  .pf-enhance-meta,
  .pf-enhance-slot-name,
  .pf-enhance-slot-power,
  .pf-enhance-slot-empty,
  .pf-enhance-picker-copy,
  .pf-enhance-picker-empty,
  .pf-enhance-help-chip,
  .pf-enhance-help-bubble { font-size: 10px; }
  .pf-enhance-help-toggle { width: 28px; height: 28px; font-size: 14px; }
  .pf-enhance-picker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-equipment-inventory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pf-equipment-item { padding: 8px; gap: 5px; border-radius: 13px; }
  .pf-equipment-inventory--enhance .pf-equipment-inventory-grid {
    grid-template-columns: repeat(auto-fit, minmax(76px, 88px));
    gap: 7px;
  }
  .pf-equipment-inventory--enhance .pf-equipment-item {
    padding: 6px 6px 7px;
    gap: 4px;
    border-radius: 12px;
  }
  .pf-equipment-inventory--enhance .pf-equipment-item-art {
    padding: 5px;
    max-height: 80px;
  }
  .pf-equipment-inventory--enhance .pf-equipment-item-name { font-size: 9px; }
  .pf-equipment-inventory--enhance .pf-equipment-item-rarity,
  .pf-equipment-inventory--enhance .pf-equipment-item-slot,
  .pf-equipment-inventory--enhance .pf-equipment-item-power,
  .pf-equipment-inventory--enhance .pf-equipment-item-state { font-size: 8px; }
  .pf-equipment-inventory--enhance .pf-equipment-item-count {
    min-width: 18px;
    font-size: 11px;
  }
  .pf-equipment-item-count {
    top: 4px;
    right: 4px;
    min-width: 22px;
    padding: 2px 5px 1px;
    font-size: 13px;
  }
  .pf-equipment-item-name { font-size: 10px; }
  .pf-equipment-item-rarity,
  .pf-equipment-item-power,
  .pf-equipment-item-state { font-size: 9px; }
  .pf-leaderboard-card {
    grid-template-columns: 58px 44px minmax(0, 1fr) auto;
    gap: 4px;
    padding: 6px;
  }
  .pf-leaderboard-rank {
    font-size: 18px;
  }
  .pf-leaderboard-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
  }
  .pf-leaderboard-avatar .portrait-glyph {
    font-size: 24px;
  }
  .pf-leaderboard-name {
    font-size: 12px;
  }
  .pf-leaderboard-meta {
    font-size: 9px;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .pf-leaderboard-side {
    font-size: 9px;
    gap: 1px;
  }
  .pf-leaderboard-side > div {
    white-space: normal;
  }
  .pf-leaderboard-attack {
    min-width: 64px;
    padding: 5px 6px;
    font-size: 10px;
  }
}
.pf-leaderboard-list {
  --leaderboard-metric-color: #ffe8b4;
  display: grid;
  gap: 10px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  max-height: min(58vh, 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}
.pf-leaderboard-list::-webkit-scrollbar {
  width: 8px;
}
.pf-leaderboard-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.2);
  border-radius: 999px;
}
.pf-leaderboard-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.pf-leaderboard-gap {
  display: grid;
  grid-template-columns: minmax(36px, 1fr) auto minmax(36px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 4px 6px;
  color: rgba(255, 232, 180, 0.82);
}
.pf-leaderboard-gap__line {
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 172, 112, 0), rgba(255, 172, 112, 0.35), rgba(255, 172, 112, 0));
}
.pf-leaderboard-gap__text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 166, 108, 0.24);
  background: rgba(18, 9, 10, 0.82);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
}
.drag-scroll-enabled-vertical {
  touch-action: pan-y;
  cursor: grab;
}
.drag-scroll-enabled-vertical.is-dragging {
  cursor: grabbing;
  user-select: none;
}
.pf-leaderboard-card {
  display: grid;
  grid-template-columns: 84px 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  border: 3px solid #0c1a4a;
  background: linear-gradient(180deg, rgba(39, 16, 18, 0.96), rgba(13, 8, 10, 0.98));
  color: #fff7e8;
}
.pf-leaderboard-attack {
  min-width: 108px;
  align-self: stretch;
}
.pf-leaderboard-rank {
  font-size: 26px;
  font-weight: 900;
  text-align: center;
  color: #ffd76a;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.pf-leaderboard-avatar {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  overflow: hidden;
  border: 3px solid var(--rar, #7fb6ff);
  background: linear-gradient(180deg, #2d3553, #0f1530);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pf-leaderboard-avatar .portrait-art {
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.32));
}
.pf-leaderboard-avatar .portrait-glyph {
  font-size: 34px;
}
.pf-leaderboard-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.pf-leaderboard-name {
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pf-leaderboard-meta,
.pf-leaderboard-side {
  font-size: 12px;
  font-weight: 800;
  color: var(--leaderboard-metric-color);
  opacity: 1;
  text-shadow: 0 1px 6px rgba(0,0,0,.62);
}
.pf-leaderboard-side {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--leaderboard-metric-color);
}
.pf-leaderboard-you {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  color: #241108;
  background: linear-gradient(180deg, #ffcf45, #ff9a2e);
}
.leader-profile-hero,
.leader-profile-summary,
.leader-profile-grid,
.leader-profile-equipment,
.leader-profile-heroes {
  max-width: 720px;
  width: 100%;
  margin: 0 auto 14px;
}
.leader-profile-hero,
.leader-profile-summary,
.leader-profile-grid > *,
.leader-profile-equipment,
.leader-profile-heroes {
  border-radius: 18px;
  border: 3px solid #0c1a4a;
  background: linear-gradient(180deg, rgba(39, 16, 18, 0.96), rgba(13, 8, 10, 0.98));
}
.leader-profile-hero,
.leader-profile-summary,
.leader-profile-equipment,
.leader-profile-heroes {
  padding: 14px;
}
.leader-profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.leader-profile-tile {
  padding: 12px 10px;
  text-align: center;
}
.leader-profile-heroes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 10px;
}
.leader-profile-equipment-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: center;
}
.leader-profile-equipment-frame {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}
.leader-profile-equipment-copy {
  display: grid;
  gap: 8px;
}
.leader-profile-equipment-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #fff1e8;
  font-weight: 900;
}
.leader-profile-equipment-stats span {
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid rgba(255, 215, 106, 0.22);
  background: rgba(0, 0, 0, 0.42);
}
.leader-profile-equipment-stats .eq-chip {
  border: 1.5px solid var(--rar-color, rgba(255,255,255,0.35));
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 0 0 6px var(--rar-color, transparent);
  font-weight: 900;
  font-size: 12px;
  white-space: nowrap;
}
.leader-profile-equipment-stats .eq-empty {
  border: 1px dashed rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.6);
  box-shadow: none;
}
.leader-profile-equipment-frame {
  position: relative;
  border-radius: 18px;
  border: 2px solid rgba(255, 39, 39, 0.38);
  background: #000;
  overflow: hidden;
  aspect-ratio: 1086 / 1448;
}
.leader-profile-equipment-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
}
.pf-tile {
  background: rgba(0,0,0,.3);
  border: 3px solid #0c1a4a;
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-height: 96px;
  justify-content: center;
}
.pf-tile-label {
  font-size: 11px;
  opacity: .85;
  font-weight: 800;
  letter-spacing: .5px;
  line-height: 1.2;
}
.pf-tile-icon { font-size: 28px; line-height: 1; }
.pf-stat-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 7px 10px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 214, 186, 0.28);
  background: linear-gradient(180deg, rgba(44, 30, 34, 0.96), rgba(15, 12, 18, 0.98));
  color: #fff4ea;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.pf-stat-tag--cool {
  border-color: rgba(127, 182, 255, 0.34);
  color: #d5e8ff;
}
.pf-stat-tag--arcane {
  border-color: rgba(176, 136, 255, 0.34);
  color: #eadcff;
}
.pf-stat-tag--sun {
  border-color: rgba(255, 215, 106, 0.36);
  color: #ffe7a0;
}
.pf-stat-tag--danger {
  border-color: rgba(255, 122, 122, 0.36);
  color: #ffd4d4;
}
.pf-stat-tag--neutral {
  border-color: rgba(255, 181, 139, 0.32);
  color: #ffe6d4;
}
.pf-tile-value {
  font-weight: 900; font-size: 18px;
  letter-spacing: .3px;
}

/* ============== PASS REDESIGN ============== */
#pass { padding: 10px; background: linear-gradient(180deg, #4b2e8a 0%, #2a1555 100%); }

.pass-header {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 4px 6px;
  margin-bottom: 10px;
}
.pass-season {
  display: flex; flex-direction: column;
  align-self: stretch;
  justify-content: center;
  padding: 6px 14px;
  background: linear-gradient(135deg, #5b3ab2, #3a1f78);
  border: 3px solid #0c0a2a;
  border-radius: 14px;
  transform: skew(-6deg);
}
.ps-sub { font-size: 11px; opacity: .85; font-weight: 800; letter-spacing: 1px; transform: skew(6deg); }
.ps-title { font-size: 18px; font-weight: 900; letter-spacing: 1px; transform: skew(6deg); text-shadow: 0 2px 0 #1a0a3f; }

.pass-tabs {
  display: inline-flex;
  background: #1a0a3f;
  border-radius: 12px;
  padding: 4px;
  border: 3px solid #0c0a2a;
}
.ptab {
  background: transparent;
  border: none;
  color: #fff;
  font-weight: 900;
  padding: 8px 14px;
  cursor: pointer;
  border-radius: 8px;
  font-size: 13px;
  letter-spacing: 1px;
}
.ptab.active {
  background: linear-gradient(180deg, #ff5c2c, #e03010);
  color: #fff;
  box-shadow: 0 2px 0 rgba(0,0,0,.3);
}

.pass-progress-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 0 6px 10px;
}
.ppb-fill {
  position: relative;
  height: 26px;
  background: #1a0a3f;
  border: 3px solid #0c0a2a;
  border-radius: 14px;
  overflow: hidden;
}
.ppb-fill > div:first-child {
  height: 100%;
  background: linear-gradient(180deg, #ff5c2c, #e03010);
  transition: width .2s ease;
}
.ppb-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 13px;
  text-shadow: 0 1px 0 #000;
}
.ppb-level {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffcf45, #ff9a2e);
  color: #3a1b00;
  font-weight: 900; font-size: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 3px solid #0c0a2a;
}

.pass-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

#passRewardsPane {
  gap: 10px;
}
.pass-buy-col {
  flex: 0 0 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
}
.pbc-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px 10px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffcf45, #ff9a2e);
  border: 3px solid #0c0a2a;
  color: #3a1b00;
  gap: 8px;
  text-align: center;
  box-shadow: 0 4px 0 rgba(0,0,0,.3);
  min-height: 270px;
}
.pbc-card.pbc-owned { background: linear-gradient(180deg, #6cf08e, #2ea84a); color: #0a2f10; }
.pbc-ic { font-size: 48px; line-height: 1; }
.pbc-label { font-weight: 900; font-size: 14px; letter-spacing: 1px; }
.pbc-sub { font-size: 11px; font-weight: 800; opacity: .9; }

.pass-track {
  flex: 1;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
  align-items: center;
}
.pass-track.is-dragging {
  scroll-snap-type: none;
}
.pass-track::-webkit-scrollbar { height: 8px; }
.pass-track::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 4px; }
.pass-col {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 12px;
  min-width: 116px;
  align-items: center;
  flex-shrink: 0;
}
.pass-col.current .ptk-card { box-shadow: 0 0 0 3px #ffe27a inset; }
.pass-row { display: flex; justify-content: center; }
.ptk-card {
  position: relative;
  width: 108px; min-height: 116px;
  border-radius: 14px;
  border: 3px solid #0c0a2a;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 8px;
  background: linear-gradient(180deg, #6a4ac2, #3a1f78);
}
.ptk-card.premium { background: linear-gradient(180deg, #ff6fff, #9c29c7); }
.ptk-card.free    { background: linear-gradient(180deg, #5b3ab2, #2a1555); }
.ptk-card.claimed { opacity: .5; filter: grayscale(.5); }
.ptk-card.locked  { opacity: .8; }
.ptk-ic { font-size: 44px; line-height: 1; }
.ptk-v  { font-size: 13px; font-weight: 900; text-align: center; line-height: 1.1; }
.ptk-check {
  position: absolute; top: 4px; right: 6px;
  font-size: 18px; color: #6cf08e; text-shadow: 0 1px 0 #0c0a2a;
}
.ptk-lock {
  position: absolute; top: 4px; right: 6px;
  font-size: 16px; opacity: .9;
}
.ptk-claim {
  position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(180deg, #ffcf45, #ff9a2e);
  color: #3a1b00;
  border: 2px solid #0c0a2a;
  border-radius: 8px;
  font-weight: 900;
  padding: 3px 8px;
  cursor: pointer;
  font-size: 10px;
  letter-spacing: .5px;
}
.pass-lv {
  font-weight: 900;
  font-size: 12px;
  color: #ffd76a;
  text-align: center;
  background: #1a0a3f;
  border: 2px solid #0c0a2a;
  border-radius: 10px;
  padding: 4px 6px;
}

/* Quests pane */
#passQuestsPane { flex-direction: column; padding: 0 6px; overflow-y: auto; }
#quests {
  gap: 10px;
}
#quests .screen-header {
  margin-bottom: 0;
}
#questsPane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 6px 10px;
  overflow-y: auto;
}
#questsPane.drag-scroll-enabled-vertical {
  touch-action: pan-y;
}
#questsPane.drag-scroll-enabled-vertical.is-dragging {
  cursor: grabbing;
  user-select: none;
}
.quests-screen .pq-cols {
  flex: 1;
  min-height: 0;
}
.quests-screen .pq-list {
  padding-bottom: 14px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.quests-screen .pq-list::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.quests-screen .pq-title {
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(233, 107, 79, 0.18);
  background: linear-gradient(180deg, rgba(34, 11, 12, 0.9), rgba(12, 8, 9, 0.96));
  color: #fff0e8;
  text-shadow: none;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.quests-screen .pq-sub {
  color: #efb38f;
  font-size: 10px;
  letter-spacing: .08em;
}
.quests-screen .pq-card {
  min-width: clamp(260px, 34vw, 360px);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.04);
  background:
    linear-gradient(180deg, rgba(39, 12, 13, 0.94), rgba(12, 8, 9, 0.98)),
    radial-gradient(circle at 50% 0, rgba(231, 86, 62, 0.06), transparent 72%);
  box-shadow: 0 12px 24px rgba(0,0,0,.22);
}
.quests-screen .pq-card.done {
  border-color: rgba(236, 121, 90, 0.28);
  box-shadow: 0 0 18px rgba(231, 86, 62, 0.08), 0 12px 24px rgba(0,0,0,.22);
}
.quests-screen .pq-card.claimed {
  opacity: .56;
  filter: grayscale(.18);
}
.quests-screen .pq-ic {
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.05);
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,.14), transparent 28%),
    radial-gradient(circle at 50% 50%, rgba(255, 157, 97, 0.82), rgba(87, 29, 18, 0.96));
  box-shadow: inset 0 0 18px rgba(255,255,255,.06), 0 0 20px rgba(231, 86, 62, 0.14);
}
.quests-screen .pq-text {
  color: #f3e2d9;
  line-height: 1.35;
}
.quests-screen .pq-progress {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(12, 8, 9, 0.98), rgba(21, 8, 9, 0.98));
}
.quests-screen .pq-progress > div {
  background: linear-gradient(90deg, rgba(104, 24, 19, 0.98), rgba(231, 86, 62, 0.98), rgba(255, 148, 88, 0.94));
}
.quests-screen .pq-prog-n,
.quests-screen .pq-foot-note {
  color: #ceb7ad;
}
.quests-screen .pq-reward {
  color: #ffcf9b;
}
.quests-screen .pq-claim {
  background: linear-gradient(180deg, rgba(149, 35, 27, 0.96), rgba(83, 20, 16, 0.98));
  border-color: rgba(255, 160, 124, 0.28);
  box-shadow: 0 0 16px rgba(231, 86, 62, 0.14);
}
.quests-screen .pq-list.drag-scroll-enabled,
.quests-screen .pq-list.drag-scroll-enabled.is-dragging {
  touch-action: pan-x;
  cursor: default;
  user-select: auto;
}
.pq-top { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.pq-cols {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (max-width: 720px) { .pq-cols { gap: 10px; } }
.pq-col { display: flex; flex-direction: column; gap: 8px; }
.pq-title {
  font-weight: 900; font-size: 14px;
  color: #ffd76a;
  letter-spacing: 1px;
  text-shadow: 0 2px 0 #0c0a2a;
  padding: 4px 0;
}
.pq-sub { font-size: 11px; opacity: .8; font-weight: 700; color: #fff; margin-left: 6px; }
.pq-list { display: flex; flex-direction: row; gap: 8px; overflow-x: auto; overflow-y: hidden; padding-bottom: 10px; scroll-snap-type: x proximity; }
.pq-card {
  background: #1a0a3f;
  border: 3px solid #0c0a2a;
  border-radius: 14px;
  padding: 10px;
  display: grid;
  grid-template-columns: 56px 1fr;
  grid-template-rows: auto auto auto;
  gap: 6px 10px;
  position: relative;
  min-width: clamp(260px, 34vw, 360px);
  scroll-snap-align: start;
}
.pq-card.done   { border-color: #4ad36a; box-shadow: 0 0 0 2px rgba(74,211,106,.2) inset; }
.pq-card.claimed { opacity: .5; filter: grayscale(.5); }
.pq-ic {
  grid-row: 1 / 4;
  width: 56px; height: 56px;
  background: linear-gradient(180deg, #6a4ac2, #3a1f78);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  border: 2px solid #0c0a2a;
}
.pq-text { font-weight: 800; font-size: 13px; line-height: 1.2; }
.pq-progress {
  height: 12px;
  background: #0c0a2a;
  border-radius: 6px;
  overflow: hidden;
}
.pq-progress > div {
  height: 100%;
  background: linear-gradient(180deg, #4ade80, #1b9f4a);
}
.pq-foot {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px;
}
.pq-prog-n { opacity: .8; font-weight: 800; }
.pq-reward { font-weight: 900; color: #ffd76a; }
.pq-claim {
  position: static;
}

/* ============== BUY PASS MODAL ============== */
#buyPassModal {
  position: fixed; inset: 0;
  display: none; align-items: center; justify-content: center;
  background: rgba(5, 10, 40, 0.85);
  z-index: 1100;
  padding: 16px;
}
#buyPassModal.active { display: flex; }
.bp-modal {
  position: relative;
  width: min(720px, 100%);
  background: linear-gradient(180deg, #8c5bff 0%, #4b2a96 100%);
  border: 4px solid #0c0a2a;
  border-radius: 22px;
  padding: 18px;
  color: #fff;
  text-align: center;
}
.bp-close {
  position: absolute; top: -10px; right: -10px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff5c2c, #e03010);
  border: 3px solid #0c0a2a;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  font-size: 16px;
}
.bp-hero { padding: 10px 0; }
.bp-hero-row {
  font-size: 40px; letter-spacing: 4px;
  margin-bottom: 8px;
}
.bp-title {
  font-weight: 900; font-size: 24px;
  letter-spacing: 1px;
  text-shadow: 0 3px 0 #1a0a3f;
}
.bp-options {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}
@media (max-width: 600px) { .bp-options { grid-template-columns: 1fr; } }
.bp-option {
  background: #1a0a3f;
  border: 3px solid #0c0a2a;
  border-radius: 16px;
  padding: 14px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.bp-or {
  font-weight: 900; font-size: 18px;
  color: #ffd76a;
  text-shadow: 0 2px 0 #0c0a2a;
}
.bp-opt-title {
  font-weight: 900; font-size: 16px; letter-spacing: 1px;
}
.bp-opt-desc {
  font-size: 11px; opacity: .9; font-weight: 700;
  line-height: 1.3; text-align: center;
}
.bp-btn {
  background: linear-gradient(180deg, #ffcf45, #ff9a2e);
  color: #3a1b00;
  border: 3px solid #0c0a2a;
  border-radius: 12px;
  font-weight: 900; font-size: 18px;
  padding: 10px 18px;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,.3);
}

body.yandex-debug-ads-active #opening,
body.yandex-debug-ads-active #dailyLogin,
body.yandex-debug-ads-active #buyPassModal {
  inset:
    var(--yandex-debug-top-inset)
    var(--yandex-debug-right-inset)
    var(--yandex-debug-bottom-inset)
    var(--yandex-debug-left-inset);
}

body.yandex-debug-ads-active #opening .stage {
  width: min(calc(var(--yandex-debug-safe-width) - 24px), 92vw, 760px);
  max-height: calc(var(--yandex-debug-safe-height) - 40px);
  padding-bottom: 148px;
}

body.yandex-debug-ads-active #opening.opening-awaiting-open .tap-hint {
  bottom: clamp(112px, 18vh, 176px);
}

body.yandex-debug-ads-active #opening.hero-reveal-active .stage {
  width: min(calc(var(--yandex-debug-safe-width) - 24px), 94vw, 680px);
}

body.yandex-debug-ads-active .hero-reveal {
  width: min(calc(var(--yandex-debug-safe-width) - 24px), 92vw, 620px);
  min-height: min(calc(var(--yandex-debug-safe-height) - 84px), 76vh, 660px);
}

body.yandex-debug-ads-active #dailyLogin {
  padding:
    clamp(10px, 2.4vw, 18px)
    clamp(10px, 2.4vw, 18px)
    calc(clamp(10px, 2.4vw, 18px) + var(--yandex-debug-bottom-inset))
    clamp(10px, 2.4vw, 18px);
}

body.yandex-debug-ads-active .d-modal {
  max-height: calc(var(--yandex-debug-safe-height) - clamp(20px, 6vw, 40px));
}

body.yandex-debug-ads-active #buyPassModal {
  padding:
    16px
    16px
    calc(16px + var(--yandex-debug-bottom-inset))
    16px;
}

/* ==========================================================
   MOBILE ADAPTIVE (phone-first overrides, в‰¤640px and в‰¤400px)
   ========================================================== */
@media (max-width: 640px) {
  /* --- Global scale-down --- */
  .screen { padding: 8px; }

  /* --- Top HUD --- */
  .top { gap: 6px; }
  .player-pill { padding: 6px 10px 6px 56px; min-width: 0; }
  .player-pill .avatar { width: 52px; height: 52px; left: -6px; top: -6px; }
  .player-pill .avatar-ring { inset: 4px; }
  .player-pill .avatar-glyph { font-size: 26px; }
  .player-pill .nm { font-size: 12px; }
  .player-pill .lv { font-size: 14px; }
  .pill { padding: 4px 10px; border-radius: 14px; }
  .pill .val  { font-size: 15px; }
  .currency-pill { min-width: 88px; gap: 8px; }
  .currency-pill .hud-icon { width: 18px; height: 18px; }
  .currencies { gap: 6px; }
  .icon-btn { width: 44px; height: 44px; border-radius: 12px; font-size: 20px; }

  /* --- Lobby body: stack side menus above/below vaults --- */
  #lobby .body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 8px;
    padding-top: 6px;
  }
  .side-menu {
    flex-direction: row;
    align-self: stretch;
    margin-top: 0;
    gap: 6px;
    overflow-x: auto;
    padding: 2px;
  }
  .side-menu::-webkit-scrollbar { display: none; }
  .side-btn {
    flex: 1 0 auto;
    min-width: 0;
    padding: 8px 10px;
    font-size: 12px;
    gap: 6px;
    border-width: 2px;
    border-radius: 12px;
  }
  .side-btn .ic { width: 16px; height: 16px; }

  /* --- Vaults tighter --- */
  .vault-row { gap: 6px; padding: 6px; }
  .vault { width: 102px; height: 136px; }
  .chest { width: 94px; height: 94px; border-radius: 18px; }
  .vault .label { margin-top: 6px; font-size: 12px; padding: 4px 10px; border-width: 2px; border-radius: 10px; }
  .vault .label .hud-icon.coin,
  .vault .label .hud-icon.gem { width: 30px; height: 30px; }
  .vault .info { width: 24px; height: 24px; right: 6px; top: -4px; font-size: 12px; }

  /* --- Footer banners --- */
  .footer-row { gap: 6px; }
  .banner { font-size: 12px; padding: 8px 10px; border-radius: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.3); flex: 1; text-align: center; }
  .banner .ui-glyph { width: 16px; height: 16px; }

  /* --- Inner screen headers --- */
  .screen-header { gap: 6px; margin-bottom: 8px; }
  .screen-title { font-size: 18px; letter-spacing: .5px; }
  .back-btn { width: 40px; height: 40px; font-size: 20px; border-radius: 10px; }
  .home-btn { width: 40px; height: 40px; font-size: 18px; border-radius: 10px; border-width: 2px; }
  #trophyRoad .screen-header,
  #profile    .screen-header { grid-template-columns: 40px 1fr 40px; }

  /* --- Generic grid of cards --- */
  .grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; padding: 4px 4px 20px; }
  .card .portrait { font-size: 48px; }
  .card .nm { font-size: 12px; padding: 4px; }
  .card .meta { font-size: 11px; padding: 3px 6px; }

  /* --- Shop / heroes buttons --- */
  .btn { padding: 8px 20px; font-size: 16px; border-width: 2px; border-radius: 12px; }
  .btn.sm { padding: 5px 12px; font-size: 12px; }

  /* --- Tabs --- */
  .tab { padding: 5px 10px; font-size: 12px; }

  /* --- Pass screen header: wrap tabs + season to two rows --- */
  .pass-header {
    grid-template-columns: 40px 1fr;
    grid-template-rows: auto auto;
    gap: 6px;
    padding: 2px;
  }
  .pass-header .back-btn { grid-row: 1; grid-column: 1; }
  .pass-season           { grid-row: 1; grid-column: 2; padding: 4px 10px; }
  .pass-tabs             { grid-row: 2; grid-column: 1 / -1; justify-self: center; }
  .ps-sub   { font-size: 10px; }
  .ps-title { font-size: 14px; }
  .ptab { padding: 6px 12px; font-size: 12px; }
  .pass-progress-bar { padding: 0 4px 8px; gap: 6px; }
  .ppb-fill { height: 22px; border-width: 2px; }
  .ppb-text { font-size: 12px; }
  .ppb-level { width: 32px; height: 32px; font-size: 15px; border-width: 2px; }

  /* --- Pass rewards track --- */
  .pass-buy-col { flex: 0 0 88px; }
  .pbc-card { padding: 10px 4px; min-height: 160px; border-width: 2px; border-radius: 12px; }
  .pbc-ic { font-size: 36px; }
  .pbc-label { font-size: 12px; }
  .pbc-sub { font-size: 10px; }
  .pass-track { gap: 6px; }
  .pass-col { min-width: 76px; }
  .ptk-card { width: 72px; min-height: 82px; border-width: 2px; border-radius: 10px; padding: 4px; }
  .ptk-ic { font-size: 26px; }
  .ptk-v  { font-size: 10px; }
  .ptk-claim { font-size: 9px; padding: 2px 6px; }
  .pass-lv { font-size: 10px; padding: 3px 4px; }

  /* --- Quests pane --- */
  .pq-cols { gap: 8px; }
  .pq-title { font-size: 12px; }
  .pq-sub { font-size: 10px; display: block; margin-left: 0; margin-top: 2px; }
  .pq-card { grid-template-columns: 48px 1fr; padding: 8px; gap: 4px 8px; }
  .pq-ic { width: 48px; height: 48px; font-size: 24px; }
  .pq-text { font-size: 12px; }
  .pq-foot { font-size: 11px; }
  #btnAddQuest { font-size: 12px; padding: 6px 12px; }
  #questsBtnAddQuest { font-size: 12px; padding: 6px 12px; }

  /* --- Daily login modal --- */
  #dailyLogin {
    padding:
      max(6px, env(safe-area-inset-top, 0px))
      6px
      max(6px, env(safe-area-inset-bottom, 0px));
  }
  .d-modal { max-height: calc(100dvh - max(10px, env(safe-area-inset-top, 0px)) - max(10px, env(safe-area-inset-bottom, 0px))); padding: 14px 10px 12px; border-radius: 18px; border-width: 3px; }
  .d-title { font-size: 20px; letter-spacing: 0.08em; }
  .d-sub { font-size: 12px; }
  .d-streak { display: flex; width: 100%; justify-content: center; padding: 8px 10px; font-size: 12px; }
  .d-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 2px 2px 4px 0; }
  .d-card { min-height: 174px; padding: 10px 8px; border-width: 2px; border-radius: 14px; grid-template-rows: auto auto auto auto minmax(40px, 1fr) auto; row-gap: 5px; }
  .d-card__day { font-size: 10px; letter-spacing: 0.14em; }
  .d-card__tag { padding: 4px 7px; font-size: 9px; }
  .d-card__symbol { font-size: 24px; }
  .d-card__title { font-size: 13px; line-height: 1.18; }
  .d-card__flavor { min-height: 40px; font-size: 11px; line-height: 1.25; }
  .d-card__effect { padding-top: 8px; font-size: 10px; letter-spacing: 0.05em; }
  #dailyClaim { padding: 12px 18px; font-size: 15px; }

  /* --- Trophy Road --- */
  #trophyRoad { min-height: 100dvh; padding: max(2px, env(safe-area-inset-top, 0px)) 6px calc(84px + env(safe-area-inset-bottom, 0px)); }
  #trophyRoad .screen-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2px;
    padding-top: calc(max(6px, env(safe-area-inset-top, 0px)) + 12px);
    padding-left: 50px;
    padding-right: 50px;
    min-height: 52px;
  }
  #trophyRoad .screen-header .back-btn {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
  }
  #trophyRoad .screen-title { width: 100%; margin: 0 auto; font-size: 18px; line-height: 1.04; letter-spacing: 0.05em; text-wrap: balance; }
  .tr-sub { font-size: 11px; line-height: 1.35; margin: 4px auto 8px; padding: 8px 10px; }
  .tr-track { gap: 12px; min-height: 0; padding: 18px 8px 12px; border-radius: 22px; align-items: stretch; }
  .tr-track::before { left: 50%; right: auto; width: 8px; height: auto; top: 18px; bottom: 18px; }
  .tr-track::after { left: 50%; right: auto; width: 18px; top: 18px; bottom: 18px; }
  .tr-node { min-width: 0; gap: 8px; }
  .tr-node.next { min-width: 0; }
  .tr-card { min-height: 214px; padding: 14px 10px 16px; border-radius: 18px; gap: 10px; }
  .tr-relic { width: 96px; height: 106px; border-radius: 22px; }
  .tr-node.next .tr-relic { width: 110px; height: 124px; }
  .tr-core { width: 68px; height: 68px; border-radius: 20px; }
  .tr-node.next .tr-core { width: 82px; height: 82px; border-radius: 22px; }
  .tr-core-glyph { font-size: 34px; }
  .tr-node.next .tr-core-glyph { font-size: 46px; }
  .tr-state { font-size: 9px; padding: 7px 10px; }
  .tr-label { font-size: 11px; padding: 7px 8px; border-radius: 12px; }
  .tr-badge { font-size: 10px; padding: 6px 10px; }
  .tr-threshold { font-size: 12px; padding: 7px 10px; gap: 6px; }
  .tr-check, .tr-lock { width: 26px; height: 26px; font-size: 14px; top: 8px; right: 8px; }
  .tr-counter { position: relative; right: auto; bottom: auto; align-self: center; font-size: 14px; padding: 8px 12px; margin: 14px auto 0; }
  .tr-counter + .tr-claim-all { margin-top: 18px; }
  .tr-claim-all { position: sticky; display: block; left: 0; right: 0; bottom: max(8px, env(safe-area-inset-bottom, 0px)); margin: 18px auto 0; width: min(260px, calc(100vw - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px))); max-width: calc(100% - 4px); box-sizing: border-box; transform: none; z-index: 120; pointer-events: auto; touch-action: manipulation; }
  .tr-claim-all.is-ready { box-shadow: 0 0 22px rgba(255, 112, 74, 0.38), 0 16px 24px rgba(0,0,0,.3); opacity: 1; }
  .tr-claim-all.is-idle { box-shadow: 0 8px 14px rgba(0,0,0,.16); filter: saturate(.66) brightness(.86); opacity: .6; }
  .tr-claim-all:active { transform: translateY(2px); }

  /* --- Profile --- */
  #profile .screen-title { font-size: 18px; }
  .pf-top { padding: 10px; gap: 10px; border-width: 2px; }
  .pf-avatar { width: 84px; height: 84px; }
  .pf-name { font-size: 15px; padding: 6px 10px; min-width: 100px; }
  .pf-lvl { width: 30px; height: 30px; font-size: 15px; border-width: 2px; }
  .pf-id { font-size: 11px; }
  .pf-tile-label { font-size: 10px; }
  .pf-tile-icon { font-size: 22px; }
  .pf-tile-value { font-size: 15px; }

  /* --- Buy Pass modal --- */
  .bp-modal { padding: 14px 12px; border-width: 3px; border-radius: 18px; }
  .bp-title { font-size: 18px; }
  .bp-hero-row { font-size: 28px; letter-spacing: 2px; }
  .bp-options { gap: 8px; margin-top: 10px; }
  .bp-option { padding: 10px 8px; border-width: 2px; border-radius: 12px; gap: 4px; }
  .bp-opt-title { font-size: 14px; }
  .bp-opt-desc { font-size: 10px; }
  .bp-or { font-size: 14px; }
  .bp-btn { font-size: 15px; padding: 8px 14px; border-width: 2px; }
  .bp-close { top: -8px; right: -8px; width: 32px; height: 32px; font-size: 14px; border-width: 2px; }

  /* --- Mini-games --- */
  .mini-emoji { font-size: 64px; }
  .mini-bar { width: 94%; height: 28px; }
  .mini-info { font-size: 14px; }
  .wheel-wrap { width: 220px; height: 220px; }
  .mem-info { font-size: 13px; }

  /* --- Generic modal --- */
  .modal { padding: 16px; font-size: 14px; }
  .modal h2 { font-size: 18px; }

  /* --- Box opening overlay --- */
  .reward-title { font-size: 22px; }
  .reward-amount { font-size: 34px; }
  .reward-art { font-size: 70px; width: 130px; height: 130px; }
  .reward-sub { width: min(92vw, 300px); font-size: 18px; padding: 8px 16px; }
  .progress-bar { width: min(92vw, 240px); height: 28px; }
  .upgrade-tag { font-size: 14px; max-width: min(92vw, 300px); }
  .tap-hint { font-size: 14px; }

  /* --- Toast --- */
  .toast { top: -80px; padding: 10px 14px; font-size: 14px; }
  .toast.show { top: 78px; }
}

@media (max-width: 400px) {
  /* Super-tight adjustments for very small phones */
  .vault { width: 88px; height: 120px; }
  .chest { width: 82px; height: 82px; border-radius: 16px; }
  .vault .label { font-size: 11px; padding: 3px 8px; }
  .vault .label .hud-icon.coin,
  .vault .label .hud-icon.gem { width: 26px; height: 26px; }

  .side-btn { font-size: 11px; padding: 6px 8px; }
  .side-btn .ic { font-size: 14px; }

  .pf-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .pf-tile { padding: 8px 4px; min-height: 82px; }
  .pf-tile-label { font-size: 9px; }

  .d-grid { grid-template-columns: repeat(2, 1fr); }
  .d-card { min-height: 162px; }

  .tr-node { min-width: 122px; }
  .tr-node.next { min-width: 154px; }
  .tr-card { min-height: 172px; padding: 10px 8px 12px; }
  .tr-relic { width: 78px; height: 88px; border-radius: 18px; }
  .tr-node.next .tr-relic { width: 88px; height: 98px; }
  .tr-core { width: 56px; height: 56px; border-radius: 18px; }
  .tr-node.next .tr-core { width: 66px; height: 66px; }
  .tr-core-glyph { font-size: 30px; }
  .tr-node.next .tr-core-glyph { font-size: 36px; }
  .tr-label { font-size: 10px; letter-spacing: .05em; }
  .tr-threshold { font-size: 11px; }

  .pass-col { min-width: 68px; }
  .ptk-card { width: 64px; min-height: 74px; }
  .ptk-ic { font-size: 22px; }

  .banner { font-size: 11px; padding: 7px 8px; }

  .bp-hero-row { font-size: 22px; }
  .bp-title { font-size: 16px; }
}

/* Landscape phones: avoid vertical cramping */
@media (max-height: 480px) and (orientation: landscape) {
  .vault { height: 120px; }
  .chest { height: 72px; }
  .pass-progress-bar { padding-bottom: 4px; }
  .ppb-fill { height: 20px; }
  .tr-card { min-height: 146px; }
  .d-card { min-height: 150px; }
}

/* ============== HERO DETAIL ============== */
#heroDetail { padding: 14px; }
#heroDetail .screen-header {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
#heroDetail .screen-title {
  text-align: center;
  font-weight: 900;
  font-size: 24px;
  letter-spacing: 1px;
  text-shadow: 0 3px 0 #0c1a4a;
}

.hd-body {
  flex: 1;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  align-content: start;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
  overflow-y: auto;
}
@media (max-width: 640px) {
  .hd-body { grid-template-columns: 1fr; gap: 12px; }
}

.hd-portrait-wrap {
  background: linear-gradient(180deg, var(--rar-color, #6b6cf0) 0%, #1b1b3a 100%);
  border: 4px solid #0c1a4a;
  border-radius: 20px;
  padding: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  box-shadow: 0 6px 0 rgba(0,0,0,.3);
}
.hd-portrait {
  position: relative;
  width: min(100%, 188px);
  min-height: 228px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  border-radius: 18px;
  padding: 14px 12px 0;
  box-sizing: border-box;
  background: radial-gradient(circle at 50% 18%, rgba(255,255,255,.24), transparent 56%), rgba(8,12,28,.24);
  font-size: 144px; line-height: 1;
  text-shadow: 0 6px 0 rgba(0,0,0,.3);
}
.hd-portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,.16), transparent 58%);
  pointer-events: none;
}
.hd-portrait.is-locked::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 10, 20, 0.22), rgba(4, 6, 12, 0.72));
  z-index: 1;
}
.hd-portrait-art {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.28));
}
.hd-portrait.is-locked .hd-portrait-art {
  filter: grayscale(.3) brightness(.62) drop-shadow(0 10px 18px rgba(0,0,0,.28));
}
.hd-portrait-glyph {
  position: relative;
  z-index: 0;
  font-size: 144px;
  line-height: 1;
}
.hd-portrait-lock {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,.55);
}
.hd-rarity {
  font-weight: 900;
  padding: 6px 16px;
  border-radius: 999px;
  color: #1b1b3a;
  letter-spacing: 1px;
  border: 3px solid #0c1a4a;
  font-size: 14px;
}
.hd-level {
  background: rgba(0,0,0,.4);
  border: 2px solid rgba(255,255,255,.25);
  border-radius: 10px;
  padding: 4px 12px;
  font-weight: 900;
  font-size: 16px;
}

.hd-side {
  display: flex; flex-direction: column; gap: 14px;
}

@media (max-width: 1024px), (pointer: coarse) and (max-width: 1366px) {
  #heroDetail {
    min-height: 100dvh;
    height: 100dvh;
    min-height: 100svh;
    padding: max(4px, env(safe-area-inset-top, 0px)) 10px 12px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  #heroDetail .screen-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
    padding-top: calc(max(8px, env(safe-area-inset-top, 0px)) + 4px);
    padding-left: 54px;
    padding-right: 54px;
    min-height: calc(44px + max(8px, env(safe-area-inset-top, 0px)));
  }

  #heroDetail .screen-header .back-btn,
  #heroDetail .screen-header .home-btn {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    z-index: 9;
  }

  #heroDetail .screen-header .back-btn {
    left: 10px;
  }

  #heroDetail .screen-header .home-btn {
    right: 10px;
  }

  #heroDetail .screen-title {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    font-size: clamp(18px, 2.8vw, 24px);
    line-height: 1.04;
    letter-spacing: 0.04em;
    text-align: center;
    text-wrap: balance;
  }

  .hd-body {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 6px;
    min-width: 0;
    overflow: visible;
  }

  .hd-portrait-wrap {
    width: min(100%, 420px);
    margin: 0 auto;
    padding: 14px;
  }

  .hd-portrait {
    width: min(100%, 210px);
    min-height: 210px;
    padding: 12px 10px 0;
  }

  .hd-portrait-lock {
    font-size: 38px;
    transform: translateY(14px);
  }
}

.hd-stats {
  display: flex; flex-direction: column; gap: 10px;
  background: rgba(0,0,0,.3);
  border: 3px solid #0c1a4a;
  border-radius: 14px;
  padding: 14px;
}
.hd-stat-head {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}
.hd-stat-ic { font-size: 22px; line-height: 1; }
.hd-stat-label { font-weight: 900; font-size: 13px; letter-spacing: 1px; opacity: .9; }
.hd-stat-val { font-weight: 900; font-size: 18px; }
.hd-stat-next { color: #6cf08e; font-weight: 900; font-size: 14px; }
.hd-stat-bar {
  height: 10px;
  background: rgba(0,0,0,.5);
  border-radius: 5px;
  overflow: hidden;
}
.hd-stat-bar > div {
  height: 100%;
  background: linear-gradient(90deg, #ffcf45, #ff5c2c);
  transition: width .3s;
}

.hd-upgrade {
  background: rgba(0,0,0,.3);
  border: 3px solid #0c1a4a;
  border-radius: 14px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.hd-upg-row { display: flex; flex-direction: column; gap: 4px; }
.hd-upg-bar-label { font-weight: 900; font-size: 13px; }
.hd-upg-bar {
  height: 12px;
  background: rgba(0,0,0,.5);
  border-radius: 6px;
  overflow: hidden;
}
.hd-upg-bar > div {
  height: 100%;
  background: linear-gradient(90deg, #4ade80, #1b9f4a);
}
.hd-upg-coins { font-weight: 900; font-size: 14px; }
.hd-upg-coins.miss { color: #ff9f9f; }
.hd-upg-locked, .hd-upg-max {
  text-align: center;
  font-weight: 900;
  font-size: 16px;
  color: #ffd76a;
  letter-spacing: 1px;
  padding: 10px;
}
.btn.disabled { background: linear-gradient(180deg,#667,#334); color: #ccd; opacity: .7; cursor: not-allowed; }

/* Selected-hero star on hero list card */
.sel-star {
  position: absolute; top: 4px; right: 4px;
  background: linear-gradient(180deg, #ffcf45, #ff9a2e);
  color: #3a1b00;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid #0c1a4a;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 14px;
  z-index: 2;
  box-shadow: 0 2px 0 rgba(0,0,0,.3);
}

/* ============================================================
   v2 вЂ” polish, boss, rarity effects, badges, transitions
   ============================================================ */

/* Notification dot */
.notif-dot {
  display: inline-block;
  width: 10px; height: 10px;
  background: linear-gradient(180deg, #ffb18b, #ff5d2c);
  border-radius: 50%;
  margin-left: 6px;
  border: 1px solid rgba(255, 236, 222, 0.72);
  box-shadow: 0 0 10px rgba(255, 95, 35, 0.7);
  animation: dot-pulse 1.5s ease-in-out infinite;
}

.notif-dot[hidden] {
  display: none !important;
}

@keyframes dot-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 6px rgba(255, 80, 80, 0.5); }
  50%      { transform: scale(1.2); box-shadow: 0 0 12px rgba(255, 80, 80, 0.9); }
}
.side-btn { position: relative; }
.side-btn.red { background: linear-gradient(180deg, rgba(41, 24, 26, 0.98), rgba(15, 11, 16, 0.98)); color: var(--ui-text); }

/* Free box stack badge */
.stack-badge {
  position: static;
  background: linear-gradient(180deg, #ffb18b, #ff5d2c);
  color: #160b08;
  border: 1px solid rgba(255, 236, 222, 0.72);
  border-radius: 999px;
  padding: 5px 10px;
  min-width: 52px;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
  z-index: 3;
  box-shadow: 0 0 14px rgba(255, 95, 35, 0.32), 0 2px 0 rgba(0,0,0,.3);
  letter-spacing: .5px;
}

@media (max-width: 1024px) {
  .vault-row {
    align-items: flex-start;
    gap: 14px 12px;
    padding: 14px 8px 10px;
  }

  .vault {
    width: min(22vw, 170px);
    min-height: 244px;
    height: auto;
    padding-top: 30px;
  }

  .vault .chest {
    width: min(100%, 148px);
    height: min(100%, 148px);
  }

  .vault[data-box="smallChest"] {
    padding-top: 54px;
  }

  .vault[data-box="smallChest"] .chest {
    margin-top: -24px;
  }

  .vault[data-box="smallChest"] .free-vault-top {
    top: 0;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(100%, 156px);
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
  }

  .vault[data-box="smallChest"] .free-vault-status {
    flex: 1 1 auto;
    align-items: flex-start;
  }

  .vault[data-box="smallChest"] .free-stack-host {
    width: auto;
    min-width: 0;
  }

  .vault[data-box="smallChest"] .stack-badge,
  .vault[data-box="smallChest"] .free-ad-meta {
    width: auto;
  }

  .vault[data-box="smallChest"] .free-ad-meta {
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 160, 120, 0.22);
    background: linear-gradient(180deg, rgba(27, 18, 22, 0.96), rgba(10, 11, 16, 0.98));
    white-space: nowrap;
  }

  .vault[data-box="smallChest"] .free-ad-btn {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    width: min(100%, 166px);
    min-height: 48px;
    margin-top: 10px;
    padding: 6px 8px;
    border-radius: 13px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 2px;
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: .045em;
    color: #fff3e8;
    border: 1px solid rgba(255, 178, 126, 0.62);
    background:
      linear-gradient(180deg, rgba(135, 34, 18, 0.96), rgba(68, 10, 8, 0.98)),
      radial-gradient(circle at 50% 0%, rgba(255, 180, 123, 0.24), transparent 58%);
    box-shadow: 0 18px 26px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.14);
    z-index: 5;
    animation: free-ad-cta-pulse 1.4s ease-in-out infinite;
  }

  .vault[data-box="smallChest"].free-stack-full .free-vault-top {
    width: 78px;
  }

  .vault[data-box="smallChest"] .timer-overlay,
  .vault[data-box="smallChest"].locked .timer-overlay {
    left: 50%;
    top: 30px;
    width: min(calc(100% - 22px), 148px);
    aspect-ratio: 1 / 1;
    transform: translateX(-50%);
    margin-top: 0;
    min-height: 0;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 231, 214, 0.9);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    text-shadow: 0 1px 0 rgba(0,0,0,.6);
    pointer-events: none;
  }

  .vault .label {
    width: min(100%, 166px);
    min-height: 48px;
    margin-top: 8px;
    padding: 6px 8px;
    font-size: 12px;
    line-height: 1.08;
    letter-spacing: .05em;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    justify-items: center;
    column-gap: 5px;
    row-gap: 3px;
  }

  .vault .label--plain {
    grid-template-columns: minmax(0, 1fr);
  }

  .vault .label > span:first-child {
    min-width: 0;
    line-height: 1.12;
    white-space: normal;
    word-break: break-word;
  }

  .vault .label .hud-icon.coin,
  .vault .label .hud-icon.gem {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 0 10px rgba(255, 205, 120, 0.28));
  }
}

@media (max-width: 640px) {
  .vault[data-box="smallChest"] {
    min-height: 232px;
  }

  .vault[data-box="bigChest"],
  .vault[data-box="largeChest"],
  .vault[data-box="equipChest"] {
    min-height: 232px;
  }

  .chest-ad-btn {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 40px;
    margin-top: 8px;
    padding: 5px 6px;
    border-radius: 12px;
    font-size: 8px;
    letter-spacing: .04em;
  }

  .chest-ad-timer {
    min-height: 14px;
    margin-top: 8px;
    font-size: 8px;
    letter-spacing: .05em;
  }

  .vault-row {
    gap: 8px 6px;
    padding: 8px 4px 10px;
  }

  .vault {
    width: 114px;
    min-height: 196px;
    padding-top: 26px;
  }

  .vault .chest {
    width: 102px;
    height: 102px;
    border-radius: 18px;
  }

  .vault[data-box="smallChest"] {
    padding-top: 50px;
  }

  .vault[data-box="smallChest"] .chest {
    margin-top: -24px;
  }

  .vault[data-box="smallChest"] .free-vault-top {
    width: 108px;
    gap: 6px;
  }

  .vault[data-box="smallChest"].free-stack-full .free-vault-top {
    width: 74px;
  }

  .vault[data-box="smallChest"] .free-ad-btn {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 40px;
    margin-top: 6px;
    padding: 5px 6px;
    border-radius: 12px;
    font-size: 8px;
    line-height: 1;
    letter-spacing: .04em;
  }

  .vault[data-box="smallChest"] .free-ad-meta {
    padding: 3px 6px;
    font-size: 8px;
    letter-spacing: .05em;
  }

  .vault[data-box="smallChest"] .timer-overlay,
  .vault[data-box="smallChest"].locked .timer-overlay {
    top: 26px;
    width: min(calc(100% - 12px), 102px);
    padding: 0 8px;
    margin-top: 0;
    min-height: 0;
    font-size: 8px;
    letter-spacing: .06em;
  }

  .stack-badge {
    min-width: 44px;
    padding: 4px 8px;
    font-size: 10px;
  }

  .vault .info {
    width: 24px;
    height: 24px;
    right: 5px;
    top: -4px;
    font-size: 12px;
  }

  .vault .label {
    width: 108px;
    min-height: 40px;
    margin-top: 8px;
    padding: 5px 6px;
    font-size: 9.5px;
    line-height: 1.02;
    letter-spacing: .04em;
    column-gap: 4px;
  }

  .vault .label .hud-icon.coin,
  .vault .label .hud-icon.gem {
    width: 17px;
    height: 17px;
  }
}

@media (max-width: 400px) {
  .vault[data-box="smallChest"] {
    min-height: 206px;
  }

  .vault[data-box="bigChest"],
  .vault[data-box="largeChest"],
  .vault[data-box="equipChest"] {
    min-height: 206px;
  }

  .chest-ad-btn {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 36px;
    margin-top: 6px;
    padding: 4px;
    border-radius: 11px;
    font-size: 6.8px;
  }

  .chest-ad-timer {
    min-height: 12px;
    margin-top: 6px;
    font-size: 7px;
  }

  .vault {
    width: 96px;
    min-height: 176px;
  }

  .vault .chest {
    width: 88px;
    height: 88px;
    border-radius: 16px;
  }

  .vault[data-box="smallChest"] .free-vault-top {
    width: 92px;
  }

  .vault[data-box="smallChest"].free-stack-full .free-vault-top {
    width: 68px;
  }

  .vault[data-box="smallChest"] .free-ad-btn {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 36px;
    margin-top: 6px;
    padding: 4px;
    border-radius: 11px;
    font-size: 6.8px;
  }

  .vault[data-box="smallChest"] .timer-overlay,
  .vault[data-box="smallChest"].locked .timer-overlay {
    top: 24px;
    width: min(calc(100% - 8px), 88px);
    padding: 0 6px;
    margin-top: 0;
    min-height: 0;
    font-size: 7.2px;
  }

  .vault .label {
    width: 92px;
    min-height: 36px;
    font-size: 8.5px;
    line-height: 1;
    padding: 4px;
  }

  .vault .label .hud-icon.coin,
  .vault .label .hud-icon.gem {
    width: 15px;
    height: 15px;
  }
}

/* Danger variant for buttons & modal actions */
.btn.danger {
  background: linear-gradient(180deg, rgba(51, 24, 23, 0.98), rgba(18, 11, 13, 0.98));
  color: var(--ui-text);
}

/* Rarity cards: legendary/mythic glow + sheen */
.card[style*="#ff5136"],
.card[style*="rar-color: #ff5136"] {
  animation: legend-glow 2.6s ease-in-out infinite;
}
@keyframes legend-glow {
  0%, 100% { box-shadow: 0 4px 0 rgba(0,0,0,.3), 0 0 14px rgba(255, 81, 54, 0.35); }
  50%      { box-shadow: 0 4px 0 rgba(0,0,0,.3), 0 0 32px rgba(255, 81, 54, 0.85); }
}

/* HUD pop animation on currency change */
@keyframes hud-pop {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.3); color: #ffd76a; }
  100% { transform: scale(1); }
}
.pop { animation: hud-pop .35s ease-out; display: inline-block; }

/* +N floater for currency changes */
.hud-float {
  position: fixed;
  font-weight: 900;
  font-size: 18px;
  text-shadow: 0 2px 0 #000;
  pointer-events: none;
  z-index: 300;
  animation: hud-rise 1.1s ease-out forwards;
}
@keyframes hud-rise {
  0%   { transform: translate(-50%, 0); opacity: 1; }
  100% { transform: translate(-50%, -50px); opacity: 0; }
}

/* Screen transition: fade in when .active */
.screen.active { animation: screen-fade .22s ease-out; }
@keyframes screen-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Floating spark particles on background */
.bg-sparks {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  overflow: hidden;
}
.bg-sparks .s {
  position: absolute; bottom: -20px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffd76a 0%, transparent 70%);
  animation: spark-rise linear infinite;
  opacity: .6;
}
@keyframes spark-rise {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: .7; }
  100% { transform: translateY(-110vh) translateX(30px); opacity: 0; }
}

/* Modal success / danger variants */
.modal.success h2 { background: linear-gradient(180deg, #6cf08e, #22c358); }
.modal.danger  h2 { background: linear-gradient(180deg, #ff7b7b, #d92020); }

/* HD: PP-to-gem convert block */
.hd-convert {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(0,0,0,.3);
  border: 2px solid rgba(255,255,255,.1);
  border-radius: 12px;
}
.hd-convert-row {
  display: flex; gap: 10px; align-items: center;
  font-weight: 900; font-size: 16px;
}
.hd-convert-rate { opacity: .7; font-size: 12px; }

/* Shop: deal highlight */
.card.deal {
  border-color: #ff5c2c !important;
  box-shadow: 0 4px 0 rgba(0,0,0,.3), 0 0 20px rgba(255,92,44,.5);
  animation: deal-pulse 1.8s ease-in-out infinite;
}
@keyframes deal-pulse {
  0%, 100% { box-shadow: 0 4px 0 rgba(0,0,0,.3), 0 0 14px rgba(255,92,44,.35); }
  50%      { box-shadow: 0 4px 0 rgba(0,0,0,.3), 0 0 30px rgba(255,92,44,.85); }
}
.deal-badge {
  position: absolute; top: 4px; left: 4px;
  background: #ff3b3b; color: #fff;
  border: 2px solid #fff;
  border-radius: 8px;
  padding: 3px 7px;
  font-weight: 900; font-size: 11px;
  z-index: 3;
  letter-spacing: .5px;
  box-shadow: 0 2px 0 rgba(0,0,0,.3);
}
.card .orig {
  text-decoration: line-through;
  opacity: .6;
  margin-right: 6px;
  font-weight: 700;
  font-size: 11px;
}

/* Opening overlay: rarity-based ray tinting */
#opening[data-peak="2"] { background: radial-gradient(ellipse at 50% 50%, #2d1f5a, #000); }
#opening[data-peak="3"] { background: radial-gradient(ellipse at 50% 50%, #4a1f45, #000); }
#opening[data-peak="4"] {
  background: radial-gradient(ellipse at 50% 50%, #4a2f10, #000);
}
#opening[data-peak="3"] .rays,
#opening[data-peak="4"] .rays {
  background:
    conic-gradient(from 0deg,
      transparent 0deg, rgba(255,215,106,.38) 8deg, transparent 16deg,
      transparent 24deg, rgba(255,92,44,.28) 32deg, transparent 40deg);
  animation: spin 8s linear infinite;
}
#opening[data-peak="4"] {
  animation: legend-flash 2s ease-in-out infinite;
}
@keyframes legend-flash {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.2); }
}

/* Crit-Punch: dynamic target element colored */
#critTarget {
  transition: left .15s ease, width .15s ease;
}

/* ========= BOSS RAID HUB ========= */
#boss {
  --boss-bg-current: var(--boss-bg-desktop);
  background:
    linear-gradient(180deg, rgba(4, 5, 9, 0.74), rgba(16, 2, 4, 0.42) 42%, rgba(3, 4, 8, 0.86)),
    var(--boss-bg-current);
  background-position: center center, center center;
  background-repeat: no-repeat, no-repeat;
  background-size: cover, cover;
}
@media (max-width: 768px) and (orientation: portrait) {
  #boss {
    --boss-bg-current: var(--boss-bg-mobile);
    background-position: center top, center center;
  }
}
#boss .screen-header {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  grid-template-rows: auto auto;
  gap: 8px;
  align-items: center;
}
.boss-energy-controls {
  display: grid;
  grid-template-columns: auto minmax(180px, 228px);
  align-items: stretch;
  justify-self: end;
  gap: 10px;
  grid-column: 3;
  grid-row: 1;
}
.boss-attempts-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(20, 5, 7, 0.92), rgba(6, 4, 7, 0.96));
  border: 1px solid rgba(255, 54, 54, 0.72);
  border-radius: 14px;
  min-height: 58px;
  min-width: 102px;
  padding: 8px 14px;
  font-weight: 900;
  color: #ffe9dd;
  box-shadow: 0 0 14px rgba(255, 0, 0, 0.22), inset 0 0 12px rgba(255, 44, 44, 0.08);
}
.boss-ad-btn {
  min-width: 0;
  min-height: 58px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  text-align: left;
  white-space: normal;
  border-radius: 16px;
  border-color: rgba(255, 120, 120, 0.88);
  background:
    linear-gradient(180deg, rgba(176, 16, 24, 0.98), rgba(72, 8, 12, 0.99)),
    radial-gradient(circle at 18% 50%, rgba(255, 170, 124, 0.26), transparent 42%);
  box-shadow:
    0 0 22px rgba(255, 48, 48, 0.34),
    inset 0 0 18px rgba(255, 120, 120, 0.12),
    0 10px 18px rgba(0,0,0,.28);
}
.boss-ad-btn__icon {
  font-size: 24px;
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(255, 193, 120, 0.36));
}
.boss-ad-btn__copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.boss-ad-btn__title {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #fff4ee;
  text-wrap: balance;
}
.boss-ad-btn__meta {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.18;
  color: #ffd4c5;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.boss-ad-btn.is-busy,
.boss-ad-btn.is-unavailable {
  box-shadow: inset 0 0 10px rgba(255,255,255,.04), 0 8px 14px rgba(0,0,0,.24);
}
.boss-ad-btn.is-unavailable .boss-ad-btn__meta {
  color: #d8aea1;
}
.boss-ad-meta {
  display: none;
}
.boss-hero-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  background:
    linear-gradient(180deg, rgba(22, 6, 8, 0.78), rgba(5, 4, 7, 0.92)),
    radial-gradient(circle at 12% 50%, rgba(255, 42, 42, 0.14), transparent 42%);
  border: 1px solid rgba(255, 43, 43, 0.76);
  border-radius: 18px;
  padding: 10px 14px;
  margin-bottom: 10px;
  box-shadow: 0 0 18px rgba(255, 0, 0, 0.24), 0 14px 26px rgba(0,0,0,.32);
}
.boss-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 0 12px;
}
.boss-tab {
  min-width: 174px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 47, 47, 0.44);
  background: linear-gradient(180deg, rgba(16, 6, 8, 0.94), rgba(4, 4, 6, 0.98));
  color: #ffe7dc;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 0 16px rgba(255, 39, 39, 0.1);
}
.boss-tab.active {
  border-color: rgba(255, 72, 72, 0.78);
  background: linear-gradient(180deg, rgba(112, 21, 21, 0.98), rgba(28, 7, 9, 0.98));
  color: #fff6ec;
  box-shadow: 0 0 22px rgba(255, 39, 39, 0.24), inset 0 0 18px rgba(255, 110, 96, 0.08);
}
.bh-portrait {
  width: 70px; height: 70px;
  background: radial-gradient(circle at 50% 30%, var(--rar, #7fb6ff), #1b1b3a);
  border: 3px solid #fff;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 44px;
  overflow: hidden;
  padding: 6px 6px 0;
  box-sizing: border-box;
}
.bh-portrait-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.24));
}
.bh-portrait-glyph {
  line-height: 1;
}
.bh-name { font-weight: 900; font-size: 18px; margin-bottom: 4px; }
.bh-stats { display: flex; gap: 12px; font-weight: 800; font-size: 13px; opacity: .85; }

.boss-list {
  flex: 1; overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  padding: 6px 0 20px;
}
.boss-card {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(28, 7, 9, 0.82), rgba(7, 4, 7, 0.96)),
    radial-gradient(circle at 50% 0, rgba(255, 27, 27, 0.18), transparent 70%);
  border: 1px solid rgba(255, 27, 27, 0.72);
  border-radius: 18px;
  padding: 12px 10px;
  text-align: center;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: 0 0 18px rgba(255, 0, 0, 0.28), inset 0 0 18px rgba(255, 49, 49, 0.08), 0 18px 30px rgba(0,0,0,.38);
  overflow: hidden;
}
.boss-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 74, 74, 0.22);
  box-shadow: inset 0 0 24px rgba(255, 0, 0, 0.12);
  pointer-events: none;
  z-index: 0;
}
.boss-card.beat   { opacity: .55; filter: grayscale(.6); }
.boss-card.locked { opacity: .65; }
.boss-portrait {
  appearance: none;
  -webkit-appearance: none;
  width: 72px;
  height: 72px;
  margin: 0 auto 4px;
  padding: 0;
  background: radial-gradient(circle at 50% 30%, rgba(255, 92, 64, 0.62), rgba(10, 4, 8, 0.96));
  border: 1px solid rgba(255, 96, 74, 0.8);
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6px 6px 0;
  box-sizing: border-box;
  box-shadow: inset 0 0 16px rgba(255, 60, 50, 0.1), 0 0 14px rgba(255, 0, 0, 0.2);
}
.boss-portrait-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.24));
}
.boss-portrait-glyph {
  font-size: 44px;
  line-height: 1;
}
.boss-detail {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  max-width: 860px;
  width: min(100%, 860px);
}
.boss-detail-portrait {
  width: min(48vw, 280px);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  border: 2px solid rgba(255, 41, 41, 0.78);
  background: radial-gradient(circle at 50% 32%, rgba(255, 49, 49, 0.32), rgba(3, 2, 3, 0.96) 66%);
  box-shadow: 0 0 26px rgba(255, 0, 0, 0.28), inset 0 0 28px rgba(255, 45, 45, 0.1);
  overflow: hidden;
}
.boss-detail-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 14px 20px rgba(0,0,0,.45));
}
.boss-detail-glyph {
  font-size: 92px;
  line-height: 1;
}
.boss-detail-copy {
  color: #fff1e8;
  text-align: left;
  min-width: 0;
}
.boss-detail-panel {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 54, 54, 0.34);
  background: linear-gradient(180deg, rgba(12, 4, 7, 0.92), rgba(0, 0, 0, 0.82));
  box-shadow: inset 0 0 24px rgba(255, 40, 40, 0.08);
  min-width: 0;
}
.boss-detail-name {
  color: #fff;
  font-size: clamp(20px, 2.2vw, 24px);
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(255, 38, 38, 0.5);
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.boss-detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.boss-detail-stats span,
.boss-detail-hero,
.boss-detail-reward {
  border: 1px solid rgba(255, 54, 54, 0.28);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.58);
  padding: 8px 10px;
  color: #fff1e8;
  font-weight: 900;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.4;
}
.boss-detail-reward,
.boss-detail-hero {
  margin-top: 0;
}
.boss-detail-note {
  border-radius: 12px;
  border: 1px solid rgba(255, 215, 106, 0.34);
  background: rgba(24, 8, 6, 0.78);
  padding: 10px 12px;
  color: #ffe7be;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 800;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.boss-hero-picker-shell {
  display: grid;
  gap: 12px;
}
.boss-hero-picker-copy {
  color: #fff1e8;
  font-size: 13px;
  font-weight: 800;
}
.boss-hero-picker {
  display: flex;
  flex-direction: row;
  gap: 12px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: rgba(140, 34, 22, 0.96) rgba(6, 3, 4, 0.94);
}
.boss-hero-picker::-webkit-scrollbar {
  height: 10px;
}
.boss-hero-picker::-webkit-scrollbar-track {
  background: rgba(6, 3, 4, 0.94);
  border-radius: 999px;
}
.boss-hero-picker::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, rgba(58, 14, 11, 0.98), rgba(120, 32, 24, 0.96));
  border: 2px solid rgba(6, 3, 4, 0.94);
  border-radius: 999px;
}
.boss-hero-picker-card {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 10px;
  flex: 0 0 min(200px, 66vw);
  border-radius: 16px;
  border: 2px solid rgba(255, 39, 39, 0.42);
  background: linear-gradient(180deg, rgba(18, 7, 9, 0.98), rgba(0, 0, 0, 0.96));
  color: #fff1e8;
  cursor: pointer;
}
.boss-hero-picker-card.selected {
  border-color: #ffd76a;
  box-shadow: 0 0 18px rgba(255, 215, 106, 0.34);
}
.boss-hero-picker-portrait {
  width: 86px;
  height: 86px;
  border-radius: 18px;
  border: 2px solid var(--rar, #ff5136);
  background: #000;
  overflow: hidden;
}
.boss-hero-picker-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}
.boss-hero-picker-name,
.boss-hero-picker-meta {
  font-weight: 900;
  text-align: center;
}
.boss-hero-picker-meta {
  color: #ffe0c8;
  font-size: 11px;
}
.boss-detail-empty {
  color: #fff1e8;
  font-weight: 900;
  padding: 14px;
}
.boss-emoji { font-size: 56px; line-height: 1; }
.boss-name  { font-weight: 900; font-size: 14px; letter-spacing: .5px; }
.boss-stat  { font-size: 12px; font-weight: 800; opacity: .85; }
.boss-reward { font-size: 11px; color: #ffd76a; font-weight: 800; line-height: 1.2; min-height: 28px; }
.boss-pred { font-size: 12px; font-weight: 800; min-height: 18px; }

@media (max-width: 1024px), (pointer: coarse) and (max-width: 1366px) {
  #boss.screen.active {
    display: flex;
    flex-direction: column;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }
  #boss .screen-header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding-top: calc(max(8px, env(safe-area-inset-top, 0px)) + 4px);
    padding-left: 54px;
    padding-right: 54px;
    min-height: calc(44px + max(8px, env(safe-area-inset-top, 0px)));
  }
  #boss .screen-header .back-btn {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    left: 10px;
    z-index: 8;
  }
  #boss .screen-title {
    text-align: center;
  }
  #bossHeroCard {
    position: static;
    top: auto;
    right: auto;
    z-index: auto;
    margin: 6px auto 0;
  }
  #bossTabs {
    margin: 12px 0 0;
    align-self: stretch;
  }
  #bossList {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
  }
  .boss-hero-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 3px;
    padding: 4px 6px;
    margin-bottom: 0;
    max-width: 120px;
    border-radius: 12px;
    text-align: center;
    align-items: center;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.16), 0 6px 12px rgba(0,0,0,.28);
  }
  .boss-hero-card .bh-portrait {
    width: 40px;
    height: 40px;
    font-size: 26px;
    margin: 0 auto;
  }
  .boss-hero-card .bh-name {
    font-size: 10px;
  }
  .boss-hero-card .bh-stats {
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 6px;
    font-size: 9px;
  }
  .boss-tabs {
    justify-content: center;
    flex-wrap: nowrap;
    gap: 10px;
    margin-bottom: 0;
  }
  .boss-tab {
    min-width: 0;
    flex: 0 1 auto;
    padding: 9px 14px;
    font-size: 12px;
  }
  .boss-energy-controls {
    width: min(100%, 360px);
    grid-template-columns: minmax(88px, auto) minmax(0, 1fr);
    grid-column: auto;
    grid-row: auto;
    justify-self: auto;
    align-self: stretch;
  }
  .boss-attempts-pill {
    min-width: 0;
    min-height: 52px;
    padding: 8px 10px;
    font-size: 13px;
  }
  .boss-ad-btn {
    min-height: 60px;
    padding: 9px 10px;
    gap: 8px;
  }
  .boss-ad-btn__icon {
    font-size: 21px;
  }
  .boss-ad-btn__title {
    font-size: 11px;
  }
  .boss-ad-btn__meta {
    font-size: 10px;
    line-height: 1.14;
  }
}

@media (max-width: 1024px) {
  .boss-list {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    padding: 6px 0 24px;
  }
  .boss-card {
    min-height: 324px;
    padding: 12px 12px 16px;
    gap: 8px;
  }
  .boss-reward {
    min-height: 40px;
  }
  .boss-pred {
    min-height: 22px;
  }
  .boss-card .btn {
    width: 100%;
    min-height: 44px;
    margin-top: auto;
    justify-content: center;
  }
}

/* ========= BOSS ARENA ========= */
#bossArena {
  --boss-arena-bg-current: var(--boss-arena-bg-desktop);
  background:
    linear-gradient(180deg, rgba(7, 6, 10, 0.44), rgba(18, 4, 6, 0.26) 44%, rgba(6, 5, 9, 0.72)),
    radial-gradient(circle at 50% 12%, rgba(255, 52, 52, 0.14), transparent 32%),
    var(--boss-arena-bg-current);
  background-position: center center, center top, center center;
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-size: cover, cover, cover;
}
#pvpArena {
  background: linear-gradient(180deg, #431a20, #100408);
}
@media (max-width: 1024px) and (orientation: portrait), (pointer: coarse) and (max-width: 1366px) and (orientation: portrait) {
  #bossArena {
    --boss-arena-bg-current: var(--boss-arena-bg-mobile);
    background-position: center center, center top, center top;
  }
}
.arena-stage {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 20px 6px;
}
.arena-side {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.arena-name { font-weight: 900; letter-spacing: 1px; text-shadow: 0 2px 0 #000; }
.arena-hero-card {
  width: min(100%, 260px);
  margin-bottom: 4px;
  padding: 12px 14px;
  border-color: rgba(255,255,255,.28);
  background: linear-gradient(180deg, rgba(18, 26, 58, 0.96), rgba(8, 12, 28, 0.98));
  box-shadow: 0 10px 24px rgba(0,0,0,.28), 0 0 18px rgba(87, 163, 255, 0.12);
}
.arena-hero-card .bh-portrait {
  width: 88px;
  height: 88px;
  font-size: 54px;
  border-width: 4px;
  box-shadow: 0 6px 0 rgba(0,0,0,.32);
}
.arena-hero-card .bh-name {
  font-size: 16px;
}
.arena-hero-card .bh-stats {
  flex-wrap: wrap;
  gap: 8px 10px;
  font-size: 12px;
}
.arena-fighter {
  transition: transform .15s ease, filter .22s ease;
}
.arena-char {
  width: 120px; height: 120px;
  background: radial-gradient(circle at 50% 30%, var(--rar, #7fb6ff), #1b1b3a);
  border: 4px solid #fff;
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 76px;
  box-shadow: 0 6px 0 rgba(0,0,0,.4);
  overflow: hidden;
}
.arena-char.boss {
  background: radial-gradient(circle at 50% 30%, #ff6060, #2a0a0a);
}
.arena-boss-art {
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  object-fit: contain;
  object-position: center bottom;
  transform: translateY(4px);
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.28));
}
.arena-boss-glyph {
  font-size: 76px;
  line-height: 1;
}
.arena-char,
.arena-fighter {
  transition: transform .15s ease, filter .22s ease;
}
.arena-char.strike,
.arena-fighter.strike { animation: strike .24s ease-out; }
.arena-char.hit,
.arena-fighter.hit    { animation: hit .22s ease-out; filter: brightness(1.7) saturate(1.5); }
@keyframes strike {
  0%   { transform: translateX(0) rotate(0); }
  40%  { transform: translateX(30px) rotate(8deg); }
  100% { transform: translateX(0) rotate(0); }
}
.arena-side.right .arena-char.strike,
.arena-side.right .arena-fighter.strike { animation: strike-r .24s ease-out; }
@keyframes strike-r {
  0%   { transform: translateX(0) rotate(0); }
  40%  { transform: translateX(-30px) rotate(-8deg); }
  100% { transform: translateX(0) rotate(0); }
}
@keyframes hit {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
.arena-vs {
  font-size: 36px; font-weight: 900;
  color: #ffd76a; text-shadow: 0 3px 0 #000;
}
.arena-hp {
  width: 140px; height: 18px;
  background: rgba(0,0,0,.6);
  border: 2px solid #000;
  border-radius: 10px;
  overflow: hidden;
}
.arena-hp > div {
  height: 100%;
  background: linear-gradient(180deg, #6cf08e, #22c358);
  transition: width .2s ease;
  width: 100%;
}
.arena-hp > div.enemy {
  background: linear-gradient(180deg, #ff7b7b, #d92020);
}
.arena-log {
  background: rgba(0,0,0,.45);
  border: 2px solid rgba(255,255,255,.15);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 0 6px 10px;
  min-height: 120px;
  max-height: 180px;
  overflow-y: auto;
  font-size: 13px;
  font-weight: 800;
}
.pvp-arena-stage {
  padding-inline: 18px;
}
.pvp-fighter-card {
  width: min(100%, 260px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  border: 3px solid var(--rar, #ff2727);
  background: linear-gradient(180deg, rgba(8, 4, 5, 0.98), rgba(0, 0, 0, 0.98));
  color: #fff3eb;
  box-shadow: 0 0 18px rgba(255, 0, 0, 0.18), 0 14px 24px rgba(0,0,0,.34);
}
.pvp-fighter-label {
  color: #ffb39a;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .18em;
}
.pvp-fighter-portrait {
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 2px solid rgba(255,255,255,.12);
  background: #000;
  overflow: hidden;
}
.pvp-fighter-portrait .portrait-art {
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  object-fit: contain;
  object-position: center bottom;
}
.pvp-fighter-name {
  font-size: 17px;
  font-weight: 900;
}
.pvp-fighter-hero,
.pvp-fighter-stats {
  font-size: 12px;
  font-weight: 800;
  color: #ffe8b4;
  text-align: center;
}
.al-entry { padding: 3px 0; opacity: .85; }
.al-entry.hero { color: #6cf08e; }
.al-entry.boss { color: #ff9a9a; }

/* Mini hub card disabled */
.btn.sm.disabled { background: #555; color: #aaa; cursor: not-allowed; opacity: .7; }

/* Daily streak pill */
.d-streak {
  background: rgba(0,0,0,.35);
  border: 2px solid rgba(255,255,255,.2);
  border-radius: 10px;
  padding: 6px 12px;
  margin-top: 8px;
  display: inline-block;
  font-weight: 800;
}
.d-streak.muted { opacity: .7; }

/* Boss on mobile */
@media (max-width: 520px) {
  .boss-list {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 6px 0 28px;
  }
  .boss-card {
    min-height: 336px;
    padding: 12px 12px 16px;
    gap: 8px;
  }
  .boss-reward {
    min-height: 40px;
  }
  .boss-pred {
    min-height: 22px;
  }
  .boss-card .btn {
    width: 100%;
    min-height: 44px;
    margin-top: auto;
    justify-content: center;
  }
  .boss-tabs { gap: 8px; margin-bottom: 0; }
  .boss-tab { min-width: 0; flex: 1 1 0; padding: 9px 10px; font-size: 10px; }
  .boss-hero-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 2px;
    padding: 3px 5px;
    margin-bottom: 0;
    max-width: 110px;
    border-radius: 10px;
    text-align: center;
    align-items: center;
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.14), 0 4px 10px rgba(0,0,0,.26);
  }
  .boss-hero-card .bh-portrait {
    width: 36px;
    height: 36px;
    font-size: 24px;
    margin: 0 auto;
  }
  .boss-hero-card .bh-name {
    font-size: 9px;
  }
  .boss-hero-card .bh-stats {
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 4px;
    font-size: 8px;
  }
  .arena-stage { grid-template-columns: 1fr; gap: 8px; padding: 10px; }
  .arena-vs { font-size: 24px; margin: 0; }
  .arena-char { width: 90px; height: 90px; font-size: 54px; }
  .arena-hp { width: 110px; }
  .bh-portrait { width: 56px; height: 56px; font-size: 34px; }
  .arena-hero-card { width: min(100%, 220px); padding: 10px 12px; }
  .arena-hero-card .bh-portrait { width: 72px; height: 72px; font-size: 42px; }
  .arena-hero-card .bh-name { font-size: 14px; }
}

/* ============== PASS RESKIN ============== */
#pass[data-pass-view="rewards"] {
  --pass-bg-desktop: var(--pass-bg-rewards-desktop);
  --pass-bg-mobile: var(--pass-bg-rewards-mobile);
  --pass-bg-current: var(--pass-bg-desktop);
}

#pass[data-pass-view="quests"] {
  --pass-bg-desktop: var(--pass-bg-quests-desktop);
  --pass-bg-mobile: var(--pass-bg-quests-mobile);
  --pass-bg-current: var(--pass-bg-desktop);
}

#pass {
  position: absolute;
  inset: 0;
  overflow: hidden;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(6, 7, 12, 0.88), rgba(8, 7, 12, 0.78) 38%, rgba(5, 6, 10, 0.92)),
    var(--pass-bg-current, linear-gradient(180deg, rgba(8, 5, 7, 0.98), rgba(17, 8, 10, 0.98) 44%, rgba(8, 5, 6, 0.98)));
  background-position: center center, center center;
  background-repeat: no-repeat, no-repeat;
  background-size: cover, cover;
}
#pass::before,
#pass::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#pass::before {
  background:
    radial-gradient(circle at 34% 42%, rgba(255,255,255,.035), transparent 2px) 0 0 / 180px 180px,
    radial-gradient(circle at 72% 70%, rgba(255,255,255,.03), transparent 2px) 0 0 / 220px 220px;
  opacity: .45;
  animation: pass-screen-spores 12s linear infinite;
}
#pass::after {
  background:
    linear-gradient(110deg, transparent 0 16%, rgba(168, 45, 36, 0.12) 17%, transparent 18% 48%, rgba(168, 45, 36, 0.08) 49%, transparent 50% 100%),
    linear-gradient(64deg, transparent 0 20%, rgba(255, 118, 82, 0.06) 21%, transparent 22% 100%);
  opacity: .52;
  filter: blur(10px);
}
#pass > * {
  position: relative;
  z-index: 1;
}
#pass .pass-header,
#pass .pass-progress-bar {
  z-index: 4;
}
#pass .pass-header .back-btn,
#pass .pass-header .pass-season,
#pass .pass-header .pass-tabs {
  position: relative;
  z-index: 5;
}
@media (max-width: 768px) and (orientation: portrait) {
  #pass[data-pass-view="rewards"],
  #pass[data-pass-view="quests"] {
    --pass-bg-current: var(--pass-bg-mobile);
  }
}
#pass .pass-header {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  grid-template-rows: auto auto;
  gap: 8px 10px;
  align-items: center;
  padding: 4px 6px;
  margin-bottom: 4px;
}

@media (max-width: 1280px) and (min-width: 1025px) and (pointer: fine) {
  #trophyRoad {
    padding: 12px 12px 16px;
  }
  #trophyRoad .screen-header {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 6px 0 2px;
    margin-bottom: 6px;
    background: linear-gradient(180deg, rgba(6, 5, 8, 0.96), rgba(6, 5, 8, 0.82) 78%, rgba(6, 5, 8, 0));
  }
  #trophyRoad .screen-title {
    font-size: clamp(20px, 2vw, 24px);
    letter-spacing: .1em;
    padding: 0 48px;
  }
  .tr-sub {
    margin-bottom: 10px;
    padding: 12px 14px;
    line-height: 1.42;
  }
  .tr-track {
    padding: 22px 12px 26px;
    gap: 14px;
    border-radius: 24px;
  }
  .tr-track::before,
  .tr-track::after {
    left: 18px;
    right: 18px;
  }
  .tr-counter {
    margin-top: 16px;
    padding: 10px 14px;
    font-size: 16px;
  }
  .tr-claim-all {
    bottom: 10px;
    margin-top: 12px;
    width: min(280px, calc(100% - 6px));
  }
}
#pass .pass-header .back-btn {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  left: auto;
  top: auto;
  transform: none;
  justify-self: start;
  align-self: center;
  margin-left: clamp(6px, 0.9vw, 14px);
  z-index: 8;
}
#pass[data-pass-view="quests"] .pass-header {
  padding-top: 0;
  margin-bottom: 6px;
}
#pass .pass-season {
  grid-column: 1 / -1;
  grid-row: 1;
  justify-self: stretch;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px 64px;
  border-radius: 18px;
  border: 1px solid rgba(234, 112, 84, 0.28);
  background:
    linear-gradient(180deg, rgba(48, 13, 15, 0.96), rgba(17, 8, 10, 0.98)),
    radial-gradient(circle at 50% 0, rgba(231, 86, 62, 0.1), transparent 70%);
  transform: none;
  min-width: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 12px 26px rgba(0,0,0,.22);
}
#pass .ps-sub {
  transform: none;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: #f2a37d;
  opacity: 1;
}
#pass .ps-title {
  transform: none;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #fff1e9;
  text-shadow: 0 0 18px rgba(231, 86, 62, 0.18);
}
#pass .pass-tabs {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: end;
  align-self: center;
  margin-left: 0;
  border-radius: 16px;
  padding: 4px;
  border: 1px solid rgba(233, 107, 79, 0.24);
  background: linear-gradient(180deg, rgba(35, 11, 12, 0.94), rgba(12, 8, 9, 0.96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
#pass .ptab {
  border-radius: 12px;
  padding: 9px 16px;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #d7c3bb;
}
#pass .ptab.active {
  background: linear-gradient(180deg, rgba(100, 24, 19, 0.98), rgba(35, 11, 12, 0.98));
  color: #fff2eb;
  box-shadow: 0 0 18px rgba(231, 86, 62, 0.14);
}
#pass .home-btn {
  border: 1px solid rgba(234, 112, 84, 0.28);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(43, 12, 14, 0.96), rgba(15, 8, 10, 0.98));
  color: #f1ddd3;
  box-shadow: 0 0 14px rgba(231, 86, 62, 0.12), 0 10px 20px rgba(0,0,0,.28);
}
#pass .pass-progress-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 0 6px 6px;
}
#pass[data-pass-view="quests"] .pass-progress-bar {
  padding-bottom: 6px;
}
#pass .ppb-fill {
  height: 28px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(25, 10, 11, 0.98), rgba(10, 7, 8, 0.98));
  border: 1px solid rgba(221, 95, 74, 0.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
#pass #ppbFill {
  height: 100%;
  background:
    linear-gradient(90deg, rgba(110, 28, 21, 0.96), rgba(230, 90, 65, 0.98), rgba(255, 144, 88, 0.94));
  box-shadow: 0 0 18px rgba(231, 86, 62, 0.16);
}
#pass .ppb-text {
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .12em;
  color: #fff0e8;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(0,0,0,.48);
}
#pass .ppb-level {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(245, 126, 92, 0.34);
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,.16), transparent 30%),
    radial-gradient(circle at 50% 50%, rgba(255, 162, 92, 0.88), rgba(86, 28, 18, 0.96));
  color: #fff3eb;
  box-shadow: 0 0 18px rgba(231, 86, 62, 0.18);
}
#pass .pass-pane {
  position: relative;
  min-height: 0;
  overflow: hidden;
  z-index: 1;
}
#pass #passRewardsPane {
  position: relative;
  gap: 12px;
}
.pass-claim-all {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 3;
}
#pass .pass-buy-col {
  flex: 0 0 136px;
  justify-content: center;
}
#pass .pbc-card {
  position: relative;
  min-height: 348px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 242px 14px 26px;
  padding-top: 242px;
  gap: 10px;
  border-radius: 22px;
  border: 1px solid rgba(235, 113, 85, 0.24);
  color: #f7e7dd;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.01) 0%, rgba(0, 0, 0, 0.10) 34%, rgba(0, 0, 0, 0.62) 54%, rgba(0, 0, 0, 0.92) 72%, rgba(0, 0, 0, 0.99) 100%),
    var(--pass-ticket-image) center / cover no-repeat;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 16px 30px rgba(0,0,0,.28);
}
#pass .pbc-card::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  height: 18px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(231, 86, 62, 0.16), transparent 72%);
  filter: blur(12px);
}
#pass .pbc-state {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.05);
  background: rgba(16, 8, 9, 0.86);
  color: #f3dfd5;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}
#pass .pbc-relic {
  width: 90px;
  height: 108px;
  display: grid;
  place-items: center;
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% 34%, rgba(255,255,255,.08), transparent 24%),
    linear-gradient(180deg, rgba(66, 18, 19, 0.98), rgba(18, 8, 10, 0.98));
  border: 1px solid rgba(255,255,255,.05);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
#pass .pbc-core {
  width: 64px;
  height: 64px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 32px;
  color: #fff3ea;
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,.16), transparent 26%),
    radial-gradient(circle at 50% 50%, rgba(255, 160, 92, 0.92), rgba(91, 28, 18, 0.96));
  box-shadow: inset 0 0 18px rgba(255,255,255,.08), 0 0 24px rgba(231, 86, 62, 0.18);
}
#pass .pbc-owned .pbc-core {
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,.16), transparent 26%),
    radial-gradient(circle at 50% 50%, rgba(120, 228, 160, 0.88), rgba(18, 76, 44, 0.96));
  box-shadow: inset 0 0 18px rgba(255,255,255,.08), 0 0 24px rgba(120, 228, 160, 0.14);
}
#pass .pbc-label {
  position: relative;
  z-index: 1;
  margin-top: auto;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
  line-height: 1.4;
  text-transform: uppercase;
  text-align: center;
}
#pass .pbc-sub {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 800;
  color: #ccb8b0;
  line-height: 1.45;
  text-align: center;
}
#pass .pbc-locked .pbc-sub {
  margin-top: 2px;
}
#pass #pbcActivate {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  border-radius: 12px;
  border: 1px solid rgba(247, 139, 103, 0.3);
  background: linear-gradient(180deg, rgba(100, 24, 19, 0.98), rgba(36, 11, 12, 0.98));
  color: #fff0e8;
  box-shadow: 0 0 18px rgba(231, 86, 62, 0.14);
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0.15em;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
#pass #pbcActivate .pbc-activate-label,
#pass #pbcActivate .pbc-activate-price {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#pass #pbcActivate .pbc-activate-price .currency-inline {
  gap: 0.35em;
}
#pass #pbcActivate .pbc-activate-sep {
  opacity: 0.88;
  font-weight: 800;
}
#pass .pass-track {
  position: relative;
  flex: 1;
  display: flex;
  gap: 12px;
  padding: 14px 14px 14px;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(27, 10, 12, 0.72), rgba(9, 6, 7, 0.86)),
    radial-gradient(circle at 50% 0, rgba(231, 86, 62, 0.08), transparent 70%);
  border: 1px solid rgba(200, 76, 59, 0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 18px 32px rgba(0,0,0,.22);
}
#pass .pass-track,
#pass .pass-track * {
  touch-action: pan-x;
}
#pass .pass-track.drag-scroll-enabled {
  touch-action: pan-x;
  cursor: grab;
}
#pass .pass-track.drag-scroll-enabled.is-dragging {
  cursor: grabbing;
  user-select: none;
}
#pass .pass-track::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
#pass .pass-track::before {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: 50%;
  height: 12px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, rgba(63, 20, 18, 0.18), rgba(178, 48, 40, 0.92), rgba(63, 20, 18, 0.18));
  box-shadow: 0 0 18px rgba(231, 86, 62, 0.2), 0 0 44px rgba(231, 86, 62, 0.12);
  animation: pass-track-breathe 3.8s ease-in-out infinite;
  pointer-events: none;
}
#pass .pass-col {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 122px;
}
#pass .pass-col.current {
  transform: translateY(-6px);
}
#pass .pass-col.current .ptk-card {
  box-shadow:
    0 0 0 1px rgba(255,255,255,.02),
    0 0 24px rgba(231, 86, 62, 0.18),
    0 16px 30px rgba(0,0,0,.32);
}
#pass .pass-row {
  display: flex;
  justify-content: center;
}
#pass .ptk-card {
  position: relative;
  width: 112px;
  min-height: 168px;
  padding: 12px 8px 14px;
  gap: 8px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  color: #fff0e8;
  background:
    linear-gradient(180deg, rgba(49, 13, 15, 0.98), rgba(15, 8, 10, 0.98)),
    radial-gradient(circle at 50% 0, rgba(255,255,255,.04), transparent 72%);
  box-shadow: 0 12px 24px rgba(0,0,0,.28);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, opacity .2s ease;
}
#pass .ptk-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 28%, rgba(241, 110, 83, 0.15), transparent 34%),
    linear-gradient(124deg, transparent 0 18%, rgba(255,255,255,.03) 19%, transparent 21% 100%);
  pointer-events: none;
}
#pass .ptk-card.premium {
  border-color: rgba(245, 121, 90, 0.26);
  background:
    linear-gradient(180deg, rgba(63, 16, 18, 0.98), rgba(19, 8, 10, 0.98)),
    radial-gradient(circle at 50% 0, rgba(233, 86, 62, 0.12), transparent 72%);
}
#pass .ptk-card.free {
  border-color: rgba(231, 178, 102, 0.18);
  background:
    linear-gradient(180deg, rgba(40, 16, 14, 0.98), rgba(13, 8, 9, 0.98)),
    radial-gradient(circle at 50% 0, rgba(233, 153, 72, 0.08), transparent 72%);
}
#pass .ptk-card.avail {
  border-color: rgba(245, 131, 95, 0.34);
  box-shadow: 0 0 22px rgba(231, 86, 62, 0.12), 0 12px 24px rgba(0,0,0,.28);
  animation: pass-card-breathe 2.8s ease-in-out infinite;
}
#pass .ptk-card.claimed {
  opacity: .54;
  filter: grayscale(.2) saturate(.86);
}
#pass .ptk-card.locked {
  opacity: .82;
}
#pass .ptk-state {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(16, 8, 9, 0.88);
  border: 1px solid rgba(255,255,255,.05);
  color: #f2ddd2;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}
#pass .ptk-card.avail .ptk-state {
  background: linear-gradient(180deg, rgba(99, 24, 19, 0.98), rgba(35, 11, 12, 0.98));
  border-color: rgba(244, 129, 96, 0.3);
  box-shadow: 0 0 14px rgba(231, 86, 62, 0.1);
}
#pass .ptk-relic {
  width: 82px;
  height: 92px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 34%, rgba(255,255,255,.08), transparent 24%),
    linear-gradient(180deg, rgba(66, 18, 19, 0.98), rgba(18, 8, 10, 0.98));
  border: 1px solid rgba(255,255,255,.05);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
#pass .ptk-veins,
#pass .ptk-veins::before,
#pass .ptk-veins::after {
  content: "";
  position: absolute;
  display: block;
  border-radius: 999px;
  pointer-events: none;
}
#pass .ptk-veins {
  left: 10px;
  right: 10px;
  top: 24px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(127, 44, 37, 0.88), transparent);
}
#pass .ptk-veins::before {
  left: 8px;
  right: 16px;
  bottom: -36px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(127, 44, 37, 0.88), transparent);
}
#pass .ptk-veins::after {
  width: 2px;
  top: -14px;
  bottom: -46px;
  right: 20px;
  background: linear-gradient(180deg, transparent, rgba(127, 44, 37, 0.72), transparent);
}
#pass .ptk-core {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  margin-top: 4px;
  box-shadow: inset 0 0 18px rgba(255,255,255,.08), 0 0 22px rgba(241, 110, 83, 0.16);
}
#pass .ptk-card.avail .ptk-core {
  animation: pass-relic-pulse 2.2s ease-in-out infinite;
}
#pass .ptk-ic {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(255,255,255,.08));
}
#pass .ptk-coins .ptk-core {
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 248, 207, 0.26), transparent 28%),
    radial-gradient(circle at 50% 50%, rgba(255, 190, 88, 0.92), rgba(118, 52, 12, 0.96));
}
#pass .ptk-gems .ptk-core {
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,.24), transparent 24%),
    radial-gradient(circle at 50% 50%, rgba(119, 215, 255, 0.86), rgba(11, 57, 86, 0.96));
}
#pass .ptk-coins .ptk-ic,
#pass .ptk-gems .ptk-ic {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}
#pass .ptk-coins .ptk-ic .currency-mark {
  --currency-icon-limit: 58px;
  filter: drop-shadow(0 0 12px rgba(255, 205, 120, 0.28));
}
#pass .ptk-gems .ptk-ic .currency-mark {
  --currency-icon-limit: 58px;
  filter: drop-shadow(0 0 14px rgba(122, 224, 255, 0.32));
}
#pass .ptk-box {
  border-color: rgba(246, 152, 101, 0.26);
  background:
    linear-gradient(180deg, rgba(55, 16, 12, 0.98), rgba(16, 8, 9, 0.98)),
    radial-gradient(circle at 50% 0, rgba(240, 152, 72, 0.10), transparent 70%);
}
#pass .ptk-box .ptk-relic {
  background:
    radial-gradient(circle at 50% 34%, rgba(255,255,255,.08), transparent 26%),
    linear-gradient(180deg, rgba(73, 23, 15, 0.98), rgba(23, 10, 9, 0.98));
}
#pass .ptk-box .ptk-core {
  width: 64px;
  height: 64px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
#pass .ptk-box-art {
  display: block;
  width: 110%;
  height: 110%;
  margin-inline: auto;
  object-fit: contain;
  object-position: center center;
  filter: drop-shadow(0 10px 14px rgba(0,0,0,.28));
}
#pass .ptk-box .ptk-v {
  color: #f7ddca;
  font-size: 10px;
  line-height: 1.25;
}
#pass .ptk-hero {
  border-color: rgba(255, 39, 39, 0.58);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.03),
    0 0 28px rgba(255, 39, 39, 0.22),
    0 18px 32px rgba(0,0,0,.34);
}
#pass .ptk-hero::before {
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 85, 85, 0.22), transparent 38%),
    linear-gradient(124deg, transparent 0 18%, rgba(255,255,255,.04) 19%, transparent 21% 100%);
}
#pass .ptk-hero .ptk-core {
  overflow: hidden;
  width: 70px;
  height: 70px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 118, 118, 0.16), transparent 32%),
    #050303;
  box-shadow: inset 0 0 0 1px rgba(255, 96, 96, 0.28), 0 0 26px rgba(255, 45, 45, 0.18);
}
#pass .ptk-hero .ptk-ic {
  display: block;
  width: 100%;
  height: 100%;
}
#pass .ptk-hero-art {
  display: block;
  width: 100%;
  height: 100%;
  margin-inline: auto;
  object-fit: contain;
  object-position: center center;
  padding: 4px;
}
#pass .ptk-hero-glyph {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  font-size: 30px;
}
#pass .ptk-generic .ptk-core {
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,.18), transparent 24%),
    radial-gradient(circle at 50% 50%, rgba(214, 190, 180, 0.78), rgba(62, 32, 26, 0.96));
}
#pass .ptk-v {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  min-height: 2.8em;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: .08em;
}
#pass .ptk-hero .ptk-v {
  color: #fff1dc;
  text-shadow: 0 0 16px rgba(255, 84, 84, 0.22);
}
#pass .ptk-check,
#pass .ptk-lock {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(12, 7, 8, 0.82);
  border: 1px solid rgba(255,255,255,.05);
}
#pass .ptk-check {
  color: #88f4aa;
  font-size: 14px;
}
#pass .ptk-lock {
  color: #f2ddd2;
  font-size: 13px;
}
#pass .ptk-claim {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  left: auto;
  right: auto;
  bottom: auto;
  transform: none;
  width: 100%;
  max-width: 96px;
  align-self: center;
  margin-inline: auto;
  margin: auto auto 0;
  padding: 5px 8px;
  min-height: 28px;
  border-radius: 10px;
  border: 1px solid rgba(246, 140, 102, 0.3);
  background: linear-gradient(180deg, rgba(100, 24, 19, 0.98), rgba(36, 11, 12, 0.98));
  color: #fff0e8;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .12em;
  line-height: 1.1;
  text-align: center;
  box-shadow: 0 0 14px rgba(231, 86, 62, 0.12);
}
@media (min-width: 1025px) {
  #pass {
    min-height: 100dvh;
    padding: 0 18px 18px;
    gap: 0;
  }
  #pass .pass-header {
    padding: max(10px, env(safe-area-inset-top, 0px)) 0 0;
    margin-bottom: 10px;
    align-items: stretch;
  }
  #pass .pass-season {
    min-height: 92px;
    padding: 14px 20px;
    border-radius: 0 0 22px 22px;
  }
  #pass .ps-sub {
    font-size: 12px;
    letter-spacing: .28em;
  }
  #pass .ps-title {
    font-size: 22px;
  }
  #pass .pass-progress-bar {
    padding: 0 0 12px;
    margin-bottom: 2px;
  }
  #pass .pass-pane {
    flex: 1 1 auto;
    min-height: 0;
  }
  #pass #passRewardsPane {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    height: calc(100dvh - 152px);
    align-items: stretch;
    gap: 16px;
  }
  #pass .pass-buy-col {
    flex: 0 0 212px;
    align-self: stretch;
    justify-content: stretch;
  }
  #pass .pbc-card {
    min-height: 100%;
    height: 100%;
    max-width: 204px;
    width: 100%;
    margin-inline: auto;
    box-sizing: border-box;
    padding: clamp(28px, 6vh, 56px) 16px 28px;
    gap: 14px;
    background-size: 100% 100%, min(92%, 200px) auto;
    background-position: center, 50% calc(100% - 128px);
    background-repeat: no-repeat, no-repeat;
  }
  #pass #pbcActivate {
    flex-direction: column;
    gap: 6px;
    align-items: center;
    justify-content: center;
    white-space: normal;
    text-wrap: wrap;
    min-height: 52px;
    padding: 10px 14px 12px;
    font-size: clamp(10px, 0.55vw + 8px, 13px);
    word-break: normal;
    overflow-wrap: normal;
    line-height: 1.15;
    letter-spacing: .06em;
  }
  #pass #pbcActivate .pbc-activate-sep {
    display: none;
  }
  #pass #pbcActivate .pbc-activate-label {
    white-space: nowrap;
    letter-spacing: .06em;
  }
  #pass #pbcActivate .pbc-activate-price {
    white-space: nowrap;
    line-height: 1;
  }
  #pass #pbcActivate .pbc-activate-price .currency-inline {
    gap: .35em;
    font-size: 1.12em;
    flex-shrink: 0;
  }
  #pass #pbcActivate .pbc-activate-price .currency-inline__icon {
    --currency-icon-limit: 1.4em;
  }
  #pass .pass-track {
    min-height: 100%;
    padding: 30px 20px 20px;
    gap: 16px;
    border-radius: 30px;
  }
  #pass .pass-col {
    min-width: 170px;
    gap: 12px;
  }
  #pass .ptk-card {
    width: 170px;
    min-height: 206px;
    padding: 16px 10px 18px;
    gap: 10px;
  }
  #pass .ptk-state {
    font-size: 11px;
  }
  #pass .ptk-relic {
    width: 112px;
    height: 130px;
  }
  #pass .ptk-core {
    width: 86px;
    height: 86px;
    border-radius: 24px;
  }
  #pass .ptk-ic {
    font-size: 48px;
  }
  #pass .ptk-coins .ptk-ic .currency-mark,
  #pass .ptk-gems .ptk-ic .currency-mark {
    --currency-icon-limit: 82px;
  }
  #pass .ptk-box .ptk-core,
  #pass .ptk-hero .ptk-core {
    width: 94px;
    height: 94px;
  }
  #pass .ptk-v {
    font-size: 14px;
  }
  #pass .ptk-state,
  #pass .ptk-v,
  #pass .ptk-claim {
    overflow-wrap: anywhere;
    text-wrap: balance;
  }
  #pass .ptk-claim {
    max-width: 96px;
    min-height: 28px;
    padding: 5px 8px;
    font-size: 9px;
  }
}
@media (min-width: 1440px) {
  #pass {
    padding: 0 24px 22px;
  }
  #pass .pass-header {
    margin-bottom: 12px;
  }
  #pass .pass-season {
    min-height: 104px;
    padding: 16px 24px;
  }
  #pass .ps-title {
    font-size: 24px;
  }
  #pass .pass-progress-bar {
    padding-bottom: 14px;
  }
  #pass #passRewardsPane {
    height: calc(100dvh - 164px);
    gap: 18px;
  }
  #pass .pass-buy-col {
    flex-basis: 228px;
  }
  #pass .pbc-card {
    max-width: 220px;
    width: 100%;
    padding: clamp(32px, 7vh, 64px) 18px 30px;
    background-size: 100% 100%, min(90%, 214px) auto;
    background-position: center, 50% calc(100% - 132px);
    background-repeat: no-repeat, no-repeat;
  }
  #pass #pbcActivate {
    flex-direction: column;
    gap: 7px;
    align-items: center;
    white-space: normal;
    text-wrap: wrap;
    min-height: 54px;
    padding-top: 11px;
    padding-bottom: 12px;
    font-size: clamp(10px, 0.5vw + 9px, 14px);
    word-break: normal;
    overflow-wrap: normal;
  }
  #pass #pbcActivate .pbc-activate-sep {
    display: none;
  }
  #pass #pbcActivate .pbc-activate-label {
    white-space: nowrap;
  }
  #pass #pbcActivate .pbc-activate-price {
    white-space: nowrap;
  }
  #pass #pbcActivate .pbc-activate-price .currency-inline {
    font-size: 1.15em;
  }
  #pass .pass-track {
    padding: 32px 22px 22px;
    gap: 18px;
  }
  #pass .pass-col {
    min-width: 178px;
  }
  #pass .ptk-card {
    width: 178px;
    min-height: 222px;
    padding: 18px 12px 20px;
  }
  #pass .ptk-relic {
    width: 120px;
    height: 138px;
  }
  #pass .ptk-core {
    width: 92px;
    height: 92px;
  }
  #pass .ptk-ic {
    font-size: 52px;
  }
  #pass .ptk-coins .ptk-ic .currency-mark,
  #pass .ptk-gems .ptk-ic .currency-mark {
    --currency-icon-limit: 88px;
  }
  #pass .ptk-box .ptk-core,
  #pass .ptk-hero .ptk-core {
    width: 100px;
    height: 100px;
  }
  #pass .ptk-v {
    font-size: 14px;
  }
  #pass .ptk-claim {
    max-width: 100px;
    min-height: 32px;
    font-size: 10px;
  }
}
@media (min-width: 1025px) and (max-height: 960px) {
  #pass {
    padding: 0 14px 14px;
  }
  #pass .pass-header {
    padding-top: max(8px, env(safe-area-inset-top, 0px));
    margin-bottom: 6px;
  }
  #pass .pass-season {
    min-height: 74px;
    padding: 10px 14px;
    border-radius: 0 0 18px 18px;
  }
  #pass .ps-sub {
    font-size: 10px;
    letter-spacing: .22em;
  }
  #pass .ps-title {
    font-size: 18px;
  }
  #pass .pass-tabs {
    padding: 3px;
  }
  #pass .ptab {
    padding: 7px 12px;
    font-size: 11px;
    letter-spacing: .14em;
  }
  #pass .pass-progress-bar {
    padding: 0 2px 4px;
    gap: 8px;
  }
  #pass .ppb-fill {
    height: 24px;
  }
  #pass .ppb-level {
    width: 38px;
    height: 38px;
  }
  #pass #passRewardsPane {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    gap: 14px;
  }
  #pass .pass-buy-col {
    flex: 0 0 196px;
  }
  #pass .pbc-card {
    min-height: 100%;
    height: auto;
    max-width: 192px;
    width: 100%;
    margin-inline: auto;
    padding: clamp(20px, 5vh, 44px) 14px 18px;
    gap: 10px;
    border-radius: 18px;
    background-size: 100% 100%, min(88%, 176px) auto;
    background-position: center, 50% calc(100% - 114px);
    background-repeat: no-repeat, no-repeat;
  }
  #pass .pbc-relic {
    width: 72px;
    height: 88px;
    border-radius: 20px;
  }
  #pass .pbc-core {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    font-size: 26px;
  }
  #pass .pbc-label {
    font-size: 11px;
    line-height: 1.3;
  }
  #pass .pbc-sub {
    font-size: 10px;
    line-height: 1.3;
  }
  #pass #pbcActivate {
    flex-direction: column;
    gap: 5px;
    align-items: center;
    white-space: normal;
    text-wrap: wrap;
    min-height: 48px;
    margin-top: 8px;
    padding: 8px 10px 9px;
    font-size: clamp(8px, 0.6vw + 6px, 11px);
    word-break: normal;
    overflow-wrap: normal;
    letter-spacing: .05em;
  }
  #pass #pbcActivate .pbc-activate-sep {
    display: none;
  }
  #pass #pbcActivate .pbc-activate-label {
    white-space: nowrap;
  }
  #pass #pbcActivate .pbc-activate-price {
    white-space: nowrap;
  }
  #pass .pass-track {
    min-height: 0;
    padding: 22px 14px 14px;
    gap: 12px;
    border-radius: 24px;
  }
  #pass .pass-track::before {
    left: 18px;
    right: 18px;
    height: 10px;
  }
  #pass .pass-col {
    min-width: 148px;
    gap: 10px;
  }
  #pass .pass-col.current {
    transform: translateY(-3px);
  }
  #pass .ptk-card {
    width: 148px;
    min-height: 168px;
    padding: 11px 8px 12px;
    gap: 8px;
    border-radius: 16px;
  }
  #pass .ptk-state {
    font-size: 10px;
    padding: 6px 8px;
  }
  #pass .ptk-relic {
    width: 86px;
    height: 100px;
    border-radius: 20px;
  }
  #pass .ptk-core {
    width: 62px;
    height: 62px;
    border-radius: 20px;
  }
  #pass .ptk-ic {
    font-size: 34px;
  }
  #pass .ptk-coins .ptk-ic .currency-mark,
  #pass .ptk-gems .ptk-ic .currency-mark {
    --currency-icon-limit: 62px;
  }
  #pass .ptk-box .ptk-core,
  #pass .ptk-hero .ptk-core {
    width: 72px;
    height: 72px;
  }
  #pass .ptk-v {
    font-size: 12px;
  }
  #pass .ptk-claim {
    max-width: 92px;
    font-size: 9px;
    padding: 5px 7px;
    min-height: 26px;
  }
  #pass .pass-lv {
    padding: 7px 8px;
  }
  #pass .pass-lv-num {
    font-size: 15px;
  }
  #pass .pass-lv-xp {
    font-size: 8px;
  }
  #pass .pass-claim-all {
    right: 10px;
    bottom: 10px;
  }
}
#pass .pass-lv {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(227, 168, 102, 0.24);
  background: linear-gradient(180deg, rgba(35, 14, 13, 0.96), rgba(12, 8, 9, 0.98));
  color: #ffe1cd;
  box-shadow: 0 10px 18px rgba(0,0,0,.2);
}
#pass .pass-lv-num {
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}
#pass .pass-lv-xp {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
  color: #efb98f;
  text-transform: uppercase;
}
#pass #passQuestsPane {
  flex: 1;
  min-height: 0;
  max-height: 100%;
  height: 100%;
  flex-direction: column;
  padding: 0 6px 18px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-color: rgba(58, 19, 18, 0.96) rgba(4, 3, 4, 0.9);
  scrollbar-width: thin;
}
#pass #passQuestsPane::-webkit-scrollbar {
  width: 12px;
}
#pass #passQuestsPane::-webkit-scrollbar-track {
  background: rgba(4, 3, 4, 0.9);
  border-radius: 999px;
}
#pass #passQuestsPane::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(40, 12, 12, 0.98), rgba(105, 28, 22, 0.96));
  border: 2px solid rgba(4, 3, 4, 0.9);
  border-radius: 999px;
}
#pass #passQuestsPane.drag-scroll-enabled-vertical {
  touch-action: pan-y;
  cursor: grab;
}
#pass #passQuestsPane.drag-scroll-enabled-vertical.is-dragging {
  cursor: grabbing;
  user-select: none;
}
#pass .pq-top {
  position: sticky;
  top: 0;
  z-index: 7;
  justify-content: flex-end;
  padding: 2px 0 10px;
  margin-bottom: 10px;
  background:
    linear-gradient(180deg, rgba(11, 7, 9, 0.98), rgba(11, 7, 9, 0.92) 72%, rgba(11, 7, 9, 0));
}
#pass #btnClaimAllQuests {
  white-space: nowrap;
}
#pass #btnAddQuest {
  border-radius: 12px;
  border: 1px solid rgba(246, 140, 102, 0.28);
  background: linear-gradient(180deg, rgba(99, 24, 19, 0.98), rgba(35, 11, 12, 0.98));
  color: #fff0e8;
  box-shadow: 0 0 16px rgba(231, 86, 62, 0.12);
}
#pass .pq-cols {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  min-height: 0;
  width: 100%;
  min-width: 0;
  padding-bottom: 8px;
}
#pass .pq-col {
  gap: 10px;
  min-width: 0;
  width: 100%;
}
#pass .pq-title {
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(233, 107, 79, 0.18);
  background: linear-gradient(180deg, rgba(34, 11, 12, 0.9), rgba(12, 8, 9, 0.96));
  color: #fff0e8;
  text-shadow: none;
  letter-spacing: .16em;
  text-transform: uppercase;
}
#pass .pq-sub {
  color: #efb38f;
  font-size: 10px;
  letter-spacing: .08em;
}
#pass .pq-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  overflow: visible;
  padding-bottom: 0;
  scroll-snap-type: none;
  overscroll-behavior: contain;
}
#pass .pq-card {
  min-width: 0;
  width: 100%;
  scroll-snap-align: none;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.04);
  background:
    linear-gradient(180deg, rgba(39, 12, 13, 0.94), rgba(12, 8, 9, 0.98)),
    radial-gradient(circle at 50% 0, rgba(231, 86, 62, 0.06), transparent 72%);
  box-shadow: 0 12px 24px rgba(0,0,0,.22);
}
#pass .pq-card.done {
  border-color: rgba(236, 121, 90, 0.28);
  box-shadow: 0 0 18px rgba(231, 86, 62, 0.08), 0 12px 24px rgba(0,0,0,.22);
}
#pass .pq-card.claimed {
  opacity: .56;
  filter: grayscale(.18);
}
#pass .pq-card.is-removing {
  animation: questCardDisappear .26s ease forwards;
  pointer-events: none;
  overflow: hidden;
}
@keyframes questCardDisappear {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-12px) scale(.96);
  }
}
#pass .pq-ic-wrap {
  grid-row: 1 / 4;
  display: grid;
  place-items: center;
}
#pass .pq-ic {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.05);
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,.14), transparent 28%),
    radial-gradient(circle at 50% 50%, rgba(255, 157, 97, 0.82), rgba(87, 29, 18, 0.96));
  box-shadow: inset 0 0 18px rgba(255,255,255,.06), 0 0 20px rgba(231, 86, 62, 0.14);
}
#pass .pq-head {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
#pass .pq-state {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(16, 8, 9, 0.88);
  border: 1px solid rgba(255,255,255,.05);
  color: #f2ddd2;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}
#pass .pq-text {
  grid-column: 2;
  color: #f3e2d9;
  font-size: 13px;
  line-height: 1.35;
  min-width: 0;
}
#pass .pq-progress {
  grid-column: 2;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(12, 8, 9, 0.98), rgba(21, 8, 9, 0.98));
}
#pass .pq-progress > div {
  background: linear-gradient(90deg, rgba(104, 24, 19, 0.98), rgba(231, 86, 62, 0.98), rgba(255, 148, 88, 0.94));
}
#pass .pq-foot {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
#pass .pq-prog-n {
  flex: 0 0 auto;
  color: #d8c6bf;
}
#pass .pq-reward {
  color: #ffd8b7;
}
#pass .pq-foot-note {
  min-width: 0;
  text-align: right;
  color: #c1aea7;
  font-size: 11px;
  font-weight: 700;
}
#pass .pq-claim {
  grid-column: 2;
  flex: 0 0 auto;
  justify-self: end;
  margin-left: auto;
  border-radius: 10px;
  border: 1px solid rgba(246, 140, 102, 0.28);
  background: linear-gradient(180deg, rgba(100, 24, 19, 0.98), rgba(35, 11, 12, 0.98));
  color: #fff0e8;
  box-shadow: 0 0 14px rgba(231, 86, 62, 0.12);
}

@media (max-width: 1320px) {
  #pass .pq-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  #pass .pq-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
#buyPassModal {
  background: rgba(5, 6, 10, 0.84);
  backdrop-filter: blur(6px);
}
#buyPassModal .bp-modal {
  width: min(760px, 100%);
  border-radius: 26px;
  border: 1px solid rgba(237, 119, 90, 0.28);
  background:
    linear-gradient(180deg, rgba(42, 12, 14, 0.98), rgba(15, 8, 10, 0.99)),
    radial-gradient(circle at 50% 0, rgba(231, 86, 62, 0.1), transparent 72%);
  box-shadow: 0 22px 48px rgba(0,0,0,.42);
}
#buyPassModal .bp-close {
  border: 1px solid rgba(246, 140, 102, 0.3);
  background: linear-gradient(180deg, rgba(100, 24, 19, 0.98), rgba(36, 11, 12, 0.98));
  box-shadow: 0 0 16px rgba(231, 86, 62, 0.12);
}
#buyPassModal .bp-hero-row {
  text-shadow: 0 0 18px rgba(231, 86, 62, 0.18);
}
#buyPassModal .bp-title {
  color: #fff0e8;
  text-shadow: none;
}
#buyPassModal .bp-option {
  border-radius: 20px;
  border: 1px solid rgba(235, 113, 85, 0.22);
  background: linear-gradient(180deg, rgba(33, 11, 12, 0.94), rgba(12, 8, 9, 0.98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
#buyPassModal .bp-or {
  color: #efb38f;
  text-shadow: none;
}
#buyPassModal .bp-opt-title {
  color: #fff0e8;
}
#buyPassModal .bp-opt-desc {
  color: #cbb8b0;
}
#buyPassModal .bp-btn {
  border-radius: 12px;
  border: 1px solid rgba(246, 140, 102, 0.28);
  background: linear-gradient(180deg, rgba(100, 24, 19, 0.98), rgba(35, 11, 12, 0.98));
  color: #fff0e8;
  box-shadow: 0 0 16px rgba(231, 86, 62, 0.12);
}

@keyframes pass-screen-spores {
  from { transform: translateY(0); }
  to { transform: translateY(18px); }
}
@keyframes pass-track-breathe {
  0%, 100% { opacity: .82; transform: translateY(-50%) scaleX(1); }
  50% { opacity: 1; transform: translateY(-50%) scaleX(1.022); }
}
@keyframes pass-card-breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes pass-relic-pulse {
  0%, 100% { transform: scale(1); box-shadow: inset 0 0 18px rgba(255,255,255,.08), 0 0 22px rgba(241, 110, 83, 0.16); }
  50% { transform: scale(1.06); box-shadow: inset 0 0 18px rgba(255,255,255,.08), 0 0 30px rgba(241, 110, 83, 0.22); }
}
@media (prefers-reduced-motion: reduce) {
  #pass::before,
  #pass .pass-track::before,
  #pass .ptk-card.avail,
  #pass .ptk-card.avail .ptk-core {
    animation: none;
  }
}
@media (max-width: 1024px) {
  #pass {
    min-height: 100dvh;
    height: 100dvh;
    min-height: 100svh;
    padding: max(2px, env(safe-area-inset-top, 0px)) 10px 8px;
    background-position: center top, center top;
    overflow: hidden;
  }
  #pass[data-pass-view="quests"] { padding-top: max(0px, env(safe-area-inset-top, 0px)); }
  #pass[data-pass-view="quests"] .pass-header {
    padding-top: 0;
    background:
      linear-gradient(180deg, rgba(11, 7, 9, 0.98), rgba(11, 7, 9, 0.94) 78%, rgba(11, 7, 9, 0));
  }
  #pass[data-pass-view="quests"] .pass-progress-bar {
    padding-top: 2px;
    background:
      linear-gradient(180deg, rgba(11, 7, 9, 0.96), rgba(11, 7, 9, 0.9) 72%, rgba(11, 7, 9, 0));
  }
  #pass[data-pass-view="quests"] .pass-pane {
    flex: 1 1 auto;
    min-height: 0;
  }
  #pass[data-pass-view="quests"] #passQuestsPane {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }
  #pass .pass-pane {
    flex: 1 1 auto;
    min-height: 0;
  }
  #pass #passRewardsPane,
  #pass #passQuestsPane {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  #pass #passRewardsPane::-webkit-scrollbar,
  #pass #passQuestsPane::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
  #pass .pass-header {
    flex: 0 0 auto;
    gap: 8px;
    padding: 0;
    margin-bottom: 4px;
  }
  #pass[data-pass-view="quests"] .pass-header {
    margin-top: 0;
    margin-bottom: 4px;
  }
  #pass[data-pass-view="quests"] .pass-header .back-btn {
    top: 50%;
    transform: translateY(-50%);
  }
  #pass .pass-season {
    padding: 8px 54px;
  }
  #pass .pass-tabs {
    align-self: start;
  }
  #pass .pass-progress-bar {
    flex: 0 0 auto;
    padding: 0 2px 6px;
    gap: 8px;
  }
  #pass[data-pass-view="rewards"] #passRewardsPane {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto auto;
    flex: 1 1 auto;
    gap: 10px;
    min-height: 0;
    height: auto;
    overflow-x: hidden;
    overflow-y: hidden;
    padding-bottom: 0;
    align-items: stretch;
  }
  #pass[data-pass-view="rewards"] .pass-buy-col {
    order: 2;
    flex: none;
    width: 100%;
    align-self: end;
    justify-content: stretch;
  }
  #pass[data-pass-view="rewards"] .pass-track {
    order: 1;
    flex: 1 1 auto;
    min-height: clamp(360px, 56dvh, 520px);
    height: auto;
    padding: 18px 10px 18px;
  }
  #pass[data-pass-view="rewards"] .pbc-card {
    min-height: 132px;
    height: auto;
    padding: 14px 16px 16px;
    border-radius: 24px;
  }
  #pass[data-pass-view="rewards"] #pbcActivate {
    min-height: 50px;
    font-size: 14px;
    margin-top: 4px;
  }
  #pass[data-pass-view="rewards"] .pass-claim-all {
    position: static;
    order: 3;
    right: auto;
    left: auto;
    bottom: auto;
    transform: none;
    margin: 0 auto;
    align-self: center;
  }
  #pass .pass-claim-all {
    min-width: min(calc(100% - 28px), 300px);
    justify-content: center;
    box-shadow: 0 16px 30px rgba(0,0,0,.34);
  }
  #pass .pq-top {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    justify-content: stretch;
  }
  #pass #btnAddQuest,
  #pass #btnClaimAllQuests {
    width: 100%;
    justify-content: center;
    margin: 0;
  }
}
@media (max-width: 720px) {
  #pass {
    height: 100dvh;
    min-height: 100svh;
    padding: max(1px, env(safe-area-inset-top, 0px)) 8px 6px;
  }
  #pass[data-pass-view="quests"] {
    padding-top: max(0px, env(safe-area-inset-top, 0px));
  }
  #pass[data-pass-view="quests"] .pass-header {
    padding-top: 0;
  }
  #pass[data-pass-view="quests"] .pass-progress-bar {
    padding-top: 1px;
  }
  #pass .pass-header {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    grid-template-rows: auto auto;
    gap: 6px;
    padding: 0;
    margin-bottom: 2px;
    align-items: start;
  }
  #pass[data-pass-view="quests"] .pass-header {
    margin-top: 0;
    margin-bottom: 2px;
  }
  #pass .pass-header .back-btn {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    justify-self: start;
    margin-left: 4px;
    margin-top: 2px;
  }
  #pass[data-pass-view="quests"] .pass-header .back-btn {
    margin-top: 2px;
  }
  #pass .pass-season { grid-column: 1 / -1; grid-row: 1; padding: 7px 46px; }
  #pass .pass-tabs { grid-column: 1 / -1; grid-row: 2; justify-self: start; margin-top: -4px; }
  #pass .ptab { padding: 7px 12px; font-size: 11px; }
  #pass .pass-progress-bar { padding: 0 0 4px; gap: 6px; }
  #pass .ppb-fill { height: 24px; }
  #pass .ppb-level { width: 36px; height: 36px; font-size: 16px; }
  #pass[data-pass-view="rewards"] #passRewardsPane {
    gap: 8px;
    min-height: 0;
    height: auto;
    padding-bottom: 0;
  }
  #pass[data-pass-view="rewards"] .pass-buy-col { flex: none; width: 100%; }
  #pass[data-pass-view="rewards"] .pbc-card {
    min-height: 132px;
    height: auto;
    padding: 14px 12px 16px;
    border-radius: 20px;
  }
  #pass .pbc-relic { width: 74px; height: 90px; }
  #pass .pbc-core { width: 54px; height: 54px; font-size: 26px; }
  #pass .pbc-label { font-size: 10px; }
  #pass .pbc-sub { font-size: 10px; }
  #pass[data-pass-view="rewards"] .pass-track {
    gap: 8px;
    flex: 1 1 auto;
    min-height: clamp(392px, 60dvh, 560px);
    height: auto;
    padding: 18px 8px 10px;
    border-radius: 22px;
  }
  #pass .pass-track::before { left: 14px; right: 14px; height: 10px; }
  #pass .pass-claim-all {
    min-width: min(calc(100% - 20px), 280px);
  }
  #pass[data-pass-view="rewards"] .pass-claim-all { margin-top: 2px; }
  #pass .pass-col { min-width: 86px; gap: 8px; }
  #pass .ptk-card { width: 82px; min-height: 136px; padding: 10px 6px 12px; border-radius: 16px; }
  #pass .ptk-state { font-size: 8px; padding: 6px 7px; letter-spacing: .12em; }
  #pass .ptk-relic { width: 64px; height: 72px; border-radius: 18px; }
  #pass .ptk-core { width: 46px; height: 46px; border-radius: 16px; }
  #pass .ptk-ic { font-size: 24px; }
  #pass .ptk-v { font-size: 9px; }
  #pass .ptk-coins .ptk-ic .currency-mark,
  #pass .ptk-gems .ptk-ic .currency-mark { --currency-icon-limit: 52px; }
  #pass .ptk-box .ptk-core,
  #pass .ptk-hero .ptk-core { width: 58px; height: 58px; }
  #pass .ptk-claim { max-width: 100%; font-size: 8px; padding: 4px 6px; min-height: 24px; }
  #pass .pass-lv { padding: 6px 7px; border-radius: 12px; }
  #pass .pass-lv-num { font-size: 14px; }
  #pass .pass-lv-xp { font-size: 8px; }
  #pass #passQuestsPane { padding: 6px 0 calc(76px + env(safe-area-inset-bottom, 0px)); }
  #pass .pq-title { font-size: 12px; padding: 8px 10px; }
  #pass .pq-card { grid-template-columns: 48px 1fr; gap: 6px 8px; padding: 8px; min-width: 0; }
  #pass .pq-ic { width: 48px; height: 48px; font-size: 24px; border-radius: 14px; }
  #pass .pq-state { font-size: 8px; padding: 6px 8px; }
  #pass .pq-text { font-size: 12px; }
  #pass .pq-foot { font-size: 11px; }
  #pass .pq-claim { min-width: 110px; }
  #buyPassModal .bp-modal { padding: 14px; border-radius: 20px; }
}

@media (max-width: 640px) {
  #pass .pq-list {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 420px) {
  #pass[data-pass-view="rewards"] .pass-buy-col { flex: none; width: 100%; }
  #pass[data-pass-view="rewards"] .pbc-card {
    min-height: 104px;
    height: auto;
    padding: 10px 10px 12px;
  }
  #pass[data-pass-view="rewards"] #passRewardsPane {
    height: auto;
    padding-bottom: 0;
  }
  #pass[data-pass-view="rewards"] .pass-track {
    flex: 1 1 auto;
    min-height: clamp(404px, 62dvh, 580px);
    height: auto;
    padding: 16px 8px 8px;
  }
  #pass .pass-claim-all { min-width: calc(100% - 16px); }
  #pass .pass-col { min-width: 74px; }
  #pass .ptk-card { width: 72px; min-height: 124px; padding: 8px 5px 10px; }
  #pass .ptk-relic { width: 58px; height: 66px; }
  #pass .ptk-core { width: 42px; height: 42px; }
  #pass .ptk-ic { font-size: 22px; }
  #pass .ptk-v { font-size: 8px; }
  #pass .ptk-coins .ptk-ic .currency-mark,
  #pass .ptk-gems .ptk-ic .currency-mark { --currency-icon-limit: 46px; }
  #pass .ptk-box .ptk-core,
  #pass .ptk-hero .ptk-core { width: 52px; height: 52px; }
  #pass .pass-lv-num { font-size: 12px; }
  #pass .pass-lv-xp { font-size: 7px; }
}

/* Upside Down Pass: keep activation copy clear of rewards/buttons on phones and tablets */
@media (max-width: 1024px) {
  #pass[data-pass-view="rewards"] #passRewardsPane {
    gap: 12px;
  }

  #pass[data-pass-view="rewards"] .pass-buy-col {
    margin-top: 10px;
  }

  #pass[data-pass-view="rewards"] .pbc-card.pbc-locked {
    min-height: 152px;
    padding: 26px 14px 16px;
    justify-content: flex-end;
    gap: 8px;
  }

  #pass[data-pass-view="rewards"] .pbc-card.pbc-locked .pbc-label {
    margin-top: auto;
  }

  #pass[data-pass-view="rewards"] .pbc-card.pbc-locked .pbc-sub {
    margin-top: 4px;
    padding: 0 6px;
    line-height: 1.38;
  }

  #pass[data-pass-view="rewards"] .pbc-card.pbc-locked #pbcActivate {
    margin-top: 8px;
  }
}

@media (max-width: 640px) {
  #pass[data-pass-view="rewards"] #passRewardsPane {
    gap: 18px;
  }

  #pass[data-pass-view="rewards"] .pbc-card.pbc-locked {
    min-height: 164px;
    padding: 34px 12px 14px;
  }

  #pass[data-pass-view="rewards"] .pass-buy-col {
    margin-top: 24px;
  }

  #pass[data-pass-view="rewards"] .pbc-card.pbc-locked .pbc-sub {
    font-size: 10px;
  }
}

@media (max-width: 420px) {
  #pass[data-pass-view="rewards"] #passRewardsPane {
    gap: 22px;
  }

  #pass[data-pass-view="rewards"] .pbc-card.pbc-locked {
    min-height: 172px;
    padding: 42px 10px 14px;
  }

  #pass[data-pass-view="rewards"] .pass-buy-col {
    margin-top: 30px;
  }

  #pass[data-pass-view="rewards"] .pbc-card.pbc-locked .pbc-label {
    font-size: 9px;
  }

  #pass[data-pass-view="rewards"] .pbc-card.pbc-locked .pbc-sub {
    font-size: 9px;
    line-height: 1.34;
  }

  #pass[data-pass-view="rewards"] .pbc-card.pbc-locked #pbcActivate {
    margin-top: 10px;
    min-height: 44px;
    font-size: 12px;
  }
}

/* ============== UI Refresh 2026-04-22 ============== */
.menu-right {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  max-width: min(100%, 520px);
}

.top-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  min-width: 0;
  max-width: 100%;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--ui-text);
  font-weight: 900;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: linear-gradient(180deg, var(--ui-panel-soft-top), var(--ui-panel-soft-bottom));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 8px 20px rgba(0,0,0,.28);
  border-radius: 16px;
  cursor: pointer;
  white-space: nowrap;
}
.top-shortcut > span:not(.ic):not(.notif-dot) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-shortcut .notif-dot {
  flex: 0 0 auto;
}

.top-shortcut:hover { transform: translateY(-1px); border-color: rgba(255, 170, 127, 0.58); }
.top-shortcut:active { transform: translateY(2px); }
.top-shortcut .ic { width: 16px; height: 16px; }
.top-shortcut--panel {
  border-color: rgba(255, 127, 76, 0.24);
  box-shadow: 0 0 0 1px rgba(255, 102, 44, 0.08), 0 0 18px rgba(255, 102, 44, 0.14), 0 8px 18px rgba(0,0,0,.28);
}
.top-shortcut--capsule { border-radius: 999px; }

.footer-row--single {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.footer-row--single .banner {
  flex: 1 1 460px;
}

@container (max-width: 1240px) {
  body:not(.tutorial-starter-compact-active) #lobby .body {
    grid-template-columns: minmax(128px, max-content) minmax(0, 1fr);
    align-items: start;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(186px, 212px));
    justify-content: center;
    justify-items: center;
    align-content: start;
    align-items: start;
    gap: clamp(14px, 2vh, 22px) clamp(14px, 2.4vw, 24px);
    padding: clamp(6px, 1.5vh, 12px) clamp(8px, 1.6vw, 18px);
    overflow: hidden;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault,
  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="smallChest"],
  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="bigChest"],
  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="largeChest"],
  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="equipChest"] {
    width: min(100%, 196px);
    min-height: 0;
    height: auto;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault {
    padding-top: 24px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="smallChest"] {
    padding-top: 44px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault .chest {
    width: min(100%, 164px);
    height: min(100%, 164px);
    border-radius: 22px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="smallChest"] .chest {
    margin-top: -18px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault .info {
    right: 3px;
    top: -5px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="smallChest"] .free-vault-top {
    width: min(100%, 170px);
    gap: 6px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="smallChest"].free-stack-full .free-vault-top {
    width: 78px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="smallChest"] .timer-overlay,
  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="smallChest"].locked .timer-overlay {
    top: 24px;
    width: min(calc(100% - 18px), 164px);
    padding: 0 10px;
    font-size: 9px;
    letter-spacing: .05em;
  }

  body:not(.tutorial-starter-compact-active) #lobby .stack-badge {
    min-width: 46px;
    padding: 4px 8px;
    font-size: 10px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .free-ad-meta,
  body:not(.tutorial-starter-compact-active) #lobby .chest-ad-timer {
    font-size: 8px;
    letter-spacing: .045em;
    line-height: 1.15;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault .label,
  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="smallChest"] .free-ad-btn,
  body:not(.tutorial-starter-compact-active) #lobby .chest-ad-btn,
  body:not(.tutorial-starter-compact-active) #lobby .chest-ad-btn.boss-ad-btn {
    width: min(100%, 188px);
    max-width: 100%;
    min-width: 0;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault .label {
    min-height: 40px;
    margin-top: 8px;
    padding: 5px 6px;
    font-size: 10px;
    line-height: 1.06;
    letter-spacing: .04em;
    column-gap: 4px;
    row-gap: 2px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault .label > span:first-child {
    overflow-wrap: anywhere;
    word-break: normal;
    text-wrap: balance;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault .label .hud-icon.coin,
  body:not(.tutorial-starter-compact-active) #lobby .vault .label .hud-icon.gem {
    width: 18px;
    height: 18px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="smallChest"] .free-ad-btn,
  body:not(.tutorial-starter-compact-active) #lobby .chest-ad-btn,
  body:not(.tutorial-starter-compact-active) #lobby .chest-ad-btn.boss-ad-btn {
    min-height: 40px;
    margin-top: 7px;
    padding: 5px 6px;
    border-radius: 12px;
    font-size: 8px;
    line-height: 1.08;
    gap: 2px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .footer-row--single {
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
    margin-top: 2px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .footer-row--single .banner {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 42px;
    padding: 8px 14px;
    font-size: clamp(11px, 1.65vw, 14px);
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.yandex-debug-ads-active:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .body {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-right: 2px;
  }

  body.yandex-debug-ads-active:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .vault-row {
    height: auto;
    min-height: max-content;
    align-content: start;
    overflow: visible;
    padding-bottom: max(14px, env(safe-area-inset-bottom, 0px));
  }
}

.lobby-version {
  margin-left: auto;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  min-width: 138px;
  padding: 10px 14px 11px;
  border-radius: 16px;
  border: 1px solid rgba(255, 142, 89, 0.34);
  background:
    linear-gradient(180deg, rgba(35, 24, 29, 0.96), rgba(11, 10, 14, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 10px 24px rgba(0,0,0,.34),
    0 0 24px rgba(255, 115, 51, .12);
  color: #ffe5d6;
  text-align: right;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.lobby-version__label {
  font-size: 11px;
  font-weight: 900;
  color: #ffb08a;
}

.lobby-version__value {
  font-size: 20px;
  font-weight: 1000;
  line-height: 1;
  color: #fff7ef;
  text-shadow: 0 0 14px rgba(255, 128, 72, .18);
}

@media (max-width: 900px) {
  .lobby-version {
    min-width: 128px;
    padding: 9px 12px 10px;
  }

  .lobby-version__value {
    font-size: 18px;
  }
}

@media (max-width: 640px) {
  .footer-row--single {
    align-items: stretch;
  }

  .lobby-version {
    min-width: 94px;
    padding: 6px 8px 7px;
    border-radius: 12px;
  }

  .lobby-version__label {
    font-size: 8px;
  }

  .lobby-version__value {
    font-size: 12px;
  }
}

.currency-mark {
  --currency-icon-size: 300px;
  --currency-icon-limit: 1.38em;
  display: inline-block;
  width: min(var(--currency-icon-size), var(--currency-icon-limit));
  height: min(var(--currency-icon-size), var(--currency-icon-limit));
  flex: 0 0 auto;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  vertical-align: middle;
  image-rendering: auto;
  filter: drop-shadow(0 0 10px rgba(255, 118, 74, 0.18));
}

.currency-mark::before,
.currency-mark::after,
.hud-icon.coin::before,
.hud-icon.coin::after,
.hud-icon.gem::before,
.hud-icon.gem::after {
  display: none;
}

.hud-icon.coin,
.hud-icon.gem,
.currency-mark--coin,
.currency-mark--crystal,
.currency-mark--power {
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.hud-icon.coin,
.currency-mark--coin {
  background-image: var(--currency-coin-image);
}

.hud-icon.gem,
.currency-mark--crystal {
  background-image: var(--currency-crystal-image);
}

.currency-mark--power {
  background-image: var(--currency-power-image);
}

.currency-inline {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  white-space: nowrap;
  vertical-align: middle;
}

.currency-inline__icon {
  --currency-icon-size: 300px;
  --currency-icon-limit: 1.38em;
}

.mini-info .currency-mark,
.muted .currency-mark,
.boss-reward .currency-mark,
.pq-reward .currency-mark,
.hd-upg-coins .currency-mark,
.hd-convert-row .currency-mark,
.hd-convert-rate .currency-mark,
.card .orig .currency-mark,
.bp-btn .currency-mark {
  --currency-icon-limit: 1.06em;
}

.reward-art--currency {
  font-size: 0;
  width: min(70vw, 300px);
  height: min(70vw, 300px);
}

.reward-art--currency .currency-mark {
  --currency-icon-limit: min(70vw, 300px);
  filter: drop-shadow(0 0 18px rgba(255, 205, 120, 0.32));
}

.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
}
.tutorial-overlay.blocks-gameplay {
  pointer-events: auto;
}
.tutorial-gameplay-target {
  position: relative;
  z-index: 60;
  pointer-events: auto;
}
.tutorial-overlay--disclaimer {
  background:
    radial-gradient(circle at 50% 10%, rgba(151, 217, 255, .16), transparent 42%),
    linear-gradient(180deg, rgba(6, 13, 34, .24), rgba(6, 13, 34, .62));
  backdrop-filter: blur(4px);
}
.tutorial-overlay--starter-compact {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding:
    max(clamp(12px, 3vh, 24px), env(safe-area-inset-top, 0px))
    max(clamp(10px, 3vw, 18px), env(safe-area-inset-right, 0px))
    calc(max(12px, env(safe-area-inset-bottom, 0px)) + 8px)
    max(clamp(10px, 3vw, 18px), env(safe-area-inset-left, 0px));
}
.tutorial-starter-bottom {
  width: min(100%, 720px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}
.tutorial-card {
  position: fixed;
  left: var(--tutorial-left, clamp(14px, 4vw, 56px));
  top: var(--tutorial-top, auto);
  bottom: var(--tutorial-bottom, clamp(14px, 4vw, 44px));
  width: min(92vw, 620px);
  max-width: calc(100vw - max(16px, env(safe-area-inset-left, 0px) + env(safe-area-inset-right, 0px)));
  display: grid;
  grid-template-columns: minmax(110px, 170px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: 24px;
  border: 2px solid rgba(255, 39, 39, .68);
  background: linear-gradient(135deg, rgba(0,0,0,.94), rgba(35, 3, 8, .96));
  box-shadow: 0 0 28px rgba(255,0,0,.28), 0 18px 42px rgba(0,0,0,.58);
  pointer-events: auto;
}
.tutorial-card:not(.tutorial-card--disclaimer) {
  max-height: min(78dvh, 620px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.tutorial-card--starter-compact {
  position: relative;
  left: auto;
  top: auto;
  bottom: auto;
  width: 100%;
  max-width: 100%;
  max-height: min(46dvh, 360px);
  transform: none !important;
}

/* ПК-версия подсказки для стартового сундука: меньше перекрывает интерфейс. */
.tutorial-card--open-starter:not(.tutorial-card--starter-compact) {
  width: min(86vw, 520px);
  grid-template-columns: minmax(88px, 132px) minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
  border-radius: 20px;
}
.tutorial-card--open-starter:not(.tutorial-card--starter-compact) .tutorial-dustin {
  height: 124px;
  border-radius: 16px;
}
.tutorial-card--open-starter:not(.tutorial-card--starter-compact) .tutorial-kicker {
  font-size: 12px;
  letter-spacing: .14em;
}
.tutorial-card--open-starter:not(.tutorial-card--starter-compact) .tutorial-text {
  font-size: 14px;
  line-height: 1.35;
  margin: 6px 0 10px;
}
.tutorial-card--open-starter:not(.tutorial-card--starter-compact) .tutorial-note {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: clamp(10px, 1.9vw, 11px);
  letter-spacing: .05em;
}
.tutorial-card--disclaimer {
  width: min(92vw, 720px);
  display: block;
  padding: 22px 24px 20px;
  max-height: min(82vh, 640px);
  overflow: auto;
  border: 3px solid rgba(132, 205, 255, .84);
  background:
    linear-gradient(180deg, rgba(51, 157, 255, .98), rgba(17, 88, 224, .99) 58%, rgba(12, 52, 169, .99));
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,.14),
    0 0 32px rgba(56, 145, 255, .24),
    0 20px 44px rgba(0,0,0,.5);
}

body.yandex-debug-ads-active .tutorial-overlay {
  inset:
    var(--yandex-debug-top-inset)
    var(--yandex-debug-right-inset)
    var(--yandex-debug-bottom-inset)
    var(--yandex-debug-left-inset);
}

body.yandex-debug-ads-active .tutorial-card {
  width: min(calc(var(--yandex-debug-safe-width) - 24px), 92vw, 620px);
  max-width: calc(var(--yandex-debug-safe-width) - max(16px, env(safe-area-inset-left, 0px) + env(safe-area-inset-right, 0px)));
}

body.yandex-debug-ads-active .tutorial-card:not(.tutorial-card--disclaimer) {
  max-height: min(calc(var(--yandex-debug-safe-height) - 24px), 620px);
}

body.yandex-debug-ads-active .tutorial-card--disclaimer {
  max-height: calc(var(--yandex-debug-safe-height) - 24px);
}
.tutorial-card--identity {
  width: min(94vw, 640px);
}
.tutorial-dustin {
  height: 170px;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid rgba(255, 215, 106, .46);
  background: radial-gradient(circle at 50% 18%, rgba(255,215,106,.16), rgba(0,0,0,.78) 68%);
}
.tutorial-dustin-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
  transform: scale(1.14);
  transform-origin: center top;
}
.tutorial-copy {
  color: #fff6e8;
  display: grid;
  gap: 8px;
}
.tutorial-copy--disclaimer {
  color: #fef8eb;
  display: block;
}
.tutorial-kicker {
  color: #ffd76a;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.tutorial-disclaimer-title {
  margin: 0 0 16px;
  text-align: center;
  color: #fff9df;
  font-size: clamp(28px, 4.4vw, 44px);
  font-weight: 1000;
  line-height: 1;
  letter-spacing: .05em;
  text-shadow:
    0 3px 0 rgba(7, 31, 104, .7),
    0 10px 20px rgba(0,0,0,.28);
}
.tutorial-text {
  margin: 8px 0 14px;
  font-size: 16px;
  font-weight: 850;
  line-height: 1.42;
  text-shadow: 0 2px 10px rgba(0,0,0,.65);
}
.tutorial-text--disclaimer {
  margin: 0;
  font-size: 15px;
  line-height: 1.54;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .32);
}
.tutorial-disclaimer-lead {
  margin-bottom: 14px;
}
.tutorial-disclaimer-alert {
  margin-bottom: 10px;
  color: #fff3a5;
  font-size: 15px;
  font-weight: 1000;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.tutorial-disclaimer-list {
  margin: 0 0 14px;
  padding-left: 22px;
  display: grid;
  gap: 8px;
}
.tutorial-disclaimer-list li::marker {
  color: #ffe25c;
}
.tutorial-disclaimer-note {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(5, 22, 88, .28);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  font-size: 14px;
}
.tutorial-disclaimer-ok {
  display: flex;
  justify-content: center;
  min-width: 170px;
  margin: 18px auto 0;
}
.tutorial-open-starter {
  min-width: min(100%, 320px);
  pointer-events: auto;
}
.tutorial-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 215, 106, .42);
  background: rgba(0, 0, 0, .52);
  color: #ffd76a;
  font-size: clamp(10px, 2.8vw, 12px);
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-wrap: balance;
  text-align: center;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.tutorial-form {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
}
.tutorial-inline-error {
  min-height: 0;
  color: #ff4545;
  font-size: clamp(14px, 1.05vw, 19px);
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: 0.01em;
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 0 16px rgba(255, 69, 69, 0.18);
  opacity: 0;
  transition: opacity .18s ease;
}
.tutorial-inline-error.is-visible {
  min-height: 2.8em;
  opacity: 1;
}
@media (min-width: 1400px) {
  .tutorial-inline-error {
    font-size: 21px;
  }
}
.tutorial-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}
.tutorial-name-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 215, 106, .28);
  background: rgba(0, 0, 0, .56);
  color: #fff7ef;
  font-size: 14px;
  font-weight: 700;
}
.tutorial-lang-row {
  display: flex;
  gap: 8px;
}
.tutorial-name-random {
  white-space: nowrap;
}
.tutorial-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}
.tutorial-actions .btn {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.15;
}
.tutorial-skip-inline {
  white-space: normal;
}
.tutorial-skip {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(0,0,0,.72);
  color: transparent;
  font-size: 0;
  padding: 0;
  cursor: pointer;
}
.tutorial-skip::before,
.tutorial-skip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 2.5px;
  border-radius: 999px;
  background: #fff;
  transform-origin: center center;
}
.tutorial-skip::before {
  transform: translate(-50%, -50%) rotate(45deg);
}
.tutorial-skip::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}
.tutorial-attention-target {
  position: relative;
  z-index: 3;
  animation: tutorialAttentionPulse 1s ease-in-out infinite;
}
.tutorial-attention-target.btn,
.tutorial-attention-target.tutorial-open-starter,
.tutorial-attention-target.tutorial-next,
.tutorial-attention-target#tutorialNameRandom {
  border-color: rgba(255, 122, 122, .96) !important;
  background: linear-gradient(180deg, #ff5858, #c81919) !important;
  color: #fff7f3 !important;
  box-shadow:
    0 0 0 1px rgba(255, 214, 214, .24),
    0 0 18px rgba(255, 44, 44, .68),
    0 10px 26px rgba(120, 0, 0, .42);
}
.tutorial-attention-target:not(button) {
  box-shadow:
    0 0 0 2px rgba(255, 126, 126, .58),
    0 0 22px rgba(255, 44, 44, .56);
}
.tutorial-attention-target::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: inherit;
  border: 2px solid rgba(255, 110, 110, .75);
  opacity: .9;
  pointer-events: none;
  animation: tutorialAttentionRing 1s ease-out infinite;
}
.tutorial-arrow {
  position: fixed;
  width: 92px;
  height: 5px;
  transform-origin: 0 50%;
  background: linear-gradient(90deg, rgba(255, 215, 106, .05), #ffd76a);
  border-radius: 999px;
  filter: drop-shadow(0 0 10px rgba(255, 39, 39, .75));
  animation: tutorialArrowBob 0.9s ease-in-out infinite alternate;
}
.tutorial-arrow::after {
  content: "";
  position: absolute;
  right: -2px;
  top: 50%;
  width: 18px;
  height: 18px;
  border-right: 5px solid #ffd76a;
  border-bottom: 5px solid #ffd76a;
  transform: translateY(-50%) rotate(-45deg);
}
@keyframes tutorialArrowBob {
  from { margin-left: 0; }
  to { margin-left: 10px; }
}
@keyframes tutorialAttentionPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}
@keyframes tutorialAttentionRing {
  0% {
    transform: scale(.96);
    opacity: .85;
  }
  100% {
    transform: scale(1.12);
    opacity: 0;
  }
}

@media (max-height: 540px) and (orientation: landscape) {
  .tutorial-card:not(.tutorial-card--disclaimer) {
    max-height: min(88dvh, 520px);
    grid-template-columns: minmax(72px, 120px) minmax(0, 1fr);
    gap: 10px;
    padding: 10px 12px;
    border-radius: 18px;
    align-items: start;
  }
  .tutorial-card--identity {
    max-height: min(92dvh, 560px);
    grid-template-columns: minmax(88px, 120px) minmax(0, 1fr);
  }
  .tutorial-dustin {
    height: min(112px, 28vh);
  }
  .tutorial-card--identity .tutorial-dustin {
    min-height: 120px;
  }
  .tutorial-text {
    font-size: 13px;
    line-height: 1.35;
    margin: 4px 0 10px;
  }
  .tutorial-kicker {
    font-size: 11px;
    letter-spacing: .12em;
  }
}

@media (max-height: 420px) {
  .tutorial-starter-bottom {
    width: min(100%, 96vw);
    max-height: 94dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .tutorial-overlay--starter-compact {
    align-items: center;
    padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
  }
  .tutorial-card--starter-compact {
    max-height: min(40dvh, 280px);
  }
}

@media (max-width: 1024px) {
  .tutorial-card--identity .tutorial-dustin {
    align-self: stretch;
    min-height: clamp(188px, 28vw, 248px);
  }

  .tutorial-card--identity .tutorial-dustin-art {
    transform: scale(1.18);
  }

  body.tutorial-starter-compact-active #lobby .footer-row {
    display: none;
  }

  body.tutorial-starter-compact-active #lobby .body {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    align-items: center;
    padding: 8px 0 min(38dvh, 340px);
  }

  body.tutorial-starter-compact-active #lobby .vault-row.starter-guided {
    width: 100%;
    min-height: 100%;
    justify-content: center;
    align-content: center;
    padding: 8px 0 0;
  }

  body.tutorial-starter-compact-active #lobby .vault-row.starter-guided .vault:not(.starter-pending) {
    display: none;
  }

  body.tutorial-starter-compact-active #lobby .vault-row.starter-guided .vault.starter-pending {
    width: clamp(214px, 34vw, 296px);
    height: auto;
    margin: 0 auto;
    transform: none;
  }

  body.tutorial-starter-compact-active #lobby .vault-row.starter-guided .vault.starter-pending:hover,
  body.tutorial-starter-compact-active #lobby .vault-row.starter-guided .vault.starter-pending:active {
    transform: none;
  }

  body.tutorial-starter-compact-active #lobby .vault-row.starter-guided .vault.starter-pending .chest {
    width: clamp(184px, 30vw, 248px);
    height: clamp(184px, 30vw, 248px);
  }

  body.tutorial-starter-compact-active #lobby .vault-row.starter-guided .vault.starter-pending .label {
    width: min(100%, 260px);
    font-size: clamp(16px, 2.2vw, 20px);
  }

  body.tutorial-starter-compact-active #lobby .vault-row.starter-guided .starter-callout {
    display: none;
  }

  body.starter-skip-focus-active #lobby .body {
    padding: 8px 0 14px;
    overflow: visible;
  }

  body.starter-skip-focus-active #lobby .top {
    grid-template-columns: 98px minmax(74px, max-content) minmax(0, 1fr);
    grid-template-areas: "player heroes currencies";
    gap: 8px 6px;
  }

  body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided {
    width: 100%;
    min-height: fit-content;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "starter starter"
      "small large"
      ". equip";
    gap: clamp(10px, 2vh, 16px) clamp(8px, 2vw, 14px);
    padding: 8px 6px 18px;
    overflow: visible;
  }

  body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-pending {
    width: clamp(214px, 34vw, 296px);
    min-height: clamp(296px, 44vw, 356px);
    padding-top: 18px;
    padding-bottom: 16px;
  }

  body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-pending .starter-callout {
    width: min(100%, 252px);
    margin-bottom: 12px;
    font-size: clamp(18px, 3vw, 24px);
    letter-spacing: .12em;
  }

  body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-locked {
    width: min(100%, 154px);
    padding-bottom: 10px;
  }

  body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-locked .chest {
    width: min(100%, 126px);
    height: min(100%, 126px);
    border-radius: 20px;
  }

  body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-pending .label {
    width: min(100%, 252px);
    min-height: 48px;
    font-size: clamp(15px, 2.4vw, 18px);
  }

  body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-locked .label {
    width: min(100%, 150px);
    min-height: 38px;
    padding: 5px 6px;
    font-size: 9px;
    line-height: 1.02;
    letter-spacing: .03em;
  }

  body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-locked .label .hud-icon.coin,
  body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-locked .label .hud-icon.gem {
    width: 16px;
    height: 16px;
  }

  .tutorial-overlay--starter-compact .tutorial-arrow {
    display: none;
  }
}
@media (max-width: 620px) {
  .tutorial-card {
    right: auto;
    width: min(calc(100vw - 12px), 560px);
    max-width: calc(100vw - 12px);
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    border-radius: 18px;
  }
  .tutorial-card--disclaimer {
    width: min(calc(100vw - 8px), 720px);
    max-width: calc(100vw - 8px);
    max-height: min(90dvh, 760px);
    padding: 18px 14px 16px;
    border-radius: 20px;
  }
  .tutorial-card--identity {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
    padding: 14px 12px;
  }
  .tutorial-dustin {
    height: 118px;
    border-radius: 16px;
  }
  .tutorial-card--identity .tutorial-dustin {
    height: auto;
    min-height: 176px;
  }
  .tutorial-card--identity .tutorial-dustin-art {
    transform: scale(1.2);
  }
  .tutorial-card--identity .tutorial-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
  }
  .tutorial-text {
    font-size: 13px;
    line-height: 1.35;
    margin-bottom: 10px;
  }
  .tutorial-card--identity .tutorial-text {
    margin-bottom: 8px;
  }
  .tutorial-text--disclaimer {
    font-size: 13px;
    line-height: 1.45;
  }
  .tutorial-card--identity .tutorial-form {
    gap: 8px;
    margin: 0 0 10px;
  }
  .tutorial-card--identity .tutorial-name-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .tutorial-card--identity .tutorial-name-input {
    min-width: 0;
  }
  .tutorial-card--identity .tutorial-name-random,
  .tutorial-card--identity .tutorial-next,
  .tutorial-card--identity .tutorial-skip-inline {
    width: 100%;
  }
  .tutorial-actions {
    grid-template-columns: 1fr;
  }
  .tutorial-card--identity .tutorial-lang-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .tutorial-inline-error {
    font-size: 12px;
  }
  .tutorial-disclaimer-title {
    margin-bottom: 14px;
    font-size: clamp(24px, 8vw, 34px);
  }
  .tutorial-disclaimer-alert {
    font-size: 13px;
  }
  .tutorial-disclaimer-note {
    font-size: 12px;
  }
  .tutorial-name-row {
    grid-template-columns: 1fr;
  }
  .tutorial-arrow {
    width: 56px;
    height: 4px;
  }

  .tutorial-overlay--starter-compact {
    padding-left: 8px;
    padding-right: 8px;
    padding-bottom: calc(max(10px, env(safe-area-inset-bottom, 0px)) + 4px);
  }

  .tutorial-starter-bottom {
    gap: 10px;
  }

  .tutorial-open-starter {
    width: 100%;
  }

  body.tutorial-starter-compact-active #lobby .body {
    padding-bottom: min(44dvh, 360px);
  }

  body.tutorial-starter-compact-active #lobby .vault-row.starter-guided .vault.starter-pending {
    width: min(100%, 234px);
  }
}
@media (max-width: 420px) {
  .tutorial-card {
    width: calc(100vw - 8px);
    max-width: calc(100vw - 8px);
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 8px;
    padding: 12px 10px;
    border-radius: 16px;
  }
  .tutorial-card--disclaimer {
    width: calc(100vw - 4px);
    max-width: calc(100vw - 4px);
    padding: 16px 12px 14px;
  }
  .tutorial-card--identity .tutorial-dustin {
    min-height: 164px;
  }
}

.reward-art--equipment {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(70vw, 300px);
  height: min(70vw, 300px);
  border: 3px solid var(--rar, #ffd84a);
  border-radius: 28px;
  background: radial-gradient(circle at 50% 35%, rgba(255,255,255,.1), rgba(0,0,0,.7) 62%, #000 100%);
  box-shadow: inset 0 0 22px rgba(255,255,255,.08), 0 0 28px color-mix(in srgb, var(--rar, #ffd84a) 48%, transparent);
  overflow: hidden;
}

.reward-art--equipment img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  padding: 16px;
}

.sum-card .ic .currency-mark {
  --currency-icon-limit: min(22vw, 96px);
}

.portrait .currency-mark {
  --currency-icon-limit: 54px;
  filter: drop-shadow(0 0 12px rgba(255, 145, 87, 0.24));
}

.shop-card .portrait .currency-mark {
  --currency-icon-limit: min(90%, 300px);
}

#shop {
  --shop-bg-current: var(--shop-bg-desktop);
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(4, 6, 10, 0.84), rgba(6, 5, 8, 0.68) 42%, rgba(4, 4, 7, 0.9)),
    var(--shop-bg-current);
  background-position: center center, center center;
  background-size: cover, cover;
  background-repeat: no-repeat, no-repeat;
}

#shop::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 45, 45, 0.14), transparent 34%),
    linear-gradient(90deg, rgba(0,0,0,.56), transparent 26%, transparent 74%, rgba(0,0,0,.62));
}

#shop > * {
  position: relative;
  z-index: 1;
}

@media (max-width: 1400px) {
  #shopGrid {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    max-width: 1040px;
  }
}

@media (max-width: 1100px) {
  #shopGrid {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
    max-width: 820px;
  }
}

@media (max-width: 820px) {
  #shopGrid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    max-width: 560px;
  }
}

.settings-language {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid rgba(255, 39, 39, 0.24);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.42);
}

.settings-language__title {
  margin-right: auto;
  font-weight: 900;
  color: #fff1e8;
}

.settings-audio {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(255, 39, 39, 0.24);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.42);
}

.settings-audio__title {
  font-weight: 900;
  color: #fff1e8;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.settings-audio__item {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(29, 14, 18, 0.74), rgba(9, 10, 14, 0.82));
  border: 1px solid rgba(255, 133, 84, 0.14);
  transition: opacity .18s ease, border-color .18s ease;
}

.settings-audio__item.is-muted {
  opacity: .76;
  border-color: rgba(255,255,255,.08);
}

.settings-audio__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.settings-audio__label {
  font-weight: 900;
  color: #fff4ec;
}

.settings-audio__toggle {
  min-width: 84px;
  padding-inline: 16px;
}

.settings-audio__track {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 46px;
  align-items: center;
  gap: 8px;
}

.settings-audio__edge,
.settings-audio__value {
  font-size: 12px;
  font-weight: 900;
  color: #ffdcca;
}

.settings-audio__value {
  text-align: right;
}

.settings-audio__range {
  width: 100%;
  margin: 0;
  accent-color: #ff6e43;
  cursor: pointer;
}

.settings-audio__hint {
  font-size: 12px;
  line-height: 1.35;
  color: rgba(255, 234, 223, 0.82);
}

.settings-actions {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
}

.settings-actions__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.settings-actions__row .btn {
  width: 100%;
}

.settings-actions__footer {
  display: flex;
  justify-content: center;
}

.settings-actions__footer .btn {
  min-width: min(100%, 260px);
}

@media (max-width: 1024px) {
  .modal.settings {
    max-width: min(100vw - 20px, 640px);
  }
}

@media (max-width: 640px) {
  .modal-bg {
    padding: 12px;
    align-items: stretch;
  }

  .modal.mini-result-modal {
    width: min(100%, 340px);
    max-width: min(calc(100vw - 24px), 340px);
    min-height: 0;
    height: auto;
    margin: auto;
    padding: 14px 12px max(12px, env(safe-area-inset-bottom, 0px));
    border-radius: 22px;
  }

  .modal.mini-result-modal h2 {
    margin: -14px -12px 10px;
    padding: 11px 12px;
    font-size: 18px;
  }

  .modal.mini-result-modal > div {
    gap: 10px;
  }

  .modal.mini-result-modal p {
    margin: 0;
  }

  .modal.time-played-modal {
    width: min(100%, 340px);
    max-width: min(calc(100vw - 24px), 340px);
    min-height: 0;
    height: auto;
    margin: auto;
    padding: 14px 12px max(12px, env(safe-area-inset-bottom, 0px));
    border-radius: 22px;
  }

  .modal.time-played-modal h2 {
    margin: -14px -12px 10px;
    padding: 11px 12px;
    font-size: 18px;
  }

  .modal.time-played-modal > div {
    gap: 10px;
  }

  .modal.time-played-modal p {
    margin: 0;
  }

  .modal.boss-victory-modal {
    width: 100%;
    max-width: none;
    height: auto;
    max-height: calc(100dvh - 24px);
    margin: auto 0;
    padding: 14px 12px max(12px, env(safe-area-inset-bottom, 0px));
    border-radius: 22px;
    align-self: center;
  }

  .modal.boss-victory-modal h2 {
    margin: -14px -12px 10px;
    padding: 11px 12px;
    font-size: 18px;
  }

  .modal.boss-victory-modal > div {
    gap: 7px;
    max-height: calc(100dvh - 206px);
    padding-right: 2px;
    font-size: 13px;
  }

  .modal.boss-detail-modal {
    width: 100%;
    max-width: none;
    margin: auto 0;
    padding: 14px 12px max(12px, env(safe-area-inset-bottom, 0px));
    border-radius: 22px;
  }

  .modal.boss-detail-modal h2 {
    line-height: 1.2;
  }

  .modal.boss-detail-modal > div {
    max-height: calc(100dvh - 256px);
    padding-right: 2px;
  }

  .boss-rewarded-offer-modal {
    width: 100%;
    max-width: none;
    margin: auto 0;
    border-radius: 22px;
  }

  .boss-rewarded-offer__chest {
    width: min(72vw, 260px);
  }

  .modal.settings {
    width: 100%;
    max-width: none;
    height: calc(100dvh - 24px);
    min-height: 0;
    max-height: calc(100dvh - 24px);
    margin: 0;
    border-radius: 22px;
    padding: 14px 12px max(12px, env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .modal.settings h2 {
    position: sticky;
    top: 0;
    z-index: 1;
    margin: -14px -12px 10px;
    padding: max(14px, env(safe-area-inset-top, 0px)) 12px 12px;
    border-radius: 22px 22px 0 0;
    line-height: 1.2;
  }

  .modal.settings > div {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 2px;
  }

  .modal.settings .btn {
    width: 100%;
    min-height: 46px;
  }

  .modal.settings .settings-actions__footer .btn {
    width: auto;
  }

  .modal.settings .settings-audio__toggle {
    width: auto;
    min-height: 42px;
  }

  .modal.settings .settings-language {
    flex-wrap: wrap;
    align-items: stretch;
  }

  .modal.settings .settings-audio__track {
    grid-template-columns: 16px minmax(0, 1fr) 42px;
  }

  .modal.settings .settings-language__title {
    width: 100%;
    margin-right: 0;
    text-align: left;
  }

  .modal.settings .settings-audio__head {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .modal.settings .settings-audio__label {
    width: 100%;
  }

  .modal.settings .modal-back-btn {
    width: 40px;
    height: 40px;
    align-self: center;
  }
}

@media (max-width: 1024px) {
  .modal.settings h2 {
    text-align: center;
  }

  .settings-modal__title {
    justify-self: center;
  }
}

@media (max-width: 768px) and (orientation: portrait) {
  #shop {
    --shop-bg-current: var(--shop-bg-mobile);
    background-position: center top, center top;
  }
}

@media (max-width: 1024px), (pointer: coarse) and (max-width: 1366px) {
  .screen-header {
    position: relative;
    align-items: start;
    padding-top: calc(max(8px, env(safe-area-inset-top, 0px)) + 4px);
    padding-left: 54px;
    min-height: calc(44px + max(8px, env(safe-area-inset-top, 0px)));
  }

  .screen-header .back-btn {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    left: 10px;
    z-index: 100;
  }

  #shop {
    min-height: 100dvh;
    height: 100dvh;
    min-height: 100svh;
    padding: max(4px, env(safe-area-inset-top, 0px)) 10px 10px;
    overflow: hidden;
  }

  #shop .screen-header {
    margin-bottom: 4px;
    padding-top: calc(max(8px, env(safe-area-inset-top, 0px)) + 4px);
  }

  #shopGrid {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    align-content: start;
    gap: 12px;
    max-width: none;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding: 8px 6px 22px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  #shopGrid::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  #shopGrid.drag-scroll-enabled,
  #shopGrid.drag-scroll-enabled.is-dragging {
    touch-action: pan-y;
    cursor: default;
    user-select: auto;
  }
}

.pf-tile-icon .currency-mark {
  --currency-icon-limit: 30px;
}

.tr-core-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tr-core-glyph .currency-mark {
  --currency-icon-limit: 42px;
}

.tr-node.next .tr-core-glyph .currency-mark {
  --currency-icon-limit: 52px;
}

.tr-card--coins .tr-core-glyph .currency-mark,
.tr-card--gems .tr-core-glyph .currency-mark {
  --currency-icon-limit: 80px;
}

.ptk-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ptk-ic .currency-mark {
  --currency-icon-limit: 34px;
}

#pass .ptk-relic,
#pass .ptk-core,
#pass .ptk-ic,
#pass .ptk-v,
#pass .ptk-box-art,
#pass .ptk-hero-art,
#pass .pq-ic,
#pass .pq-reward,
#pass .pq-reward .currency-inline,
#pass .pq-reward .currency-inline__icon,
#pass .pq-reward .currency-inline__value,
#pass .pq-reward .currency-mark {
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

#pass .ptk-box-art,
#pass .ptk-hero-art {
  pointer-events: none;
}

.reward-amount--pp .currency-mark {
  --currency-icon-limit: .95em;
}

.pf-subtabs {
  flex-wrap: wrap;
}

.pf-subtab {
  min-width: 132px;
}

@media (max-width: 1024px) {
  #shopGrid .shop-card {
    width: 100%;
    min-width: 0;
    max-width: none;
    flex: none;
    padding-bottom: 16px;
    height: 100%;
    grid-template-rows: 172px 44px 46px auto auto;
  }

  .shop-card .portrait {
    min-height: 172px;
    align-items: center;
    padding: 12px 10px 0;
  }

  .shop-card-visual {
    width: min(100%, 156px);
    height: 156px;
  }

  .shop-card-visual--art {
    width: min(100%, 164px);
    height: 164px;
  }

  .shop-card-visual--currency,
  .shop-card-visual--emoji {
    width: min(100%, 148px);
    height: 148px;
  }

  .shop-card-visual--currency {
    width: min(100%, 162px);
    height: 162px;
    transform: translateY(18px);
  }

  .shop-card-visual--currency .currency-mark {
    --currency-icon-limit: min(100%, 160px);
  }

  .shop-card-visual--emoji {
    font-size: clamp(66px, 7.2vw, 94px);
  }

  .shop-card .nm {
    min-height: 44px;
    padding: 10px 8px 0;
  }

  .shop-card-gives {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    padding: 4px 8px 2px;
    background: rgba(0, 0, 0, 0.92);
    color: #ffe9b5;
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 0 10px rgba(255, 200, 120, 0.28);
  }

  .shop-card-gives.is-empty {
    color: transparent;
  }

  .shop-card-gives .currency-inline {
    gap: 6px;
    font-size: 16px;
  }

  .shop-card-gives .currency-mark {
    --currency-icon-limit: 28px;
  }

  .shop-card-gives-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .shop-card-gives-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
  }

  .shop-card-gives-value {
    color: #ffe9b5;
  }

  #shopGrid .shop-card {
    grid-template-rows: 172px 44px 16px 32px 46px 16px auto auto;
  }

  .shop-card-gives-label,
  .shop-card-price-label {
    background: rgba(0, 0, 0, 0.92);
    color: rgba(255, 226, 197, 0.78);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    text-align: center;
    line-height: 1;
    padding: 4px 8px 0;
  }

  .shop-card-price-label {
    padding-top: 6px;
  }

  .shop-card-gives-label.is-empty,
  .shop-card-price-label.is-empty {
    background: transparent;
    color: transparent;
    pointer-events: none;
  }

  .shop-card-desc {
    min-height: 46px;
    padding: 10px 8px 0;
  }

  .shop-card .meta {
    min-height: 44px;
  }

  .shop-card:not([data-shop-item="s_ad_gems"]) .meta > span:last-child {
    gap: 5px;
  }

  .shop-card:not([data-shop-item="s_ad_gems"]) .meta .currency-inline {
    gap: 5px;
    font-size: 16px;
  }

  .shop-card:not([data-shop-item="s_ad_gems"]) .meta .currency-mark {
    --currency-icon-limit: 28px;
  }

  .shop-card:not([data-shop-item="s_ad_gems"]) .meta .orig .currency-mark {
    --currency-icon-limit: 34px;
  }

  .shop-card > .btn {
    min-height: 52px;
    width: calc(100% - 16px);
    margin: 12px auto 4px;
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 14px;
  }

  .pf-subtabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    max-width: 100%;
  }

  .pf-subtab {
    min-width: 0;
    width: 100%;
    padding: 9px 6px;
    font-size: 11px;
    line-height: 1.15;
    letter-spacing: .04em;
    white-space: normal;
    text-align: center;
  }
}

@media (max-width: 520px) {
  .pf-subtabs {
    gap: 6px;
  }

  .pf-subtab {
    padding: 8px 4px;
    font-size: 10px;
    letter-spacing: .02em;
  }
}

@media (max-width: 900px) {
  .top {
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
  }

  .currencies {
    justify-content: flex-start;
  }

  .menu-right {
    justify-content: flex-start;
    max-width: 100%;
  }
}

@media (min-width: 1025px) {
  #lobby .top {
    grid-template-columns: minmax(196px, max-content) minmax(220px, max-content) minmax(0, 1fr);
    align-items: center;
    column-gap: 14px;
  }

  #lobby .currencies {
    flex-wrap: nowrap;
    justify-content: center;
    gap: 12px;
  }

  #lobby .menu-right {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    max-width: none;
    overflow: visible;
  }

  #lobby .top-shortcut {
    min-height: 54px;
    padding: 0 14px;
    font-size: 11px;
    flex: 0 0 auto;
  }

  #lobby .player-pill {
    min-width: 196px;
    min-height: 84px;
    padding: 10px 18px 10px 100px;
    border-radius: 22px;
  }

  #lobby .player-pill .avatar {
    left: -14px;
    top: -12px;
    width: 88px;
    height: 88px;
    border-radius: 18px;
  }

  #lobby .player-pill .avatar-ring {
    inset: 6px;
    border-radius: 14px;
  }

  #lobby .player-pill .avatar-glyph {
    font-size: 42px;
  }

  #lobby .player-pill .avatar-art {
    width: calc(100% - 4px);
    height: calc(100% - 4px);
    object-position: center 14%;
    transform: scale(1.28);
    transform-origin: center 16%;
  }

  #lobby .player-pill .nm {
    font-size: 14px;
  }

  #lobby .player-pill .lv {
    font-size: 20px;
  }
}

@media (min-width: 1025px) and (max-width: 1320px) {
  #lobby .top {
    grid-template-columns: minmax(196px, max-content) minmax(0, 1fr);
    grid-template-areas:
      "player currencies"
      "player menu";
    align-items: start;
    row-gap: 10px;
  }

  #lobby .player-pill {
    grid-area: player;
  }

  #lobby .currencies {
    grid-area: currencies;
    justify-self: end;
    justify-content: flex-end;
    flex-wrap: nowrap;
    min-width: 0;
  }

  #lobby .menu-right {
    grid-area: menu;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    max-width: none;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-content: flex-start;
  }

  #lobby .top-shortcut {
    min-height: 50px;
    padding: 0 12px;
    font-size: 10px;
    flex: 0 1 auto;
  }
}

@container (max-width: 1180px) {
  #lobby .top {
    grid-template-columns: minmax(196px, max-content) minmax(0, 1fr);
    grid-template-areas:
      "player currencies"
      "player menu";
    align-items: start;
    row-gap: 10px;
  }

  #lobby .player-pill {
    grid-area: player;
  }

  #lobby .currencies {
    grid-area: currencies;
    justify-self: end;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
  }

  #lobby .currency-pill {
    flex: 1 1 136px;
    min-width: min(136px, 100%);
  }

  #lobby .menu-right {
    grid-area: menu;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    max-width: none;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-content: flex-start;
  }

  #lobby .top-shortcut {
    min-height: 50px;
    padding: 0 12px;
    font-size: 10px;
    flex: 0 1 auto;
  }
}

@container (max-width: 980px) {
  #lobby .currencies {
    gap: 8px;
  }

  #lobby .currency-pill {
    flex-basis: 124px;
    padding: 0 12px;
    gap: 8px;
  }

  #lobby .currency-pill .hud-icon.coin,
  #lobby .currency-pill .hud-icon.gem {
    width: 42px;
    height: 42px;
  }

  #lobby .top-shortcut {
    flex: 1 1 180px;
  }
}

@media (max-width: 640px), (pointer: coarse) and (max-width: 820px) {
  #shop {
    padding: max(2px, env(safe-area-inset-top, 0px)) 6px 8px;
  }

  #shop .screen-header {
    gap: 8px;
    margin-bottom: 2px;
  }

  #shopGrid {
    gap: 10px;
    padding: 6px 4px 18px;
  }

  #shopGrid .shop-card {
    width: 100%;
    max-width: none;
    flex: none;
    padding-bottom: 12px;
    height: 100%;
    grid-template-rows: 156px 40px 14px 30px 44px 14px auto auto;
  }

  .shop-card-gives-label,
  .shop-card-price-label {
    font-size: 9px;
    padding: 3px 6px 0;
  }

  .shop-card-price-label {
    padding-top: 5px;
  }

  .shop-card-gives {
    min-height: 30px;
    font-size: 15px;
    padding: 4px 6px 2px;
  }

  .shop-card-gives .currency-inline {
    gap: 5px;
    font-size: 15px;
  }

  .shop-card-gives .currency-mark {
    --currency-icon-limit: 24px;
  }

  .shop-card-gives-icon {
    width: 22px;
    height: 22px;
  }

  .shop-card .portrait {
    min-height: 156px;
    padding: 10px 8px 0;
  }

  .shop-card-visual {
    width: min(100%, 132px);
    height: 132px;
  }

  .shop-card-visual--art {
    width: min(100%, 140px);
    height: 140px;
  }

  .shop-card-visual--currency,
  .shop-card-visual--emoji {
    width: min(100%, 126px);
    height: 126px;
  }

  .shop-card-visual--currency {
    width: min(100%, 140px);
    height: 140px;
    transform: translateY(14px);
  }

  .shop-card-visual--currency .currency-mark {
    --currency-icon-limit: min(100%, 138px);
  }

  .shop-card-visual--emoji {
    font-size: 72px;
  }

  .shop-card .nm {
    font-size: 12px;
    min-height: 40px;
    padding: 8px 8px 0;
  }

  .shop-card-desc {
    min-height: 44px;
    font-size: 11px;
    padding: 8px 8px 0;
  }

  .shop-card .meta {
    min-height: 42px;
  }

  .shop-card:not([data-shop-item="s_ad_gems"]) .meta > span:last-child {
    gap: 4px;
  }

  .shop-card:not([data-shop-item="s_ad_gems"]) .meta .currency-inline {
    gap: 4px;
    font-size: 14px;
  }

  .shop-card:not([data-shop-item="s_ad_gems"]) .meta .currency-mark {
    --currency-icon-limit: 24px;
  }

  .shop-card:not([data-shop-item="s_ad_gems"]) .meta .orig .currency-mark {
    --currency-icon-limit: 30px;
  }

  .shop-card > .btn {
    min-height: 48px;
    width: calc(100% - 12px);
    margin: 10px auto 2px;
    padding: 9px 12px;
    font-size: 13px;
  }

  .shop-card .meta .currency-mark {
    --currency-icon-limit: 34px;
  }

  .shop-card .meta .orig .currency-mark {
    --currency-icon-limit: 42px;
  }

  .boss-detail,
  .leader-profile-equipment-card {
    grid-template-columns: 1fr;
  }

  .leader-profile-equipment-stats .eq-chip {
    font-size: 11px;
    padding: 5px 7px;
  }

  .boss-detail-portrait {
    width: min(72vw, 260px);
    margin: 0 auto;
  }

  .boss-detail-copy {
    text-align: left;
  }
  .boss-hero-picker-card {
    flex-basis: min(220px, 78vw);
  }

  .top-shortcut {
    min-height: 40px;
    padding: 0 10px;
    font-size: 9px;
    gap: 6px;
  }

  .top-shortcut .ic {
    width: 14px;
    height: 14px;
  }

  .menu-right {
    gap: 6px;
  }

  .reward-art--currency .currency-mark {
    --currency-icon-limit: min(70vw, 300px);
  }

  .ptk-ic .currency-mark {
    --currency-icon-limit: 26px;
  }

  .tr-core-glyph .currency-mark {
    --currency-icon-limit: 34px;
  }

  .tr-node.next .tr-core-glyph .currency-mark {
    --currency-icon-limit: 42px;
  }

  .mini-stage {
    width: min(100%, 100%);
    padding: 20px 14px 22px;
    border-radius: 22px;
  }

  .mini-emoji {
    width: 88px;
    height: 88px;
    border-radius: 22px;
    font-size: 52px;
  }

  .mini-info {
    min-width: min(100%, 360px);
    font-size: 15px;
  }

  .wheel-wrap {
    width: 256px;
    height: 256px;
  }

  .mem-info,
  .signal-readout,
  .wall-readout {
    font-size: 12px;
  }
}

body.mobile-main-menu-open {
  overflow: hidden;
}

@keyframes mobile-main-menu-pop {
  from {
    opacity: 0;
    transform: translate3d(0, -10px, 0) scale(.96);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@media (max-width: 1024px), (pointer: coarse) and (max-width: 1366px) {
  #lobby {
    min-height: 100dvh;
    height: 100dvh;
    min-height: 100svh;
    padding-bottom: calc(max(10px, env(safe-area-inset-bottom, 0px)) + 10px);
  }

  #lobby .top {
    grid-template-columns: 98px minmax(74px, max-content) minmax(0, 1fr) 48px;
    grid-template-areas: "player heroes currencies toggle";
    align-items: start;
    gap: 8px 6px;
  }

  #lobby .player-pill {
    grid-area: player;
    justify-self: start;
    align-self: start;
    width: 98px;
    min-width: 98px;
    height: 98px;
    min-height: 98px;
    margin-top: 0;
    padding: 0;
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #lobby .player-pill > :not(.avatar) {
    display: none;
  }

  #lobby .lobby-heroes-pill {
    grid-area: heroes;
    display: inline-flex;
    justify-self: start;
    align-self: start;
    min-width: 74px;
    min-height: 40px;
    padding: 6px 10px;
    gap: 4px;
    border-radius: 14px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(180deg, rgba(34, 25, 29, 0.98), rgba(11, 11, 16, 0.98));
    border-color: rgba(255, 136, 84, 0.30);
  }

  #lobby .lobby-heroes-pill__label {
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: rgba(255, 198, 166, 0.82);
    line-height: 1;
  }

  #lobby .lobby-heroes-pill__value {
    font-size: 16px;
    font-weight: 1000;
    letter-spacing: .04em;
    color: #fff7ef;
    line-height: 1;
  }

  #lobby .currencies {
    grid-area: currencies;
    justify-self: end;
    align-self: start;
    display: grid;
    grid-template-columns: repeat(2, minmax(92px, max-content));
    justify-content: end;
    align-items: center;
    width: auto;
    max-width: min(100%, 248px);
    min-width: 0;
    margin: 0;
    gap: 8px;
  }

  #lobby .currency-pill {
    width: auto;
    min-width: 92px;
    max-width: min(100%, 120px);
    min-height: 52px;
    margin-left: 0;
    padding: 8px 10px;
    gap: 8px;
    border-radius: 16px;
  }
  #lobby .currency-pill .val {
    font-size: 15px;
    letter-spacing: .04em;
    min-width: 0;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
  }
  #lobby .currency-pill .hud-icon.coin,
  #lobby .currency-pill .hud-icon.gem {
    width: 32px;
    height: 32px;
  }

  #lobby .player-pill .avatar {
    position: relative;
    width: 100%;
    height: 100%;
    left: auto;
    top: auto;
    border-radius: inherit;
  }

  #lobby .player-pill .avatar-ring {
    inset: 6px;
    border-radius: 18px;
  }

  #lobby .player-pill .avatar-glyph {
    font-size: 40px;
  }

  #lobby .player-pill .avatar-art {
    width: calc(100% - 8px);
    height: calc(100% - 8px);
    object-fit: contain;
    object-position: center top;
    transform: scale(1.06);
    transform-origin: center top;
  }

  #lobby .menu-right,
  #lobby .side-menu {
    display: none;
  }

  #lobby .body {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    min-height: 0;
  }

  .footer-row--single {
    margin-top: 6px;
    padding-bottom: max(2px, env(safe-area-inset-bottom, 0px));
  }

  .mobile-main-menu-toggle {
    display: inline-flex;
    grid-area: toggle;
    justify-self: end;
    align-self: start;
    width: 52px;
    height: 52px;
    padding: 0;
    gap: 0;
    font-size: 0;
    margin-top: 0;
    border-radius: 18px;
  }

  .mobile-main-menu-toggle .ui-glyph.menu {
    width: 22px;
    height: 22px;
  }

  .mobile-main-menu-toggle .ui-glyph.menu::before {
    inset: 0;
    border-radius: 8px;
  }

  .mobile-main-menu-toggle .ui-glyph.menu::after {
    left: 3px;
    right: 3px;
    top: 4px;
    height: 2.5px;
    box-shadow:
      0 6px 0 rgba(255, 232, 216, 0.96),
      0 12px 0 rgba(255, 232, 216, 0.96);
  }

  .mobile-main-menu {
    position: fixed;
    inset:
      var(--yandex-debug-top-inset)
      var(--yandex-debug-right-inset)
      var(--yandex-debug-bottom-inset)
      var(--yandex-debug-left-inset);
    z-index: 120;
    padding: clamp(12px, 2vw, 18px);
    pointer-events: none;
  }

  .mobile-main-menu[hidden] {
    display: none;
  }

  .mobile-main-menu:not([hidden]) {
    display: grid;
    place-items: start center;
    pointer-events: auto;
  }

  .mobile-main-menu__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    background:
      radial-gradient(circle at 50% 12%, rgba(255, 120, 80, 0.10), transparent 30%),
      linear-gradient(180deg, rgba(5, 7, 13, 0.54), rgba(3, 4, 8, 0.86));
    backdrop-filter: blur(14px);
    cursor: pointer;
  }

  .mobile-main-menu__panel {
    position: relative;
    z-index: 1;
    width: min(100%, 468px);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border-radius: 28px;
    border: 1px solid rgba(255, 150, 98, 0.36);
    background:
      radial-gradient(circle at 50% 0%, rgba(255, 136, 84, 0.08), transparent 34%),
      linear-gradient(180deg, rgba(31, 21, 27, 0.98), rgba(10, 10, 14, 0.99));
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.06),
      inset 0 0 0 1px rgba(255, 161, 111, 0.06),
      0 28px 56px rgba(0,0,0,.52),
      0 0 32px rgba(255, 115, 51, 0.16);
    animation: mobile-main-menu-pop .18s ease-out;
    transform-origin: top center;
    overflow: hidden;
  }

  .mobile-main-menu__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-main-menu__copy {
    min-width: 0;
    display: grid;
    gap: 4px;
  }

  .mobile-main-menu__eyebrow {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: #ffb08a;
  }

  .mobile-main-menu__title {
    font-size: 24px;
    font-weight: 1000;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #fff7ef;
  }

  .mobile-main-menu__close {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 16px;
  }

  .mobile-main-menu__close-glyph {
    position: relative;
    display: block;
    width: 20px;
    height: 20px;
    font-size: 0;
    line-height: 0;
  }

  .mobile-main-menu__close-glyph::before,
  .mobile-main-menu__close-glyph::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 2.5px;
    border-radius: 999px;
    background: rgba(255, 240, 230, 0.96);
    transform-origin: center center;
  }

  .mobile-main-menu__close-glyph::before {
    transform: translate(-50%, -50%) rotate(45deg);
  }

  .mobile-main-menu__close-glyph::after {
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  .mobile-main-menu__list {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    gap: 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding-right: 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .mobile-main-menu__list::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .mobile-main-menu__item {
    width: 100%;
    min-width: 0;
    min-height: 58px;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    justify-content: stretch;
    align-items: center;
    column-gap: 14px;
    row-gap: 4px;
    padding: 12px 16px;
    white-space: normal;
    text-align: left;
    text-transform: none;
    letter-spacing: .025em;
    line-height: 1.18;
    border-radius: 16px;
  }

  .mobile-main-menu__item .ic {
    width: 18px;
    height: 18px;
    justify-self: center;
  }

  .mobile-main-menu__item .hud-icon {
    width: 18px;
    height: 18px;
    justify-self: center;
  }

  .mobile-main-menu__item > span:last-child {
    min-width: 0;
    display: block;
    overflow-wrap: anywhere;
    word-break: normal;
    text-wrap: balance;
  }

  .grid,
  .hd-body,
  .boss-list,
  .pf-leaderboard-list,
  .pf-equipment-inventory,
  #pass #passQuestsPane,
  .modal.settings > div {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .grid::-webkit-scrollbar,
  .hd-body::-webkit-scrollbar,
  .boss-list::-webkit-scrollbar,
  .pf-leaderboard-list::-webkit-scrollbar,
  .pf-equipment-inventory::-webkit-scrollbar,
  #pass #passQuestsPane::-webkit-scrollbar,
  .modal.settings > div::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
}

@media (max-width: 640px), (pointer: coarse) and (max-width: 820px) {
  #lobby {
    min-height: 100dvh;
    height: 100dvh;
    min-height: 100svh;
    padding-bottom: calc(max(8px, env(safe-area-inset-bottom, 0px)) + 8px);
  }

  #lobby .top {
    grid-template-columns: 72px minmax(50px, 60px) minmax(0, 1fr) 42px;
    gap: 8px 6px;
  }

  #lobby .player-pill {
    width: 72px;
    min-width: 72px;
    height: 72px;
    min-height: 72px;
    border-radius: 20px;
  }

  #lobby .player-pill .avatar {
    width: 100%;
    height: 100%;
  }

  #lobby .player-pill .avatar-ring {
    inset: 4px;
    border-radius: 14px;
  }

  #lobby .player-pill .avatar-glyph {
    font-size: 30px;
  }

  #lobby .player-pill .avatar-art {
    width: calc(100% - 8px);
    height: calc(100% - 8px);
    object-fit: contain;
    object-position: center top;
    transform: scale(1.04);
    transform-origin: center top;
  }

  #lobby .currencies {
    gap: 4px;
    width: auto;
    max-width: min(100%, 212px);
    grid-template-columns: repeat(2, minmax(80px, max-content));
  }

  #lobby .currency-pill {
    width: auto;
    min-width: 80px;
    max-width: min(100%, 104px);
    min-height: 42px;
    padding: 6px 6px;
    gap: 4px;
    border-radius: 14px;
  }
  #lobby .currency-pill .val {
    font-size: 12px;
    letter-spacing: .02em;
    overflow: visible;
    text-overflow: clip;
  }
  #lobby .currency-pill .hud-icon.coin,
  #lobby .currency-pill .hud-icon.gem {
    width: 22px;
    height: 22px;
  }

  #lobby .lobby-heroes-pill {
    min-width: 0;
    width: 100%;
    max-width: 60px;
    min-height: 34px;
    padding: 4px 6px;
    border-radius: 12px;
    gap: 3px;
  }

  #lobby .lobby-heroes-pill__label {
    font-size: 7px;
    letter-spacing: .1em;
  }

  #lobby .lobby-heroes-pill__value {
    font-size: 12px;
  }

  .footer-row--single {
    margin-top: 4px;
    padding-bottom: max(2px, env(safe-area-inset-bottom, 0px));
  }

  .mobile-main-menu-toggle {
    width: 46px;
    height: 46px;
  }

  .vault.tier-equipChest .label {
    gap: 5px;
    padding-inline: 8px;
  }

  .vault.tier-equipChest .label > span:first-child {
    font-size: 12px;
    letter-spacing: .02em;
  }
}

@media (max-width: 640px), (pointer: coarse) and (max-width: 820px) {
  .mobile-main-menu__panel {
    padding: 14px;
    border-radius: 22px;
  }

  .mobile-main-menu__title {
    font-size: 20px;
  }

  .mobile-main-menu__item {
    min-height: 48px;
    padding: 10px 12px;
    font-size: 11px;
    column-gap: 10px;
  }

  .mini-stage {
    padding: 18px 12px 20px;
    gap: 14px;
  }

  .mini-emoji {
    width: 76px;
    height: 76px;
    font-size: 44px;
  }

  .wheel-wrap {
    width: 220px;
    height: 220px;
    padding: 8px;
  }

  .mini-info,
  .mem-info {
    font-size: 13px;
    padding: 10px 12px;
  }
}

.vault.tier-equipChest .label.label--equip-price {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  justify-content: stretch;
  column-gap: 6px;
}

.vault.tier-equipChest .label.label--equip-price .vault-label-title {
  min-width: 0;
  overflow: visible;
  white-space: nowrap;
  word-break: normal;
  text-align: center;
  font-size: clamp(8px, 1.55vw, 14px);
  letter-spacing: .02em;
  line-height: 1.05;
}

.vault.tier-equipChest .label.label--equip-price .vault-label-currency {
  width: clamp(26px, 3.8vw, 32px);
  height: clamp(26px, 3.8vw, 32px);
}

.vault.tier-equipChest .label.label--equip-price .vault-label-price {
  white-space: nowrap;
  font-size: clamp(9px, 1.7vw, 14px);
  line-height: 1;
}

@media (max-width: 1024px) {
  .vault.tier-equipChest .label.label--equip-price {
    width: min(100%, 100%);
    padding-inline: 8px;
    column-gap: 4px;
  }

  .vault.tier-equipChest .label.label--equip-price .vault-label-title {
    font-size: clamp(8px, 1.95vw, 13px);
  }

  .vault.tier-equipChest .label.label--equip-price .vault-label-price {
    font-size: clamp(9px, 2vw, 13px);
  }
}

@media (max-width: 520px) {
  .vault.tier-equipChest .label.label--equip-price {
    padding-inline: 5px;
    column-gap: 3px;
  }

  .vault.tier-equipChest .label.label--equip-price .vault-label-title {
    font-size: 7.6px;
    letter-spacing: .015em;
  }

  .vault.tier-equipChest .label.label--equip-price .vault-label-currency {
    width: 13px;
    height: 13px;
  }

  .vault.tier-equipChest .label.label--equip-price .vault-label-price {
    font-size: 8.5px;
  }
}

.wheel-seg {
  width: clamp(76px, 16vw, 104px);
  max-width: clamp(76px, 16vw, 104px);
  font-size: clamp(14px, 1.55vw, 18px);
}

.wheel-seg .currency-inline {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .18em;
  font-size: 1.16em;
  line-height: 1;
  white-space: nowrap;
}

.wheel-seg .currency-inline__icon {
  --currency-icon-limit: 1.72em;
  flex: 0 0 auto;
}

.wheel-seg .currency-mark {
  filter: drop-shadow(0 0 10px rgba(255, 205, 126, 0.28));
}

.wheel-seg .currency-inline__value {
  display: block;
  width: 100%;
  font-size: .94em;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
}

@media (max-width: 1024px) {
  .wheel-wrap {
    width: min(78vw, 292px);
    height: min(78vw, 292px);
    padding: 12px;
  }

  #mini-mem {
    justify-content: flex-start;
    align-items: stretch;
    gap: clamp(8px, 1.5vw, 14px);
    padding: max(6px, env(safe-area-inset-top, 0px)) clamp(10px, 2.2vw, 18px) max(10px, env(safe-area-inset-bottom, 0px));
    overflow: hidden;
  }

  #mini-mem .screen-header,
  #mini-mem .mem-info,
  #mini-mem .mem-grid,
  #mini-mem .muted {
    width: 100%;
    max-width: none;
  }

  #mini-mem .screen-header,
  #mini-mem .mem-info {
    margin-bottom: 0;
  }

  #mini-mem .screen-header {
    padding-top: calc(max(8px, env(safe-area-inset-top, 0px)) + 4px);
  }

  #mini-mem .mem-info {
    padding: 10px 12px;
    font-size: clamp(12px, 1.8vw, 16px);
  }

  #mini-mem .mem-grid {
    flex: 0 1 auto;
    width: min(100%, calc(100vh - 236px));
    width: min(100%, calc(100dvh - 236px));
    max-width: none;
    aspect-ratio: 1 / 1;
    min-height: 0;
    margin: 0 auto;
    gap: clamp(6px, 1vw, 10px);
    padding: clamp(10px, 1.5vw, 14px);
  }

  #mini-mem .mem-front,
  #mini-mem .mem-back {
    font-size: clamp(24px, 4.6vw, 42px);
    border-width: 2px;
    border-radius: clamp(10px, 1.4vw, 14px);
  }

  #mini-mem .muted {
    margin-top: 0;
    padding: 8px 10px;
    font-size: clamp(11px, 1.5vw, 13px);
    line-height: 1.28;
  }
}

@media (max-width: 1024px) and (orientation: landscape) {
  #mini-mem.active {
    display: grid;
    grid-template-columns: minmax(214px, 30vw) minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    column-gap: 12px;
    row-gap: 10px;
    align-items: start;
  }

  #mini-mem .screen-header {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  #mini-mem .mem-info {
    grid-column: 1;
    grid-row: 2;
  }

  #mini-mem .mem-grid {
    grid-column: 2;
    grid-row: 2 / span 2;
    width: min(100%, calc(100vh - 104px));
    width: min(100%, calc(100dvh - 104px));
    justify-self: center;
    align-self: center;
    margin: 0;
  }

  #mini-mem .muted {
    grid-column: 1;
    grid-row: 3;
    align-self: end;
  }
}

@media (max-width: 640px) {
  .wheel-wrap {
    width: min(78vw, 248px);
    height: min(78vw, 248px);
    padding: 10px;
  }

  #mini-mem {
    gap: 8px;
    padding: max(4px, env(safe-area-inset-top, 0px)) 8px max(8px, env(safe-area-inset-bottom, 0px));
  }

  #mini-mem .mem-info {
    font-size: 11.5px;
  }

  #mini-mem .mem-grid {
    gap: 6px;
    padding: 8px;
  }

  #mini-mem .mem-front,
  #mini-mem .mem-back {
    font-size: clamp(22px, 7vw, 30px);
  }

  #mini-mem .muted {
    font-size: 10px;
  }
}


/* Chest ad buttons: keep the longer Russian label readable on smaller screens */
.chest-ad-btn,
.chest-ad-btn.boss-ad-btn {
  grid-auto-rows: min-content;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.08;
  gap: 3px;
}

.chest-ad-btn .free-ad-btn__line {
  display: block;
  width: 100%;
  max-width: 100%;
  text-align: center;
  text-wrap: balance;
}

.chest-ad-btn .free-ad-btn__line:first-child {
  font-size: 0.98em;
  line-height: 1.04;
}

.chest-ad-btn .free-ad-btn__line:last-child {
  max-width: 100%;
  font-size: 0.78em;
  line-height: 1.16;
  letter-spacing: 0.015em;
  overflow-wrap: anywhere;
  word-break: normal;
}

@media (max-width: 900px) {
  .vault[data-box="bigChest"],
  .vault[data-box="largeChest"],
  .vault[data-box="equipChest"] {
    min-height: 308px;
  }

  .chest-ad-btn,
  .chest-ad-btn.boss-ad-btn {
    width: min(100%, 178px);
    min-height: 62px;
    padding: 8px 10px;
    font-size: 9.2px;
    gap: 4px;
  }

  .chest-ad-btn .free-ad-btn__line:last-child {
    font-size: 0.76em;
  }
}

@media (max-width: 640px) {
  .vault[data-box="bigChest"],
  .vault[data-box="largeChest"],
  .vault[data-box="equipChest"] {
    min-height: 252px;
  }

  .chest-ad-btn,
  .chest-ad-btn.boss-ad-btn {
    min-height: 56px;
    padding: 7px 6px;
    font-size: 7.8px;
    line-height: 1.1;
    gap: 3px;
  }

  .chest-ad-btn .free-ad-btn__line:last-child {
    font-size: 0.74em;
    line-height: 1.14;
  }
}

@media (max-width: 400px) {
  .vault[data-box="bigChest"],
  .vault[data-box="largeChest"],
  .vault[data-box="equipChest"] {
    min-height: 228px;
  }

  .chest-ad-btn,
  .chest-ad-btn.boss-ad-btn {
    min-height: 52px;
    padding: 6px 4px;
    font-size: 6.8px;
    gap: 2px;
  }

  .chest-ad-btn .free-ad-btn__line:last-child {
    font-size: 0.7em;
    line-height: 1.12;
  }
}

/* Small chest ad button: keep both languages readable on phones and tablets */
.free-ad-btn,
.free-ad-btn.boss-ad-btn {
  grid-auto-rows: min-content;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.06;
  gap: 3px;
}

.free-ad-btn .free-ad-btn__line {
  display: block;
  width: 100%;
  max-width: 100%;
  text-align: center;
  text-wrap: balance;
}

.free-ad-btn .free-ad-btn__line:first-child {
  font-size: 0.98em;
  line-height: 1.02;
}

.free-ad-btn .free-ad-btn__line:last-child {
  font-size: 0.8em;
  line-height: 1.14;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
  word-break: normal;
}

@media (max-width: 900px) {
  .vault[data-box="smallChest"] {
    min-height: 308px;
  }

  .vault[data-box="smallChest"] .free-ad-btn,
  .vault[data-box="smallChest"] .free-ad-btn.boss-ad-btn {
    width: min(100%, 178px);
    min-height: 62px;
    padding: 8px 10px;
    font-size: 9.4px;
    gap: 4px;
  }

  .vault[data-box="smallChest"] .free-ad-btn .free-ad-btn__line:last-child {
    font-size: 0.78em;
  }
}

@media (max-width: 640px) {
  .vault[data-box="smallChest"] {
    min-height: 252px;
  }

  .vault[data-box="smallChest"] .free-ad-btn,
  .vault[data-box="smallChest"] .free-ad-btn.boss-ad-btn {
    min-height: 56px;
    padding: 7px 6px;
    font-size: 7.8px;
    line-height: 1.1;
    gap: 3px;
  }

  .vault[data-box="smallChest"] .free-ad-btn .free-ad-btn__line:last-child {
    font-size: 0.76em;
    line-height: 1.12;
  }
}

@media (max-width: 400px) {
  .vault[data-box="smallChest"] {
    min-height: 228px;
  }

  .vault[data-box="smallChest"] .free-ad-btn,
  .vault[data-box="smallChest"] .free-ad-btn.boss-ad-btn {
    min-height: 52px;
    padding: 6px 4px;
    font-size: 6.8px;
    gap: 2px;
  }

  .vault[data-box="smallChest"] .free-ad-btn .free-ad-btn__line:last-child {
    font-size: 0.7em;
    line-height: 1.12;
  }
}

/* Boss ad refill button: keep copy inside the frame on phones and tablets */
@media (max-width: 1024px), (pointer: coarse) and (max-width: 1366px) {
  #boss #bossAdBtn {
    min-width: 0;
    min-height: 64px;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    align-items: center;
    gap: 4px;
    padding: 9px 10px;
    text-align: center;
  }

  #boss #bossAdBtn .boss-ad-btn__icon {
    font-size: 20px;
  }

  #boss #bossAdBtn .boss-ad-btn__copy {
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 3px;
  }

  #boss #bossAdBtn .boss-ad-btn__title,
  #boss #bossAdBtn .boss-ad-btn__meta {
    width: 100%;
    max-width: 100%;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-wrap: balance;
  }

  #boss #bossAdBtn .boss-ad-btn__title {
    font-size: 10px;
    line-height: 1.12;
    letter-spacing: .03em;
  }

  #boss #bossAdBtn .boss-ad-btn__meta {
    font-size: 9px;
    line-height: 1.18;
  }
}

@media (max-width: 640px) {
  #boss #bossAdBtn {
    min-height: 62px;
    padding: 8px 8px;
    gap: 3px;
  }

  #boss #bossAdBtn .boss-ad-btn__icon {
    font-size: 18px;
  }

  #boss #bossAdBtn .boss-ad-btn__title {
    font-size: 9px;
    line-height: 1.1;
  }

  #boss #bossAdBtn .boss-ad-btn__meta {
    font-size: 8px;
    line-height: 1.14;
  }
}

/* Upside Down Pass: force a non-overlapping vertical stack on narrow screens */
@media (max-width: 900px) {
  #pass[data-pass-view="rewards"] #passRewardsPane {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 12px;
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  #pass[data-pass-view="rewards"] .pass-track {
    order: 1;
    flex: 0 0 auto;
    min-height: 0;
    height: auto;
    padding: 18px 10px 14px;
    margin-bottom: 0;
  }

  #pass[data-pass-view="rewards"] .pass-buy-col {
    order: 2;
    flex: none;
    width: 100%;
    margin-top: 0;
    align-self: stretch;
  }

  #pass[data-pass-view="rewards"] .pbc-card,
  #pass[data-pass-view="rewards"] .pbc-card.pbc-locked,
  #pass[data-pass-view="rewards"] .pbc-card.pbc-owned {
    min-height: auto;
    height: auto;
    padding: 16px 12px 16px;
    gap: 8px;
    justify-content: flex-start;
    border-radius: 18px;
    background:
      linear-gradient(180deg, rgba(10, 8, 12, 0.92), rgba(8, 6, 10, 0.98)),
      var(--pass-ticket-image) center / cover no-repeat;
  }

  #pass[data-pass-view="rewards"] .pbc-card::after {
    display: none;
  }

  #pass[data-pass-view="rewards"] .pbc-label,
  #pass[data-pass-view="rewards"] .pbc-sub {
    width: 100%;
    max-width: 100%;
    text-align: center;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-wrap: balance;
  }

  #pass[data-pass-view="rewards"] .pbc-sub {
    padding: 0;
    margin-top: 0;
    line-height: 1.32;
  }

  #pass[data-pass-view="rewards"] #pbcActivate {
    width: 100%;
    max-width: 320px;
    min-height: 46px;
    margin: 4px auto 0;
    padding: 8px 12px;
    white-space: normal;
    line-height: 1.14;
    text-align: center;
    justify-content: center;
  }

  #pass[data-pass-view="rewards"] #pbcActivate .currency-inline {
    flex-wrap: wrap;
    justify-content: center;
  }

  #pass[data-pass-view="rewards"] .pass-claim-all {
    position: static;
    order: 3;
    right: auto;
    left: auto;
    bottom: auto;
    transform: none;
    margin: 0 auto;
    align-self: center;
  }

  #pass[data-pass-view="rewards"] .pass-col.current {
    transform: none;
  }

  #pass[data-pass-view="rewards"] .ptk-card {
    overflow: hidden;
  }

  #pass[data-pass-view="rewards"] .ptk-v,
  #pass[data-pass-view="rewards"] .ptk-state,
  #pass[data-pass-view="rewards"] .ptk-claim {
    width: 100%;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-wrap: balance;
  }

  #pass[data-pass-view="rewards"] .ptk-claim {
    position: relative;
    z-index: 1;
  }
}

@media (max-width: 640px) {
  #pass[data-pass-view="rewards"] #passRewardsPane {
    gap: 10px;
  }

  #pass[data-pass-view="rewards"] .pass-track {
    padding: 16px 8px 12px;
  }

  #pass[data-pass-view="rewards"] .pbc-card,
  #pass[data-pass-view="rewards"] .pbc-card.pbc-locked,
  #pass[data-pass-view="rewards"] .pbc-card.pbc-owned {
    padding: 14px 10px 14px;
    border-radius: 16px;
  }

  #pass[data-pass-view="rewards"] #pbcActivate {
    min-height: 44px;
    font-size: 12px;
  }
}

/* Upside Down Pass: keep activation panel visible and separate from rewards on all narrow screens */
@media (max-width: 900px) {
  #pass[data-pass-view="rewards"] #passRewardsPane {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    gap: 10px;
    min-height: 0;
    height: auto;
    padding-bottom: 0;
  }

  #pass[data-pass-view="rewards"] .pass-buy-col {
    order: 1;
    grid-row: 1;
    width: 100%;
    margin-top: 0;
    align-self: stretch;
  }

  #pass[data-pass-view="rewards"] .pass-track {
    order: 2;
    grid-row: 2;
    flex: 1 1 auto;
    min-height: clamp(248px, 38dvh, 360px);
    height: auto;
    margin: 0;
    padding: 14px 8px 12px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  #pass[data-pass-view="rewards"] .pbc-card,
  #pass[data-pass-view="rewards"] .pbc-card.pbc-locked,
  #pass[data-pass-view="rewards"] .pbc-card.pbc-owned {
    min-height: 0;
    height: auto;
    padding: 12px 10px;
    gap: 6px;
    justify-content: flex-start;
    border-radius: 16px;
  }

  #pass[data-pass-view="rewards"] .pbc-label {
    font-size: 11px;
    line-height: 1.2;
  }

  #pass[data-pass-view="rewards"] .pbc-sub {
    font-size: 10px;
    line-height: 1.28;
  }

  #pass[data-pass-view="rewards"] #pbcActivate {
    width: 100%;
    max-width: 320px;
    min-height: 42px;
    margin: 2px auto 0;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.12;
    white-space: normal;
    justify-content: center;
  }

  #pass[data-pass-view="rewards"] .pass-claim-all {
    order: 3;
    grid-row: 3;
    position: static;
    right: auto;
    left: auto;
    bottom: auto;
    transform: none;
    margin: 0 auto;
    align-self: center;
  }
}

@media (max-width: 640px) {
  #pass[data-pass-view="rewards"] .pass-track {
    min-height: clamp(224px, 34dvh, 300px);
    padding: 12px 6px 10px;
  }

  #pass[data-pass-view="rewards"] .pbc-card,
  #pass[data-pass-view="rewards"] .pbc-card.pbc-locked,
  #pass[data-pass-view="rewards"] .pbc-card.pbc-owned {
    padding: 10px 8px;
    border-radius: 14px;
  }

  #pass[data-pass-view="rewards"] #pbcActivate {
    min-height: 40px;
    font-size: 11px;
    padding: 7px 10px;
  }
}

@media (max-height: 820px) {
  #pass[data-pass-view="rewards"] .pass-header {
    gap: 6px 8px;
    margin-bottom: 2px;
    padding: 2px 4px;
  }

  #pass[data-pass-view="rewards"] .pass-season {
    padding: 5px 54px;
    border-radius: 16px;
  }

  #pass[data-pass-view="rewards"] .ps-sub {
    font-size: 10px;
  }

  #pass[data-pass-view="rewards"] .ps-title {
    font-size: 14px;
  }

  #pass[data-pass-view="rewards"] .pass-progress-bar {
    gap: 8px;
    padding: 0 4px 4px;
  }

  #pass[data-pass-view="rewards"] .ppb-fill {
    height: 24px;
  }

  #pass[data-pass-view="rewards"] .ppb-level {
    width: 38px;
    height: 38px;
  }

  #pass[data-pass-view="rewards"] #passRewardsPane {
    gap: 8px;
  }

  #pass[data-pass-view="rewards"] .pass-track {
    min-height: clamp(208px, 30dvh, 300px);
    padding: 12px 6px 8px;
  }

  #pass[data-pass-view="rewards"] .pbc-card,
  #pass[data-pass-view="rewards"] .pbc-card.pbc-locked,
  #pass[data-pass-view="rewards"] .pbc-card.pbc-owned {
    padding: 10px 8px;
    gap: 5px;
    border-radius: 14px;
  }

  #pass[data-pass-view="rewards"] #pbcActivate {
    min-height: 38px;
    margin-top: 0;
    padding: 7px 10px;
    font-size: 11px;
  }

  #pass[data-pass-view="rewards"] .pass-claim-all {
    min-height: 42px;
  }
}

/* Trophy Road: keep header, track and claim-all visible on every viewport */
@media (min-width: 1025px) and (pointer: fine) {
  #trophyRoad {
    min-height: 100dvh;
    height: 100dvh;
    padding: clamp(12px, 2vh, 22px) clamp(12px, 1.8vw, 24px) calc(86px + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  #trophyRoad::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  #trophyRoad .screen-header {
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 8px;
    padding: 8px 10px 6px;
    background: linear-gradient(180deg, rgba(8, 5, 7, 0.98), rgba(8, 5, 7, 0.86) 78%, rgba(8, 5, 7, 0));
  }

  #trophyRoad .screen-title {
    font-size: clamp(18px, 1.8vw, 24px);
    line-height: 1.06;
    letter-spacing: .08em;
    padding: 0 54px;
    text-wrap: balance;
  }

  .tr-sub {
    margin: 0 auto 10px;
    padding: 12px 14px;
    line-height: 1.4;
    max-width: min(980px, 100%);
  }

  .tr-track {
    flex: 0 0 auto;
    min-height: clamp(252px, 44vh, 360px);
    padding: 24px 14px 22px;
    gap: 14px;
    border-radius: 24px;
  }

  .tr-track::before,
  .tr-track::after {
    left: 18px;
    right: 18px;
  }

  .tr-node {
    min-width: clamp(148px, 13vw, 176px);
  }

  .tr-node.next {
    min-width: clamp(188px, 16vw, 220px);
    transform: translateY(-4px);
  }

  .tr-card {
    min-height: clamp(198px, 30vh, 226px);
    padding: 14px 12px 16px;
    gap: 10px;
  }

  .tr-relic {
    width: 96px;
    height: 108px;
  }

  .tr-node.next .tr-relic {
    width: 112px;
    height: 126px;
  }

  .tr-core {
    width: 68px;
    height: 68px;
    border-radius: 22px;
  }

  .tr-node.next .tr-core {
    width: 82px;
    height: 82px;
    border-radius: 24px;
  }

  .tr-counter {
    align-self: center;
    margin: 12px auto 0;
    padding: 10px 14px;
    font-size: 16px;
  }

  .tr-claim-all {
    position: sticky;
    left: 0;
    right: 0;
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    align-self: center;
    margin: 12px auto 0;
    width: min(300px, calc(100% - 12px));
    max-width: calc(100% - 12px);
    z-index: 120;
  }
}

@media (max-width: 1024px), (pointer: coarse) and (max-width: 1366px) {
  #trophyRoad {
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  }

  #trophyRoad .screen-header {
    padding-left: 10px;
    padding-right: 10px;
  }

  .tr-track {
    padding: 18px 8px 14px;
  }

  .tr-counter {
    margin: 12px auto 0;
  }

  .tr-claim-all {
    margin-top: 12px;
    width: min(280px, calc(100% - 8px));
  }
}

/* Daily rewards modal: keep each day card readable on phones and tablets */
/* Leaderboard and public profile: keep player cards tappable and readable on every device */
@media (max-width: 1024px) {
  #profile .pf-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  #profile .pf-tab,
  #profile .pf-subtab {
    min-width: 0;
    white-space: normal;
    line-height: 1.14;
    text-wrap: balance;
  }

  #profile .pf-pane--leaderboard {
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }

  #profile .pf-leaderboard-list {
    gap: 8px;
    padding-right: 0;
  }

  #profile .pf-leaderboard-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
  }

  #profile .pf-leaderboard-gap {
    grid-template-columns: minmax(20px, 1fr) auto minmax(20px, 1fr);
    gap: 6px;
    padding: 2px 0;
  }

  #profile .pf-leaderboard-gap__text {
    min-height: 24px;
    padding: 0 10px;
    font-size: 9px;
  }

  #profile .pf-leaderboard-card {
    grid-template-columns: 58px 52px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    padding: 9px;
  }

  #profile .pf-leaderboard-rank {
    align-self: center;
    font-size: 18px;
    justify-self: center;
  }

  #profile .pf-leaderboard-avatar {
    width: 52px;
    height: 52px;
    border-radius: 12px;
  }

  #profile .pf-leaderboard-copy {
    gap: 4px;
  }

  #profile .pf-leaderboard-name {
    font-size: 13px;
    white-space: normal;
    line-height: 1.18;
    overflow-wrap: anywhere;
  }

  #profile .pf-leaderboard-meta,
  #profile .pf-leaderboard-side,
  #profile .pf-leaderboard-side > div {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.25;
  }

  #profile .pf-leaderboard-side {
    grid-column: 2 / -1;
    text-align: left;
    gap: 3px;
  }

  #profile .pf-leaderboard-attack {
    width: 100%;
    min-width: 0;
    min-height: 42px;
  }

  #leaderProfile .screen-header {
    margin-bottom: 10px;
  }

  #leaderProfile .pf-top {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  #leaderProfile .pf-center,
  #leaderProfile .leader-profile-equipment-copy {
    min-width: 0;
  }

  #leaderProfile .pf-row {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px 10px;
  }

  #leaderProfile .pf-name,
  #leaderProfile .pf-id,
  #leaderProfile .pf-xptext,
  #leaderProfile .pf-tile-label,
  #leaderProfile .pf-tile-value,
  #leaderProfile .leader-profile-equipment-copy,
  #leaderProfile .leader-profile-equipment-stats span,
  #leaderProfile .pf-equipment-slot-label,
  #leaderProfile .pf-equipment-slot-name,
  #leaderProfile .pf-equipment-slot-power {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  #leaderProfile .leader-profile-hero,
  #leaderProfile .leader-profile-summary,
  #leaderProfile .leader-profile-equipment,
  #leaderProfile .leader-profile-heroes {
    padding: 12px;
    margin-bottom: 10px;
  }

  #leaderProfile .leader-profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
  }

  #leaderProfile .leader-profile-summary .pf-row {
    justify-content: flex-start;
  }

  #leaderProfile .leader-profile-equipment-stats {
    gap: 6px;
  }

  #leaderProfile .leader-profile-equipment-stats span,
  #leaderProfile .leader-profile-equipment-stats .eq-chip {
    white-space: normal;
  }

  #leaderProfile .leader-profile-heroes {
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 8px;
  }
}

@media (max-width: 640px) {
  #profile .pf-tabs,
  #profile .pf-subtabs {
    gap: 6px;
  }

  #profile .pf-tab,
  #profile .pf-subtab {
    padding: 8px 6px;
    font-size: 10px;
  }

  #profile .pf-leaderboard-card {
    grid-template-columns: 52px 46px minmax(0, 1fr);
    gap: 6px;
    padding: 8px;
  }

  #profile .pf-leaderboard-rank {
    font-size: 16px;
  }

  #profile .pf-leaderboard-avatar {
    width: 46px;
    height: 46px;
    border-radius: 10px;
  }

  #profile .pf-leaderboard-meta,
  #profile .pf-leaderboard-side {
    font-size: 9px;
  }

  #profile .pf-leaderboard-attack {
    min-height: 40px;
    font-size: 10px;
    padding: 7px 8px;
  }

  #leaderProfile .pf-top {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
  }

  #leaderProfile .pf-center {
    width: 100%;
    align-items: center;
  }

  #leaderProfile .pf-row {
    justify-content: center;
  }

  #leaderProfile .pf-xpbar {
    width: 100%;
  }

  #leaderProfile .leader-profile-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #leaderProfile .leader-profile-heroes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Daily rewards modal: keep each day card readable on phones and tablets */
.d-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 164px), 1fr));
  justify-content: center;
  align-items: stretch;
  align-content: start;
}

.d-card {
  display: grid;
  min-height: clamp(220px, 28vh, 252px);
  grid-template-rows: auto auto auto auto minmax(72px, 1fr) auto;
  align-content: start;
  row-gap: 8px;
  min-width: 0;
}

.d-card__tag,
.d-card__symbol,
.d-card__title,
.d-card__flavor,
.d-card__effect {
  margin-top: 0;
}

.d-card__title,
.d-card__flavor,
.d-card__effect {
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  min-width: 0;
}

.d-card__title {
  line-height: 1.18;
  text-wrap: balance;
}

.d-card__flavor {
  min-height: 0;
  line-height: 1.3;
  text-wrap: pretty;
}

.d-card__effect {
  align-self: end;
  margin-top: auto;
  padding-top: 6px;
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-wrap: balance;
  white-space: normal;
}

body.yandex-debug-ads-active .d-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 152px), 1fr));
  gap: 10px;
}

body.yandex-debug-ads-active .d-modal {
  width: min(calc(var(--yandex-debug-safe-width) - 24px), 1040px);
}

@media (max-width: 1480px) and (min-width: 1025px) {
  .d-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 156px), 1fr));
  }

  .d-card {
    min-height: 236px;
    padding: 12px 10px;
    grid-template-rows: auto auto auto auto minmax(64px, 1fr) auto;
  }

  .d-card__title {
    font-size: 13px;
  }

  .d-card__flavor {
    font-size: 11px;
  }

  .d-card__effect {
    font-size: 10px;
  }
}

@media (max-width: 1024px) {
  .d-modal {
    width: min(760px, 100%);
  }

  .d-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .d-card {
    min-height: 204px;
    padding: 12px 10px;
    grid-template-rows: auto auto auto auto minmax(58px, 1fr) auto;
  }

  .d-card__title {
    font-size: 13px;
  }

  .d-card__flavor {
    font-size: 11px;
  }

  .d-card__effect {
    font-size: 10px;
  }
}

@media (max-width: 640px) {
  .d-modal {
    padding: 14px 10px 12px;
  }

  .d-grid {
    gap: 8px;
  }

  .d-card {
    min-height: 214px;
    padding: 11px 8px;
    border-radius: 14px;
    grid-template-rows: auto auto auto auto minmax(64px, 1fr) auto;
    row-gap: 6px;
  }

  .d-card__day {
    font-size: 10px;
    letter-spacing: 0.12em;
  }

  .d-card__tag {
    padding: 4px 7px;
    font-size: 8px;
    letter-spacing: 0.08em;
  }

  .d-card__symbol {
    font-size: 24px;
  }

  .d-card__title {
    font-size: 12px;
    line-height: 1.15;
  }

  .d-card__flavor {
    font-size: 10px;
    line-height: 1.22;
  }

  .d-card__effect {
    font-size: 9px;
    letter-spacing: 0.035em;
  }

  #dailyClaim {
    font-size: 14px;
  }
}

@media (max-width: 400px) {
  .d-card {
    min-height: 202px;
    padding: 10px 7px;
    grid-template-rows: auto auto auto auto minmax(58px, 1fr) auto;
  }

  .d-card__title {
    font-size: 11px;
  }

  .d-card__flavor {
    font-size: 9.5px;
  }

  .d-card__effect {
    font-size: 8.5px;
  }
}

/* Shop cards: keep all copy visible on tablets and phones */
@media (max-width: 1024px) {
  #shopGrid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    align-items: start;
    justify-content: stretch;
  }

  #shopGrid .shop-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex: 0 0 calc((100% - 12px) / 2);
    max-width: calc((100% - 12px) / 2);
    min-height: 0;
    min-width: 0;
    height: auto;
    padding-bottom: 12px;
    overflow: hidden;
  }

  .shop-card .portrait {
    min-height: 132px;
    max-height: 132px;
    padding: 8px 8px 0;
  }

  .shop-card-visual {
    width: min(100%, 118px);
    height: 118px;
  }

  .shop-card-visual--art {
    width: min(100%, 124px);
    height: 124px;
  }

  .shop-card-visual--currency,
  .shop-card-visual--emoji {
    width: min(100%, 112px);
    height: 112px;
  }

  .shop-card-visual--currency {
    width: min(100%, 122px);
    height: 122px;
    transform: translateY(8px);
  }

  .shop-card-visual--currency .currency-mark {
    --currency-icon-limit: min(100%, 120px);
  }

  .shop-card-visual--emoji {
    font-size: clamp(50px, 6vw, 68px);
  }

  .shop-card .nm {
    min-height: 0;
    padding: 8px 8px 2px;
    font-size: 12px;
    line-height: 1.18;
    overflow-wrap: anywhere;
    word-break: normal;
    text-wrap: balance;
  }

  .shop-card-desc {
    min-height: 0;
    padding: 6px 8px 2px;
    font-size: 10.5px;
    line-height: 1.24;
    overflow-wrap: anywhere;
    word-break: normal;
    text-wrap: balance;
  }

  .shop-card .meta {
    min-height: 0;
    padding: 6px 8px;
    min-width: 0;
    margin-top: auto;
  }

  .shop-card-price-label {
    font-size: 9px;
    letter-spacing: .1em;
  }

  .shop-card:not([data-shop-item="s_ad_gems"]) .shop-card-price-value {
    gap: 4px;
    min-width: 0;
    flex-wrap: wrap;
    white-space: normal;
  }

  .shop-card:not([data-shop-item="s_ad_gems"]) .shop-card-price-value .currency-inline {
    gap: 4px;
    font-size: 14px;
  }

  .shop-card:not([data-shop-item="s_ad_gems"]) .shop-card-price-value .currency-mark {
    --currency-icon-limit: 24px;
  }

  .shop-card:not([data-shop-item="s_ad_gems"]) .shop-card-price-value .orig .currency-mark {
    --currency-icon-limit: 30px;
  }

  .shop-card[data-shop-item="s_ad_gems"] .shop-ad-meta {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    display: block;
    width: 100%;
    max-width: none;
    padding: 4px 6px;
    font-size: 10px;
    line-height: 1.18;
  }

  .shop-card .meta.meta--price-only {
    padding: 6px 8px 8px;
    border-top: 1px solid rgba(255, 92, 44, 0.16);
  }

  .shop-card .meta.meta--price-only .shop-card-price-main {
    justify-content: center;
    gap: 4px;
  }

  .shop-card .meta.meta--price-only .shop-card-price-value {
    justify-content: center;
    flex-wrap: nowrap;
  }

  .shop-card.deal .meta.meta--price-only .shop-card-price-main {
    gap: 5px;
  }

  .shop-card .meta .orig {
    margin-right: 0;
  }

  .shop-card > .btn {
    width: auto;
    min-height: 42px;
    margin: 6px 8px 0;
    padding: 9px 12px;
    font-size: 13px;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  #shopGrid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  #shopGrid .shop-card {
    flex: 0 0 calc((100% - 12px) / 2);
    max-width: calc((100% - 12px) / 2);
    height: 368px;
    min-height: 368px;
  }

  .shop-card .nm {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .shop-card-desc {
    min-height: 36px;
  }

  .shop-card .meta.meta--price-only {
    height: 72px;
    min-height: 72px;
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  .shop-card-price-label {
    text-align: center;
  }

  .shop-card .meta.meta--price-only .shop-card-price-main {
    width: auto;
    max-width: 100%;
    justify-content: center;
    gap: 4px;
  }

  .shop-card .meta.meta--price-only .shop-card-price-value,
  .shop-card:not([data-shop-item="s_ad_gems"]) .shop-card-price-value {
    justify-content: center;
    width: auto;
    max-width: 100%;
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  .shop-card.deal .meta.meta--price-only .shop-card-price-main {
    gap: 5px;
  }
}

@media (max-width: 640px) {
  #shopGrid {
    max-width: min(100%, 420px);
    margin: 0 auto;
  }

  #shopGrid .shop-card {
    flex-basis: 100%;
    max-width: 100%;
    padding-bottom: 12px;
  }

  .shop-card .portrait {
    min-height: 112px;
    max-height: 112px;
    padding: 8px 6px 0;
  }

  .shop-card-visual {
    width: min(100%, 98px);
    height: 98px;
  }

  .shop-card-visual--art {
    width: min(100%, 104px);
    height: 104px;
  }

  .shop-card-visual--currency,
  .shop-card-visual--emoji {
    width: min(100%, 94px);
    height: 94px;
  }

  .shop-card-visual--currency {
    width: min(100%, 102px);
    height: 102px;
    transform: translateY(6px);
  }

  .shop-card-visual--currency .currency-mark {
    --currency-icon-limit: min(100%, 100px);
  }

  .shop-card-visual--emoji {
    font-size: clamp(42px, 8vw, 56px);
  }

  .shop-card .nm {
    padding: 7px 6px 2px;
    font-size: 11px;
  }

  .shop-card-desc {
    padding: 5px 6px 2px;
    font-size: 9.5px;
    line-height: 1.2;
  }

  .shop-card .meta.meta--price-only {
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  .shop-card-price-label {
    text-align: center;
  }

  .shop-card .meta.meta--price-only .shop-card-price-main {
    width: auto;
    max-width: 100%;
    justify-content: center;
    gap: 4px;
  }

  .shop-card .meta.meta--price-only .shop-card-price-value,
  .shop-card:not([data-shop-item="s_ad_gems"]) .shop-card-price-value {
    justify-content: center;
    width: auto;
    max-width: 100%;
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  .shop-card.deal .meta.meta--price-only .shop-card-price-main {
    gap: 5px;
  }

  .shop-card:not([data-shop-item="s_ad_gems"]) .shop-card-price-value .currency-inline {
    font-size: 12.5px;
  }

  .shop-card:not([data-shop-item="s_ad_gems"]) .shop-card-price-value .currency-mark {
    --currency-icon-limit: 22px;
  }

  .shop-card[data-shop-item="s_ad_gems"] .shop-ad-meta {
    font-size: 9px;
  }

  .shop-card > .btn {
    min-height: 40px;
    margin: 6px 6px 0;
    font-size: 12px;
    padding: 8px 10px;
  }
}

@media (max-width: 400px) {
  #shopGrid {
    max-width: 100%;
  }

  .shop-card .portrait {
    min-height: 102px;
    max-height: 102px;
  }

  .shop-card-visual {
    width: min(100%, 90px);
    height: 90px;
  }

  .shop-card-visual--art {
    width: min(100%, 96px);
    height: 96px;
  }

  .shop-card-visual--currency,
  .shop-card-visual--emoji {
    width: min(100%, 86px);
    height: 86px;
  }

  .shop-card-visual--currency {
    width: min(100%, 94px);
    height: 94px;
    transform: translateY(5px);
  }

  .shop-card .nm {
    font-size: 10px;
  }

  .shop-card-desc {
    font-size: 9px;
  }

  .shop-card > .btn {
    min-height: 38px;
    margin-inline: 5px;
    font-size: 11px;
  }
}

/* Lobby compact fit: keep all four chests visible inside narrow or low Yandex Games windows */
@media (max-width: 1024px), (pointer: coarse) and (max-width: 1366px) {
  body:not(.tutorial-starter-compact-active) #lobby .body {
    min-height: 0;
    overflow: hidden;
    align-items: stretch;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault-row {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-items: center;
    align-content: center;
    align-items: start;
    gap: clamp(10px, 1.8vh, 16px) clamp(8px, 2vw, 16px);
    padding: clamp(4px, 1.3vh, 10px) clamp(4px, 1.2vw, 12px);
    overflow: hidden;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault,
  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="smallChest"],
  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="bigChest"],
  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="largeChest"],
  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="equipChest"] {
    width: min(100%, 168px);
    min-height: 0;
    height: auto;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault {
    padding-top: 24px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="smallChest"] {
    padding-top: 44px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault .chest {
    width: min(100%, 140px);
    height: min(100%, 140px);
    border-radius: 22px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="smallChest"] .chest {
    margin-top: -18px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault .info {
    right: 3px;
    top: -5px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="smallChest"] .free-vault-top {
    width: min(100%, 144px);
    gap: 6px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="smallChest"].free-stack-full .free-vault-top {
    width: 78px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="smallChest"] .timer-overlay,
  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="smallChest"].locked .timer-overlay {
    top: 24px;
    width: min(calc(100% - 16px), 140px);
    padding: 0 10px;
    font-size: 9px;
    letter-spacing: .05em;
  }

  body:not(.tutorial-starter-compact-active) #lobby .stack-badge {
    min-width: 46px;
    padding: 4px 8px;
    font-size: 10px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .free-ad-meta,
  body:not(.tutorial-starter-compact-active) #lobby .chest-ad-timer {
    font-size: 8px;
    letter-spacing: .045em;
    line-height: 1.15;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault .label,
  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="smallChest"] .free-ad-btn,
  body:not(.tutorial-starter-compact-active) #lobby .chest-ad-btn,
  body:not(.tutorial-starter-compact-active) #lobby .chest-ad-btn.boss-ad-btn {
    width: min(100%, 164px);
    max-width: 100%;
    min-width: 0;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault .label {
    min-height: 40px;
    margin-top: 8px;
    padding: 5px 6px;
    font-size: 10px;
    line-height: 1.06;
    letter-spacing: .04em;
    column-gap: 4px;
    row-gap: 2px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault .label > span:first-child {
    overflow-wrap: anywhere;
    word-break: normal;
    text-wrap: balance;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault .label .hud-icon.coin,
  body:not(.tutorial-starter-compact-active) #lobby .vault .label .hud-icon.gem {
    width: 18px;
    height: 18px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="smallChest"] .free-ad-btn,
  body:not(.tutorial-starter-compact-active) #lobby .chest-ad-btn,
  body:not(.tutorial-starter-compact-active) #lobby .chest-ad-btn.boss-ad-btn {
    min-height: 40px;
    margin-top: 7px;
    padding: 5px 6px;
    border-radius: 12px;
    font-size: 8px;
    line-height: 1.08;
    gap: 2px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .footer-row--single {
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
    margin-top: 2px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .footer-row--single .banner {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 42px;
    padding: 8px 14px;
    font-size: clamp(11px, 1.65vw, 14px);
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.yandex-debug-ads-active:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .body {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-right: 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  body.yandex-debug-ads-active:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }

  body.yandex-debug-ads-active:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .vault-row {
    height: auto;
    min-height: max-content;
    align-content: start;
    overflow: visible;
    padding-bottom: max(14px, env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 1024px) and (max-height: 860px), (pointer: coarse) and (max-width: 1366px) and (max-height: 860px) {
  body:not(.tutorial-starter-compact-active) #lobby .vault-row {
    align-content: start;
    gap: 10px 8px;
    padding: 2px 4px 6px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault,
  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="smallChest"],
  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="bigChest"],
  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="largeChest"],
  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="equipChest"] {
    width: min(100%, 154px);
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault {
    padding-top: 20px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="smallChest"] {
    padding-top: 40px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault .chest {
    width: min(100%, 126px);
    height: min(100%, 126px);
    border-radius: 20px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="smallChest"] .free-vault-top {
    width: min(100%, 132px);
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="smallChest"] .timer-overlay,
  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="smallChest"].locked .timer-overlay {
    width: min(calc(100% - 14px), 126px);
    top: 22px;
    font-size: 8px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault .label,
  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="smallChest"] .free-ad-btn,
  body:not(.tutorial-starter-compact-active) #lobby .chest-ad-btn,
  body:not(.tutorial-starter-compact-active) #lobby .chest-ad-btn.boss-ad-btn {
    width: min(100%, 150px);
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault .label {
    min-height: 36px;
    margin-top: 6px;
    padding: 4px 5px;
    font-size: 8.8px;
    line-height: 1.02;
    letter-spacing: .03em;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault .label .hud-icon.coin,
  body:not(.tutorial-starter-compact-active) #lobby .vault .label .hud-icon.gem {
    width: 16px;
    height: 16px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .vault[data-box="smallChest"] .free-ad-btn,
  body:not(.tutorial-starter-compact-active) #lobby .chest-ad-btn,
  body:not(.tutorial-starter-compact-active) #lobby .chest-ad-btn.boss-ad-btn {
    min-height: 36px;
    margin-top: 6px;
    padding: 4px 5px;
    font-size: 7.2px;
    gap: 2px;
  }

  body:not(.tutorial-starter-compact-active) #lobby .footer-row--single .banner {
    min-height: 38px;
    padding: 7px 12px;
    font-size: 12px;
  }
}

@media (max-width: 1024px), (pointer: coarse) and (max-width: 1366px) {
  body.starter-skip-focus-active #lobby .top {
    grid-template-columns: 98px minmax(74px, max-content) minmax(0, 1fr);
    grid-template-areas: "player heroes currencies";
    gap: 8px 6px;
  }

  body.starter-skip-focus-active #lobby .body {
    padding: 8px 0 14px;
    min-height: 0;
    overflow: visible;
  }

  body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "starter starter"
      "small large"
      ". equip";
    justify-items: center;
    align-content: center;
    align-items: start;
    gap: clamp(10px, 2vh, 16px) clamp(8px, 2vw, 14px);
    min-height: fit-content;
    padding: 8px 6px 18px;
    overflow: visible;
  }

  body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-pending {
    width: clamp(214px, 34vw, 296px);
    min-height: clamp(296px, 44vw, 356px);
    padding-top: 18px;
    padding-bottom: 16px;
  }

  body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-pending .starter-callout {
    width: min(100%, 252px);
    margin-bottom: 12px;
    font-size: clamp(18px, 3vw, 24px);
    letter-spacing: .12em;
  }

  body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-locked {
    width: min(100%, 154px);
    padding-bottom: 10px;
  }

  body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-locked .chest {
    width: min(100%, 126px);
    height: min(100%, 126px);
    border-radius: 20px;
  }

  body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-pending .label {
    width: min(100%, 252px);
    min-height: 48px;
    font-size: clamp(15px, 2.4vw, 18px);
  }

  body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-locked .label {
    width: min(100%, 150px);
    min-height: 38px;
    padding: 5px 6px;
    font-size: 9px;
    line-height: 1.02;
    letter-spacing: .03em;
  }

  body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-locked .label .hud-icon.coin,
  body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-locked .label .hud-icon.gem {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 1024px) and (max-height: 860px), (pointer: coarse) and (max-width: 1366px) and (max-height: 860px) {
  body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided {
    align-content: start;
    gap: 10px 8px;
    padding: 2px 4px 14px;
  }

  body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-locked {
    width: min(100%, 154px);
  }

  body.starter-skip-focus-active #lobby .vault-row.starter-skipped-guided .vault.starter-locked .chest {
    width: min(100%, 126px);
    height: min(100%, 126px);
  }
}

@media (max-width: 640px), (pointer: coarse) and (max-width: 820px) {
  body.starter-skip-focus-active #lobby .top {
    grid-template-columns: 72px minmax(50px, 60px) minmax(0, 1fr);
    grid-template-areas: "player heroes currencies";
    gap: 8px 6px;
  }
}

/* Pass rewards compact fit: keep both reward rows and claim buttons visible on small windows */
@media (max-width: 1024px), (pointer: coarse) and (max-width: 1366px) {
  #pass[data-pass-view="rewards"] #passRewardsPane {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 0;
    height: auto;
    overflow: hidden;
  }

  #pass[data-pass-view="rewards"] .pass-buy-col {
    grid-row: 1;
    width: 100%;
    flex: none;
    min-width: 0;
    margin-top: 0;
    align-self: stretch;
  }

  #pass[data-pass-view="rewards"] .pbc-card,
  #pass[data-pass-view="rewards"] .pbc-card.pbc-locked,
  #pass[data-pass-view="rewards"] .pbc-card.pbc-owned {
    min-height: 0;
    height: auto;
    padding: 12px 10px;
    gap: 6px;
    justify-content: flex-start;
    border-radius: 16px;
    background:
      linear-gradient(180deg, rgba(10, 8, 12, 0.94), rgba(8, 6, 10, 0.98)),
      var(--pass-ticket-image) center top / cover no-repeat;
  }

  #pass[data-pass-view="rewards"] .pbc-card::after {
    display: none;
  }

  #pass[data-pass-view="rewards"] .pbc-label,
  #pass[data-pass-view="rewards"] .pbc-sub {
    width: 100%;
    max-width: 100%;
    text-align: center;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-wrap: balance;
  }

  #pass[data-pass-view="rewards"] .pbc-label {
    margin-top: 0;
    font-size: 11px;
    line-height: 1.2;
  }

  #pass[data-pass-view="rewards"] .pbc-sub {
    font-size: 10px;
    line-height: 1.24;
  }

  #pass[data-pass-view="rewards"] #pbcActivate {
    width: 100%;
    max-width: 320px;
    min-height: 40px;
    margin: 2px auto 0;
    padding: 7px 10px;
    font-size: 11px;
    line-height: 1.12;
    white-space: normal;
    justify-content: center;
  }

  #pass[data-pass-view="rewards"] #pbcActivate .currency-inline {
    flex-wrap: wrap;
    justify-content: center;
  }

  #pass[data-pass-view="rewards"] .pass-track {
    grid-row: 2;
    min-height: clamp(194px, 31dvh, 248px);
    height: auto;
    margin: 0;
    padding: 10px 6px 8px;
    gap: 6px;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
  }

  #pass[data-pass-view="rewards"] .pass-track::before {
    left: 12px;
    right: 12px;
    height: 8px;
  }

  #pass[data-pass-view="rewards"] .pass-col {
    min-width: 74px;
    gap: 6px;
  }

  #pass[data-pass-view="rewards"] .pass-col.current {
    transform: none;
  }

  #pass[data-pass-view="rewards"] .pass-lv {
    padding: 4px 3px;
    font-size: 9px;
    line-height: 1.1;
  }

  #pass[data-pass-view="rewards"] .pass-lv-num {
    font-size: 11px;
  }

  #pass[data-pass-view="rewards"] .pass-lv-xp {
    font-size: 8px;
    letter-spacing: .04em;
  }

  #pass[data-pass-view="rewards"] .ptk-card {
    width: 74px;
    min-height: 86px;
    padding: 4px 4px 6px;
    gap: 4px;
    border-radius: 12px;
    display: grid;
    grid-template-rows: auto auto minmax(24px, auto) auto;
    align-content: start;
    justify-items: center;
    overflow: hidden;
  }

  #pass[data-pass-view="rewards"] .ptk-state,
  #pass[data-pass-view="rewards"] .ptk-v,
  #pass[data-pass-view="rewards"] .ptk-claim {
    width: 100%;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-wrap: balance;
  }

  #pass[data-pass-view="rewards"] .ptk-state {
    padding: 4px 5px;
    font-size: 6.7px;
    line-height: 1.12;
    letter-spacing: .08em;
  }

  #pass[data-pass-view="rewards"] .ptk-relic {
    width: 52px;
    height: 58px;
    border-radius: 16px;
  }

  #pass[data-pass-view="rewards"] .ptk-veins {
    left: 6px;
    right: 6px;
    top: 16px;
  }

  #pass[data-pass-view="rewards"] .ptk-veins::before {
    left: 5px;
    right: 10px;
    bottom: -24px;
  }

  #pass[data-pass-view="rewards"] .ptk-veins::after {
    right: 12px;
    top: -10px;
    bottom: -30px;
  }

  #pass[data-pass-view="rewards"] .ptk-core {
    width: 36px;
    height: 36px;
    margin-top: 2px;
    border-radius: 12px;
  }

  #pass[data-pass-view="rewards"] .ptk-box .ptk-core {
    width: 40px;
    height: 40px;
  }

  #pass[data-pass-view="rewards"] .ptk-hero .ptk-core {
    width: 42px;
    height: 42px;
  }

  #pass[data-pass-view="rewards"] .ptk-ic {
    font-size: 20px;
  }

  #pass[data-pass-view="rewards"] .ptk-coins .ptk-ic .currency-mark,
  #pass[data-pass-view="rewards"] .ptk-gems .ptk-ic .currency-mark {
    --currency-icon-limit: 36px;
  }

  #pass[data-pass-view="rewards"] .ptk-v {
    min-height: 2.3em;
    font-size: 7.5px;
    line-height: 1.12;
    letter-spacing: .04em;
  }

  #pass[data-pass-view="rewards"] .ptk-box .ptk-v {
    font-size: 7px;
    line-height: 1.12;
  }

  #pass[data-pass-view="rewards"] .ptk-hero-art {
    padding: 2px;
  }

  #pass[data-pass-view="rewards"] .ptk-claim {
    max-width: none;
    min-height: 22px;
    margin: 0;
    padding: 3px 4px;
    border-radius: 8px;
    font-size: 7px;
    line-height: 1.08;
    letter-spacing: .06em;
    position: relative;
    z-index: 1;
  }

  #pass[data-pass-view="rewards"] .ptk-check,
  #pass[data-pass-view="rewards"] .ptk-lock {
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    font-size: 9px;
  }

  #pass[data-pass-view="rewards"] .pass-claim-all {
    grid-row: 3;
    position: static;
    right: auto;
    left: auto;
    bottom: auto;
    transform: none;
    margin: 0 auto;
    width: min(100%, 240px);
    min-height: 40px;
    padding: 8px 12px;
    font-size: 11px;
    line-height: 1.1;
  }
}

@media (max-width: 640px), (pointer: coarse) and (max-width: 820px) {
  #pass[data-pass-view="rewards"] .pass-track {
    min-height: clamp(182px, 28dvh, 220px);
    padding: 8px 4px 6px;
    gap: 5px;
  }

  #pass[data-pass-view="rewards"] .pass-col {
    min-width: 68px;
    gap: 5px;
  }

  #pass[data-pass-view="rewards"] .ptk-card {
    width: 68px;
    min-height: 80px;
    padding: 4px 3px 5px;
    gap: 3px;
  }

  #pass[data-pass-view="rewards"] .ptk-state {
    font-size: 6.2px;
    letter-spacing: .06em;
  }

  #pass[data-pass-view="rewards"] .ptk-relic {
    width: 48px;
    height: 54px;
  }

  #pass[data-pass-view="rewards"] .ptk-core {
    width: 34px;
    height: 34px;
  }

  #pass[data-pass-view="rewards"] .ptk-box .ptk-core,
  #pass[data-pass-view="rewards"] .ptk-hero .ptk-core {
    width: 38px;
    height: 38px;
  }

  #pass[data-pass-view="rewards"] .ptk-ic {
    font-size: 18px;
  }

  #pass[data-pass-view="rewards"] .ptk-coins .ptk-ic .currency-mark,
  #pass[data-pass-view="rewards"] .ptk-gems .ptk-ic .currency-mark {
    --currency-icon-limit: 34px;
  }

  #pass[data-pass-view="rewards"] .ptk-v {
    min-height: 2.2em;
    font-size: 6.8px;
  }

  #pass[data-pass-view="rewards"] .ptk-box .ptk-v {
    font-size: 6.4px;
  }

  #pass[data-pass-view="rewards"] .ptk-claim {
    min-height: 20px;
    font-size: 6.4px;
    padding: 2px 3px;
  }

  #pass[data-pass-view="rewards"] .pass-lv {
    padding: 3px 2px;
    font-size: 8px;
  }

  #pass[data-pass-view="rewards"] .pass-lv-num {
    font-size: 10px;
  }

  #pass[data-pass-view="rewards"] .pass-lv-xp {
    font-size: 7px;
  }

  #pass[data-pass-view="rewards"] .pbc-card,
  #pass[data-pass-view="rewards"] .pbc-card.pbc-locked,
  #pass[data-pass-view="rewards"] .pbc-card.pbc-owned {
    padding: 10px 8px;
    gap: 5px;
    border-radius: 14px;
  }

  #pass[data-pass-view="rewards"] .pbc-label {
    font-size: 10px;
  }

  #pass[data-pass-view="rewards"] .pbc-sub {
    font-size: 9px;
  }

  #pass[data-pass-view="rewards"] #pbcActivate {
    min-height: 36px;
    font-size: 10px;
    padding: 6px 8px;
  }

  #pass[data-pass-view="rewards"] .pass-claim-all {
    min-height: 36px;
    font-size: 10px;
    padding: 7px 10px;
  }
}

/* Только узкие окна: иначе при низкой высоте (devtools, сплит) перебивались широкие карточки ПК */
@media (max-height: 820px) and (max-width: 1024px) {
  #pass[data-pass-view="rewards"] #passRewardsPane {
    gap: 6px;
  }

  #pass[data-pass-view="rewards"] .pass-track {
    min-height: clamp(170px, 25dvh, 206px);
    padding: 8px 4px 6px;
    gap: 5px;
  }

  #pass[data-pass-view="rewards"] .pass-col {
    min-width: 64px;
  }

  #pass[data-pass-view="rewards"] .ptk-card {
    width: 64px;
    min-height: 76px;
    padding: 3px;
    gap: 3px;
  }

  #pass[data-pass-view="rewards"] .ptk-state {
    font-size: 5.8px;
    padding: 3px 4px;
  }

  #pass[data-pass-view="rewards"] .ptk-relic {
    width: 44px;
    height: 50px;
  }

  #pass[data-pass-view="rewards"] .ptk-core {
    width: 32px;
    height: 32px;
  }

  #pass[data-pass-view="rewards"] .ptk-box .ptk-core,
  #pass[data-pass-view="rewards"] .ptk-hero .ptk-core {
    width: 36px;
    height: 36px;
  }

  #pass[data-pass-view="rewards"] .ptk-ic {
    font-size: 16px;
  }

  #pass[data-pass-view="rewards"] .ptk-coins .ptk-ic .currency-mark,
  #pass[data-pass-view="rewards"] .ptk-gems .ptk-ic .currency-mark {
    --currency-icon-limit: 30px;
  }

  #pass[data-pass-view="rewards"] .ptk-v {
    min-height: 2em;
    font-size: 6.2px;
    line-height: 1.08;
  }

  #pass[data-pass-view="rewards"] .ptk-box .ptk-v {
    font-size: 5.9px;
  }

  #pass[data-pass-view="rewards"] .ptk-claim {
    min-height: 18px;
    font-size: 5.8px;
    padding: 2px 3px;
  }

  #pass[data-pass-view="rewards"] .pass-lv {
    padding: 2px;
  }

  #pass[data-pass-view="rewards"] .pbc-card,
  #pass[data-pass-view="rewards"] .pbc-card.pbc-locked,
  #pass[data-pass-view="rewards"] .pbc-card.pbc-owned {
    padding: 8px 7px;
    gap: 4px;
  }

  #pass[data-pass-view="rewards"] .pbc-label {
    font-size: 9px;
  }

  #pass[data-pass-view="rewards"] .pbc-sub {
    font-size: 8px;
    line-height: 1.2;
  }

  #pass[data-pass-view="rewards"] #pbcActivate,
  #pass[data-pass-view="rewards"] .pass-claim-all {
    min-height: 34px;
    font-size: 9px;
    padding: 6px 8px;
  }
}

/* Hide the visible side scrollbar in the public leaderboard profile while keeping touch/mouse scrolling. */
#leaderProfile {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#leaderProfile::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Keep leaderboard rival cards readable on compact device windows without text/button overlap. */
.pf-leaderboard-card,
.pf-leaderboard-copy,
.pf-leaderboard-side {
  min-width: 0;
}

.pf-leaderboard-name {
  white-space: normal;
  line-height: 1.16;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pf-leaderboard-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 8px;
  min-width: 0;
  line-height: 1.22;
}

.pf-leaderboard-meta > span,
.pf-leaderboard-side > div {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.d-grid {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.d-grid::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

@media (max-width: 900px) {
  #profile .pf-leaderboard-card {
    grid-template-columns: 54px 48px minmax(0, 1fr);
    gap: 7px;
    padding: 8px;
  }

  #profile .pf-leaderboard-rank {
    font-size: 17px;
  }

  #profile .pf-leaderboard-avatar {
    width: 48px;
    height: 48px;
    border-radius: 11px;
  }

  #profile .pf-leaderboard-name {
    font-size: 12px;
  }

  #profile .pf-leaderboard-meta,
  #profile .pf-leaderboard-side,
  #profile .pf-leaderboard-side > div {
    font-size: 9px;
  }

  #profile .pf-leaderboard-side {
    grid-column: 2 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 4px 8px;
    text-align: left;
  }

  #profile .pf-leaderboard-you {
    justify-self: start;
  }

  #profile .pf-leaderboard-attack {
    min-width: 0;
    min-height: 40px;
    padding: 7px 8px;
    font-size: 10px;
    line-height: 1.08;
    white-space: normal;
  }
}

@media (max-width: 560px) {
  #profile .pf-leaderboard-side {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }

  #profile .pf-leaderboard-meta {
    gap: 2px 6px;
  }
}

.pf-leaderboard-forecast {
  font-weight: 700;
}

.pf-leaderboard-forecast.good {
  color: #6cf08e;
}

.pf-leaderboard-forecast.warn {
  color: #ff9a2e;
}

.pf-leaderboard-forecast.tie {
  color: #c8d4e8;
  font-weight: 600;
}

@media (min-width: 1280px) {
  #pass {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    padding: 18px;
  }

  #pass .pass-header {
    gap: 10px 12px;
    padding: 6px 8px;
  }

  #pass .pass-season {
    padding: 10px 78px;
  }

  #pass .ps-sub {
    font-size: 12px;
  }

  #pass .ps-title {
    font-size: 17px;
  }

  #pass .ptab {
    padding: 11px 20px;
    font-size: 13px;
  }

  #pass .ppb-fill {
    height: 34px;
  }

  #pass .ppb-text {
    font-size: 13px;
  }

  #pass .ppb-level {
    width: 48px;
    height: 48px;
  }

  #pass #passRewardsPane {
    min-height: 0;
    height: 100%;
    gap: 16px;
    align-items: stretch;
  }

  #pass .pass-buy-col {
    flex-basis: 204px;
  }

  #pass .pbc-card {
    min-height: 438px;
    max-width: 196px;
    width: 100%;
    margin-inline: auto;
    box-sizing: border-box;
    padding: clamp(24px, 5vh, 48px) 14px 28px;
    border-radius: 24px;
    background-size: 100% 100%, min(90%, 196px) auto;
    background-position: center, 50% calc(100% - 124px);
    background-repeat: no-repeat, no-repeat;
  }

  #pass .pass-track {
    min-height: 0;
    height: 100%;
    gap: 14px;
    padding: 18px;
    border-radius: 30px;
  }

  #pass .pass-col {
    height: 100%;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 10px;
    min-width: 208px;
  }

  #pass .pass-row {
    min-height: 0;
    height: 100%;
    align-items: stretch;
  }

  #pass .ptk-card {
    height: 100%;
    min-height: 0;
    width: 208px;
    box-sizing: border-box;
    padding: 11px 9px 10px;
    justify-content: space-between;
    gap: 6px;
  }

  #pass .ptk-state {
    font-size: 9px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    line-height: 1.15;
    letter-spacing: .1em;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-wrap: balance;
  }

  #pass .ptk-relic {
    width: min(200px, 96%);
    height: auto;
    aspect-ratio: 1 / 1.08;
    min-height: 148px;
    max-height: 82%;
    flex: 1 1 auto;
  }

  #pass .ptk-core {
    width: min(158px, 82%);
    height: min(158px, 82%);
  }

  #pass .ptk-ic {
    font-size: clamp(42px, 2.8vw, 58px);
  }

  #pass .ptk-coins .ptk-ic .currency-mark,
  #pass .ptk-gems .ptk-ic .currency-mark {
    --currency-icon-limit: 86px;
  }

  #pass .ptk-box .ptk-core {
    width: min(168px, 88%);
    height: min(168px, 88%);
  }

  #pass .ptk-hero .ptk-core {
    width: min(158px, 86%);
    height: min(158px, 86%);
  }

  #pass .ptk-v {
    font-size: 11px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    padding: 0 4px;
    min-height: auto;
    line-height: 1.2;
    letter-spacing: .04em;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-wrap: balance;
  }

  #pass .ptk-claim {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-height: 32px;
    padding: 7px 8px;
    font-size: 9px;
    line-height: 1.15;
    white-space: normal;
    text-align: center;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-wrap: balance;
  }

  #pass .pass-lv {
    padding: 8px 6px;
    min-width: 0;
    max-width: 100%;
    text-align: center;
    box-sizing: border-box;
  }

  #pass .pass-lv-num {
    font-size: 20px;
    line-height: 1.1;
  }

  #pass .pass-lv-xp {
    font-size: 10px;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  #pass #pbcActivate {
    max-width: 100%;
    box-sizing: border-box;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    white-space: normal;
    text-wrap: wrap;
    line-height: 1.15;
    overflow-wrap: normal;
    word-break: normal;
    font-size: clamp(9px, 0.5vw + 8px, 12px);
    padding: 9px 10px 11px;
    letter-spacing: .05em;
  }
  #pass #pbcActivate .pbc-activate-sep {
    display: none;
  }
  #pass #pbcActivate .pbc-activate-label {
    white-space: nowrap;
  }
  #pass #pbcActivate .pbc-activate-price {
    white-space: nowrap;
  }

  #pass .pbc-label,
  #pass .pbc-sub {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-wrap: balance;
  }

  /* Та же специфичность, что у компактных правил #pass[data-pass-view="rewards"], иначе каскад оставляет узкие карточки */
  #pass[data-pass-view="rewards"] .pass-col {
    height: 100%;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 10px;
    min-width: 208px;
  }

  #pass[data-pass-view="rewards"] .ptk-card {
    height: 100%;
    min-height: 0;
    width: 208px;
    box-sizing: border-box;
    padding: 11px 9px 10px;
    justify-content: space-between;
    gap: 6px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    align-content: unset;
    justify-items: unset;
    grid-template-rows: none;
    overflow: hidden;
  }

  #pass[data-pass-view="rewards"] .ptk-relic {
    width: min(200px, 96%);
    height: auto;
    aspect-ratio: 1 / 1.08;
    min-height: 148px;
    max-height: 82%;
    flex: 1 1 auto;
  }

  #pass[data-pass-view="rewards"] .ptk-core {
    width: min(158px, 82%);
    height: min(158px, 82%);
  }

  #pass[data-pass-view="rewards"] .ptk-ic {
    font-size: clamp(42px, 2.8vw, 58px);
  }

  #pass[data-pass-view="rewards"] .ptk-coins .ptk-ic .currency-mark,
  #pass[data-pass-view="rewards"] .ptk-gems .ptk-ic .currency-mark {
    --currency-icon-limit: 86px;
  }

  #pass[data-pass-view="rewards"] .ptk-state {
    font-size: 9px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    line-height: 1.15;
    letter-spacing: .1em;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-wrap: balance;
  }

  #pass[data-pass-view="rewards"] .ptk-v {
    font-size: 11px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    padding: 0 4px;
    min-height: auto;
    line-height: 1.2;
    letter-spacing: .04em;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-wrap: balance;
  }

  #pass[data-pass-view="rewards"] .ptk-claim {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-height: 32px;
    padding: 7px 8px;
    font-size: 9px;
    line-height: 1.15;
    white-space: normal;
    text-align: center;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-wrap: balance;
  }
}

body.yandex-debug-ads-active .modal.settings {
  height: calc(var(--yandex-debug-safe-height) - 24px);
  max-height: calc(var(--yandex-debug-safe-height) - 24px);
}

body.yandex-debug-ads-active #pass #passRewardsPane,
body.yandex-debug-ads-active #pass[data-pass-view="rewards"] #passRewardsPane {
  min-height: 0;
  height: auto;
}

/* Upside Down Pass: keep rewards, text and action controls inside the safe viewport */
#pass[data-pass-view="rewards"] {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

#pass[data-pass-view="rewards"] #passRewardsPane {
  display: grid;
  grid-template-columns: minmax(136px, 212px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: stretch;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding-bottom: 0;
}

#pass[data-pass-view="rewards"] .pass-buy-col {
  grid-column: 1;
  grid-row: 1 / span 2;
  min-width: 0;
  width: 100%;
  align-self: stretch;
}

#pass[data-pass-view="rewards"] .pass-track {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding-bottom: clamp(12px, 1.8vh, 22px);
}

#pass[data-pass-view="rewards"] .pass-claim-all {
  position: static;
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  align-self: end;
  margin: 0;
  width: min(100%, 280px);
  max-width: 100%;
}

#pass[data-pass-view="rewards"] .pass-buy-col,
#pass[data-pass-view="rewards"] .pass-track,
#pass[data-pass-view="rewards"] .pass-col,
#pass[data-pass-view="rewards"] .pass-row,
#pass[data-pass-view="rewards"] .ptk-card,
#pass[data-pass-view="rewards"] .pass-lv,
#pass[data-pass-view="rewards"] .pbc-card {
  min-width: 0;
}

#pass[data-pass-view="rewards"] .pass-col {
  min-width: clamp(84px, 9vw, 170px);
}

#pass[data-pass-view="rewards"] .ptk-card {
  width: clamp(84px, 9vw, 170px);
  min-height: clamp(136px, 19vh, 206px);
  padding: clamp(8px, 1vw, 16px) clamp(6px, 0.8vw, 10px) clamp(10px, 1.1vw, 18px);
}

#pass[data-pass-view="rewards"] .ptk-state {
  font-size: clamp(8px, 0.55vw, 11px);
  padding: clamp(6px, 0.55vw, 7px) clamp(7px, 0.7vw, 10px);
}

#pass[data-pass-view="rewards"] .ptk-relic {
  width: clamp(64px, 6.4vw, 112px);
  height: clamp(72px, 7.8vw, 130px);
}

#pass[data-pass-view="rewards"] .ptk-core {
  width: clamp(46px, 4.9vw, 86px);
  height: clamp(46px, 4.9vw, 86px);
}

#pass[data-pass-view="rewards"] .ptk-box .ptk-core,
#pass[data-pass-view="rewards"] .ptk-hero .ptk-core {
  width: clamp(58px, 5.5vw, 94px);
  height: clamp(58px, 5.5vw, 94px);
}

#pass[data-pass-view="rewards"] .ptk-ic {
  font-size: clamp(20px, 2.2vw, 38px);
}

#pass[data-pass-view="rewards"] .ptk-coins .ptk-ic .currency-mark,
#pass[data-pass-view="rewards"] .ptk-gems .ptk-ic .currency-mark {
  --currency-icon-limit: clamp(40px, 4.2vw, 62px);
}

#pass[data-pass-view="rewards"] .ptk-v {
  font-size: clamp(9px, 0.72vw, 14px);
  min-height: 3.3em;
}

#pass[data-pass-view="rewards"] .ptk-claim {
  max-width: 100%;
  min-height: clamp(24px, 2.4vw, 32px);
  font-size: clamp(8px, 0.55vw, 10px);
}

#pass[data-pass-view="rewards"] .pass-lv {
  padding: clamp(6px, 0.7vw, 10px);
}

#pass[data-pass-view="rewards"] .pass-lv-num {
  font-size: clamp(14px, 1.1vw, 24px);
}

#pass[data-pass-view="rewards"] .pass-lv-xp {
  font-size: clamp(8px, 0.55vw, 11px);
}

#pass[data-pass-view="rewards"] .pbc-card {
  min-height: 0;
  height: 100%;
  max-width: min(100%, 204px);
  padding: clamp(18px, 4vh, 40px) clamp(10px, 1vw, 16px) clamp(18px, 2.4vh, 28px);
}

#pass[data-pass-view="rewards"] .pbc-label,
#pass[data-pass-view="rewards"] .pbc-sub,
#pass[data-pass-view="rewards"] .ptk-state,
#pass[data-pass-view="rewards"] .ptk-v,
#pass[data-pass-view="rewards"] .ptk-claim,
#pass[data-pass-view="rewards"] .pass-lv-xp {
  overflow-wrap: anywhere;
  word-break: break-word;
  text-wrap: balance;
}

@media (max-width: 900px) {
  #pass[data-pass-view="rewards"] #passRewardsPane {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  #pass[data-pass-view="rewards"] .pass-buy-col {
    grid-column: 1;
    grid-row: 1;
  }

  #pass[data-pass-view="rewards"] .pass-track {
    grid-column: 1;
    grid-row: 2;
    min-height: clamp(224px, 36dvh, 420px);
  }

  #pass[data-pass-view="rewards"] .pass-claim-all {
    grid-column: 1;
    grid-row: 3;
    justify-self: center;
    width: min(100%, 320px);
  }

  #pass[data-pass-view="rewards"] .pbc-card {
    max-width: none;
    height: auto;
  }
}

body.yandex-debug-ads-active #pass[data-pass-view="rewards"] #passRewardsPane {
  grid-template-columns: minmax(132px, 196px) minmax(0, 1fr);
  gap: clamp(10px, 1.1vw, 16px);
}

body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .pass-track {
  padding-inline: clamp(8px, 1vw, 18px);
}

body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .pass-col {
  min-width: clamp(74px, 8vw, 150px);
}

body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .ptk-card {
  width: clamp(74px, 8vw, 150px);
  min-height: clamp(124px, 16vh, 188px);
}

body.yandex-debug-ads-active #pass #passQuestsPane {
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px) + var(--yandex-debug-bottom-inset));
}

/* Upside Down Pass: keep the rewards rail wide and the premium ticket readable across devices */
#pass[data-pass-view="rewards"] #passRewardsPane {
  grid-template-columns: minmax(172px, 244px) minmax(0, 1fr);
  gap: clamp(14px, 1.35vw, 22px);
  align-items: stretch;
}

#pass[data-pass-view="rewards"] .pass-progress-bar {
  padding-bottom: clamp(14px, 1.7vh, 22px);
}

#pass[data-pass-view="rewards"] .pass-track {
  min-height: clamp(430px, 54vh, 620px);
  padding: clamp(18px, 1.55vw, 24px) clamp(16px, 1.4vw, 22px) clamp(18px, 1.45vw, 24px);
  gap: clamp(12px, 0.95vw, 18px);
  align-items: flex-start;
  border-radius: 32px;
  border-color: rgba(194, 76, 57, 0.24);
  background:
    linear-gradient(180deg, rgba(39, 13, 15, 0.9), rgba(13, 7, 9, 0.96)),
    radial-gradient(circle at 50% 0, rgba(234, 98, 68, 0.12), transparent 74%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 18px 34px rgba(0,0,0,.24),
    0 0 0 1px rgba(255, 118, 86, 0.04);
}

#pass[data-pass-view="rewards"] .pass-col {
  height: auto;
  grid-template-rows: minmax(0, auto) auto minmax(0, auto);
  align-items: start;
  justify-items: center;
  min-width: clamp(92px, 6.7vw, 126px);
  gap: clamp(10px, 0.9vh, 14px);
}

#pass[data-pass-view="rewards"] .pass-row {
  height: auto;
  min-height: auto;
  width: 100%;
  align-items: stretch;
}

#pass[data-pass-view="rewards"] .ptk-card {
  display: grid;
  grid-template-rows: auto minmax(40px, 1fr) minmax(2.2em, auto) auto;
  align-items: start;
  justify-items: center;
  width: clamp(92px, 6.7vw, 126px);
  min-height: clamp(96px, 10.4vh, 120px);
  padding: clamp(7px, 0.52vw, 9px) clamp(6px, 0.5vw, 8px) clamp(8px, 0.62vw, 10px);
  gap: clamp(4px, 0.38vw, 6px);
  border-radius: 22px;
}

#pass[data-pass-view="rewards"] .ptk-relic {
  width: clamp(48px, 3.9vw, 64px);
  height: clamp(48px, 4vw, 66px);
  display: grid;
  place-items: center;
  align-self: center;
  justify-self: center;
  margin-inline: auto;
}

#pass[data-pass-view="rewards"] .ptk-core {
  width: clamp(36px, 3vw, 48px);
  height: clamp(36px, 3vw, 48px);
  align-self: center;
  justify-self: center;
  margin: 0 auto;
}

#pass[data-pass-view="rewards"] .ptk-box .ptk-core,
#pass[data-pass-view="rewards"] .ptk-hero .ptk-core {
  width: clamp(42px, 3.35vw, 58px);
  height: clamp(42px, 3.35vw, 58px);
}

#pass[data-pass-view="rewards"] .ptk-state {
  font-size: clamp(7px, 0.46vw, 9.4px);
  line-height: 1.08;
  padding: clamp(5px, 0.42vw, 6px) clamp(6px, 0.52vw, 8px);
  align-self: start;
  justify-self: stretch;
  text-align: center;
}

#pass[data-pass-view="rewards"] .ptk-v {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0;
  min-height: 2em;
  padding: 0 1px;
  line-height: 1.12;
  font-size: clamp(7.4px, 0.5vw, 9px);
  font-weight: 800;
  letter-spacing: .03em;
  text-align: center;
  text-transform: none;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-wrap: balance;
}

#pass[data-pass-view="rewards"] .ptk-hover-tip {
  display: none;
}

#pass[data-pass-view="rewards"] .ptk-box .ptk-v,
#pass[data-pass-view="rewards"] .ptk-hero .ptk-v {
  font-size: clamp(7.2px, 0.5vw, 8.8px);
  line-height: 1.08;
}

@media (hover: hover) and (pointer: fine) and (min-width: 1025px) {
  #pass[data-pass-view="rewards"] .ptk-card {
    overflow: visible;
  }

  #pass[data-pass-view="rewards"] .ptk-relic {
    cursor: help;
  }

  #pass[data-pass-view="rewards"] .ptk-hover-tip {
    position: absolute;
    left: 50%;
    top: 54%;
    width: min(calc(100% - 14px), 168px);
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 186, 133, 0.34);
    background:
      linear-gradient(180deg, rgba(49, 18, 18, 0.96), rgba(17, 8, 10, 0.98)),
      radial-gradient(circle at 50% 0, rgba(255, 134, 88, 0.16), transparent 72%);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.38), 0 0 18px rgba(231, 86, 62, 0.16);
    backdrop-filter: blur(10px);
    text-align: center;
    transform: translate(-50%, -48%) scale(0.94);
    transform-origin: center center;
    opacity: 0;
    pointer-events: none;
    z-index: 5;
    transition: opacity 0.18s ease, transform 0.18s ease;
  }

  #pass[data-pass-view="rewards"] .ptk-hover-tip__level {
    font-size: clamp(9px, 0.58vw, 11px);
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #ffbe9d;
  }

  #pass[data-pass-view="rewards"] .ptk-hover-tip__title {
    font-size: clamp(11px, 0.72vw, 13px);
    line-height: 1.2;
    font-weight: 900;
    color: #fff2ea;
    overflow-wrap: anywhere;
    text-wrap: balance;
  }

  #pass[data-pass-view="rewards"] .ptk-hover-tip__amount {
    font-size: clamp(13px, 0.88vw, 16px);
    line-height: 1.1;
    font-weight: 900;
    color: #ffd185;
    overflow-wrap: anywhere;
  }

  #pass[data-pass-view="rewards"] .ptk-relic:hover + .ptk-hover-tip,
  #pass[data-pass-view="rewards"] .ptk-relic:focus-visible + .ptk-hover-tip {
    opacity: 1;
    transform: translate(-50%, -56%) scale(1);
  }
}

#pass[data-pass-view="rewards"] .ptk-box-art {
  width: 100%;
  height: 100%;
  object-position: center center;
}

#pass[data-pass-view="rewards"] .ptk-hero-art {
  width: 100%;
  height: 100%;
  object-position: center center;
  padding: 2px;
}

#pass[data-pass-view="rewards"] .pass-lv {
  width: min(100%, calc(clamp(92px, 6.7vw, 126px) - 2px));
  min-height: clamp(42px, 4.25vh, 50px);
  justify-self: center;
  align-self: center;
  padding: clamp(6px, 0.56vw, 8px) clamp(6px, 0.58vw, 10px);
  border-radius: 18px;
}

#pass[data-pass-view="rewards"] .pass-lv-num {
  font-size: clamp(14px, 0.96vw, 18px);
}

#pass[data-pass-view="rewards"] .pass-lv-xp {
  font-size: clamp(7.4px, 0.46vw, 9px);
}

@media (pointer: fine) and (min-width: 1025px) {
  #pass[data-pass-view="rewards"] .pass-track {
    min-height: min(100%, clamp(392px, 50vh, 560px));
    padding: clamp(12px, 1vw, 16px) clamp(14px, 1.2vw, 20px) clamp(14px, 1.2vh, 18px);
    gap: clamp(10px, 0.8vw, 14px);
  }

  #pass[data-pass-view="rewards"] .pass-col {
    min-width: clamp(90px, 6.3vw, 122px);
    gap: clamp(8px, 0.72vh, 11px);
  }

  #pass[data-pass-view="rewards"] .ptk-card {
    width: clamp(90px, 6.3vw, 122px);
    min-height: clamp(90px, 9.3vh, 112px);
    padding: clamp(6px, 0.46vw, 8px) clamp(6px, 0.46vw, 8px) clamp(7px, 0.54vw, 9px);
    gap: clamp(3px, 0.3vw, 5px);
  }

  #pass[data-pass-view="rewards"] .pass-row.free .ptk-card.avail {
    padding-top: clamp(12px, 1.2vh, 16px);
  }

  #pass[data-pass-view="rewards"] .pass-row.free .ptk-card.avail .ptk-state {
    display: none;
  }

  #pass[data-pass-view="rewards"] .pass-row.free .ptk-card.avail .ptk-claim {
    position: absolute;
    top: clamp(8px, 0.8vh, 12px);
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translateX(-50%);
    width: calc(100% - clamp(14px, 1vw, 18px));
    max-width: calc(100% - clamp(14px, 1vw, 18px));
    margin: 0;
    min-height: clamp(20px, 1.85vh, 24px);
    padding: 3px clamp(5px, 0.42vw, 7px);
    border-radius: 999px;
    font-size: clamp(6.6px, 0.46vw, 8.2px);
    line-height: 1.05;
    letter-spacing: .08em;
    z-index: 3;
  }

  #pass[data-pass-view="rewards"] .pass-row.free .ptk-card.avail .ptk-relic {
    margin-top: clamp(18px, 1.55vh, 24px);
  }

  #pass[data-pass-view="rewards"] .pass-lv {
    width: min(100%, calc(clamp(90px, 6.3vw, 122px) - 2px));
    min-height: clamp(38px, 3.8vh, 46px);
    padding: clamp(5px, 0.48vw, 7px) clamp(6px, 0.52vw, 8px);
  }
}

#pass[data-pass-view="rewards"] .pbc-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 0;
  height: 100%;
  max-width: none;
  padding: clamp(18px, 2.3vh, 28px) clamp(12px, 1.05vw, 18px) clamp(18px, 2.3vh, 24px);
  gap: clamp(10px, 1.1vh, 16px);
  border-radius: 28px;
  border-color: rgba(201, 79, 60, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 16px 30px rgba(0,0,0,.26);
  background:
    linear-gradient(180deg, rgba(12, 8, 12, 0.88), rgba(8, 6, 10, 0.97)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    var(--pass-ticket-image) center top / min(100%, 182px) auto no-repeat;
}

#pass[data-pass-view="rewards"] .pbc-label {
  margin-top: 0;
  width: 100%;
  font-size: clamp(11px, 0.86vw, 14px);
  line-height: 1.22;
}

#pass[data-pass-view="rewards"] .pbc-sub {
  width: 100%;
  font-size: clamp(9.4px, 0.7vw, 11.2px);
  line-height: 1.32;
}

#pass[data-pass-view="rewards"] #pbcActivate {
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: clamp(40px, 4.4vh, 50px);
  margin-top: auto;
  padding: 10px 12px;
  white-space: normal;
  text-wrap: balance;
  line-height: 1.12;
}

#pass[data-pass-view="rewards"] #pbcActivate .pbc-activate-sep {
  display: none;
}

#pass[data-pass-view="rewards"] #pbcActivate .pbc-activate-label,
#pass[data-pass-view="rewards"] #pbcActivate .pbc-activate-price,
#pass[data-pass-view="rewards"] #pbcActivate .pbc-activate-price .currency-inline {
  justify-content: center;
  text-align: center;
}

@media (max-width: 900px) and (min-width: 561px) {
  #pass[data-pass-view="rewards"] #passRewardsPane {
    grid-template-columns: minmax(118px, 164px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }

  #pass[data-pass-view="rewards"] .pass-buy-col {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  #pass[data-pass-view="rewards"] .pass-track {
    grid-column: 2;
    grid-row: 1;
    min-height: clamp(308px, 42dvh, 446px);
    padding: 12px 10px 14px;
  }

  #pass[data-pass-view="rewards"] .pass-claim-all {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }

  #pass[data-pass-view="rewards"] .pass-col {
    min-width: clamp(88px, 14vw, 114px);
  }

  #pass[data-pass-view="rewards"] .ptk-card {
    width: clamp(88px, 14vw, 114px);
    min-height: clamp(106px, 14vh, 134px);
  }

}

@media (max-width: 560px) {
  #pass[data-pass-view="rewards"] #passRewardsPane {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 10px;
  }

  #pass[data-pass-view="rewards"] .pass-buy-col {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  #pass[data-pass-view="rewards"] .pass-track {
    grid-column: 1;
    grid-row: 2;
    min-height: clamp(236px, 35dvh, 320px);
    padding: 10px 8px 12px;
    gap: 8px;
  }

  #pass[data-pass-view="rewards"] .pass-claim-all {
    grid-column: 1;
    grid-row: 3;
    justify-self: center;
    width: min(100%, 320px);
  }

  #pass[data-pass-view="rewards"] .pbc-card {
    height: auto;
    min-height: 0;
    padding: 12px;
    gap: 0;
    border-radius: 22px;
    background:
      linear-gradient(180deg, rgba(18, 8, 10, 0.96), rgba(10, 6, 8, 0.98)),
      linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
  }

  #pass[data-pass-view="rewards"] .pbc-label,
  #pass[data-pass-view="rewards"] .pbc-sub {
    display: none;
  }

  #pass[data-pass-view="rewards"] #pbcActivate {
    min-height: 56px;
    margin-top: 0;
    padding: 12px 14px;
  }

  #pass[data-pass-view="rewards"] #pbcActivate .pbc-activate-label {
    font-size: 15px;
    line-height: 1.05;
  }

  #pass[data-pass-view="rewards"] #pbcActivate .pbc-activate-price,
  #pass[data-pass-view="rewards"] #pbcActivate .pbc-activate-price .currency-inline {
    font-size: 14px;
    line-height: 1.05;
  }
}

@media (max-width: 640px), (pointer: coarse) and (max-width: 820px) {
  #pass[data-pass-view="rewards"] #passRewardsPane {
    gap: 10px;
  }

  #pass[data-pass-view="rewards"] .pass-track {
    min-height: clamp(228px, 34dvh, 312px);
    padding: 10px 8px 12px;
    gap: 8px;
  }

  #pass[data-pass-view="rewards"] .ptk-card.avail {
    padding-top: 30px;
  }

  #pass[data-pass-view="rewards"] .ptk-card.avail .ptk-state {
    display: none;
  }

  #pass[data-pass-view="rewards"] .ptk-card.avail .ptk-claim {
    position: absolute;
    top: 8px;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translateX(-50%);
    width: calc(100% - 14px);
    max-width: calc(100% - 14px);
    margin: 0;
    min-height: 24px;
    padding: 4px 6px;
    border-radius: 999px;
    font-size: 7px;
    line-height: 1.08;
    letter-spacing: .08em;
    z-index: 3;
    touch-action: manipulation;
  }

  #pass[data-pass-view="rewards"] .ptk-card.avail .ptk-relic {
    margin-top: 4px;
  }

  #pass[data-pass-view="rewards"] .pass-buy-col {
    min-width: 0;
  }

  #pass[data-pass-view="rewards"] .pbc-card.pbc-locked {
    min-height: 0;
    padding: 12px;
    gap: 0;
    border-radius: 22px;
    background:
      linear-gradient(180deg, rgba(18, 8, 10, 0.96), rgba(10, 6, 8, 0.98)),
      linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
  }

  #pass[data-pass-view="rewards"] .pbc-card.pbc-locked .pbc-label,
  #pass[data-pass-view="rewards"] .pbc-card.pbc-locked .pbc-sub {
    display: none;
  }

  #pass[data-pass-view="rewards"] .pbc-card.pbc-locked #pbcActivate {
    min-height: 56px;
    margin-top: 0;
    padding: 12px 14px;
  }

  #pass[data-pass-view="rewards"] .pbc-card.pbc-locked #pbcActivate .pbc-activate-label {
    font-size: 15px;
    line-height: 1.05;
  }

  #pass[data-pass-view="rewards"] .pbc-card.pbc-locked #pbcActivate .pbc-activate-price,
  #pass[data-pass-view="rewards"] .pbc-card.pbc-locked #pbcActivate .pbc-activate-price .currency-inline {
    font-size: 14px;
    line-height: 1.05;
  }
}

body.yandex-debug-ads-active #pass[data-pass-view="rewards"] #passRewardsPane {
  grid-template-columns: minmax(132px, 176px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
}

body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .pass-progress-bar {
  padding-bottom: 18px;
}

body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .pass-buy-col {
  grid-column: 1;
  grid-row: 1 / span 2;
}

body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .pass-track {
  grid-column: 2;
  grid-row: 1;
  min-height: clamp(360px, calc(var(--yandex-debug-safe-height) - 252px), 520px);
  padding: 16px 12px 18px;
  align-items: flex-start;
}

body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .pass-col {
  min-width: clamp(84px, 7.2vw, 110px);
  gap: 12px;
  align-content: start;
}

body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .ptk-card {
  width: clamp(84px, 7.2vw, 110px);
  min-height: clamp(98px, 10.6vh, 124px);
  padding: 8px 6px 10px;
  gap: 6px;
  height: auto;
}

body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .ptk-state {
  font-size: clamp(6.4px, 0.46vw, 8.6px);
  padding: 4px 5px;
}

body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .ptk-relic {
  width: clamp(48px, 4.4vw, 60px);
  height: clamp(48px, 4.6vw, 62px);
}

body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .ptk-core {
  width: clamp(36px, 3.2vw, 46px);
  height: clamp(36px, 3.2vw, 46px);
}

body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .ptk-box .ptk-core,
body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .ptk-hero .ptk-core {
  width: clamp(42px, 3.6vw, 50px);
  height: clamp(42px, 3.6vw, 50px);
}

body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .ptk-ic {
  font-size: clamp(20px, 2.2vw, 34px);
}

body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .ptk-coins .ptk-ic .currency-mark,
body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .ptk-gems .ptk-ic .currency-mark {
  --currency-icon-limit: clamp(34px, 4vw, 46px);
}

body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .ptk-v {
  min-height: 2.15em;
  font-size: clamp(7.2px, 0.5vw, 8.8px);
  line-height: 1.08;
}

body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .ptk-box .ptk-v,
body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .ptk-hero .ptk-v {
  font-size: clamp(7px, 0.48vw, 8.4px);
}

body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .pass-lv {
  width: calc(100% - 4px);
  min-height: 42px;
  padding: 6px 5px;
}

body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .pass-lv-num {
  font-size: clamp(12px, 0.9vw, 16px);
}

body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .pass-lv-xp {
  font-size: clamp(7px, 0.46vw, 8.5px);
  line-height: 1.05;
}

body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .pbc-card {
  padding: 14px 10px 16px;
}

body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .pass-claim-all {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
}

@media (max-width: 460px) {
  body.yandex-debug-ads-active #pass[data-pass-view="rewards"] #passRewardsPane {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .pass-buy-col,
  body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .pass-track,
  body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .pass-claim-all {
    grid-column: 1;
  }

  body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .pass-buy-col {
    grid-row: 1;
  }

  body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .pass-track {
    grid-row: 2;
  }

  body.yandex-debug-ads-active #pass[data-pass-view="rewards"] .pass-claim-all {
    grid-row: 3;
    justify-self: center;
  }
}

/* Shop: switch constrained desktop and debug-ad layouts to a clean vertical grid without visible rails */
#shop[data-shop-layout="stacked"] {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 100dvh;
  height: 100dvh;
  min-height: 100svh;
  min-width: 0;
  padding: max(4px, env(safe-area-inset-top, 0px)) 10px 10px;
  overflow: hidden;
}

#shop[data-shop-layout="stacked"] .screen-header {
  flex: 0 0 auto;
  margin-bottom: 4px;
  padding-top: calc(max(8px, env(safe-area-inset-top, 0px)) + 4px);
  align-items: start;
}

#shopGrid[data-shop-layout="rail"] {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#shopGrid[data-shop-layout="rail"]::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

@media (max-width: 1024px) {
  #shopGrid[data-shop-layout="rail"][data-shop-rail-axis="horizontal"] {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    max-width: 100%;
    margin: 0;
    overflow-x: auto;
    overflow-y: hidden;
    touch-action: pan-x;
  }

  #shopGrid[data-shop-layout="rail"][data-shop-rail-axis="horizontal"].drag-scroll-enabled {
    touch-action: pan-x;
    cursor: grab;
  }

  #shopGrid[data-shop-layout="rail"][data-shop-rail-axis="horizontal"].drag-scroll-enabled.is-dragging {
    touch-action: pan-x;
    cursor: grabbing;
    user-select: none;
  }

  #shopGrid[data-shop-layout="rail"][data-shop-rail-axis="horizontal"] .shop-card {
    width: auto;
    min-width: 0;
    flex: 0 0 clamp(180px, 28vw, 236px);
    max-width: clamp(180px, 28vw, 236px);
    height: auto;
  }
}

@media (max-width: 640px) {
  #shop[data-shop-layout="rail"] {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 100dvh;
    height: 100dvh;
    min-height: 100svh;
    min-width: 0;
    padding: max(2px, env(safe-area-inset-top, 0px)) 6px 8px;
    overflow: hidden;
  }

  #shop[data-shop-layout="rail"] .screen-header {
    flex: 0 0 auto;
    gap: 8px;
    margin-bottom: 2px;
  }

  #shopGrid[data-shop-layout="rail"][data-shop-rail-axis="vertical"] {
    flex: 1 1 auto;
    min-height: 0;
    height: calc(100dvh - 136px);
    max-height: calc(100dvh - 136px);
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
    width: min(100%, 420px);
    max-width: min(100%, 420px);
    margin: 0 auto;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding: 6px 4px 18px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  #shopGrid[data-shop-layout="rail"][data-shop-rail-axis="vertical"]::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  #shopGrid[data-shop-layout="rail"][data-shop-rail-axis="vertical"].drag-scroll-enabled,
  #shopGrid[data-shop-layout="rail"][data-shop-rail-axis="vertical"].drag-scroll-enabled.is-dragging {
    touch-action: pan-y;
    cursor: default;
    user-select: auto;
  }

  #shopGrid[data-shop-layout="rail"][data-shop-rail-axis="vertical"] .shop-card {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
  }

  body.yandex-debug-ads-active #shop[data-shop-layout="rail"] {
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px) + var(--yandex-debug-bottom-inset));
  }

  body.yandex-debug-ads-active #shopGrid[data-shop-layout="rail"][data-shop-rail-axis="vertical"] {
    height: min(100%, calc(var(--yandex-debug-safe-height) - 132px));
    max-height: min(100%, calc(var(--yandex-debug-safe-height) - 132px));
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px) + var(--yandex-debug-bottom-inset));
  }
}

#shopGrid[data-shop-layout="stacked"] {
  flex: 1 1 auto;
  min-height: 0;
  height: calc(100dvh - 152px);
  max-height: calc(100dvh - 152px);
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 10px;
  width: min(100%, 420px);
  max-width: min(100%, 420px);
  margin: 0 auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 8px 6px 24px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#shopGrid[data-shop-layout="stacked"]::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

#shopGrid[data-shop-layout="stacked"].drag-scroll-enabled,
#shopGrid[data-shop-layout="stacked"].drag-scroll-enabled.is-dragging {
  touch-action: pan-y;
  cursor: default;
  user-select: auto;
}

#shopGrid[data-shop-layout="stacked"] .shop-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: auto;
  min-height: 0;
  padding-bottom: 12px;
  overflow: hidden;
}

#shopGrid[data-shop-layout="stacked"] .shop-card .portrait {
  min-height: 112px;
  max-height: 112px;
  padding: 8px 6px 0;
}

#shopGrid[data-shop-layout="stacked"] .shop-card-visual {
  width: min(100%, 98px);
  height: 98px;
}

#shopGrid[data-shop-layout="stacked"] .shop-card-visual--art {
  width: min(100%, 104px);
  height: 104px;
}

#shopGrid[data-shop-layout="stacked"] .shop-card-visual--currency,
#shopGrid[data-shop-layout="stacked"] .shop-card-visual--emoji {
  width: min(100%, 94px);
  height: 94px;
}

#shopGrid[data-shop-layout="stacked"] .shop-card-visual--currency {
  width: min(100%, 102px);
  height: 102px;
  transform: translateY(6px);
}

#shopGrid[data-shop-layout="stacked"] .shop-card-visual--currency .currency-mark {
  --currency-icon-limit: min(100%, 100px);
}

#shopGrid[data-shop-layout="stacked"] .shop-card .nm {
  min-height: 0;
  padding: 7px 6px 2px;
  font-size: 11px;
  line-height: 1.18;
  overflow-wrap: anywhere;
  word-break: normal;
  text-wrap: balance;
}

#shopGrid[data-shop-layout="stacked"] .shop-card-desc {
  min-height: 0;
  padding: 5px 6px 2px;
  font-size: 9.5px;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: normal;
  text-wrap: balance;
}

#shopGrid[data-shop-layout="stacked"] .shop-card .meta.meta--price-only {
  min-height: 0;
  height: auto;
  padding: 6px 8px 8px;
  gap: 4px;
  flex-direction: column;
  align-items: center;
  border-top: 1px solid rgba(255, 92, 44, 0.16);
}

#shopGrid[data-shop-layout="stacked"] .shop-card-price-label {
  font-size: 9px;
  text-align: center;
}

#shopGrid[data-shop-layout="stacked"] .shop-card .meta.meta--price-only .shop-card-price-main {
  justify-content: center;
  gap: 4px;
}

#shopGrid[data-shop-layout="stacked"] .shop-card .meta.meta--price-only .shop-card-price-value,
#shopGrid[data-shop-layout="stacked"] .shop-card:not([data-shop-item="s_ad_gems"]) .shop-card-price-value {
  justify-content: center;
  width: auto;
  max-width: 100%;
  flex-wrap: nowrap;
  white-space: nowrap;
}

#shopGrid[data-shop-layout="stacked"] .shop-card:not([data-shop-item="s_ad_gems"]) .shop-card-price-value .currency-inline {
  gap: 4px;
  font-size: 12.5px;
}

#shopGrid[data-shop-layout="stacked"] .shop-card .meta .currency-mark {
  --currency-icon-limit: 22px;
}

#shopGrid[data-shop-layout="stacked"] .shop-card .meta .orig .currency-mark {
  --currency-icon-limit: 30px;
}

#shopGrid[data-shop-layout="stacked"] .shop-card.deal .meta.meta--price-only .shop-card-price-main {
  gap: 5px;
}

#shopGrid[data-shop-layout="stacked"] .shop-card[data-shop-item="s_ad_gems"] .shop-ad-meta {
  position: static;
  left: auto;
  top: auto;
  transform: none;
  display: block;
  width: 100%;
  max-width: none;
  padding: 4px 6px;
  font-size: 9px;
  line-height: 1.18;
}

#shopGrid[data-shop-layout="stacked"] .shop-card > .btn {
  width: auto;
  min-height: 40px;
  margin: 6px 6px 0;
  padding: 8px 10px;
  font-size: 12px;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}

body.yandex-debug-ads-active #shop[data-shop-layout="stacked"] {
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px) + var(--yandex-debug-bottom-inset));
}

body.yandex-debug-ads-active #shopGrid[data-shop-layout="stacked"] {
  height: min(100%, calc(var(--yandex-debug-safe-height) - 132px));
  max-height: min(100%, calc(var(--yandex-debug-safe-height) - 132px));
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px) + var(--yandex-debug-bottom-inset));
}

@media (min-width: 1025px) {
  #shop[data-shop-layout="stacked"] {
    padding: max(8px, env(safe-area-inset-top, 0px)) 18px 14px;
  }

  #shopGrid[data-shop-layout="stacked"] {
    height: calc(100dvh - 156px);
    max-height: calc(100dvh - 156px);
    padding: 12px 6px 28px;
  }

  body.yandex-debug-ads-active #shopGrid[data-shop-layout="stacked"] {
    height: min(100%, calc(var(--yandex-debug-safe-height) - 136px));
    max-height: min(100%, calc(var(--yandex-debug-safe-height) - 136px));
  }
}

@media (max-width: 1024px) {
  #shopGrid[data-shop-layout="stacked"] {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: stretch;
    width: 100%;
    max-width: none;
    gap: 12px;
    padding: 8px 6px 22px;
  }

  #shopGrid[data-shop-layout="stacked"] .shop-card {
    flex: 0 0 calc((100% - 12px) / 2);
    max-width: calc((100% - 12px) / 2);
    width: auto;
    padding-bottom: 12px;
  }

  #shopGrid[data-shop-layout="stacked"] .shop-card .portrait {
    min-height: 132px;
    max-height: 132px;
    padding: 8px 8px 0;
  }

  #shopGrid[data-shop-layout="stacked"] .shop-card-visual {
    width: min(100%, 118px);
    height: 118px;
  }

  #shopGrid[data-shop-layout="stacked"] .shop-card-visual--art {
    width: min(100%, 124px);
    height: 124px;
  }

  #shopGrid[data-shop-layout="stacked"] .shop-card-visual--currency,
  #shopGrid[data-shop-layout="stacked"] .shop-card-visual--emoji {
    width: min(100%, 112px);
    height: 112px;
  }

  #shopGrid[data-shop-layout="stacked"] .shop-card-visual--currency {
    width: min(100%, 122px);
    height: 122px;
    transform: translateY(8px);
  }

  #shopGrid[data-shop-layout="stacked"] .shop-card-visual--currency .currency-mark {
    --currency-icon-limit: min(100%, 120px);
  }

  #shopGrid[data-shop-layout="stacked"] .shop-card .nm {
    padding: 8px 8px 2px;
    font-size: 12px;
  }

  #shopGrid[data-shop-layout="stacked"] .shop-card-desc {
    padding: 6px 8px 2px;
    font-size: 10.5px;
    line-height: 1.24;
  }

  #shopGrid[data-shop-layout="stacked"] .shop-card .meta {
    min-height: 0;
    padding: 6px 8px;
    min-width: 0;
    margin-top: auto;
  }

  #shopGrid[data-shop-layout="stacked"] .shop-card-price-label {
    letter-spacing: .1em;
  }

  #shopGrid[data-shop-layout="stacked"] .shop-card:not([data-shop-item="s_ad_gems"]) .shop-card-price-value .currency-inline {
    font-size: 14px;
  }

  #shopGrid[data-shop-layout="stacked"] .shop-card:not([data-shop-item="s_ad_gems"]) .shop-card-price-value .currency-mark {
    --currency-icon-limit: 24px;
  }

  #shopGrid[data-shop-layout="stacked"] .shop-card[data-shop-item="s_ad_gems"] .shop-ad-meta {
    font-size: 10px;
  }

  #shopGrid[data-shop-layout="stacked"] .shop-card > .btn {
    min-height: 42px;
    margin: 6px 8px 0;
    padding: 9px 12px;
    font-size: 13px;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  #shopGrid[data-shop-layout="stacked"] .shop-card {
    height: 368px;
    min-height: 368px;
  }

  #shopGrid[data-shop-layout="stacked"] .shop-card .nm {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #shopGrid[data-shop-layout="stacked"] .shop-card-desc {
    min-height: 36px;
  }

  #shopGrid[data-shop-layout="stacked"] .shop-card .meta.meta--price-only {
    height: 72px;
    min-height: 72px;
  }
}

@media (max-width: 640px) {
  #shop[data-shop-layout="stacked"] {
    padding: max(2px, env(safe-area-inset-top, 0px)) 6px 8px;
  }

  #shopGrid[data-shop-layout="stacked"] {
    height: calc(100dvh - 136px);
    max-height: calc(100dvh - 136px);
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 10px;
    width: min(100%, 420px);
    max-width: min(100%, 420px);
    padding: 6px 4px 18px;
  }

  #shopGrid[data-shop-layout="stacked"] .shop-card {
    flex-basis: 100%;
    max-width: 100%;
    width: 100%;
  }
}

body.yandex-debug-ads-active #profile .pf-pane--equipment {
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px) + var(--yandex-debug-bottom-inset));
}

@media (min-width: 1025px) {
  body.yandex-debug-ads-active .pf-equipment-inventory {
    max-height: clamp(240px, calc(var(--yandex-debug-safe-height) - 360px), 520px);
  }
}

body.yandex-debug-ads-active #profile .pf-equipment-layout {
  grid-template-columns: 1fr;
  grid-template-areas:
    "side"
    "card";
  gap: 12px;
}

body.yandex-debug-ads-active #profile .pf-equipment-layout--enhance {
  grid-template-columns: 1fr;
  grid-template-areas: none;
}

body.yandex-debug-ads-active #profile .pf-enhance-workspace {
  grid-template-columns: 1fr;
  gap: 10px;
}

body.yandex-debug-ads-active #profile .pf-equipment-side {
  grid-template-rows: auto auto;
  gap: 10px;
}

body.yandex-debug-ads-active #profile .pf-equipment-toolbar {
  position: static;
  top: auto;
  z-index: auto;
  padding: 10px;
  border-radius: 18px;
}

body.yandex-debug-ads-active #profile .pf-equipment-card {
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 14px;
}

body.yandex-debug-ads-active #profile .pf-equipment-copy,
body.yandex-debug-ads-active #profile .pf-equipment-summary {
  text-align: center;
  justify-content: center;
}

body.yandex-debug-ads-active #profile .pf-equipment-frame {
  width: min(100%, 420px);
  max-height: none;
}

body.yandex-debug-ads-active #profile .pf-equipment-inventory {
  height: auto;
  max-height: min(58vh, calc(var(--yandex-debug-safe-height) - 188px));
  padding: 12px 12px calc(16px + env(safe-area-inset-bottom, 0px) + var(--yandex-debug-bottom-inset));
}

body.yandex-debug-ads-active #profile .pf-equipment-inventory--enhance {
  max-height: min(56vh, calc(var(--yandex-debug-safe-height) - 220px));
}

body.yandex-debug-ads-active #profile .pf-equipment-inventory--enhance .pf-equipment-inventory-grid {
  grid-template-columns: repeat(auto-fit, minmax(78px, 92px));
  gap: 8px;
}

body.yandex-debug-ads-active #profile .pf-enhance-panel {
  gap: 8px;
  padding: 10px;
}

body.yandex-debug-ads-active #profile .pf-enhance-slot {
  min-height: clamp(112px, 16vh, 148px);
}

body.yandex-debug-ads-active #profile .pf-enhance-copy,
body.yandex-debug-ads-active #profile .pf-enhance-picker-copy,
body.yandex-debug-ads-active #profile .pf-enhance-picker-empty,
body.yandex-debug-ads-active #profile .pf-enhance-help-bubble {
  font-size: 11px;
}

body.yandex-debug-ads-active #mini-mem .mem-grid {
  width: min(100%, calc(var(--yandex-debug-safe-height) - 236px));
}

@media (max-width: 1024px) and (orientation: landscape) {
  body.yandex-debug-ads-active #mini-mem .mem-grid {
    width: min(100%, calc(var(--yandex-debug-safe-height) - 104px));
  }
}

@container (max-width: 1480px) {
  body:not(.starter-skip-focus-active) #lobby .top {
    grid-template-columns: 98px minmax(74px, max-content) minmax(0, 1fr) 48px;
    grid-template-areas: "player heroes currencies toggle";
    align-items: start;
    gap: 8px 6px;
  }

  body:not(.starter-skip-focus-active) #lobby .player-pill {
    grid-area: player;
    justify-self: start;
    align-self: start;
    width: 98px;
    min-width: 98px;
    height: 98px;
    min-height: 98px;
    margin-top: 0;
    padding: 0;
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  body:not(.starter-skip-focus-active) #lobby .player-pill > :not(.avatar) {
    display: none;
  }

  body:not(.starter-skip-focus-active) #lobby .player-pill .avatar {
    position: relative;
    width: 100%;
    height: 100%;
    left: auto;
    top: auto;
    border-radius: inherit;
  }

  body:not(.starter-skip-focus-active) #lobby .player-pill .avatar-ring {
    inset: 6px;
    border-radius: 18px;
  }

  body:not(.starter-skip-focus-active) #lobby .player-pill .avatar-glyph {
    font-size: 40px;
  }

  body:not(.starter-skip-focus-active) #lobby .player-pill .avatar-art {
    width: calc(100% - 8px);
    height: calc(100% - 8px);
    object-fit: contain;
    object-position: center top;
    transform: scale(1.06);
    transform-origin: center top;
  }

  body:not(.starter-skip-focus-active) #lobby .lobby-heroes-pill {
    grid-area: heroes;
    display: inline-flex;
    justify-self: start;
    align-self: start;
    min-width: 74px;
    min-height: 40px;
    padding: 6px 10px;
    gap: 4px;
    border-radius: 14px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(180deg, rgba(34, 25, 29, 0.98), rgba(11, 11, 16, 0.98));
    border-color: rgba(255, 136, 84, 0.30);
  }

  body:not(.starter-skip-focus-active) #lobby .lobby-heroes-pill__label {
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: rgba(255, 198, 166, 0.82);
    line-height: 1;
  }

  body:not(.starter-skip-focus-active) #lobby .lobby-heroes-pill__value {
    font-size: 16px;
    font-weight: 1000;
    letter-spacing: .04em;
    color: #fff7ef;
    line-height: 1;
  }

  body:not(.starter-skip-focus-active) #lobby .currencies {
    grid-area: currencies;
    justify-self: end;
    align-self: start;
    display: grid;
    grid-template-columns: repeat(2, minmax(92px, max-content));
    justify-content: end;
    align-items: center;
    width: auto;
    max-width: min(100%, 248px);
    min-width: 0;
    margin: 0;
    gap: 8px;
  }

  body:not(.starter-skip-focus-active) #lobby .currency-pill {
    width: auto;
    min-width: 92px;
    max-width: min(100%, 120px);
    min-height: 52px;
    margin-left: 0;
    padding: 8px 10px;
    gap: 8px;
    border-radius: 16px;
  }

  body:not(.starter-skip-focus-active) #lobby .currency-pill .val {
    font-size: 15px;
    letter-spacing: .04em;
    min-width: 0;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
  }

  body:not(.starter-skip-focus-active) #lobby .currency-pill .hud-icon.coin,
  body:not(.starter-skip-focus-active) #lobby .currency-pill .hud-icon.gem {
    width: 32px;
    height: 32px;
  }

  body:not(.starter-skip-focus-active) #lobby .menu-right {
    display: none;
  }

  body:not(.starter-skip-focus-active) #lobby .mobile-main-menu-toggle {
    display: inline-flex;
    grid-area: toggle;
    justify-self: end;
    align-self: start;
    width: 48px;
    height: 48px;
    padding: 0;
    gap: 0;
    font-size: 0;
    margin-top: 0;
  }

  body:not(.starter-skip-focus-active) #lobby .mobile-main-menu {
    position: fixed;
    inset:
      var(--yandex-debug-top-inset)
      var(--yandex-debug-right-inset)
      var(--yandex-debug-bottom-inset)
      var(--yandex-debug-left-inset);
    z-index: 120;
    padding: clamp(12px, 2vw, 18px);
    pointer-events: none;
  }

  body:not(.starter-skip-focus-active) #lobby .mobile-main-menu[hidden] {
    display: none;
  }

  body:not(.starter-skip-focus-active) #lobby .mobile-main-menu:not([hidden]) {
    display: grid;
    place-items: start center;
    pointer-events: auto;
  }

  body:not(.starter-skip-focus-active) #lobby .mobile-main-menu__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    background:
      radial-gradient(circle at 50% 12%, rgba(255, 120, 80, 0.10), transparent 30%),
      linear-gradient(180deg, rgba(5, 7, 13, 0.54), rgba(3, 4, 8, 0.86));
    backdrop-filter: blur(14px);
    cursor: pointer;
  }

  body:not(.starter-skip-focus-active) #lobby .mobile-main-menu__panel {
    position: relative;
    z-index: 1;
    width: min(100%, 620px);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border-radius: 28px;
    border: 1px solid rgba(255, 150, 98, 0.36);
    background:
      radial-gradient(circle at 50% 0%, rgba(255, 136, 84, 0.08), transparent 34%),
      linear-gradient(180deg, rgba(31, 21, 27, 0.98), rgba(10, 10, 14, 0.99));
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.06),
      inset 0 0 0 1px rgba(255, 161, 111, 0.06),
      0 28px 56px rgba(0,0,0,.52),
      0 0 32px rgba(255, 115, 51, 0.16);
    animation: mobile-main-menu-pop .18s ease-out;
    transform-origin: top center;
    overflow: hidden;
  }

  body:not(.starter-skip-focus-active) #lobby .mobile-main-menu__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }

  body:not(.starter-skip-focus-active) #lobby .mobile-main-menu__copy {
    min-width: 0;
    display: grid;
    gap: 4px;
  }

  body:not(.starter-skip-focus-active) #lobby .mobile-main-menu__close {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 16px;
  }

  body:not(.starter-skip-focus-active) #lobby .mobile-main-menu__close-glyph {
    position: relative;
    display: block;
    width: 20px;
    height: 20px;
    font-size: 0;
    line-height: 0;
  }

  body:not(.starter-skip-focus-active) #lobby .mobile-main-menu__close-glyph::before,
  body:not(.starter-skip-focus-active) #lobby .mobile-main-menu__close-glyph::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 2.5px;
    border-radius: 999px;
    background: rgba(255, 240, 230, 0.96);
    transform-origin: center center;
  }

  body:not(.starter-skip-focus-active) #lobby .mobile-main-menu__close-glyph::before {
    transform: translate(-50%, -50%) rotate(45deg);
  }

  body:not(.starter-skip-focus-active) #lobby .mobile-main-menu__close-glyph::after {
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  body:not(.starter-skip-focus-active) #lobby .mobile-main-menu__list {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    gap: 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding-right: 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  body:not(.starter-skip-focus-active) #lobby .mobile-main-menu__list::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  body:not(.starter-skip-focus-active) #lobby .mobile-main-menu__item {
    width: 100%;
    min-width: 0;
    min-height: 58px;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    justify-content: stretch;
    align-items: center;
    column-gap: 14px;
    row-gap: 4px;
    padding: 12px 16px;
    white-space: normal;
    text-align: left;
    text-transform: none;
    letter-spacing: .025em;
    line-height: 1.18;
    border-radius: 16px;
  }

  body:not(.starter-skip-focus-active) #lobby .body {
    grid-template-columns: minmax(132px, 276px) minmax(0, 1fr);
    align-items: start;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 8px 2px 18px 0;
    column-gap: 16px;
    row-gap: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  body:not(.starter-skip-focus-active) #lobby .side-menu {
    position: sticky;
    top: 0;
    align-self: start;
    margin-top: 0;
    padding-top: 6px;
    width: 100%;
  }

  body:not(.starter-skip-focus-active) #lobby .side-btn {
    width: 100%;
    min-width: 0;
  }

  body:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .vault-row {
    width: 100%;
    min-height: max-content;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: max-content;
    justify-items: center;
    align-content: start;
    align-items: start;
    gap: 22px 18px;
    padding: 8px 10px 28px;
    overflow: visible;
  }

  body:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .vault,
  body:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .vault[data-box="smallChest"],
  body:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .vault[data-box="bigChest"],
  body:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .vault[data-box="largeChest"],
  body:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .vault[data-box="equipChest"] {
    width: min(100%, 208px);
    min-height: 0;
    height: auto;
    padding-top: 24px;
  }

  body:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .vault[data-box="smallChest"] {
    padding-top: 44px;
  }

  body:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .vault .chest {
    width: min(100%, 156px);
    height: min(100%, 156px);
    border-radius: 24px;
  }

  body:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .vault[data-box="smallChest"] .chest {
    margin-top: -18px;
  }

  body:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .vault .info {
    right: 8px;
    top: 2px;
  }

  body:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .vault .label,
  body:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .vault[data-box="smallChest"] .free-ad-btn,
  body:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .chest-ad-btn,
  body:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .chest-ad-btn.boss-ad-btn {
    width: min(100%, 180px);
    max-width: 100%;
    min-width: 0;
  }

  body:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .vault .label {
    min-height: 44px;
    margin-top: 10px;
    padding: 6px 8px;
    font-size: 11px;
    line-height: 1.08;
    letter-spacing: .04em;
    column-gap: 5px;
    row-gap: 2px;
  }

  body:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .vault .label .hud-icon.coin,
  body:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .vault .label .hud-icon.gem {
    width: 18px;
    height: 18px;
  }

  body:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .chest-ad-btn,
  body:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .chest-ad-btn.boss-ad-btn {
    min-height: 46px;
    margin-top: 8px;
    padding: 6px 8px;
    border-radius: 14px;
    font-size: 8.5px;
    line-height: 1.08;
    gap: 2px;
  }

  body:not(.starter-skip-focus-active) #lobby .footer-row--single {
    margin-top: 6px;
    padding-bottom: max(2px, env(safe-area-inset-bottom, 0px));
  }
}

@container (max-width: 1180px) {
  body:not(.starter-skip-focus-active) #lobby .body {
    grid-template-columns: 1fr;
    padding: 8px 0 18px;
  }

  body:not(.starter-skip-focus-active) #lobby .side-menu {
    display: none;
  }

  body:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .vault-row {
    padding-inline: 4px;
  }
}

@container (max-width: 820px) {
  body:not(.starter-skip-focus-active) #lobby .top {
    grid-template-columns: 72px minmax(50px, 60px) minmax(0, 1fr) 42px;
  }

  body:not(.starter-skip-focus-active) #lobby .player-pill {
    width: 72px;
    min-width: 72px;
    height: 72px;
    min-height: 72px;
    border-radius: 20px;
  }

  body:not(.starter-skip-focus-active) #lobby .player-pill .avatar-ring {
    inset: 4px;
    border-radius: 14px;
  }

  body:not(.starter-skip-focus-active) #lobby .player-pill .avatar-glyph {
    font-size: 30px;
  }

  body:not(.starter-skip-focus-active) #lobby .currencies {
    gap: 4px;
    width: auto;
    max-width: min(100%, 212px);
    grid-template-columns: repeat(2, minmax(80px, max-content));
  }

  body:not(.starter-skip-focus-active) #lobby .currency-pill {
    width: auto;
    min-width: 80px;
    max-width: min(100%, 104px);
    min-height: 42px;
    padding: 6px;
    gap: 4px;
    border-radius: 14px;
  }

  body:not(.starter-skip-focus-active) #lobby .currency-pill .val {
    font-size: 12px;
    letter-spacing: .02em;
    overflow: visible;
    text-overflow: clip;
  }

  body:not(.starter-skip-focus-active) #lobby .currency-pill .hud-icon.coin,
  body:not(.starter-skip-focus-active) #lobby .currency-pill .hud-icon.gem {
    width: 22px;
    height: 22px;
  }

  body:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .vault-row {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  body:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .vault,
  body:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .vault[data-box="smallChest"],
  body:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .vault[data-box="bigChest"],
  body:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .vault[data-box="largeChest"],
  body:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .vault[data-box="equipChest"] {
    width: min(100%, 244px);
  }

  body:not(.tutorial-starter-compact-active):not(.starter-skip-focus-active) #lobby .vault .chest {
    width: min(100%, 168px);
    height: min(100%, 168px);
  }
}
