:root {
  --bg: #14111f;
  --panel: #211c33;
  --panel2: #2b2542;
  --line: #3a3358;
  --text: #f1ecff;
  --muted: #a59cc4;
  --gold: #ffd34d;
  --red: #ff5f6d;
  --green: #6fe3a0;
  --blue: #7fc8ff;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; color: var(--text);
  font: 15px/1.35 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
/* сияние сверху — на всю страницу (у html), а не на высоту содержимого: иначе на коротком экране
   под текстом обрывался светлый прямоугольник */
html { background: radial-gradient(ellipse 140% 70% at 50% 0%, #2a2147 0%, var(--bg) 70%) no-repeat var(--bg);
  background-size: 100% 100vh; }
body { background: transparent; }
#app { max-width: 480px; margin: 0 auto; padding: 10px 12px calc(84px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px; }
img.px { image-rendering: pixelated; }
button, select { font: inherit; color: inherit; border: 0; cursor: pointer; }
[hidden] { display: none !important; }
.emo { display: inline-grid; place-items: center; font-size: 26px; width: 40px; height: 40px; flex: none; }

/* ---------- рамки редкости (как на отрисованных картах) ---------- */
.frame { position: relative; overflow: hidden; border: 2px solid transparent !important;
  background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--rg) border-box !important;
  background-size: 100% 100%, 300% 300% !important; }
.r-common { --rg: linear-gradient(135deg, #7d7d90, #e9e9f3, #8a8aa0, #d4d4e0, #7d7d90); }
.r-rare { --rg: linear-gradient(135deg, #1f5fbf, #9fd0ff, #2b6fd6, #7fc0ff, #1f5fbf); }
.r-epic { --rg: linear-gradient(135deg, #6a2bbf, #e2b3ff, #7b35d6, #c48aff, #6a2bbf); }
.r-legendary { --rg: linear-gradient(135deg, #b8740a, #fff0a8, #d48a10, #ffd66b, #b8740a); box-shadow: 0 0 12px #ffb52e44; }
.r-mythic { --rg: linear-gradient(135deg, #ff5fd2, #ffd34d, #6fe3a0, #7fc8ff, #b06bff, #ff5fd2); box-shadow: 0 0 14px #ff5fd244; }
.r-legendary, .r-mythic { animation: chrome 4s linear infinite; }
.holo::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; z-index: 2;
  background-size: 260% 260%; mix-blend-mode: screen; animation: holo 3.8s ease-in-out infinite; }
/* легендарные — тёплый золотой отблеск */
.r-legendary.holo::after {
  background-image: linear-gradient(115deg, transparent 26%, #ffe9a055 40%, #ffc94a99 48%, #fff3c077 55%, transparent 70%); }
/* мифические — радужная призма + мерцающие искорки */
.r-mythic.holo::after {
  background-image:
    radial-gradient(circle at 18% 22%, #fff 0 2px, #ffffff66 3px, transparent 5px),
    radial-gradient(circle at 72% 30%, #fff 0 1.5px, #ffffff55 2.5px, transparent 4px),
    radial-gradient(circle at 40% 70%, #fff 0 2px, #ffffff66 3px, transparent 5px),
    radial-gradient(circle at 85% 78%, #fff 0 1.5px, #ffffff55 2.5px, transparent 4px),
    linear-gradient(115deg, transparent 18%, #ff5fd288 32%, #ffd34d88 41%, #6fe3a088 50%, #7fc8ff88 59%, #b06bff88 68%, transparent 82%);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 260% 260%;
  animation: holo-myth 3.2s ease-in-out infinite; }

/* ---------- HUD ---------- */
#hud { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px;
  display: flex; flex-direction: column; gap: 6px; position: sticky; top: 6px; z-index: 5; box-shadow: 0 6px 16px #0008; }
.hud-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#act { font-weight: 700; letter-spacing: .3px; }
#act small { color: var(--muted); font-weight: 400; }
#purse { font-weight: 700; color: var(--gold); display: flex; align-items: center; gap: 4px; }
#purse img { width: 18px; height: 18px; }
#floors { display: grid; grid-template-columns: repeat(8, 1fr) auto; gap: 4px; align-items: center; }
#floors .skull { font-size: 13px; line-height: 1; }
.fl { height: 8px; border-radius: 4px; background: var(--panel2); }
.fl.done { background: #6b5aa8; }
.fl.now { background: var(--gold); box-shadow: 0 0 8px var(--gold); animation: pulse 1.4s ease-in-out infinite; }
.fl.boss { background: #5a2330; }
.fl.boss.now { background: var(--red); box-shadow: 0 0 8px var(--red); }
#hearts { display: flex; gap: 2px; flex-wrap: wrap; }
#hearts span { font-size: 18px; line-height: 1; display: inline-block; }
#hearts span.lost { filter: grayscale(1) brightness(.35); opacity: .8; }
#hearts span.pop { animation: pop .5s ease; }
#relics { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.relic-ic { width: 28px; height: 28px; background: var(--panel2); border-radius: 7px; display: grid; place-items: center; }
.relic-ic img { width: 24px; height: 24px; }
.relic-ic .emo { font-size: 17px; width: 24px; height: 24px; }
.relic-ic.new { animation: pop .6s ease; box-shadow: 0 0 10px var(--gold); }

/* ---------- команда ---------- */
#team { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini { border-radius: 12px; }
.mini img.photo { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.pw { position: absolute; left: 4px; bottom: 4px; background: #000b; border-radius: 8px; padding: 1px 6px;
  font-weight: 800; font-size: 13px; z-index: 3; }
.it { position: absolute; right: 4px; bottom: 4px; font-size: 13px; z-index: 3; text-shadow: 0 1px 2px #000; }
.it .free { font-style: normal; color: #fffa; font-size: 10px; margin-left: 2px; }
#team.hit .mini { animation: shake .45s; }
.team-power { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 13px; margin-top: -2px; }
.team-power b { color: var(--text); }

/* ---------- экраны ---------- */
#screen { display: flex; flex-direction: column; gap: 10px; }
#screen.enter { animation: enter .28s ease; }
.loading, .center { text-align: center; color: var(--muted); padding: 40px 10px; }
h1 { margin: 6px 0 2px; font-size: 24px; text-align: center; }
h2 { margin: 4px 0; font-size: 18px; text-align: center; }
h2 small { color: var(--muted); font-weight: 500; font-size: 14px; }
p.lead { margin: 0; text-align: center; color: var(--muted); }
p.lead b { color: var(--text); }
p.lead.small { font-size: 12px; }
code { background: var(--panel2); border-radius: 6px; padding: 1px 5px; color: var(--text); }
.log { background: var(--panel); border-left: 3px solid var(--gold); border-radius: 10px; padding: 8px 10px;
  white-space: pre-line; font-size: 14px; animation: enter .3s ease; }
.rules { color: var(--muted); font-size: 13px; line-height: 1.55; }
.rules b { color: var(--text); }

.btn { display: block; width: 100%; padding: 13px 14px; border-radius: 12px; background: var(--panel2);
  border: 1px solid var(--line); font-weight: 700; text-align: center; transition: transform .08s, filter .15s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(180deg, #ffcf4a, #f2a91c); color: #2a1a00; border: 0; box-shadow: 0 4px 0 #b77808; }
.btn.primary:active { box-shadow: 0 1px 0 #b77808; transform: translateY(3px); }
.btn.danger { background: transparent; color: var(--muted); border-style: dashed; font-weight: 500; }
/* без pointer-events: none — иначе тап по неактивной кнопке «проваливается» в то, что под ней (карточку кота) */
.btn[disabled] { filter: grayscale(.8) brightness(.7); cursor: not-allowed; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
/* пока ждём ответа, нажатия гасит guarded(); pointer-events: none тут нельзя — тап «проваливался» на карточку под кнопкой */
.busy .btn, .busy .node, .busy .pick, .busy .relic, .busy .bagbtn { cursor: progress; }
.odds { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 8px; margin-left: 4px; }
.odds.easy { background: #1f4a33; color: var(--green); }
.odds.even { background: #4a421f; color: var(--gold); }
.odds.hard { background: #4a1f26; color: var(--red); }

.hud-right { display: flex; align-items: center; gap: 8px; }
#journal { background: var(--panel2); border-radius: 8px; padding: 2px 6px; font-size: 15px; }
.quit-row { text-align: center; margin-top: -2px; }
.quit-link { background: transparent; color: var(--muted); font-size: 13px; padding: 6px 10px; opacity: .75; }
.btn.danger-fill { background: #4a1f26; color: #ffb3ba; border-color: #6b2a33; }
.journal { display: flex; flex-direction: column; gap: 4px; }
.jrow { background: var(--panel2); border-radius: 10px; padding: 7px 10px; font-size: 14px; white-space: pre-line; }
.abyss-card { background: radial-gradient(ellipse at top, #2a0f3a, var(--panel)); border-color: #6b3fa0; }
.abyss-ic { font-size: 54px; text-align: center; animation: bob 2.4s ease-in-out infinite; filter: drop-shadow(0 0 14px #b06bff); }
.abyss-btn { background: linear-gradient(180deg, #8a5cff, #5f36c9) !important; color: #fff !important; box-shadow: 0 4px 0 #3b1f8a !important; }
.top-row.me { color: var(--gold); font-weight: 700; }
.who { text-decoration: underline dotted #ffffff66; text-underline-offset: 3px; cursor: pointer; }
.who:active { color: var(--gold); }
.back-link { background: none; color: var(--muted); font-size: 14px; padding: 4px 0; align-self: flex-start; }
.rar-line { display: flex; justify-content: space-between; font-size: 14px; margin: 6px 0 2px; }
.gcard .notmine { position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 4; font-size: 10px; font-weight: 800;
  white-space: nowrap; background: #ff5f6de6; color: #fff; padding: 1px 6px; border-radius: 8px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.season-card { text-align: center; background: linear-gradient(180deg, #2b2147, var(--panel)); }
.big-num { font-size: 34px; font-weight: 900; margin: 2px 0; }
.hall-s { color: var(--muted); font-size: 12px; margin-top: 6px; }
.res-row { padding: 6px 0; border-bottom: 1px solid #ffffff10; font-size: 14px; }
.res-row:last-child { border-bottom: 0; }
.res-row.me b { color: var(--gold); }
.res-row .sub { color: var(--muted); font-size: 12px; }
.res-loot { margin-top: 2px; }

/* наши эмодзи вместо системных (тот же пак, что у бота в чате) */
/* картинки 16×16: размер только кратный 16px, иначе пиксели «ломаются»; старый браузер без round() возьмёт 1.2em */
img.ej { width: 1.2em; height: 1.2em; width: max(16px, round(nearest, 1.2em, 16px)); height: max(16px, round(nearest, 1.2em, 16px));
  vertical-align: -0.25em; image-rendering: pixelated; display: inline-block; }
#nav button img.ej { width: 32px; height: 32px; margin: -4px 0; }
.emo img.ej { width: max(16px, round(nearest, 1.1em, 16px)); height: max(16px, round(nearest, 1.1em, 16px)); }

/* иконки предметов */
.iic { width: 16px; height: 16px; vertical-align: -3px; filter: drop-shadow(0 1px 1px #000); }
.iic.inline { width: 18px; height: 18px; }
.iic.big { width: 36px; height: 36px; flex: none; }
.iic.proc { width: 22px; height: 22px; }
.iemo { display: inline-block; width: auto; height: auto; filter: none; }
.it .iic { width: 15px; height: 15px; margin-left: 1px; }
.relic .iic.big { width: 44px; height: 44px; }

/* ---------- карта акта ---------- */
.map-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; }
.map-head .legend { color: var(--muted); font-size: 12px; font-weight: 400; }
.map { position: relative; background: linear-gradient(180deg, #1b1630, #18132a); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden; }
.map svg.links { position: absolute; inset: 0; }
.map line { stroke: #4a4170; stroke-width: 3; stroke-dasharray: 2 7; stroke-linecap: round; }
.map line.walked { stroke: var(--gold); stroke-dasharray: none; opacity: .8; }
.node { position: absolute; width: 58px; height: 58px; transform: translate(-50%, -50%); border-radius: 50%;
  background: var(--panel2); border: 2px solid var(--line); display: grid; place-items: center; padding: 0;
  transition: opacity .2s; }
.node .spr { max-width: 46px; max-height: 44px; }
.node .ic { width: 28px; height: 28px; }
.node.fight { border-color: #ff6b6b88; }
/* элита — крупнее, двойная оранжево-золотая рамка, свечение и значок 👿 */
.node.elite { width: 66px; height: 66px; border: 3px solid #ff9f43; background: radial-gradient(circle, #5a3214, #2a160a);
  box-shadow: 0 0 0 2px #ffd34d66, 0 0 14px #ff9f4399; }
.node.elite .spr { max-width: 52px; max-height: 50px; }
.node.elite::before { content: "👿"; position: absolute; bottom: -6px; left: -6px; font-size: 14px; line-height: 1;
  background: #2a160a; border: 2px solid #ff9f43; border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; }
.node.elite.reach { box-shadow: 0 0 0 3px var(--gold), 0 0 22px #ff9f43; }
.node.event { border-color: #7fc8ff88; } .node.chest { border-color: #ffd34d88; }
.node.shop { border-color: #7fe0a088; } .node.rest { border-color: #ffa25c88; }
.node.forge { border-color: #b8c4e0aa; background: radial-gradient(circle, #3a4256, #1c2030); }
.node.trickster { border-color: #5fd3a8aa; background: radial-gradient(circle, #1f4a3c, #12241e); }
.node.forge .ic, .node.trickster .ic { width: 32px; height: 32px; image-rendering: pixelated; }
.node.trial { border: 3px dashed #d36bff; background: radial-gradient(circle, #43205a, #1e1028); }
.node.trial::before { content: "🏋"; position: absolute; bottom: -6px; left: -6px; font-size: 14px; line-height: 1; }
.node.boss { width: 78px; height: 78px; border-color: var(--red); background: #3a1622; }
.node.boss .spr { max-width: 66px; max-height: 64px; }
.node.reach { box-shadow: 0 0 0 3px var(--gold), 0 0 18px #ffd34daa; animation: beat 1.3s ease-in-out infinite; z-index: 2; }
.node.done { box-shadow: 0 0 0 3px #ffd34d66; }
.node.done::after { content: "✓"; position: absolute; right: -2px; top: -4px; background: var(--gold); color: #2a1a00;
  width: 18px; height: 18px; border-radius: 50%; font-size: 12px; font-weight: 900; display: grid; place-items: center; }
.node.gone { opacity: .28; filter: grayscale(.8); }
.node.blocked { opacity: .45; }
.node .tr { position: absolute; top: -6px; left: -6px; font-size: 12px; background: #000c; border-radius: 8px; padding: 0 3px; }
.node .od { position: absolute; bottom: -2px; right: -2px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--bg); }
.node .od.easy { background: var(--green); } .node .od.even { background: var(--gold); } .node .od.hard { background: var(--red); }

/* ---------- всплывающая панель ---------- */
#sheet { position: fixed; inset: 0; z-index: 15; }
.sheet-bg { position: absolute; inset: 0; background: #0009; animation: fade .2s; }
.sheet-body { position: absolute; left: 0; right: 0; bottom: 0; max-width: 480px; margin: 0 auto; max-height: 86vh; overflow: auto;
  background: var(--panel); border-radius: 20px 20px 0 0; border: 1px solid var(--line); border-bottom: 0;
  padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px;
  animation: slideup .25s cubic-bezier(.2, .9, .3, 1); }
.room { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.room-pic { display: grid; place-items: center; min-height: 96px; }
.room-pic .big-spr { max-width: 140px; max-height: 120px; animation: bob 2s ease-in-out infinite; }
.room-pic .big-ic { width: 64px; height: 64px; }
.room .lbl { text-align: center; font-size: 12px; font-weight: 800; letter-spacing: 1px; }
.traits { display: flex; flex-direction: column; gap: 6px; }
.trait { background: var(--panel2); border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.trait.off { opacity: .5; text-decoration: line-through; }
.why { text-align: center; color: var(--muted); margin: 4px 0; }

/* ---------- драфт ---------- */
.draft { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pick { border-radius: 14px; text-align: left; padding: 0; transition: transform .1s; }
.pick img.photo { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.pick .info { padding: 6px 8px 8px; }
.pick .nm { font-weight: 700; font-size: 13px; line-height: 1.2; height: 2.4em; overflow: hidden; }
.pick .st { color: var(--muted); font-size: 12px; margin-top: 2px; }
.pick.on { box-shadow: 0 0 0 3px var(--gold), 0 6px 18px #ffd34d55 !important; transform: translateY(-2px); }
.pick:not(.on) img.photo { filter: saturate(.75) brightness(.85); }
.pick .badge { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; z-index: 3;
  background: var(--gold); color: #2a1a00; font-weight: 900; display: grid; place-items: center; animation: pop .3s; }
.sticky { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 6;
  box-shadow: 0 -14px 0 6px var(--bg), 0 4px 0 #b77808 !important; }
.draft { padding-bottom: 8px; }
.draft-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted);
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px 6px 6px 12px; }
.draft-bar b { color: var(--text); }
.draft-bar .btn { flex: none; }

/* ---------- событие, сундук, лавка ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.card .big { width: 48px; height: 48px; display: block; margin: 0 auto 6px; animation: bob 2.2s ease-in-out infinite; }
.relic { display: flex; gap: 12px; align-items: center; padding: 10px 12px; background: var(--panel2);
  border: 2px solid var(--line); border-radius: 14px; width: 100%; text-align: left; animation: enter .3s ease both; }
.relic img:not(.ej) { width: 44px; height: 44px; flex: none; }
.relic .emo { width: 44px; height: 44px; font-size: 30px; }
.relic .ttl { font-weight: 700; }
.relic .sub { color: var(--muted); font-size: 13px; }
.relic .price { margin-left: auto; font-weight: 800; color: var(--gold); white-space: nowrap; }
.relic.cant .price { color: var(--red); }
.relic.static { cursor: default; }
.chest-lid { font-size: 56px; text-align: center; animation: chest 1s ease; }

/* ---------- итог ---------- */
.score { text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px; color: var(--muted); }
.score .pts { font-size: 38px; font-weight: 900; color: var(--text); }
.score.rec { border-color: var(--gold); box-shadow: 0 0 22px #ffd34d55; color: var(--gold); font-weight: 800; animation: pop .6s ease; }
.rewards { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.reward { background: var(--panel2); border-radius: 12px; padding: 8px 12px; font-weight: 700; animation: pop .5s ease both; }
.reward:nth-child(2) { animation-delay: .1s; } .reward:nth-child(3) { animation-delay: .2s; } .reward:nth-child(4) { animation-delay: .3s; }
.stat { text-align: center; color: var(--muted); }
.stat b { color: var(--text); font-size: 20px; }

/* ---------- бой ---------- */
#overlay { position: fixed; inset: 0; background: #0b0814f7; backdrop-filter: blur(6px); display: grid; place-items: center;
  z-index: 20; animation: fade .2s ease; padding: 16px; }
.fightbox { width: 100%; max-width: 420px; text-align: center; display: flex; flex-direction: column; gap: 14px; }
.foe-name { font-weight: 800; font-size: 18px; }
.fightbox.elite .foe-name { color: #ff9f43; } .fightbox.boss .foe-name { color: var(--red); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 6px; }
.chip { background: var(--panel2); border-radius: 10px; padding: 2px 8px; font-size: 13px; }
.foe-pic { position: relative; height: 150px; display: grid; place-items: center; }
.foe-pic img { max-width: 170px; max-height: 150px; animation: bob 1.6s ease-in-out infinite; }
.fightbox.boss .foe-pic img { max-width: 210px; }
.foe-pic.hurt img { animation: hurt .45s; }
.foe-pic.dead img { animation: die .9s ease forwards; }
.dmg { position: absolute; top: 30%; transform: translateX(-50%); font-size: 30px; font-weight: 900; color: #ff4d5e;
  text-shadow: 0 2px 0 #000, 0 0 10px #ff4d5e88; animation: dmgup 1s ease forwards; pointer-events: none; }
.hp { position: relative; height: 18px; background: #3b1a22; border-radius: 9px; overflow: hidden; margin: 6px 10px 0; }
.hp i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ff4d5e, #ff8a5c); transition: width .35s ease; }
.hp span { position: absolute; inset: 0; font-size: 12px; font-weight: 800; line-height: 18px; text-shadow: 0 1px 2px #000; }
.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cats.hit { animation: shake .5s; }
.cat { border-radius: 12px; }
.cat img.photo { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.cat.atk { animation: atk .45s ease; }
.cat .procs { position: absolute; top: 4px; left: 0; right: 0; display: flex; justify-content: center; gap: 2px; z-index: 3; }
.cat .procs span { font-size: 18px; animation: pop .4s ease both; filter: drop-shadow(0 0 4px #ffd34d); }
.cat .pw { left: 50%; transform: translateX(-50%); font-size: 15px; white-space: nowrap; }
.verdict { font-size: 30px; font-weight: 900; opacity: 0; min-height: 1.2em; }
.verdict.show { animation: stamp .45s cubic-bezier(.2, 1.6, .4, 1) forwards; }
.verdict.win { color: var(--gold); text-shadow: 0 0 18px #ffd34d88; }
.verdict.lose { color: var(--red); }
.gain { font-weight: 800; font-size: 17px; min-height: 1.4em; margin-top: -8px; }
.tap { color: var(--muted); font-size: 12px; }
.float { position: fixed; font-weight: 900; font-size: 22px; pointer-events: none; z-index: 30; animation: floatup 1.1s ease forwards; }

/* ---------- коллекция ---------- */
.chips-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fchip { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 5px 10px; font-size: 14px; }
.fchip.on { background: var(--gold); color: #2a1a00; font-weight: 700; border-color: var(--gold); }
#sort, #psort { margin-left: auto; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 5px 8px; font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gcard { border-radius: 12px; padding: 0; aspect-ratio: 1; }
.gcard img.photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.gcard .cnt { position: absolute; top: 4px; right: 4px; background: #000b; border-radius: 8px; padding: 0 6px; font-size: 12px; font-weight: 800; z-index: 3; }
.cardview { display: flex; flex-direction: column; gap: 10px; }
.bigcard { border-radius: 16px; width: 72%; margin: 0 auto; }
.bigcard img.photo { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.slots { display: flex; flex-direction: column; gap: 6px; }
.slot { border-radius: 12px; padding: 8px 10px; display: flex; gap: 10px; align-items: center; font-size: 14px; }
.slot.full { background: var(--panel2); }
.slot.full > span { font-size: 26px; }
.slot.full small { color: var(--muted); }
.slot.empty { border: 2px dashed var(--line); color: var(--muted); justify-content: center; }
.sub-h { font-weight: 700; margin-top: 4px; }
.bag { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bagbtn { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 8px; text-align: left;
  display: flex; flex-direction: column; gap: 2px; }
.bagbtn span { font-weight: 700; font-size: 14px; }
.bagbtn small { color: var(--muted); font-size: 12px; }
.bagbtn:active { transform: scale(.97); }
.plan { display: flex; flex-direction: column; gap: 4px; max-height: 40vh; overflow: auto; }
.plan-row { background: var(--panel2); border-radius: 10px; padding: 6px 10px; font-size: 14px; }
.plan-row span { font-size: 18px; }

/* ---------- магазин и мята ---------- */
.segs { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 5px; position: sticky; top: 6px; z-index: 5; box-shadow: 0 6px 16px #0008; }
.seg { background: transparent; border-radius: 12px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.seg b { font-size: 17px; }
.seg span { font-size: 11px; color: var(--muted); font-weight: 700; }
.seg.on { background: var(--panel2); box-shadow: inset 0 0 0 2px var(--gold); }
.seg.on span { color: var(--text); }
.star-items .grid-full { grid-column: 1 / -1; margin-top: 4px; }
.bagbtn[disabled] { opacity: .45; cursor: not-allowed; }
.pack.n1 { grid-template-columns: 1fr; width: 55%; margin: 0 auto; }
.purse-big { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 16px; }
.purse-big img { width: 34px; height: 34px; }
.purse-big b { font-size: 34px; color: var(--gold); }
.purse-big.mint b { color: var(--green); }
.purse-big .leaf { font-size: 30px; }
.purse-big span { color: var(--muted); }
.ware { display: flex; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 12px; animation: enter .3s ease both; }
.ware:nth-child(4) { animation-delay: .04s; } .ware:nth-child(5) { animation-delay: .08s; } .ware:nth-child(6) { animation-delay: .12s; }
.ware-txt { flex: 1; }
.ware .ttl { font-weight: 700; }
.ware .sub { color: var(--muted); font-size: 13px; }
.ware .sub.ok { color: var(--green); }
.ware.blocked { opacity: .7; }
.price-btn { width: auto; min-width: 84px; padding: 10px 12px; white-space: nowrap; }
.price-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.price-btn .cur { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: #2a1a00; font-size: 14px; line-height: 1; }
.price-btn[disabled] .cur { background: #0006; }
.price-btn.multi { flex-direction: column; gap: 1px; padding: 6px 10px; line-height: 1.15; font-size: 13px; }
.price-btn.multi .pp.bad { color: #ff8a8a; text-decoration: line-through; }
.price-btn.multi[disabled] { filter: none; background: var(--panel2); color: var(--muted); }  /* серость съела бы красный: видно, чего не хватает */
/* звёздная лавка — свои фиолетовые кнопки, на них звезда горит */
.btn.primary.starbtn { background: linear-gradient(180deg, #8a5cff, #5f36c9); color: #fff; box-shadow: 0 4px 0 #3b1f8a; }
.btn.primary.starbtn:active { box-shadow: 0 1px 0 #3b1f8a; }
.starbtn .cur { background: #1b0f3d; }
.maxed { color: var(--green); font-weight: 800; white-space: nowrap; }
.pips { display: flex; gap: 4px; margin-top: 6px; }
.pips i { width: 18px; height: 6px; border-radius: 3px; background: var(--panel2); }
.pips i.on { background: var(--green); box-shadow: 0 0 6px #6fe3a088; }
.pack { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.flip { perspective: 600px; }
.flip-in { position: relative; aspect-ratio: 1; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.3, 1.3, .5, 1); }
.flip.open .flip-in { transform: rotateY(180deg); }
.flip .back, .flip .front { position: absolute; inset: 0; border-radius: 12px; backface-visibility: hidden; }
.flip .back { display: grid; place-items: center; font-size: 34px; background: repeating-linear-gradient(45deg, #2b2542, #2b2542 8px, #332b52 8px, #332b52 16px);
  border: 2px solid var(--line); }
.flip .front { transform: rotateY(180deg); }
.flip .front img.photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.flip .tag { position: absolute; top: 4px; right: 4px; background: #000b; border-radius: 8px; padding: 0 6px; font-size: 12px; font-weight: 800; z-index: 3; }
.flip .cap { font-size: 12px; text-align: center; margin-top: 4px; color: var(--muted); height: 2.4em; overflow: hidden; opacity: 0; transition: opacity .3s .4s; }
.flip.open .cap { opacity: 1; }
.popin { animation: pop .5s ease; }
/* модификаторы забега (классы значков с префиксом k-: .patron и .pack уже заняты драфтом и пакетиком) */
.patrons { display: grid; grid-template-columns: 1fr; gap: 6px; }
.patron { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px;
  display: flex; flex-direction: column; gap: 2px; }
.patron small { color: var(--muted); font-size: 12px; }
.patron.on { border-color: var(--gold); box-shadow: 0 0 0 2px #ffd34d66; }
.pack-bonus { background: linear-gradient(90deg, #3a2a10, var(--panel)); border: 1px solid #ffd34d55; border-radius: 12px;
  padding: 6px 10px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pack-bonus small { width: 100%; color: var(--muted); font-size: 11px; }
.mod-ic { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; font-size: 14px;
  background: var(--panel2); border: 1px solid var(--line); line-height: 1; }
/* картинка-эмодзи по центру значка: без сдвига вниз, как у эмодзи в строке текста */
.mod-ic img.ej { display: block; width: 16px; height: 16px; margin: 0; vertical-align: top; }
.mod-ic.k-curse { border-color: #ff5f6d99; background: #3a1622; }
.mod-ic.k-bless, .mod-ic.k-patron { border-color: #ffd34d88; }
.mod-ic.k-synergy { border-color: #7fc8ff99; }
.mod-ic.k-pack { border-color: #6fe3a099; }
.node .tell { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); font-size: 12px; background: #000c;
  border-radius: 8px; padding: 0 3px; line-height: 1.3; }
.trait.ability { border-left: 3px solid var(--red); }
.stances { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stance { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 7px 9px;
  display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.stance small { color: var(--muted); font-size: 11px; line-height: 1.25; }
.stance.on { border-color: var(--gold); box-shadow: 0 0 0 2px #ffd34d55; }
.stance:disabled { opacity: .4; }
.cat.crit { box-shadow: 0 0 0 3px #ffd34d, 0 0 18px #ffd34d !important; }
.cat.crit .pw { color: var(--gold); }
.cat.missed { opacity: .5; filter: grayscale(.7); }
.syn { font-size: 11px; color: var(--muted); margin-top: 3px; }
.syn.ready { color: #7fc8ff; font-weight: 700; }
.relic.deal { border-color: #b06bff88; background: linear-gradient(90deg, #2a1640, var(--panel)); }
.swap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.swap select { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 6px; max-width: 46%; }
/* ---------- живые эффекты ---------- */
.quake { animation: quake .32s ease; }
.quake-hard { animation: quake-hard .45s ease; }
@keyframes quake { 0%, 100% { transform: none; } 25% { transform: translate(-3px, 1px); } 50% { transform: translate(3px, -1px); }
  75% { transform: translate(-2px, 0); } }
@keyframes quake-hard { 0%, 100% { transform: none; } 15% { transform: translate(-7px, 2px) rotate(-.6deg); }
  35% { transform: translate(6px, -2px) rotate(.5deg); } 55% { transform: translate(-4px, 1px); } 75% { transform: translate(3px, 0); } }
.spark { position: fixed; z-index: 40; pointer-events: none; font-size: 16px; line-height: 1;
  transform: translate(-50%, -50%); animation: spark .85s cubic-bezier(.2, .7, .4, 1) forwards; }
.spark img.ej { width: 18px; height: 18px; }
@keyframes spark { 0% { transform: translate(-50%, -50%) scale(.4); opacity: 1; }
  70% { opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1); opacity: 0; } }
.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.22); } }
.picked { animation: picked .35s ease; }
@keyframes picked { 35% { transform: scale(.95); filter: brightness(1.25); } }
.tabpop { animation: tabpop .3s ease; }
@keyframes tabpop { 40% { transform: translateY(-4px) scale(1.08); } }
#hearts span.crack { animation: crack .5s ease; }
@keyframes crack { 0% { transform: scale(1.4) rotate(0); filter: brightness(2); } 40% { transform: scale(.8) rotate(-18deg); }
  70% { transform: rotate(10deg); } 100% { transform: none; } }
.anvil { animation: anvil .5s ease; }
@keyframes anvil { 20% { transform: translateY(4px) scale(.94); filter: brightness(1.8); } 50% { transform: translateY(-3px) scale(1.06); } }
.stepping { animation: stepping .35s ease; }
@keyframes stepping { 40% { transform: translate(-50%, -50%) scale(.85); } 100% { transform: translate(-50%, -50%) scale(1); } }
.equip-flash { animation: equip-flash .7s ease; }
@keyframes equip-flash { 25% { filter: brightness(1.8) saturate(1.3); transform: scale(1.03); } }
.shuffle { animation: shuffle .45s ease; }
@keyframes shuffle { 25% { transform: translateX(-6px) rotate(-6deg); } 50% { transform: translateX(6px) rotate(6deg); }
  75% { transform: translateX(-3px); } }
.wheel-ptr.ticking { animation: ticking .12s ease-in-out 40 alternate, ticking .25s ease-in-out 4.8s 8 alternate; }
@keyframes ticking { from { transform: translateX(-50%) rotate(-12deg); } to { transform: translateX(-50%) rotate(12deg); } }
.win-glow { animation: win-glow 1s ease; }
@keyframes win-glow { 30% { box-shadow: 0 0 0 6px #ffd34d88, 0 0 40px #ffd34d; transform: scale(1.12); } }
/* полоски статистики растут, строки рейтинга появляются по очереди */
.hbar i { animation: grow .6s ease both; transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } }
.rank-row { animation: enter .3s ease both; }
.rank-row:nth-child(2) { animation-delay: .03s; } .rank-row:nth-child(3) { animation-delay: .06s; }
.rank-row:nth-child(4) { animation-delay: .09s; } .rank-row:nth-child(5) { animation-delay: .12s; }
.rank-row:nth-child(n+6) { animation-delay: .15s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* казино */
.casino { display: flex; flex-direction: column; gap: 10px; }
.wheel-wrap { position: relative; width: 260px; height: 260px; margin: 6px auto 0; }
.wheel { position: absolute; inset: 0; border-radius: 50%; border: 6px solid #b8862b;
  box-shadow: 0 0 0 3px #3a2a10, 0 10px 30px #000a, inset 0 0 18px #000a; }
.wheel span { position: absolute; left: 50%; top: 0; height: 50%; width: 20px; margin-left: -10px; transform-origin: 50% 100%;
  text-align: center; font-size: 10px; font-weight: 800; color: #fff; padding-top: 5px; text-shadow: 0 1px 1px #000; }
.wheel-ptr { position: absolute; left: 50%; top: -14px; transform: translateX(-50%); z-index: 3; color: var(--gold); font-size: 22px;
  text-shadow: 0 2px 4px #000; }
.wheel-hub { position: absolute; left: 50%; top: 50%; width: 78px; height: 78px; margin: -39px 0 0 -39px; border-radius: 50%; z-index: 2;
  display: grid; place-items: center; font-size: 30px; font-weight: 900; background: radial-gradient(circle, #3a3050, #17121f);
  border: 4px solid #b8862b; }
.wheel-hub.red { background: radial-gradient(circle, #e05050, #8a1f1f); }
.wheel-hub.black { background: radial-gradient(circle, #3a3644, #0f0d14); }
.wheel-hub.green { background: radial-gradient(circle, #43c47a, #1d6b3e); }
.cas-result { text-align: center; font-size: 16px; min-height: 22px; }
.cas-hist { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.cas-hist i { font-style: normal; font-size: 12px; font-weight: 800; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.cas-hist i.red { background: #c73a3a; } .cas-hist i.black { background: #2a2633; } .cas-hist i.green { background: #2f9b5a; }
.cas-colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cas-color { padding: 10px 0; border-radius: 12px; font-weight: 800; border: 2px solid transparent; }
.cas-color.red { background: #7a2424; } .cas-color.black { background: #221f2a; } .cas-color.green { background: #1f5e38; }
.cdot { display: inline-block; width: .85em; height: .85em; border-radius: 50%; vertical-align: -.1em; border: 2px solid #fff6; }
.cdot.red { background: #e04848; } .cdot.black { background: #111; } .cdot.green { background: #3cc277; }
.cas-color.on { border-color: var(--gold); box-shadow: 0 0 12px #ffd34d66; }
/* дуэли */
.card.duel { display: flex; flex-direction: column; gap: 8px; }
.card.duel.focus { box-shadow: 0 0 0 2px var(--gold); }
.card.duel.finished, .card.duel.cancelled, .card.duel.expired { opacity: .92; }
.duel-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.duel-head .x { background: none; color: var(--muted); font-size: 16px; padding: 0 4px; }
.stakes { display: flex; flex-wrap: wrap; gap: 6px; }
.btn.small { width: auto; padding: 8px 12px; font-size: 14px; }
.hand { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hand .pick.dim { opacity: .35; filter: grayscale(.6); }
.hand .pick.chosen { box-shadow: 0 0 0 3px var(--gold), 0 0 14px #ffd34d88; }
.duel-res { font-size: 18px; } .duel-res.win b { color: var(--green); } .duel-res.lose b { color: var(--red); }
.duelbox { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; text-align: center; }
.dvs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.vs { font-weight: 900; font-size: 22px; color: var(--gold); animation: pulse 1s ease-in-out infinite; }
.dside { display: flex; flex-direction: column; gap: 6px; align-items: center; transition: transform .5s, opacity .5s, filter .5s; }
.dside .mini { width: 100%; border-radius: 14px; }
.dside.left { animation: duel-in-l .5s ease; } .dside.right { animation: duel-in-r .5s ease; }
.dname { font-weight: 700; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dscore { font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; }
.dside.won { transform: scale(1.08); filter: drop-shadow(0 0 14px #ffd34d); }
.dside.won .dscore { color: var(--gold); }
.dside.lost { opacity: .45; filter: grayscale(.8); transform: scale(.94); }
.dside.tie { filter: drop-shadow(0 0 10px #7fc8ff); }
.dside.fly-left { animation: fly-left .9s .2s ease-in forwards; }
.dside.fly-right { animation: fly-right .9s .2s ease-in forwards; }
.dverdict { font-size: 26px; font-weight: 900; opacity: 0; transform: scale(.6); transition: all .35s cubic-bezier(.3, 1.6, .5, 1); }
.dverdict.show { opacity: 1; transform: none; } .dverdict.win { color: var(--gold); } .dverdict.lose { color: var(--red); }
#dloot, #dok { transition: opacity .4s; }
@keyframes duel-in-l { from { transform: translateX(-60%) rotate(-8deg); opacity: 0; } }
@keyframes duel-in-r { from { transform: translateX(60%) rotate(8deg); opacity: 0; } }
@keyframes fly-left { to { transform: translateX(-120%) scale(.4) rotate(-20deg); opacity: 0; } }
@keyframes fly-right { to { transform: translateX(120%) scale(.4) rotate(20deg); opacity: 0; } }
/* блестящая копия: золотое сияние рамки + мерцающие искры поверх картинки */
.shiny { box-shadow: 0 0 0 2px #ffe27a, 0 0 14px #ffd34daa !important; }
.shiny::before { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit;
  background:
    radial-gradient(circle at 15% 20%, #fff 0 1.5px, #ffe9a0aa 2.5px, transparent 4px),
    radial-gradient(circle at 80% 15%, #fff 0 2px, #ffe9a0aa 3px, transparent 5px),
    radial-gradient(circle at 65% 75%, #fff 0 1.5px, #ffe9a0aa 2.5px, transparent 4px),
    radial-gradient(circle at 25% 82%, #fff 0 2px, #ffe9a0aa 3px, transparent 5px),
    radial-gradient(circle at 50% 45%, #fff 0 1px, #ffe9a088 2px, transparent 3.5px);
  animation: twinkle 1.6s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .25; transform: scale(.98); } to { opacity: 1; transform: scale(1.02); } }
.shiny-tag { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; text-align: center; font-size: 11px; font-weight: 800;
  color: #2a1a00; background: linear-gradient(90deg, #ffd34d, #fff3c0, #ffd34d); padding: 1px 0; }
.shiny-note { color: var(--gold); }
.shiny-badge { position: absolute; top: 3px; left: 3px; z-index: 5; line-height: 1; padding: 2px; border-radius: 8px; font-size: 18px;
  filter: drop-shadow(0 0 3px #ffd34d);
  background: radial-gradient(circle, #ffe9a0cc, #ffd34d55 60%, transparent 75%); animation: twinkle 1.2s ease-in-out infinite alternate; }
.bigcard .shiny-badge { top: 8px; left: 8px; font-size: 26px; }
.shiny { box-shadow: 0 0 0 2px #ffe27a, 0 0 6px 2px #ffd34d, 0 0 18px #ffd34daa !important; }
.foil.lucky .foil-top, .foil.lucky .foil-body { filter: saturate(1.4) brightness(1.15); }
.foil.lucky { filter: drop-shadow(0 0 14px #ffd34d) drop-shadow(0 8px 14px #0009); }
/* кузница и жулик */
.forge-pic { width: 46px; height: 46px; flex: none; border-radius: 10px; }
.forge-pic img.photo { width: 100%; height: 100%; object-fit: cover; }
.mini .forged { position: absolute; top: 2px; right: 2px; z-index: 4; font-size: 12px; background: #000b; border-radius: 6px; padding: 0 3px; }
.cups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 10px; }
.cup { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 0; font-size: 30px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line); transition: transform .1s; }
.cup:active { transform: translateY(2px); }
.cup:disabled { opacity: .4; }
.cup small { font-size: 12px; color: var(--muted); }
/* запечатанный пакетик: фольга с бликом, верх отрывается по зубчатой линии */
.foil { position: relative; width: 50%; aspect-ratio: 3 / 4; margin: 6px auto 0; cursor: pointer;
  animation: foil-wobble 1.6s ease-in-out infinite; filter: drop-shadow(0 8px 14px #0009); }
.foil-top, .foil-body { position: absolute; inset: 0; border-radius: 10px;
  background: linear-gradient(115deg, #5b3a9e 0%, #8d5bd6 30%, #ffd34d 46%, #8d5bd6 60%, #4a2f86 100%);
  background-size: 260% 100%; animation: foil-shine 2.4s linear infinite; }
.foil-top::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12%;
  background: repeating-linear-gradient(90deg, #0000 0 6px, #fff3 6px 8px); }  /* рубчик запайки */
.foil-body { padding-top: 12%; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; color: #fff; text-shadow: 0 2px 0 #2a1650; }
.foil-body b { font-size: 20px; letter-spacing: .5px; }
.foil-body small { font-size: 12px; opacity: .9; }
.foil-logo { font-size: 54px; line-height: 1; }
.foil.torn { animation: none; }
.foil.torn .foil-top { animation: foil-rip .7s cubic-bezier(.3, .6, .4, 1) forwards; }
.foil.torn .foil-body { animation: foil-drop .75s ease-in forwards; }
.tap-hint { text-align: center; animation: pulse 1.4s ease-in-out infinite; }
.lead.warn { color: var(--gold); }
@keyframes foil-wobble { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg) translateY(-4px); } }
@keyframes foil-shine { from { background-position: 100% 0; } to { background-position: -160% 0; } }
@keyframes foil-rip { 0% { transform: none; } 25% { transform: translate(6px, -4px) rotate(4deg); }
  100% { transform: translate(140%, -120%) rotate(55deg); opacity: 0; } }
@keyframes foil-drop { 0%, 30% { transform: none; opacity: 1; } 100% { transform: translateY(70%) scale(.9); opacity: 0; } }

/* ---------- босс ---------- */
.boss-card { background: linear-gradient(180deg, #3a1622, var(--panel)); border: 2px solid #ff5f6d66; border-radius: 18px;
  padding: 12px; display: flex; flex-direction: column; gap: 10px; animation: enter .3s ease; }
.boss-card.rage { border-color: var(--red); box-shadow: 0 0 22px #ff3b3b55; }
.boss-card.defeated { border-color: var(--gold); background: linear-gradient(180deg, #3a2e14, var(--panel)); }
.boss-card.escaped { opacity: .7; }
.boss-card.killed { animation: shake .6s, glowgold 1.5s ease; }
.boss-pic { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 3; background: #200a10; }
.boss-pic img.photo { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(1.2) contrast(1.1);
  animation: breathe 3s ease-in-out infinite; }
.boss-card.rage .boss-pic img.photo { filter: saturate(1.4) contrast(1.15) sepia(.3) hue-rotate(-25deg); }
.boss-pic::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 45%, #000c 100%); pointer-events: none; }
.boss-pic.hurt img.photo { animation: hurt .45s; }
.boss-pic.dead img.photo { animation: die 1.2s ease forwards; }
.boss-name { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 2; font-weight: 900; font-size: 18px;
  text-shadow: 0 2px 4px #000, 0 0 12px #000; }
.vuln-badge { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 2; background: var(--gold); color: #2a1a00;
  font-weight: 900; border-radius: 10px; padding: 3px 10px; animation: pulse 1s ease-in-out infinite; }
.bdmgs { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.dmg.tagline { font-size: 18px; color: var(--gold); top: 15%; }
.hp.big { height: 24px; border-radius: 12px; margin: 0; }
.hp.big span { line-height: 24px; font-size: 13px; }
.next-hit { display: flex; gap: 10px; align-items: center; background: #0006; border-radius: 12px; padding: 8px; }
.next-hit .mini { width: 64px; flex: none; border-radius: 10px; }
.next-hit .ttl { font-weight: 700; }
.next-hit .sub { color: var(--muted); font-size: 12px; }
.next-hit .sub b { color: var(--text); font-size: 15px; }
.mini.lunge { animation: lunge .5s ease; }
.hit-btn { font-size: 17px; background: linear-gradient(180deg, #ff6b6b, #d63a4a) !important; color: #fff !important; box-shadow: 0 4px 0 #8a1f2b !important; }
.hit-btn small { font-weight: 500; opacity: .85; }
.boss-over { text-align: center; color: var(--muted); background: #0006; border-radius: 12px; padding: 12px; }
.boss-over.win { color: var(--gold); font-weight: 800; }
.boss-top { background: #0005; border-radius: 12px; padding: 8px 10px; }
.top-row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 14px; }
#nav button.alarm { color: #ff8a8a; animation: alarm 1.2s ease-in-out infinite; }
#nav button.alarm.vuln { color: var(--gold); }

/* ---------- нижняя навигация ---------- */
#nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: center; gap: 4px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: #14111fee; backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); }
#nav button { flex: 1 1 0; min-width: 0; max-width: 120px; background: transparent; border-radius: 12px; padding: 6px 2px; font-size: 20px;
  display: flex; flex-direction: column; align-items: center; color: var(--muted); }
#nav button span { font-size: 12px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 340px) { #nav { gap: 2px; padding-left: 4px; padding-right: 4px; } #nav button { padding: 6px 0; } #nav button span { font-size: 10px; letter-spacing: -.2px; } }
/* профиль: «Я» / «Рейтинг» и разделы рейтинга */
.segs.two { grid-template-columns: 1fr 1fr; }
/* статистика */
/* классы с префиксом st-: .gain/.loss уже заняты другим экраном */
.hbar { display: grid; grid-template-columns: 38% 1fr auto; align-items: center; gap: 10px; font-size: 13px; padding: 6px 0; }
.hbar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.hbar i { height: 8px; border-radius: 4px; display: block; align-self: center; }
.hbar i.st-in { background: linear-gradient(90deg, #3987e5, #7fc8ff); }
.hbar i.st-out { background: linear-gradient(90deg, #e66767, #ff9f8a); }
.hbar i.r-fill { background: var(--rg); background-size: 200% 100%; }
.hbar b { font-variant-numeric: tabular-nums; font-size: 13px; }
.sub-h.small { font-size: 12px; margin: 14px 0 2px; color: var(--muted); }
.flow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; text-align: center; margin: 6px 0 4px; }
.flow small { display: block; color: var(--muted); font-size: 12px; }
.flow b { font-size: 22px; font-variant-numeric: tabular-nums; }
.flow .st-in { color: #7fc8ff; } .flow .st-out { color: #ff8a8a; }
.wl { display: flex; height: 22px; border-radius: 11px; overflow: hidden; font-size: 12px; font-weight: 800; margin: 8px 0 10px; }
.wl i { font-style: normal; display: grid; place-items: center; min-width: 22px; }
.wl .w { background: var(--green); color: #0b2a17; } .wl .l { background: var(--red); color: #2a0b0b; }
.days { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; height: 100px; align-items: end; margin-top: 8px; }
.day { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; text-align: center; }
.day i { display: block; background: linear-gradient(0deg, #6a2bbf, #c48aff); border-radius: 3px 3px 0 0; min-height: 2px; }
.day small { font-size: 9px; color: var(--muted); }
.rtabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.rtabs .fchip { white-space: nowrap; padding: 6px 2px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.rank-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; padding: 5px 0; font-size: 14px;
  border-bottom: 1px solid #ffffff0d; }
.rank-row:last-child { border-bottom: 0; }
.rank-row.me { color: var(--gold); font-weight: 700; }
.rank-row .n { color: var(--muted); font-weight: 800; }
.rank-row b { font-variant-numeric: tabular-nums; }
.link-card { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; }
.craft-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 8px 0;
  border-bottom: 1px solid #ffffff10; }
.craft-row:last-child { border-bottom: 0; }
.craft-row .sub { color: var(--muted); font-size: 12px; }
#nav button.on { background: var(--panel2); color: var(--text); }

#toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #000e; padding: 10px 14px; border-radius: 12px; max-width: 90%; z-index: 40; text-align: center; }
#toast.show { animation: fade .2s ease; }

@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes beat { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.08); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideup { from { transform: translateY(100%); } to { transform: none; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes hurt { 0% { filter: none; } 25% { filter: brightness(3) saturate(0); transform: translateX(8px); }
  60% { transform: translateX(-6px); } 100% { filter: none; transform: none; } }
@keyframes die { to { transform: translateY(30px) rotate(25deg) scale(.6); opacity: 0; filter: grayscale(1); } }
@keyframes atk { 0% { transform: none; } 40% { transform: translateY(-22px) scale(1.06); } 100% { transform: none; } }
@keyframes dmgup { from { opacity: 1; transform: translate(-50%, 0) scale(1.3); } to { opacity: 0; transform: translate(-50%, -70px) scale(1); } }
@keyframes stamp { from { opacity: 0; transform: scale(2.2); } to { opacity: 1; transform: scale(1); } }
@keyframes floatup { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -60px); } }
@keyframes chest { 0% { transform: scale(.6) rotate(-8deg); } 50% { transform: scale(1.2) rotate(6deg); } 100% { transform: none; } }
@keyframes holo { 0% { background-position: 100% 100%; } 50% { background-position: 0% 0%; } 100% { background-position: 100% 100%; } }
@keyframes holo-myth {
  0% { background-position: 0 0, 0 0, 0 0, 0 0, 100% 100%; opacity: .85; }
  25% { opacity: 1; }
  50% { background-position: 0 0, 0 0, 0 0, 0 0, 0% 0%; opacity: .7; }
  75% { opacity: 1; }
  100% { background-position: 0 0, 0 0, 0 0, 0 0, 100% 100%; opacity: .85; } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@keyframes lunge { 0% { transform: none; } 45% { transform: translateY(-40px) scale(1.15) rotate(-6deg); } 100% { transform: none; } }
@keyframes alarm { 0%, 100% { transform: none; } 50% { transform: scale(1.12); text-shadow: 0 0 12px currentColor; } }
@keyframes glowgold { 0% { box-shadow: 0 0 0 #ffd34d00; } 40% { box-shadow: 0 0 40px #ffd34dcc; } 100% { box-shadow: 0 0 0 #ffd34d00; } }
@keyframes chrome { 0% { background-position: 0 0, 0% 50%; } 100% { background-position: 0 0, 300% 50%; } }
