  :root {
    /* ═══════ ARCTIC PALETTE (task #48): лёд + бледное золото + чистый белый ═══════ */
    /* Backgrounds — холодный синий подтон */
    --bg-deep: #0a1120;         /* глубокий серо-синий */
    --bg-panel: #142238;        /* панели */
    --bg-elevated: #1d2d48;     /* поднятые карточки */
    --bg-overlay: rgba(6,12,24,.94);
    /* Accent semantic — cyan-blue вместо cyan-green */
    --acc-primary: #66d6ff;     /* лёд — CTA, здоровье, успех */
    --acc-primary-dark: #2d9dd0;
    --acc-reward: #ffee88;      /* бледное золото — награды, XP */
    --acc-reward-dark: #c9b53d;
    --acc-danger: #ff7c9c;      /* мягкий pink — HP low, урон */
    --acc-info: #a0d8ff;        /* воздушный blue — info, ctrl */
    /* Text — холодный белый */
    --text-primary: #f0f6ff;
    --text-secondary: #b8c8de;
    --text-dim: #6d84a0;
    --text-inverse: #0a1120;
    /* Rarity */
    --rarity-common: #a5b3c8;
    --rarity-rare: #5cb8ff;
    --rarity-epic: #c084ff;
    --rarity-legendary: #ff9d3b;
    --rarity-mythic: #ff5cf7;
    /* Radii — chunky feels fat */
    --rad-xs: 4px;
    --rad-sm: 8px;
    --rad-md: 12px;
    --rad-lg: 18px;
    --rad-xl: 24px;
    --rad-pill: 999px;
    /* Spacing */
    --sp-1: 4px; --sp-2: 8px; --sp-3: 12px;
    --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
    /* Borders — chunky = thick */
    --border-thin: 1px;
    --border-md: 2px;
    --border-thick: 3px;
    /* Shadows / glows */
    --shadow-panel: 0 4px 20px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.04);
    --shadow-elevated: 0 8px 28px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.06);
    --shadow-cta: 0 4px 0 var(--acc-primary-dark), 0 6px 22px rgba(102,214,255,.32);
    --shadow-cta-active: 0 1px 0 var(--acc-primary-dark), 0 2px 8px rgba(102,214,255,.4);
    --glow-legendary: 0 0 22px rgba(255,157,59,.55), 0 0 4px rgba(255,157,59,.9);
    --glow-epic: 0 0 14px rgba(192,132,255,.45);
    --glow-rare: 0 0 10px rgba(92,184,255,.4);
    --glow-primary: 0 0 18px rgba(102,214,255,.4);
    /* Animation curves */
    --ease-out: cubic-bezier(.22,1,.36,1);
    --ease-bounce: cubic-bezier(.34,1.56,.64,1);  /* squish-в */
    --ease-quick: cubic-bezier(.4,0,.2,1);
    /* Typography scale */
    --fs-xs: 10px;
    --fs-sm: 12px;
    --fs-md: 14px;
    --fs-lg: 16px;
    --fs-xl: 20px;
    --fs-xxl: 28px;
    --fs-display: 40px;
  }
  * { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
  html,body { width:100%; height:100%; overflow:hidden; background:var(--bg-deep); touch-action:none; overscroll-behavior:none; }
  /* Глобальные safeguards от переполнения */
  .card, .charcard, .bonusitem, .recipe, .brow, #mybuild, #cards, #chars, #bonuslist, #rescueoffer,
  #pausebuild, #dmgpanel, #enddmg, #schemebody, #talcontent, #endstats {
    max-width: 100%;
    box-sizing: border-box;
  }
  /* Тонкий кастомный скроллбар для overlay-контейнеров */
  .overlay, #activebuffs, #bufftip {
    scrollbar-width: thin;
    scrollbar-color: var(--acc-primary-dark) transparent;
  }
  .overlay::-webkit-scrollbar,
  #activebuffs::-webkit-scrollbar,
  #bufftip::-webkit-scrollbar { width: 6px; height: 6px; }
  .overlay::-webkit-scrollbar-thumb,
  #activebuffs::-webkit-scrollbar-thumb,
  #bufftip::-webkit-scrollbar-thumb {
    background: var(--acc-primary-dark);
    border-radius: var(--rad-pill);
  }
  body {
    font-family: 'Rubik', system-ui, -apple-system, sans-serif;
    font-weight: 500;
    color: var(--text-primary);
    user-select: none;
    -webkit-user-select: none;
    font-feature-settings: 'tnum' 1, 'ss01' 1;  /* tabular numbers для стабильных цифр */
    letter-spacing: 0.01em;
  }
  /* task #131: low-HP vignette — красная viñeta по краям при hp<30%, пульс. */
  body.hp-low::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    background: radial-gradient(ellipse at center,
      transparent 40%,
      rgba(220,40,40,.15) 65%,
      rgba(180,20,20,.55) 100%);
    animation: hp-low-pulse 1s infinite ease-in-out;
  }
  @keyframes hp-low-pulse {
    0%,100% { opacity: 0.65; }
    50% { opacity: 1; }
  }
  /* task #131: hurt-flash — короткая красная вспышка на весь экран при hit. */
  #hurtflash {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background: radial-gradient(ellipse at center,
      rgba(255,60,60,.15) 0%,
      rgba(255,40,40,.45) 60%,
      rgba(200,20,20,.7) 100%);
    opacity: 0;
    transition: opacity 0.08s ease-out;
    mix-blend-mode: normal;
  }
  /* Утилити-классы для типографики */
  .h-display { font-weight:900; font-size:var(--fs-display); letter-spacing:.02em; line-height:1; }
  .h-title { font-weight:800; font-size:var(--fs-xxl); letter-spacing:.02em; line-height:1.1; }
  .h-heading { font-weight:800; font-size:var(--fs-xl); letter-spacing:.01em; }
  .t-body { font-weight:500; font-size:var(--fs-md); line-height:1.4; }
  .t-caption { font-weight:600; font-size:var(--fs-sm); color:var(--text-secondary); }
  .t-hint { font-weight:500; font-size:var(--fs-xs); color:var(--text-dim); letter-spacing:.05em; text-transform:uppercase; }
  .num { font-variant-numeric: tabular-nums; font-weight:700; }
  /* Micro-анимации — используются повсеместно */
  @keyframes pop-in {
    0% { transform: scale(.6); opacity: 0; }
    70% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
  }
  @keyframes pulse-glow {
    0%,100% { box-shadow: var(--glow-primary); }
    50% { box-shadow: 0 0 26px rgba(102,214,255,.55); }
  }
  @keyframes shake-tiny {
    0%,100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
  }
  @keyframes breathe-glow {
    0%,100% { filter: drop-shadow(0 0 4px currentColor); }
    50% { filter: drop-shadow(0 0 12px currentColor); }
  }
  #game { position:fixed; inset:0; display:block; }

  /* ═══════ TOP HUD — chunky refresh ═══════ */
  #hud {
    position:fixed; top:0; left:0; right:0; pointer-events:none; z-index:5;
    /* Safe-area: viewport-fit=cover пускает контент под чёлку/Dynamic Island,
       поэтому отступаем сверху и по бокам (боковые — для ландшафтной чёлки).
       Фон HUD заливает и зону чёлки — бар не «висит» в вырезе. */
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    background: linear-gradient(180deg, rgba(21,29,46,.94), rgba(11,15,26,.85));
    border-bottom: var(--border-thick) solid var(--bg-elevated);
    box-shadow: 0 4px 14px rgba(0,0,0,.5);
  }
  #xpbar {
    height:22px; background:#080b17; position:relative; overflow:hidden;
    border-bottom: 2px solid #1a2338;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
  }
  /* Флеш при повышении уровня — включается через JS-класс .leveling */
  #xpbar.leveling::after {
    content:''; position:absolute; inset:0;
    background: linear-gradient(90deg,
      rgba(255,255,255,0) 0%,
      rgba(255,255,255,0.85) 50%,
      rgba(255,255,255,0) 100%);
    animation: xp-levelup-flash 0.7s ease-out forwards;
    pointer-events:none;
    z-index: 2;
  }
  /* Пульс свечения при подборе XP-сферы — включается через JS-класс .gaining на 260мс */
  #xpbar.gaining {
    animation: xp-gain-pulse 0.26s ease-out;
  }
  @keyframes xp-gain-pulse {
    0%   { box-shadow: inset 0 2px 4px rgba(0,0,0,0.6), 0 0 0 rgba(255,238,136,0); }
    45%  { box-shadow: inset 0 2px 4px rgba(0,0,0,0.6), 0 0 18px rgba(255,238,136,0.65), 0 2px 8px rgba(255,238,136,0.4); }
    100% { box-shadow: inset 0 2px 4px rgba(0,0,0,0.6), 0 0 0 rgba(255,238,136,0); }
  }
  #xpfill {
    height:100%; width:0%;
    /* базовый градиент — золотой в 5 стоп-точек для flow-эффекта */
    background: linear-gradient(90deg,
      #e6c74a 0%, #ffee88 20%, #fff5b0 40%, #ffee88 60%, #e6c74a 80%, #ffee88 100%);
    background-size: 200% 100%;
    animation: xp-flow 3.2s linear infinite;
    box-shadow:
      0 0 14px rgba(255,238,136,.7),
      inset 0 -3px 0 rgba(160,90,0,.35),
      inset 0 2px 0 rgba(255,255,255,.55);
    transition: width .35s var(--ease-out);
    position: relative;
    overflow: hidden;
    border-right: 2px solid rgba(255,255,255,0.65);
  }
  /* Диагональный светящийся блик, пробегающий слева-направо */
  #xpfill::before {
    content:''; position:absolute; top:-4px; bottom:-4px;
    width: 45%; left: 0;
    background: linear-gradient(90deg,
      rgba(255,255,255,0) 0%,
      rgba(255,255,255,0.4) 45%,
      rgba(255,255,255,0.9) 50%,
      rgba(255,255,255,0.4) 55%,
      rgba(255,255,255,0) 100%);
    transform: skewX(-24deg);
    animation: xp-shine 2.6s cubic-bezier(0.55, 0, 0.45, 1) infinite;
    pointer-events:none;
    filter: blur(1px);
  }
  /* Сегменты — тёмные полоски каждые 10% сверху */
  #xpfill::after {
    content:''; position:absolute; inset:0;
    background: repeating-linear-gradient(90deg,
      transparent 0, transparent 9.75%,
      rgba(80,45,0,.35) 9.75%, rgba(80,45,0,.35) 10%);
    pointer-events:none;
  }
  @keyframes xp-flow {
    0%   { background-position: 0% 0; }
    100% { background-position: 200% 0; }
  }
  @keyframes xp-shine {
    0%   { transform: translateX(-120%) skewX(-24deg); }
    60%  { transform: translateX(250%) skewX(-24deg); }
    100% { transform: translateX(250%) skewX(-24deg); }
  }
  @keyframes xp-levelup-flash {
    0%   { opacity: 0; transform: scaleX(0.4); transform-origin: center; }
    30%  { opacity: 1; transform: scaleX(1); }
    100% { opacity: 0; transform: scaleX(1.4); }
  }
  #xplabel {
    position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
    font-size:11px; font-weight:900; color:#1a1105;
    text-shadow: 0 1px 0 rgba(255,255,255,.35);
    letter-spacing: .06em;
  }
  #statsrow {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 8px 8px;
    gap: 4px;
    flex-wrap: nowrap;
    min-width: 0;
  }
  .hudcell { display:flex; align-items:center; gap:6px; pointer-events:none; min-width: 0; }
  .hudcell.center { flex:1; justify-content:center; min-width: 0; flex-shrink: 1; }
  .hudcell.right { justify-content:flex-end; }
  /* Ужимаем HUD-элементы на маленьких экранах (но 44×44 touch minimum сохраняем!) */
  @media (max-width: 380px) {
    #lvlbig { padding: 3px 7px; font-size: 12px; min-width: 46px; }
    #killcount { padding: 4px 7px; font-size: 11px; }
    #timer { padding: 4px 10px; font-size: 15px; letter-spacing: .05em; }
    #hptext { padding: 3px 7px; font-size: 12px; min-width: 52px; }
    /* .hudbtn НЕ ужимаем — 44×44 WCAG touch-target minimum */
  }
  /* Level badge — chunky primary */
  #lvlbig {
    display:inline-block;
    background: var(--bg-elevated);
    color: var(--acc-primary);
    border: var(--border-thick) solid var(--acc-primary);
    border-radius: var(--rad-md);
    padding: 4px 10px;
    font-size: 14px; font-weight: 900;
    letter-spacing: .05em;
    box-shadow: 0 0 12px rgba(102,214,255,.28), inset 0 -2px 0 rgba(0,0,0,.28);
    min-width: 58px; text-align:center;
    text-shadow: 0 0 8px rgba(102,214,255,.5);
  }
  /* Kill count chip */
  #killcount {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: var(--border-md) solid #2b3752;
    border-radius: var(--rad-md);
    padding: 5px 10px;
    font-size: 13px; font-weight: 700;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,.25);
  }
  /* Timer — большой tabular */
  #timer {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: var(--border-md) solid #2b3752;
    border-radius: var(--rad-md);
    padding: 6px 16px;
    font-size: 18px; font-weight: 800;
    letter-spacing: .08em;
    font-variant-numeric: tabular-nums;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,.3);
  }
  /* HP chip — цвет по состоянию (класс hp-* переключает JS) */
  #hptext {
    display:inline-block;
    background: var(--bg-elevated);
    border: var(--border-thick) solid var(--acc-primary);
    color: var(--acc-primary);
    border-radius: var(--rad-md);
    padding: 4px 10px;
    font-size: 14px; font-weight: 800;
    letter-spacing: .04em;
    box-shadow: 0 0 10px rgba(102,214,255,.3), inset 0 -2px 0 rgba(0,0,0,.28);
    min-width: 62px; text-align:center;
    text-shadow: 0 0 6px rgba(102,214,255,.4);
    transition: border-color .3s, color .3s, box-shadow .3s;
  }
  #hptext.hp-mid {
    border-color: var(--acc-reward);
    color: var(--acc-reward);
    box-shadow: 0 0 10px rgba(255,238,136,.3), inset 0 -2px 0 rgba(0,0,0,.28);
    text-shadow: 0 0 6px rgba(255,238,136,.4);
  }
  #hptext.hp-low {
    border-color: var(--acc-danger);
    color: var(--acc-danger);
    box-shadow: 0 0 12px rgba(255,124,156,.5), inset 0 -2px 0 rgba(0,0,0,.28);
    text-shadow: 0 0 8px rgba(255,124,156,.5);
    animation: hp-pulse 0.6s infinite;
  }
  /* Focus-visible для доступности на клавиатуре */
  button:focus-visible,
  .card:focus-visible,
  .charcard:focus-visible {
    outline: 3px solid var(--acc-primary);
    outline-offset: 3px;
  }
  button:focus:not(:focus-visible) { outline: none; }
  @keyframes hp-pulse {
    0%,100% { box-shadow: 0 0 12px rgba(255,124,156,.5), inset 0 -2px 0 rgba(0,0,0,.28); }
    50% { box-shadow: 0 0 22px rgba(255,124,156,.85), inset 0 -2px 0 rgba(0,0,0,.28); }
  }
  /* HUD buttons — chunky, 44×44 WCAG touch minimum, не сжимаются flex-контейнером */
  .hudbtn {
    pointer-events: auto;
    background: var(--bg-elevated);
    border: var(--border-thick) solid #2b3752;
    color: var(--text-secondary);
    width: 44px; height: 44px;
    min-width: 44px; min-height: 44px;
    flex-shrink: 0;
    border-radius: var(--rad-md);
    font-size: 20px;
    cursor: pointer;
    margin-left: 6px;
    box-shadow: 0 3px 0 #0e1424, inset 0 -1px 0 rgba(0,0,0,.2);
    transition: transform .1s var(--ease-out), border-color .12s, color .12s, box-shadow .12s;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .hudbtn:hover {
    border-color: var(--acc-primary);
    color: var(--acc-primary);
  }
  .hudbtn:active {
    border-color: var(--acc-primary);
    color: var(--acc-primary);
    transform: translateY(2px);
    box-shadow: 0 1px 0 #0e1424, 0 0 14px rgba(102,214,255,.35);
  }
  /* ═══════ WEAPONS ROW — chunky slots ═══════ */
  #weaponsrow {
    /* низ-слева: отступаем от home-indicator (bottom) и ландшафтной чёлки (left) */
    position: fixed;
    left: calc(8px + env(safe-area-inset-left, 0px));
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    display: flex; gap: 5px; flex-wrap: wrap;
    max-width: calc(100vw - 16px);
    pointer-events: none;
    z-index: 5;
    align-content: flex-end;
    max-height: 45vh;                      /* если оружий очень много — не блокируем половину экрана */
    overflow: hidden;
  }
  /* На узких экранах — компактнее slot размер */
  @media (max-width: 380px) {
    #weaponsrow .hero-badge,
    #weaponsrow .wpn-slot { width: 34px; height: 34px; font-size: 17px; }
    #weaponsrow .wpn-slot .wpn-icon { font-size: 17px; }
    #weaponsrow { max-width: calc(100vw - 96px); }   /* оставляем место биому в углу */
  }
  #weaponsrow .hero-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    background: var(--bg-elevated);
    border: var(--border-thick) solid var(--acc-primary);
    border-radius: var(--rad-md);
    font-size: 22px;
    box-shadow: 0 3px 0 rgba(0,0,0,.5), 0 0 14px rgba(102,214,255,.35), inset 0 -2px 0 rgba(0,0,0,.3);
    text-shadow: 0 0 8px rgba(102,214,255,.5);
    pointer-events: auto;
  }
  #weaponsrow .wpn-slot {
    display: inline-flex; flex-direction: column; align-items: center;
    width: 40px; height: 40px;
    background: var(--bg-panel);
    border: var(--border-thick) solid #2b3752;
    border-radius: var(--rad-md);
    position: relative;
    box-shadow: 0 3px 0 rgba(0,0,0,.45), inset 0 -1px 0 rgba(0,0,0,.25);
    padding: 3px 0 0;
    pointer-events: auto;
    cursor: default;
    overflow: hidden;
    transition: transform .18s var(--ease-bounce);
  }
  #weaponsrow .wpn-slot:hover { transform: translateY(-2px); }
  #weaponsrow .wpn-slot .wpn-icon {
    /* Фиксированный бокс — emoji вписываются в 24×24, не растягивают slot */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 18px;
    line-height: 1;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,.6));
    overflow: hidden;
  }
  #weaponsrow .wpn-slot .wpn-progress {
    position: absolute;
    bottom: 2px; left: 3px; right: 3px;
    height: 3px;
    background: rgba(0,0,0,.5);
    border-radius: var(--rad-pill);
    overflow: hidden;
  }
  #weaponsrow .wpn-slot .wpn-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--acc-primary-dark), var(--acc-primary));
    box-shadow: 0 0 6px currentColor;
    transition: width .3s var(--ease-out);
    border-radius: var(--rad-pill);
  }
  #weaponsrow .wpn-slot .wpn-lvl {
    position: absolute;
    top: -2px; right: -2px;
    background: var(--bg-elevated);
    border: 2px solid currentColor;
    border-radius: var(--rad-pill);
    font-size: 8px; font-weight: 900;
    padding: 0 3px;
    min-width: 12px;
    text-align: center;
    line-height: 1.3;
  }
  /* Rarity by top-suffix */
  #weaponsrow .wpn-slot.rarity-common { border-color: var(--rarity-common); color: var(--rarity-common); }
  #weaponsrow .wpn-slot.rarity-rare { border-color: var(--rarity-rare); color: var(--rarity-rare); box-shadow: 0 3px 0 rgba(0,0,0,.45), var(--glow-rare), inset 0 -1px 0 rgba(0,0,0,.25); }
  #weaponsrow .wpn-slot.rarity-epic { border-color: var(--rarity-epic); color: var(--rarity-epic); box-shadow: 0 3px 0 rgba(0,0,0,.45), var(--glow-epic), inset 0 -1px 0 rgba(0,0,0,.25); }
  #weaponsrow .wpn-slot.rarity-legendary { border-color: var(--rarity-legendary); color: var(--rarity-legendary); box-shadow: 0 3px 0 rgba(0,0,0,.45), var(--glow-legendary), inset 0 -1px 0 rgba(0,0,0,.25); }
  /* Tier2/3 доп-акцент */
  #weaponsrow .wpn-slot.tier2 { background: linear-gradient(180deg, rgba(61,127,214,.18), var(--bg-panel)); }
  #weaponsrow .wpn-slot.tier3 { background: linear-gradient(180deg, rgba(255,157,59,.22), var(--bg-panel)); }
  /* Fusion-ready pulse (lvl=fuseLvl на T1) */
  #weaponsrow .wpn-slot.fusion-ready {
    animation: wpn-fusion-pulse 1s infinite ease-in-out;
  }
  @keyframes wpn-fusion-pulse {
    0%,100% { box-shadow: 0 3px 0 rgba(0,0,0,.45), 0 0 8px currentColor, inset 0 -1px 0 rgba(0,0,0,.25); transform: translateY(0); }
    50% { box-shadow: 0 3px 0 rgba(0,0,0,.45), 0 0 22px currentColor, inset 0 -1px 0 rgba(0,0,0,.25); transform: translateY(-2px); }
  }
  /* T2 на максе → готово к эволюции: золотой пульс + ⭐-бейдж (Variant A телеграф) */
  #weaponsrow .wpn-slot.evo-ready {
    border-color: #ffde3b !important;
    animation: wpn-evo-pulse 1s infinite ease-in-out;
  }
  @keyframes wpn-evo-pulse {
    0%,100% { box-shadow: 0 3px 0 rgba(0,0,0,.45), 0 0 8px #ffde3b, inset 0 -1px 0 rgba(0,0,0,.25); transform: translateY(0); }
    50% { box-shadow: 0 3px 0 rgba(0,0,0,.45), 0 0 24px #ffde3b, inset 0 -1px 0 rgba(0,0,0,.25); transform: translateY(-2px); }
  }
  #weaponsrow .wpn-slot .wpn-evo {
    position: absolute; top: -7px; right: -7px; z-index: 2;
    font-size: 13px; line-height: 1; pointer-events: none;
    filter: drop-shadow(0 0 4px #ffde3b);
  }
  /* ═══════ ACTIVE BUFFS STRIP — chunky ═══════ */
  #activebuffs {
    /* top учитывает чёлку + высоту #bosstimer (обратный таймер до финал-босса),
       чтобы баффы не перекрывались надписью таймера. */
    position: fixed; left: 8px; right: 8px; top: calc(120px + env(safe-area-inset-top, 0px)); z-index: 6;
    pointer-events: none;
    display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
    padding: 0 4px;
    max-height: 40vh;                       /* при переполнении — скролл, не съедаем весь экран */
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
  }
  #activebuffs .buffchip {
    pointer-events: auto; cursor: pointer;
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--bg-panel);
    border: var(--border-md) solid #2b3752;
    border-radius: var(--rad-pill);
    padding: 4px 10px;
    font-size: 11px; font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
    box-shadow: 0 2px 0 rgba(0,0,0,.35), inset 0 -1px 0 rgba(0,0,0,.25);
    transition: transform .15s var(--ease-bounce), box-shadow .15s;
  }
  #activebuffs .buffchip:active {
    transform: translateY(1px) scale(.95);
    box-shadow: 0 1px 0 rgba(0,0,0,.35), inset 0 -1px 0 rgba(0,0,0,.25);
  }
  #activebuffs .buffchip:hover { transform: translateY(-1px); }
  /* Категории */
  #activebuffs .buffchip.timer {
    background: linear-gradient(180deg, rgba(102,214,255,.16), var(--bg-panel));
    border-color: var(--acc-primary);
    color: var(--acc-primary);
    box-shadow: 0 2px 0 rgba(0,0,0,.35), 0 0 12px rgba(102,214,255,.35), inset 0 -1px 0 rgba(0,0,0,.25);
    text-shadow: 0 0 6px rgba(102,214,255,.5);
  }
  #activebuffs .buffchip.bless {
    background: linear-gradient(180deg, rgba(255,238,136,.14), var(--bg-panel));
    border-color: var(--acc-reward);
    color: var(--acc-reward);
    text-shadow: 0 0 6px rgba(255,238,136,.5);
  }
  #activebuffs .buffchip.tal {
    background: linear-gradient(180deg, rgba(255,157,59,.18), var(--bg-panel));
    border-color: var(--rarity-legendary);
    color: var(--rarity-legendary);
    box-shadow: 0 2px 0 rgba(0,0,0,.35), var(--glow-legendary), inset 0 -1px 0 rgba(0,0,0,.25);
    text-shadow: 0 0 8px rgba(255,157,59,.6);
    font-weight: 800;
  }
  #activebuffs .buffchip.affinity {
    background: linear-gradient(180deg, rgba(160,216,255,.14), var(--bg-panel));
    border-color: var(--acc-info);
    color: var(--acc-info);
    text-shadow: 0 0 6px rgba(160,216,255,.5);
  }
  #activebuffs .buffchip.purity {
    background: linear-gradient(180deg, rgba(255,230,107,.15), var(--bg-panel));
    border-color: #ffe66b;
    color: #fff2a0;
    text-shadow: 0 0 6px rgba(255,230,107,.55);
  }
  /* Разделитель между temp и perm */
  #activebuffs .buff-sep {
    display: inline-flex; align-items: center;
    color: var(--text-dim); font-size: 14px;
    padding: 0 4px; opacity: .5;
  }
  /* ═══════ Buff tooltip — chunky reveal ═══════ */
  #bufftip {
    position: fixed; left: 50%; top: calc(118px + env(safe-area-inset-top, 0px));
    transform: translateX(-50%) scale(.9);
    z-index: 8; pointer-events: none;
    display: none;
    max-width: min(340px, 92vw);
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    background: var(--bg-panel);
    border: var(--border-thick) solid var(--acc-primary);
    border-radius: var(--rad-md);
    padding: 12px 16px;
    color: var(--text-primary);
    box-shadow: var(--shadow-elevated), var(--glow-primary);
    transition: transform .18s var(--ease-bounce), opacity .18s;
    opacity: 0;
  }
  #bufftip.show {
    display: block;
    transform: translateX(-50%) scale(1);
    opacity: 1;
    animation: pop-in .25s var(--ease-bounce);
  }
  #bufftip .tipname {
    color: var(--acc-primary);
    font-weight: 900;
    font-size: 15px;
    letter-spacing: .02em;
    margin-bottom: 6px;
    text-shadow: 0 0 8px rgba(102,214,255,.4);
  }
  #bufftip .tipdesc {
    color: var(--text-primary);
    font-size: 12.5px;
    line-height: 1.5;
    font-weight: 500;
  }

  /* ═══════ OVERLAY MODALS — chunky refresh ═══════ */
  .overlay {
    position: fixed; inset: 0;
    background:
      radial-gradient(ellipse at center, rgba(30,40,66,.55) 0%, rgba(8,12,20,.94) 60%, rgba(8,12,20,.98) 100%);
    z-index: 20;
    display: none;
    flex-direction: column; align-items: center;
    justify-content: flex-start;                 /* всегда начинаем сверху → скролл при переполнении */
    padding: max(16px, env(safe-area-inset-top, 0)) 12px max(20px, env(safe-area-inset-bottom, 0));
    text-align: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    overflow-x: hidden;                          /* горизонт-переполнение — крайне не хотим */
    overflow-y: auto;                            /* вертикаль → скролл если много контента */
    -webkit-overflow-scrolling: touch;
  }
  /* НЕ центрируем — иначе на длинном экране заголовок уползает вверх за viewport,
     а кнопки могут оказаться ниже нижнего края. Всегда flex-start → нормальный поток сверху вниз. */
  /* Все overlay-контейнеры сжимаются, не переполняют.
     task #137: flex-shrink:0 ко ВСЕМ overlay-детям (не только #start) —
     кнопка #rerollbtn в #levelup сжималась по вертикали до 20-25px
     и overflow:hidden обрезал нижнюю половину текста. */
  .overlay > * { max-width: 100%; flex-shrink: 0; }
  /* Ambient neon particles фон для overlay-ов */
  .overlay::before {
    content: '';
    position: absolute; inset: 0;
    background:
      radial-gradient(circle at 15% 20%, rgba(102,214,255,.09) 0%, transparent 32%),
      radial-gradient(circle at 85% 30%, rgba(160,216,255,.08) 0%, transparent 32%),
      radial-gradient(circle at 25% 85%, rgba(255,157,59,.07) 0%, transparent 35%),
      radial-gradient(circle at 75% 75%, rgba(192,132,255,.07) 0%, transparent 35%);
    animation: ambient-drift 18s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
  }
  @keyframes ambient-drift {
    0%,100% { transform: scale(1) rotate(0deg); opacity: 1; }
    33% { transform: scale(1.15) rotate(2deg); opacity: .8; }
    66% { transform: scale(1.05) rotate(-2deg); opacity: .9; }
  }
  /* Subtle grid поверх overlay для tech-vibe */
  .overlay::after {
    content: '';
    position: absolute; inset: 0;
    background-image:
      linear-gradient(rgba(102,214,255,.025) 1px, transparent 1px),
      linear-gradient(90deg, rgba(102,214,255,.025) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
    animation: grid-drift 30s linear infinite;
  }
  @keyframes grid-drift {
    from { background-position: 0 0; }
    to { background-position: 40px 40px; }
  }
  .overlay > * { position: relative; z-index: 1; }
  .overlay.show {
    display: flex;
    animation: overlay-fade-in .18s var(--ease-out);
  }
  @keyframes overlay-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  /* Все прямые дети overlay въезжают снизу с bounce */
  .overlay.show > * {
    animation: modal-in .32s var(--ease-bounce) both;
  }
  @keyframes modal-in {
    from { transform: translateY(20px) scale(.92); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
  }
  .overlay h2 {
    color: var(--acc-primary);
    font-weight: 900;
    font-size: clamp(20px, 5vw, 28px);
    letter-spacing: .04em;
    margin-bottom: 14px;
    text-shadow: 0 0 22px rgba(102,214,255,.55), 0 3px 0 rgba(0,0,0,.5);
    text-transform: uppercase;
    max-width: 100%;
    word-wrap: break-word;
  }
  /* Utility-classes для overlay-content */
  .modal-hint {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 14px;
    max-width: min(500px, 92vw);
    font-weight: 500;
  }
  .modal-info {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.8;
    margin-bottom: 12px;
    max-width: min(500px, 92vw);
    font-weight: 500;
  }
  .modal-caption {
    color: var(--text-dim);
    font-size: 12px;
    margin: 8px 0 12px;
    font-weight: 500;
    letter-spacing: .04em;
  }
  #pausebuild, #rescueoffer { width: min(440px, 92vw); margin-bottom: 12px; }
  /* task #124 — sticky кнопки в конце pause menu (не требуют scroll на mobile) */
  #pausemenu .pause-actions {
    position: sticky;
    bottom: 0;
    left: 0; right: 0;
    z-index: 5;
    display: flex; flex-direction: column; align-items: center;
    gap: 6px;
    width: 100%;
    padding: 12px 4px max(12px, env(safe-area-inset-bottom, 0));
    margin-top: 8px;
    background: linear-gradient(180deg, transparent 0%, rgba(6,12,24,.85) 30%, rgba(6,12,24,.97) 60%);
    box-shadow: 0 -8px 20px rgba(0,0,0,.4);
  }
  #pausemenu .pause-actions .bigbtn { margin: 0; }
  #sfxrow, #bgmrow {
    width: min(440px, 92vw);
    margin: 6px 0;
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    background: var(--bg-elevated);
    border-radius: var(--rad-md);
    border: var(--border-md) solid rgba(102,214,255,0.2);
    font-size: 13px; font-weight: 700;
    color: var(--text-primary);
    box-shadow: inset 0 -2px 0 rgba(0,0,0,.25);
  }
  #sfxrow input[type=range], #bgmrow input[type=range] { flex: 1; accent-color: var(--acc-primary); }
  #sfxrow #sfxval, #bgmrow #bgmval { min-width: 42px; text-align: right; color: var(--acc-primary); font-variant-numeric: tabular-nums; }
  /* z-index для отдельных overlay */
  #ad { z-index: 35; }
  #endscreen { z-index: 30; }
  /* Стартовое меню — фон окрашен в цвет активного биома (через --biome-* CSS variables из renderBiomePreview).
     Transition убран — фон меняется мгновенно на реролле биома, чтобы меню не «плыло». */
  #start {
    z-index: 40;
    background:
      radial-gradient(ellipse at 50% 35%,
        color-mix(in srgb, var(--biome-accent, #66d6ff) 14%, transparent) 0%,
        transparent 55%),
      radial-gradient(ellipse at center,
        var(--biome-bg-1, #0f1420) 0%,
        var(--biome-bg-2, #0a0e18) 55%,
        var(--biome-bg-3, #05070c) 100%);
  }
  /* Ambient particles тоже красятся в цвет биома. Всё статично: ни transition, ни infinite animation. */
  #start::before {
    background:
      radial-gradient(circle at 12% 18%, color-mix(in srgb, var(--biome-accent, #66d6ff) 16%, transparent) 0%, transparent 32%),
      radial-gradient(circle at 88% 28%, color-mix(in srgb, var(--biome-accent, #66d6ff) 12%, transparent) 0%, transparent 32%),
      radial-gradient(circle at 22% 82%, color-mix(in srgb, var(--biome-accent, #66d6ff) 10%, transparent) 0%, transparent 35%),
      radial-gradient(circle at 78% 78%, color-mix(in srgb, var(--biome-accent, #66d6ff) 10%, transparent) 0%, transparent 35%);
    animation: none;
  }
  /* Grid поверх #start — тоже в цвет биома (тонкий accent). grid-drift отключён. */
  #start::after {
    background-image:
      linear-gradient(color-mix(in srgb, var(--biome-accent, #66d6ff) 4%, transparent) 1px, transparent 1px),
      linear-gradient(90deg, color-mix(in srgb, var(--biome-accent, #66d6ff) 4%, transparent) 1px, transparent 1px);
    animation: none;
  }
  /* h1 title-glow отключён на #start — фон должен быть спокойным */
  #start h1 { animation: none; }
  /* Pulse ободка выбранной карточки отключён на #start (был charcard-sel-pulse infinite) */
  #start .charcard.sel::after { animation: none; opacity: 1; }
  /* Emoji breathe отключён — просто статичное отображение */
  #start .bp-emoji { animation: none; }
  /* «Плывущий вход» блоков (modal-in translateY 20px → 0) убран на #start —
     блоки просто появляются, ничего не плавает */
  #start.show > * { animation: none; }
  /* Запрет flex-shrink детям #start. .overlay = flex-column; при переполнении
     контента дети по умолчанию сжимались до неузнаваемости (baner схлопывался
     в тонкую полоску 15px). Теперь блоки держат свою высоту, overflow-y overlay
     даёт scroll вместо сжатия. */
  #start > * { flex-shrink: 0; }
  /* Портрет-эмодзи карт: убрать breathe/glow-pulse — пусть статичный */
  #start .chportrait::before { animation: none; }
  #start .charcard.sel .chemoji { animation: none; }
  /* Big-button блеск-полоса на #start убирается — на playbtn достаточно статики */
  #start .bigbtn::before { animation: none; opacity: 0; }
  #startschemebtn::before { animation: none; opacity: 0; }
  #ad #adcnt { font-size: 32px; color: var(--acc-primary); font-weight: 900; text-shadow: 0 0 12px rgba(102,214,255,.6); }
  #ad .ad-note { font-size: 12px; color: var(--text-dim); font-weight: 500; }
  #talcontent { margin-bottom: 18px; }
  #rerollbtn { margin-top: 8px; }
  #bonusok, #schemeclose { margin-top: 14px; }

  /* ═══════ LEVEL-UP CARDS — chunky ═══════ */
  .card {
    width: min(560px, 96vw);
    background: linear-gradient(180deg, var(--bg-elevated), var(--bg-panel));
    border: var(--border-thick) solid #2b3752;
    border-radius: var(--rad-lg);
    padding: 14px 18px;
    margin: 7px 0;
    cursor: pointer;
    pointer-events: auto;
    text-align: left;
    box-shadow: 0 5px 0 rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35), inset 0 -3px 0 rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.05);
    transition: transform .16s var(--ease-bounce), box-shadow .16s, border-color .16s;
    position: relative;
    overflow: hidden;
  }
  .card::before {
    /* Subtle top-highlight strip */
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 40%;
    background: linear-gradient(180deg, rgba(255,255,255,.04), transparent);
    pointer-events: none;
  }
  .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 0 rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.45), inset 0 -3px 0 rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.06);
    border-color: var(--acc-primary);
  }
  .card:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 rgba(0,0,0,.4), 0 3px 10px rgba(0,0,0,.4), inset 0 -1px 0 rgba(0,0,0,.25);
  }
  .card .cname {
    font-size: 16px;
    font-weight: 800;
    color: var(--acc-reward);
    margin-bottom: 4px;
    text-shadow: 0 1px 0 rgba(0,0,0,.4);
  }
  .card .cdesc {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.35;
    /* Отзыв: описания коротить до ~1 строки. Клэмп до 2 строк макс. */
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .card .clvl {
    float: right;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-dim);
    padding: 2px 8px;
    background: rgba(0,0,0,.25);
    border-radius: var(--rad-pill);
    letter-spacing: .05em;
  }
  /* Tier 1 — обычные stat/weapon карточки */
  .card.t1 {
    border-color: var(--acc-primary-dark);
    box-shadow: 0 5px 0 rgba(0,0,0,.4), 0 0 12px rgba(102,214,255,.2), inset 0 -3px 0 rgba(0,0,0,.25);
  }
  .card.t1 .clvl { color: var(--acc-primary); background: rgba(102,214,255,.15); }
  /* Tier 2 — fusion */
  .card.t2 {
    border-color: var(--acc-info);
    background: linear-gradient(180deg, rgba(160,216,255,.12), var(--bg-panel));
    box-shadow: 0 5px 0 rgba(0,0,0,.4), 0 0 22px rgba(160,216,255,.35), inset 0 -3px 0 rgba(0,0,0,.25);
  }
  .card.t2 .cname { color: var(--acc-info); text-shadow: 0 0 12px rgba(160,216,255,.5); }
  .card.t2 .clvl { color: var(--acc-info); background: rgba(160,216,255,.18); }
  /* Tier 3 — ultimate fusion */
  .card.t3 {
    border-color: var(--rarity-legendary);
    background: linear-gradient(180deg, rgba(255,157,59,.18), var(--bg-panel));
    box-shadow: 0 5px 0 rgba(0,0,0,.4), var(--glow-legendary), inset 0 -3px 0 rgba(0,0,0,.25);
    animation: t3-pulse 2s infinite ease-in-out;
  }
  /* Class-perk — уникальный лиловый акцент, чтобы игрок не путал классовые с обычными stat */
  .card.class-perk {
    border-color: #c9b6ff;
    background: linear-gradient(180deg, rgba(201,182,255,.13), var(--bg-panel));
    box-shadow: 0 5px 0 rgba(0,0,0,.4), 0 0 20px rgba(201,182,255,.4), inset 0 -3px 0 rgba(0,0,0,.25);
  }
  .card.class-perk .cname { color: #c9b6ff; text-shadow: 0 0 6px rgba(201,182,255,.4); }
  /* Rarity overrides — применяются поверх t1/t2 когда суффикс rare+ */
  .card.rar-rare {
    border-color: #5cb8ff;
    box-shadow: 0 5px 0 rgba(0,0,0,.4), 0 0 16px rgba(92,184,255,.4), inset 0 -3px 0 rgba(0,0,0,.25);
  }
  .card.rar-epic {
    border-color: #c084ff;
    background: linear-gradient(180deg, rgba(192,132,255,.14), var(--bg-panel));
    box-shadow: 0 5px 0 rgba(0,0,0,.4), 0 0 24px rgba(192,132,255,.55), inset 0 -3px 0 rgba(0,0,0,.25);
  }
  .card.rar-legendary {
    border-color: #ff9d3b;
    background: linear-gradient(180deg, rgba(255,157,59,.20), var(--bg-panel));
    box-shadow: 0 5px 0 rgba(0,0,0,.4), 0 0 32px rgba(255,157,59,.75), 0 0 60px rgba(255,222,59,.4), inset 0 -3px 0 rgba(0,0,0,.25);
    animation: t3-pulse 2s infinite ease-in-out;
  }
  @keyframes t3-pulse {
    0%,100% { box-shadow: 0 5px 0 rgba(0,0,0,.4), var(--glow-legendary), inset 0 -3px 0 rgba(0,0,0,.25); }
    50% { box-shadow: 0 5px 0 rgba(0,0,0,.4), 0 0 40px rgba(255,157,59,.85), 0 0 6px rgba(255,157,59,1), inset 0 -3px 0 rgba(0,0,0,.25); }
  }
  /* Evolution — редчайшая карта (T3-эволют, не обычный ульт).
     Rainbow-shimmer border + пульсирующий multi-color glow. */
  .card.t3.evolution {
    border-color: #ffde3b;
    background: linear-gradient(180deg, rgba(255,157,59,.22), rgba(201,182,255,.10), var(--bg-panel));
    animation: evolution-shimmer 2.4s infinite ease-in-out;
  }
  @keyframes evolution-shimmer {
    0%,100% {
      box-shadow:
        0 5px 0 rgba(0,0,0,.4),
        0 0 32px rgba(255,222,59,.75),
        0 0 60px rgba(201,182,255,.35),
        inset 0 -3px 0 rgba(0,0,0,.25);
    }
    33% {
      box-shadow:
        0 5px 0 rgba(0,0,0,.4),
        0 0 40px rgba(255,157,59,.9),
        0 0 70px rgba(255,222,59,.5),
        inset 0 -3px 0 rgba(0,0,0,.25);
    }
    66% {
      box-shadow:
        0 5px 0 rgba(0,0,0,.4),
        0 0 40px rgba(201,182,255,.9),
        0 0 70px rgba(160,216,255,.5),
        inset 0 -3px 0 rgba(0,0,0,.25);
    }
  }
  .card.t3 .cname { color: var(--rarity-legendary); text-shadow: 0 0 14px rgba(255,157,59,.6); font-size: 18px; }
  .card.t3 .clvl { color: var(--rarity-legendary); background: rgba(255,157,59,.2); }
  /* Trait cards — purple accent */
  .card.isnew {
    outline: none;
    animation: card-new-pulse 1.4s infinite;
  }
  @keyframes card-new-pulse {
    0%,100% { border-color: var(--acc-primary); }
    50% { border-color: var(--rarity-mythic); }
  }
  .newbadge {
    display: inline-block;
    background: linear-gradient(180deg, var(--acc-primary), var(--acc-primary-dark));
    color: var(--text-inverse);
    font-size: 10px;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: var(--rad-pill);
    margin-right: 8px;
    vertical-align: 2px;
    letter-spacing: .05em;
    box-shadow: 0 2px 0 rgba(0,0,0,.35), 0 0 10px rgba(102,214,255,.4);
    text-shadow: 0 1px 0 rgba(255,255,255,.35);
  }
  .fusehint {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 5px;
    line-height: 1.4;
    border-top: 1px dashed rgba(255,255,255,.08);
    padding-top: 5px;
    font-weight: 500;
    /* Отзыв: подсказки (синергия/слияние) в 1 строку — не раздувать карточку */
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
    overflow: hidden; white-space: normal;
  }
  .fusehint b { color: var(--text-secondary); font-weight: 700; }
  .fusehint .own { color: var(--acc-primary); font-weight: 800; text-shadow: 0 0 6px rgba(102,214,255,.35); }
  .fusehint .miss { color: var(--text-dim); }
  .gchip {
    display: inline-block;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 8px;
    border: var(--border-thin) solid;
    border-radius: var(--rad-pill);
    margin-left: 8px;
    letter-spacing: .05em;
    text-transform: uppercase;
    vertical-align: 2px;
  }
  /* ═══════ MYBUILD PANEL (level-up + pause) ═══════ */
  #mybuild {
    width: min(560px, 96vw);
    margin-bottom: 12px;
    background: var(--bg-panel);
    border: var(--border-md) solid var(--bg-elevated);
    border-radius: var(--rad-md);
    padding: 10px 12px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,.35);
  }
  .brow {
    display: flex; align-items: center; flex-wrap: wrap;
    gap: 5px;
    margin: 5px 0;
    font-size: 12px;
    text-align: left;
  }
  .blab {
    font-weight: 900;
    font-size: 10px;
    letter-spacing: .15em;
    margin-right: 8px;
    min-width: 100px;
    text-align: left;
    text-transform: uppercase;
    color: var(--text-secondary);
  }
  .bchip {
    background: var(--bg-elevated);
    border: var(--border-md) solid #2b3752;
    border-radius: var(--rad-sm);
    padding: 3px 8px;
    color: var(--text-primary);
    font-weight: 600;
    position: relative;
    cursor: default;
    font-size: 11px;
    box-shadow: inset 0 -1px 0 rgba(0,0,0,.3);
  }
  .bchip.tier2 { border-color: var(--acc-info); color: var(--acc-info); }
  .bchip.tier3 { border-color: var(--rarity-legendary); color: var(--rarity-legendary); }
  .bchip.own { background: linear-gradient(180deg, rgba(102,214,255,.15), var(--bg-elevated)); border-color: var(--acc-primary); color: var(--acc-primary); }
  .bchip .chaintip {
    display: none;
    position: absolute;
    bottom: 120%; left: 50%;
    transform: translateX(-50%);
    background: var(--bg-panel);
    border: var(--border-md) solid var(--acc-primary);
    border-radius: var(--rad-md);
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 50;
    color: var(--text-primary);
    box-shadow: var(--shadow-elevated), var(--glow-primary);
  }
  .bchip:hover .chaintip, .bchip:active .chaintip { display: block; }
  .bnone { color: var(--text-dim); font-style: italic; }

  /* ═══════ V1 ICONIC SIDEBAR — крупные фокусные chips + mini icon rows ═══════ */
  .bprimary-row {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin: 2px 0 8px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--bg-elevated);
    justify-content: flex-start;
    align-items: center;
  }
  .bpchip {
    background: var(--bg-elevated);
    border: 2px solid #2b3752;
    border-radius: var(--rad-sm);
    padding: 4px 9px;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.2;
    box-shadow: inset 0 -1px 0 rgba(0,0,0,.3);
    min-width: 62px;
    justify-content: center;
  }
  .bpchip .bpicon { font-size: 15px; }
  .bpchip.hp   { color: #ffb0c2; border-color: rgba(255,124,156,.42); }
  .bpchip.dmg  { color: #ffcf6b; border-color: rgba(255,207,107,.42); }
  .bpchip.crit { color: #ffde3b; border-color: rgba(255,222,59,.42); }
  .bpchip.mag  { color: #8be9ff; border-color: rgba(139,233,255,.42); }
  .bpchip.el   { color: #d8c0ff; border-color: rgba(201,182,255,.42); font-size: 12px; padding: 4px 7px; }

  /* Icon rows — mini icons + tiny superscript level */
  .bicon-row {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 4px;
    margin: 3px 0;
  }
  .biclabel {
    font-size: 9px; letter-spacing: .12em; text-transform: uppercase;
    color: var(--text-dim); font-weight: 900;
    min-width: 34px; text-align: left; margin-right: 4px;
  }
  .bic {
    position: relative;
    width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 5px;
    background: var(--bg-elevated);
    border: 1.5px solid #2b3752;
    font-size: 16px; line-height: 1;
    cursor: default;
    flex-shrink: 0;
  }
  .bic.own    { border-color: var(--acc-primary); }
  .bic.max    { border-color: var(--acc-reward); box-shadow: 0 0 5px rgba(255,238,136,.45); }
  .bic.ready  { border-color: #7dffb0; box-shadow: 0 0 6px rgba(125,255,176,.55); animation: bic-ready-pulse 1.2s ease-in-out infinite; }
  .bic.tier3  { border-color: var(--rarity-legendary); box-shadow: 0 0 5px rgba(255,157,59,.45); }
  @keyframes bic-ready-pulse {
    0%,100% { box-shadow: 0 0 6px rgba(125,255,176,.55); }
    50% { box-shadow: 0 0 10px rgba(125,255,176,.85); }
  }
  .biclvl {
    position: absolute; bottom: -4px; right: -4px;
    font-size: 9px; font-weight: 900;
    background: var(--bg-deep);
    border-radius: 3px;
    padding: 0 3px;
    color: var(--acc-primary);
    min-width: 10px; text-align: center;
    border: 1px solid #2b3752;
    line-height: 1.2;
  }
  .bic.max .biclvl { color: var(--acc-reward); border-color: var(--acc-reward); }
  .bic.tier3 .biclvl { color: var(--rarity-legendary); border-color: var(--rarity-legendary); }
  .bicttp {
    display: none;
    position: absolute;
    bottom: 130%; left: 50%; transform: translateX(-50%);
    background: var(--bg-panel);
    border: 2px solid var(--acc-primary);
    border-radius: var(--rad-md);
    padding: 6px 10px;
    font-size: 11px; font-weight: 500;
    white-space: nowrap; z-index: 60;
    color: var(--text-primary);
    box-shadow: var(--shadow-elevated);
    pointer-events: none;
  }
  .bic:hover .bicttp, .bic:active .bicttp { display: block; }

  .bexpand-toggle {
    display: inline-block;
    margin: 6px 0 2px 0;
    padding: 4px 12px;
    background: var(--bg-elevated);
    border: 1.5px solid #2b3752;
    border-radius: var(--rad-sm);
    font-size: 11px; font-weight: 700;
    color: var(--acc-primary);
    cursor: pointer;
    letter-spacing: .05em;
  }
  .bexpand-toggle:hover { border-color: var(--acc-primary); }
  .bdetail-block {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #2b3752;
  }

  /* окно левел-апа — шире и с местом под билд; скролл если не влезает */
  #levelup { padding:12px; overflow-y:auto; justify-content:flex-start; padding-top:20px; padding-bottom:20px; }
  #levelup h2 { margin-bottom:8px; flex-shrink:0; }
  #cards { width:min(560px,96vw); display:flex; flex-direction:column; gap:6px; }
  /* Каскад появления карточек: 5 slots с delay */
  #cards .card {
    animation: card-slide-in .35s var(--ease-bounce) both;
  }
  #cards .card:nth-child(1) { animation-delay: .1s; }
  #cards .card:nth-child(2) { animation-delay: .2s; }
  #cards .card:nth-child(3) { animation-delay: .3s; }
  #cards .card:nth-child(4) { animation-delay: .4s; }
  #cards .card:nth-child(5) { animation-delay: .5s; }
  @keyframes card-slide-in {
    from { transform: translateX(-40px) rotate(-3deg); opacity: 0; }
    to { transform: translateX(0) rotate(0); opacity: 1; }
  }
  #mybuild { width:min(560px,96vw); }

  /* стихийный баннер в окне левел-апа */
  #affbanner {
    width: min(560px, 96vw);
    font-size: 12.5px;
    font-weight: 600;
    border: var(--border-md) solid transparent;
    border-radius: var(--rad-md);
    padding: 9px 14px;
    margin-bottom: 10px;
    text-align: left;
    display: none;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,.2);
  }
  #affbanner.show { display: block; }
  /* .bnone стилизован выше */

  /* ═══════ BIOME PREVIEW — показывается ДО выбора героя ═══════ */
  /* ═══════ BIOME PREVIEW — cinematic banner (PoE Atlas-style, компакт по высоте) ═══════ */
  #biomepreview {
    width: min(880px, 96vw);
    background:
      radial-gradient(ellipse at 15% 50%,
        color-mix(in srgb, var(--biome-accent, #66d6ff) 30%, transparent) 0%,
        transparent 55%),
      linear-gradient(105deg,
        var(--biome-bg-1, #0f1420) 0%,
        var(--biome-bg-2, #0a0e18) 60%,
        color-mix(in srgb, var(--biome-accent, #66d6ff) 12%, var(--biome-bg-2, #0a0e18)) 100%);
    border: var(--border-md) solid color-mix(in srgb, var(--biome-accent, #66d6ff) 55%, #2b3752);
    border-radius: var(--rad-md);
    padding: 8px 10px;
    margin-bottom: 8px;
    box-shadow:
      0 3px 0 rgba(0,0,0,.45),
      0 0 18px color-mix(in srgb, var(--biome-accent, #66d6ff) 22%, transparent),
      inset 0 -2px 0 rgba(0,0,0,.35),
      inset 0 1px 0 rgba(255,255,255,.05);
    display: grid;
    grid-template-columns: 62px 1fr auto;
    align-items: center;
    gap: 10px;
    position: relative;
    text-align: left;
    overflow: hidden;
  }
  /* Subtle scanlines для tech-atmosphere */
  #biomepreview::after {
    content: '';
    position: absolute; inset: 0;
    background: repeating-linear-gradient(0deg,
      transparent 0, transparent 3px,
      rgba(0,0,0,.06) 3px, rgba(0,0,0,.06) 4px);
    pointer-events: none;
    opacity: .35;
    z-index: 0;
  }
  #biomepreview > * { position: relative; z-index: 1; }

  /* Big emoji-arte «портрет» биома */
  #biomepreview .bp-artframe {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 62px; height: 54px;
    border-radius: var(--rad-md);
    background:
      radial-gradient(circle at 50% 55%,
        color-mix(in srgb, var(--biome-accent, #66d6ff) 55%, transparent) 0%,
        transparent 70%),
      linear-gradient(180deg, rgba(0,0,0,.4) 0%, rgba(0,0,0,.15) 100%);
    box-shadow: inset 0 -3px 0 rgba(0,0,0,.5), inset 0 0 24px rgba(0,0,0,.4),
                0 0 0 1px color-mix(in srgb, var(--biome-accent, #66d6ff) 40%, transparent);
    position: relative;
    overflow: hidden;
  }
  #biomepreview .bp-artframe::before {
    content: '';
    position: absolute; inset: 0;
    background: repeating-linear-gradient(0deg,
      transparent 0, transparent 3px,
      rgba(0,0,0,.14) 3px, rgba(0,0,0,.14) 4px);
    pointer-events: none;
  }
  #biomepreview .bp-emoji {
    font-size: 32px;
    line-height: 1;
    filter:
      drop-shadow(0 3px 4px rgba(0,0,0,.65))
      drop-shadow(0 0 12px color-mix(in srgb, var(--biome-accent, #66d6ff) 75%, transparent));
    z-index: 2;
  }

  #biomepreview .bp-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
  }
  #biomepreview .bp-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 2px;
  }
  #biomepreview .bp-eyebrow {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--text-dim);
    text-shadow: 0 1px 0 rgba(0,0,0,.5);
  }
  #biomepreview .bp-name {
    font-size: 17px;
    font-weight: 900;
    color: var(--biome-accent, #66d6ff);
    text-shadow:
      0 0 12px color-mix(in srgb, var(--biome-accent, #66d6ff) 60%, transparent),
      0 2px 0 rgba(0,0,0,.5);
    letter-spacing: .03em;
    text-transform: uppercase;
    line-height: 1.1;
  }
  #biomepreview .bp-bonus,
  #biomepreview .bp-warn {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-secondary);
  }
  #biomepreview .bp-tag {
    font-size: 9.5px;
    font-weight: 900;
    letter-spacing: .12em;
    padding: 2px 8px;
    border-radius: var(--rad-pill);
    text-transform: uppercase;
    flex-shrink: 0;
    box-shadow: inset 0 -1px 0 rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.06);
  }
  #biomepreview .bp-bonus .bp-tag {
    background: rgba(125,255,176,.15);
    color: #7dffb0;
    text-shadow: 0 0 6px rgba(125,255,176,.5);
  }
  #biomepreview .bp-bonus-text { color: #b5f4c9; }
  #biomepreview .bp-warn .bp-tag {
    background: rgba(255,124,156,.15);
    color: #ff8a9c;
    text-shadow: 0 0 6px rgba(255,124,156,.5);
  }
  #biomepreview .bp-warn-text { color: #f5b3bc; }

  #biomepreview .bp-reroll {
    pointer-events: auto;
    background:
      linear-gradient(180deg,
        color-mix(in srgb, var(--biome-accent, #66d6ff) 25%, rgba(0,0,0,.25)) 0%,
        rgba(0,0,0,.35) 100%);
    color: var(--text-primary);
    border: 2px solid color-mix(in srgb, var(--biome-accent, #66d6ff) 55%, transparent);
    border-radius: var(--rad-md);
    padding: 5px 8px;
    font-family: inherit;
    font-weight: 800;
    font-size: 10px;
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow:
      0 3px 0 rgba(0,0,0,.45),
      0 0 12px color-mix(in srgb, var(--biome-accent, #66d6ff) 25%, transparent),
      inset 0 -2px 0 rgba(0,0,0,.35),
      inset 0 1px 0 rgba(255,255,255,.06);
    transition: transform .14s var(--ease-bounce), border-color .18s, box-shadow .18s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    min-width: 50px;
  }
  #biomepreview .bp-reroll-icon { font-size: 17px; line-height: 1; filter: drop-shadow(0 2px 3px rgba(0,0,0,.5)); }
  #biomepreview .bp-reroll-label { font-size: 8px; color: color-mix(in srgb, var(--biome-accent, #66d6ff) 90%, white); text-shadow: 0 1px 0 rgba(0,0,0,.6); }
  #biomepreview .bp-reroll:hover {
    transform: translateY(-2px);
    border-color: var(--biome-accent, #66d6ff);
    box-shadow: 0 5px 0 rgba(0,0,0,.45), 0 0 18px color-mix(in srgb, var(--biome-accent, #66d6ff) 55%, transparent), inset 0 -2px 0 rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.08);
  }
  #biomepreview .bp-reroll:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 rgba(0,0,0,.45), inset 0 -1px 0 rgba(0,0,0,.35);
  }
  /* Mobile — компактнее */
  @media (max-width: 559px) {
    #biomepreview {
      grid-template-columns: 66px 1fr auto;
      gap: 10px;
      padding: 8px 8px 8px 8px;
    }
    #biomepreview .bp-artframe { width: 66px; height: 56px; }
    #biomepreview .bp-emoji { font-size: 34px; }
    #biomepreview .bp-name { font-size: 17px; letter-spacing: .03em; }
    #biomepreview .bp-eyebrow { font-size: 9px; letter-spacing: .18em; }
    #biomepreview .bp-bonus, #biomepreview .bp-warn { font-size: 10.5px; }
    #biomepreview .bp-tag { font-size: 8.5px; padding: 1px 6px; }
    #biomepreview .bp-reroll { padding: 6px 8px; min-width: 48px; }
    #biomepreview .bp-reroll-icon { font-size: 17px; }
    #biomepreview .bp-reroll-label { display: none; }
  }

  /* ═══════ DIFFICULTY PICKER — 10 tiers (Balatro Stakes-style) ═══════ */
  /* Секция «дышит» цветом выбранной сложности через --diff-solid (JS-inline) */
  #diffpicker {
    width: min(880px, 96vw);
    margin-bottom: 10px;
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    background:
      linear-gradient(180deg,
        color-mix(in srgb, var(--diff-solid, #66d6ff) 10%, transparent) 0%,
        transparent 60%),
      linear-gradient(180deg, var(--bg-elevated), var(--bg-panel));
    border: var(--border-md) solid color-mix(in srgb, var(--diff-solid, #66d6ff) 40%, #2b3752);
    border-radius: var(--rad-md);
    box-shadow:
      0 3px 0 rgba(0,0,0,.4),
      0 0 18px color-mix(in srgb, var(--diff-solid, #66d6ff) 22%, transparent),
      inset 0 -2px 0 rgba(0,0,0,.25),
      inset 0 1px 0 rgba(255,255,255,.04);
    position: relative;
  }
  .diffchips {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
  }
  .diffchip {
    pointer-events: auto;
    background: linear-gradient(180deg, var(--bg-panel) 0%, var(--bg-deep) 100%);
    border: var(--border-md) solid #2b3752;
    border-radius: var(--rad-sm);
    padding: 5px 2px 6px;
    color: var(--text-secondary);
    font-family: inherit;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transition: transform .14s var(--ease-bounce), border-color .18s, box-shadow .18s, background .18s;
    min-height: 62px;
    position: relative;
    overflow: hidden;
  }
  .diffchip::before {
    /* Top-highlight bar в цвет chip'а — как ленточка */
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: var(--diff-color, var(--acc-primary));
    opacity: .35;
    transition: opacity .18s, height .18s;
  }
  .diffchip:hover {
    border-color: var(--diff-color, var(--acc-primary));
    transform: translateY(-2px);
    box-shadow: 0 4px 0 rgba(0,0,0,.35), 0 0 12px color-mix(in srgb, var(--diff-color) 40%, transparent);
  }
  .diffchip:hover::before { opacity: .75; }
  .diffchip.std::after {
    content: '★';
    position: absolute;
    top: 3px; right: 4px;
    font-size: 10px;
    color: var(--acc-reward);
    text-shadow: 0 0 4px var(--acc-reward);
    z-index: 2;
  }
  .diffchip.sel {
    border-color: var(--diff-color, var(--acc-primary));
    background:
      radial-gradient(ellipse at 50% 100%, color-mix(in srgb, var(--diff-color) 30%, transparent) 0%, transparent 70%),
      linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-panel) 100%);
    box-shadow:
      0 3px 0 rgba(0,0,0,.35),
      0 0 16px color-mix(in srgb, var(--diff-color) 55%, transparent),
      inset 0 0 0 1px color-mix(in srgb, var(--diff-color) 50%, transparent),
      inset 0 -2px 0 rgba(0,0,0,.3);
    color: var(--text-primary);
    transform: translateY(-1px);
  }
  .diffchip.sel::before { opacity: 1; height: 4px; }
  /* task #135: locked difficulty — greyed out, 🔒 в diffnum, shake on click */
  .diffchip.locked {
    opacity: 0.35;
    filter: grayscale(0.75);
    cursor: not-allowed;
  }
  .diffchip.locked:hover {
    transform: none;
    background: linear-gradient(180deg, var(--bg-panel-alt), var(--bg-panel));
    box-shadow: 0 3px 0 rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.03);
    color: var(--text-dim);
  }
  .diffchip.locked .diffnum { font-size: 15px; }
  .diffchip.shake-locked {
    animation: diffchip-shake 0.4s;
  }
  @keyframes diffchip-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(2px); }
  }
  .diffchip .diffnum {
    font-size: 13px;
    font-weight: 900;
    color: var(--text-dim);
    letter-spacing: .04em;
    line-height: 1;
    font-family: 'Rubik', system-ui, sans-serif;
    text-shadow: 0 1px 0 rgba(0,0,0,.5);
  }
  .diffchip.sel .diffnum {
    color: var(--diff-color, var(--acc-primary));
    text-shadow: 0 0 8px color-mix(in srgb, var(--diff-color) 65%, transparent), 0 1px 0 rgba(0,0,0,.5);
  }
  .diffchip .diffemoji {
    font-size: 20px;
    line-height: 1;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)) drop-shadow(0 0 6px color-mix(in srgb, var(--diff-color) 30%, transparent));
    transition: transform .18s var(--ease-bounce);
  }
  .diffchip:hover .diffemoji { transform: scale(1.15); }
  .diffchip.sel .diffemoji {
    filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)) drop-shadow(0 0 10px color-mix(in srgb, var(--diff-color) 70%, transparent));
  }
  .diffchip .diffname { display: none; }

  /* Preview панель — заголовок + 4 bar-chart'а в цвет */
  .diffpreview {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px 10px;
    background: rgba(0,0,0,.28);
    border-radius: var(--rad-sm);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.03), inset 0 -1px 0 rgba(0,0,0,.35);
  }
  .diffpreview-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--diff-solid, var(--acc-primary));
    text-shadow: 0 0 10px color-mix(in srgb, var(--diff-solid, #66d6ff) 40%, transparent), 0 1px 0 rgba(0,0,0,.5);
  }
  .diffpreview-title .dpt-emoji { font-size: 18px; line-height: 1; }
  .diffpreview-title .dpt-name { flex: 1; text-align: left; }
  .diffpreview-title .dpt-tier {
    font-size: 10.5px;
    letter-spacing: .1em;
    color: var(--text-dim);
    font-weight: 800;
    padding: 2px 8px;
    background: rgba(0,0,0,.3);
    border-radius: var(--rad-pill);
    box-shadow: inset 0 -1px 0 rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.05);
  }
  /* task #121 — collapse impact bars toggle */
  .diffpreview-title .dpt-toggle {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .05em;
    padding: 3px 10px;
    border-radius: var(--rad-pill);
    background: rgba(102,214,255,.10);
    color: var(--acc-primary, #66d6ff);
    border: 1px solid rgba(102,214,255,.25);
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
  }
  .diffpreview-title .dpt-toggle:hover { background: rgba(102,214,255,.20); transform: translateY(-1px); }
  .diffpreview-title .dpt-toggle:active { transform: translateY(0); }
  .diffpreview.compact { padding: 6px 10px; }
  .diffpreview.compact .diffpreview-title { padding: 0; }
  /* Строка награды за сложность (риск=выгода) — всегда видна */
  .diffreward {
    display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
    margin-top: 5px; font-size: 12px; font-weight: 800; letter-spacing: .02em;
  }
  .diffreward .dr-xp { color: #5cb8ff; }
  .diffreward .dr-loot { color: #ffde3b; }
  .diffreward .dr-base { color: var(--text-secondary); font-weight: 700; }
  .diffbars {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 12px;
  }
  @media (max-width: 559px) {
    .diffbars { grid-template-columns: 1fr; gap: 3px; }
  }
  .diffbar {
    display: grid;
    grid-template-columns: 46px 1fr 44px;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-secondary);
    letter-spacing: .03em;
  }
  .diffbar .db-label { text-align: left; text-transform: uppercase; font-weight: 900; color: var(--text-primary); }
  .diffbar .db-track {
    position: relative;
    height: 8px;
    background: rgba(0,0,0,.5);
    border-radius: var(--rad-pill);
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.04);
  }
  .diffbar .db-fill {
    position: absolute;
    top: 0; bottom: 0; left: 0;
    background: linear-gradient(90deg,
      color-mix(in srgb, var(--diff-solid, #66d6ff) 55%, transparent) 0%,
      var(--diff-solid, #66d6ff) 100%);
    border-radius: var(--rad-pill);
    box-shadow: 0 0 6px color-mix(in srgb, var(--diff-solid, #66d6ff) 60%, transparent);
    transition: width .25s var(--ease-out);
  }
  .diffbar .db-baseline {
    /* Отметка 1.0× — «стандарт» */
    position: absolute;
    top: -2px; bottom: -2px;
    width: 2px;
    background: rgba(255,255,255,.35);
    box-shadow: 0 0 3px rgba(255,255,255,.5);
    border-radius: 2px;
  }
  .diffbar .db-value {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    color: var(--diff-solid, var(--acc-primary));
    text-shadow: 0 1px 0 rgba(0,0,0,.5);
  }
  .diffbar.up .db-value { color: #ff8a6b; }
  .diffbar.down .db-value { color: #7dffb0; }

  /* ═══════ QUICK PLAY panel (task #141) — 1-2 сек до первого клика ═══════ */
  #quickplay {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 18px 20px 22px;
    background: linear-gradient(180deg, rgba(125,255,176,.05), rgba(10,26,18,.35));
    border: 2px solid rgba(125,255,176,.25);
    border-radius: 16px;
    margin: 8px 0 14px;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 6px 30px rgba(0,0,0,.4), 0 0 40px rgba(125,255,176,.08);
  }
  #quickplay #playbtn {
    width: 100%;
    font-size: clamp(18px, 4.5vw, 22px) !important;
    padding: clamp(14px, 4vw, 18px) clamp(28px, 6vw, 42px) !important;
    letter-spacing: .1em;
  }
  #quickplay-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
  }
  .qp-portrait {
    flex-shrink: 0;
    width: 64px; height: 64px;
    border-radius: 12px;
    border: 2px solid rgba(125,255,176,.35);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 16px rgba(125,255,176,.15), inset 0 -2px 0 rgba(0,0,0,.2);
  }
  .qp-emoji { font-size: 40px; line-height: 1; filter: drop-shadow(0 0 6px rgba(255,255,255,.35)); }
  .qp-info { flex: 1; min-width: 0; text-align: left; }
  .qp-name { font-weight: 900; font-size: 17px; color: var(--acc-primary); letter-spacing: .04em; }
  .qp-role { font-weight: 600; font-size: 12px; color: var(--text-dim); margin-top: 1px; }
  .qp-diff-line {
    font-weight: 700; font-size: 11px; margin-top: 4px; letter-spacing: .04em;
    display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap;
    cursor: pointer; pointer-events: auto;
    padding: 3px 8px; border-radius: var(--rad-pill);
    border: 1px solid color-mix(in srgb, var(--diff-color, #66d6ff) 45%, transparent);
    background: color-mix(in srgb, var(--diff-color, #66d6ff) 12%, transparent);
    transition: transform .1s, background .12s;
  }
  .qp-diff-line:active { transform: scale(.97); }
  .qp-diff-line .qp-diff-tier { color: var(--diff-color, #66d6ff); text-transform: uppercase; }
  .qp-diff-line .qp-diff-rew { font-weight: 800; }
  .qp-diff-line .qp-diff-rew { color: #ffde3b; }
  .qp-diff-line .qp-diff-more { color: var(--text-dim); font-weight: 900; }
  #quickplay-info {
    text-align: center;
    font-size: 12px;
    color: var(--text-dim);
    min-height: 16px;
  }
  #advancedToggle {
    width: auto !important;
    font-size: 13px !important;
    padding: 8px 18px !important;
    opacity: 0.75;
    letter-spacing: .04em;
    animation: none !important;
  }
  #advancedToggle:hover { opacity: 1; }
  #advancedToggle.is-open span::before {
    content: '▲ ';
    display: inline-block;
    margin-right: 4px;
  }
  #advanced {
    animation: qp-advanced-in .3s ease-out;
  }
  @keyframes qp-advanced-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* ═══════ CHARACTER CARDS — Balatro-style premium ═══════ */
  #chars {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    width: min(880px, 96vw);
  }
  @media (min-width: 560px) {
    #chars { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  }
  .charcard {
    pointer-events: auto;
    width: 100%;
    min-width: 0;
    min-height: 148px;
    padding: 8px 10px 10px;
    background:
      radial-gradient(ellipse at 50% 30%, var(--char-color, rgba(102,214,255,.35)) 0%, transparent 65%),
      linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-panel) 65%, var(--bg-deep) 100%);
    border: var(--border-thick) solid #2b3752;
    border-radius: var(--rad-lg);
    cursor: pointer;
    text-align: center;
    box-shadow:
      0 4px 0 rgba(0,0,0,.45),
      0 0 14px rgba(0,0,0,.35),
      inset 0 -3px 0 rgba(0,0,0,.3),
      inset 0 1px 0 rgba(255,255,255,.06);
    transition: transform .18s var(--ease-bounce), border-color .18s, box-shadow .18s;
    position: relative;
    overflow: hidden;
    display: flex; flex-direction: column;
    align-items: stretch;
  }
  /* Тонкий top-highlight поверх фона */
  .charcard::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,.07) 0%, transparent 100%);
    pointer-events: none;
    border-radius: var(--rad-lg) var(--rad-lg) 0 0;
  }
  /* Difficulty dot в верхнем правом углу */
  .ch-diff {
    position: absolute;
    top: 6px; right: 8px;
    font-size: 14px;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.7));
    z-index: 3;
    pointer-events: none;
  }
  /* Роль-строка под именем */
  .ch-role {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-top: 2px;
    line-height: 1.2;
    text-shadow: 0 1px 0 rgba(0,0,0,.5);
  }
  .charcard.sel .ch-role { color: var(--acc-primary); text-shadow: 0 0 8px rgba(102,214,255,.5); }
  /* task #93: best-time под именем героя — рекорд забегов из META */
  .ch-best {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    color: var(--acc-reward);
    text-shadow: 0 1px 0 rgba(0,0,0,.5), 0 0 6px rgba(255,238,136,.35);
    margin-top: 4px;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
  }
  .ch-best.none {
    color: var(--text-dim);
    text-shadow: 0 1px 0 rgba(0,0,0,.5);
    opacity: .6;
  }
  .charcard.sel .ch-best {
    color: #fff5b0;
    text-shadow: 0 1px 0 rgba(0,0,0,.5), 0 0 10px rgba(255,238,136,.6);
  }
  .charcard::before {
    content: '';
    position: absolute; top:0; left:0; right:0; height:40%;
    background: linear-gradient(180deg, rgba(255,255,255,.04), transparent);
    pointer-events: none;
  }
  .charcard:hover {
    transform: translateY(-3px);
    border-color: var(--char-solid, var(--text-secondary));
    box-shadow:
      0 7px 0 rgba(0,0,0,.45),
      0 10px 22px rgba(0,0,0,.45),
      0 0 18px color-mix(in srgb, var(--char-solid, #66d6ff) 30%, transparent),
      inset 0 -3px 0 rgba(0,0,0,.3);
  }
  .charcard:active { transform: translateY(2px) scale(.98); }
  .charcard.sel {
    border-color: var(--char-solid, var(--acc-primary));
    box-shadow:
      0 4px 0 rgba(0,0,0,.4),
      0 0 28px color-mix(in srgb, var(--char-solid, #66d6ff) 55%, transparent),
      0 0 4px color-mix(in srgb, var(--char-solid, #66d6ff) 80%, transparent),
      inset 0 -3px 0 rgba(0,0,0,.3);
    background:
      radial-gradient(ellipse at 50% 30%, color-mix(in srgb, var(--char-solid, #66d6ff) 32%, transparent) 0%, transparent 65%),
      linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-panel) 65%, var(--bg-deep) 100%);
  }
  .charcard.sel::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: var(--rad-lg);
    border: 2px solid color-mix(in srgb, var(--char-solid, #66d6ff) 45%, transparent);
    pointer-events: none;
    animation: charcard-sel-pulse 1.8s ease-in-out infinite;
  }
  @keyframes charcard-sel-pulse {
    0%,100% { opacity: .5; }
    50% { opacity: 1; }
  }
  .charcard.sel .chname { color: var(--acc-primary); text-shadow: 0 0 14px rgba(102,214,255,.6); }
  .charcard .chname {
    font-size: 15px;
    font-weight: 900;
    color: var(--acc-reward);
    margin: 6px 0 0;
    text-shadow: 0 1px 0 rgba(0,0,0,.5), 0 0 8px rgba(0,0,0,.35);
    letter-spacing: .03em;
    line-height: 1.15;
    text-transform: uppercase;
  }
  /* desc/stats/slots в карточке скрыты — уходят в общий #charinfo panel под гридом */
  .charcard .chdesc,
  .charcard .chstats,
  .charcard .chslots { display: none; }
  /* Mobile — компактнее (2×4 grid), но всё ещё premium look. Media ПОСЛЕ базовых правил → override работает. */
  @media (max-width: 559px) {
    .charcard {
      min-height: 108px;
      padding: 6px 8px 8px;
    }
    .charcard .chportrait {
      height: 56px;
      margin: -6px -8px 3px;
    }
    .charcard .chemoji {
      width: 46px; height: 46px; font-size: 36px;
    }
    .charcard .chname { font-size: 13px; margin-top: 4px; letter-spacing: .02em; }
    .ch-role { font-size: 9px; margin-top: 1px; }
    .ch-diff { font-size: 12px; top: 4px; right: 6px; }
    .ch-best { font-size: 9px; margin-top: 2px; }
  }

  /* Info-панель выбранного класса — 3-строчная плашка в цвет героя (Hades-style) */
  #charinfo {
    width: min(880px, 96vw);
    background:
      linear-gradient(90deg,
        color-mix(in srgb, var(--char-solid, #66d6ff) 18%, transparent) 0%,
        transparent 40%,
        transparent 60%,
        color-mix(in srgb, var(--char-solid, #66d6ff) 12%, transparent) 100%),
      linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-panel) 100%);
    border: var(--border-md) solid color-mix(in srgb, var(--char-solid, #66d6ff) 55%, transparent);
    border-radius: var(--rad-md);
    padding: 10px 14px 12px;
    margin-bottom: 10px;
    box-shadow:
      0 3px 0 rgba(0,0,0,.4),
      0 0 14px color-mix(in srgb, var(--char-solid, #66d6ff) 22%, transparent),
      inset 0 -2px 0 rgba(0,0,0,.25),
      inset 0 1px 0 rgba(255,255,255,.05);
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    color: var(--text-secondary);
    position: relative;
  }
  /* Тонкая цветовая полоса слева — как аксцент "тебя выбрали" */
  #charinfo::before {
    content: '';
    position: absolute;
    left: 0; top: 8px; bottom: 8px;
    width: 4px;
    background: var(--char-solid, var(--acc-primary));
    border-radius: 0 var(--rad-sm) var(--rad-sm) 0;
    box-shadow: 0 0 12px var(--char-solid, var(--acc-primary));
  }
  #charinfo .ci-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
  }
  #charinfo .ci-name {
    font-size: 17px;
    font-weight: 900;
    color: var(--char-solid, var(--acc-primary));
    text-shadow: 0 0 12px color-mix(in srgb, var(--char-solid, #66d6ff) 55%, transparent), 0 1px 0 rgba(0,0,0,.5);
    letter-spacing: .03em;
    text-transform: uppercase;
    line-height: 1.1;
  }
  #charinfo .ci-role {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    color: var(--text-dim);
    text-transform: uppercase;
    padding: 2px 8px;
    background: rgba(0,0,0,.3);
    border-radius: var(--rad-pill);
    box-shadow: inset 0 -1px 0 rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.05);
  }
  #charinfo .ci-diff {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .1em;
    color: var(--text-secondary);
    margin-left: auto;
    padding: 2px 8px;
    background: rgba(0,0,0,.25);
    border-radius: var(--rad-pill);
    box-shadow: inset 0 -1px 0 rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.05);
    white-space: nowrap;
  }
  #charinfo .ci-desc {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: .01em;
  }
  #charinfo .ci-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 4px;
    border-top: 1px dashed rgba(255,255,255,.08);
  }
  #charinfo .ci-stats {
    display: inline-flex; gap: 10px; align-items: center;
    font-size: 12px; font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
  }
  #charinfo .ci-stats b {
    color: var(--char-solid, var(--acc-primary));
    font-size: 13px;
    margin-right: 2px;
  }
  #charinfo .ci-slots {
    display: inline-grid;
    grid-template-columns: repeat(3, minmax(72px, 1fr));
    gap: 5px;
    margin-left: auto;
  }
  #charinfo .slot-tag {
    text-align: center;
    font-size: 10px; font-weight: 900;
    letter-spacing: .05em;
    padding: 3px 8px;
    border-radius: var(--rad-pill);
    background: rgba(0,0,0,.35);
    color: var(--text-secondary);
    box-shadow: inset 0 -1px 0 rgba(0,0,0,.4);
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  @media (max-width: 559px) {
    #charinfo { padding: 8px 12px 10px; gap: 5px; }
    #charinfo .ci-name { font-size: 15px; }
    #charinfo .ci-desc { font-size: 12px; line-height: 1.4; }
    #charinfo .ci-slots { margin-left: 0; }
    #charinfo .ci-footer { gap: 8px; }
  }
  .slot-tag.slot-dmg { color: var(--acc-danger); box-shadow: inset 0 0 0 1px rgba(255,124,156,.4), inset 0 -1px 0 rgba(0,0,0,.4); }
  .slot-tag.slot-ctrl { color: var(--acc-info); box-shadow: inset 0 0 0 1px rgba(160,216,255,.4), inset 0 -1px 0 rgba(0,0,0,.4); }
  .slot-tag.slot-stat { color: var(--acc-primary); box-shadow: inset 0 0 0 1px rgba(102,214,255,.4), inset 0 -1px 0 rgba(0,0,0,.4); }
  /* ═══════ Портреты героев ═══════ */
  .chportrait {
    position: relative;
    height: 72px;
    margin: -8px -10px 4px;
    border-radius: var(--rad-lg) var(--rad-lg) 0 0;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background:
      radial-gradient(circle at 50% 65%, rgba(0,0,0,.15) 0%, rgba(0,0,0,.55) 100%);
    box-shadow: inset 0 -4px 0 rgba(0,0,0,.45), inset 0 0 30px rgba(0,0,0,.4);
  }
  /* Радиальный fade behind emoji — окрашивается per-класс */
  .chportrait::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at 50% 60%, var(--char-color, rgba(102,214,255,.35)) 0%, transparent 60%);
    animation: portrait-breathe 3.5s ease-in-out infinite;
    filter: blur(1px);
  }
  /* Subtle scanline effect */
  .chportrait::after {
    content: '';
    position: absolute; inset: 0;
    background: repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(0,0,0,.15) 3px, rgba(0,0,0,.15) 4px);
    pointer-events: none;
    opacity: .5;
  }
  @keyframes portrait-breathe {
    0%,100% { transform: scale(1); opacity: .9; }
    50% { transform: scale(1.15); opacity: 1; }
  }
  .chemoji {
    position: relative;
    /* Фиксированный box 56×56 — все emoji вписаны в одинаковый размер, независимо от их glyph-ширины */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    font-size: 44px;
    line-height: 1;
    z-index: 2;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,.75)) drop-shadow(0 0 14px var(--char-color, rgba(102,214,255,.55)));
    transition: transform .3s var(--ease-bounce);
    overflow: hidden;
  }
  /* Hover — только rotate, не scale (иначе bounding-box меняется → плывёт размер) */
  .charcard:hover .chemoji { transform: rotate(-6deg); }
  /* Выбранный — пульсирует glow, не размер */
  .charcard.sel .chemoji { animation: emoji-selected-glow 1.6s ease-in-out infinite; }
  @keyframes emoji-selected-glow {
    0%,100% { filter: drop-shadow(0 3px 6px rgba(0,0,0,.7)) drop-shadow(0 0 10px var(--char-color, rgba(102,214,255,.6))); }
    50% { filter: drop-shadow(0 3px 6px rgba(0,0,0,.7)) drop-shadow(0 0 22px var(--char-color, rgba(102,214,255,1))); }
  }
  /* Per-character colors — каждый герой имеет свой цвет-fingerprint. Применяется и к .charcard, и к #charinfo */
  .char-striker  { --char-color: rgba(102,214,255,.55); --char-solid: #66d6ff; }
  .char-engineer { --char-color: rgba(160,216,255,.55); --char-solid: #a0d8ff; }
  .char-shadow   { --char-color: rgba(192,132,255,.60); --char-solid: #c084ff; }
  .char-golem    { --char-color: rgba(180,140,90,.60);  --char-solid: #b48c5a; }
  .char-pyro     { --char-color: rgba(255,140,60,.65);  --char-solid: #ff8c3c; }
  .char-necro    { --char-color: rgba(160,110,220,.60); --char-solid: #a06edc; }
  .char-hunter   { --char-color: rgba(255,207,74,.60);  --char-solid: #ffcf4a; }
  .char-keeper   { --char-color: rgba(255,180,90,.65);  --char-solid: #ffb45a; }
  #biomerow {
    position: fixed; right: 10px; bottom: 10px;
    font-size: 11px; font-weight: 700;
    color: var(--text-secondary);
    text-shadow: 0 1px 2px rgba(0,0,0,.7);
    pointer-events: none;
    z-index: 5;
    background: var(--bg-panel);
    border: var(--border-md) solid var(--bg-elevated);
    border-radius: var(--rad-md);
    padding: 6px 12px;
    box-shadow: 0 3px 0 rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.4), inset 0 -1px 0 rgba(0,0,0,.25);
    letter-spacing: .02em;
    max-width: min(320px, 70vw);
  }
  /* На узком экране длинный тост наслаивался на #weaponsrow (низ-слева).
     Показываем только имя биома, модификаторы прячем — они уже прозвучали
     welcome-каскадом при входе в биом. */
  @media (max-width: 640px) {
    #biomerow { max-width: 46vw; }
    #biomerow .biome-mods { display: none; }
  }
  /* Обратный таймер до финального босса — «цель» забега (task: boss+timer) */
  #bosstimer {
    position: fixed; left: 50%; top: calc(80px + env(safe-area-inset-top, 0px));
    transform: translateX(-50%); z-index: 7; pointer-events: none;
    display: flex; align-items: center; gap: 8px;
    padding: 5px 14px; border-radius: var(--rad-pill);
    background: rgba(11,15,26,.82); border: 2px solid #ff9d3b;
    box-shadow: 0 3px 0 rgba(0,0,0,.4), 0 0 12px rgba(255,157,59,.3);
    font-weight: 900; letter-spacing: .04em; white-space: nowrap;
  }
  #bosstimer .bt-label { font-size: 11px; color: #ffcf6b; text-transform: uppercase; }
  #bosstimer .bt-time { font-size: 15px; color: #fff; font-variant-numeric: tabular-nums; }
  #bosstimer.soon { border-color: #ff5c5c; box-shadow: 0 3px 0 rgba(0,0,0,.4), 0 0 16px rgba(255,92,92,.45); }
  #bosstimer.imminent, #bosstimer.fight { border-color: #ff2020; animation: bt-pulse .6s infinite ease-in-out; }
  #bosstimer.fight { background: rgba(60,10,10,.9); }
  #bosstimer.fight .bt-label { color: #ff5c5c; font-size: 13px; }
  @keyframes bt-pulse {
    0%,100% { box-shadow: 0 3px 0 rgba(0,0,0,.4), 0 0 10px rgba(255,32,32,.4); transform: translateX(-50%) scale(1); }
    50% { box-shadow: 0 3px 0 rgba(0,0,0,.4), 0 0 22px rgba(255,32,32,.7); transform: translateX(-50%) scale(1.04); }
  }
  /* #adbox и .elcard теперь ниже в новых стилях */

  /* ═══════ BIG BUTTONS — chunky CTA ═══════ */
  .bigbtn {
    pointer-events: auto;
    background: linear-gradient(180deg, #7dffcc 0%, var(--acc-primary) 45%, var(--acc-primary-dark) 100%);
    color: #06210f;
    border: none;
    font-family: inherit;
    font-weight: 900;
    font-size: clamp(14px, 3.5vw, 17px);
    letter-spacing: .04em;
    padding: clamp(11px, 3vw, 14px) clamp(24px, 6vw, 42px);
    border-radius: var(--rad-md);
    cursor: pointer;
    box-shadow: 0 5px 0 var(--acc-primary-dark), 0 8px 24px rgba(102,214,255,.35), inset 0 -3px 0 rgba(0,0,0,.15), inset 0 2px 0 rgba(255,255,255,.35);
    margin: 6px;
    transition: transform .12s var(--ease-out), box-shadow .12s;
    text-shadow: 0 1px 0 rgba(255,255,255,.35);
    text-transform: uppercase;
    /* Фиксированная ширина + nowrap — sibling-кнопки в одной модалке всегда равного размера */
    width: min(280px, 100%);
    min-width: unset;
    max-width: 100%;
    white-space: nowrap;                     /* текст на одной строке — высота не плывёт */
    text-overflow: ellipsis;
    position: relative;
    overflow: hidden;
  }
  /* Постоянный «глянец» — диагональная белая полоса пробегает по кнопке каждые 4с */
  .bigbtn::before {
    content: '';
    position: absolute;
    top: 0; left: -70%;
    width: 60%; height: 100%;
    background: linear-gradient(105deg, transparent 0%, rgba(255,255,255,.3) 50%, transparent 100%);
    animation: btn-shine 4s ease-in-out infinite;
    pointer-events: none;
  }
  @keyframes btn-shine {
    0% { left: -70%; }
    60% { left: 130%; }
    100% { left: 130%; }
  }
  /* Ripple при нажатии */
  .bigbtn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,.4) 0%, transparent 60%);
    opacity: 0;
    transform: scale(.3);
    transition: opacity .5s, transform .5s;
    pointer-events: none;
  }
  .bigbtn:active::after {
    opacity: 1;
    transform: scale(1.4);
    transition: opacity 0s, transform 0s;
  }
  .bigbtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 0 var(--acc-primary-dark), 0 12px 30px rgba(102,214,255,.45), inset 0 -3px 0 rgba(0,0,0,.15), inset 0 2px 0 rgba(255,255,255,.35);
  }
  .bigbtn:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 var(--acc-primary-dark), 0 3px 10px rgba(102,214,255,.35), inset 0 -1px 0 rgba(0,0,0,.15);
  }
  .bigbtn.ghost {
    background: linear-gradient(180deg, var(--bg-elevated), var(--bg-panel));
    color: var(--text-secondary);
    box-shadow: 0 5px 0 #0e1424, 0 6px 18px rgba(0,0,0,.5), inset 0 -3px 0 rgba(0,0,0,.3), inset 0 2px 0 rgba(255,255,255,.05);
    text-shadow: none;
  }
  .bigbtn.ghost:hover {
    box-shadow: 0 7px 0 #0e1424, 0 10px 22px rgba(0,0,0,.55), inset 0 -3px 0 rgba(0,0,0,.3), inset 0 2px 0 rgba(255,255,255,.05);
    color: var(--text-primary);
  }
  .bigbtn.ghost:active {
    box-shadow: 0 1px 0 #0e1424, 0 3px 8px rgba(0,0,0,.5), inset 0 -1px 0 rgba(0,0,0,.3);
  }
  .bigbtn:disabled { opacity: .35; cursor: not-allowed; transform: none !important; }

  #rerollbtn {
    background: linear-gradient(180deg, #6ba0e8, #4a80c8 45%, #2f5aa0 100%);
    color: #f0f6ff;
    box-shadow: 0 5px 0 #1e3d70, 0 8px 20px rgba(74,128,200,.4), inset 0 -3px 0 rgba(0,0,0,.15), inset 0 2px 0 rgba(255,255,255,.3);
    font-size: 15px;
    padding: 11px 30px;
    min-width: 150px;
  }
  #rerollbtn:hover {
    box-shadow: 0 7px 0 #1e3d70, 0 10px 26px rgba(74,128,200,.5), inset 0 -3px 0 rgba(0,0,0,.15), inset 0 2px 0 rgba(255,255,255,.3);
  }
  #rerollbtn:active {
    box-shadow: 0 1px 0 #1e3d70, 0 3px 8px rgba(74,128,200,.35), inset 0 -1px 0 rgba(0,0,0,.15);
  }

  /* ═══════ END SCREEN — celebration + meta (task #122) ═══════ */
  #endtitle {
    font-size: clamp(28px, 8vw, 46px);
    font-weight: 900;
    letter-spacing: .04em;
    margin-bottom: 16px;
    text-transform: uppercase;
    max-width: 100%;
    word-wrap: break-word;
    display: flex; align-items: center; justify-content: center;
    gap: 12px; flex-wrap: wrap;
    animation: et-in .55s cubic-bezier(.34,1.56,.64,1) both;
  }
  @keyframes et-in {
    from { transform: scale(.5) translateY(-16px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
  }
  #endtitle .et-emoji { font-size: 1.1em; filter: drop-shadow(0 0 24px currentColor); animation: et-emoji-pulse 1.6s ease-in-out infinite; }
  #endtitle .et-time { font-size: .85em; font-variant-numeric: tabular-nums; opacity: .9; }
  #endtitle .et-unlock {
    display: block;
    font-size: .45em;
    color: #ffde3b;
    letter-spacing: .04em;
    margin-top: 8px;
    text-shadow: 0 0 12px rgba(255,222,59,.6);
    animation: et-unlock-pulse 1.8s ease-in-out infinite;
  }
  @keyframes et-unlock-pulse {
    0%, 100% { text-shadow: 0 0 12px rgba(255,222,59,.5); }
    50% { text-shadow: 0 0 20px rgba(255,222,59,.85); }
  }
  @keyframes et-emoji-pulse {
    0%, 100% { transform: scale(1) rotate(0); }
    50% { transform: scale(1.12) rotate(-3deg); }
  }
  #endtitle.win {
    color: #ffde3b;
    text-shadow: 0 0 32px rgba(255,222,89,.75), 0 4px 0 rgba(0,0,0,.5);
  }
  #endtitle.survived {
    color: #7dffb0;
    text-shadow: 0 0 32px rgba(125,255,176,.6), 0 4px 0 rgba(0,0,0,.5);
  }
  #endtitle.lose {
    color: var(--acc-danger);
    text-shadow: 0 0 28px rgba(255,124,156,.6), 0 4px 0 rgba(0,0,0,.5);
  }
  #endstats {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
    background: var(--bg-panel);
    border: var(--border-md) solid var(--bg-elevated);
    border-radius: var(--rad-md);
    padding: 14px 18px;
    max-width: min(500px, 92vw);
    box-shadow: var(--shadow-panel);
    display: flex; flex-direction: column; gap: 10px;
  }
  #endstats .es-hero { font-weight: 700; color: var(--text-primary); font-size: 15px; }
  #endstats .es-metrics {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  #endstats .es-metric {
    background: rgba(0,0,0,.28);
    padding: 8px 10px;
    border-radius: var(--rad-sm);
    display: flex; flex-direction: column; align-items: center;
    box-shadow: inset 0 -1px 0 rgba(0,0,0,.35);
  }
  #endstats .em-label { font-size: 10px; text-transform: uppercase; color: var(--text-dim); letter-spacing: .08em; }
  #endstats .em-val { font-size: 20px; font-weight: 900; color: var(--acc-primary); font-variant-numeric: tabular-nums; }
  #endstats .es-arsenal { font-size: 13px; color: var(--text-dim); }
  #endstats .es-cores {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 700;
    padding: 10px 14px;
    background: linear-gradient(90deg, rgba(255,222,89,.15), rgba(102,214,255,.10));
    border: 1px solid rgba(255,222,89,.35);
    border-radius: var(--rad-md);
    color: var(--text-primary);
  }
  #endstats .ec-num { font-size: 18px; font-weight: 900; color: #ffde3b; text-shadow: 0 0 10px rgba(255,222,89,.6); animation: ec-num-pop .8s ease-out .3s both; }
  @keyframes ec-num-pop {
    0% { transform: scale(.5); opacity: 0; }
    60% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(1); }
  }
  #endstats .ec-total { margin-left: auto; font-size: 11px; color: var(--text-dim); font-weight: 500; }
  #endstats .es-cmp {
    font-size: 12px;
    padding: 6px 12px;
    background: rgba(102,214,255,.08);
    border-radius: var(--rad-sm);
    color: var(--text-secondary);
  }
  /* Achievement blocks */
  #endstats .es-ach-section { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
  #endstats .es-ach-header {
    font-size: 10px; letter-spacing: .1em; font-weight: 800;
    color: var(--text-dim); text-transform: uppercase;
    padding: 0 4px;
  }
  #endstats .es-ach {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    background: rgba(0,0,0,.25);
    border-radius: var(--rad-sm);
    border-left: 3px solid transparent;
  }
  #endstats .es-ach.unlocked {
    background: rgba(125,255,176,.10);
    border-left-color: #7dffb0;
    animation: ach-glow 1.2s ease-in-out;
  }
  @keyframes ach-glow {
    0% { box-shadow: 0 0 0 rgba(125,255,176,0); }
    50% { box-shadow: 0 0 20px rgba(125,255,176,.6); }
    100% { box-shadow: 0 0 0 rgba(125,255,176,0); }
  }
  #endstats .es-ach.next { border-left-color: rgba(102,214,255,.35); }
  #endstats .es-ach-emoji { font-size: 22px; line-height: 1; flex-shrink: 0; }
  #endstats .es-ach-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
  #endstats .es-ach-name { font-size: 12px; font-weight: 700; color: var(--text-primary); }
  #endstats .es-ach-bar {
    height: 5px; background: rgba(0,0,0,.35); border-radius: 3px; overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(0,0,0,.4);
  }
  #endstats .es-ach-fill {
    height: 100%;
    background: linear-gradient(90deg, #66d6ff, #7dffb0);
    border-radius: 3px;
    transition: width .8s cubic-bezier(.34,1.2,.64,1);
    box-shadow: 0 0 8px rgba(102,214,255,.6);
  }
  #endstats .es-ach-val { font-size: 10.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
  /* Pulsing restart button on endscreen */
  #endscreen #restart {
    animation: es-restart-pulse 1.4s ease-in-out infinite;
  }
  @keyframes es-restart-pulse {
    0%, 100% { box-shadow: 0 4px 0 rgba(0,0,0,.35), 0 0 14px rgba(125,255,176,.4); }
    50% { box-shadow: 0 4px 0 rgba(0,0,0,.35), 0 0 30px rgba(125,255,176,.85); }
  }

  /* ═══════ START SCREEN — brand identity (task #134: SVG logo) ═══════ */
  /* Screen-reader-only text — visually hidden but read by AT */
  .sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
  }
  #voidmesh-logo {
    display: block;
    width: clamp(240px, 60vw, 380px);
    height: auto;
    margin: 0 auto 4px;
    max-width: 100%;
    filter: drop-shadow(0 0 24px rgba(125,255,176,.35)) drop-shadow(0 4px 0 rgba(0,0,0,.5));
    animation: title-glow 3s ease-in-out infinite;
    pointer-events: none;
    user-select: none;
  }
  /* legacy: остальные h1 в start (если появятся) — прежний стиль */
  #start h1:not(.sr-only) {
    font-size: clamp(24px, 7vw, 40px);
    background: linear-gradient(180deg, #fff 0%, var(--acc-primary) 40%, var(--acc-primary-dark) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: .1em;
    font-weight: 900;
    margin-bottom: 8px;
    text-transform: uppercase;
    position: relative;
    filter: drop-shadow(0 0 24px rgba(102,214,255,.5)) drop-shadow(0 4px 0 rgba(0,0,0,.5));
    animation: title-glow 3s ease-in-out infinite;
    max-width: 100%;
    word-wrap: break-word;
    text-align: center;
  }
  @keyframes title-glow {
    0%,100% { filter: drop-shadow(0 0 24px rgba(102,214,255,.5)) drop-shadow(0 4px 0 rgba(0,0,0,.5)); }
    50% { filter: drop-shadow(0 0 36px rgba(102,214,255,.8)) drop-shadow(0 4px 0 rgba(0,0,0,.5)); }
  }
  /* .sub убран из start-меню — не занимаем вертикальное пространство */
  #start .sub { display: none; }
  /* Play-кнопка в стартовом меню — шире (текст «ИГРАТЬ ЗА 🎯 Стрелка») */
  #start #playbtn {
    width: min(360px, 96vw);
    max-width: 96vw;
    font-size: clamp(15px, 4vw, 18px);
    padding: clamp(12px, 3.5vw, 16px) clamp(20px, 5vw, 34px);
  }
  /* «СХЕМА СЛИЯНИЙ» — маленькая кнопка в верхнем-правом углу, вне overlay */
  #startschemebtn {
    position: fixed;
    top: calc(14px + env(safe-area-inset-top, 0px));
    right: calc(14px + env(safe-area-inset-right, 0px));
    width: auto !important;
    min-width: 0 !important;
    padding: 8px 14px !important;
    font-size: 12px !important;
    margin: 0 !important;
    z-index: 45;
    box-shadow: 0 3px 0 rgba(0,0,0,.4), 0 0 12px rgba(102,214,255,.15) !important;
    display: none;
  }
  /* Показываем только когда открыто start-меню */
  body:has(#start.show) #startschemebtn { display: inline-block; }
  /* task #113: padding-bottom на #start чтобы PLAY кнопка не залезала под langswitch */
  #start { padding-bottom: 72px !important; }
  /* Language switch — task #111: canonical bottom-center pills */
  #langswitch {
    position: fixed;
    left: 50%;
    bottom: max(12px, env(safe-area-inset-bottom, 12px));
    transform: translateX(-50%);
    z-index: 45;
    display: none;
    gap: 6px;
    padding: 4px;
    background: rgba(6,12,24,.75);
    border: var(--border-md) solid rgba(102,214,255,.25);
    border-radius: var(--rad-pill);
    box-shadow: 0 4px 12px rgba(0,0,0,.5), inset 0 -2px 0 rgba(0,0,0,.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
  body:has(#start.show) #langswitch { display: inline-flex; }
  .lang-pill {
    pointer-events: auto;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    font-family: inherit;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: .06em;
    padding: 8px 14px;
    border-radius: var(--rad-pill);
    cursor: pointer;
    transition: background .18s, color .18s, transform .12s var(--ease-bounce);
    min-width: 68px;
    text-align: center;
  }
  .lang-pill:hover { color: var(--text-primary); transform: translateY(-1px); }
  .lang-pill.active {
    background: linear-gradient(180deg, var(--acc-primary) 0%, var(--acc-primary-dark) 100%);
    color: #06210f;
    box-shadow: 0 2px 0 var(--acc-primary-dark), 0 0 10px rgba(102,214,255,.45), inset 0 -2px 0 rgba(0,0,0,.2);
    text-shadow: 0 1px 0 rgba(255,255,255,.35);
  }
  .lang-pill.active:hover { transform: none; }
  /* Metainfo — компакт, одна строка */
  #metainfo {
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 8px;
    letter-spacing: .02em;
    text-align: center;
  }
  #start .hint {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 24px;
    max-width: 480px;
    font-weight: 500;
  }

  /* ═══════ TALISMAN OFFER MODAL — компакт в углу, не перекрывает поле ═══════ */
  #talismanoffer {
    /* переопределяем базовый .overlay: не fullscreen, не тёмный фон, не блочит */
    position: fixed !important;
    /* inset FIRST — потом top/right/bottom/left его переопределяют */
    inset: auto !important;
    top: calc(88px + env(safe-area-inset-top, 0px)) !important; right: calc(12px + env(safe-area-inset-right, 0px)) !important; left: auto !important; bottom: auto !important;
    max-width: 300px !important; width: min(300px, 40vw) !important;
    padding: 0 !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    pointer-events: none !important; /* фон-контейнер прозрачен */
    z-index: 15 !important; /* ниже levelup=20, выше HUD=5 */
    justify-content: flex-start !important;
    align-items: stretch !important;
    overflow: visible !important;
  }
  #talismanoffer::before { display: none !important; }  /* никаких ambient particles */
  #talismanoffer::after { display: none !important; }
  #talismanoffer h2 {
    font-size: 13px !important;
    margin: 0 0 6px 0 !important;
    letter-spacing: .04em !important;
    text-align: center !important;
    color: var(--rarity-legendary) !important;
    text-shadow: 0 0 6px rgba(255,157,59,.6) !important;
    pointer-events: auto;
  }
  #talismanoffer .bigbtn {
    pointer-events: auto;
    width: 100% !important;
    font-size: 13px !important;
    padding: 8px 14px !important;
    margin: 3px 0 !important;
  }
  #talcontent {
    background: linear-gradient(180deg, rgba(255,157,59,.14), var(--bg-panel));
    border: var(--border-thick) solid var(--rarity-legendary);
    border-radius: var(--rad-md);
    padding: 12px 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,.6), 0 0 18px rgba(255,157,59,.35);
    max-width: 100%;
    animation: talisman-pulse 2s infinite ease-in-out;
    pointer-events: auto;
    font-size: 12px;
  }
  #talcontent > div:first-child { font-size: 28px !important; margin-bottom: 4px !important; }
  #talcontent > div:nth-child(2) { font-size: 14px !important; margin-bottom: 3px !important; }
  #talcontent > div:nth-child(3) { font-size: 11px !important; line-height: 1.4 !important; }
  #taltimer { font-size: 11px !important; margin-top: 8px !important; }
  #taltimerbar { height: 4px !important; margin-top: 3px !important; }
  @keyframes talisman-pulse {
    0%,100% { box-shadow: 0 6px 0 rgba(0,0,0,.4), var(--glow-legendary), inset 0 -3px 0 rgba(0,0,0,.25), inset 0 2px 0 rgba(255,255,255,.08); }
    50% { box-shadow: 0 6px 0 rgba(0,0,0,.4), 0 0 40px rgba(255,157,59,.9), 0 0 6px rgba(255,157,59,1), inset 0 -3px 0 rgba(0,0,0,.25), inset 0 2px 0 rgba(255,255,255,.08); }
  }

  /* ═══════ AD BOX ═══════ */
  #adbox {
    font-size: 16px;
    color: var(--text-primary);
    background: var(--bg-panel);
    border: var(--border-thick) dashed var(--acc-primary);
    border-radius: var(--rad-lg);
    padding: 42px 34px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-elevated), var(--glow-primary);
    font-weight: 600;
  }
  .elcard { border-width: 2px; }

  #scheme, #pausemenu, #endscreen { overflow-y:auto; justify-content:flex-start; padding-top:26px; }
  #schemebody { width:min(1080px,96vw); }
  /* ═══════ SCHEME — redesigned grid (task #42) ═══════ */
  .scheme-progress {
    display: flex; justify-content: center; gap: 18px;
    padding: 10px 16px; margin-bottom: 14px;
    background: linear-gradient(180deg,var(--bg-elevated),var(--bg-panel));
    border: var(--border-md) solid #2b3752;
    border-radius: var(--rad-lg);
    box-shadow: 0 3px 0 rgba(0,0,0,.35);
  }
  .progress-item { display: flex; flex-direction: column; align-items: center; gap: 3px; }
  .progress-label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
  .progress-value { font-size: 18px; color: var(--acc-reward); font-weight: 900; text-shadow: 0 0 8px rgba(255,238,136,.4); }
  .scheme-filters {
    display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
    margin-bottom: 14px;
  }
  .filter-chip {
    background: linear-gradient(180deg,var(--bg-elevated),var(--bg-panel));
    color: var(--text-secondary);
    border: var(--border-md) solid #2b3752;
    border-radius: var(--rad-pill);
    padding: 6px 14px;
    font-size: 12px; font-weight: 800;
    cursor: pointer;
    transition: border-color .15s, transform .15s var(--ease-bounce), color .15s;
    letter-spacing: .04em;
  }
  .filter-chip:hover { transform: translateY(-1px); border-color: var(--acc-primary); }
  .filter-chip.active {
    background: linear-gradient(180deg,rgba(255,238,136,.2),rgba(255,238,136,.06));
    border-color: var(--acc-reward);
    color: var(--acc-reward);
    text-shadow: 0 0 6px rgba(255,238,136,.5);
  }
  .scheme-section-header {
    font-size: 14px; font-weight: 900;
    color: var(--text-primary);
    letter-spacing: .1em; text-transform: uppercase;
    margin: 20px 0 10px;
    padding: 8px 14px;
    background: linear-gradient(90deg,rgba(255,238,136,.15),transparent);
    border-left: 4px solid var(--acc-reward);
    border-radius: var(--rad-sm);
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,.2);
  }
  .ssh-hint {
    font-size: 10px; font-weight: 600;
    color: var(--text-dim); text-transform: none; letter-spacing: 0;
    text-align: right;
  }
  .recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
  }
  .recipe-card {
    display: flex; flex-direction: column; gap: 8px;
    background: linear-gradient(180deg,var(--bg-elevated),var(--bg-panel));
    border: var(--border-md) solid #2b3752;
    border-radius: var(--rad-lg);
    padding: 12px;
    position: relative;
    box-shadow: 0 3px 0 rgba(0,0,0,.4), inset 0 -2px 0 rgba(0,0,0,.2);
    transition: transform .15s var(--ease-bounce), box-shadow .15s, border-color .15s;
  }
  .recipe-card:hover { transform: translateY(-2px); }
  .recipe-card .rc-el-tag {
    position: absolute; top: 8px; right: 10px;
    display: flex; gap: 4px;
  }
  .recipe-card .rc-ings {
    display: flex; align-items: stretch; gap: 6px;
    margin-top: 8px;
  }
  .recipe-card .rc-plus {
    display: flex; align-items: center; justify-content: center;
    color: var(--text-dim); font-size: 14px; font-weight: 900;
    flex: 0 0 auto; padding: 0 2px;
  }
  .ing-tile {
    flex: 1 1 0;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: rgba(0,0,0,.25);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: var(--rad-md);
    padding: 8px 4px;
    text-align: center;
    min-width: 0;
  }
  .ing-tile.done { border-color: var(--acc-primary); background: rgba(102,214,255,.1); }
  .ing-tile.partial { border-color: var(--acc-info); background: rgba(160,216,255,.08); }
  .ing-tile.none { opacity: .55; }
  .ing-tile.any { background: rgba(255,255,255,.05); border-style: dashed; }
  .ing-tile.el-ing { border-color: rgba(255,255,255,.15); }
  .ing-tile.cond.done { border-color: var(--acc-primary); background: rgba(102,214,255,.14); }
  .ing-tile.cond .cond-type {
    font-size: 8px; font-weight: 900; letter-spacing: .1em;
    padding: 2px 6px;
    border-radius: var(--rad-pill);
    background: rgba(0,0,0,.4);
    margin-bottom: 3px;
  }
  .ing-tile.cond.ct-talisman .cond-type { color: #ff9d3b; background: rgba(255,157,59,.18); }
  .ing-tile.cond.ct-trait    .cond-type { color: #c9b6ff; background: rgba(201,182,255,.18); }
  .ing-tile.cond.ct-affinity .cond-type { color: #8be9ff; background: rgba(139,233,255,.18); }
  .ing-tile.cond.ct-kills    .cond-type { color: #ff5c5c; background: rgba(255,92,92,.18); }
  .ing-tile.cond.ct-skill    .cond-type { color: #ffde3b; background: rgba(255,222,59,.18); }
  .ing-tile.cond.ct-hp       .cond-type { color: #ff7c9c; background: rgba(255,124,156,.22); }
  .ing-tile.cond.ct-talisman { border-color: rgba(255,157,59,.35); }
  .ing-tile.cond.ct-trait    { border-color: rgba(201,182,255,.35); }
  .ing-tile.cond.ct-affinity { border-color: rgba(139,233,255,.35); }
  .ing-tile.cond.ct-kills    { border-color: rgba(255,92,92,.35); }
  .ing-tile.cond.ct-skill    { border-color: rgba(255,222,59,.35); }
  .ing-tile.cond.ct-hp       { border-color: rgba(255,124,156,.35); }
  .ing-tile .ing-emoji { font-size: 24px; line-height: 1; }
  .ing-tile .ing-name { font-size: 10px; font-weight: 700; color: var(--text-secondary); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
  .ing-tile .ing-lvl { font-size: 9px; color: var(--text-dim); font-weight: 800; letter-spacing: .05em; }
  .ing-tile.done .ing-lvl { color: var(--acc-primary); }
  .recipe-card .rc-arrow {
    text-align: center;
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 900;
    margin: -4px 0;
  }
  .recipe-card .rc-arrow span {
    display: inline-block;
    padding: 0 8px;
    background: linear-gradient(90deg,transparent,rgba(255,255,255,.08),transparent);
    border-radius: var(--rad-pill);
  }
  .recipe-card .rc-result {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 8px;
    background: rgba(255,255,255,.03);
    border-radius: var(--rad-md);
    border: 1px solid rgba(255,255,255,.06);
  }
  .rc-res-emoji { font-size: 30px; line-height: 1; margin-bottom: 2px; }
  .rc-res-name { font-size: 13px; font-weight: 900; color: var(--acc-info); text-shadow: 0 0 6px rgba(160,216,255,.35); text-align: center; }
  .rc-res-desc { font-size: 11px; color: var(--text-secondary); text-align: center; line-height: 1.35; font-weight: 500; }
  .recipe-card .rc-status {
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    padding: 5px 10px;
    border-radius: var(--rad-pill);
    background: rgba(0,0,0,.3);
    color: var(--text-dim);
    letter-spacing: .06em;
    text-transform: uppercase;
  }
  .recipe-card.state-locked { opacity: .8; }
  .recipe-card.state-locked .rc-status { color: var(--text-dim); }
  .recipe-card.state-ready {
    border-color: var(--acc-primary);
    box-shadow: 0 3px 0 rgba(0,0,0,.4), 0 0 20px rgba(102,214,255,.35), inset 0 -2px 0 rgba(0,0,0,.2);
    animation: recipe-ready-pulse 1.8s infinite ease-in-out;
  }
  .recipe-card.state-ready .rc-status { background: linear-gradient(90deg,rgba(102,214,255,.25),rgba(102,214,255,.1)); color: var(--acc-primary); text-shadow: 0 0 6px rgba(102,214,255,.5); }
  .recipe-card.state-owned {
    border-color: var(--acc-reward);
    background: linear-gradient(180deg, rgba(255,238,136,.10), var(--bg-panel));
    box-shadow: 0 3px 0 rgba(0,0,0,.4), 0 0 16px rgba(255,238,136,.28), inset 0 -2px 0 rgba(0,0,0,.2);
  }
  .recipe-card.state-owned .rc-status { background: rgba(255,238,136,.18); color: var(--acc-reward); }
  .recipe-card.state-owned .rc-res-name { color: var(--acc-reward); text-shadow: 0 0 8px rgba(255,238,136,.5); }
  .recipe-card.t3 .rc-res-name { color: var(--rarity-legendary); text-shadow: 0 0 8px rgba(255,157,59,.55); }
  .recipe-card.t3.state-owned { border-color: var(--rarity-mythic); box-shadow: 0 3px 0 rgba(0,0,0,.4), 0 0 20px rgba(255,92,247,.35), inset 0 -2px 0 rgba(0,0,0,.2); }
  .recipe-card.evolution.state-ready {
    border-color: var(--rarity-legendary);
    box-shadow: 0 3px 0 rgba(0,0,0,.4), 0 0 24px rgba(255,157,59,.5), inset 0 -2px 0 rgba(0,0,0,.2);
  }
  .eltag.evo-tag {
    background: linear-gradient(180deg, #ff9d3b, #b06a1e);
    color: #1a1030;
    text-shadow: none;
    font-weight: 900;
  }
  /* ═══════ Синергии — компактная сетка ═══════ */
  .syn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
  }
  .syn-tile {
    background: linear-gradient(180deg,var(--bg-elevated),var(--bg-panel));
    border: var(--border-md) solid #2b3752;
    border-radius: var(--rad-md);
    padding: 10px 12px;
    display: flex; flex-direction: column; gap: 4px;
    text-align: left;
  }
  .syn-tile .syn-name { font-size: 13px; font-weight: 900; color: var(--acc-reward); }
  .syn-tile .syn-req { font-size: 11px; color: var(--text-dim); font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
  .syn-tile .syn-req .done { color: var(--acc-primary); }
  .syn-tile .syn-plus { color: var(--text-dim); }
  .syn-tile .syn-bonus { font-size: 11px; color: var(--text-secondary); line-height: 1.4; }
  .syn-tile .syn-active { font-size: 10px; color: var(--acc-primary); font-weight: 900; letter-spacing: .08em; text-shadow: 0 0 6px rgba(102,214,255,.5); }
  .syn-tile.state-active { border-color: var(--acc-primary); box-shadow: 0 3px 0 rgba(0,0,0,.35), 0 0 14px rgba(102,214,255,.35); }
  /* ═══════ Легенда снизу ═══════ */
  .scheme-legend {
    display: flex; justify-content: center; gap: 16px; flex-wrap: wrap;
    padding: 10px; margin-top: 8px;
    font-size: 11px; color: var(--text-dim); font-weight: 700; letter-spacing: .04em;
  }
  .lg-state { display: inline-flex; align-items: center; gap: 5px; }
  .lg-state.ready { color: var(--acc-primary); }
  .lg-state.owned { color: var(--acc-reward); }
  .tierlabel {
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: .18em;
    margin: 16px 0 8px;
    text-align: left;
    font-weight: 800;
    text-transform: uppercase;
    position: relative;
    padding-left: 20px;
  }
  .tierlabel::before {
    content: '';
    position: absolute;
    left: 0; top: 50%; transform: translateY(-50%);
    width: 12px; height: 3px;
    background: var(--acc-primary);
    border-radius: var(--rad-pill);
    box-shadow: 0 0 8px var(--acc-primary);
  }
  .tierlabel.center { text-align: center; padding-left: 0; padding-top: 8px; }
  .tierlabel.center::before { display: none; }
  /* В стартовом меню — ещё компактнее */
  #start .tierlabel { margin: 6px 0 4px; font-size: 11px; letter-spacing: .22em; }
  #start .tierlabel .tl-hint {
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: .1em;
    font-weight: 600;
    text-transform: none;
    margin-left: 4px;
    opacity: .8;
  }
  /* ═══════ SCHEME (fusion recipes) — chunky ═══════ */
  .recipe {
    display: flex; align-items: center; flex-wrap: wrap;
    background: linear-gradient(180deg, var(--bg-elevated), var(--bg-panel));
    border: var(--border-md) solid #2b3752;
    border-radius: var(--rad-md);
    padding: 10px 14px;
    margin: 6px 0;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    box-shadow: 0 3px 0 rgba(0,0,0,.35), inset 0 -2px 0 rgba(0,0,0,.2);
    transition: transform .16s var(--ease-bounce), border-color .16s;
  }
  .recipe:hover { transform: translateY(-1px); }
  .recipe.owned {
    border-color: var(--acc-reward);
    background: linear-gradient(180deg, rgba(255,238,136,.12), var(--bg-panel));
    box-shadow: 0 3px 0 rgba(0,0,0,.35), 0 0 14px rgba(255,238,136,.25), inset 0 -2px 0 rgba(0,0,0,.2);
  }
  .recipe.owned3 {
    border-color: var(--rarity-mythic);
    background: linear-gradient(180deg, rgba(255,92,247,.14), var(--bg-panel));
    box-shadow: 0 3px 0 rgba(0,0,0,.35), 0 0 18px rgba(255,92,247,.35), inset 0 -2px 0 rgba(0,0,0,.2);
  }
  .recipe.ready {
    border-color: var(--acc-primary);
    background: linear-gradient(180deg, rgba(102,214,255,.14), var(--bg-panel));
    box-shadow: 0 3px 0 rgba(0,0,0,.35), var(--glow-primary), inset 0 -2px 0 rgba(0,0,0,.2);
    animation: recipe-ready-pulse 1.5s infinite ease-in-out;
  }
  @keyframes recipe-ready-pulse {
    0%,100% { box-shadow: 0 3px 0 rgba(0,0,0,.35), var(--glow-primary), inset 0 -2px 0 rgba(0,0,0,.2); }
    50% { box-shadow: 0 3px 0 rgba(0,0,0,.35), 0 0 26px rgba(102,214,255,.5), inset 0 -2px 0 rgba(0,0,0,.2); }
  }
  .recipe .ing { color: var(--text-secondary); font-weight: 600; }
  .recipe .ing b { color: var(--text-primary); font-weight: 900; }
  .recipe .arrow {
    color: var(--acc-primary);
    margin: 0 10px;
    font-weight: 900;
    text-shadow: 0 0 6px var(--acc-primary);
  }
  .recipe .res { color: var(--acc-info); font-weight: 700; text-shadow: 0 0 6px rgba(160,216,255,.4); }
  .recipe .res.ult { color: var(--rarity-legendary); font-weight: 900; text-shadow: 0 0 8px rgba(255,157,59,.5); }
  .recipe .req {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-dim);
    padding-left: 8px;
    white-space: nowrap;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
  .recipe .req.ok {
    color: var(--acc-primary);
    text-shadow: 0 0 6px rgba(102,214,255,.4);
  }
  /* Element tags */
  .eltag {
    font-size: 10px; font-weight: 800;
    padding: 3px 8px;
    border-radius: var(--rad-pill);
    margin-left: 6px;
    letter-spacing: .04em;
    box-shadow: inset 0 -1px 0 rgba(0,0,0,.3);
  }
  .el-fire { background: linear-gradient(180deg, #5a2a10, #3a1c08); color: #ffab6b; text-shadow: 0 0 6px rgba(255,171,107,.4); }
  .el-ice { background: linear-gradient(180deg, #0e3453, #0a2433); color: #8be9ff; text-shadow: 0 0 6px rgba(139,233,255,.4); }
  .el-energy { background: linear-gradient(180deg, #4d0d43, #33082e); color: #ff9dea; text-shadow: 0 0 6px rgba(255,157,234,.4); }
  .el-grav { background: linear-gradient(180deg, #2c1858, #1d0f3a); color: #c9b6ff; text-shadow: 0 0 6px rgba(201,182,255,.4); }

  /* ═══════ DAMAGE STATS PANEL — chunky bars ═══════ */
  #dmgpanel, #enddmg {
    width: min(500px, 94vw);
    margin-bottom: 14px;
    background: var(--bg-panel);
    border: var(--border-md) solid var(--bg-elevated);
    border-radius: var(--rad-md);
    padding: 10px 12px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,.35);
  }
  .dmgrow {
    display: flex; align-items: center;
    margin: 5px 0;
    font-size: 12px;
    gap: 8px;
    animation: dmg-reveal .35s var(--ease-out) both;
  }
  @keyframes dmg-reveal {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
  }
  .dmgname {
    width: 160px;
    text-align: left;
    color: var(--text-primary);
    font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-size: 12px;
  }
  /* Грейд-иерархия имён источников урона: база → T1 → T2 → T3, + support/boss */
  .dmgrow.r0 .dmgname { color: #aeb8c6; }                                                            /* база (стартовое оружие) */
  .dmgrow.r1 .dmgname { color: var(--acc-primary); text-shadow: 0 0 8px rgba(102,214,255,.35); }     /* T1 */
  .dmgrow.r2 .dmgname { color: var(--rarity-epic); text-shadow: 0 0 10px rgba(192,132,255,.55); }     /* T2 */
  .dmgrow.r3 .dmgname { color: var(--rarity-legendary); text-shadow: 0 0 10px rgba(255,157,59,.5); }  /* T3 ульта/эволют */
  .dmgrow.rsupport .dmgname { color: #7e8b9e; font-weight: 600; }                                     /* трейты/хазарды/env — приглушённо */
  .dmgrow.rboss .dmgname { color: #ff8a6b; text-shadow: 0 0 8px rgba(255,138,107,.4); }               /* босс — угроза */
  .dmgbarwrap {
    flex: 1;
    height: 16px;
    background: #0a0f1c;
    border-radius: var(--rad-pill);
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,.6), 0 1px 0 rgba(255,255,255,.03);
    position: relative;
  }
  .dmgbar {
    height: 100%;
    border-radius: var(--rad-pill);
    background: linear-gradient(180deg, #7dffcc, var(--acc-primary) 50%, var(--acc-primary-dark));
    box-shadow: 0 0 10px rgba(102,214,255,.5), inset 0 1px 0 rgba(255,255,255,.25);
    transition: width .5s var(--ease-out);
    position: relative;
    overflow: hidden;
  }
  .dmgbar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg, transparent 0, transparent 6px, rgba(0,0,0,.12) 6px, rgba(0,0,0,.12) 8px);
    pointer-events: none;
  }
  .dmgrow.r1 .dmgbar { background: linear-gradient(180deg, #7dffcc, var(--acc-primary) 50%, var(--acc-primary-dark)); box-shadow: 0 0 10px rgba(102,214,255,.5), inset 0 1px 0 rgba(255,255,255,.25); }
  .dmgrow.r2 .dmgbar { background: linear-gradient(180deg, #dfa8ff, var(--rarity-epic) 50%, #7c3fd4); box-shadow: 0 0 12px rgba(192,132,255,.65), inset 0 1px 0 rgba(255,255,255,.28); }
  .dmgrow.r3 .dmgbar { background: linear-gradient(180deg, #ffcf6b, var(--rarity-legendary) 50%, #c47216); box-shadow: var(--glow-legendary), inset 0 1px 0 rgba(255,255,255,.25); }
  .dmgrow.r0 .dmgbar { background: linear-gradient(180deg, #c8d0da, #8a94a3); }
  .dmgrow.rsupport .dmgbar { background: linear-gradient(180deg, #6b7686, #454d5b); }
  .dmgrow.rboss .dmgbar { background: linear-gradient(180deg, #ffb59d, #ff5c5c 60%, #c43b3b); box-shadow: 0 0 10px rgba(255,92,92,.5); }
  .dmgval {
    width: 92px;
    text-align: right;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
  }

  /* ═══════ BONUS CHEST — casino-style reveal (task #118) ═══════ */
  /* B+C гибрид: сундук wobble+explode → K карт flip sequential с legendary drama */
  #bonuslist { width: min(460px, 94vw); display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; align-items: center; }
  .chest-hint { color: #8a8a5a; font-size: 11px; margin-top: 4px; text-align: center; opacity: 0; animation: chest-hint-fade .5s ease .2s forwards; }
  @keyframes chest-hint-fade { to { opacity: 1; } }

  /* ═════ Phase 1: chest wobble + build-up ═════ */
  .chest-stage {
    height: 100px;
    display: flex; align-items: center; justify-content: center;
    perspective: 600px;
    position: relative;
    margin-bottom: 4px;
  }
  .chest-wobble {
    font-size: 68px;
    display: inline-block;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,.7)) drop-shadow(0 0 22px rgba(255,238,136,.85));
    animation: chest-wobble 800ms cubic-bezier(.5,-.3,.5,1.4) both;
    transform-origin: 50% 90%;
  }
  @keyframes chest-wobble {
    0%   { transform: scale(.3) rotate(0deg); opacity: 0; filter: drop-shadow(0 0 0 rgba(255,238,136,0)); }
    20%  { transform: scale(1.15) rotate(-8deg); opacity: 1; }
    35%  { transform: scale(1.05) rotate(9deg); }
    50%  { transform: scale(1.15) rotate(-7deg); }
    65%  { transform: scale(1.08) rotate(6deg); }
    80%  { transform: scale(1.22) rotate(-3deg);
           filter: drop-shadow(0 6px 16px rgba(0,0,0,.7)) drop-shadow(0 0 32px rgba(255,238,136,1)) drop-shadow(0 0 50px rgba(255,255,255,.5)); }
    100% { transform: scale(1.35) rotate(0deg);
           filter: drop-shadow(0 6px 16px rgba(0,0,0,.7)) drop-shadow(0 0 40px rgba(255,255,255,.9)); }
  }
  /* Phase 2: explode — chest scales up + fades, radial burst */
  .chest-stage.explode .chest-wobble {
    animation: chest-explode 350ms ease-out both;
  }
  @keyframes chest-explode {
    0%   { transform: scale(1.35); opacity: 1;
           filter: drop-shadow(0 0 40px rgba(255,255,255,.9)); }
    40%  { transform: scale(1.9); opacity: .9;
           filter: drop-shadow(0 0 60px rgba(255,255,255,1)) drop-shadow(0 0 100px rgba(255,238,136,.9)); }
    100% { transform: scale(2.6); opacity: 0;
           filter: drop-shadow(0 0 80px rgba(255,255,255,0)); }
  }
  .chest-stage::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at center, rgba(255,238,136,.35) 0%, transparent 55%);
    opacity: 0; pointer-events: none;
  }
  .chest-stage.explode::before {
    animation: chest-flash 400ms ease-out both;
  }
  @keyframes chest-flash {
    0%   { opacity: 0; transform: scale(.6); }
    40%  { opacity: 1; transform: scale(1.4); }
    100% { opacity: 0; transform: scale(2); }
  }
  /* Skip: instant hide */
  .chest-stage.skipped .chest-wobble,
  .chest-stage.skipped::before { animation: none; opacity: 0; }

  /* ═════ Phase 3: cards deal + flip ═════ */
  .chest-cards {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
    perspective: 1000px;
    width: 100%;
    opacity: 0; transform: translateY(-8px);
    transition: opacity 250ms ease, transform 250ms ease;
  }
  .chest-cards.deal { opacity: 1; transform: translateY(0); }
  .chest-card {
    width: 100%;               /* по умолчанию одна колонка */
    height: 78px;
    perspective: 900px;
  }
  /* Для 2+ карт делаем сеточку */
  .chest-cards[data-count="2"] .chest-card,
  .chest-cards[data-count="3"] .chest-card { width: calc(50% - 6px); height: 84px; }
  .chest-cards[data-count="4"] .chest-card,
  .chest-cards[data-count="5"] .chest-card { width: calc(50% - 6px); height: 78px; }
  @media (min-width: 500px) {
    .chest-cards[data-count="3"] .chest-card { width: calc(33.333% - 8px); height: 96px; }
    .chest-cards[data-count="4"] .chest-card,
    .chest-cards[data-count="5"] .chest-card { width: calc(33.333% - 8px); height: 88px; }
  }
  .chest-card-inner {
    position: relative;
    width: 100%; height: 100%;
    transform-style: preserve-3d;
    transition: transform 450ms cubic-bezier(.4, 1.4, .55, 1.1);
    transform: rotateY(0);
  }
  .chest-card.flip .chest-card-inner { transform: rotateY(180deg); }
  .chest-card.flip.skipped .chest-card-inner { transition: none; }
  .chest-card-back, .chest-card-face {
    position: absolute; inset: 0;
    backface-visibility: hidden;
    border-radius: var(--rad-md);
    display: flex; align-items: center; justify-content: center;
    padding: 8px 10px;
  }
  /* Back — пульсирующий mystery card с category-color hint (тизер рарности) */
  .chest-card-back {
    background: linear-gradient(160deg,
      color-mix(in srgb, var(--cat-color, #ffd54a) 20%, #12182a),
      #08101a 60%,
      color-mix(in srgb, var(--cat-color, #ffd54a) 12%, #0a1120));
    border: 2px solid color-mix(in srgb, var(--cat-color, #ffd54a) 55%, #2b3752);
    box-shadow:
      0 4px 0 rgba(0,0,0,.4),
      0 0 20px color-mix(in srgb, var(--cat-color, #ffd54a) 25%, transparent),
      inset 0 0 22px color-mix(in srgb, var(--cat-color, #ffd54a) 22%, transparent);
    animation: card-back-pulse 1.4s ease-in-out infinite;
  }
  .chest-card-back-mark {
    font-size: 30px; font-weight: 900;
    color: color-mix(in srgb, var(--cat-color, #ffd54a) 85%, white);
    text-shadow: 0 0 12px color-mix(in srgb, var(--cat-color, #ffd54a) 80%, transparent),
                 0 0 22px color-mix(in srgb, var(--cat-color, #ffd54a) 45%, transparent);
    opacity: .85;
  }
  @keyframes card-back-pulse {
    0%, 100% { box-shadow: 0 4px 0 rgba(0,0,0,.4),
                           0 0 20px color-mix(in srgb, var(--cat-color, #ffd54a) 25%, transparent),
                           inset 0 0 22px color-mix(in srgb, var(--cat-color, #ffd54a) 22%, transparent); }
    50%      { box-shadow: 0 4px 0 rgba(0,0,0,.4),
                           0 0 34px color-mix(in srgb, var(--cat-color, #ffd54a) 55%, transparent),
                           inset 0 0 34px color-mix(in srgb, var(--cat-color, #ffd54a) 40%, transparent); }
  }
  /* Легендарки — золотая заметная пульсация на back'е */
  .chest-card.is-leg .chest-card-back {
    animation: card-back-pulse-leg 1.1s ease-in-out infinite;
    border-color: #ffe27a;
  }
  .chest-card.is-leg .chest-card-back-mark {
    color: #fff5cc; opacity: 1;
    text-shadow: 0 0 14px rgba(255,222,89,1), 0 0 28px rgba(255,180,60,.8);
    animation: leg-mark-spin 2.2s linear infinite;
  }
  @keyframes card-back-pulse-leg {
    0%, 100% { box-shadow: 0 4px 0 rgba(0,0,0,.4),
                           0 0 24px rgba(255,222,89,.4),
                           inset 0 0 26px rgba(255,222,89,.3); }
    50%      { box-shadow: 0 4px 0 rgba(0,0,0,.4),
                           0 0 44px rgba(255,222,89,.85),
                           inset 0 0 44px rgba(255,222,89,.55); }
  }
  @keyframes leg-mark-spin {
    from { transform: rotate(0deg); } to { transform: rotate(360deg); }
  }

  /* Face — сам буф после переворота */
  .chest-card-face {
    transform: rotateY(180deg);
    background: linear-gradient(180deg,
      color-mix(in srgb, var(--cat-color, var(--acc-reward)) 14%, var(--bg-panel)),
      var(--bg-panel));
    border: var(--border-thick) solid var(--cat-color, var(--acc-reward));
    box-shadow:
      0 4px 0 rgba(0,0,0,.35),
      0 0 18px color-mix(in srgb, var(--cat-color, var(--acc-reward)) 35%, transparent),
      inset 0 -2px 0 rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.06);
    gap: 10px;
  }
  .chest-card.is-leg .chest-card-face {
    border-color: #ffde3b;
    box-shadow:
      0 4px 0 rgba(0,0,0,.35),
      0 0 26px rgba(255,222,89,.75),
      0 0 50px rgba(255,180,60,.35),
      inset 0 -2px 0 rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.12);
  }
  /* Легендарная вспышка на reveal */
  .chest-card.flip.is-leg .chest-card-face { animation: leg-face-shine .9s ease-out; }
  @keyframes leg-face-shine {
    0%   { filter: brightness(1); }
    20%  { filter: brightness(1.9) saturate(1.3); }
    60%  { filter: brightness(1.2) saturate(1.1); }
    100% { filter: brightness(1); }
  }
  .chest-card.flip.is-leg::after {
    content: ''; position: absolute; inset: -6px;
    border-radius: var(--rad-md);
    background: radial-gradient(circle at center, rgba(255,238,136,.45), transparent 65%);
    animation: leg-burst 700ms ease-out both;
    pointer-events: none;
  }
  @keyframes leg-burst {
    0%   { transform: scale(.4); opacity: 0; }
    30%  { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
  }

  /* Face content — существующие .bonus-icon / .bonus-text */
  .chest-card-face .bonus-icon {
    flex-shrink: 0;
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 28px;
    background: rgba(0,0,0,.35);
    border-radius: var(--rad-md);
    box-shadow: inset 0 -2px 0 rgba(0,0,0,.35);
    filter: drop-shadow(0 0 8px var(--cat-color, var(--acc-reward)));
  }
  .chest-card-face .bonus-text {
    flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px;
    text-align: left; overflow: hidden;
  }
  .chest-card-face .bonus-text b {
    color: var(--cat-color, var(--acc-reward));
    font-weight: 900; font-size: 13px;
    text-shadow: 0 0 8px color-mix(in srgb, var(--cat-color, var(--acc-reward)) 55%, transparent);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .chest-card-face .bonus-text span {
    color: var(--text-secondary); font-size: 11px; font-weight: 500;
    line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }

  /* Ready-pulse на кнопке ЗАБРАТЬ после last reveal */
  #bonusok.ready-pulse {
    animation: btn-ready-pulse 1.2s ease-in-out infinite;
  }
  @keyframes btn-ready-pulse {
    0%, 100% { box-shadow: 0 4px 0 rgba(0,0,0,.35), 0 0 16px rgba(125,255,176,.4); }
    50%      { box-shadow: 0 4px 0 rgba(0,0,0,.35), 0 0 28px rgba(125,255,176,.85); }
  }

  /* task #118 bonus chest использует .chest-card, но .bonusitem всё ещё нужен
     для #rescueoffer (Древний Обелиск) — награда до просмотра рекламы */
  #rescueoffer .bonusitem {
    display: flex; align-items: center; gap: 10px;
    background: linear-gradient(180deg, rgba(255,205,89,.10), rgba(102,214,255,.05));
    border: var(--border-md) solid rgba(255,205,89,.5);
    border-radius: var(--rad-md);
    padding: 10px 14px;
    margin: 6px 0;
    font-size: 13px; font-weight: 600;
    color: var(--text-primary);
    box-shadow: 0 3px 0 rgba(0,0,0,.35),
                0 0 12px rgba(255,222,89,.25),
                inset 0 -2px 0 rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.06);
    text-align: left;
  }
  #rescueoffer .bonusitem b { color: #ffde3b; font-weight: 900; }

  /* ═══════ TUTORIAL POPUP (task #120) — first-run only ═══════ */
  #tutorial {
    position: fixed; inset: 0;
    z-index: 60;
    display: none;
    align-items: center; justify-content: center;
    background: rgba(6,12,24,0.55);
    backdrop-filter: blur(4px);
    animation: tut-fade-in .35s ease both;
    padding: 24px;
    pointer-events: auto;
  }
  @keyframes tut-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  #tutorial-card {
    background: linear-gradient(180deg, #12253d, #0a1120);
    border: 3px solid #66d6ff;
    border-radius: var(--rad-lg);
    padding: 28px 28px 20px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 0 32px rgba(102,214,255,.45),
                0 8px 24px rgba(0,0,0,.6),
                inset 0 1px 0 rgba(255,255,255,.08);
    animation: tut-pop .45s cubic-bezier(.34,1.56,.64,1) both;
  }
  @keyframes tut-pop {
    from { transform: scale(.75) translateY(20px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
  }
  #tutorial-emoji {
    font-size: 64px;
    line-height: 1;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 18px rgba(102,214,255,.65));
    animation: tut-emoji-bob 2.4s ease-in-out infinite;
  }
  @keyframes tut-emoji-bob {
    0%, 100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-4px) scale(1.05); }
  }
  #tutorial-title {
    font-size: 20px;
    font-weight: 900;
    color: #66d6ff;
    margin-bottom: 10px;
    letter-spacing: .02em;
    text-shadow: 0 0 12px rgba(102,214,255,.5);
  }
  #tutorial-body {
    font-size: 14px;
    color: #c8d4e8;
    line-height: 1.5;
    margin-bottom: 18px;
    font-weight: 500;
  }
  #tutorial-ok {
    padding: 10px 26px;
    font-size: 15px;
    margin-bottom: 14px;
  }
  #tutorial-step-dots {
    display: flex; justify-content: center; gap: 8px;
  }
  #tutorial-step-dots .td-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: rgba(255,255,255,.15);
    transition: background .25s ease, transform .25s ease;
  }
  #tutorial-step-dots .td-dot.done   { background: rgba(125,255,176,.6); }
  #tutorial-step-dots .td-dot.active { background: #66d6ff; transform: scale(1.4); box-shadow: 0 0 8px rgba(102,214,255,.9); }
