/* Легенды Вальмерии — стили (HTML5/CSS3, без зависимостей). Дизайн 3.0: кузня и лава, под логотип */

/* ---------- шрифты (SIL Open Font License, см. assets/fonts) ---------- */
@font-face { font-family: "Philosopher"; font-weight: 400; font-display: swap; src: url(../fonts/philosopher-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Philosopher"; font-weight: 400; font-display: swap; src: url(../fonts/philosopher-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Philosopher"; font-weight: 700; font-display: swap; src: url(../fonts/philosopher-cyrillic-700-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Philosopher"; font-weight: 700; font-display: swap; src: url(../fonts/philosopher-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Ruslan Display"; font-display: swap; src: url(../fonts/ruslan-display-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Ruslan Display"; font-display: swap; src: url(../fonts/ruslan-display-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF; }

@font-face { font-family: "Yeseva One"; font-display: swap; src: url(../fonts/yeseva-one-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Yeseva One"; font-display: swap; src: url(../fonts/yeseva-one-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }

/* ---------- токены ---------- */
:root {
  --bg: #120908;
  --bg-2: #1b0e0c;
  --surface: #2a1512;
  --surface-2: #3a1d18;
  --surface-3: #4e271f;
  --line: rgba(232, 160, 110, .18);
  --line-2: rgba(240, 170, 110, .34);
  --text: #f5e8d4;
  --muted: #c4a48a;
  --gold: #f4b443;
  --gold-2: #ffd98a;
  --gold-dark: #a3601c;
  --ember: #ff6a1f;
  --green: #5fd068;
  --red: #ff6464;
  --blue: #6cc4ff;
  --purple: #e07a5f;
  --r: 14px;
  --r-sm: 10px;
  --gap: 12px;
  --tap: 44px;
  --shadow: 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .3);
  --font: "Philosopher", "Trebuchet MS", "PT Sans", Arial, sans-serif;
  --font-display: "Yeseva One", "Philosopher", Georgia, serif;
  --tabbar-h: 64px;
  --lava: #e2421b;
  --lava-2: #ff8a2a;
  --blood: #6e1210;
  --ink: #5a1210;
  --parch: #ecd3a2;
  --parch-2: #d3ad74;
  --iron: #9a918a;
  --iron-2: #4b4440;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* ---------- основа ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); min-height: 100%; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; color: var(--text); font: 15px/1.5 var(--font);
  background: radial-gradient(1200px 600px at 50% -200px, rgba(226, 66, 27, .25), transparent 70%),
              radial-gradient(800px 500px at 100% 100%, rgba(255, 122, 61, .08), transparent 70%), var(--bg);
  background-attachment: fixed; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: url(../img/bg.svg) center top / cover no-repeat; opacity: .55; pointer-events: none; }
body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at 50% 0%, transparent 40%, rgba(10, 4, 3, .65) 100%); }
a { color: var(--gold); text-decoration: none; transition: color .15s; }
a:hover { color: var(--gold-2); }
img { max-width: 100%; }
h1, h2, h3, h4 { color: #fff; margin: 6px 0 10px; font-weight: 700; line-height: 1.25; }
h2 { font-size: 20px; } h3 { font-size: 17px; } h4 { font-size: 15px; }
p { margin: 8px 0; }
small, .muted { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(245, 200, 76, .35); }
.center { text-align: center; }
.right { text-align: right; }
.hidden, [hidden] { display: none !important; }
.mt { margin-top: 12px; } .mb { margin-bottom: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grow { flex: 1; min-width: 0; }

/* иконки */
.i { width: 1.25em; height: 1.25em; vertical-align: -.25em; flex: none; }
.c-gold { color: var(--gold); } .c-red { color: var(--red); } .c-blue { color: var(--blue); } .c-green { color: var(--green); } .c-purple { color: var(--purple); }

/* ---------- каркас ---------- */
.shell { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.in-game .shell { padding-bottom: calc(var(--tabbar-h) + var(--safe-b)); }
.body-grid { flex: 1; }
.page { padding: 4px 0 12px; animation: pageIn .35s ease-out both; }
.side { display: none; }
.head-img { display: block; width: 100%; border-radius: 0 0 var(--r) var(--r); }

/* шапка */
.appbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px;
  background: rgba(18, 9, 8, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--gold); font-family: var(--font-display); font-size: 17px; letter-spacing: .5px; white-space: nowrap; overflow: hidden; }
.brand img { width: 32px; height: 32px; border-radius: 8px; box-shadow: 0 0 0 1px var(--line-2); }
.brand span { overflow: hidden; white-space: normal; line-height: 1.05; max-width: 11em; }
.appbar-icons { display: flex; gap: 2px; }
.appbar-icons a { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-width: var(--tap); height: var(--tap); padding: 0 6px; color: var(--text); border-radius: 12px; }
.appbar-icons a:hover { background: var(--surface); color: #fff; }
.appbar-icons .i { width: 22px; height: 22px; }
.appbar-icons .cnt { font-size: 12px; color: var(--muted); }
[data-mute] .off, [data-mute].is-muted .on { display: none; }
[data-mute].is-muted .off { display: inline; }
.badge { position: absolute; top: 4px; right: 2px; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.badge.pulse { animation: pulse 1.6s infinite; }

/* ресурсы */
.resbar { display: flex; align-items: center; justify-content: space-around; gap: 6px; margin: 10px 10px 2px; padding: 8px 10px; border-radius: 999px; background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.resbar > * { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-size: 15px; }
.resbar b { font-weight: 700; }
.resbar .i { width: 20px; height: 20px; }
.res-daily { color: var(--gold) !important; animation: pulse 1.4s infinite; }

/* нижняя панель вкладок */
.tabbar { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(22, 11, 9, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.tabbar a { flex: 1; max-width: 112px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 12px; position: relative; transition: color .15s; }
.tabbar a .i { width: 24px; height: 24px; transition: transform .2s; }
.tabbar a:hover { color: #fff; }
.tabbar a.on { color: var(--gold); }
.tabbar a.on .i { transform: translateY(-2px) scale(1.08); filter: drop-shadow(0 0 6px rgba(245, 200, 76, .55)); }
.tabbar a.on::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); }

/* подвал */
.foot { padding: 14px 12px 18px; text-align: center; font-size: 13px; color: var(--muted); }
.foot-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0; }
.foot-links a { color: var(--muted); padding: 6px 0; }
.foot-links a:hover { color: var(--gold); }
.clock { margin-top: 6px; font-size: 12px; opacity: .7; }

/* ---------- блоки ---------- */
.box { margin: 10px; padding: 14px; background: linear-gradient(180deg, rgba(70, 32, 24, .55), rgba(36, 17, 14, .9)); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); word-wrap: break-word; }
.box.flat { background: rgba(28, 13, 11, .8); box-shadow: none; }
.box h3:first-child, .box h2:first-child, .box h4:first-child { margin-top: 0; }
.title { display: flex; align-items: center; gap: 10px; margin: 16px 12px 6px; color: var(--gold); font-size: 18px; font-weight: 700; letter-spacing: .3px; }
.title::before, .title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-dark)); }
.title::after { background: linear-gradient(90deg, var(--gold-dark), transparent); }
.notice { border-color: rgba(255, 100, 100, .6); background: linear-gradient(180deg, rgba(120, 30, 40, .35), rgba(36, 17, 14, .9)); }
.list { margin: 10px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.list > a, .list > div { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--text); transition: background .15s; }
.list > a:last-child, .list > div:last-child { border-bottom: 0; }
.list > a:hover { background: var(--surface-2); color: #fff; }
.list img.ico { width: 40px; height: 40px; object-fit: contain; flex: none; }
.ico-box { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; flex: none; border-radius: 12px; background: var(--surface-3); color: var(--gold); box-shadow: inset 0 0 0 1px var(--line-2); }
.ico-box .i { width: 22px; height: 22px; }
.kv { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: 0; }
.empty-state { padding: 26px 16px; text-align: center; color: var(--muted); }
.empty-state .i { width: 44px; height: 44px; margin-bottom: 6px; color: var(--line-2); }

/* ---------- кнопки ---------- */
.btn, button.btn, input.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); cursor: pointer; border: 0; padding: 10px 22px;
  color: #2b1a00; font: inherit; font-size: 15px; font-weight: 700; text-align: center; border-radius: 12px; text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
  background: linear-gradient(180deg, var(--gold-2), var(--gold) 55%, #e0a93a); box-shadow: 0 2px 0 var(--gold-dark), 0 6px 16px rgba(245, 200, 76, .22), inset 0 1px 0 rgba(255, 255, 255, .5);
  transition: transform .1s, filter .15s, box-shadow .15s; -webkit-tap-highlight-color: transparent; }
.btn:hover { color: #2b1a00; filter: brightness(1.07); }
.btn:active { transform: translateY(2px); box-shadow: 0 0 0 var(--gold-dark), 0 2px 8px rgba(245, 200, 76, .2), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn[disabled], .btn.disabled { filter: grayscale(.85) brightness(.65); pointer-events: none; }
.btn-block { display: flex; width: 100%; margin: 8px 0; }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 14px; border-radius: 10px; }
.btn-ghost, .btn-sm.btn-ghost { color: var(--text); text-shadow: none; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost:hover { color: #fff; background: var(--surface-3); }
.btn-red { color: #fff; text-shadow: none; background: linear-gradient(180deg, #ff8a7a, #e0453d); box-shadow: 0 2px 0 #9b2a25, 0 6px 16px rgba(224, 69, 61, .25); }
.btn-green { color: #0d2a00; background: linear-gradient(180deg, #9cf27e, #4fbf45); box-shadow: 0 2px 0 #2d7a26, 0 6px 16px rgba(79, 191, 69, .25); }
.btn-hero { min-height: 60px; font-size: 20px; letter-spacing: .5px; border-radius: 16px; }
.inline-form { display: inline; margin: 0; }
.inline-form .btn-block { width: 100%; }
form.inline-form:has(.btn-block) { display: block; }
.link-btn { background: none; border: 0; color: var(--gold); cursor: pointer; font: inherit; padding: 6px 0; }
.link-btn:hover { color: var(--gold-2); }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btns > * { flex: 1; }

/* ---------- формы ---------- */
input[type=text], input[type=password], input[type=email], input[type=number], input[type=file], select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 12px; margin: 4px 0 10px; color: var(--text); background: rgba(14, 6, 5, .7); border: 1px solid var(--line-2); border-radius: 10px; font: inherit; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245, 200, 76, .2); }
textarea { min-height: 96px; resize: vertical; }
label { display: block; color: var(--muted); font-size: 14px; }
label.check { display: flex; gap: 10px; align-items: center; min-height: var(--tap); color: var(--text); margin: 4px 0; }
label.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--gold); }

/* ---------- тосты ---------- */
.toasts { position: fixed; z-index: 100; top: 10px; left: 50%; transform: translateX(-50%); width: min(420px, 94vw); pointer-events: none; }
.toast { pointer-events: auto; margin-bottom: 8px; padding: 12px 16px; border-radius: 12px; color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: toastIn .35s cubic-bezier(.2, 1.4, .4, 1) both; cursor: pointer; border: 1px solid rgba(255, 255, 255, .15); }
.toast-ok { background: linear-gradient(135deg, #22663a, #3c9c4b); }
.toast-err { background: linear-gradient(135deg, #7d1f2a, #c4423a); }
.toast.out { animation: toastOut .3s ease-in forwards; }

/* старый блок ресурсов (на случай пользовательских шаблонов) */
.res { display: flex; justify-content: space-around; padding: 10px; margin: 10px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }

/* ---------- главный экран ---------- */
.hero { position: relative; margin: 10px; padding: 18px 16px 16px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(18, 9, 8, .1), rgba(18, 9, 8, .92) 70%), url(../img/bg.svg) 70% 22% / 190% auto no-repeat, #1c0b09; box-shadow: var(--shadow); }
.hero-top { display: flex; align-items: center; gap: 12px; }
.hero-top img { width: 58px; height: 58px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--gold); object-fit: cover; }
.hero-name { font-size: 19px; font-weight: 700; color: #fff; }
.hero-sub { font-size: 14px; color: var(--muted); }
.hero .btn-hero { margin: 16px 0 4px; }
.hero .hero-links { display: flex; gap: 8px; }
.hero .hero-links .btn { flex: 1; }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px; }
.status-card { position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 104px; padding: 12px; border-radius: var(--r); color: var(--text); background: linear-gradient(160deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); overflow: hidden;
  transition: transform .15s, border-color .15s; animation: popIn .4s both; animation-delay: calc(var(--i, 0) * 50ms); }
.status-card:hover { transform: translateY(-2px); border-color: var(--line-2); color: var(--text); }
.status-card .sc-ico { position: absolute; right: -6px; bottom: -8px; width: 64px; height: 64px; color: rgba(255, 255, 255, .06); }
.status-card .sc-h { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.status-card .sc-h .i { color: var(--gold); }
.status-card .sc-v { font-size: 20px; font-weight: 700; color: #fff; line-height: 1.2; }
.status-card .sc-s { font-size: 12px; color: var(--muted); }
.status-card.hot { border-color: rgba(245, 200, 76, .6); box-shadow: 0 0 0 1px rgba(245, 200, 76, .25), 0 0 18px rgba(245, 200, 76, .15); }
.status-card .bar { margin-top: auto; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 92px; padding: 10px 6px; border-radius: var(--r); color: var(--text); font-size: 13px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); transition: transform .15s, background .15s; animation: popIn .4s both; animation-delay: calc(var(--i, 0) * 40ms); }
.tile:hover { transform: translateY(-2px); background: var(--surface-2); color: #fff; }
.tile .i { width: 30px; height: 30px; color: var(--gold); }
.tile img { width: 40px; height: 40px; object-fit: contain; }
.more-section { margin: 16px 12px 4px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }

/* новости / акции */
.news-banner { display: flex; gap: 8px; align-items: center; }
.action-banner { display: block; margin: 10px 0; padding: 12px; border-radius: var(--r); color: #fff; background: linear-gradient(90deg, rgba(255, 122, 61, .35), rgba(226, 66, 27, .3)), url(../../images/bg-head.jpg) center / cover; border: 1px solid rgba(245, 200, 76, .6); }
.glow { animation: glowPulse 2.2s infinite ease-in-out; }
.gift-box { text-align: center; border-color: rgba(245, 200, 76, .6); }

/* ---------- карты ---------- */
.cards-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding: 8px; }
.gcard { --rc: #5aa9d6; --rc2: #2b5f86; position: relative; display: block; width: 124px; color: var(--text); text-align: center; perspective: 700px; transition: transform .2s; }
.gcard:hover { color: var(--text); }
.gc-frame { position: relative; padding: 6px 6px 8px; border-radius: 14px; transform-style: preserve-3d;
  background: linear-gradient(160deg, #3d1d17, #1b0c0a 70%) padding-box, linear-gradient(160deg, var(--rc), var(--rc2) 45%, var(--rc)) border-box;
  border: 2px solid transparent; box-shadow: 0 6px 16px rgba(0, 0, 0, .5), inset 0 0 14px rgba(0, 0, 0, .45);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .25s ease-out, box-shadow .2s; }
.gcard:hover .gc-frame { box-shadow: 0 10px 22px rgba(0, 0, 0, .6), 0 0 14px color-mix(in srgb, var(--rc) 55%, transparent); }
.gc-frame::after { content: ""; position: absolute; inset: 0; border-radius: 12px; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .16) 45%, transparent 60%); background-size: 250% 100%; background-position: var(--shine, 120%) 0; transition: background-position .4s; }
.gcard:hover .gc-frame::after { --shine: -20%; }
.gc-art { position: relative; margin: 0 auto 6px; width: 100%; aspect-ratio: 90 / 133; border-radius: 60px 60px 10px 10px / 46px 46px 10px 10px; overflow: hidden; box-shadow: 0 0 0 2px color-mix(in srgb, var(--rc) 70%, #000), inset 0 0 0 1px rgba(255, 255, 255, .1); background: #100605; }
.gcard img.art { display: block; width: 100%; height: 100%; object-fit: cover; }
.gcard .nm { margin: 0 -2px 4px; padding: 3px 4px; border-radius: 6px; color: #fff; font-size: 13px; font-weight: 700; line-height: 1.2; min-height: 2.4em; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--rc) 30%, transparent), transparent); }
.gcard .lv { position: absolute; z-index: 2; top: -6px; left: -6px; width: 28px; height: 28px; line-height: 28px; border-radius: 50%; font-weight: 700; font-size: 14px; color: #fff;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--rc) 80%, #fff), var(--rc2)); box-shadow: 0 0 0 2px #120908, 0 2px 6px rgba(0, 0, 0, .6); }
.gcard .up { position: absolute; z-index: 2; top: 6px; right: 6px; padding: 0 6px; border-radius: 8px; background: rgba(79, 191, 69, .92); color: #fff; font-size: 11px; font-weight: 700; }
.gcard .abil { position: absolute; z-index: 2; top: 30px; right: 4px; width: 24px; height: 24px; line-height: 24px; text-align: center; border-radius: 50%; background: rgba(18, 9, 8, .85); box-shadow: 0 0 0 1px var(--line-2); font-size: 13px; cursor: help; animation: glowPulse 2.4s infinite; }
.gcard .st { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; font-size: 11.5px; }
.gcard .st i { display: flex; align-items: center; gap: 3px; padding: 2px 4px; border-radius: 6px; background: rgba(0, 0, 0, .28); font-style: normal; white-space: nowrap; }
.gcard .st .i { width: 13px; height: 13px; vertical-align: 0; }
.gcard > .btn, .gcard > form, .gcard > small, .gcard > .bar, .gcard > a.btn { margin-top: 6px; }
.gcard.selected .gc-frame { box-shadow: 0 0 0 3px var(--gold), 0 0 18px rgba(245, 200, 76, .5); }
.gcard.dead { filter: grayscale(1) brightness(.5); }
.r-common { --rc: #5aa9d6; --rc2: #24557a; } .r-rare { --rc: #f0973a; --rc2: #8a4a12; } .r-myth { --rc: #ff5a2a; --rc2: #7a1408; }
.r-myth .gc-frame { animation: mythGlow 3s infinite ease-in-out; }
.card-big { display: flex; gap: 14px; align-items: flex-start; }
.card-big img.art { width: 130px; border-radius: 60px 60px 12px 12px / 46px 46px 12px 12px; border: 2px solid var(--rc, var(--line)); box-shadow: 0 0 18px color-mix(in srgb, var(--rc, #000) 40%, transparent); }
.stats-table { width: 100%; border-collapse: collapse; }
.stats-table td { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.stats-table td:last-child { text-align: right; color: #fff; }
.stat-ico { width: 18px; height: 18px; vertical-align: -4px; margin-right: 4px; }
.slot-empty { width: 124px; height: 230px; border: 2px dashed var(--line-2); border-radius: 14px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.deal > * { animation: deal .55s cubic-bezier(.2, 1.2, .4, 1) both; animation-delay: calc(var(--i, 0) * 90ms); }
.flip-in { animation: flipIn .7s ease-out both; }

/* ---------- полосы ---------- */
.bar { position: relative; height: 18px; margin: 6px 0; border-radius: 9px; background: rgba(8, 3, 2, .8); overflow: hidden; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .7), 0 0 0 1px var(--line); }
.bar > i { position: absolute; inset: 0 auto 0 0; width: var(--w, 100%); border-radius: 9px; background: linear-gradient(180deg, #8ff06a, #3fae2f); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); transition: width .5s ease-out; }
.bar.enemy > i { background: linear-gradient(180deg, #ff8b7f, #c9302a); }
.bar.blue > i { background: linear-gradient(180deg, #8fd0ff, #2c74d6); }
.bar > span { position: relative; display: block; text-align: center; font-size: 11px; line-height: 18px; color: #fff; text-shadow: 0 1px 2px #000; }
.bar.low > i { animation: lowHp 1s infinite; }

/* ---------- бой ---------- */
.arena { position: relative; padding: 8px 6px; }
.box.arena { background: radial-gradient(circle at 50% 50%, rgba(255, 122, 61, .12), transparent 60%), linear-gradient(180deg, rgba(70, 32, 24, .6), rgba(28, 13, 11, .95)); }
.fighter { position: relative; text-align: center; }
.fighter img.art { width: 100px; border-radius: 50px 50px 10px 10px / 38px 38px 10px 10px; box-shadow: 0 0 0 2px var(--line-2), 0 8px 20px rgba(0, 0, 0, .5); transition: transform .2s; }
.vs { display: block; margin: 6px auto; width: 50px; animation: vsBeat 1.5s infinite ease-in-out; }
.hit { animation: shake .5s; }
.lunge-up { animation: lungeUp .4s ease-out; }
.lunge-down { animation: lungeDown .4s ease-out; }
.dmg { position: absolute; left: 50%; top: 30%; z-index: 6; font-weight: 700; font-size: 24px; color: #ff5a5a; pointer-events: none; text-shadow: 0 0 6px #000, 0 2px 0 #000; animation: floatUp 1.2s ease-out forwards; }
.dmg.heal { color: #8ff06a; }
.dmg.crit { font-size: 32px; color: var(--gold-2); }
.log { font-size: 13px; color: var(--muted); max-height: 150px; overflow: auto; }
.log div { padding: 3px 0; border-bottom: 1px dotted var(--line); animation: pageIn .3s both; }
.timer { color: var(--gold); font-weight: 700; }
.turn-mine { color: var(--green); animation: pulse 1.2s infinite; }
.big-timer { font-size: 44px; font-weight: 700; color: var(--gold); text-align: center; animation: pulse 1s infinite; }
.attack-btns { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
.target { cursor: pointer; }
.target.can .gc-frame { box-shadow: 0 0 0 2px var(--red), 0 0 16px rgba(255, 100, 100, .6); animation: targetGlow 1s infinite; }
.round-banner { pointer-events: none;  position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 30px; color: var(--gold); background: rgba(10, 9, 30, .82); border-radius: var(--r); animation: bannerIn .5s ease-out both; }
/* табло арены */
.scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.scoreboard .side-name { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scoreboard .score { font-size: 28px; font-weight: 700; color: #fff; }
.turn-ring { position: relative; width: 64px; height: 64px; margin: 0 auto; }
.turn-ring svg { width: 64px; height: 64px; transform: rotate(-90deg); }
.turn-ring circle { fill: none; stroke-width: 6; }
.turn-ring .bg { stroke: rgba(255, 255, 255, .08); }
.turn-ring .fg { stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 176; stroke-dashoffset: var(--off, 0); transition: stroke-dashoffset .5s linear, stroke .3s; }
.turn-ring.mine .fg { stroke: var(--green); }
.turn-ring.low .fg { stroke: var(--red); }
.turn-ring b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 16px; color: #fff; }
.turn-label { display: table; margin: 6px auto; padding: 4px 14px; border-radius: 99px; text-align: center; font-weight: 700; font-size: 14px; background: rgba(255,255,255,.06); border: 1px solid var(--line); color: var(--muted); }
.turn-label.turn-mine { color: #1a1300; background: linear-gradient(180deg, #ffe08a, var(--gold)); border-color: transparent; animation: breathe 2.4s ease-in-out infinite; }
.arena-field { position: relative; }
.strike-line { position: absolute; z-index: 8; height: 4px; transform-origin: 0 50%; border-radius: 2px; pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 224, 138, 0), var(--gold-2) 60%, #fff); box-shadow: 0 0 12px var(--gold); animation: strike .45s ease-out forwards; }
.particle { position: absolute; z-index: 9; width: 8px; height: 8px; border-radius: 50%; pointer-events: none; background: var(--pc, var(--gold-2)); box-shadow: 0 0 8px var(--pc, var(--gold));
  animation: particle .8s ease-out forwards; }
.screen-shake { animation: screenShake .35s; }
/* экран итогов */
.result-screen { position: relative; overflow: hidden; text-align: center; padding: 26px 16px 18px; }
.result-screen .rays { left: 50%; top: 70px; margin: -180px 0 0 -180px; }
.result-screen h2 { position: relative; font-family: var(--font-display); font-size: 34px; margin: 6px 0 10px; color: var(--gold); text-shadow: 0 0 18px rgba(245, 200, 76, .5); animation: rewardIn .7s cubic-bezier(.2, 1.5, .4, 1) both; }
.result-screen.lose h2 { color: #d08a7a; text-shadow: 0 2px 0 #000; }
.result-screen .final-score { position: relative; font-size: 22px; font-weight: 700; color: #fff; }
.result-screen p, .result-screen .btn, .result-screen .rating-change { position: relative; }

/* ---------- сундуки ---------- */
.chests { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.chest { padding: 10px 4px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.chest img { width: 80px; transition: transform .2s; }
.chest.ready { border-color: rgba(245, 200, 76, .55); }
.chest.ready img { animation: chestIdle 2.2s infinite ease-in-out; filter: drop-shadow(0 0 10px rgba(245, 200, 76, .6)); }
.chest.opening img { animation: chestShake .8s ease-in-out; }
.reward-pop { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(8, 3, 2, .82); backdrop-filter: blur(3px); animation: fadeIn .3s both; }
.reward-pop .inner { position: relative; max-width: 340px; padding: 22px; text-align: center; border-radius: 18px; background: radial-gradient(circle at 50% 25%, #4a3f9a, #1b1840); border: 2px solid var(--gold); box-shadow: 0 0 40px rgba(245, 200, 76, .25); animation: rewardIn .6s cubic-bezier(.2, 1.5, .4, 1) both; }
.reward-pop img { width: 90px; animation: flipIn .8s .2s both; }
.rays { position: absolute; width: 360px; height: 360px; background: conic-gradient(from 0deg, transparent 0 10deg, rgba(245, 200, 76, .16) 10deg 20deg, transparent 20deg 30deg, rgba(245, 200, 76, .16) 30deg 40deg, transparent 40deg 50deg, rgba(245, 200, 76, .16) 50deg 60deg, transparent 60deg);
  border-radius: 50%; animation: spin 10s linear infinite; mask: radial-gradient(circle, #000 25%, transparent 70%); -webkit-mask: radial-gradient(circle, #000 25%, transparent 70%); pointer-events: none; }

/* ---------- чат, сообщения ---------- */
.msg { padding: 10px 12px; border-bottom: 1px solid var(--line); animation: pageIn .3s both; }
.msg:last-child { border-bottom: 0; }
.msg .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.msg .txt { margin-top: 3px; color: #f7ebdc; }
.msg.to-me { background: rgba(245, 200, 76, .07); box-shadow: inset 3px 0 0 var(--gold); }
.msg.mine { background: rgba(95, 208, 104, .06); }
.smile { width: 20px; height: 20px; vertical-align: -4px; }
.bb-img { max-width: 100%; border-radius: 8px; }
.smiles { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 0; }
.smiles button { min-width: 36px; min-height: 36px; background: none; border: 0; padding: 2px; cursor: pointer; font-size: 20px; line-height: 1; border-radius: 8px; transition: transform .15s, background .15s; }
.smiles button:hover { transform: scale(1.2); background: var(--surface-2); }
.ulink { color: var(--gold); }
.role-admin { color: #ff7f7f; } .role-moder { color: #7fd6ff; }
.dot-on { display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); vertical-align: 1px; }
.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 12px 10px; }
.pager a, .pager b, .pager span { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.pager b { color: #2b1a00; background: var(--gold); border-color: var(--gold); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 7px; font-size: 11px; background: var(--surface-2); border: 1px solid var(--line-2); vertical-align: 1px; }
.tag.ok { border-color: var(--green); color: var(--green); } .tag.warn { border-color: var(--ember); color: var(--ember); } .tag.bad { border-color: var(--red); color: var(--red); }
.npc { display: flex; gap: 12px; align-items: flex-start; }
.npc img { width: 76px; flex: none; animation: popIn .5s both; }
.npc .speech { position: relative; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); animation: pageIn .5s .15s both; }
.steps { display: flex; gap: 4px; margin: 10px; }
.steps i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.steps i.on { background: var(--gold); box-shadow: 0 0 6px rgba(245, 200, 76, .6); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: left; }
table.tbl th { color: var(--muted); font-weight: 400; font-size: 13px; }
table.tbl tr.me td { background: rgba(245, 200, 76, .08); }
.toggle { display: flex; justify-content: space-between; align-items: center; min-height: var(--tap); padding: 6px 0; border-bottom: 1px solid var(--line); }
.err-code { font-family: var(--font-display); font-size: 72px; text-align: center; color: var(--gold); animation: popIn .6s both; }

/* ---------- ежедневные награды ---------- */
.streak { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin: 10px 0 12px; }
.streak-day { position: relative; padding: 8px 2px; text-align: center; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font-size: 10px; line-height: 1.2; animation: popIn .4s both; animation-delay: calc(var(--i) * 50ms); }
.streak-day b { display: block; font-size: 16px; color: #fff; }
.streak-day small { color: var(--muted); font-size: 9px; }
.streak-day.done { opacity: .55; }
.streak-day.done i { position: absolute; top: 2px; right: 4px; color: var(--green); font-style: normal; }
.streak-day.now { border-color: var(--gold); box-shadow: 0 0 12px rgba(245, 200, 76, .5); animation: popIn .4s both, glowPulse 2s infinite; }
.quest { display: flex; gap: 10px; align-items: center; min-height: 52px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.quest:last-of-type { border-bottom: 0; }
.quest .grow { flex: 1; min-width: 0; }
.quest.claimed { opacity: .6; }
.quest.ready b { color: var(--gold); }

/* ---------- способности, рейтинг, лиги, кланы ---------- */
.gcard .effects { display: flex; gap: 4px; justify-content: center; font-size: 12px; margin-top: 4px; }
.gcard .effects span { padding: 0 5px; border-radius: 6px; background: rgba(0, 0, 0, .6); animation: popIn .4s both; }
.rating-box .league { font-size: 20px; margin-bottom: 4px; }
.league { font-weight: 700; }
.league-0 { color: #d89a5b; } .league-1100 { color: #d3dae2; } .league-1300 { color: #f5c84c; }
.league-1500 { color: #7fe3e2; } .league-1700 { color: #8ab4ff; } .league-1900 { color: #ff8ae0; text-shadow: 0 0 8px rgba(255, 122, 217, .6); }
.row-links { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 14px; }
.row-links a { padding: 6px 0; }
.rating-change { font-size: 24px; font-weight: 700; animation: popIn .6s .3s both; }
.rating-change.up { color: var(--green); } .rating-change.down { color: var(--red); }
.war-box { border-color: rgba(255, 100, 100, .5); }
.war-score { display: flex; justify-content: center; align-items: center; gap: 14px; font-size: 34px; font-weight: 700; margin: 6px 0; }
.war-score.sm { font-size: 22px; margin: 2px 0 0; }
.war-score b { animation: popIn .5s both; }
.war-score b:first-child { color: var(--green); } .war-score b:last-child { color: var(--red); }
.msg-new { animation: msgIn .45s ease-out both; }
.live-dot { margin-left: 8px; } .live-dot::first-letter { color: var(--green); }

/* ---------- боковая панель (широкий экран) ---------- */
.side-card { display: block; margin-bottom: 12px; padding: 12px; border-radius: var(--r); color: var(--text); background: linear-gradient(180deg, rgba(70, 32, 24, .55), rgba(36, 17, 14, .9)); border: 1px solid var(--line); }
a.side-card:hover { border-color: var(--line-2); color: var(--text); }
.side-h { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.side-h b, .side-h a { margin-left: auto; }
.side-h .i { color: var(--gold); }
.profile-mini { display: flex; align-items: center; gap: 10px; }
.profile-mini img { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--gold); background: var(--surface-2); }
.chat-mini { margin-top: 6px; max-height: 340px; overflow: auto; }
.chat-mini .msg { padding: 6px 4px; font-size: 13px; }
.chat-mini .msg small { display: none; }

/* ---------- широкий экран ---------- */
@media (min-width: 1000px) {
  .in-game .shell { max-width: 1120px; padding-bottom: 0; }
  .body-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; padding: 0 16px; align-items: start; }
  .side { display: block; position: sticky; top: 132px; padding-top: 14px; }
  .appbar { padding: 10px 20px; }
  .tabbar { position: sticky; top: 61px; z-index: 39; height: auto; padding: 6px 16px; justify-content: flex-start; gap: 4px; background: rgba(22, 11, 9, .9); border-top: 0; border-bottom: 1px solid var(--line); }
  .tabbar a { flex: none; max-width: none; flex-direction: row; gap: 8px; padding: 10px 16px; font-size: 15px; border-radius: 12px; }
  .tabbar a:hover { background: var(--surface); }
  .tabbar a.on { background: var(--surface-2); }
  .tabbar a.on::before { display: none; }
  .resbar { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 45; margin: 0; padding: 6px 16px; }
  .in-game .shell { position: relative; }
  .status-grid { grid-template-columns: repeat(3, 1fr); }
  .tiles { grid-template-columns: repeat(6, 1fr); }
  .gcard { width: 136px; }
}
@media (min-width: 1000px) and (max-width: 1180px) { .resbar { left: auto; right: 220px; transform: none; } }
@media (max-width: 360px) {
  .brand span { display: none; }
  .gcard { width: 112px; }
}

/* ---------- анимации ---------- */
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
@keyframes deal { 0% { opacity: 0; transform: translate(0, -160px) rotate(-25deg) scale(.6); } 70% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes flipIn { 0% { transform: perspective(600px) rotateY(90deg); opacity: 0; } 60% { transform: perspective(600px) rotateY(-15deg); opacity: 1; } 100% { transform: perspective(600px) rotateY(0); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-20px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-20px); } }
@keyframes pulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.35) drop-shadow(0 0 6px rgba(245, 200, 76, .55)); } }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 10px rgba(245, 200, 76, .35); } 50% { box-shadow: 0 0 24px rgba(245, 200, 76, .75); } }
@keyframes glowPulse { 0%, 100% { box-shadow: 0 0 4px rgba(245, 200, 76, .5); } 50% { box-shadow: 0 0 18px rgba(245, 200, 76, .55), 0 0 4px rgba(245, 200, 76, .5) inset; } }
@keyframes mythGlow { 0%, 100% { box-shadow: 0 6px 16px rgba(0, 0, 0, .5), 0 0 6px rgba(255, 120, 60, .35); } 50% { box-shadow: 0 6px 16px rgba(0, 0, 0, .5), 0 0 18px rgba(255, 120, 60, .6); } }
@keyframes shake { 0%, 100% { transform: none; } 12% { transform: translate(-5px, 1px) rotate(-1.5deg); } 28% { transform: translate(4px, -1px) rotate(1.2deg); } 46% { transform: translate(-2.5px, 0) rotate(-.6deg); } 66% { transform: translate(1.5px, 0); } 84% { transform: translate(-.5px, 0); } }
@keyframes screenShake { 0%, 100% { transform: none; } 25% { transform: translate(-4px, 2px); } 50% { transform: translate(4px, -2px); } 75% { transform: translate(-2px, 1px); } }
@keyframes lungeUp { 50% { transform: translateY(-26px) scale(1.08); } }
@keyframes lungeDown { 50% { transform: translateY(26px) scale(1.08); } }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.4); } 14% { opacity: 1; transform: translate(-50%, -12px) scale(1.18); } 26% { transform: translate(-50%, -16px) scale(.96); } 36% { transform: translate(-50%, -20px) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -54px) scale(.92); } }
@keyframes strike { 0% { opacity: 0; clip-path: inset(0 100% 0 0); } 40% { opacity: 1; clip-path: inset(0 0 0 0); } 100% { opacity: 0; clip-path: inset(0 0 0 100%); } }
@keyframes particle { from { opacity: 1; transform: translate(0, 0) scale(1); } to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.2); } }
@keyframes lowHp { 50% { filter: brightness(1.6); } }
@keyframes vsBeat { 50% { transform: scale(1.15) rotate(4deg); } }
@keyframes targetGlow { 50% { box-shadow: 0 0 0 2px var(--red), 0 0 26px rgba(255, 100, 100, .8); } }
@keyframes bannerIn { from { opacity: 0; transform: scale(1.3); } to { opacity: 1; transform: none; } }
@keyframes chestIdle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes chestShake { 0%, 100% { transform: none; } 20% { transform: rotate(-12deg) scale(1.05); } 40% { transform: rotate(10deg) scale(1.1); } 60% { transform: rotate(-8deg) scale(1.15); } 80% { transform: rotate(6deg) scale(1.2); } }
@keyframes rewardIn { from { opacity: 0; transform: scale(.3) rotate(-10deg); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes msgIn { from { opacity: 0; transform: translateY(-8px); background: rgba(245, 200, 76, .18); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .gc-frame { transform: none !important; }
}
.chev { margin-left: auto; color: var(--muted); font-size: 20px; }
.guest-hero { text-align: center; padding: 44px 16px 26px; }
.guest-title { font-family: var(--font-display); font-size: 34px; font-weight: 400; color: var(--gold); text-shadow: 0 0 20px rgba(245, 200, 76, .45), 0 2px 0 #000; margin: 0 0 6px; animation: rewardIn .8s cubic-bezier(.2, 1.5, .4, 1) both; }
.gcard.moved .gc-frame { filter: brightness(.6) saturate(.7); }
/* пустые списки */
.box > .muted.center:only-child, .box > .muted.center.empty, .muted.center.empty { padding: 22px 10px; }
.box > .muted.center:only-child::before, .muted.center.empty::before { content: "✦"; display: block; margin-bottom: 6px; font-size: 26px; color: var(--line-2); }
@media (max-width: 480px) {
  .brand { font-size: 13px; letter-spacing: 0; }
  .appbar-icons a { min-width: 40px; padding: 0 4px; }
  .appbar-icons .cnt { display: none; }
}

/* ---------- тактический бой на поле 5×6 ---------- */
.field-hero p { color: var(--muted); margin: 8px 0 14px; }
.field-wrap { position: relative; }
.field-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 2px; }
.ft-side { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ft-side b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft-side.right { align-items: flex-end; text-align: right; }
.ft-mid { display: flex; flex-direction: column; align-items: center; }
.ft-timer { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; padding: 2px 12px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line-2); }
.ft-timer.low { color: var(--red); border-color: var(--red); animation: pulse 1s ease-in-out infinite; }
.cr { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; margin-left: 8px; }
.cr.gold { color: var(--gold); }
.cr.silver { color: #cfd6e6; }

.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 6px; border-radius: var(--r); position: relative; user-select: none; -webkit-user-select: none;
  background: url(../img/board.svg) center / 100% 100% no-repeat, #1a0c0a; border: 1px solid rgba(245, 200, 76, .35); box-shadow: inset 0 0 30px rgba(0, 0, 0, .55), 0 10px 30px rgba(0, 0, 0, .45), 0 0 0 4px rgba(30, 14, 11, .9), 0 0 0 5px rgba(245, 200, 76, .25); }
.cell { position: relative; aspect-ratio: 3 / 4; border-radius: 8px; background: rgba(255, 255, 255, .03); border: 1px dashed rgba(232, 160, 110, .14); }
.cell.own { background: rgba(255, 190, 120, .04); }
.cell.their { background: rgba(255, 100, 100, .035); }
.cell.front.own { box-shadow: inset 0 3px 0 rgba(245, 200, 76, .25); }
.cell.fog { background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .025) 0 6px, transparent 6px 12px); }
.cell.reach { background: rgba(95, 208, 104, .18); border: 1px solid rgba(95, 208, 104, .7); cursor: pointer; animation: reachPulse 1.4s ease-in-out infinite; }
@keyframes reachPulse { 50% { background: rgba(95, 208, 104, .30); } }

.unit { position: absolute; inset: 0; border-radius: 8px; overflow: hidden; cursor: pointer; border: 2px solid var(--blue); background: #0b0a1d; box-shadow: var(--shadow-sm);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), filter .3s, box-shadow .2s; }
.unit.enemy { border-color: var(--red); }
.unit.elite { box-shadow: 0 0 0 1px var(--gold), 0 0 10px rgba(245, 200, 76, .45); }
.unit img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; display: block; pointer-events: none; }
.unit.tapped { transform: rotate(90deg) scale(.7); filter: grayscale(.55) brightness(.75); transition: transform .45s cubic-bezier(.34, 1.4, .64, 1), filter .4s; }
.unit.ready { box-shadow: 0 0 0 2px rgba(245, 200, 76, .8), 0 0 14px rgba(245, 200, 76, .55); }
.unit.selected { box-shadow: 0 0 0 3px var(--gold-2), 0 0 20px var(--gold); z-index: 3; transform: scale(1.06); }
.unit.target { border-color: #ff3b3b; box-shadow: 0 0 0 3px rgba(255, 59, 59, .7), 0 0 16px rgba(255, 59, 59, .8); animation: targetPulse 1s ease-in-out infinite; }
.unit.target.tapped { transform: rotate(90deg) scale(.7); }
@keyframes targetPulse { 50% { box-shadow: 0 0 0 4px rgba(255, 59, 59, .4), 0 0 22px rgba(255, 59, 59, 1); } }
.unit.lunge { animation: fLunge .45s ease-out; }
@keyframes fLunge { 40% { transform: translate(var(--lx), var(--ly)) scale(1.08); } }
.unit.dying { animation: fDie .9s ease-in forwards; pointer-events: none; z-index: 4; }
@keyframes fDie { 30% { filter: brightness(2) saturate(0); } 100% { opacity: 0; transform: scale(.4) rotate(-25deg); filter: brightness(.3); } }
.u-lv { position: absolute; left: 2px; top: 2px; min-width: 16px; height: 16px; border-radius: 50%; font-size: 10px; line-height: 16px; text-align: center; font-weight: 700; background: rgba(0, 0, 0, .7); color: #fff; }
.u-ab { position: absolute; right: 2px; top: 2px; font-size: 12px; line-height: 1; filter: drop-shadow(0 0 2px #000); }
.u-fx { position: absolute; right: 2px; top: 18px; font-size: 10px; font-weight: 700; color: #b6ff9c; text-shadow: 0 0 3px #000; }
.u-hp { position: absolute; right: 2px; bottom: 6px; min-width: 20px; height: 20px; padding: 0 3px; border-radius: 10px; font-size: 12px; line-height: 20px; text-align: center; font-weight: 700; color: #fff; background: #c43a3a; box-shadow: 0 0 0 1px rgba(0, 0, 0, .6); }
.u-hp.low { background: #7a1010; animation: pulse 1s ease-in-out infinite; }
.u-str { position: absolute; left: 2px; bottom: 6px; padding: 0 4px; height: 18px; border-radius: 9px; font-size: 10.5px; line-height: 18px; font-weight: 700; color: #1a1300; background: linear-gradient(180deg, var(--gold-2), var(--gold)); }
.u-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0, 0, 0, .6); }
.u-bar::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); background: var(--green); transition: width .4s; }
.unit.enemy .u-bar::after { background: var(--red); }
.unit .dmg { top: 20%; font-size: 22px; }
.dmg.back { color: #ffb36b; }
.dmg.miss { color: #cfd6e6; font-size: 16px; }
.dmg.poison { color: #8ff06a; font-size: 18px; }
.dmg[style*="absolute"] { transform: translate(-50%, -50%); }

.dice-pop { position: absolute; z-index: 8; display: flex; gap: 6px; transform: translate(-50%, -50%); pointer-events: none; animation: diceIn 1.3s ease-out forwards; }
.die { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; box-shadow: 0 4px 12px rgba(0, 0, 0, .6); animation: dieRoll .5s ease-out; }
.die.atk { background: linear-gradient(180deg, #fff3c9, var(--gold)); color: #3a2400; }
.die.def { background: linear-gradient(180deg, #f3e6cc, #b9a27c); color: #3a1a10; }
@keyframes dieRoll { 0% { transform: rotate(-360deg) scale(.3); } 70% { transform: rotate(15deg) scale(1.15); } 100% { transform: none; } }
@keyframes diceIn { 0%, 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -80%); } }

.field-info { min-height: 58px; margin: 8px 0; }
.fi-card { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); }
.fi-card img { width: 44px; height: 58px; object-fit: cover; border-radius: 6px; flex: none; }
.fi-card .grow { min-width: 0; }
.fi-stats { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; font-weight: 700; font-size: 14px; }
.fi-stats .i { width: 14px; height: 14px; margin-right: 2px; }
.fi-hint { font-size: 13px; color: var(--muted); text-align: center; padding: 4px; }
.field-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 6px 0; }
.field-actions .btn[disabled] { opacity: .5; pointer-events: none; }
.field-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-size: 14px; }

.hand { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(78px, 22%), 1fr)); gap: 8px; margin-top: 8px; }
.hcard { position: relative; padding: 0; border: 2px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; text-align: left; min-height: var(--tap); transition: transform .15s, opacity .2s; }
.hcard img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: 50% 20%; display: block; }
.hcard.elite { border-color: var(--gold); }
.hcard.picked { transform: translateY(-4px); box-shadow: 0 0 0 3px var(--gold-2), 0 0 16px var(--gold); }
.hcard.used { opacity: .3; }
.hcard.poor { opacity: .55; filter: grayscale(.7); }
.h-cost { position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; background: #cfd6e6; color: #13183a; box-shadow: 0 0 0 2px rgba(0, 0, 0, .5); }
.hcard.elite .h-cost { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #3a2400; }
.h-nm { display: block; padding: 2px 4px 0; font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-st { display: block; padding: 0 4px 4px; font-size: 11px; }
.h-st .i { width: 11px; height: 11px; }
.hcard .u-ab { top: 4px; }
.rules h3 { display: flex; align-items: center; gap: 6px; margin: 16px 0 6px; color: var(--gold); font-size: 17px; }
.rules h3:first-child { margin-top: 0; }
.rules ul { padding-left: 18px; margin: 4px 0; }
.rules li { margin: 4px 0; }
@media (prefers-reduced-motion: reduce) { .cell.reach, .unit.target { animation: none; } }
.unit.tapped.selected { transform: rotate(90deg) scale(.74); }
.field-wrap, .board, .hand { min-width: 0; max-width: 100%; } .cell { min-width: 0; } .hcard { min-width: 0; }
.dmg.note { font-size: 12px; color: #fff; background: rgba(0, 0, 0, .65); padding: 1px 6px; border-radius: 8px; white-space: nowrap; top: 60%; }
.field-set { border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 10px; margin: 12px 0; }
.field-set legend { display: flex; align-items: center; gap: 6px; padding: 0 6px; color: var(--gold); font-weight: 700; }
.check-list label.check { align-items: flex-start; }
.check-list label.check small { display: block; }
.unit.target.shoot { border-style: dashed; border-color: #6cc4ff; box-shadow: 0 0 0 3px rgba(108, 196, 255, .6), 0 0 16px rgba(108, 196, 255, .8); animation: none; }
.unit.guarded::before { content: "🛡️"; position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 2; font-size: 20px; filter: drop-shadow(0 0 4px #000); }
.unit.guard-ready { box-shadow: 0 0 0 3px rgba(108, 196, 255, .8), 0 0 14px rgba(108, 196, 255, .7); }
.unit.guard-jump { animation: guardJump .7s ease-out; }
@keyframes guardJump { 30% { transform: scale(1.18); filter: brightness(1.6); } }
.arrow-fly { position: absolute; z-index: 8; width: 26px; height: 4px; margin: -2px 0 0 -13px; border-radius: 2px; background: linear-gradient(90deg, transparent, #cfe9ff 40%, #fff); box-shadow: 0 0 8px #6cc4ff;
  transform: rotate(var(--ang)); animation: arrowFly .42s linear forwards; pointer-events: none; }
@keyframes arrowFly { to { transform: translate(var(--dx), var(--dy)) rotate(var(--ang)); } }
.fi-ab { display: block; margin-top: 2px; }
.field-log { margin-top: 10px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.field-log:empty { display: none; }
.flog-h { padding: 6px 10px; font-weight: 700; color: var(--gold); border-bottom: 1px solid var(--line); font-size: 14px; }
.flog-r { padding: 5px 10px; font-size: 13px; border-bottom: 1px solid var(--line); color: var(--muted); }
.flog-h + .flog-r { color: var(--text); }
.flog-r.turn { background: rgba(245, 200, 76, .06); color: var(--gold-2); }
.flog-r:last-child { border-bottom: 0; }
.field-stats h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; color: var(--gold); }

/* ---------- качественные эффекты боя ---------- */
.dmg { font-family: var(--font-display); font-weight: 400; letter-spacing: .5px; color: #fff; -webkit-text-stroke: 1px rgba(80, 0, 0, .9);
  text-shadow: 0 2px 0 #7a0d0d, 0 0 12px rgba(255, 60, 60, .8), 0 4px 10px rgba(0, 0, 0, .8); animation: floatUp 1.25s cubic-bezier(.2, .7, .3, 1) forwards; }
.dmg.crit { color: var(--gold-2); -webkit-text-stroke: 1px #6b4300; text-shadow: 0 2px 0 #7a4b00, 0 0 18px rgba(255, 200, 60, .95), 0 4px 10px rgba(0, 0, 0, .8); }
.dmg.heal { color: #b9ffb0; -webkit-text-stroke: 1px #0d4a12; text-shadow: 0 2px 0 #0d4a12, 0 0 12px rgba(80, 255, 120, .8); }
.dmg.back { color: #ffd2a8; }
.dmg.note { font-family: var(--font); -webkit-text-stroke: 0; text-shadow: none; }
.particle { width: 3px; height: 14px; border-radius: 2px; background: linear-gradient(180deg, #fff, var(--pc, var(--gold-2))); box-shadow: 0 0 6px var(--pc, var(--gold)), 0 0 12px var(--pc, var(--gold));
  transform: rotate(var(--rot, 0deg)); animation: spark .8s cubic-bezier(.15, .7, .3, 1) forwards !important; }
@keyframes spark { 0% { opacity: 1; transform: translate(0, 0) rotate(var(--rot, 0deg)) scaleY(1.4); } 60% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 18px)) rotate(var(--rot, 0deg)) scaleY(.2); } }
.slash { position: absolute; inset: -10%; width: 120%; height: 120%; z-index: 5; pointer-events: none; overflow: visible; }
.slash path { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; filter: drop-shadow(0 0 4px #ffd27a) drop-shadow(0 0 10px #ff9a3c);
  stroke-dasharray: 120; stroke-dashoffset: 120; animation: slashDraw .5s cubic-bezier(.3, .8, .3, 1) forwards; }
.slash .s2 { animation-delay: .08s; }
.slash.crit path { stroke-width: 7; filter: drop-shadow(0 0 5px #fff1b0) drop-shadow(0 0 14px #ffc83c); }
@keyframes slashDraw { 0% { stroke-dashoffset: 120; opacity: 1; } 45% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: -120; opacity: 0; } }
.impact { position: absolute; inset: 0; z-index: 4; pointer-events: none; border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .95), rgba(255, 190, 90, .55) 30%, transparent 65%); mix-blend-mode: screen; animation: impact .45s ease-out forwards; }
.impact.crit { background: radial-gradient(circle at 50% 50%, #fff, rgba(255, 220, 110, .8) 35%, transparent 75%); animation-duration: .6s; }
@keyframes impact { 0% { opacity: 0; transform: scale(.4); } 20% { opacity: 1; transform: scale(1.05); } 100% { opacity: 0; transform: scale(1.3); } }
.unit.dying { animation: dissolve 1s cubic-bezier(.4, 0, .6, 1) forwards; }
@keyframes dissolve { 0% { filter: brightness(1); } 18% { filter: brightness(2.2) saturate(0); transform: scale(1.04); } 100% { opacity: 0; filter: brightness(.6) saturate(0) blur(6px); transform: translateY(-14px) scale(.85); } }
/* 3D кубики */
.dice-pop { animation: none; gap: 10px; perspective: 400px; }
.dice-pop.out { transition: opacity .3s, transform .3s; opacity: 0; transform: translate(-50%, -80%); }
.die3d { --s: 34px; --h: 17px; width: var(--s); height: var(--s); }
.cube { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }
.face { position: absolute; inset: 0; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 5px; gap: 1px; border-radius: 7px; backface-visibility: hidden;
  background: linear-gradient(145deg, #fffaf0, #e8dcc0); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15), inset -3px -3px 6px rgba(0, 0, 0, .15); }
.die3d.def .face { background: linear-gradient(145deg, #fbefe0, #b9c3e8); }
.face i { border-radius: 50%; }
.face i.on { background: radial-gradient(circle at 35% 35%, #6a1010, #1a0303); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .5); margin: 1px; }
.die3d.def .face i.on { background: radial-gradient(circle at 35% 35%, #22306e, #070b22); }
.die3d.atk .face:first-child i.on:only-child { background: radial-gradient(circle at 35% 35%, #ff3b3b, #7a0000); }
@media (prefers-reduced-motion: reduce) {
  .slash, .impact, .particle { display: none; }
  .cube { transition: none !important; }
}
.btn.is-busy { opacity: .75; cursor: progress; background-image: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.35) 50%, rgba(255,255,255,0) 100%), linear-gradient(180deg, var(--gold-2), var(--gold)); background-size: 200% 100%, 100% 100%; animation: busyShine 1.2s linear infinite; }
@keyframes busyShine { from { background-position: 200% 0, 0 0; } to { background-position: -200% 0, 0 0; } }

.emblem { display: inline-block; vertical-align: middle; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .5)); }
.rating-box .emblem { display: block; margin: 0 auto 4px; }
.hero-sub .emblem { vertical-align: -4px; }
.sc-emblem { opacity: .55; }
.sc-emblem .emblem { filter: none; }
.field-crest { width: 120px; margin: 0 auto 4px; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .6)) drop-shadow(0 0 18px rgba(245, 200, 76, .25)); }
.field-hero { text-align: center; }
.cell { background: rgba(255, 255, 255, .02); border-color: rgba(232, 160, 110, .10); }
.cell.own { background: rgba(108, 196, 255, .035); }
.cell.their { background: rgba(255, 100, 100, .03); }
.hero .hero-links form { flex: 1; display: flex; } .hero .hero-links form .btn { flex: 1; width: 100%; }

/* ---------- колода для поля ---------- */
.deck-sum { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; position: sticky; top: 0; z-index: 5; }
.deck-list { display: grid; gap: 6px; margin: 8px 0; }
.deck-row { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); min-width: 0; }
.deck-row.elite { border-color: var(--gold); }
.deck-row.off { opacity: .5; }
.deck-row img { width: 44px; height: 58px; object-fit: cover; object-position: 50% 20%; border-radius: 6px; flex: none; }
.deck-row .grow { min-width: 0; }
.stepper { display: flex; align-items: center; gap: 2px; flex: none; }
.stepper input { width: 38px; text-align: center; padding: 6px 2px; }
.stepper .btn { min-width: 36px; padding: 6px; }

/* ---------- зона полёта, стихии, перетаскивание ---------- */
.air-sep { grid-column: 1 / -1; height: 2px; margin: 1px 0; background: linear-gradient(90deg, transparent, rgba(140, 200, 255, .45), transparent); }
.cell.air { aspect-ratio: 3 / 3.4; border: 1px dashed rgba(140, 200, 255, .3); background: radial-gradient(120% 90% at 50% 100%, rgba(140, 200, 255, .12), rgba(60, 90, 160, .06) 60%, transparent); }
.cell.air:empty::after { content: '☁'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 18px; color: rgba(190, 220, 255, .18); pointer-events: none; }
.cell.air.reach { background: rgba(95, 208, 104, .18); border: 1px solid rgba(95, 208, 104, .7); }
.cell.air .unit { animation: hover 3.2s ease-in-out infinite; }
@keyframes hover { 0%, 100% { translate: 0 0; } 50% { translate: 0 -3px; } }
.h-el { position: absolute; right: 3px; top: 3px; font-size: 13px; line-height: 1; filter: drop-shadow(0 0 2px #000); }
.hcard, .dealing .unit.placed { touch-action: none; }
.dealing .unit.placed { cursor: grab; }
.drag-src { opacity: .35; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; aspect-ratio: 3 / 4; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .55)); }
.cell.drop-over { box-shadow: 0 0 0 2px var(--gold-2), 0 0 18px rgba(245, 200, 76, .6) inset; }
@media (prefers-reduced-motion: reduce) { .cell.air .unit { animation: none; } }

/* ---------- книга правил ---------- */
.rules-toc ol { margin: 6px 0 0; padding-left: 22px; columns: 2; column-gap: 16px; }
.rules-toc li { break-inside: avoid; padding: 2px 0; }
.rules h3[id] { scroll-margin-top: 70px; }
@media (max-width: 380px) { .rules-toc ol { columns: 1; } }
.stepper input { height: 36px; padding: 0 2px; line-height: 36px; }

/* ==========================================================================
   Дизайн 3.0 «Кузня и лава» — под логотип «Легенды Вальмерии»:
   кованое железо, лавовые прожилки, пергамент и тёмно-алые чернила
   ========================================================================== */
body {
  background: radial-gradient(1100px 620px at 50% -180px, rgba(226, 66, 27, .32), transparent 70%),
              radial-gradient(900px 520px at 50% 110%, rgba(255, 106, 31, .16), transparent 70%), var(--bg);
  background-attachment: fixed; }
body::before { opacity: .62; }
body::after { background: radial-gradient(ellipse at 50% 10%, transparent 35%, rgba(10, 4, 3, .72) 100%); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; color: var(--parch); letter-spacing: .2px; }
h2 { font-size: 21px; } h3 { font-size: 18px; }
::selection { background: rgba(226, 66, 27, .45); color: #fff; }
:focus-visible { outline-color: var(--lava-2); }
a { color: var(--gold); }

/* кованая рамка: железо снаружи, тлеющие угли внутри */
.forged, .box, .hero, .list, .side-card {
  border: 2px solid transparent;
  background-clip: padding-box, border-box;
  background-origin: padding-box, border-box; }
.box { border-radius: var(--r); background-color: transparent;
  background-image: radial-gradient(130% 70% at 50% -10%, rgba(226, 66, 27, .16), transparent 60%),
                    linear-gradient(180deg, rgba(58, 27, 21, .96), rgba(26, 12, 10, .98)),
                    linear-gradient(160deg, #c9bfb6, #5d544e 28%, #b4471c 50%, #5d544e 72%, #b8ada4);
  background-clip: padding-box, padding-box, border-box; background-origin: padding-box, padding-box, border-box;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 200, 150, .08), inset 0 0 22px rgba(0, 0, 0, .45), 0 6px 18px rgba(0, 0, 0, .45); }
.box.flat { background-image: none; background: rgba(28, 13, 11, .85); border: 1px solid var(--line); box-shadow: none; }
.notice { background-image: linear-gradient(180deg, rgba(140, 24, 16, .45), rgba(36, 12, 10, .96)), linear-gradient(160deg, #ff8a5a, #6e1210 50%, #ff8a5a) !important;
  background-clip: padding-box, border-box !important; }
.gift-box { background-image: radial-gradient(120% 80% at 50% 0%, rgba(244, 180, 67, .22), transparent 60%), linear-gradient(180deg, rgba(64, 30, 18, .96), rgba(28, 13, 10, .98)), linear-gradient(160deg, #ffe3a0, #a3601c 40%, #ffd98a 60%, #a3601c) !important; }

/* заголовок раздела: светлые буквы над лавовой чертой */
.title { justify-content: center; margin: 18px 10px 8px; gap: 10px; color: var(--parch); font-family: var(--font-display); font-weight: 400; font-size: 19px; text-align: center; line-height: 1.2;
  text-shadow: 0 0 12px rgba(226, 66, 27, .55), 0 2px 0 #000; letter-spacing: .4px; }
.title::before { height: 2px; background: linear-gradient(90deg, transparent, var(--iron-2) 30%, var(--lava)); box-shadow: 0 0 6px rgba(226, 66, 27, .5); }
.title::after { height: 2px; background: linear-gradient(90deg, var(--lava), var(--iron-2) 70%, transparent); box-shadow: 0 0 6px rgba(226, 66, 27, .5); }

/* шапка */
.appbar { background: linear-gradient(180deg, rgba(36, 16, 13, .96), rgba(18, 9, 8, .9)); border-bottom: 0;
  box-shadow: 0 1px 0 #5d544e, 0 2px 0 rgba(226, 66, 27, .55), 0 6px 18px rgba(0, 0, 0, .5); }
.brand { gap: 6px; }
.brand img.brand-logo { width: auto; height: 54px; margin: -6px 0; border-radius: 0; box-shadow: none; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .6)); }
.brand .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.appbar-icons a:hover { background: rgba(226, 66, 27, .16); }
.badge { background: var(--lava); box-shadow: 0 0 0 2px var(--bg), 0 0 8px rgba(255, 106, 31, .6); }

/* ресурсы — железная планка */
.resbar { border-radius: 14px; border: 1px solid #5d544e;
  background: linear-gradient(180deg, #3a2420, #1e100d); box-shadow: inset 0 1px 0 rgba(255, 210, 170, .12), inset 0 -2px 0 rgba(0, 0, 0, .4), 0 0 0 1px #000, 0 4px 12px rgba(0, 0, 0, .45); }

/* нижние вкладки */
.tabbar { background: linear-gradient(180deg, rgba(30, 14, 11, .97), rgba(16, 8, 7, .98)); border-top: 0; box-shadow: 0 -1px 0 #5d544e, 0 -2px 0 rgba(226, 66, 27, .45), 0 -8px 20px rgba(0, 0, 0, .5); }
.tabbar a.on { color: var(--gold-2); }
.tabbar a.on .i { filter: drop-shadow(0 0 7px rgba(255, 120, 40, .8)); }
.tabbar a.on::before { background: linear-gradient(90deg, var(--lava), var(--gold-2), var(--lava)); box-shadow: 0 0 8px rgba(255, 106, 31, .8); }

/* кнопки: раскалённое золото */
.btn, button.btn, input.btn { color: #3a0e06; text-shadow: 0 1px 0 rgba(255, 236, 190, .5); border-radius: 10px;
  background: linear-gradient(180deg, #ffe6a6 0%, #f7b84a 45%, #e07a22 80%, #b9501a 100%);
  box-shadow: 0 0 0 1px #5a1e0c, 0 3px 0 #6e2a10, 0 8px 18px rgba(226, 66, 27, .28), inset 0 1px 0 rgba(255, 250, 220, .7), inset 0 -2px 4px rgba(120, 30, 6, .35); }
.btn:hover { color: #3a0e06; filter: brightness(1.08) saturate(1.05); }
.btn:active { box-shadow: 0 0 0 1px #5a1e0c, 0 0 0 #6e2a10, 0 2px 8px rgba(226, 66, 27, .25), inset 0 1px 0 rgba(255, 250, 220, .6); }
.btn-ghost, .btn-sm.btn-ghost { color: var(--text); text-shadow: none; background: linear-gradient(180deg, #4a2c25, #2a1612);
  box-shadow: 0 0 0 1px #6b5f58, inset 0 1px 0 rgba(255, 210, 170, .14), 0 2px 6px rgba(0, 0, 0, .4); }
.btn-ghost:hover { color: #fff; background: linear-gradient(180deg, #5a342b, #331a15); }
.btn-red { color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .4); background: linear-gradient(180deg, #ff7a52, #c3301a 60%, #8a1a0e); box-shadow: 0 0 0 1px #4a0c06, 0 3px 0 #5a120a, 0 8px 16px rgba(226, 66, 27, .3), inset 0 1px 0 rgba(255, 200, 170, .5); }
.btn-hero { font-family: var(--font-display); font-weight: 400; font-size: 22px; color: var(--ink); text-shadow: 0 1px 0 rgba(255, 245, 220, .6); border-radius: 12px;
  background: linear-gradient(180deg, #f8e6bf, #e6c48b 55%, #c99a5b);
  box-shadow: 0 0 0 2px #6b5f58, 0 0 0 4px #2a1612, 0 0 0 5px #8a3a1c, 0 0 22px rgba(255, 106, 31, .45), inset 0 0 18px rgba(140, 70, 20, .35); }
.btn-hero:hover { color: var(--ink); }
.btn-hero .i { color: var(--ink); }

/* главный экран */
.hero { border-radius: 16px;
  background-image: linear-gradient(180deg, rgba(18, 9, 8, .05), rgba(18, 9, 8, .9) 72%), url(../img/bg.svg), linear-gradient(160deg, #c9bfb6, #5d544e 28%, #b4471c 50%, #5d544e 72%, #b8ada4);
  background-size: auto, 190% auto, auto; background-position: 0 0, 50% 46%, 0 0; background-repeat: no-repeat;
  background-clip: padding-box, padding-box, border-box; background-color: #1c0b09; box-shadow: 0 0 0 1px #000, 0 10px 26px rgba(0, 0, 0, .55), inset 0 0 30px rgba(0, 0, 0, .5); }
.hero-top img { border-color: var(--gold); box-shadow: 0 0 0 2px #2a1612, 0 0 14px rgba(255, 106, 31, .5); }
.hero-name { font-family: var(--font-display); font-weight: 400; color: var(--parch); font-size: 21px; }
.guest-hero { padding: 18px 10px 18px; }
.guest-logo { display: block; width: min(100%, 460px); height: auto; margin: 0 auto 6px; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .65)) drop-shadow(0 0 24px rgba(226, 66, 27, .35)); animation: logoIn .8s cubic-bezier(.2, 1.2, .4, 1) both; }
.guest-hero .hero-sub { color: var(--parch-2); }
@keyframes logoIn { from { opacity: 0; transform: scale(.92) translateY(8px); } to { opacity: 1; transform: none; } }

/* списки, плитки, карточки статуса */
.list { background-image: linear-gradient(180deg, #2c1612, #1d0e0b), linear-gradient(160deg, #a89e96, #4b4440 40%, #8a3a1c 60%, #4b4440); background-clip: padding-box, border-box; }
.list > a:hover { background: rgba(226, 66, 27, .12); }
.ico-box { background: radial-gradient(circle at 50% 35%, #5a2a1e, #24110d); color: var(--gold-2); box-shadow: 0 0 0 1px #6b5f58, inset 0 0 8px rgba(255, 106, 31, .25); }
.status-card, .tile { background: linear-gradient(170deg, #3a1d18, #1f0f0c); border: 1px solid #5d4a42; box-shadow: inset 0 1px 0 rgba(255, 210, 170, .08), 0 3px 10px rgba(0, 0, 0, .4); }
.status-card:hover, .tile:hover { border-color: var(--lava); background: linear-gradient(170deg, #4a2219, #24110d); }
.status-card.hot { border-color: var(--lava-2); box-shadow: 0 0 0 1px rgba(255, 138, 42, .35), 0 0 18px rgba(255, 106, 31, .25); }
.status-card .sc-v, .tile { color: var(--text); }
.tile .i, .status-card .sc-h .i { color: var(--gold); filter: drop-shadow(0 0 4px rgba(255, 106, 31, .45)); }
.more-section { color: var(--parch-2); font-family: var(--font-display); text-transform: none; letter-spacing: .3px; font-size: 15px; }
.action-banner { background: linear-gradient(90deg, rgba(226, 66, 27, .55), rgba(110, 18, 16, .55)), url(../../images/bg-head.jpg) center / cover; border-color: var(--gold-dark); }

/* поля ввода */
input[type=text], input[type=password], input[type=email], input[type=number], input[type=file], select, textarea { background: rgba(14, 6, 5, .78); border-color: #5d4a42; }
input:focus, select:focus, textarea:focus { border-color: var(--lava-2); box-shadow: 0 0 0 3px rgba(255, 106, 31, .22); }

/* карты: рамка из тёмной бронзы */
.gc-frame { box-shadow: 0 6px 16px rgba(0, 0, 0, .6), inset 0 0 14px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 190, 140, .06); }
.gcard .nm { font-family: var(--font-display); font-weight: 400; letter-spacing: .2px; }
.gcard .lv { box-shadow: 0 0 0 2px #120908, 0 0 0 3px #6b5f58, 0 2px 6px rgba(0, 0, 0, .6); }
.gcard.selected .gc-frame { box-shadow: 0 0 0 3px var(--lava-2), 0 0 20px rgba(255, 106, 31, .6); }

/* полосы: здоровье — живое, опыт — раскалённый */
.bar { background: rgba(8, 3, 2, .85); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .8), 0 0 0 1px #4b4440; }

/* подвал */
.foot { color: var(--muted); }
.foot-links a:hover { color: var(--gold-2); }

/* поле боя */
.board, #field .board { border-color: rgba(255, 138, 42, .45) !important; box-shadow: 0 0 0 2px #4b4440, 0 0 0 3px #000, 0 0 26px rgba(226, 66, 27, .3), inset 0 0 30px rgba(0, 0, 0, .6) !important; }
.cell { border-color: rgba(255, 170, 120, .12); }

/* книга правил */
.rules h3 { color: var(--gold-2); border-bottom: 1px solid rgba(226, 66, 27, .35); padding-bottom: 4px; }
.tbl th { color: var(--parch); }
.guest-title { animation: none; text-shadow: none; margin: 0; line-height: 0; }

/* аватары игроков: свои огненные рамки, без обводки */
img.ava { border-radius: 50%; object-fit: contain; flex: none; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .55)); }
.hero-top img.ava, .hero-top .ava-hero { width: 76px; height: 76px; border: 0; background: none; box-shadow: none; border-radius: 0; margin: -6px 0; }
.ava-big { width: 88px; height: 88px; }
.ava-link { display: inline-flex; flex: none; position: relative; transition: transform .15s; }
.ava-link:hover { transform: scale(1.05); }
.ava-link::after { content: "✎"; position: absolute; right: 2px; bottom: 4px; width: 20px; height: 20px; line-height: 20px; text-align: center; font-size: 12px; border-radius: 50%; color: var(--ink); background: var(--parch); box-shadow: 0 0 0 1px #6b5f58; }
.ava-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0 14px; }

.ava-pick { position: relative; display: block; cursor: pointer; border-radius: 50%; padding: 4px; transition: transform .15s; }
.ava-pick input { position: absolute; opacity: 0; pointer-events: none; }
.ava-pick img { display: block; width: 100%; height: auto; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .6)); }
.ava-pick:hover { transform: translateY(-2px); }
.ava-pick:has(input:checked) { background: radial-gradient(circle, rgba(255, 138, 42, .45), transparent 70%); }
.ava-pick:has(input:checked)::after { content: "✓"; position: absolute; right: 6%; top: 6%; width: 24px; height: 24px; line-height: 24px; text-align: center; border-radius: 50%; font-weight: 700; color: #3a0e06; background: linear-gradient(180deg, #ffe6a6, #e07a22); box-shadow: 0 0 0 2px #2a1612, 0 0 10px rgba(255, 106, 31, .8); }
.ava-pick input:focus-visible + img { outline: 2px solid var(--lava-2); outline-offset: 2px; border-radius: 50%; }

/* хаб режимов и страницы режимов */
.mode-grid { display: grid; gap: 10px; margin: 10px; }
.mode-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); color: var(--text); background: linear-gradient(170deg, #3a1d18, #1f0f0c); border: 1px solid #5d4a42; box-shadow: inset 0 1px 0 rgba(255, 210, 170, .08), 0 3px 10px rgba(0, 0, 0, .4); transition: transform .15s, border-color .15s; animation: popIn .4s both; animation-delay: calc(var(--i, 0) * 50ms); }
.mode-card:hover { color: var(--text); transform: translateY(-2px); border-color: var(--lava); }
.mode-card.hot { border-color: rgba(255, 138, 42, .55); box-shadow: 0 0 0 1px rgba(255, 138, 42, .2), 0 0 16px rgba(255, 106, 31, .18); }
.mc-ico { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; flex: none; border-radius: 50%; color: var(--gold-2); background: radial-gradient(circle at 50% 35%, #6a2e1e, #24110d); box-shadow: 0 0 0 2px #6b5f58, 0 0 0 3px #000, inset 0 0 10px rgba(255, 106, 31, .35); }
.mc-ico .i { width: 26px; height: 26px; filter: drop-shadow(0 0 4px rgba(255, 106, 31, .6)); }
.mc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mc-body b { font-family: var(--font-display); font-weight: 400; font-size: 18px; color: var(--parch); }
.mc-body small { color: var(--muted); line-height: 1.35; }
.mc-status { font-size: 13px; color: var(--gold); }
.mode-card .chev { color: var(--muted); font-size: 22px; }
.mode-hero { text-align: center; }
.mode-hero p { color: var(--text); }
.mode-hero .kv { text-align: left; }
.mode-ico { display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 72px; margin: 4px auto 6px; border-radius: 50%; color: var(--gold-2); background: radial-gradient(circle at 50% 35%, #7a3220, #24110d); box-shadow: 0 0 0 3px #6b5f58, 0 0 0 4px #000, 0 0 22px rgba(255, 106, 31, .45), inset 0 0 14px rgba(255, 106, 31, .4); }
.mode-ico .i { width: 36px; height: 36px; filter: drop-shadow(0 0 6px rgba(255, 106, 31, .7)); }
.rounds { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 10px 0 4px; }
.round { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; font-weight: 700; color: var(--muted); background: #24110d; box-shadow: 0 0 0 2px #4b4440; }
.round.done { color: #0d2a00; background: linear-gradient(180deg, #9cf27e, #4fbf45); box-shadow: 0 0 0 2px #2d7a26; }
.round.now { color: #3a0e06; background: linear-gradient(180deg, #ffe6a6, #e07a22); box-shadow: 0 0 0 2px #6e2a10, 0 0 12px rgba(255, 106, 31, .7); animation: pulse 1.6s infinite; }
.round.prize { color: var(--gold-2); box-shadow: 0 0 0 2px var(--gold-dark); }
.place { width: 36px; color: var(--gold); flex: none; }

/* ================= Главная 4.0: концепт «Закат над Вальмерией» ================= */
/* шапка: золотые кнопки-плашки из набора */
.appbar-icons { gap: 4px; align-items: center; }
.appbar-icons a.hb { min-width: 0; width: 46px; height: 38px; padding: 0; border-radius: 10px; transition: transform .15s, filter .15s; }
.appbar-icons a.hb:hover { background: none; transform: translateY(-1px); filter: brightness(1.12) drop-shadow(0 0 6px rgba(255, 150, 60, .55)); }
.appbar-icons a.hb img { display: block; width: 46px; height: auto; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.appbar-icons a.hb .cnt { position: absolute; bottom: -3px; right: -2px; display: block; min-width: 16px; padding: 0 3px; border-radius: 8px; font-size: 10px; line-height: 14px; color: var(--gold-2); background: #1a0b08; box-shadow: 0 0 0 1px #8a6a2a; }
.appbar-icons a.hb .badge { top: -4px; right: -4px; }
.appbar-icons a.hb.is-muted img { filter: grayscale(1) brightness(.7); }
.appbar-icons a.hb.is-muted::after { content: ""; position: absolute; left: 10px; right: 10px; top: 50%; height: 3px; border-radius: 2px; background: #e2421b; transform: rotate(-28deg); box-shadow: 0 0 0 1px #000; }
@media (max-width: 420px) {
  .appbar { padding: 6px 8px; }
  .brand img.brand-logo { height: 46px; }
  .appbar-icons { gap: 2px; }
  .appbar-icons a.hb, .appbar-icons a.hb img { width: 40px; }
  .appbar-icons a.hb { height: 34px; }
}
@media (max-width: 370px) { .appbar-icons a.hb-set { display: none; } }

/* валюты: плашки с монетой, рубином и кристаллом, «+» ведёт в магазин */
.resbar { gap: 4px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; justify-content: space-between; }
.resbar a.rb { flex: 1 1 0; min-width: 0; position: relative; display: flex; align-items: center; width: 0; aspect-ratio: 330 / 96;
  background: url(../../images/ui/bar-coin.webp?v=14) center / 100% 100% no-repeat; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .55)); transition: filter .15s; }
.resbar a.rb-gem { background-image: url(../../images/ui/bar-gem.webp); }
.resbar a.rb-diamond { background-image: url(../../images/ui/bar-diamond.webp); }
.resbar a.rb:hover { filter: brightness(1.1) drop-shadow(0 0 6px rgba(255, 150, 60, .5)); }
.resbar a.rb b { position: absolute; left: 31%; right: 26%; top: 50%; transform: translateY(-50%); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; color: #fff4dc; font-size: clamp(12px, 3.6vw, 16px); text-shadow: 0 1px 2px #000; }
.resbar .res-daily { flex: none; width: 34px; height: 34px; justify-content: center; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #6a2e1e, #24110d); box-shadow: 0 0 0 2px #b8862e, 0 0 10px rgba(255, 106, 31, .6); }
@media (min-width: 1000px) { .resbar { width: 440px; } }

/* фон главной: закат, замок и водопады */
body.page-home { background: transparent; }
body.page-home::before { background: url(../../images/ui/bg-castle.webp) center top / cover no-repeat; opacity: 1; }
body.page-home::after { background: linear-gradient(180deg, rgba(14, 6, 5, .35) 0%, rgba(14, 6, 5, 0) 25%, rgba(14, 6, 5, .25) 55%, rgba(14, 6, 5, .85) 100%); }
body.page-home .appbar { background: linear-gradient(180deg, rgba(20, 8, 6, .85), rgba(20, 8, 6, .35)); box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }

/* сцена главной: всё масштабируется от ширины колонки */
.mm { position: relative; container-type: inline-size; margin: 0 6px; isolation: isolate; }
.mm-elf { position: absolute; z-index: 0; left: -7cqw; top: -4cqw; width: 52cqw; height: auto; pointer-events: none;
  filter: drop-shadow(6px 0 18px rgba(0, 0, 0, .55)); animation: elfIn .9s ease-out both; }
@keyframes elfIn { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
.mm-hero { position: relative; z-index: 1; height: 62cqw; }

/* плашка профиля: рамка аватара, имя, лига и щит */
.mm-profile { position: absolute; top: 2cqw; right: 4cqw; width: 58cqw; aspect-ratio: 586 / 198; display: block; color: #fff4dc;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .55)); }
.mm-profile::before { content: ""; position: absolute; inset: 0; z-index: 0; background: url(../../images/ui/profile.webp) left center / 100% 100% no-repeat; pointer-events: none; }
.mm-profile:hover { color: #fff; }
.mm-ava { position: absolute; left: 3.6%; top: 11.5%; width: 26.5%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; z-index: -1; background: #1a0b08; }
.mm-pinfo { z-index: 1; }
.mm-shield { z-index: 2; }
.mm-ava img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.mm-pinfo { position: absolute; left: 34%; right: 17%; top: 24%; bottom: 22%; display: flex; flex-direction: column; justify-content: center; min-width: 0; line-height: 1.15; }
.mm-pinfo b { font-family: var(--font-display); font-weight: 400; font-size: clamp(14px, 5.2cqw, 26px); color: #fff0d2; text-shadow: 0 2px 0 #000; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-pinfo small { display: flex; align-items: center; gap: 4px; font-size: clamp(10px, 2.9cqw, 14px); color: #f1c98a; white-space: nowrap; overflow: hidden; }
.mm-pinfo small svg { flex: none; }
.mm-shield { position: absolute; right: -6%; top: -6%; height: 112%; width: auto; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .6)); }
.lg-1500 { filter: hue-rotate(150deg) saturate(.8) drop-shadow(0 3px 6px rgba(0, 0, 0, .6)); }
.lg-1700 { filter: hue-rotate(205deg) drop-shadow(0 3px 6px rgba(0, 0, 0, .6)); }
.lg-1900 { filter: hue-rotate(285deg) saturate(1.2) drop-shadow(0 3px 6px rgba(0, 0, 0, .6)); }

/* веер карт над кнопкой */
.mm-fan { position: absolute; left: 53cqw; top: 23cqw; width: 0; height: 0; }
.mm-fan img { position: absolute; left: -6.5cqw; top: 0; width: 13cqw; max-width: none; height: auto; transform-origin: 50% 110%; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .6)); animation: fanIn .7s cubic-bezier(.2, 1.3, .4, 1) both; }
.mm-fan img:nth-child(1) { --r: -30deg; animation-delay: .1s; }
.mm-fan img:nth-child(2) { --r: -10deg; animation-delay: .18s; }
.mm-fan img:nth-child(3) { --r: 10deg; animation-delay: .26s; }
.mm-fan img:nth-child(4) { --r: 30deg; animation-delay: .34s; }
.mm-fan img { transform: rotate(var(--r)); }
@keyframes fanIn { from { opacity: 0; transform: rotate(0deg) translateY(10px); } to { opacity: 1; transform: rotate(var(--r)); } }
.mm-fan::before { content: ""; position: absolute; left: -16cqw; top: 2cqw; width: 32cqw; height: 22cqw; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 150, 50, .55), transparent); animation: glowPulse 2.4s ease-in-out infinite; }
@keyframes glowPulse { 50% { opacity: .55; } }

/* большая кнопка «В бой» */
.mm-battle-form { position: absolute; left: 50%; bottom: 0; width: 76cqw; transform: translateX(-46%); margin: 0; }
.mm-battle { position: absolute; left: 50%; bottom: 0; width: 76cqw; transform: translateX(-46%); }
.mm-battle-form .mm-battle { position: static; transform: none; width: 100%; }
.mm-battle { display: flex; flex-direction: column; justify-content: center; aspect-ratio: 524 / 117; padding: 0 12% 0 39%; border: 0; cursor: pointer; text-align: center; align-items: center;
  background: url(../../images/ui/btn-battle.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .6)) drop-shadow(0 0 14px rgba(255, 106, 31, .35)); transition: transform .15s, filter .15s; }
.mm-battle:hover { transform: translateX(-46%) scale(1.03); filter: brightness(1.1) drop-shadow(0 6px 14px rgba(0, 0, 0, .6)) drop-shadow(0 0 22px rgba(255, 140, 40, .6)); }
.mm-battle-form .mm-battle:hover { transform: scale(1.03); }
.mm-battle span { font-family: var(--font-display); font-size: clamp(20px, 7.4cqw, 38px); line-height: 1; color: #ffd98a; white-space: nowrap;
  text-shadow: 0 2px 0 #4a0f04, 0 0 10px rgba(255, 120, 30, .55); }
.mm-battle small { margin-top: .35em; max-width: 100%; overflow: hidden; white-space: nowrap; font-size: clamp(9px, 2.5cqw, 12px); letter-spacing: 0; color: #f4c27a; text-shadow: 0 1px 0 #000; }

/* три широкие плитки */
.mm-wide { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2cqw; margin-top: 4cqw; }
.mm-wide a, .mm-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; color: #fff0d2; text-align: center;
  border: 10px solid transparent; border-image: url(../../images/ui/panel.webp) 28 fill / 10px stretch; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .55));
  transition: transform .15s, filter .15s; animation: popIn .45s both; animation-delay: calc(var(--i, 0) * 40ms); }
.mm-wide a { aspect-ratio: 1.55; padding: 0 2px 2px; border-image-source: url(../../images/ui/panel-wide.webp); }
.mm-wide a:hover, .mm-tile:hover { color: #fff; transform: translateY(-2px); filter: brightness(1.12) drop-shadow(0 6px 12px rgba(0, 0, 0, .6)) drop-shadow(0 0 8px rgba(255, 140, 40, .45)); }
.mm-wide img { flex: 1; min-height: 0; max-width: 100%; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .6)); }
.mm-wide span { font-family: var(--font-display); font-size: clamp(12px, 4cqw, 20px); line-height: 1.1; text-shadow: 0 2px 0 #000; white-space: nowrap; }
img.masked { -webkit-mask-image: radial-gradient(closest-side, #000 62%, transparent 100%); mask-image: radial-gradient(closest-side, #000 62%, transparent 100%); }

/* сетка разделов 4×2 с листанием */
.mm-pager { position: relative; z-index: 1; display: flex; margin: 3cqw -1px 0; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.mm-pager::-webkit-scrollbar { display: none; }
.mm-grid { flex: 0 0 100%; scroll-snap-align: start; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2cqw; padding: 2px 1px 6px; align-content: start; }
.mm-tile { aspect-ratio: .92; padding: 0 1px 2px; justify-content: flex-start; }
.mm-tile .mm-ico { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.mm-tile .mm-ico img { max-width: 92%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .6)); }
.mm-tile .mm-ico img.masked { filter: none; }
.mm-tile .mm-ico img.lg-1500, .mm-tile .mm-ico img.lg-1700, .mm-tile .mm-ico img.lg-1900 { max-height: 90%; }
.mm-tile b { font-weight: 700; font-size: clamp(10px, 3.05cqw, 15px); line-height: 1.1; text-shadow: 0 1px 2px #000; }
.mm-tile small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(9px, 2.7cqw, 13px); line-height: 1.2; color: #f1c98a; }
.mm-tile.hot small { color: #ffdf7a; }
.mm-alert { position: absolute; z-index: 2; top: -9px; right: -9px; width: 22px; height: 22px; animation: pulse 1.6s infinite; }
.mm-dots { display: flex; justify-content: center; gap: 8px; margin: 4px 0 6px; }
.mm-dots button { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; background: #3a2a22; box-shadow: 0 0 0 1px #8a6a2a, inset 0 1px 2px #000; }
.mm-dots button.on { background: radial-gradient(circle at 40% 35%, #fff1b0, #e2a92b 60%, #7a5208); box-shadow: 0 0 0 1px #5a3a08, 0 0 6px rgba(255, 190, 70, .8); }

/* подвал: ссылки между золотыми разделителями */
body.page-home .foot-links { position: relative; padding: 14px 0 12px; }
body.page-home .foot-links::before, body.page-home .foot-links::after { content: ""; position: absolute; left: 50%; width: min(92%, 420px); transform: translateX(-50%); height: 14px;
  background: url(../../images/ui/divider.webp) center / 100% 100% no-repeat; opacity: .9; }
body.page-home .foot-links::before { top: -2px; }
body.page-home .foot-links::after { bottom: -4px; }

/* нижние вкладки: золото и выделенная активная */
.tabbar { box-shadow: 0 -1px 0 #8a6a2a, 0 -2px 0 rgba(255, 170, 60, .35), 0 -8px 20px rgba(0, 0, 0, .55); }
.tabbar a { color: #e9c98f; }
.tabbar a .i { color: #f2b850; filter: drop-shadow(0 1px 0 #000); }
.tabbar a.on { color: #fff0d2; background: radial-gradient(ellipse at 50% 100%, rgba(255, 120, 40, .35), transparent 70%); }
.tabbar a.on .i { color: #ffd77a; }

@media (min-width: 1000px) {
  .mm { max-width: 600px; margin: 0 auto; }
}
.mm-elf { -webkit-mask-image: linear-gradient(180deg, #000 78%, transparent 99%); mask-image: linear-gradient(180deg, #000 78%, transparent 99%); }
body.page-home .side-card { background: linear-gradient(180deg, rgba(40, 18, 14, .93), rgba(20, 9, 7, .93)); }
body.page-home .box { background-color: rgba(24, 11, 8, .88); }

/* ================= Вход, знакомство, подсказки и эффекты (обновление 13) ================= */
/* фон страниц входа и знакомства — тот же закат, что на главной */
body.page-auth { background: transparent; }
body.page-auth::before { background: url(../../images/ui/bg-castle.webp) center top / cover no-repeat; opacity: 1; }
body.page-auth::after { background: linear-gradient(180deg, rgba(14, 6, 5, .2) 0%, rgba(14, 6, 5, 0) 30%, rgba(14, 6, 5, .45) 60%, rgba(14, 6, 5, .9) 100%); }
body.page-auth.out-game .appbar { display: none; }
body.page-auth .appbar { background: linear-gradient(180deg, rgba(20, 8, 6, .85), rgba(20, 8, 6, .35)); box-shadow: none; }

/* страница входа */
.auth { position: relative; container-type: inline-size; padding: 0 12px 24px; }
.auth-hero { position: relative; height: 74cqw; max-height: 430px; }
.auth-rays { position: absolute; left: 50%; top: 32%; width: 130cqw; height: 130cqw; max-width: 760px; max-height: 760px; transform: translate(-50%, -50%); pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255, 196, 110, .16) 0deg 6deg, transparent 6deg 18deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 20%, transparent 75%); mask-image: radial-gradient(closest-side, #000 20%, transparent 75%); animation: raysSpin 60s linear infinite; }
@keyframes raysSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.auth-title { position: relative; z-index: 2; margin: 0; padding-top: 2cqw; text-align: center; }
.auth-logo { width: 96cqw; max-width: 560px; height: auto; filter: drop-shadow(0 8px 22px rgba(0, 0, 0, .7)) drop-shadow(0 0 26px rgba(255, 120, 40, .35)); animation: logoIn 1s cubic-bezier(.2, 1.2, .3, 1) both, logoGlow 4s ease-in-out 1s infinite; }
@keyframes logoIn { from { opacity: 0; transform: scale(.85) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes logoGlow { 50% { filter: drop-shadow(0 8px 22px rgba(0, 0, 0, .7)) drop-shadow(0 0 40px rgba(255, 150, 60, .6)); } }
.auth-elf { position: absolute; z-index: 1; right: -8cqw; bottom: -18cqw; width: 34cqw; max-width: 200px; height: auto; opacity: .95; transform: scaleX(-1);
  filter: drop-shadow(-6px 0 16px rgba(0, 0, 0, .6)); -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); animation: elfIn .9s .3s ease-out both; }
.auth-tag { position: relative; z-index: 2; max-width: 64cqw; margin: 0 0 14px; color: #fbe8c8; font-size: clamp(13px, 3.8cqw, 16px); line-height: 1.4; text-shadow: 0 2px 4px #000, 0 0 12px rgba(0, 0, 0, .8); }
.auth-play { position: relative; z-index: 2; margin: 0 auto 16px; width: 84cqw; max-width: 460px; }
.auth-battle { position: relative; left: auto; bottom: auto; width: 100%; transform: none; padding-left: 40%; }
.auth-battle:hover { transform: scale(1.03); }
.auth-panel { position: relative; z-index: 2; padding: 14px 16px 16px; border: 12px solid transparent; border-image: url(../../images/ui/panel.webp) 28 fill / 12px stretch;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, .65)); animation: popIn .5s .15s both; }
.auth-radio { position: absolute; opacity: 0; pointer-events: none; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: -4px -2px 12px; }
.auth-tabs label { display: block; padding: 9px 4px; text-align: center; cursor: pointer; border-radius: 10px; font-family: var(--font-display); font-size: 18px; color: #d9b98a;
  background: linear-gradient(180deg, rgba(60, 26, 18, .9), rgba(30, 12, 9, .9)); box-shadow: inset 0 0 0 1px #6b4a2a; transition: color .15s, box-shadow .15s; }
#t-login:checked ~ .auth-tabs label[for="t-login"], #t-reg:checked ~ .auth-tabs label[for="t-reg"] { color: #3a0e06; text-shadow: 0 1px 0 rgba(255, 236, 190, .6);
  background: linear-gradient(180deg, #ffe6a6, #f7b84a 50%, #d9822a); box-shadow: 0 0 0 1px #5a1e0c, 0 0 14px rgba(255, 150, 50, .45); }
.auth-form { display: none; }
#t-login:checked ~ .f-login, #t-reg:checked ~ .f-reg { display: block; animation: pageIn .3s ease-out both; }
.auth-form label, .auth-form-solo label { display: block; margin-bottom: 10px; color: #f1d2a0; font-size: 14px; }
.auth-form input[type=text], .auth-form input[type=password], .auth-form input[type=email],
.auth-form-solo input[type=text], .auth-form-solo input[type=password], .auth-form-solo input[type=email] {
  margin-top: 4px; background: rgba(12, 5, 4, .75); border: 1px solid #7a5a32; box-shadow: inset 0 2px 6px rgba(0, 0, 0, .6); color: #fff4dc; }
.auth-form input:focus, .auth-form-solo input:focus { border-color: #f2b850; box-shadow: inset 0 2px 6px rgba(0, 0, 0, .6), 0 0 0 3px rgba(242, 184, 80, .25); outline: none; }
.auth-submit { margin-top: 4px; font-family: var(--font-display); font-size: 19px; padding: 12px; }
.auth-sex { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.auth-sex .ava-pick { display: flex; flex-direction: column; align-items: center; gap: 2px; border-radius: 14px; padding: 6px; background: rgba(20, 8, 6, .55); box-shadow: inset 0 0 0 1px #5d4a32; }
.auth-sex .ava-pick img { width: 64px; }
.auth-sex .ava-pick span { font-size: 13px; color: #f1d2a0; }
.auth-sex .ava-pick:has(input:checked) { box-shadow: inset 0 0 0 2px #f2b850, 0 0 12px rgba(255, 150, 50, .35); }
.auth-feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.auth-feats > div { display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(48, 20, 14, .88), rgba(22, 9, 7, .88)); box-shadow: inset 0 0 0 1px #6b4a2a, 0 4px 10px rgba(0, 0, 0, .45); animation: popIn .45s both; animation-delay: calc(.3s + var(--i) * 70ms); }
.auth-feats img { grid-row: 1 / 3; width: 52px; height: 40px; object-fit: contain; }
.auth-feats b { font-family: var(--font-display); font-weight: 400; font-size: 15px; color: #fff0d2; line-height: 1.15; }
.auth-feats small { color: #d9b98a; font-size: 12px; line-height: 1.2; }
.auth-foot { margin-top: 14px; text-align: center; color: #c9a77a; }
@media (min-width: 700px) { .auth-feats { grid-template-columns: repeat(4, minmax(0, 1fr)); } .auth-feats > div { grid-template-columns: 1fr; text-align: center; } .auth-feats img { grid-row: auto; margin: 0 auto; } }

/* знакомство с игрой */
.onb { position: relative; padding: 8px 10px 20px; }
.onb-steps { display: flex; justify-content: center; gap: 8px; margin: 6px 0 10px; }
.onb-steps i { width: 34px; height: 6px; border-radius: 3px; background: #3a2a22; box-shadow: inset 0 0 0 1px #6b4a2a; }
.onb-steps i.done { background: #b8862e; }
.onb-steps i.on { background: linear-gradient(90deg, #ffe6a6, #f2b850); box-shadow: 0 0 10px rgba(255, 170, 60, .7); }
.onb-npc { position: relative; display: flex; align-items: flex-end; min-height: 210px; margin-bottom: 10px; }
.onb-elf { position: absolute; left: -10px; bottom: -20px; width: 130px; height: auto; filter: drop-shadow(4px 0 14px rgba(0, 0, 0, .6));
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); animation: elfIn .8s ease-out both; }
.onb-speech { position: relative; margin-left: 108px; padding: 12px 14px; border-radius: 16px; color: #fbe8c8; font-size: 14.5px; line-height: 1.45;
  background: linear-gradient(180deg, rgba(58, 24, 16, .95), rgba(26, 10, 8, .95)); box-shadow: inset 0 0 0 1px #8a6a2a, 0 0 0 1px #000, 0 8px 20px rgba(0, 0, 0, .55); animation: popIn .5s .2s both; }
.onb-speech::before { content: ""; position: absolute; left: -9px; bottom: 26px; border: 9px solid transparent; border-right-color: #8a6a2a; border-left: 0; }
.onb-speech b { display: block; margin-bottom: 4px; font-family: var(--font-display); font-weight: 400; font-size: 19px; color: #ffd98a; }
.onb-speech p { margin: 0; }
.onb-card { padding: 12px; border: 12px solid transparent; border-image: url(../../images/ui/panel.webp) 28 fill / 12px stretch; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .6)); }
.onb-label { margin: 2px 0 4px; text-align: center; font-family: var(--font-display); color: #ffd98a; font-size: 16px; }
.onb-avas { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; margin-bottom: 6px; }
@media (max-width: 420px) { .onb-avas { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.onb-cards { margin-top: 4px; }
.onb-skip { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 16px; text-align: center; }
.onb-skip .link-btn { color: #e9c98f; text-decoration: underline; text-underline-offset: 3px; }

/* полоса гостя */
.guest-bar { display: flex; align-items: center; gap: 8px; margin: 6px 10px; padding: 8px 12px; border-radius: 12px; color: #fff0d2; font-size: 13.5px; line-height: 1.3;
  background: linear-gradient(90deg, rgba(150, 60, 18, .92), rgba(90, 30, 12, .92)); box-shadow: inset 0 0 0 1px #e0a040, 0 4px 12px rgba(0, 0, 0, .45); }
.guest-bar:hover { color: #fff; filter: brightness(1.1); }
.guest-bar .i { flex: none; width: 20px; height: 20px; color: #ffd98a; }
.guest-bar span { flex: 1; }
.guest-bar .chev { flex: none; font-size: 22px; }

/* подсказки обучения */
.guide { position: fixed; z-index: 70; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px); width: min(540px, calc(100% - 16px)); transform: translateX(-50%);
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px 10px 10px; border-radius: 16px; color: #fbe8c8;
  background: linear-gradient(180deg, rgba(62, 26, 17, .97), rgba(26, 10, 8, .97)); box-shadow: inset 0 0 0 1px #c08a3a, 0 0 0 1px #000, 0 10px 30px rgba(0, 0, 0, .7), 0 0 24px rgba(255, 120, 40, .25);
  animation: guideIn .5s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes guideIn { from { opacity: 0; transform: translate(-50%, 20px) scale(.96); } to { opacity: 1; transform: translateX(-50%); } }
.guide-elf { flex: none; width: 54px; height: 54px; border-radius: 50%; box-shadow: 0 0 0 2px #f2b850, 0 0 12px rgba(255, 170, 60, .5); }
.guide-body { flex: 1; min-width: 0; }
.guide-head small { display: block; color: #c9a77a; font-size: 11.5px; letter-spacing: .3px; }
.guide-head b { font-family: var(--font-display); font-weight: 400; font-size: 18px; color: #ffd98a; }
.guide p { margin: 3px 0 8px; font-size: 14px; line-height: 1.4; }
.guide-btns { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.guide-btns .link-btn { color: #c9a77a; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 1000px) { .guide { bottom: 18px; } }
/* подсветка нужного элемента */
.guide-spot { position: relative; z-index: 60 !important; animation: spotPulse 1.6s ease-in-out infinite !important; }
@keyframes spotPulse { 0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 200, 80, 0)) brightness(1); } 50% { filter: drop-shadow(0 0 14px rgba(255, 200, 80, .95)) brightness(1.15); } }
.guide-finger { position: absolute; z-index: 61; width: 34px; height: 34px; pointer-events: none; font-size: 30px; line-height: 1; animation: finger 1.1s ease-in-out infinite; filter: drop-shadow(0 2px 3px #000); }
@keyframes finger { 50% { transform: translate(-6px, -8px); } }
body.has-guide .page { padding-bottom: 150px; }

/* учебные подсказки на поле */
.f-tip { position: relative; z-index: 5; display: flex; gap: 10px; align-items: flex-start; margin: 8px 6px; padding: 10px 12px; border-radius: 14px; color: #fbe8c8; font-size: 14px; line-height: 1.4;
  background: linear-gradient(180deg, rgba(62, 26, 17, .97), rgba(26, 10, 8, .97)); box-shadow: inset 0 0 0 1px #c08a3a, 0 6px 18px rgba(0, 0, 0, .6); animation: guideInStatic .45s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes guideInStatic { from { opacity: 0; transform: translateY(-8px) scale(.97); } to { opacity: 1; transform: none; } }
.f-tip img { flex: none; width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 0 0 2px #f2b850; }
.f-tip b { display: block; font-family: var(--font-display); font-weight: 400; color: #ffd98a; font-size: 16px; }
.f-tip p { margin: 2px 0 0; }
.f-tip .x { flex: none; margin-left: auto; padding: 0 4px; border: 0; background: none; color: #c9a77a; font-size: 20px; cursor: pointer; }

/* ---------- эффекты интерфейса ---------- */
/* летящие искры на фоне */
.fx-embers { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.shell { position: relative; z-index: 1; }
/* блик по золотым кнопкам */
.btn, .mm-battle, .auth-tabs label { position: relative; overflow: hidden; }
.mm-battle { overflow: visible; }
.btn::after, .auth-tabs label::after { content: ""; position: absolute; top: -20%; bottom: -20%; left: -60%; width: 40%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 240, .55), transparent); transform: skewX(-20deg); transition: left .6s ease; }
.btn:hover::after, .auth-tabs label:hover::after { left: 130%; }
.mm-battle::after { content: ""; position: absolute; inset: 14% 9%; pointer-events: none; border-radius: 6px;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 240, 200, .45) 45%, transparent 60%) no-repeat; background-size: 250% 100%; background-position: 160% 0;
  -webkit-mask: linear-gradient(#000, #000); animation: battleShine 4.5s ease-in-out 1.2s infinite; mix-blend-mode: screen; }
@keyframes battleShine { 0%, 60% { background-position: 160% 0; } 85%, 100% { background-position: -60% 0; } }
/* горячие плитки — бегущий золотой отблеск */
.mm-tile.hot::after { content: ""; position: absolute; inset: -4px; pointer-events: none; border-radius: 6px;
  background: conic-gradient(from var(--ang, 0deg), transparent 0 70%, rgba(255, 210, 120, .75) 80%, transparent 90%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; padding: 2px; animation: hotSpin 3s linear infinite; }
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes hotSpin { to { --ang: 360deg; } }
/* мягкое появление разделов страницы */
.page > * { animation: riseIn .45s ease-out both; }
.page > *:nth-child(2) { animation-delay: .05s; } .page > *:nth-child(3) { animation-delay: .1s; } .page > *:nth-child(4) { animation-delay: .15s; }
@keyframes riseIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .auth-rays, .auth-logo, .mm-battle::after, .mm-tile.hot::after, .guide-spot, .guide-finger { animation: none !important; }
  .fx-embers { display: none; }
}

/* ---------- эффекты боя на поле ---------- */
.fx-layer { position: absolute; left: 0; top: 0; z-index: 30; pointer-events: none; }
.fx-layer.fx-fixed { position: fixed; z-index: 80; }
.f-tip-wrap:empty { display: none; }
.dmg.strong { font-size: 28px; color: #ffe1a0; -webkit-text-stroke: 1px #6b2a00; text-shadow: 0 2px 0 #5a1e00, 0 0 12px rgba(255, 160, 50, .9); }
.dmg.crit { animation: critPop 1.3s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes critPop { 0% { opacity: 0; transform: translate(-50%, 0) scale(.4); } 15% { opacity: 1; transform: translate(-50%, -10px) scale(1.5); } 30% { transform: translate(-50%, -16px) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -60px) scale(1); } }
/* знамя хода: свет пробегает по полосе */
.round-banner { background: none; overflow: hidden; }
.round-banner::before { content: ""; position: absolute; left: -10%; right: -10%; top: 50%; height: 64px; transform: translateY(-50%) skewY(-4deg);
  background: linear-gradient(90deg, transparent, rgba(40, 10, 6, .92) 15%, rgba(40, 10, 6, .92) 85%, transparent);
  box-shadow: 0 -2px 0 rgba(242, 184, 80, .8), 0 2px 0 rgba(242, 184, 80, .8); animation: bannerBar .9s ease-out both; }
.round-banner::after { content: ""; position: absolute; top: 50%; left: -40%; width: 40%; height: 64px; transform: translateY(-50%) skewX(-25deg);
  background: linear-gradient(90deg, transparent, rgba(255, 230, 170, .55), transparent); animation: bannerShine .9s ease-out both; }
.round-banner { z-index: 12; text-shadow: 0 2px 0 #000, 0 0 16px rgba(255, 150, 50, .8); font-size: 34px; color: #ffd98a; }
.round-banner.theirs { color: #ffb0a0; text-shadow: 0 2px 0 #000, 0 0 16px rgba(255, 70, 50, .8); }
.round-banner { isolation: isolate; }
.round-banner::before, .round-banner::after { z-index: -1; }
@keyframes bannerBar { 0% { transform: translateY(-50%) skewY(-4deg) scaleX(0); } 35% { transform: translateY(-50%) skewY(-4deg) scaleX(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes bannerShine { 0% { left: -40%; } 100% { left: 120%; } }
/* двойной удар: короткая белая вспышка и толчок поля */
#field.fx-crit .board { animation: critShake .45s cubic-bezier(.36, .07, .19, .97); }
@keyframes critShake { 10%, 90% { transform: translate(-2px, 1px); } 20%, 80% { transform: translate(4px, -2px); } 30%, 50%, 70% { transform: translate(-6px, 2px); } 40%, 60% { transform: translate(6px, -1px); } }
/* существо, которое может ходить, мерцает золотом */
.unit.ready { animation: readyGlow 1.8s ease-in-out infinite; }
@keyframes readyGlow { 50% { filter: drop-shadow(0 0 7px rgba(255, 200, 80, .85)) brightness(1.08); } }
.unit.selected { filter: drop-shadow(0 0 10px rgba(255, 220, 120, 1)) brightness(1.12); }
.cell.reach { position: relative; }
.cell.reach::after { content: ""; position: absolute; inset: 18%; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, rgba(120, 255, 160, .45), transparent 70%); animation: reachPulse 1.2s ease-in-out infinite; }
@keyframes reachPulse { 50% { transform: scale(1.25); opacity: .55; } }
.unit.target { animation: targetPulse 1s ease-in-out infinite; }
@keyframes targetPulse { 50% { filter: drop-shadow(0 0 8px rgba(255, 70, 50, .95)); } }
@media (prefers-reduced-motion: reduce) { .unit.ready, .cell.reach::after, .unit.target, #field.fx-crit .board { animation: none !important; } }
/* рисованная монета вместо значка */
img.i.i-img { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -.2em; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .6)); }

/* подпись под «В бой»: по центру, светлое золото на тёмной плашке */
.mm-battle small { display: inline-block; margin-top: .45em; padding: .1em .7em; border-radius: 999px; font-size: clamp(9px, 2.4cqw, 12px); line-height: 1.4; letter-spacing: .3px;
  color: #ffe7b0; background: rgba(30, 6, 2, .55); box-shadow: inset 0 0 0 1px rgba(242, 184, 80, .35); text-shadow: 0 1px 1px #000; }
.auth-battle { padding-left: 37%; }

/* ===== обновление 14: страница входа ===== */
html:has(body.page-auth), body.page-auth { overflow-x: hidden; }
.auth { overflow-x: clip; padding: 0 16px 24px; }
.auth-hero { height: auto; max-height: none; padding-top: 2cqw; }
.auth-rays { top: 50%; width: 120cqw; height: 120cqw; }
.auth-title { padding-top: 0; }
.auth-logo { display: block; width: 100%; max-width: 520px; margin: 0 auto; }
.auth-intro { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) 34%; align-items: center; gap: 8px; max-width: 520px; margin: -2cqw auto -12cqw; }
.auth-tag { max-width: none; margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(14, 6, 5, .55); box-shadow: inset 0 0 0 1px rgba(242, 184, 80, .25);
  font-size: clamp(13px, 3.7cqw, 16px); text-align: left; }
.auth-elf { position: static; display: block; width: 100%; max-width: 190px; justify-self: end; transform: scaleX(-1); filter: none; opacity: 1;
  -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent 96%); mask-image: linear-gradient(180deg, #000 62%, transparent 96%); }
.auth-play { position: relative; z-index: 3; width: 100%; max-width: 460px; margin: 0 auto 16px; }
.auth-battle { padding: 0 11% 0 37%; }
.auth-panel { max-width: 520px; margin: 0 auto; }
.auth-feats, .auth-foot { max-width: 520px; margin-left: auto; margin-right: auto; }
.auth-feats { margin-top: 16px; }

/* обновление 14: без блика на кнопке «В бой» */
.mm-battle::after { content: none; display: none; animation: none; }

/* эльфийка слева, описание справа */
.auth-intro { grid-template-columns: 34% minmax(0, 1fr); }
.auth-elf { order: -1; justify-self: start; transform: none; }

/* обновление 15: цели режимов */
.f-goal { display: flex; gap: 10px; align-items: center; margin: 0 0 8px; padding: 8px 12px; border-radius: 12px; background: linear-gradient(180deg, rgba(60, 22, 8, .92), rgba(30, 10, 5, .92));
  box-shadow: inset 0 0 0 1px rgba(242, 184, 80, .45), 0 4px 12px rgba(0, 0, 0, .45); color: #f6dfb6; animation: popIn .4s both; }
.f-goal .fg-ic { font-size: 28px; line-height: 1; filter: drop-shadow(0 2px 3px #000); }
.f-goal b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 17px; color: #ffd98a; }
.f-goal small { display: block; font-size: 12.5px; line-height: 1.3; color: #e8cfa4; }
.f-goal em { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; font-style: normal; font-size: 12px; color: #fff1cc; background: rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 1px rgba(242, 184, 80, .3); }
.unit .u-tag { position: absolute; left: 2px; top: 2px; z-index: 3; font-size: 15px; line-height: 1; filter: drop-shadow(0 1px 2px #000); }
.unit.tag-boss { box-shadow: 0 0 0 2px #ff5a2a, 0 0 16px rgba(255, 80, 30, .8); animation: bossPulse 2.2s ease-in-out infinite; }
@keyframes bossPulse { 50% { box-shadow: 0 0 0 2px #ff8a3a, 0 0 26px rgba(255, 110, 40, 1); } }
.unit.tag-leader { box-shadow: 0 0 0 2px #ffd25a, 0 0 14px rgba(255, 200, 70, .75); }
.unit.tag-tower, .unit.tag-villager { box-shadow: 0 0 0 2px #7fd0ff, 0 0 12px rgba(120, 200, 255, .6); }
.unit.tag-tower img { object-fit: contain; padding: 10%; background: radial-gradient(circle, #5a3a1a, #2a1608); }
@media (prefers-reduced-motion: reduce) { .unit.tag-boss { animation: none; } }

/* обновление 16: сюжетная кампания */
.saga-npc img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; object-position: top; box-shadow: 0 0 0 2px #f2b850, 0 4px 10px rgba(0, 0, 0, .5); }
.saga-spk { display: block; margin-bottom: 4px; font-family: var(--font-display); font-weight: 400; color: #ffd98a; }
.saga-path { display: flex; gap: 4px; margin: 0 0 12px; padding: 4px; overflow-x: auto; }
.sp-node { flex: 1 1 0; min-width: 64px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; position: relative; }
.sp-node span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; font-weight: 700; background: #2a1408; color: #c9a77a; box-shadow: inset 0 0 0 2px #5d4a32; }
.sp-node small { font-size: 11px; line-height: 1.2; color: #c9a77a; }
.sp-node.done span { background: linear-gradient(#5a9a3a, #2f6a1e); color: #fff; box-shadow: inset 0 0 0 2px #9ee07a; }
.sp-node.now span { background: linear-gradient(#ffd98a, #c9781e); color: #3a0e06; box-shadow: 0 0 12px rgba(255, 170, 60, .8); animation: bossPulse 2s ease-in-out infinite; }
.sp-node.now small { color: #ffe7b0; }
.saga-head { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 10px; text-align: center; }
.saga-head small { color: #c9a77a; }
.saga-head b { font-family: var(--font-display); font-weight: 400; font-size: 22px; color: #ffd98a; }
.saga-head span { font-size: 13px; color: #f1d2a0; }
.saga-goal { margin: 10px 0; padding: 8px 10px; border-radius: 10px; font-size: 13px; line-height: 1.35; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px rgba(242, 184, 80, .3); }

/* обновление 16: бросок кубиков со своей стороны поля */
.die-throw { position: absolute; left: 0; top: 0; z-index: 9; width: 42px; height: 42px; perspective: 420px; pointer-events: none; will-change: transform; }
.die-throw .die3d { --s: 42px; --h: 21px; position: relative; z-index: 1; }
.die-throw .face { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18), inset -4px -4px 7px rgba(0, 0, 0, .18), inset 3px 3px 5px rgba(255, 255, 255, .7); }
.die-throw .die3d.atk .face { background: linear-gradient(145deg, #fffaf0, #f2d58a); }
.die-throw .die3d.def .face { background: linear-gradient(145deg, #f6f0ff, #9fb2e8); }
.die-throw .face i.on { background: radial-gradient(circle at 35% 35%, #8a1c0c, #3a0602); }
.die-shadow { position: absolute; left: 4px; right: 4px; bottom: -6px; height: 10px; border-radius: 50%; background: rgba(0, 0, 0, .7); filter: blur(4px); opacity: 0; }
.die-throw.landed::after { content: ""; position: absolute; inset: -12px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 220, 140, .65), transparent 65%); animation: dieLand .5s ease-out forwards; }
.die-throw.from-them.landed::after { background: radial-gradient(circle, rgba(170, 190, 255, .6), transparent 65%); }
@keyframes dieLand { from { opacity: 1; transform: scale(.4); } to { opacity: 0; transform: scale(1.5); } }
.die-throw.out { transition: opacity .3s; opacity: 0; }
/* кубики в руке (ручной бросок) */
.roll-hand { position: fixed; left: 0; right: 0; margin: 0 auto; width: max-content; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 220px; padding: 14px 20px 12px; border-radius: 18px; cursor: grab; touch-action: none; user-select: none; text-align: center;
  background: radial-gradient(120% 140% at 50% 0%, rgba(90, 36, 10, .97), rgba(24, 8, 4, .97)); box-shadow: inset 0 0 0 1px rgba(242, 184, 80, .55), 0 10px 30px rgba(0, 0, 0, .7), 0 0 30px rgba(255, 150, 50, .25);
  animation: popIn .3s both; }
.roll-hand b { font-family: var(--font-display); font-weight: 400; font-size: 20px; color: #ffd98a; }
.roll-hand small { color: #e8cfa4; }
.rh-dice { display: flex; gap: 14px; padding: 6px 0 4px; perspective: 400px; }
.rh-dice .die3d { --s: 40px; --h: 20px; animation: dieShake .9s ease-in-out infinite; }
.rh-dice .die3d:nth-child(2) { animation-delay: -.45s; }
.rh-dice .cube { transform: rotateX(-20deg) rotateY(30deg); }
@keyframes dieShake { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-8px) rotate(8deg); } }
.roll-hand.thrown { animation: rollAway .25s ease-in forwards; }
@keyframes rollAway { to { opacity: 0; transform: translateY(-160px) scale(.6); } }
.set-row { display: flex; gap: 12px; align-items: center; }
.btn.switch { min-width: 104px; background: linear-gradient(#4a3424, #2a1a10); color: #d9b98a; }
.btn.switch.on { background: linear-gradient(#ffd98a, #d08a2a); color: #3a0e06; }
@media (prefers-reduced-motion: reduce) { .rh-dice .die3d { animation: none; } }

/* гербы кланов */
.emblem-pick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 4px 0 12px; }
.emblem-pick label { position: relative; display: block; margin: 0; padding: 4px; border-radius: 12px; cursor: pointer; background: rgba(20, 8, 6, .55); box-shadow: inset 0 0 0 1px #5d4a32; transition: transform .15s, box-shadow .15s; }
.emblem-pick input { position: absolute; opacity: 0; pointer-events: none; }
.emblem-pick img { display: block; width: 100%; height: auto; max-width: none; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .6)); }
.emblem-pick label:has(input:checked) { box-shadow: inset 0 0 0 2px #f2b850, 0 0 14px rgba(255, 170, 60, .55); transform: scale(1.06); background: rgba(70, 30, 10, .7); }
.emblem-pick label:has(input:focus-visible) { outline: 2px solid #ffd98a; outline-offset: 2px; }
.lbl { margin: 6px 0 2px; color: #f1d2a0; font-size: 14px; }
.clan-emblem { width: 128px; height: 128px; max-width: none; object-fit: contain; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .65)) drop-shadow(0 0 16px rgba(255, 160, 60, .25)); }
.clan-mini { width: 28px; height: 28px; max-width: none; object-fit: contain; vertical-align: middle; }
/* узкие телефоны (Android 320–360px) */
.chests { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chest { min-width: 0; overflow-wrap: anywhere; }
.chest img { width: min(80px, 100%); height: auto; }
.chest .btn { max-width: 100%; white-space: normal; }
@media (max-width: 360px) { .chests { gap: 6px; } .chest { padding: 8px 2px; font-size: 13px; } .auth-tabs label { font-size: 16px; } }
/* логотип в шапке не обрезается */
.brand { overflow: visible; }
.brand img.brand-logo { margin: 0; height: 58px; }
@media (max-width: 480px) { .brand img.brand-logo { height: 50px; } }

/* ---- обновление 17: новые карты в рамке, цифры в кружках ---- */
.r-legend { --rc: #ffd45a; --rc2: #8a6410; }
.r-legend .gc-frame { animation: mythGlow 3s infinite ease-in-out; }
.fc { position: relative; container-type: inline-size; }
.fullcard .gc-frame.fc { padding: 0; border-radius: 9px; background: none; }
.fullcard .gc-frame.fc::after { border-radius: 9px; }
.fc .fc-img { display: block; width: 100%; height: auto; aspect-ratio: 352 / 688; border-radius: 9px; }
.fc-n, .fc-cost { position: absolute; z-index: 2; display: flex; align-items: center; justify-content: center; transform: translate(-50%, -50%);
  font-family: var(--font-display, inherit); font-weight: 700; line-height: 1; font-size: 15px; font-size: 12cqw; pointer-events: auto; }
.fc-n { top: 93.6%; width: 17cqw; height: 17cqw; border-radius: 50%; color: #fff;
  text-shadow: 0 0 2px #000, 0 1px 3px #000, 0 0 8px rgba(0, 0, 0, .8); }
.fc-atk { left: 14.3%; background: radial-gradient(circle, rgba(255, 168, 58, .55), rgba(120, 40, 8, .2) 70%, transparent 72%); color: #ffe7b0; }
.fc-hp { left: 85.7%; background: radial-gradient(circle, rgba(255, 70, 70, .55), rgba(110, 10, 10, .2) 70%, transparent 72%); color: #ffd9d9; }
.fc-cost { left: 50%; top: 94.6%; width: 17cqw; height: 17cqw; font-size: 9cqw; color: #2b1300; text-shadow: 0 1px 0 rgba(255, 255, 255, .5);
  background: radial-gradient(circle at 45% 35%, #fff6c8, #ffc93a 45%, #b77708 75%, #5a3304); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.fullcard .lv { top: -6px; left: -6px; }
.fullcard .up { top: auto; bottom: 18%; right: 4px; }
.fc-sub { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; margin-top: 4px; font-size: 11.5px; }
.fc-sub i { display: inline-flex; align-items: center; gap: 2px; padding: 1px 5px; border-radius: 6px; background: rgba(0, 0, 0, .35); font-style: normal; white-space: nowrap; cursor: help; }
.fc-sub .i { width: 13px; height: 13px; }
.card-big.has-full { align-items: flex-start; }
.fc-big { flex: 0 0 auto; width: 200px; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .6)) drop-shadow(0 0 12px color-mix(in srgb, var(--rc, #000) 45%, transparent)); }
@media (max-width: 480px) {
  .card-big.has-full { flex-direction: column; align-items: center; }
  .fc-big { width: min(260px, 78vw); }
}

/* ---- обновление 18: заклинания, связки стихий ---- */
.kind-tabs { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 0 0 10px; }
.kind-tabs a { padding: 6px 12px; border-radius: 999px; background: rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text); font-size: 13px; }
.kind-tabs a.on { background: linear-gradient(#ffb44a, #e0701c); color: #2b1300; box-shadow: none; font-weight: 700; }
.fc-spell i { color: #e9d8ff; }
.hcard.spell { box-shadow: 0 0 0 2px #b27bff, 0 0 10px rgba(178, 123, 255, .45); }
.hcard.spell .h-st { color: #e9d8ff; font-size: 10px; white-space: normal; line-height: 1.15; }
.f-spells { display: flex; gap: 8px; align-items: stretch; justify-content: center; flex-wrap: wrap; margin: 8px 0; }
.f-spells .fs-h { flex-basis: 100%; text-align: center; font-size: 12px; color: var(--muted); }
.f-spells .fs-h.foe { margin-top: 2px; }
.spell-slot { position: relative; width: 64px; min-height: 86px; padding: 0; border: 0; border-radius: 10px; background: rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 1px rgba(178, 123, 255, .45); color: var(--text); cursor: pointer; overflow: hidden; }
.spell-slot.empty { display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); border: 1px dashed rgba(178, 123, 255, .5); background: none; box-shadow: none; cursor: default; }
.spell-slot img { display: block; width: 100%; aspect-ratio: 330 / 366; object-fit: cover; }
.spell-slot .ss-nm { display: block; padding: 2px 3px 3px; font-size: 10px; line-height: 1.1; }
.spell-slot .ss-cost { position: absolute; top: 2px; left: 2px; min-width: 18px; padding: 0 4px; border-radius: 9px; background: #ffc93a; color: #2b1300; font-size: 11px; font-weight: 700; }
.spell-slot.can { box-shadow: 0 0 0 2px #c89bff, 0 0 14px rgba(200, 155, 255, .7); animation: glowPulse 1.6s infinite; }
.spell-slot.armed { box-shadow: 0 0 0 3px #fff, 0 0 18px rgba(255, 255, 255, .8); transform: translateY(-3px); }
.spell-slot.used { filter: grayscale(1) brightness(.45); cursor: default; }
.spell-slot.foe { width: 46px; min-height: 0; cursor: help; box-shadow: inset 0 0 0 1px rgba(255, 110, 90, .5); font-size: 20px; padding: 6px 0; }
.unit.spell-target { outline: 3px solid #c89bff; outline-offset: -2px; box-shadow: 0 0 16px rgba(200, 155, 255, .8); cursor: crosshair; }
.spell-burst { position: absolute; z-index: 30; pointer-events: none; font-size: 54px; transform: translate(-50%, -50%); animation: spellPop .9s ease-out forwards; filter: drop-shadow(0 0 12px rgba(255, 255, 255, .8)); }
@keyframes spellPop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); } 30% { opacity: 1; transform: translate(-50%, -50%) scale(1.3); } 100% { opacity: 0; transform: translate(-50%, -70%) scale(1); } }

/* ---- обновление 20: старт новичка, календарь, путь сезона, событие, осколки, записи, бой с другом ---- */
.el-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.el-opt button { width: 100%; display: flex; flex-direction: column; gap: 6px; padding: 10px; color: var(--text); background: var(--surface-2, rgba(40, 20, 16, .8)); border: 1px solid var(--line-2); border-radius: 14px; cursor: pointer; text-align: left; font: inherit; transition: transform .15s, box-shadow .15s; }
.el-opt button:hover { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--gold), 0 8px 24px rgba(0, 0, 0, .4); }
.el-head { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.el-ico { font-size: 26px; }
.el-cards { display: flex; gap: 4px; }
.el-cards img { width: calc(25% - 3px); aspect-ratio: 352 / 688; object-fit: cover; border-radius: 6px; }
.el-opt small { font-size: 12px; line-height: 1.3; }
.goal-box { display: flex; align-items: center; gap: 12px; position: relative; z-index: 2; }
.goal-box .grow { min-width: 0; }
.goal-ico { font-size: 30px; flex: none; }
.duel-ready { color: var(--text); box-shadow: 0 0 0 2px var(--gold), 0 0 22px rgba(244, 180, 67, .35); }
.cal-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 10px 0; }
.cal-day { position: relative; display: flex; flex-direction: column; align-items: center; padding: 6px 0 4px; border-radius: 10px; background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; }
.cal-day small { font-size: 15px; line-height: 1.2; }
.cal-day.big { box-shadow: inset 0 0 0 1px var(--gold); background: rgba(244, 180, 67, .08); }
.cal-day.now { box-shadow: 0 0 0 2px var(--gold), 0 0 14px rgba(244, 180, 67, .5); animation: pulse 1.6s infinite; }
.cal-day.done { opacity: .55; }
.cal-day i { position: absolute; top: 1px; right: 4px; font-style: normal; color: #7fe08a; font-size: 12px; }
.pass-head { display: flex; gap: 14px; align-items: center; }
.pass-lv { display: flex; flex-direction: column; align-items: center; min-width: 70px; padding: 8px; border-radius: 14px; background: radial-gradient(circle, rgba(244, 180, 67, .25), transparent 70%); }
.pass-lv b { font-size: 34px; line-height: 1; color: var(--gold-2); }
.pass-track { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.pass-step { position: relative; display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; animation: fadeUp .3s both; animation-delay: calc(var(--i) * 30ms); }
.pass-step b { min-width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(0, 0, 0, .35); color: var(--gold-2); }
.pass-step.big { box-shadow: inset 0 0 0 1px var(--gold); background: rgba(244, 180, 67, .08); }
.pass-step.ready { box-shadow: 0 0 0 2px var(--gold); }
.pass-step.done { opacity: .5; }
.pass-step i { margin-left: auto; font-style: normal; }
.event-hero, .duel-hero { text-align: center; position: relative; overflow: hidden; }
.ev-badge { display: inline-flex; width: 56px; height: 56px; align-items: center; justify-content: center; border-radius: 50%; background: radial-gradient(circle, rgba(244, 180, 67, .4), rgba(244, 180, 67, .05)); color: var(--gold-2); font-size: 28px; }
.ev-badge .i { width: 30px; height: 30px; }
.event-hero h3, .duel-hero h3 { margin: 8px 0 4px; color: var(--gold-2); }
.shards-n { font-size: 26px; }
.el-tabs a { min-width: 40px; text-align: center; }
.invite-link { display: flex; gap: 6px; margin: 10px 0; }
.invite-link input { margin: 0; flex: 1; min-width: 0; font-size: 13px; }
.rp-names { font-size: 16px; }
.rp-p1 { color: #8fd0ff; font-weight: 700; }
.rp-p2 { color: #ff9d8a; font-weight: 700; }
.rp-board { position: relative; width: 100%; max-width: 420px; margin: 0 auto; aspect-ratio: 5 / 8.6; border-radius: 14px; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.rp-cell { position: absolute; width: 20%; height: 12.5%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05); }
.rp-cell.air { background: rgba(120, 170, 255, .06); }
.rp-cell.own { background: rgba(120, 200, 255, .03); }
.rp-unit { position: absolute; width: 20%; height: 12.5%; padding: 2px; transition: left .5s ease, top .5s ease, opacity .5s, filter .5s; }
.rp-board.instant .rp-unit { transition: none; }
.rp-unit img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; box-shadow: 0 0 0 2px #5aa8ff; }
.rp-unit.side2 img { box-shadow: 0 0 0 2px #ff6a55; }
.rp-hp { position: absolute; right: 3px; bottom: 3px; min-width: 20px; padding: 0 4px; border-radius: 10px; background: #b4241c; color: #fff; font-size: 12px; text-align: center; line-height: 18px; }
.rp-unit.low .rp-hp { animation: pulse 1s infinite; }
.rp-st { position: absolute; left: 3px; bottom: 3px; padding: 0 4px; border-radius: 8px; background: rgba(0, 0, 0, .7); font-size: 10px; color: var(--gold-2); }
.rp-el { position: absolute; right: 3px; top: 2px; font-size: 11px; }
.rp-unit.dead { opacity: 0; filter: grayscale(1); pointer-events: none; }
.rp-unit.hit img { animation: rpHit .5s; }
.rp-unit.heal img { animation: rpHeal .6s; }
@keyframes rpHit { 30% { transform: translateX(-4px); filter: brightness(2) sepia(1) hue-rotate(-40deg); } 60% { transform: translateX(4px); } }
@keyframes rpHeal { 40% { filter: brightness(1.6) sepia(1) hue-rotate(60deg); } }
.rp-controls { display: flex; justify-content: center; gap: 6px; margin: 10px 0 4px; flex-wrap: wrap; }
.rp-pos { width: 100%; max-width: 420px; display: block; margin: 4px auto; accent-color: var(--gold); }
.rp-turn { text-align: center; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.rp-log { max-height: 260px; overflow: auto; }
.rp-log .log-row { padding: 4px 8px; font-size: 13px; border-bottom: 1px solid var(--line); }
.rp-log .log-row.fresh { color: var(--gold-2); }
.rp-log .log-row.head { font-weight: 700; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ===== обновление 21: звук, тряска, оформление, аналитика ===== */
/* тряска поля при сильном ударе */
.quake-1 { animation: quake1 .32s ease-out; }
.quake-2 { animation: quake2 .42s ease-out; }
.quake-3 { animation: quake3 .52s ease-out; }
@keyframes quake1 { 0%, 100% { transform: none; } 20% { transform: translate(-3px, 2px); } 45% { transform: translate(3px, -2px); } 70% { transform: translate(-2px, 1px); } }
@keyframes quake2 { 0%, 100% { transform: none; } 12% { transform: translate(-7px, 4px) rotate(-.6deg); } 30% { transform: translate(6px, -4px) rotate(.5deg); } 50% { transform: translate(-4px, 3px); } 70% { transform: translate(3px, -1px); } 85% { transform: translate(-1px, 1px); } }
@keyframes quake3 { 0%, 100% { transform: none; filter: none; } 8% { transform: translate(-11px, 6px) rotate(-1deg) scale(1.01); filter: brightness(1.35); } 22% { transform: translate(10px, -7px) rotate(.9deg); } 38% { transform: translate(-7px, 5px) rotate(-.5deg); filter: brightness(1.1); } 55% { transform: translate(5px, -3px); } 72% { transform: translate(-3px, 2px); } 88% { transform: translate(1px, -1px); } }

/* настройки звука */
.audio-set { display: grid; gap: 12px; }
.range-row { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.range-row span { flex: 0 0 150px; }
.range-row input[type=range] { flex: 1; min-width: 0; accent-color: var(--gold); }
input.tgl { appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 26px; border-radius: 13px; background: #3a2618; box-shadow: inset 0 0 0 1px var(--line-2); position: relative; cursor: pointer; transition: background .2s; }
input.tgl::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #c9a77a; transition: transform .2s, background .2s; }
input.tgl:checked { background: linear-gradient(#ffd98a, #d08a2a); }
input.tgl:checked::after { transform: translateX(20px); background: #fff7e0; }
label.set-row { cursor: pointer; }

/* рубашки карт */
img.cback { display: block; width: 100%; height: auto; aspect-ratio: 264 / 380; border-radius: 7%; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .55)); }
img.cback.big { width: 108px; margin: 0 auto; }
img.cback.mini { width: 26px; display: inline-block; vertical-align: middle; border-radius: 3px; }
img.cback.live, .mm-fan img.live { animation: backLive 3.2s ease-in-out infinite; }
.mm-fan img.live { animation: fanIn .7s cubic-bezier(.2, 1.3, .4, 1) both, backLive 3.2s 1s ease-in-out infinite; }
@keyframes backLive { 0%, 100% { filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .55)) brightness(1) saturate(1); } 50% { filter: drop-shadow(0 0 10px rgba(255, 220, 140, .65)) brightness(1.18) saturate(1.35) hue-rotate(8deg); } }
.foe-fan { display: flex; justify-content: center; height: 64px; margin: 2px 0 6px; }
.foe-fan span { width: 40px; margin: 0 -9px; transform: rotate(calc(var(--k) * 7deg)) translateY(calc(var(--k) * var(--k) * 1.5px)); transform-origin: 50% 120%; animation: fanBob 2.4s ease-in-out infinite; animation-delay: calc(var(--k) * .15s); }
@keyframes fanBob { 50% { translate: 0 -3px; } }
.spell-slot.foe.back { padding: 2px; width: 34px; background: none; box-shadow: none; }

/* рамки аватара: кольца вокруг портрета */
img.ava.fr { background: radial-gradient(circle, #4a2c1c 0%, #1a0c07 72%); padding: 2px; filter: none; }
img.ava.fr-bronze { box-shadow: 0 0 0 3px #b8743e, 0 0 0 5px #4a2a14, 0 3px 8px rgba(0, 0, 0, .6); }
img.ava.fr-gold { box-shadow: 0 0 0 3px #f5c84c, 0 0 0 5px #7a5214, 0 0 0 6px #f5c84c, 0 0 12px rgba(245, 200, 76, .55); }
img.ava.fr-vine { box-shadow: 0 0 0 3px #3f9a37, 0 0 0 5px #173d12, 0 0 10px rgba(110, 220, 90, .45); outline: 2px dotted #9dff5a; outline-offset: 4px; }
img.ava.fr-frost { animation: frFrost 2.8s ease-in-out infinite; outline: 1px dashed rgba(220, 245, 255, .8); outline-offset: 5px; }
img.ava.fr-flame { animation: frFlame 1.1s ease-in-out infinite alternate; }
img.ava.fr-sun { animation: frSun 3s ease-in-out infinite; }
img.ava.fr-void { animation: frVoid 3.6s ease-in-out infinite; }
img.ava.fr-season { animation: frSeason 3s ease-in-out infinite; outline: 2px solid rgba(245, 200, 76, .7); outline-offset: 4px; }
img.ava.fr-champion { animation: frChamp 2.2s ease-in-out infinite; outline: 2px double #f5c84c; outline-offset: 5px; }
@keyframes frFrost { 0%, 100% { box-shadow: 0 0 0 3px #bfe9ff, 0 0 0 5px #2a6a8a, 0 0 8px 2px rgba(110, 200, 255, .45); } 50% { box-shadow: 0 0 0 3px #e8f8ff, 0 0 0 5px #3f8ab0, 0 0 18px 5px rgba(140, 220, 255, .8); } }
@keyframes frFlame { 0% { box-shadow: 0 0 0 3px #ff9a3a, 0 0 0 5px #7a1a06, 0 -4px 12px 3px rgba(255, 110, 30, .65); } 100% { box-shadow: 0 0 0 3px #ffd06a, 0 0 0 5px #a0280a, 0 -7px 20px 6px rgba(255, 70, 20, .85); } }
@keyframes frSun { 0%, 100% { box-shadow: 0 0 0 3px #fff1a0, 0 0 0 6px #d8a22a, 0 0 14px 4px rgba(255, 230, 140, .6); } 50% { box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px #ffcf4a, 0 0 28px 10px rgba(255, 240, 170, .85); } }
@keyframes frVoid { 0%, 100% { box-shadow: 0 0 0 3px #7a2ac0, 0 0 0 5px #12061f, 0 0 12px 3px rgba(150, 60, 255, .5), inset 0 0 14px rgba(120, 40, 220, .6); } 50% { box-shadow: 0 0 0 3px #c77dff, 0 0 0 5px #24083d, 0 0 24px 8px rgba(180, 90, 255, .75), inset 0 0 22px rgba(160, 60, 255, .9); } }
@keyframes frSeason { 0%, 100% { box-shadow: 0 0 0 3px #f5c84c, 0 0 0 5px #0f5a5a, 0 0 12px 3px rgba(60, 220, 210, .45); } 50% { box-shadow: 0 0 0 3px #3fe0d0, 0 0 0 5px #7a5214, 0 0 20px 6px rgba(245, 200, 76, .7); } }
@keyframes frChamp { 0%, 100% { box-shadow: 0 0 0 3px #f5c84c, 0 0 0 5px #8a0e0e, 0 0 0 7px #f5c84c, 0 0 14px 4px rgba(255, 80, 60, .5); } 50% { box-shadow: 0 0 0 3px #fff1b0, 0 0 0 5px #c41a1a, 0 0 0 7px #ffd98a, 0 0 26px 9px rgba(255, 120, 80, .8); } }

/* живые карты: перелив, свечение стихии, «дыхание» и искры */
.anim { --ac: #e0c8ff; }
.anim.el-fire { --ac: #ff7a2a; } .anim.el-water { --ac: #6fc8ff; } .anim.el-wood { --ac: #7fe05a; }
.anim.el-stone { --ac: #e0b47a; } .anim.el-shadow { --ac: #b46bff; } .anim.el-light { --ac: #fff0a0; }
.gcard.anim { isolation: isolate; }
.gcard.anim .gc-frame { animation: animAura 2.6s ease-in-out infinite; }
.gcard.anim .gc-frame::before { content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none; mix-blend-mode: soft-light;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .85) 46%, color-mix(in srgb, var(--ac) 70%, #fff) 52%, transparent 68%) no-repeat; background-size: 260% 100%; animation: animFoil 3.4s ease-in-out infinite; }
.gcard.anim .fc-img, .gcard.anim img.art { animation: animBreath 4s ease-in-out infinite; }
.gcard.anim::after { content: ""; position: absolute; left: 8%; right: 8%; top: 10%; height: 70%; z-index: 4; pointer-events: none;
  background: radial-gradient(circle, var(--ac) 0 1.5px, transparent 2.5px) 0 0 / 22px 26px, radial-gradient(circle, #fff 0 1px, transparent 2px) 11px 13px / 28px 30px;
  opacity: .0; animation: animSparks 3s linear infinite; mask-image: linear-gradient(transparent, #000 25%, #000 70%, transparent); -webkit-mask-image: linear-gradient(transparent, #000 25%, #000 70%, transparent); }
@keyframes animAura { 0%, 100% { box-shadow: 0 6px 16px rgba(0, 0, 0, .6), 0 0 8px 1px color-mix(in srgb, var(--ac) 45%, transparent); } 50% { box-shadow: 0 6px 16px rgba(0, 0, 0, .6), 0 0 22px 5px color-mix(in srgb, var(--ac) 75%, transparent); } }
@keyframes animFoil { 0% { background-position: 130% 0; } 55%, 100% { background-position: -30% 0; } }
@keyframes animBreath { 0%, 100% { filter: brightness(1) saturate(1); } 50% { filter: brightness(1.12) saturate(1.3); } }
@keyframes animSparks { 0% { background-position: 0 40px, 11px 60px; opacity: 0; } 20% { opacity: .9; } 80% { opacity: .8; } 100% { background-position: 0 -30px, 11px -20px; opacity: 0; } }
.unit.anim { animation: unitAnim 2.4s ease-in-out infinite; }
.unit.anim img { animation: animBreath 3s ease-in-out infinite; }
.unit.anim::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; mix-blend-mode: soft-light;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .9) 48%, transparent 66%) no-repeat; background-size: 260% 100%; animation: animFoil 3s ease-in-out infinite; }
@keyframes unitAnim { 0%, 100% { box-shadow: 0 0 4px 1px color-mix(in srgb, var(--ac) 50%, transparent); } 50% { box-shadow: 0 0 14px 4px color-mix(in srgb, var(--ac) 85%, transparent); } }
@media (prefers-reduced-motion: reduce) {
  .gcard.anim .gc-frame, .gcard.anim .gc-frame::before, .gcard.anim::after, .gcard.anim .fc-img, .unit.anim, .unit.anim::after, .unit.anim img, img.cback.live, img.ava.fr { animation: none !important; }
}

/* лавка оформления */
.style-intro small { display: block; text-align: center; }
.style-wallet { display: flex; gap: 16px; justify-content: center; margin-top: 8px; font-size: 15px; }
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 0 0 10px; }
.style-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px 10px; border-radius: 14px; text-align: center; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px var(--line); animation: fadeUp .3s both; }
.style-item.on { box-shadow: inset 0 0 0 2px var(--gold), 0 0 14px rgba(245, 200, 76, .25); }
.style-item .si-pic { min-height: 100px; display: flex; align-items: center; justify-content: center; padding: 8px; }
.style-item b { font-size: 14px; line-height: 1.2; }
.style-item small { font-size: 11.5px; line-height: 1.25; min-height: 2.5em; }
.si-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: auto; }
.tag.gold { color: #3a0e06; background: linear-gradient(#ffd98a, #d08a2a); border-color: #ffd98a; }
.style-cards .gcard { margin-bottom: 6px; }
.sc-act { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-top: 6px; }
.sc-act .btn { padding: 4px 8px; font-size: 12px; }
.sc-act .btn.on { color: var(--gold-2); }
.showcase .cards-row { justify-content: center; }
.showcase .sc-big { width: 170px; }
.sc-backrow { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 8px 0; }

/* золотой путь */
.gold-pass { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: linear-gradient(135deg, rgba(245, 200, 76, .16), rgba(60, 200, 190, .08)); box-shadow: inset 0 0 0 1px rgba(245, 200, 76, .55); }
.gold-pass .gp-badge { font-size: 34px; filter: drop-shadow(0 0 8px rgba(245, 200, 76, .7)); }
.gold-pass .grow { flex: 1 1 200px; }
.gold-pass small { display: block; color: var(--muted); margin-top: 2px; }
.pass-track.two { display: block; }
.pt-head, .pt-row { display: grid; grid-template-columns: 34px 1fr 1fr; gap: 6px; align-items: stretch; }
.pt-head { font-size: 12px; color: var(--muted); padding: 0 0 4px; }
.pt-row { margin-bottom: 6px; animation: fadeUp .3s both; animation-delay: calc(var(--i) * 30ms); }
.pt-lv { display: flex; align-items: center; justify-content: center; border-radius: 10px; background: rgba(0, 0, 0, .35); color: var(--muted); font-size: 14px; }
.pt-lv.on { color: #3a0e06; background: linear-gradient(#ffd98a, #d08a2a); }
.pt-row .pass-step { animation: none; font-size: 12.5px; }
.pass-step.gold { background: linear-gradient(135deg, rgba(245, 200, 76, .12), rgba(0, 0, 0, .2)); box-shadow: inset 0 0 0 1px rgba(245, 200, 76, .35); }
.pass-step.gold.big { box-shadow: inset 0 0 0 1px var(--gold), 0 0 10px rgba(245, 200, 76, .2); }
.pass-step.gold.locked { opacity: .62; }
.pass-step.gold img.ava { width: 30px; height: 30px; flex: none; }

/* аналитика */
.funnel { display: grid; gap: 6px; margin: 8px 0; }
.fn-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(60px, 1fr) 46px 74px; gap: 8px; align-items: center; font-size: 13px; padding: 4px 6px; border-radius: 8px; }
.fn-row.worst { background: rgba(226, 66, 27, .14); box-shadow: inset 0 0 0 1px rgba(226, 66, 27, .5); }
.fn-bar { height: 10px; border-radius: 5px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.fn-bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #d08a2a, #ffd98a); }
.fn-row b { text-align: right; }
.el-stats { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.el-stats span { padding: 3px 9px; border-radius: 999px; background: rgba(0, 0, 0, .3); font-size: 12.5px; box-shadow: inset 0 0 0 1px var(--line); }
.el-stats .hot, .wr-row.hot { box-shadow: inset 0 0 0 1px rgba(255, 90, 60, .7); background: rgba(255, 90, 60, .1); }
.el-stats .cold, .wr-row.cold { box-shadow: inset 0 0 0 1px rgba(90, 170, 255, .7); background: rgba(90, 170, 255, .1); }
.wr-table { display: grid; gap: 4px; margin: 8px 0; }
.wr-row { display: grid; grid-template-columns: minmax(0, 2.4fr) 46px 80px 70px 70px; gap: 6px; align-items: center; padding: 4px 6px; border-radius: 8px; font-size: 13px; }
.wr-row.head { color: var(--muted); font-size: 11.5px; }
.wr-card { display: flex; gap: 8px; align-items: center; min-width: 0; }
.wr-card img { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; flex: none; }
.wr-card span { display: flex; flex-direction: column; min-width: 0; }
.wr-card a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wr-v { position: relative; }
.wr-v i { display: block; height: 4px; border-radius: 2px; margin-top: 2px; background: linear-gradient(90deg, #5aa9d6, #ffd98a, #ff6a4a); }
@media (max-width: 520px) {
  .fn-row { grid-template-columns: minmax(0, 1fr) 40px 64px; }
  .fn-row .fn-bar { grid-column: 1 / -1; grid-row: 2; }
  .wr-row { grid-template-columns: minmax(0, 1fr) 38px 64px; }
  .wr-row > span:nth-child(4), .wr-row > span:nth-child(5) { display: none; }
  .range-row span { flex-basis: 120px; }
}

/* ===== обновление 21б: остатки старого дизайна ===== */
.chest img.chest-img { width: min(104px, 100%); height: auto; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .6)); }
.chest:not(.ready) img.chest-img { filter: grayscale(.85) brightness(.55) drop-shadow(0 4px 6px rgba(0, 0, 0, .6)); }
.chest.ready img.chest-img { filter: drop-shadow(0 0 12px rgba(245, 200, 76, .65)); }
.chest[data-chest="legendary"].ready img.chest-img { filter: drop-shadow(0 0 14px rgba(190, 110, 255, .8)); }
.chest[data-chest="rare"].ready img.chest-img { filter: drop-shadow(0 0 12px rgba(90, 170, 255, .75)); }
.chest > div small { display: block; min-height: 2.6em; line-height: 1.3; font-size: 13px; }
.chest .btn { padding-left: 4px; padding-right: 4px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chest .btn span[data-countdown] { font-variant-numeric: tabular-nums; }
.list img.ico.ico-wide { width: 58px; height: 40px; border-radius: 8px; object-fit: cover; box-shadow: 0 0 0 1px rgba(245, 200, 76, .35); }
.list img.ico.locked { filter: grayscale(1) brightness(.5); }
.hero-pic { display: inline-flex; gap: 6px; align-items: flex-end; justify-content: center; margin: 4px 0 8px; }
.hero-pic img { height: 120px; width: auto; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .6)); }
.hero-pic img + img { height: 100px; transform: scaleX(-1); opacity: .9; }
img.hero-ico { width: 140px; max-width: 60%; height: auto; margin: 4px auto 8px; display: block; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .6)); }
img.support-face { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; margin: 4px auto 8px; display: block; box-shadow: 0 0 0 3px #f5c84c, 0 0 0 5px #7a5214, 0 0 16px rgba(245, 200, 76, .45); }
.vs-badge { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin: 6px auto; border-radius: 50%; font-family: var(--font-display); font-size: 22px; font-weight: 700; color: #3a0e06;
  background: radial-gradient(circle at 35% 30%, #fff1b0, #f5c84c 45%, #b8741e); box-shadow: 0 0 0 2px #5a2a0a, 0 0 18px rgba(245, 160, 60, .6); }
.profile-acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.profile-acts .btn, .profile-acts form, .profile-acts form .btn { width: 100%; }
.profile-acts .btn { padding: 8px 4px; font-size: 12.5px; white-space: normal; line-height: 1.2; }

/* ---------- обновление 23: переходы без перезагрузки ---------- */
html.nav-busy::before { content: ""; position: fixed; z-index: 9999; left: 0; top: 0; height: 3px; width: 100%; background: linear-gradient(90deg, transparent, var(--gold, #f5c84c), #ff6a1f, transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: navbar 1s linear infinite; pointer-events: none; }
@keyframes navbar { from { background-position: -50% 0; } to { background-position: 150% 0; } }
html.nav-busy main.page { opacity: .72; transition: opacity .2s .1s; }

/* ---------- обновление 24: 10 видов поля боя (images/lands), выбираются случайно ---------- */
.board.bf-lava { background: linear-gradient(rgba(10, 5, 4, .38), rgba(10, 5, 4, .38)), url(../../images/lands/lava.webp) center / cover no-repeat, #1a0c0a; }
.board.bf-ice { background: linear-gradient(rgba(10, 5, 4, .38), rgba(10, 5, 4, .38)), url(../../images/lands/ice.webp) center / cover no-repeat, #1a0c0a; }
.board.bf-forest { background: linear-gradient(rgba(10, 5, 4, .38), rgba(10, 5, 4, .38)), url(../../images/lands/forest.webp) center / cover no-repeat, #1a0c0a; }
.board.bf-desert { background: linear-gradient(rgba(10, 5, 4, .38), rgba(10, 5, 4, .38)), url(../../images/lands/desert.webp) center / cover no-repeat, #1a0c0a; }
.board.bf-swamp { background: linear-gradient(rgba(10, 5, 4, .38), rgba(10, 5, 4, .38)), url(../../images/lands/swamp.webp) center / cover no-repeat, #1a0c0a; }
.board.bf-temple { background: linear-gradient(rgba(10, 5, 4, .38), rgba(10, 5, 4, .38)), url(../../images/lands/temple.webp) center / cover no-repeat, #1a0c0a; }
.board.bf-sky { background: linear-gradient(rgba(10, 5, 4, .38), rgba(10, 5, 4, .38)), url(../../images/lands/sky.webp) center / cover no-repeat, #1a0c0a; }
.board.bf-crystal { background: linear-gradient(rgba(10, 5, 4, .38), rgba(10, 5, 4, .38)), url(../../images/lands/crystal.webp) center / cover no-repeat, #1a0c0a; }
.board.bf-abyss { background: linear-gradient(rgba(10, 5, 4, .38), rgba(10, 5, 4, .38)), url(../../images/lands/abyss.webp) center / cover no-repeat, #1a0c0a; }
.board.bf-castle { background: linear-gradient(rgba(10, 5, 4, .38), rgba(10, 5, 4, .38)), url(../../images/lands/castle.webp) center / cover no-repeat, #1a0c0a; }
.board.bf .cell { background-color: rgba(0, 0, 0, .14); border-color: rgba(255, 230, 200, .16); }
.board.bf .cell.own { background-color: rgba(108, 196, 255, .07); }
.board.bf .cell.their { background-color: rgba(255, 100, 100, .06); }
.board.bf .cell.reach { background-color: rgba(95, 208, 104, .24); }
.f-land { text-align: center; font-size: 12px; color: var(--muted); margin: -2px 0 6px; display: flex; gap: 6px; align-items: center; justify-content: center; }
.f-land .i { width: 14px; height: 14px; color: var(--gold); }
#field.my-turn .unit.mine.ready { touch-action: none; cursor: grab; }
.battle-ghost .unit { width: 100%; height: 100%; }
.unit.target.drop-over { outline: 3px solid #ff5a3a; outline-offset: 2px; box-shadow: 0 0 22px rgba(255, 90, 58, .8); }
/* анимация раздачи карт не должна давать горизонтальную прокрутку на телефоне */
main.page { overflow-x: clip; }

/* ---------- обновление 25: бой на телефоне — лёгкие эффекты, поле не уезжает ---------- */
html, body { overflow-x: clip; }
#field { touch-action: pan-y; overflow-x: clip; }
/* заклинания соперника — маленькие рубашки в строке, а не на весь экран */
.f-spells .fs-h.foe { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; }
.spell-slot.foe { display: inline-flex; align-items: center; justify-content: center; width: 30px; min-height: 0; height: 42px; vertical-align: middle; font-size: 16px; cursor: default; }
.spell-slot.foe img.cback { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; border-radius: 4px; filter: none; }
.spell-slot.foe.used { opacity: .7; background: rgba(0, 0, 0, .35); }
/* подсветка «может ходить» и «цель» — через прозрачность (дёшево), а не анимацию фильтров и теней */
.unit.ready, .unit.target { animation: none !important; filter: none; }
.unit.ready::before, .unit.target::before { content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none; opacity: .45; animation: unitPulse 1.6s ease-in-out infinite; }
.unit.ready::before { box-shadow: inset 0 0 0 2px rgba(255, 210, 90, .95), inset 0 0 16px rgba(255, 190, 60, .8); }
.unit.target::before { box-shadow: inset 0 0 0 2px rgba(255, 70, 50, .95), inset 0 0 18px rgba(255, 60, 40, .85); animation-duration: 1s; }
.unit.target.shoot::before { box-shadow: inset 0 0 0 2px rgba(108, 196, 255, .95), inset 0 0 18px rgba(108, 196, 255, .8); }
@keyframes unitPulse { 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .unit.ready::before, .unit.target::before { animation: none; opacity: .8; } }

/* ---------- обновление 27: ровный ряд карт с прокруткой пальцем ---------- */
.cards-row.hrow { flex-wrap: nowrap; justify-content: safe center; align-items: stretch; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scroll-padding: 0 12px; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  touch-action: pan-x pan-y; scrollbar-width: none; padding: 10px 12px 14px; }
.cards-row.hrow::-webkit-scrollbar { display: none; }
.cards-row.hrow > * { flex: 0 0 auto; scroll-snap-align: center; }
.cards-row.hrow > .gcard { display: flex; flex-direction: column; }
.cards-row.hrow .fc-sub { align-content: flex-start; }
.cards-row.hrow .gcard > .inline-form, .cards-row.hrow .gcard > .btn, .cards-row.hrow .gcard > form { margin-top: auto; padding-top: 8px; }
.cards-row.hrow .slot-empty { align-self: flex-start; height: auto; aspect-ratio: 124 / 200; }
@media (pointer: fine) { .cards-row.hrow { scrollbar-width: thin; } .cards-row.hrow::-webkit-scrollbar { display: block; height: 6px; } .cards-row.hrow::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; } }
/* почта: строка диалога с кнопкой удаления */
.list > .mail-row { padding: 0 10px 0 0; gap: 6px; }
.mail-row > a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 4px 10px 14px; color: var(--text); }
.mail-row > a:hover { color: #fff; }
.mail-row .grow { min-width: 0; overflow-wrap: anywhere; }
.mail-row .mail-del { min-width: 36px; padding: 6px 0; }

