/* ============================================================ Новая Земля v6
   Оформление: тёмный металл и дерево, золотая оковка, пергамент.
   Все цвета — токены; текстуры — встроенный SVG-шум (без внешних файлов). */
:root {
    --bg: #0d0f14;
    --bg2: #151923;
    --panel: #1b2030;
    --panel2: #232a3d;
    --line: rgba(214, 178, 94, 0.28);
    --gold: #d8b25e;
    --gold2: #f3d98e;
    --gold3: #9c7631;
    --text: #efe6d2;
    --muted: #a59c8a;
    --dim: #6f6a60;
    --parch: #e9dcbc;
    --parch2: #d7c49a;
    --ink: #3a2a18;
    --red: #d14b3f;
    --red2: #8f2a22;
    --green: #5fb85a;
    --blue: #5b8fd6;
    --food: #e5a64a; --wood: #b07b46; --stone: #a9adb3; --iron: #8ea2b8; --gold-res: #f1c34e;
    --r: 14px;
    --top: env(safe-area-inset-top, 0px);
    --bottom: env(safe-area-inset-bottom, 0px);
    --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.035 .6' numOctaves='4' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .22 0 0 0 0 .08 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: var(--bg); overscroll-behavior: none; }
body { background: radial-gradient(120% 80% at 50% 0%, #1e2536 0%, var(--bg) 60%), var(--bg); background-attachment: fixed; }
body::before { content: ''; position: fixed; inset: 0; background: var(--noise); pointer-events: none; z-index: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }
.serif { font-family: 'Cormorant SC', 'Cormorant Garamond', Georgia, serif; letter-spacing: .02em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.gold { color: var(--gold2); }
.red { color: #ff7a6e; }
.green { color: #8fe08a; }

#app { position: fixed; inset: 0; display: flex; flex-direction: column; z-index: 1; }

/* ------------------------------------------------------------ рамки и панели */
.frame {
    position: relative; border-radius: var(--r);
    background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.18)), var(--panel);
    border: 1px solid var(--line);
    box-shadow: 0 0 0 1px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,236,180,.12), 0 8px 24px rgba(0,0,0,.45);
}
.frame.gilded { border: 1px solid rgba(216,178,94,.6); box-shadow: 0 0 0 1px #000, 0 0 0 3px rgba(216,178,94,.18), inset 0 1px 0 rgba(255,236,180,.2), 0 10px 30px rgba(0,0,0,.55); }
.parchment {
    color: var(--ink); border-radius: 10px;
    background: var(--grain), radial-gradient(120% 90% at 50% 20%, #f2e7c9 0%, var(--parch) 55%, var(--parch2) 100%);
    box-shadow: inset 0 0 30px rgba(120,80,30,.35), 0 0 0 1px rgba(90,60,20,.4);
}
.ribbon {
    position: relative; display: inline-flex; align-items: center; justify-content: center; padding: 6px 28px; min-height: 34px;
    font-family: 'Cormorant SC', Georgia, serif; font-weight: 700; font-size: 19px; color: #fff3d6; text-shadow: 0 1px 2px #000;
    background: linear-gradient(180deg, #a3332a, #6e1d17); border-top: 1px solid #e06a5c; border-bottom: 1px solid #3c0d0a;
    clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 50%, 100% 100%, 0 100%, 12px 50%);
}
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); margin: 10px 0; }

/* ------------------------------------------------------------ кнопки */
.btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px;
    border-radius: 10px; font-weight: 700; font-size: 15px; letter-spacing: .01em; white-space: nowrap; transition: transform .1s, filter .15s;
    color: #2a1a06; text-shadow: 0 1px 0 rgba(255,240,200,.5);
    background: linear-gradient(180deg, #ffe7a3 0%, #e9be5f 45%, #b98a35 100%);
    box-shadow: inset 0 1px 0 #fff4cc, inset 0 -2px 0 rgba(90,55,10,.55), 0 0 0 1px #5a3c10, 0 4px 10px rgba(0,0,0,.45);
}
.btn:active { transform: translateY(1px) scale(.98); filter: brightness(.95); }
.btn:disabled { filter: grayscale(.85) brightness(.7); cursor: not-allowed; }
.btn.steel { color: var(--text); text-shadow: 0 1px 1px #000; background: linear-gradient(180deg, #4c5874 0%, #323b52 55%, #252c3e 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18), inset 0 -2px 0 rgba(0,0,0,.4), 0 0 0 1px #0b0e15, 0 4px 10px rgba(0,0,0,.45); }
.btn.red { color: #fff1ea; text-shadow: 0 1px 1px #3a0602; background: linear-gradient(180deg, #e8735f 0%, #c03a2c 50%, #8e2219 100%);
    box-shadow: inset 0 1px 0 #ffb2a3, inset 0 -2px 0 rgba(60,5,0,.5), 0 0 0 1px #3d0b06, 0 4px 10px rgba(0,0,0,.45); }
.btn.green { color: #0f2a0c; text-shadow: 0 1px 0 rgba(220,255,200,.5); background: linear-gradient(180deg, #b6f08f 0%, #6cc04f 50%, #3f8a2f 100%);
    box-shadow: inset 0 1px 0 #e3ffd0, inset 0 -2px 0 rgba(15,50,5,.5), 0 0 0 1px #173a10, 0 4px 10px rgba(0,0,0,.45); }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn .badge { position: absolute; top: -6px; right: -6px; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; position: relative;
    background: linear-gradient(180deg, #303a52, #1c2232); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 0 0 1px rgba(216,178,94,.35), 0 3px 8px rgba(0,0,0,.5); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--gold2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: linear-gradient(180deg, #ff6b5c, #c52a1d); color: #fff;
    font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px #10131b; }
.badge.dot { min-width: 12px; width: 12px; height: 12px; padding: 0; }

/* ------------------------------------------------------------ верхняя панель */
.hud { position: relative; z-index: 5; padding: calc(var(--top) + 8px) 10px 6px; display: flex; flex-direction: column; gap: 6px;
    background: linear-gradient(180deg, rgba(8,10,15,.96), rgba(12,15,22,.88)); border-bottom: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0,0,0,.5); }
.hud-row { display: flex; align-items: center; gap: 10px; }
.lord { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; text-align: left; }
.lord-avatar { position: relative; width: 50px; height: 50px; flex: none; }
.lord-avatar img, .lord-avatar video { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; object-position: 50% 12%; box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--gold3); }
.lord-avatar .lvl { position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); min-width: 26px; height: 18px; padding: 0 6px; border-radius: 9px;
    font-size: 11px; font-weight: 800; color: #2a1a06; background: linear-gradient(180deg, #ffe7a3, #c9993f); box-shadow: 0 0 0 1px #000; display: grid; place-items: center; }
.lord-info { min-width: 0; }
.lord-name { font-family: 'Cormorant SC', Georgia, serif; font-weight: 700; font-size: 18px; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lord-sub { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.xpbar { width: 110px; height: 5px; border-radius: 3px; background: #0a0c11; box-shadow: inset 0 0 0 1px rgba(216,178,94,.25); overflow: hidden; margin-top: 3px; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, #8bd15d, #e8d36a); }
.hud-buttons { display: flex; gap: 8px; }
.res-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.res { position: relative; display: flex; align-items: center; justify-content: center; gap: 3px; height: 32px; padding: 0 4px 0 2px; border-radius: 8px; background: rgba(0,0,0,.45);
    box-shadow: inset 0 0 0 1px rgba(216,178,94,.18); min-width: 0; text-align: left; }
.res .ri { width: 22px; height: 22px; flex: none; }
.res b { font-size: 14px; font-weight: 800; white-space: nowrap; letter-spacing: -.01em; }
.res.full b { color: #ffb36b; }
.res .fill { position: absolute; left: 4px; right: 4px; bottom: 2px; height: 2px; border-radius: 1px; background: rgba(255,255,255,.08); overflow: hidden; }
.res .fill i { display: block; height: 100%; background: var(--c, var(--gold)); }

/* иконки ресурсов: картинка с запасом, подпись снизу обрезается */
.ri { display: inline-block; border-radius: 6px; overflow: hidden; position: relative; background: radial-gradient(circle at 40% 35%, rgba(255,255,255,.12), rgba(0,0,0,.3)); }
.ri img { position: absolute; left: 0; top: -2%; width: 100%; height: 128%; object-fit: cover; object-position: 50% 0; }
.ri.clean { background: none; }
.ri.clean img { top: 0; height: 100%; object-fit: contain; }

/* ------------------------------------------------------------ тревога и события */
.alert-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; font-weight: 700; font-size: 14px;
    background: linear-gradient(90deg, rgba(160,30,20,.95), rgba(110,20,14,.9)); box-shadow: 0 0 0 1px #ff6b5c66, 0 0 22px rgba(255,60,40,.35); animation: alarm 1.4s ease-in-out infinite; }
@keyframes alarm { 50% { box-shadow: 0 0 0 1px #ff6b5caa, 0 0 34px rgba(255,60,40,.6); } }
.event-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
    color: #ffe8b0; background: linear-gradient(90deg, rgba(120,70,10,.85), rgba(70,40,8,.85)); box-shadow: inset 0 0 0 1px rgba(255,210,120,.4); }

/* ------------------------------------------------------------ основная область */
.view { position: relative; flex: 1; overflow: hidden; }
.page { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 12px 180px; }
.page.full { padding: 0; overflow: hidden; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 2px 12px; }
.page-head h2 { font-family: 'Cormorant SC', Georgia, serif; font-size: 26px; font-weight: 700; color: var(--gold2); text-shadow: 0 2px 6px #000; }
.section-title { font-family: 'Cormorant SC', Georgia, serif; font-size: 19px; font-weight: 700; color: var(--gold2); margin: 18px 4px 8px; display: flex; align-items: center; gap: 10px; }
.section-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

/* ------------------------------------------------------------ нижняя навигация */
.nav { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px;
    padding: 6px 6px calc(var(--bottom) + 6px); background: linear-gradient(180deg, rgba(14,17,25,.9), rgba(6,8,12,.98)); border-top: 1px solid var(--line);
    box-shadow: 0 -8px 20px rgba(0,0,0,.6); }
.nav button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 4px; border-radius: 10px; color: var(--muted);
    font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.nav button svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav button.active { color: var(--gold2); background: radial-gradient(80% 90% at 50% 100%, rgba(216,178,94,.22), transparent 70%); }
.nav button.active::before { content: ''; position: absolute; top: -7px; left: 30%; right: 30%; height: 2px; border-radius: 2px; background: var(--gold2); box-shadow: 0 0 10px var(--gold); }
.nav .badge { position: absolute; top: 2px; right: calc(50% - 22px); }

/* ------------------------------------------------------------ город */
.city-scene { position: relative; isolation: isolate; width: 100%; max-width: 760px; margin-left: auto; margin-right: auto; aspect-ratio: 1 / 1; border-radius: var(--r); overflow: hidden; }
.city-scene > .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.city-scene::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 80px rgba(0,0,0,.65); }
.spot { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; z-index: 2; }
.spot .tag { padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; background: rgba(8,10,15,.82); box-shadow: inset 0 0 0 1px rgba(216,178,94,.35); white-space: nowrap; }
.spot .tag b { color: var(--gold2); }
.spot .busy { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 6px; border-radius: 999px; font-size: 10.5px; font-weight: 800; font-variant-numeric: tabular-nums;
    color: #0c1a2a; background: linear-gradient(180deg, #bfe6ff, #6fb2e6); box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.spot .busy svg { stroke: #0c1a2a; fill: none; stroke-width: 2.4; }
.spot .tag.building { box-shadow: inset 0 0 0 1px rgba(127,190,240,.85), 0 0 10px rgba(111,178,230,.35); }
.spot .tag.building b { color: #a9d8ff; }
.buildings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.bcard { position: relative; overflow: hidden; border-radius: 12px; text-align: left; padding: 0; display: flex; flex-direction: column; }
.bcard .art { position: relative; aspect-ratio: 1 / .78; overflow: hidden; background: #0b0d12; }
.bcard .art img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.bcard:hover .art img { transform: scale(1.05); }
.bcard .art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(5,6,9,.92)); }
.bcard .lv { position: absolute; top: 8px; left: 8px; z-index: 1; min-width: 30px; height: 26px; padding: 0 8px; border-radius: 13px; display: grid; place-items: center;
    font-weight: 800; font-size: 13px; color: #2a1a06; background: linear-gradient(180deg, #ffe7a3, #c9993f); box-shadow: 0 0 0 1px #000, 0 2px 6px rgba(0,0,0,.6); }
.bcard .lv.zero { color: var(--muted); background: #20263a; box-shadow: 0 0 0 1px rgba(216,178,94,.3); }
.bcard .info { position: relative; padding: 8px 10px 10px; margin-top: -30px; z-index: 1; }
.bcard .info h4 { font-family: 'Cormorant SC', Georgia, serif; font-size: 17px; font-weight: 700; line-height: 1.1; }
.bcard .info small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; min-height: 15px; }
.bcard .up { position: absolute; top: 8px; right: 8px; z-index: 1; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
    background: linear-gradient(180deg, #9cf27a, #3f9a2f); box-shadow: 0 0 0 1px #0d2a09, 0 0 12px rgba(120,255,90,.6); animation: bob 1.6s ease-in-out infinite; }
.bcard .up svg { width: 14px; height: 14px; stroke: #10300b; stroke-width: 3; fill: none; }
@keyframes bob { 50% { transform: translateY(-3px); } }
.bcard.building .art::before { content: ''; position: absolute; inset: 0; z-index: 1; background: repeating-linear-gradient(-45deg, rgba(91,143,214,.12) 0 10px, transparent 10px 20px); }
.bcard.locked { opacity: .55; }
.timerbar { position: relative; height: 18px; border-radius: 9px; overflow: hidden; background: #090b10; box-shadow: inset 0 0 0 1px rgba(91,143,214,.45); }
.timerbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #7fb6ff, #3a6fc0); }
.timerbar span { position: relative; display: block; text-align: center; font-size: 11px; font-weight: 800; line-height: 18px; text-shadow: 0 1px 2px #000; }

/* очереди */
.queues { display: flex; flex-direction: column; gap: 8px; }
.qitem { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.qitem .qi { width: 42px; height: 42px; border-radius: 9px; overflow: hidden; flex: none; box-shadow: 0 0 0 1px rgba(216,178,94,.35); }
.qitem .qi img { width: 100%; height: 100%; object-fit: cover; }
.qitem .qbody { flex: 1; min-width: 0; }
.qitem .qtitle { font-size: 13px; font-weight: 700; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qitem .qact { display: flex; gap: 6px; }

/* ------------------------------------------------------------ карточки юнитов */
.units-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.ucard { position: relative; border-radius: 12px; overflow: hidden; text-align: left; display: flex; flex-direction: column; }
.ucard .portrait { position: relative; aspect-ratio: 1 / 1.05; background: #0b0d12; overflow: hidden; }
.ucard .portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.ucard .portrait::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25), transparent 30%, transparent 55%, rgba(5,6,9,.95)); }
.ucard .tier { position: absolute; top: 8px; left: 8px; z-index: 1; font-family: 'Cormorant SC', Georgia, serif; font-weight: 700; font-size: 15px; color: var(--gold2); text-shadow: 0 1px 3px #000; }
.ucard .ulv { position: absolute; top: 8px; right: 8px; z-index: 1; display: flex; gap: 2px; }
.ucard .ulv i { width: 5px; height: 12px; border-radius: 1px; background: rgba(255,255,255,.15); }
.ucard .ulv i.on { background: linear-gradient(180deg, #ffe7a3, #c9993f); box-shadow: 0 0 6px rgba(255,210,120,.6); }
.ucard .ubody { position: relative; z-index: 1; margin-top: -44px; padding: 8px 10px 10px; }
.ucard h4 { font-family: 'Cormorant SC', Georgia, serif; font-size: 17px; font-weight: 700; line-height: 1.1; }
.ucard .count { font-size: 12px; color: var(--muted); }
.ucard .count b { color: var(--text); font-size: 14px; }
.ucard.elite { box-shadow: 0 0 0 1px #000, 0 0 0 2px #b87cff88, 0 0 24px rgba(184,124,255,.25); }
.ucard.locked .portrait img { filter: grayscale(1) brightness(.45); }
.ucard .lock { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 30% 10px 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 6px; }
.stat { text-align: center; padding: 4px 0; border-radius: 6px; background: rgba(0,0,0,.35); font-size: 12px; font-weight: 700; }
.stat small { display: block; font-size: 9.5px; color: var(--muted); font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.stat-btn { border: 0; color: inherit; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(243,217,142,.35); }
.stat-btn small svg { width: 11px; height: 11px; vertical-align: -1px; }
.rate-bd dt small { font-weight: 600; }
.msg .mtime { float: right; margin-left: 8px; font-size: 10.5px; color: var(--muted); font-weight: 500; }
.cls-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; background: rgba(0,0,0,.4); box-shadow: inset 0 0 0 1px rgba(216,178,94,.25); }

/* ------------------------------------------------------------ модальное окно */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; padding-top: calc(var(--top) + 10px); background: rgba(3,4,7,.8); animation: fade .18s; }
@media (hover: hover) and (min-width: 1000px) { html:not(.lite) .modal { background: rgba(3,4,7,.72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); } }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 560px; max-height: 100%; display: flex; flex-direction: column; border-radius: 20px 20px 0 0; animation: up .25s cubic-bezier(.2,.9,.3,1); overflow: hidden; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-head { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 54px 12px 16px; border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255,236,180,.06), transparent); }
.sheet-head h3 { font-family: 'Cormorant SC', Georgia, serif; font-size: 23px; font-weight: 700; color: var(--gold2); line-height: 1.05; }
.sheet-head small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.sheet-close { position: absolute; z-index: 3; right: 10px; top: 10px; touch-action: manipulation; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.45); box-shadow: inset 0 0 0 1px rgba(216,178,94,.4); }
.sheet-close svg { width: 16px; height: 16px; stroke: var(--gold2); stroke-width: 2.4; fill: none; }
.sheet-body { overflow-y: auto; padding: 14px 16px calc(var(--bottom) + 18px); -webkit-overflow-scrolling: touch; }
@media (min-width: 700px) { .modal { align-items: center; } .sheet { border-radius: 20px; max-height: 86vh; } }
.hero-art { position: relative; height: 170px; margin: -14px -16px 12px; overflow: hidden; }
.hero-art img, .hero-art video { width: 100%; height: 100%; object-fit: cover; }
.hero-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, var(--panel)); }

/* стоимость */
.cost { display: flex; flex-wrap: wrap; gap: 6px; }
.cost span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px 3px 3px; border-radius: 7px; background: rgba(0,0,0,.38); font-size: 13px; font-weight: 700; }
.cost span .ri { width: 20px; height: 20px; }
.cost span.lack { color: #ff8b80; box-shadow: inset 0 0 0 1px rgba(255,107,92,.5); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { font-weight: 700; text-align: right; }
.req { padding: 8px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; background: rgba(209,75,63,.14); color: #ffb0a8; box-shadow: inset 0 0 0 1px rgba(209,75,63,.4); }
.actions { display: flex; gap: 8px; margin-top: 14px; }
.actions .btn { flex: 1; }

/* слайдер количества */
.qty { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.qty input[type=range] { flex: 1; accent-color: var(--gold); }
.qty input[type=number] { width: 84px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: #0b0d12; text-align: center; font-weight: 700; }

/* ------------------------------------------------------------ карта */
.map-wrap { position: absolute; inset: 0; background: #0b1410; touch-action: none; }
.map-wrap canvas { width: 100%; height: 100%; display: block; }
.map-wrap::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.5)); }
.map-ui { position: absolute; left: 10px; right: 10px; top: 10px; display: flex; gap: 8px; align-items: center; pointer-events: none; z-index: 2; }
.map-ui > * { pointer-events: auto; }
.coords { padding: 7px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; background: rgba(8,10,15,.85); box-shadow: inset 0 0 0 1px rgba(216,178,94,.35); }
.map-tools { position: absolute; right: 10px; bottom: 96px; display: flex; flex-direction: column; gap: 8px; z-index: 2; }
.march-list { position: absolute; left: 10px; bottom: 96px; display: flex; flex-direction: column; gap: 6px; z-index: 2; max-width: 62%; }
.march-chip { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; font-size: 12px; font-weight: 700; background: rgba(8,10,15,.88); box-shadow: inset 0 0 0 1px rgba(216,178,94,.3); text-align: left; }
.march-chip.hostile { box-shadow: inset 0 0 0 1px rgba(255,107,92,.7); color: #ffc1ba; }
.march-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); flex: none; }
.march-chip.hostile i { background: var(--red); }

/* выбор армии для похода */
.army-pick { display: flex; flex-direction: column; gap: 8px; }
.army-row { display: grid; grid-template-columns: 44px 1fr 96px; gap: 10px; align-items: center; padding: 6px; border-radius: 10px; background: rgba(0,0,0,.28); }
.army-row img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; object-position: 50% 20%; }
.army-row b { font-size: 13px; display: block; }
.army-row small { font-size: 11.5px; color: var(--muted); }
.army-row input { width: 100%; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #0b0d12; text-align: center; font-weight: 700; }

/* ------------------------------------------------------------ списки, вкладки */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(0,0,0,.4); box-shadow: inset 0 0 0 1px rgba(216,178,94,.2); margin-bottom: 12px; overflow-x: auto; }
.tabs button { flex: 1; min-width: max-content; padding: 8px 12px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.tabs button.active { color: #2a1a06; background: linear-gradient(180deg, #ffe7a3, #c9993f); box-shadow: 0 0 0 1px #000; }
.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; text-align: left; width: 100%; }
.row .av { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: none; box-shadow: 0 0 0 2px var(--gold3); }
.row .av img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; }
.row .grow { flex: 1; min-width: 0; }
.row .grow b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .grow small { color: var(--muted); font-size: 12px; }
.row .pos { width: 30px; text-align: center; font-family: 'Cormorant SC', Georgia, serif; font-weight: 700; font-size: 20px; color: var(--muted); }
.row.me { box-shadow: 0 0 0 1px var(--gold), 0 0 18px rgba(216,178,94,.2); }
.online-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #5bd35a; box-shadow: 0 0 6px #5bd35a; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 14px; }

/* отчёты */
.report { padding: 12px; border-radius: 12px; }
.report.unread { box-shadow: 0 0 0 1px var(--gold), 0 6px 18px rgba(0,0,0,.4); }
.report h4 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.report time { font-size: 12px; color: var(--muted); }
.report .tag { padding: 1px 7px; border-radius: 5px; font-size: 11px; font-weight: 800; }
.tag.win { background: rgba(95,184,90,.2); color: #9be096; }
.tag.loss { background: rgba(209,75,63,.22); color: #ff9c92; }
.tag.info { background: rgba(91,143,214,.2); color: #a9c8ff; }
.battle-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 8px; }
.battle-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 4px 4px; border-bottom: 1px solid var(--line); }
.battle-table td { padding: 4px 4px; border-bottom: 1px solid rgba(255,255,255,.04); }
.battle-table td.n { text-align: right; font-variant-numeric: tabular-nums; }
.versus { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; text-align: center; margin: 8px 0; }
.versus .side img, .versus .side video { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; object-position: 50% 12%; margin: 0 auto 4px; box-shadow: 0 0 0 2px var(--gold3); }
.versus .vs { font-family: 'Cormorant SC', Georgia, serif; font-size: 26px; color: var(--red); font-weight: 700; }

/* ------------------------------------------------------------ ежедневное */
.login-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.lday { position: relative; padding: 8px 2px 6px; border-radius: 10px; text-align: center; font-size: 11px; font-weight: 700; background: rgba(0,0,0,.35); box-shadow: inset 0 0 0 1px rgba(216,178,94,.2); }
.lday .d { font-family: 'Cormorant SC', Georgia, serif; font-size: 15px; color: var(--gold2); }
.lday.done { opacity: .5; }
.lday.today { background: linear-gradient(180deg, rgba(216,178,94,.35), rgba(120,80,20,.25)); box-shadow: inset 0 0 0 1px var(--gold2), 0 0 16px rgba(216,178,94,.35); }
.lday.big { grid-column: span 1; }
.quest { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; }
.quest .qtxt { flex: 1; font-size: 14px; font-weight: 600; }
.quest .prog { height: 6px; border-radius: 3px; background: #0a0c11; overflow: hidden; margin-top: 6px; }
.quest .prog i { display: block; height: 100%; background: linear-gradient(90deg, #6cc04f, #e8d36a); }
.quest .pts { font-family: 'Cormorant SC', Georgia, serif; font-weight: 700; color: var(--gold2); font-size: 16px; white-space: nowrap; }
.quest.done { opacity: .6; }
.chests { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chest { padding: 10px 6px; border-radius: 12px; text-align: center; font-size: 12px; font-weight: 700; }
.chest .ci { font-size: 30px; line-height: 1; filter: drop-shadow(0 2px 4px #000); }
.chest.ready { box-shadow: 0 0 0 1px var(--gold2), 0 0 20px rgba(216,178,94,.4); animation: bob 1.6s ease-in-out infinite; }
.chest.open { opacity: .45; }
.pointsbar { position: relative; height: 12px; border-radius: 6px; background: #0a0c11; box-shadow: inset 0 0 0 1px rgba(216,178,94,.3); overflow: hidden; margin: 8px 0 12px; }
.pointsbar i { display: block; height: 100%; background: linear-gradient(90deg, #c9993f, #ffe7a3); }

/* главное задание */
.mainquest { position: absolute; left: 10px; right: 10px; bottom: calc(var(--bottom) + 80px); z-index: 5; display: flex; align-items: center; gap: 10px; padding: 8px 10px; text-align: left; }
.mainquest .mq-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: linear-gradient(180deg, #ffe7a3, #b98a35); box-shadow: 0 0 0 1px #000; }
.mainquest .mq-ico svg { width: 18px; height: 18px; stroke: #3a2508; fill: none; stroke-width: 2.2; }
.mainquest .mq-text { flex: 1; font-size: 13px; font-weight: 700; line-height: 1.25; }
.mainquest .mq-text small { display: block; color: var(--muted); font-weight: 600; font-size: 11px; }
.mainquest.ready { box-shadow: 0 0 0 1px var(--gold2), 0 0 20px rgba(216,178,94,.5); }

/* ------------------------------------------------------------ чат */
.chat { display: flex; flex-direction: column; height: 60vh; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 4px 2px 10px; }
.msg { max-width: 86%; padding: 7px 10px; border-radius: 12px; background: rgba(0,0,0,.4); font-size: 14px; line-height: 1.35; }
.msg b { display: block; font-size: 12px; color: var(--gold2); margin-bottom: 1px; }
.msg.me { align-self: flex-end; background: rgba(216,178,94,.16); }
.msg.sys { align-self: center; background: none; color: var(--muted); font-size: 12.5px; font-style: italic; text-align: center; }
.chat-input { display: flex; gap: 8px; }
.chat-input input { flex: 1; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: #0b0d12; padding: 0 12px; }

/* ------------------------------------------------------------ вход и выбор расы */
.auth { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 20px; overflow-y: auto; }
.auth-bg { position: fixed; inset: 0; z-index: -1; }
.auth-bg img, .auth-bg video { width: 100%; height: 100%; object-fit: cover; filter: blur(2px) brightness(.45) saturate(1.1); transform: scale(1.06); }
.auth-bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(70% 60% at 50% 40%, transparent, rgba(5,6,9,.85)); }
.auth-card { width: 100%; max-width: 400px; padding: 26px 22px 22px; text-align: center; }
.logo { font-family: 'Cormorant SC', Georgia, serif; font-weight: 700; font-size: 44px; line-height: .95; color: var(--gold2);
    text-shadow: 0 2px 0 #4a3210, 0 0 30px rgba(216,178,94,.35), 0 6px 18px #000; letter-spacing: .04em; }
.logo small { display: block; font-size: 15px; color: var(--muted); letter-spacing: .3em; margin-top: 6px; text-shadow: none; }
.crest { width: 84px; height: 84px; margin: 0 auto 10px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--gold3), 0 0 30px rgba(216,178,94,.35); }
.crest img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.field { display: flex; flex-direction: column; gap: 5px; text-align: left; margin-top: 12px; }
.field label { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.field input { height: 46px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.5); padding: 0 14px; font-size: 16px; outline: none; }
.field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(216,178,94,.2); }
.error { color: #ff8b80; font-size: 13px; font-weight: 600; min-height: 18px; margin-top: 8px; }

.races { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; width: 100%; max-width: 900px; }
@media (min-width: 820px) { .races { grid-template-columns: repeat(4, 1fr); } }
.race-card { position: relative; border-radius: 16px; overflow: hidden; text-align: left; aspect-ratio: 3 / 4.6; display: flex; flex-direction: column; justify-content: flex-end; transition: transform .2s; }
.race-card .portrait { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 66%; object-fit: cover; object-position: 50% 0; }
.race-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 38%, rgba(5,6,9,.9) 60%, rgba(5,6,9,.98) 100%); }
.race-card .rbody { position: relative; z-index: 1; padding: 12px; }
.race-card h3 { font-family: 'Cormorant SC', Georgia, serif; font-size: 25px; font-weight: 700; color: var(--gold2); line-height: 1; }
.race-card .rt { font-size: 12px; color: var(--muted); margin: 2px 0 8px; }
.race-card ul { list-style: none; display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 600; }
.race-card li::before { content: '◆ '; color: var(--gold); font-size: 9px; }
.race-card li.weak::before { color: var(--red); }
.race-card.sel { transform: translateY(-4px); box-shadow: 0 0 0 2px var(--gold2), 0 0 30px rgba(216,178,94,.45); }

/* ------------------------------------------------------------ всплывающие */
.toast { position: fixed; left: 50%; top: calc(var(--top) + 96px); z-index: 80; transform: translate(-50%, -10px); opacity: 0; pointer-events: none; transition: .25s;
    max-width: 90%; padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 700; text-align: center;
    background: linear-gradient(180deg, #2a3248, #1a1f2d); box-shadow: 0 0 0 1px rgba(216,178,94,.5), 0 10px 30px rgba(0,0,0,.6); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { box-shadow: 0 0 0 1px rgba(255,107,92,.7), 0 10px 30px rgba(0,0,0,.6); color: #ffc1ba; }
.reward-pop { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px 0; }
.reward-pop span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; background: rgba(0,0,0,.4); font-weight: 800; box-shadow: inset 0 0 0 1px rgba(216,178,94,.35); }
.reward-pop .ri { width: 26px; height: 26px; }

/* широкий экран: контент по центру */
@media (min-width: 1000px) {
    .page { padding-left: max(12px, calc(50% - 520px)); padding-right: max(12px, calc(50% - 520px)); }
    .nav { left: 50%; right: auto; width: 640px; transform: translateX(-50%); border-radius: 18px 18px 0 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
    .mainquest { left: 50%; right: auto; width: 560px; transform: translateX(-50%); }
    .hud { padding-left: max(10px, calc(50% - 520px)); padding-right: max(10px, calc(50% - 520px)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* арена: шапка без картинки */
.arena-head { position: relative; overflow: hidden; padding: 18px 14px 14px; background:
    radial-gradient(60% 90% at 50% 0%, rgba(209,75,63,.35), transparent 70%),
    linear-gradient(180deg, rgba(255,236,180,.06), transparent), var(--panel); }
.arena-head .arena-art { position: absolute; inset: 0; }
.arena-head .arena-art img { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.arena-head .arena-stats { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 1000px) { .hud .res b { font-size: 14px; } .res { height: 34px; } .res .ri { width: 28px; height: 28px; } }

/* iPhone, приложение на экране «Домой»: строка состояния прозрачная (black-translucent),
   а 100% высоты у iOS короче экрана — снизу оставалась чёрная полоса. Берём полную высоту экрана. */
@media (display-mode: standalone) {
    html, body { height: 100vh; }
    #app, .modal, .auth { bottom: auto; height: 100vh; }
}

/* прогноз боя */
.forecast { padding: 10px 12px; }
.fc-chance { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.fc-chance b { font-family: 'Cormorant SC', Georgia, serif; font-size: 30px; line-height: 1; }
.fc-chance span { font-weight: 700; font-size: 14px; }
.forecast.good .fc-chance b, .forecast.good .fc-chance span { color: #8fe08a; }
.forecast.mid .fc-chance b, .forecast.mid .fc-chance span { color: #f3d98e; }
.forecast.bad .fc-chance b, .forecast.bad .fc-chance span { color: #ff8b80; }
.fc-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: #0a0c11; }
.fc-bar i { background: linear-gradient(90deg, #3a6fc0, #7fb6ff); }
.fc-bar em { background: linear-gradient(90deg, #ff6b5c, #a3332a); }
.fc-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-top: 6px; }
.ico { display: inline-block; vertical-align: -2px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lday-ico { height: 30px; display: grid; place-items: center; margin-top: 2px; color: var(--gold2); }
.chest .ci { line-height: 0; }
.versus .vs .ico { stroke: var(--red); }
.cls-role { font-size: 13px; line-height: 1.45; color: var(--text); margin: -2px 4px 10px; opacity: .9; }
.locked-cls { padding: 14px; font-size: 13.5px; color: var(--muted); }
.triangle { padding: 10px 12px; margin-bottom: 4px; }
.triangle summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none; }
.triangle summary::-webkit-details-marker { display: none; }
.tri-svg { width: 100%; max-width: 340px; display: block; margin: 8px auto; }
.cls-pill.red { color: #ff9c92; }

/* задание в шапке */
.quest-bar { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 6px 0 4px; border-radius: 10px; text-align: left; width: 100%;
    background: linear-gradient(90deg, rgba(216,178,94,.18), rgba(216,178,94,.05)); box-shadow: inset 0 0 0 1px rgba(216,178,94,.35); }
.quest-bar.ready { background: linear-gradient(90deg, rgba(95,184,90,.3), rgba(95,184,90,.08)); box-shadow: inset 0 0 0 1px rgba(143,224,138,.6); }
.qb-ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: linear-gradient(180deg, #ffe7a3, #b98a35); }
.qb-ico svg { width: 15px; height: 15px; stroke: #3a2508; fill: none; stroke-width: 2.2; }
.qb-text { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qb-text small { color: var(--gold2); font-weight: 800; margin-right: 6px; }
.qb-go { flex: none; font-size: 12px; font-weight: 800; padding: 4px 9px; border-radius: 7px; color: #2a1a06; background: linear-gradient(180deg, #ffe7a3, #c9993f); }
.qb-go.green { color: #0f2a0c; background: linear-gradient(180deg, #b6f08f, #5fae45); }

/* советник и подсветка */
.advisor { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; }
.advisor img, .advisor video { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; object-position: 50% 12%; flex: none; box-shadow: 0 0 0 2px var(--gold3); }
.advisor p { font-size: 14px; line-height: 1.45; padding: 9px 12px; border-radius: 4px 12px 12px 12px; background: rgba(0,0,0,.35); box-shadow: inset 0 0 0 1px rgba(216,178,94,.25); }
.pulse { animation: pulse 1s ease-in-out infinite; z-index: 3; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 2px #8fe08a, 0 0 0 6px rgba(143,224,138,.25); } 50% { box-shadow: 0 0 0 3px #b6f08f, 0 0 0 12px rgba(143,224,138,.1); } }
.spot.pulse .tag { box-shadow: 0 0 0 2px #8fe08a; }
.htp-ico { width: 72px; height: 72px; margin: 4px auto 10px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, rgba(216,178,94,.25), transparent 70%); }
.htp-ico svg { width: 40px; height: 40px; fill: none; stroke: var(--gold2); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.htp-dots { display: flex; justify-content: center; gap: 6px; }
.htp-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.18); }
.htp-dots i.on { background: var(--gold2); }

/* кнопка «наверх» */
.to-top { position: absolute; right: 14px; bottom: calc(var(--bottom) + 84px); z-index: 6; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
    background: linear-gradient(180deg, #303a52, #1c2232); box-shadow: 0 0 0 1px rgba(216,178,94,.5), 0 6px 16px rgba(0,0,0,.6); }
.to-top svg { width: 22px; height: 22px; fill: none; stroke: var(--gold2); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* переключатели */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: rgba(0,0,0,.4); box-shadow: inset 0 0 0 1px rgba(216,178,94,.25); flex: none; }
.seg button { padding: 6px 9px; border-radius: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
.seg button.on { color: #2a1a06; background: linear-gradient(180deg, #ffe7a3, #c9993f); }
.seg.wide { display: flex; } .seg.wide button { flex: 1; }
button.event-chip { cursor: pointer; }

/* город: новые и будущие здания */
.bcard.new { box-shadow: 0 0 0 1px rgba(143,224,138,.55), 0 8px 24px rgba(0,0,0,.45); }
.bcard .lv.zero { font-size: 10px; text-transform: uppercase; color: #0f2a0c; background: linear-gradient(180deg, #b6f08f, #5fae45); }
.spot .tag.new { box-shadow: inset 0 0 0 1px rgba(143,224,138,.8); }
.spot .tag.new b { color: #8fe08a; }
.soon { display: flex; align-items: center; gap: 12px; padding: 10px 12px; font-size: 13.5px; }
.soon-icons { display: flex; flex: none; }
.soon-icons img { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; margin-left: -10px; box-shadow: 0 0 0 2px var(--panel); filter: grayscale(.6) brightness(.7); }
.soon-icons img:first-child { margin-left: 0; }

/* профиль */
.profile-top { display: flex; gap: 14px; align-items: center; }
.profile-top img, .profile-top video { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; object-position: 50% 12%; box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--gold3); }
.profile-menu { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 16px; }
.profile-menu .btn { width: 100%; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-menu .btn.red { grid-column: 1 / -1; }
.invite-card { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left; color: inherit;
    background: linear-gradient(135deg, rgba(95,174,69,.22), rgba(216,178,94,.12)); box-shadow: inset 0 0 0 1px rgba(143,224,138,.45); }
.invite-card .ic { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #1a1206; background: linear-gradient(180deg, #ffe08a, #e0a83a); }
.invite-card .ic svg { stroke: #1a1206; }
.invite-card b { display: block; font-size: 15px; }
.invite-card small { color: #bfe6b0; font-size: 12.5px; }
.invite-card > svg { stroke: var(--gold2); fill: none; stroke-width: 2.2; flex: none; }

/* лёгкий режим для слабых устройств */
html.lite body::before { display: none; }
html.lite .modal { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(3,4,7,.85); }
html.lite *, html.lite *::before, html.lite *::after { animation: none !important; transition: none !important; }
html.lite .frame, html.lite .frame.gilded { box-shadow: 0 0 0 1px rgba(0,0,0,.6); }
html.lite .btn { box-shadow: 0 0 0 1px #5a3c10; }
html.lite .city-scene::after, html.lite .map-wrap::after { display: none; }
html.lite .pulse { box-shadow: 0 0 0 3px #8fe08a !important; }
.fc-note { font-size: 12.5px; line-height: 1.4; margin-top: 8px; padding: 6px 8px; border-radius: 8px; background: rgba(209,75,63,.12); color: #ffc1ba; }
.link-btn { display: block; margin: 10px auto 0; font-size: 13.5px; font-weight: 700; color: var(--gold2); text-decoration: underline; text-underline-offset: 3px; }
.or { display: flex; align-items: center; gap: 10px; margin: 16px 0 10px; color: var(--muted); font-size: 12px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.oauth-row { display: flex; gap: 8px; flex-wrap: wrap; }
.oauth-row .btn { flex: 1; min-width: 96px; text-decoration: none; }
.btn.oauth.vk { background: linear-gradient(180deg, #2c7bf2, #0b57c5); color: #fff; }
.btn.oauth.yandex { background: linear-gradient(180deg, #ff4d33, #d42a12); color: #fff; }
.btn.oauth.mailru { background: linear-gradient(180deg, #1f7cf5, #005ff9); color: #fff; }
.code-input { text-align: center; font-size: 26px !important; letter-spacing: 10px; font-weight: 800; }
.auth { align-items: flex-start; }
.auth > .auth-card, .auth > div:not(.auth-bg) { margin-top: auto; margin-bottom: auto; }
.mk-tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.mk-tile { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 10px; font-size: 11px; font-weight: 700; color: var(--muted);
    background: rgba(0,0,0,.35); box-shadow: inset 0 0 0 1px rgba(216,178,94,.2); }
.mk-tile .ri { width: 30px; height: 30px; }
.mk-tile.on { color: var(--text); background: rgba(216,178,94,.18); box-shadow: inset 0 0 0 2px var(--gold); }
.mk-tile:disabled { opacity: .3; }
.mk-deal { display: flex; align-items: center; justify-content: space-around; padding: 12px; margin-top: 14px; text-align: center; }
.mk-deal > div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mk-deal .ri { width: 34px; height: 34px; }
.mk-deal b { font-size: 18px; }
.mk-deal small { font-size: 11px; color: var(--muted); }
.mk-arrow { font-size: 24px; color: var(--gold2); }

/* ---------------------------------------------------------------- v6.3: свиток заданий, рудники, летопись */
video { display: block; background: #0b0d12; }
.quest-tab { position: fixed; z-index: 30; right: 0; top: 52%; display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 8px 4px 8px 6px; border-radius: 14px 0 0 14px; font-size: 9.5px; background: linear-gradient(180deg, #3a2a12, #1d150a); box-shadow: inset 0 0 0 1px rgba(216,178,94,.55), -4px 4px 16px rgba(0,0,0,.5);
    color: var(--gold2); font-size: 10.5px; font-weight: 800; letter-spacing: .02em; touch-action: manipulation; }
.quest-tab .qt-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(180deg, #ffe7a3, #b98a35); }
.quest-tab .qt-ico svg { width: 17px; height: 17px; stroke: #3a2508; fill: none; stroke-width: 2.2; }
.quest-tab .badge { position: absolute; top: -6px; left: -6px; }
.quest-tab.ready { animation: qtpulse 1.8s infinite; }
@keyframes qtpulse { 0%, 100% { box-shadow: inset 0 0 0 1px rgba(143,224,138,.8), 0 0 0 0 rgba(143,224,138,.6); } 50% { box-shadow: inset 0 0 0 1px rgba(143,224,138,.8), 0 0 0 8px rgba(143,224,138,0); } }
.modal.side { align-items: stretch; justify-content: flex-end; padding-top: 0; }
.modal.side .sheet { max-width: 430px; height: 100%; max-height: 100%; border-radius: 20px 0 0 20px; animation: slidein .25s cubic-bezier(.2,.9,.3,1); }
.modal.side .sheet-head { padding-top: calc(var(--top) + 12px); }
.modal.side .sheet-close { top: calc(var(--top) + 8px); }
@keyframes slidein { from { transform: translateX(100%); } to { transform: none; } }
.q-item { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border-radius: 12px; }
.q-item .qn { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: rgba(216,178,94,.16); color: var(--gold2); }
.q-item .qb { flex: 1; min-width: 0; }
.q-item .qt { font-weight: 700; font-size: 14px; line-height: 1.3; }
.q-item .qs { font-style: italic; color: #cdbf9f; font-size: 12.5px; line-height: 1.4; margin-top: 3px; }
.q-item .cost { margin-top: 6px; }
.q-item.ready { box-shadow: inset 0 0 0 1px rgba(143,224,138,.65); background: linear-gradient(90deg, rgba(95,184,90,.2), rgba(95,184,90,.04)); }
.q-item.ready .qn { background: linear-gradient(180deg, #b6f08f, #5fae45); color: #0f2a0c; }
.q-item.current { box-shadow: inset 0 0 0 1px rgba(216,178,94,.6); }
.q-item.later { opacity: .55; }
.q-item.claimed { opacity: .5; padding: 7px 12px; }
.q-item.claimed .qn { background: rgba(95,184,90,.25); color: #8fe08a; }
.q-item .qa { flex: none; display: flex; flex-direction: column; gap: 6px; align-self: center; }
.chron { padding: 14px 16px; margin-bottom: 10px; }
.chron h4 { font-family: 'Cormorant SC', Georgia, serif; font-size: 20px; color: var(--gold2); margin-bottom: 6px; }
.chron p { font-size: 14px; line-height: 1.55; }
.chron.locked { opacity: .5; }
.store-warn { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 6px; padding: 6px 10px; border-radius: 10px; font-size: 12.5px; font-weight: 700; text-align: left;
    color: #ffd9a0; background: rgba(214,140,40,.16); box-shadow: inset 0 0 0 1px rgba(232,160,60,.5); }
.store-note { margin-top: 10px; padding: 9px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.45; color: #ffd9a0; background: rgba(214,140,40,.14); box-shadow: inset 0 0 0 1px rgba(232,160,60,.45); text-align: left; }
#fc.loading { opacity: .55; transition: opacity .15s; }
.story { font-size: 14px; line-height: 1.55; font-style: italic; color: #e6dcc4; }
.parchment.story { color: #2a1d0c; }
html.lite .quest-tab.ready { animation: none; }

/* ---------------------------------------------------------------- v6.4: поиск по карте, ускорения */
.find-btn { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.find-btn svg { stroke: var(--gold2); fill: none; stroke-width: 2.4; }
.find-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.find-chip { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 12px; font-size: 12.5px; font-weight: 700; text-align: center; touch-action: manipulation; }
.find-chip .ri, .find-chip img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.find-chip svg { stroke: var(--gold2); fill: none; stroke-width: 2; }
.find-chip:active { transform: scale(.97); }
.find-chip:disabled { opacity: .5; }
.legend { list-style: none; display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.legend i { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 3px solid; margin-right: 8px; vertical-align: -3px; }
.find-bar { position: absolute; left: 10px; right: 10px; top: 58px; z-index: 3; display: flex; gap: 6px; align-items: stretch; padding: 6px; border-radius: 14px;
    background: rgba(12,14,20,.92); box-shadow: inset 0 0 0 1px rgba(143,224,138,.55), 0 6px 18px rgba(0,0,0,.5); }
.find-bar.hidden { display: none; }
.find-bar .fb-main { flex: 1; min-width: 0; text-align: left; padding: 2px 6px; }
.find-bar .fb-main b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #a8f0a4; }
.find-bar .fb-main small { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.find-bar .fb-nav { flex: none; width: 38px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.06); }
.find-bar .fb-nav svg { width: 18px; height: 18px; stroke: var(--gold2); fill: none; stroke-width: 2.4; }
.find-bar .fb-nav:disabled { opacity: .3; }
.stepper { display: inline-flex; align-items: center; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(216,178,94,.45); }
.stepper button { width: 36px; height: 34px; font-size: 20px; font-weight: 700; color: var(--gold2); background: rgba(255,255,255,.05); touch-action: manipulation; }
.stepper b { min-width: 34px; text-align: center; font-size: 15px; }
.stepper button.mx { width: auto; padding: 0 9px; font-size: 11.5px; font-weight: 800; text-transform: uppercase; border-left: 1px solid rgba(216,178,94,.3); }
.rep-res { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 2px; }
.rep-res span { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 3px; border-radius: 999px; background: rgba(95,184,90,.14); color: #a8f0a4; font-size: 12.5px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rep-res.lost span { background: rgba(255,107,92,.14); color: #ffb0a6; }
.rep-res .ri { width: 20px; height: 20px; }
.quest-tab { touch-action: none; user-select: none; -webkit-user-select: none; transform: translateY(-50%); }
.quest-tab.left { right: auto; left: 0; border-radius: 0 14px 14px 0; padding: 8px 6px 8px 4px; }
.quest-tab.left .badge { left: auto; right: -6px; }
.quest-tab.dragging { opacity: .85; transition: none; animation: none; box-shadow: inset 0 0 0 2px var(--gold2), 0 8px 24px rgba(0,0,0,.6); }
.free-btn { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.05; padding-top: 4px; padding-bottom: 4px; }
.free-btn small { font-size: 9.5px; font-weight: 700; opacity: .8; text-transform: lowercase; }
/* ускорения: корзина и шкала */
.spd-row { align-items: center; }
.spd-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.spd-foot { position: sticky; bottom: calc(-18px - var(--bottom)); margin: 12px -16px calc(-18px - var(--bottom)); padding: 12px 16px calc(var(--bottom) + 14px);
    background: linear-gradient(180deg, rgba(20,23,32,.92), #141720 30%); border-top: 1px solid var(--line); z-index: 2; }
.tl-head { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; font-size: 13.5px; margin-bottom: 7px; }
.tl-bar { position: relative; height: 16px; border-radius: 8px; overflow: hidden; background: linear-gradient(180deg, #2a3040, #1c2130); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.tl-bar i { position: absolute; top: 0; bottom: 0; }
.tl-seg { box-shadow: inset -1px 0 0 rgba(0,0,0,.45); transition: width .2s, right .2s; }
.tl-free { background: repeating-linear-gradient(135deg, rgba(95,184,90,.55) 0 5px, rgba(95,184,90,.2) 5px 10px); z-index: 1; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 11.5px; color: var(--muted); min-height: 15px; }
.tl-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.tl-free-dot { background: repeating-linear-gradient(135deg, #5fb85a 0 2px, rgba(95,184,90,.3) 2px 4px); }
.tl-waste { margin-top: 6px; font-size: 12px; font-weight: 700; color: #ff9c92; }
.spd-foot .btn { margin-top: 10px; min-height: 46px; font-size: 16px; }
.gold-btn .ri, .btn .ri { width: 18px; height: 18px; vertical-align: -3px; }
.stepper button:disabled { opacity: .35; }
.plan-btn { flex-direction: column; gap: 2px; white-space: normal; height: auto; min-height: 48px; padding: 7px 12px; margin-bottom: 10px; line-height: 1.2; }
.plan-btn small { font-size: 11.5px; font-weight: 600; opacity: .75; }
/* живой фон входа: без размытия, чуть светлее картинки, чтобы движение было видно */
.auth-bg video { filter: brightness(.6) saturate(1.1); transform: none; }
.shield-warn { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: rgba(91,143,214,.14); box-shadow: inset 0 0 0 1px rgba(120,180,255,.45); }
.shield-warn > svg { width: 34px; height: 34px; flex: none; stroke: #9fd0ff; fill: none; stroke-width: 2; }
.shield-warn b { color: #cfe6ff; font-size: 15px; }
.shield-warn p { font-size: 13.5px; line-height: 1.45; margin-top: 4px; }
/* свёрнутые очереди в городе */
.q-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; text-align: left; touch-action: manipulation; }
.qh-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: linear-gradient(180deg, #bfe6ff, #6fb2e6); }
.qh-ico svg { stroke: #0c1a2a; fill: none; stroke-width: 2.2; }
.qh-text { flex: 1; min-width: 0; }
.qh-text b { display: block; font-size: 14px; }
.qh-text small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.qh-free { flex: none; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; color: #0f2a0c; background: linear-gradient(180deg, #b6f08f, #5fae45); }
.qh-chev svg { width: 18px; height: 18px; stroke: var(--gold2); fill: none; stroke-width: 2.4; transition: transform .2s; }
.queues.open .qh-chev svg { transform: rotate(90deg); }
.queues.foldable:not(.open) .qitem { display: none; }
.qh-free[data-freeall] { cursor: pointer; }
.qh-free[data-freeall]:hover { filter: brightness(1.1); }
/* экран загрузки: фон входа сразу, до скриптов */
.splash .logo { position: relative; z-index: 1; text-shadow: 0 2px 18px rgba(0,0,0,.8); }
.splash-bar { display: block; width: 160px; height: 3px; margin: 14px auto 0; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; position: relative; }
.splash-bar::after { content: ''; position: absolute; inset: 0; width: 40%; border-radius: 3px; background: linear-gradient(90deg, transparent, var(--gold2), transparent); animation: splashbar 1.2s ease-in-out infinite; }
@keyframes splashbar { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .splash-bar::after { animation: none; } }
.spd-more { margin-top: 10px; padding: 10px 12px; }
.spd-more summary { cursor: pointer; font-weight: 700; color: var(--gold2); list-style: none; }
.spd-more summary::-webkit-details-marker { display: none; }
.spd-more summary::before { content: '＋ '; }
.spd-more[open] summary::before { content: '－ '; }
.spd-more ul { margin: 8px 0 0 18px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.versus .side video { display: block; }

/* ================================================================ ПК-версия (широкий экран) */
@media (hover: hover) { button, .bcard, .spot, [data-b] { cursor: pointer; } .btn:hover { filter: brightness(1.08); } .bcard:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.45); } .bcard { transition: transform .15s, box-shadow .15s; } }
/* ПК (широкий экран и мышь): игровой экран, а не «растянутая мобилка».
   Сверху — одна полоса: лорд · ресурсы с добычей в час · кнопки. Снизу по центру — док разделов, как в стратегиях на ПК.
   Город: большая квадратная сцена слева во всю высоту, справа — очереди и здания. Позади — размытая сцена города. */
.res .rate { display: none; }
.res-v { display: contents; }
@media (min-width: 1200px) and (hover: hover) {
    :root { --pc-top: 76px; --pc-dock: 96px; }
    #app { padding-left: 0; }
    .view::before { content: ''; position: absolute; inset: -40px; z-index: 0; pointer-events: none; background: var(--stage, none) center / cover no-repeat;
        filter: blur(22px) brightness(.46) saturate(1.15); transform: scale(1.06); }
    .view > .page { z-index: 1; }

    /* — верхняя полоса — */
    .hud { display: grid; grid-template-columns: minmax(250px, 320px) minmax(0, 1fr) auto; grid-auto-rows: auto; align-items: center; column-gap: 22px; row-gap: 8px;
        padding: 10px 28px; background: linear-gradient(180deg, rgba(14,17,25,.97), rgba(9,11,16,.93)); border-bottom: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0,0,0,.45); }
    .hud-row { display: contents; }
    .lord { grid-column: 1; grid-row: 1; gap: 12px; }
    .lord-avatar, .lord-avatar img, .lord-avatar video { width: 58px; height: 58px; }
    .lord-name { font-size: 21px; }
    .lord-sub { font-size: 13px; }
    .hud-buttons { grid-column: 3; grid-row: 1; gap: 10px; }
    .icon-btn { width: 50px; height: 50px; border-radius: 14px; }
    .icon-btn svg { width: 24px; height: 24px; }
    .res-strip { grid-column: 2; grid-row: 1; width: 100%; max-width: 900px; justify-self: center; gap: 8px; }
    .res { height: 48px; justify-content: flex-start; gap: 8px; padding: 0 12px 0 8px; border-radius: 12px; background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.35));
        box-shadow: inset 0 0 0 1px rgba(216,178,94,.18); transition: box-shadow .15s; }
    .res:hover { box-shadow: inset 0 0 0 1px rgba(216,178,94,.55); }
    .res .ri { width: 30px; height: 30px; }
    .res-v { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; min-width: 0; }
    .res b { font-size: 17px; }
    .res .rate { display: block; font-size: 11.5px; font-weight: 700; color: #9fd88f; }
    .res .rate.neg { color: #ff8a7a; }
    .res .fill { left: 10px; right: 10px; bottom: 4px; }
    .store-warn, .alert-bar { grid-column: 1 / -1; justify-self: center; max-width: 900px; width: 100%; }

    /* — нижний док разделов — */
    .nav { position: fixed; left: 50%; right: auto; top: auto; bottom: 14px; width: auto; transform: translateX(-50%); display: flex; gap: 6px;
        padding: 8px 10px; border-radius: 24px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(20,24,35,.96), rgba(9,11,16,.96));
        box-shadow: 0 10px 40px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.04); }
    .nav button { width: 104px; padding: 9px 0 7px; border-radius: 16px; gap: 4px; }
    .nav button svg { width: 30px; height: 30px; }
    .nav button span { font-size: 13.5px; font-weight: 700; }
    .nav button:hover { color: var(--text); background: rgba(255,255,255,.05); }
    .nav button.active::before { top: auto; bottom: -9px; left: 28%; right: 28%; width: auto; height: 3px; }
    .nav .badge { right: calc(50% - 26px); }

    /* — страницы: «окно» по центру, док не закрывает низ — */
    .page { padding: 22px max(28px, calc(50% - 820px)) calc(var(--pc-dock) + 40px); }
    .page.full { padding: 0; }
    .page-head h2 { font-size: 32px; }
    .page:not(.full):not([data-screen="city"]) > * { position: relative; }
    .page[data-screen="alliance"], .page[data-screen="arena"] { padding-left: max(28px, calc(50% - 660px)); padding-right: max(28px, calc(50% - 660px)); }
    .page:not([data-screen="city"]) .frame > .actions:only-of-type .btn:only-child { max-width: 420px; margin: 0 auto; }
    .page[data-screen="army"], .page[data-screen="arena"], .page[data-screen="alliance"] {
        background: linear-gradient(180deg, rgba(10,12,18,.55), rgba(10,12,18,.8)); }

    /* — город — */
    .page[data-screen="city"] { --scene: min(calc(100vh - var(--pc-top) - var(--pc-dock) - 56px), 54vw); padding-top: 18px; }
    /* сцена слева во всю высоту, шапка/очереди/здания — колонкой справа */
    .page[data-screen="city"]:has(> .city-cols:not(.one)) { display: grid; grid-template-columns: var(--scene) minmax(380px, 1fr); column-gap: 26px; align-content: start; }
    .page[data-screen="city"]:has(> .city-cols:not(.one)) > * { grid-column: 2; min-width: 0; }
    .page[data-screen="city"] > .city-cols:not(.one) { display: contents; }
    .page[data-screen="city"] .city-cols:not(.one) > .city-left { grid-column: 1; grid-row: 1 / span 20; position: sticky; top: 0; align-self: start; }
    .page[data-screen="city"] .city-cols:not(.one) > .city-right { grid-column: 2; }
    .page[data-screen="city"] .city-cols:not(.one) .city-left .city-scene { width: var(--scene); max-width: none; margin-top: 0 !important;
        box-shadow: 0 18px 60px rgba(0,0,0,.65), 0 0 0 1px rgba(216,178,94,.35); }
    .page[data-screen="city"] .city-cols.one .city-scene { max-width: var(--scene); }
    .page[data-screen="city"] .city-right { padding-bottom: 20px; }
    .page[data-screen="city"] .city-right > .section-title:first-child { margin-top: 0; }
    .city-cols .buildings-grid { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; }
    .bcard .info h4 { font-size: 18px; }
    .city-scene.layered .spot .tag { font-size: 11.5px; padding: 2px 8px; }

    .rivals { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    /* — армия: классы войск в две колонки — */
    .page[data-screen="army"] .uclasses { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 28px; align-items: start; }
    .page[data-screen="army"] .uclass .units-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .page[data-screen="army"] .uclass > .section-title:first-child { margin-top: 18px; }

    /* — карта и прочие элементы над доком — */
    .map-tools { bottom: calc(var(--pc-dock) + 24px); right: 24px; }
    .march-list { bottom: calc(var(--pc-dock) + 24px); left: 24px; }
    .to-top { right: 30px; bottom: calc(var(--pc-dock) + 24px); }
    .dev-ribbon { bottom: calc(var(--pc-dock) + 30px); left: 24px; }
    .sage-btn { left: 24px; bottom: 24px; width: 60px; height: 60px; }
    .sage-tip { left: 24px; bottom: 96px; }
    .kbd-hint { display: block; right: 24px; bottom: 6px; }
    .quest-tab, .quest-tab.left { top: auto !important; bottom: 24px; right: 24px; left: auto; transform: none; border-radius: 16px; padding: 10px 14px 8px; min-width: 76px; }
    .quest-tab .badge, .quest-tab.left .badge { left: -6px; right: auto; }

    /* — окна — */
    .modal { align-items: center; }
    .sheet { max-width: 780px; border-radius: 22px; max-height: 88vh; }
    .sheet-head h3 { font-size: 28px; }
    .hero-art { height: 240px; }
}
@media (min-width: 1200px) and (hover: hover) and (max-height: 760px) { :root { --pc-dock: 84px; } .nav button { padding: 6px 0 5px; } .nav button svg { width: 26px; height: 26px; } }
.kbd-hint { display: none; position: fixed; right: 16px; bottom: 10px; z-index: 4; font-size: 11px; color: var(--muted); opacity: .7; pointer-events: none; }
.kbd-hint b { color: var(--gold2); font-weight: 700; }
.danger-zone { margin-top: 18px; padding: 10px 12px; box-shadow: inset 0 0 0 1px rgba(209,75,63,.45); }
.danger-zone summary { cursor: pointer; font-weight: 700; color: #ff9c92; }
.danger-zone p { font-size: 12.5px; color: var(--muted); margin: 8px 0; }
/* подсказка «Установите игру» */
.install-bar { position: fixed; z-index: 45; left: 10px; right: 10px; bottom: calc(var(--bottom) + 82px); display: flex; gap: 10px; align-items: center; padding: 10px 40px 10px 10px; border-radius: 16px; animation: up .3s; max-width: 520px; margin: 0 auto; }
.install-bar > img { width: 44px; height: 44px; border-radius: 10px; flex: none; }
.install-bar .ib-text { flex: 1; min-width: 0; font-size: 14px; }
.install-bar .ib-text small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.install-bar .ib-text svg { width: 16px; height: 16px; vertical-align: -3px; stroke: #6fb2ff; fill: none; stroke-width: 2.2; }
.install-bar .ib-close { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.35); }
.install-bar .ib-close svg { width: 13px; height: 13px; stroke: var(--gold2); stroke-width: 2.4; fill: none; }
.install-bar .ib-arrow { position: fixed; left: 50%; bottom: calc(var(--bottom) + 6px); width: 0; height: 0; margin-left: -10px; border: 10px solid transparent; border-top-color: #f3d98e; animation: ibbounce 1.2s infinite; pointer-events: none; }
@keyframes ibbounce { 50% { transform: translateY(6px); } }
@media (min-width: 1200px) { .install-bar { display: none; } }
.bcard .art video, .ucard .portrait video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ucard .portrait video { object-position: 50% 20%; }
.ucard.locked .portrait video { filter: grayscale(1) brightness(.45); }

/* ---------------------------------------------------------------- Сокровищница */
.icon-btn.shop-btn svg { stroke: #ffd76a; fill: rgba(255, 205, 80, .18); }
.icon-btn.shop-btn { box-shadow: inset 0 0 0 1px rgba(255, 210, 100, .55), 0 0 14px rgba(255, 196, 70, .22); }
.icon-btn.shop-btn.vip svg { fill: #f1c34e; }
.vip-crown { display: inline-flex; color: #f1c34e; margin-right: 4px; vertical-align: -1px; }
.vip-crown svg { fill: #f1c34e; stroke: #f1c34e; }
.shop-crown { color: #f1c34e; display: grid; place-items: center; margin-right: 10px; }
.shop-crown svg { fill: rgba(241, 195, 78, .25); stroke: #f1c34e; }
.shop-note { font-size: 12.5px; line-height: 1.45; padding: 9px 12px; border-radius: 10px; margin-bottom: 12px; background: rgba(91, 143, 214, .13); box-shadow: inset 0 0 0 1px rgba(91, 143, 214, .35); }
.shop-vip { padding: 14px; border-radius: var(--r); background: radial-gradient(120% 90% at 0% 0%, rgba(241, 195, 78, .2), transparent 60%), var(--panel); margin-bottom: 12px; }
.shop-vip.on { box-shadow: inset 0 0 0 1.5px #f1c34e, 0 0 24px rgba(241, 195, 78, .18); }
.shop-vip-head { display: flex; align-items: center; gap: 12px; }
.shop-vip-head > svg { fill: rgba(241, 195, 78, .3); stroke: #f1c34e; flex: none; }
.shop-vip-head b { font-size: 18px; color: var(--gold2); display: block; }
.shop-vip-head small, .shop-row small, .shop-g small { color: var(--muted); font-size: 12.5px; display: block; }
.shop-vip ul { list-style: none; margin: 10px 0 0; display: grid; gap: 5px; font-size: 13.5px; }
.shop-vip li svg { stroke: var(--green); vertical-align: -2px; }
.shop-vip .actions { margin-top: 12px; display: grid; gap: 8px; }
.shop-card { padding: 12px 14px; border-radius: var(--r); background: var(--panel); margin-bottom: 4px; }
.shop-card.sold { opacity: .6; }
.shop-row { display: flex; align-items: center; gap: 12px; }
.shop-row b { font-size: 16.5px; color: var(--gold2); }
.shop-card .reward-pop { margin-top: 10px; }
.shop-vip .tag, .shop-card .tag, .shop-g .tag { display: inline-block; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 6px; background: #b8322a; color: #fff; vertical-align: 2px; }
.shop-gold { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.shop-g { position: relative; padding: 14px 6px 10px; border-radius: var(--r); background: var(--panel); display: grid; justify-items: center; gap: 4px; text-align: center; }
.shop-g .tag { position: absolute; top: -7px; right: 6px; }
.shop-g .gico .ri { width: 34px; height: 34px; }
.shop-g .gico img { width: 34px; height: 34px; }
.shop-g b { font-size: 18px; color: var(--gold2); }
.shop-g .btn { margin-top: 4px; width: 100%; }
@media (max-width: 360px) { .shop-gold { grid-template-columns: 1fr 1fr; } }
@media (max-width: 430px) {
    .hud-buttons { gap: 5px; }
    .hud-buttons .icon-btn { width: 38px; height: 38px; border-radius: 11px; }
    .hud-buttons .icon-btn svg { width: 19px; height: 19px; }
}

/* ---------------------------------------------------------------- алмазы */
.gem-ico { flex: none; vertical-align: -3px; }
.icon-btn.shop-btn .gem-badge { position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 2px;
    padding: 1px 5px 1px 3px; border-radius: 999px; background: #0c2233; box-shadow: inset 0 0 0 1px rgba(127, 214, 255, .55); font: 800 10px/1.3 Inter, sans-serif; color: #c6f0ff; white-space: nowrap; }
.icon-btn.shop-btn .gem-badge svg { width: 10px; height: 10px; fill: initial; stroke: initial; }
.btn.gem-btn { background: linear-gradient(180deg, #3f9ccc, #1d5e85); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 2px 0 #0e3550; }
.btn.gem-btn svg { width: 16px; height: 16px; }
.reward-pop .gem-chip { color: #c6f0ff; }

/* ---------------------------------------------------------------- выбор войск: бегунки */
.army-row { grid-template-columns: 44px 1fr 74px 56px; grid-template-areas: "img name num max" "range range range range"; row-gap: 6px; }
.army-row img { grid-area: img; }
.army-row .ar-name { grid-area: name; min-width: 0; }
.army-row .ar-num { grid-area: num; height: 32px; }
.army-row .ar-max { grid-area: max; height: 32px; border-radius: 8px; background: #2a3142; color: var(--gold2); font: 800 12px Inter, sans-serif; box-shadow: inset 0 0 0 1px rgba(216,178,94,.4); }
.army-row .ar-range { grid-area: range; width: 100%; height: 26px; margin: 0; accent-color: var(--gold); --p: 0%;
    -webkit-appearance: none; appearance: none; background: transparent; }
.ar-range::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--gold) var(--p), rgba(255,255,255,.12) var(--p)); }
.ar-range::-moz-range-track { height: 8px; border-radius: 99px; background: rgba(255,255,255,.12); }
.ar-range::-moz-range-progress { height: 8px; border-radius: 99px; background: var(--gold); }
.ar-range::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -8px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3c4, #d8b25e 55%, #8a6526); box-shadow: 0 1px 4px rgba(0,0,0,.6); border: 2px solid #1a1208; }
.ar-range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #d8b25e; border: 2px solid #1a1208; }
.army-row.gov { box-shadow: inset 0 0 0 1px rgba(241,195,78,.5); background: rgba(241,195,78,.07); }
.gov-note { font-size: 12.5px; line-height: 1.45; margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(241,195,78,.1); box-shadow: inset 0 0 0 1px rgba(241,195,78,.35); }
.gov-note.warn { background: rgba(209,75,63,.12); box-shadow: inset 0 0 0 1px rgba(209,75,63,.45); }
.gov-note svg, .gov-box > svg { vertical-align: -2px; color: #f1c34e; }

/* ---------------------------------------------------------------- замки, Верность */
.loyalty { margin-top: 10px; }
.loyalty .ly-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.loyalty .ly-head b { color: var(--gold2); }
.loyalty .ly-bar { height: 9px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.loyalty .ly-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #ff6b5c, #f1c34e 40%, #7fb6ff 75%); }
.loyalty small { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; line-height: 1.4; }
.gov-box { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(0,0,0,.28); font-size: 13.5px; }
.gov-box small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.capture-box { display: flex; gap: 10px; margin-top: 12px; padding: 12px; border-radius: 12px; background: radial-gradient(120% 100% at 0 0, rgba(241,195,78,.25), transparent 70%), rgba(0,0,0,.3); box-shadow: inset 0 0 0 1.5px #f1c34e; }
.capture-box > svg { color: #f1c34e; flex: none; }
.capture-box b { font-size: 16px; color: var(--gold2); }
.capture-box small { display: block; font-size: 12.5px; margin-top: 4px; line-height: 1.4; }
.fort-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; min-height: 47px; flex: none; }   /* у прокручиваемой полосы в сетке ПК нет мин. высоты — без этого её строка сжималась и заголовок наезжал */
.fort-tabs button { flex: none; display: inline-flex; gap: 6px; align-items: center; padding: 7px 12px; border-radius: 999px; font: 700 13px Inter, sans-serif; color: var(--muted); background: rgba(0,0,0,.3); box-shadow: inset 0 0 0 1px var(--line); }
.fort-tabs button.on { color: #1a1206; background: linear-gradient(180deg, #f3d98e, #c99a45); box-shadow: none; }
.fort-info { padding: 12px 14px; margin-top: 4px; }
.fort-info .kv dt { display: flex; align-items: center; gap: 6px; }
.fort-info .kv .ri { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- роли войск */
.roles { display: grid; gap: 8px; margin-top: 10px; }
.role-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.25); }
.role-row .role-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: rgba(216,178,94,.14); color: var(--gold2); }
.role-row b { font-size: 14px; }
.role-row .gold { font-size: 12px; font-weight: 700; }
.role-row small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.45; margin-top: 2px; }
.cls-pill.gold { color: var(--gold2); }

/* опыт лорда — кольцо вокруг портрета вместо полоски (полоска упиралась в кнопки шапки) */
.lord-avatar::before { content: ""; position: absolute; inset: -5px; border-radius: 50%; z-index: 0;
    background: conic-gradient(#9fe06a var(--xp, 0%), rgba(216,178,94,.28) 0);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); }
.lord-avatar img, .lord-avatar video { position: relative; z-index: 1; box-shadow: 0 0 0 2px #000; }
.lord-avatar .lvl { z-index: 2; }

.don-code { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0; padding: 12px 14px; border-radius: 12px;
    background: rgba(0,0,0,.35); box-shadow: inset 0 0 0 1.5px var(--gold); }
.don-code b { font-size: 26px; letter-spacing: 2px; color: var(--gold2); }
.don-steps { margin: 0 0 4px 18px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.don-steps li { margin: 3px 0; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

.army-share { margin-top: 10px; padding: 10px 12px; border-radius: 12px; }
.army-share .as-head { display: flex; justify-content: space-between; font-size: 13.5px; }
.army-share .as-head span { color: var(--gold2); font-weight: 800; }
.army-share .ar-range { width: 100%; height: 26px; margin: 4px 0 2px; -webkit-appearance: none; appearance: none; background: transparent; --p: 100%; }
.as-chips { display: flex; gap: 6px; }
.as-chips button { flex: 1; height: 32px; border-radius: 9px; background: #2a3142; color: var(--text); font: 700 13px Inter, sans-serif; box-shadow: inset 0 0 0 1px rgba(216,178,94,.3); }
.as-chips button.on { background: linear-gradient(180deg, #f3d98e, #c99a45); color: #1a1206; box-shadow: none; }

.fort-status { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(209,75,63,.08); box-shadow: inset 0 0 0 1px rgba(209,75,63,.3); display: grid; gap: 6px; }
.fort-status small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.st-row { display: grid; grid-template-columns: 92px 1fr 42px; gap: 8px; align-items: center; font-size: 13px; }
.st-row .ly-bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.st-row .ly-bar i { display: block; height: 100%; border-radius: 99px; }
.st-row b { text-align: right; }
.vip-not { margin-top: 10px; font-size: 13px; }
.vip-not summary { cursor: pointer; color: var(--muted); font-weight: 700; }
.vip-not ul { list-style: none; margin: 8px 0 0; display: grid; gap: 4px; }
.vip-not li svg { stroke: #ff8b7e; vertical-align: -2px; }
.vip-not small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.4; }

.reqs { display: grid; gap: 6px; }
.req-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 12px; text-align: left; width: 100%; }
.req-row img { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; flex: none; }
.req-row b { display: block; font-size: 14px; }
.req-row small { color: var(--muted); font-size: 12px; }
.req-row.no { box-shadow: inset 0 0 0 1px rgba(209,75,63,.55); background: rgba(209,75,63,.08); }
.req-row.ok { opacity: .8; }
.req-row .req-go { display: inline-flex; align-items: center; gap: 2px; color: var(--gold2); font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.req-row .req-go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.req-mini { color: #ff9c90; }

/* ---------------------------------------------------------------- календарь входа */
.cal-head { padding: 12px 14px 10px; margin-bottom: 10px; }
.cal-bar { position: relative; height: 8px; border-radius: 99px; background: rgba(255,255,255,.1); margin: 10px 14px 16px 4px; }
.cal-bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #8bd15d, #e8d36a); }
.cal-bar > b { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
    background: #12151d; box-shadow: 0 0 0 2px rgba(216,178,94,.35); filter: grayscale(.6) brightness(.8); }
.cal-bar > b.got { filter: none; box-shadow: 0 0 0 2px var(--gold2), 0 0 12px rgba(243,217,142,.5); }
.cal-head small { display: block; font-size: 12px; line-height: 1.4; }
.login-cal { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
@media (min-width: 700px) { .login-cal { grid-template-columns: repeat(10, 1fr); } }
.login-cal .lday { position: relative; padding: 5px 2px 6px; min-height: 74px; border-radius: 11px; display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: rgba(0,0,0,.35); box-shadow: inset 0 0 0 1px rgba(216,178,94,.2); color: var(--text); font: 700 11px Inter, sans-serif; }
.login-cal .lday .d { font-size: 13px; line-height: 1; }
.login-cal .lday-ico { height: auto; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.login-cal .lday-amt { font-size: 10.5px; font-weight: 800; color: var(--text); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.login-cal .lday.done { opacity: .45; }
.login-cal .lday-ok { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: #3f8a2f; display: grid; place-items: center; color: #fff; }
.login-cal .lday-ok svg { stroke: #fff; }
.login-cal .lday.today { background: linear-gradient(180deg, rgba(216,178,94,.4), rgba(120,80,20,.3)); box-shadow: inset 0 0 0 1.5px var(--gold2), 0 0 16px rgba(216,178,94,.45);
    animation: daypulse 1.8s ease-in-out infinite; }
@keyframes daypulse { 50% { box-shadow: inset 0 0 0 1.5px var(--gold2), 0 0 26px rgba(243,217,142,.7); } }
.login-cal .lday.big { background: radial-gradient(90% 80% at 50% 30%, rgba(241,195,78,.22), rgba(0,0,0,.35)); }
.login-cal .lday.chest-4 { box-shadow: inset 0 0 0 1.5px #c58bff, 0 0 14px rgba(197,139,255,.35); }
.chest .ci img, .lday-ico img { display: block; }
.quest.dq { width: 100%; text-align: left; display: flex; gap: 10px; align-items: center; }
.quest.dq:not(.done):active { transform: scale(.99); }
.dq-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.dq-go { display: inline-flex; align-items: center; gap: 1px; font-size: 12px; font-weight: 700; color: var(--gold2); white-space: nowrap; }
.dq-go svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
/* подпись карточки здания — под картинкой, а не поверх неё */
.bcard .info { margin-top: 0; background: linear-gradient(180deg, #151923, #10131a); border-top: 1px solid rgba(216,178,94,.18); }
.bcard .art::after { background: linear-gradient(180deg, transparent 75%, rgba(5,6,9,.5)); }
.bcard .info small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lday-res { display: block; height: 24px; }
.lday-res .ri { width: 24px; height: 24px; display: inline-grid; }
.lday-res .ri img { width: 24px; height: 24px; }
/* «Завершить · бесплатно»: подпись была тёмной на тёмном низе кнопки */
.free-btn { gap: 3px; padding: 5px 12px 6px; min-height: 40px; }
.free-btn small { opacity: 1; font-size: 10px; font-weight: 800; letter-spacing: .3px; color: #f2ffe8; text-shadow: none;
    background: rgba(15,42,12,.6); border-radius: 6px; padding: 1px 7px 2px; line-height: 1.2; }

.big-ri .ri { width: 40px; height: 40px; }
.big-ri .ri img { width: 40px; height: 40px; }
.gift-crown { display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 50%;
    background: radial-gradient(circle, rgba(241,195,78,.35), rgba(241,195,78,0) 70%); }
.gift-crown svg { width: 54px; height: 54px; fill: rgba(241,195,78,.35); stroke: #f1c34e; stroke-width: 1.6; }
.gift-perks { list-style: none; margin: 10px 0; display: grid; gap: 5px; font-size: 13.5px; }
.gift-perks svg { stroke: var(--green); vertical-align: -2px; }
.row-chev { flex: none; color: var(--gold2); display: grid; place-items: center; }
.row-chev svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }

.march-info { display: grid; gap: 6px; }
.mi-row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.mi-row span { color: var(--muted); }
.mi-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.mi-btns .btn { padding: 0 6px; font-size: 13px; gap: 4px; }

.help-q { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; vertical-align: 3px; margin-left: 4px;
    font: 800 13px Inter, sans-serif; color: #1a1206; background: linear-gradient(180deg, #f3d98e, #c99a45); box-shadow: 0 1px 3px rgba(0,0,0,.5); text-transform: none; letter-spacing: 0; }
.page-head h2 .help-q { vertical-align: 6px; }
.help-pop { position: fixed; z-index: 1000; padding: 12px 14px; border-radius: 12px; background: #1b2030; color: var(--text); font-size: 13px; line-height: 1.45;
    box-shadow: 0 0 0 1px rgba(216,178,94,.45), 0 12px 32px rgba(0,0,0,.6); max-height: 70vh; overflow: auto; }
.help-pop > b { display: block; color: var(--gold2); font-size: 14.5px; margin-bottom: 6px; }
.help-pop p { margin: 0 0 7px; }
.cls-short { font: 700 11.5px Inter, sans-serif; color: var(--gold); text-transform: none; letter-spacing: 0; margin-left: 4px; }

/* жизнь города: жители между фоном и зданиями */
.city-life { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.city-scene.layered .bsprite { position: absolute; transform: translate(-50%, -72%); pointer-events: none; filter: drop-shadow(0 6px 6px rgba(0,0,0,.45)); }
.city-scene.layered .bsprite.busy { filter: drop-shadow(0 6px 6px rgba(0,0,0,.45)) drop-shadow(0 0 8px rgba(127,190,240,.75)); }
@keyframes bbusy { 50% { filter: drop-shadow(0 0 10px rgba(127,190,240,.8)); } }
.city-scene .spot { z-index: 200; }
.city-scene.layered .bsprite.hov { filter: drop-shadow(0 6px 6px rgba(0,0,0,.45)) brightness(1.18); }
.city-scene.layered .spot .tag { font-size: 10px; padding: 1px 6px; background: rgba(8,10,15,.72); }
/* в послойном городе по умолчанию только уровень — само здание видно и нажимается; названия по кнопке */
.city-scene.layered:not(.names) .spot .tag .nm { display: none; }
.city-scene.layered:not(.names) .spot .tag { padding: 0 6px; min-width: 20px; text-align: center; border-radius: 999px; }
.names-btn { position: absolute; top: 8px; left: 8px; z-index: 210; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
    color: var(--gold2); background: rgba(8,10,15,.72); box-shadow: inset 0 0 0 1px rgba(216,178,94,.35); }
@media (max-width: 520px) { .city-scene.layered .spot .tag { font-size: 9px; } }
.path-ed { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; font-size: 11px; }
.path-ed small { word-break: break-all; color: var(--muted); }

/* перенос замка */
.reloc-opt { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: inherit; }
.reloc-opt small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.reloc-opt svg { width: 16px; height: 16px; stroke: var(--gold2); fill: none; stroke-width: 2.2; }
.reloc-opt:disabled { opacity: .5; }
.city-scene.layered .bsprite.tap { filter: drop-shadow(0 6px 6px rgba(0,0,0,.45)) brightness(1.3) drop-shadow(0 0 8px rgba(255,214,120,.7)); }
@media (max-width: 520px) { .city-scene.layered:not(.names) .spot .tag { font-size: 10px; min-width: 22px; padding: 1px 6px; } }

/* ================================================================ советник */
.sage-btn { position: fixed; z-index: 31; left: 10px; bottom: calc(var(--bottom) + 100px); width: 54px; height: 54px; border-radius: 50%; padding: 0;
    background: #0b0d12; box-shadow: 0 0 0 2px var(--gold2), 0 6px 16px rgba(0,0,0,.55); overflow: visible; }
.sage-btn img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; border-radius: 50%; display: block; }
.sage-btn .sage-q { position: absolute; right: -4px; top: -4px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
    font-size: 12px; font-weight: 900; color: #1a1206; background: linear-gradient(180deg, #ffe08a, #e0a83a); box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.sage-tip { position: fixed; z-index: 32; left: 10px; bottom: calc(var(--bottom) + 166px); max-width: min(320px, calc(100vw - 20px)); padding: 10px 12px 8px;
    border-radius: 14px; background: rgba(16,19,28,.97); box-shadow: inset 0 0 0 1px rgba(216,178,94,.45), 0 10px 30px rgba(0,0,0,.6); animation: sageIn .25s ease-out; }
.sage-tip::after { content: ''; position: absolute; left: 22px; bottom: -8px; border: 8px solid transparent; border-bottom: 0; border-top-color: rgba(16,19,28,.97); }
.sage-tip b { color: var(--gold2); font-size: 12.5px; }
.sage-tip p { margin: 4px 0 6px; font-size: 13.5px; line-height: 1.45; }
.sage-tip-btns { display: flex; gap: 6px; justify-content: flex-end; }
.sage-tip-btns button { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; color: var(--gold2); background: rgba(255,255,255,.06); }
@keyframes sageIn { from { opacity: 0; transform: translateY(8px); } }
.sage-head { display: flex; gap: 12px; align-items: center; }
.sage-head img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; flex: none; box-shadow: 0 0 0 2px var(--gold2); }
.sage-head p { font-style: italic; line-height: 1.4; font-size: 14.5px; color: #e8dcc0; }
.sage-log { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.sage-log:empty { display: none; }
.sage-msg { padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; max-width: 92%; }
.sage-msg.bot { max-width: 100%; }
.sage-p { margin: 0; }
.sage-ul { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.sage-ul li { position: relative; padding-left: 16px; color: #d9d2c3; }
.sage-ul li::before { content: ''; position: absolute; left: 3px; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--gold2); opacity: .8; }
.sage-chips.folded .chip:not(.more) { display: none; }
.sage-chips:not(.folded) .chip.more { display: none; }
.chip.more { color: var(--gold2); }
.sage-msg.me { align-self: flex-end; background: rgba(91,143,214,.22); }
.sage-msg.bot { align-self: flex-start; background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px rgba(216,178,94,.25); }
.sage-msg.bot > b { display: block; color: var(--gold2); margin-bottom: 3px; }
.sage-msg .btn { margin-top: 8px; }
.sage-more { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sage-ask { display: flex; gap: 8px; }
.sage-ask input, .book-search { flex: 1; width: 100%; padding: 10px 12px; border-radius: 10px; background: rgba(0,0,0,.35); color: inherit; border: 1px solid var(--line); font: inherit; }
.sage-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: 12px; padding: 5px 10px; border-radius: 999px; color: inherit; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(216,178,94,.25); }
.sage-tog { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.book-item { margin-top: 8px; padding: 0; }
.book-item summary { padding: 11px 14px; font-weight: 700; cursor: pointer; }
.book-item .book-text { padding: 0 14px 12px; font-size: 13.5px; line-height: 1.55; color: #d9d2c3; }
.book-item .btn { margin: 0 14px 12px; }
html.lite .sage-tip { animation: none; }

.dq-reroll { display: inline-flex; align-items: center; gap: 3px; margin-top: 4px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
    color: var(--gold2); background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(216,178,94,.3); cursor: pointer; white-space: nowrap; }
.dq-reroll .ri { width: 14px; height: 14px; }

/* Донесения → Подарки */
.tab-badge { display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; margin-left: 3px; border-radius: 999px; font-size: 10.5px; color: #fff; background: #d9473a; }
.gift-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 8px; }
.gift-row.ready { box-shadow: inset 0 0 0 1px rgba(143,224,138,.55), 0 0 14px rgba(120,220,100,.12); }
.gift-row .grow b { display: block; }
.gift-row .grow small { color: var(--muted); font-size: 12.5px; }
.gift-ic { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(180deg, #ffe08a, #e0a83a); }
.gift-ic svg { stroke: #1a1206; }
/* просьбы союзников о помощи — кнопка над «Альянсом» */
.ally-pop { position: absolute; bottom: calc(100% + 10px); right: 4px; z-index: 8; display: flex; align-items: center; gap: 5px; white-space: nowrap;
    padding: 7px 11px 7px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 800; color: #10220c; cursor: pointer;
    background: linear-gradient(180deg, #a6f08a, #4fae3a); box-shadow: 0 6px 18px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.35);
    animation: allypop 1.6s ease-in-out infinite; }
.ally-pop::after { content: ''; position: absolute; top: 100%; right: 22px; border: 6px solid transparent; border-top-color: #4fae3a; }
.ally-pop svg { width: 18px; height: 18px; fill: none; stroke: #10220c; stroke-width: 1.8; stroke-linejoin: round; }
.ally-pop b { background: #10220c; color: #b9f59f; border-radius: 999px; padding: 0 6px; font-size: 11.5px; line-height: 17px; }
@keyframes allypop { 50% { transform: translateY(-3px); } }
@media (min-width: 1200px) and (hover: hover) { .ally-pop { right: 50%; transform: translateX(50%); bottom: calc(100% + 16px); font-size: 13.5px; padding: 8px 14px 8px 10px; animation: none; }
    .ally-pop::after { right: calc(50% - 6px); } .ally-pop:hover { filter: brightness(1.08); } }
@media (prefers-reduced-motion: reduce) { .ally-pop { animation: none; } }
/* поиск по карте: у древних жил — их картинка с карты и значок ресурса */
.find-chip .mine-art { position: relative; width: 52px; height: 52px; }
.find-chip .mine-art > img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px rgba(184,156,255,.7), 0 4px 10px rgba(0,0,0,.5); }
.find-chip .mine-art > .ri, .find-chip .mine-art > svg, .find-chip .mine-art > .gem-ic { position: absolute; right: -6px; bottom: -4px; width: 22px; height: 22px; }
.find-chip .mine-art > .ri img { width: 22px; height: 22px; border-radius: 0; box-shadow: none; }
/* рынок: комиссия и лимит — карточками, курс — на плитках */
.mk-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 6px; }
.mk-stats .frame { padding: 9px 12px; border-radius: 12px; display: flex; flex-direction: column; gap: 1px; }
.mk-stats small { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.mk-stats b { font-size: 19px; color: var(--gold2); font-variant-numeric: tabular-nums; }
.mk-stats span { font-size: 11px; color: var(--muted); }
.mk-note { font-size: 12px; margin: 2px 0 4px; }
.mk-tile .mk-rate { font-size: 10.5px; font-weight: 800; color: var(--gold2); opacity: .85; line-height: 1; }
.mk-tile.on .mk-rate { opacity: 1; }
.mk-rates { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 2px; }
.mk-rates > span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 4px; border-radius: 999px; background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px rgba(216,178,94,.25); font-size: 13px; }
.mk-rates > span .ri { width: 22px; height: 22px; }
.mk-rates > span b { color: var(--gold2); }
.mk-rates > small { font-size: 11.5px; color: var(--muted); margin-left: 2px; }
/* житель просит ресурс */
.ask-gift { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 12px auto; padding: 10px 16px; border-radius: 14px; width: fit-content;
    background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px rgba(216,178,94,.3); }
.ask-gift .ask-ico .ri { width: 44px; height: 44px; display: block; }
.ask-gift .ask-ico .ri img { width: 100%; height: 100%; }
.ask-gift > div { display: flex; flex-direction: column; line-height: 1.2; }
.ask-gift small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.ask-gift b { font-size: 20px; color: var(--gold2); }
.ask-gift span.red, .ask-gift span.muted { font-size: 12px; }
/* советник с ИИ */
.sage-ai { margin: 0; line-height: 1.5; }
.sage-typing { display: inline-flex; gap: 5px; padding: 4px 2px; }
.sage-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold2); opacity: .35; animation: sagedot 1s infinite; }
.sage-typing i:nth-child(2) { animation-delay: .15s; } .sage-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes sagedot { 40% { opacity: 1; transform: translateY(-3px); } }
/* телефон: на карте советник поднимается над списком походов */
@media (max-width: 1199px), (hover: none) {
    :root[data-screen="map"] .sage-btn { bottom: calc(var(--bottom) + 100px + var(--marches-h, 0px)); }
    :root[data-screen="map"] .sage-tip { bottom: calc(var(--bottom) + 166px + var(--marches-h, 0px)); }
}
/* королевства и аккаунты (скрытый переключатель) */
.realm-chev { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 6px; border-radius: 50%; vertical-align: 2px;
    color: var(--muted); background: rgba(255,255,255,.05); transform: rotate(90deg); opacity: .7; }
.realm-chev svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.4; }
.realm-list { display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; background: rgba(255,255,255,.035); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.realm-list + .realm-list, .realm-cap + .realm-list { margin-top: 10px; }
.realm-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; text-align: left; width: 100%; }
.realm-row + .realm-row { box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.realm-row:not([disabled]):active { background: rgba(255,255,255,.06); }
.realm-row .grow { min-width: 0; display: flex; flex-direction: column; }
.realm-row b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.realm-row small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.realm-av { width: 42px; height: 42px; flex: none; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
    background: rgba(216,178,94,.12); box-shadow: inset 0 0 0 1.5px rgba(216,178,94,.45); }
.realm-av img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.realm-av i { font-style: normal; font-size: 20px; color: var(--gold2); }
.realm-row.on .realm-av { box-shadow: inset 0 0 0 2px var(--gold2); }
.realm-tick { color: var(--gold2); font-weight: 800; font-size: 18px; }
.realm-actions b { color: var(--gold2); font-weight: 700; }
.realm-cap { margin: 14px 4px 0; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.realm-note { font-size: 11.5px; text-align: center; margin-top: 12px; line-height: 1.4; }
.realm-return { margin: 14px 0 4px; text-align: center; }
.realm-return small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.realm-return > div { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.realm-return .chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; }
.realm-return .chip img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; object-position: 50% 15%; }
.lord { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
/* что нового */
.pn + .pn { margin-top: 16px; padding-top: 14px; box-shadow: inset 0 1px 0 rgba(255,255,255,.07); }
.pn-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.pn-head b { font-family: var(--serif, inherit); font-size: 18px; color: var(--gold2); }
.pn-head small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.pn ul { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; }
.pn li { position: relative; padding-left: 18px; font-size: 14px; line-height: 1.45; }
.pn li::before { content: ''; position: absolute; left: 3px; top: .55em; width: 7px; height: 7px; border-radius: 2px; transform: rotate(45deg); background: var(--gold2); opacity: .8; }
.pn.old { opacity: .82; }
.pn.old .pn-head b { font-size: 16px; }
/* цветные кнопки шапки (как в мобильных стратегиях): у каждой свой цвет */
.hud-buttons .icon-btn { --t1: #3a4560; --t2: #1a2030; --ic: #f6e6b8;
    background: radial-gradient(120% 100% at 50% 15%, var(--t1), var(--t2) 75%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.25), inset 0 -3px 6px rgba(0,0,0,.35), 0 0 0 1.5px rgba(216,178,94,.55), 0 3px 8px rgba(0,0,0,.55); }
.hud-buttons .icon-btn svg { stroke: var(--ic); fill: rgba(255,255,255,.16); stroke-width: 1.9; filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
.hud-buttons .icon-btn[data-shop] { --t1: #8a5bd6; --t2: #3a1f6b; --ic: #ffe08a; }
.hud-buttons .icon-btn[data-shop] svg { fill: rgba(255, 214, 90, .45); }
.hud-buttons .icon-btn[data-daily] { --t1: #d2533f; --t2: #6a1d16; }
.hud-buttons .icon-btn[data-reports] { --t1: #3f86d6; --t2: #173a6a; }
.hud-buttons .icon-btn[data-chat] { --t1: #3fae6a; --t2: #154a2b; }
.hud-buttons .icon-btn[data-rank] { --t1: #e09a32; --t2: #6b3c0c; }
.hud-buttons .icon-btn:active { transform: translateY(1px) scale(.97); }
.uico { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.hud-buttons .icon-btn .uico { width: 34px; height: 34px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.nav button .uico { width: 34px; height: 34px; filter: grayscale(.5) brightness(.8); transition: filter .2s, transform .2s; }
.nav button.active .uico { filter: drop-shadow(0 0 8px rgba(255,200,90,.55)); transform: translateY(-2px) scale(1.08); }
/* нижнее меню: иконки с заливкой, активная — золотая и светится */
.nav button svg { fill: rgba(216,178,94,.08); transition: transform .2s; }
.nav button.active svg { stroke: #ffd77a; fill: rgba(255,205,90,.32); filter: drop-shadow(0 0 6px rgba(255,190,80,.55)); transform: translateY(-1px) scale(1.06); }
/* нарисованные иконки: сами цветные — кнопке тёмный фон, иконка крупнее */
.hud-buttons .icon-btn:has(.uico) { background: radial-gradient(120% 100% at 50% 15%, #3a4258, #161b27 75%); }
.hud-buttons .icon-btn .uico { width: 40px; height: 40px; }
.nav button .uico { width: 36px; height: 36px; margin-top: -4px; }
@media (min-width: 1200px) and (hover: hover) { .hud-buttons .icon-btn .uico { width: 44px; height: 44px; } .nav button .uico { width: 44px; height: 44px; margin-top: -8px; } }
@media (max-width: 420px) { .hud-buttons .icon-btn .uico { width: 34px; height: 34px; } }
/* ролик карточки — поверх картинки; пока не играет, его не видно */
.mv-over { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s; }
.mv-over.playing { opacity: 1; }
.ucard .portrait .mv-over { object-position: 50% 20%; }
.ucard.locked .portrait .mv-over { filter: grayscale(1) brightness(.45); }
/* телефон: всё, что висит над нижним меню, отступает от его реальной высоты */
@media (max-width: 1199px), (hover: none) {
    .nav button .uico { width: 30px; height: 30px; margin-top: 0; }
    .map-tools, .march-list { bottom: calc(var(--nav-h, 78px) + 12px); }
    .to-top { bottom: calc(var(--nav-h, 78px) + 10px); }
    .install-bar { bottom: calc(var(--nav-h, 78px) + 8px); }
    .sage-btn { bottom: calc(var(--nav-h, 78px) + 22px); }
    .sage-tip { bottom: calc(var(--nav-h, 78px) + 88px); }
    :root[data-screen="map"] .sage-btn { bottom: calc(var(--nav-h, 78px) + 22px + var(--marches-h, 0px)); }
    :root[data-screen="map"] .sage-tip { bottom: calc(var(--nav-h, 78px) + 88px + var(--marches-h, 0px)); }
}

/* знамёна войны */
.banner-av { border-radius: 10px; display: grid; place-items: center; color: #e0705c; background: rgba(224,112,92,.12); }
.banner-row.on { box-shadow: inset 0 0 0 1px rgba(111,207,151,.55); }
.banner-row .btn { margin-left: 8px; }
.hud-buffs { display: flex; gap: 4px; align-items: center; }
.hud-buffs i { width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; background: rgba(224,112,92,.2); color: #ffb3a3; font-style: normal; }

/* Состязание лордов и сезон */
#qtabs { overflow-x: auto; scrollbar-width: none; }
#qtabs button { white-space: nowrap; }
.ct-head { padding: 12px 14px; }
.ct-title { display: flex; gap: 10px; align-items: center; color: var(--gold2); }
.ct-title > div > b { display: block; font-family: var(--font-title, serif); font-size: 18px; color: var(--gold2); }
.ct-title small { display: block; color: var(--text); font-size: 13px; line-height: 1.35; }
.ct-days { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-top: 10px; }
.ct-day { border-radius: 10px; padding: 6px 4px; text-align: center; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); }
.ct-day b { display: block; font-size: 12px; }
.ct-day span { display: block; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-day small { display: block; font-size: 12px; margin-top: 2px; }
.ct-day.on { border-color: var(--gold); background: rgba(224,180,80,.14); }
.ct-day.on span { color: var(--gold2); }
.ct-day.past { opacity: .6; }
.ct-sum { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; margin-top: 10px; font-size: 13.5px; }
.ct-ms, .ss-tier { display: flex; align-items: center; gap: 10px; padding: 9px 12px; }
.ct-ms b { font-size: 13.5px; }
.ct-ms .cost, .ss-tier .cost, .ct-prize .cost { margin-top: 4px; flex-wrap: wrap; gap: 4px; }
.ct-ms.ready, .ss-tier.ready { box-shadow: inset 0 0 0 1px rgba(111,207,151,.6); }
.ct-ms.got, .ss-tier.got { opacity: .55; }
.ct-table { padding: 4px 0; }
.ct-row { display: grid; grid-template-columns: 28px 24px 1fr auto auto; gap: 8px; align-items: center; padding: 6px 12px; font-size: 13.5px; }
.ct-row img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.ct-row b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ct-row.me { background: rgba(224,180,80,.12); }
.ct-row > span:first-child { color: var(--gold2); font-weight: 700; text-align: center; }
.ct-prize { padding: 8px 12px; border-radius: 12px; background: rgba(255,255,255,.03); }
.ct-prize b { font-size: 13px; }
.ss-bar { position: relative; height: 22px; border-radius: 11px; background: rgba(0,0,0,.35); overflow: hidden; margin-top: 10px; }
.ss-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #b8862d, #f3d98e); }
.ss-bar span { position: relative; display: block; text-align: center; line-height: 22px; font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000; }
.ss-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.06); font-weight: 700; flex: none; }
.ss-tier.big .ss-n { background: rgba(224,180,80,.25); color: var(--gold2); }
.npc-tag { color: #e8c9ff; font-weight: 600; }
.ct-stage { color: var(--gold2); font-weight: 700; }
.arena-week { padding: 12px 14px; margin-top: 10px; }
.aw-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.aw-top b { color: var(--gold2); display: inline-flex; gap: 6px; align-items: center; }
.aw-champ { margin-top: 8px; font-size: 13.5px; display: flex; gap: 6px; align-items: center; color: var(--gold2); }
.aw-champ b { color: var(--text); }
.aw-prizes { display: grid; gap: 6px; margin-top: 8px; }
.aw-prizes > div { display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: start; font-size: 13px; }
.aw-prizes > div > b { padding-top: 3px; }
.aw-prizes .cost { gap: 4px; flex-wrap: wrap; }
.aw-prizes .cost span { padding: 2px 7px; font-size: 12px; }

/* нет связи с сервером */
.netbar { position: fixed; left: 50%; bottom: calc(var(--nav-h, 64px) + env(safe-area-inset-bottom, 0px) + 10px); transform: translate(-50%, 160%); z-index: 9000;
    display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 12px; border-radius: 999px; max-width: calc(100vw - 24px);
    background: rgba(40,22,18,.96); border: 1px solid rgba(255,120,100,.55); color: #ffd9d2; font-size: 13px; font-weight: 600;
    box-shadow: 0 6px 20px rgba(0,0,0,.45); transition: transform .3s ease, opacity .3s ease, visibility 0s linear .3s; pointer-events: none;
    opacity: 0; visibility: hidden; }   /* скрытая полоска полностью невидима: раньше она лишь сдвигалась вниз и оставалась поверх меню */
.netbar.on { transform: translate(-50%, 0); pointer-events: auto; opacity: 1; visibility: visible; transition: transform .3s ease, opacity .3s ease; }
.netbar .grow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.netbar-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff6b5c; flex: none; animation: netpulse 1.2s ease-in-out infinite; }
.netbar button { flex: none; border: 0; border-radius: 999px; padding: 4px 10px; background: rgba(255,255,255,.12); color: inherit; font: inherit; font-size: 12px; cursor: pointer; }
@keyframes netpulse { 50% { opacity: .3; } }
.netcard-wrap { position: fixed; inset: 0; z-index: 9001; display: grid; place-items: center; padding: 16px; background: rgba(6,8,12,.72); backdrop-filter: blur(3px); }
.netcard { max-width: 380px; width: 100%; padding: 22px 20px 18px; text-align: center; }
.auth .netcard { margin: auto; }
.netcard-ico svg { width: 46px; height: 46px; fill: none; stroke: #ff8a7a; stroke-width: 1.8; stroke-linecap: round; }
.netcard b { display: block; font-family: var(--font-title, serif); font-size: 21px; color: var(--gold2); margin: 6px 0 8px; }
.netcard p { font-size: 14px; line-height: 1.5; margin: 0 0 8px; }
.netcard-safe { color: #a8e8b4; }
.netcard-try { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 12.5px; color: var(--muted); margin: 10px 0 12px; }
.netcard-try .spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.2); border-top-color: var(--gold2); animation: netspin 1s linear infinite; }
.netcard .actions { display: grid; gap: 8px; }
@keyframes netspin { to { transform: rotate(360deg); } }
.q-stream { display: block; font-size: 12px; color: #a8e8b4; margin: 2px 0 4px; }
.q-stream b { color: #d6ffe0; }

/* календарь входа: компактная неделя, весь — по кнопке */
.login-cal.compact { grid-template-columns: repeat(7, 1fr); gap: 5px; }
.login-cal.compact .lday { min-height: 62px; padding: 4px 1px 5px; }
.login-cal.compact .lday-ico img { max-width: 30px; max-height: 26px; }
.login-cal.compact .lday-amt { font-size: 9.5px; }
.login-cal .lday.claimed { opacity: .6; }
.cal-more { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; margin: 6px 0 0; padding: 6px; border: 0; background: none;
    color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.cal-more:hover { color: var(--gold2); }

/* очереди на телефоне: название и «готово N из M» не сжимаются в столбик — кнопки уходят на свою строку */
@media (max-width: 560px) {
    .qitem { flex-wrap: wrap; row-gap: 6px; }
    .qitem .qbody { flex: 1 1 calc(100% - 52px); }
    .qitem .qact { flex: 1 1 100%; justify-content: flex-end; }
    .qitem .qact .btn.sm { padding: 6px 12px; }
}
.q-stream { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================ обучение-проводник */
.guide { position: fixed; inset: 0; z-index: 9500; pointer-events: none; animation: g-in .6s ease-out; }
@keyframes g-in { from { opacity: 0; } to { opacity: 1; } }
.guide .g-block { position: fixed; pointer-events: auto; background: transparent; z-index: 1; }
.guide .g-hole { position: fixed; pointer-events: none; box-shadow: 0 0 0 200vmax rgba(4,6,10,.74);
    transition: left .7s cubic-bezier(.25,.8,.25,1), top .7s cubic-bezier(.25,.8,.25,1), width .7s cubic-bezier(.25,.8,.25,1), height .7s cubic-bezier(.25,.8,.25,1), border-radius .7s, box-shadow .6s ease; }
.guide.no-target .g-hole { box-shadow: 0 0 0 200vmax rgba(4,6,10,.62); }
.guide .g-ring { position: fixed; pointer-events: none; box-shadow: 0 0 0 2px var(--gold2), 0 0 22px 4px rgba(243,217,142,.55);
    transition: left .7s cubic-bezier(.25,.8,.25,1), top .7s cubic-bezier(.25,.8,.25,1), width .7s cubic-bezier(.25,.8,.25,1), height .7s cubic-bezier(.25,.8,.25,1), opacity .45s ease .15s;
    animation: g-pulse 2.2s ease-in-out infinite; }
.guide.no-target .g-ring, .guide.waiting .g-ring { opacity: 0; transition-delay: 0s; }
@keyframes g-pulse { 0%, 100% { box-shadow: 0 0 0 2px var(--gold2), 0 0 18px 2px rgba(243,217,142,.45); } 50% { box-shadow: 0 0 0 4px #fff2c4, 0 0 34px 10px rgba(243,217,142,.75); } }
.guide .g-hand { position: fixed; width: 46px; height: 46px; pointer-events: none; opacity: 0; transform-origin: 30% 10%;
    transition: left .7s cubic-bezier(.25,.8,.25,1), top .7s cubic-bezier(.25,.8,.25,1), opacity .5s ease; filter: drop-shadow(0 4px 6px rgba(0,0,0,.6)); }
/* палец появляется, когда советник договорил — сначала слушаем, потом делаем */
.guide.tap.typed:not(.waiting):not(.no-target) .g-hand { opacity: 1; animation: g-tap 1.6s ease-in-out infinite; }
@keyframes g-tap { 0%, 100% { transform: translate(6px, 10px) scale(1); } 40% { transform: translate(0, 0) scale(.88); } 55% { transform: translate(0, 0) scale(.88); } }
.guide .g-box { position: fixed; left: 50%; bottom: calc(var(--nav-h, 64px) + env(safe-area-inset-bottom, 0px) + 12px); width: min(520px, calc(100vw - 24px));
    transform: translateX(-50%); pointer-events: auto; display: flex; gap: 12px; padding: 14px 14px 12px; align-items: flex-start; z-index: 3; }
.guide .g-box.top { bottom: auto; top: calc(var(--top, 0px) + 12px); }
.guide .g-box { transition: opacity .35s ease, transform .35s ease; }
.guide .g-box.pop { animation: g-pop .55s cubic-bezier(.25,.8,.25,1); }
.guide .g-box.leaving { opacity: .0; transform: translateX(-50%) translateY(8px); }
@keyframes g-pop { 0% { opacity: 0; transform: translateX(-50%) translateY(10px); } 100% { opacity: 1; transform: translateX(-50%) translateY(0); } }
.guide .g-ava { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 2px var(--gold2), 0 4px 14px rgba(0,0,0,.5); animation: g-breathe 3s ease-in-out infinite; }
@keyframes g-breathe { 50% { transform: scale(1.04); } }
.guide .g-main { flex: 1; min-width: 0; }
.guide .g-name { display: block; font-family: var(--font-title, 'Cormorant SC', serif); color: var(--gold2); font-size: 16px; margin-bottom: 3px; }
.guide .g-text { font-size: 14.5px; line-height: 1.5; min-height: 3em; }
.guide .g-text b { color: var(--gold2); }
.guide .g-btns { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.guide .g-skip { border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; padding: 4px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.guide .g-dots { flex: 1; text-align: right; font-size: 11.5px; color: var(--muted); }
.guide .g-next[hidden] { display: none; }
.guide-on .sage-tip, .guide-on .install-banner { display: none !important; }
@media (prefers-reduced-motion: reduce) { .guide * { animation: none !important; transition: none !important; } }
.g-vip { text-align: center; font-weight: 700; color: var(--gold2); font-size: 16px; margin: 0 0 10px; }
.guide-task { margin-bottom: 10px; box-shadow: inset 0 0 0 1.5px var(--gold2), 0 0 14px rgba(243,217,142,.25); }
.heal-row .heal-n { width: 78px; text-align: right; padding: 7px 8px; border-radius: 9px; font: inherit; font-weight: 700; background: rgba(0,0,0,.35); color: var(--text); border: 1px solid rgba(216,178,94,.35); }
.heal-sum { padding: 10px 12px; margin-top: 10px; }
.heal-sum .hs-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.heal-sum .cost { flex-wrap: wrap; gap: 4px; }
/* состав гарнизона рудника */
.mine-army { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mine-army span { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 3px; border-radius: 999px; background: rgba(0,0,0,.25); font-size: 12.5px; }
.mine-army img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.actions.mine-acts { flex-wrap: wrap; }
.actions.mine-acts .btn { flex: 1 1 calc(50% - 4px); }
.actions.mine-acts [data-leave] { flex-basis: 100%; }
/* Игра, а не страница: ролики и картинки не открываются отдельным окном, текст не выделяется долгим нажатием */
html, body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select, [contenteditable], .selectable, .selectable * { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
video, img { pointer-events: none; -webkit-user-drag: none; user-drag: none; -webkit-touch-callout: none; }
video::-webkit-media-controls, video::-webkit-media-controls-start-playback-button { display: none !important; -webkit-appearance: none; }
.guide.out { opacity: 0; transition: opacity .4s ease; pointer-events: none !important; }
.guide.out * { pointer-events: none !important; }
.rk-gap { text-align: center; color: var(--muted); font-size: 12px; margin: 6px 0 2px; letter-spacing: .04em; }
.rk-gap::before, .rk-gap::after { content: '· · ·'; margin: 0 8px; opacity: .6; }
/* VIP на витрине: главное — короткими плитками в две колонки, полный текст — по «Подробнее» */
.vip-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.vip-chips span { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 9px; background: rgba(0,0,0,.22); font-size: 12.5px; line-height: 1.2; }
.vip-chips svg { flex: none; stroke: #f1c34e; fill: none; }
.vip-more { margin-top: 8px; font-size: 13px; }
.vip-more summary { cursor: pointer; color: var(--muted); font-weight: 700; font-size: 12.5px; list-style: none; text-align: center; padding: 4px 0; }
.vip-more summary::-webkit-details-marker { display: none; }
.vip-more summary::after { content: ' ▾'; }
.vip-more[open] summary::after { content: ' ▴'; }
.vip-more ul { list-style: none; margin: 8px 0 0; display: grid; gap: 5px; }
.vip-more li svg { stroke: var(--green); vertical-align: -2px; }
.vip-more .vip-not { margin-top: 4px; }
.vip-more .vip-not li svg { stroke: #ff8b7e; }
.vip-not-t { display: block; margin-top: 10px; color: var(--muted); font-size: 12.5px; }
.vip-more small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.4; }
/* наборы на витрине — мелкие плитки, чтобы карточка не растягивалась на пол-экрана */
.shop-card .reward-pop { justify-content: flex-start; gap: 5px; margin: 8px 0 0; }
.shop-card .reward-pop span { padding: 3px 8px; font-size: 12.5px; gap: 4px; border-radius: 8px; }
.shop-card .reward-pop .ri, .shop-card .reward-pop img { width: 18px; height: 18px; }

/* ================================================================ живой город (двигается и приближается) */
.c3d { position: relative; overflow: hidden; isolation: isolate; border-radius: var(--r); touch-action: none; user-select: none;
    height: clamp(380px, calc(100dvh - var(--top, 0px) - var(--bottom, 64px) - 250px), 980px); background: #0d120c; cursor: grab; }
.c3d:active { cursor: grabbing; }
.page[data-screen="city"] .c3d > .city-scene, .c3d > .city-scene { position: absolute; left: 0; top: 0; max-width: none !important; margin: 0 !important; border-radius: 0;
    transform-origin: 0 0; aspect-ratio: 1 / 1; height: auto; overflow: visible; }
.c3d > .city-scene::after { display: none; }
/* подписи и таймеры не растут вместе с городом — как пузыри в больших стратегиях */
.c3d .spot > * { scale: var(--inv, 1); transform-origin: 50% 0; }
.c3d .spot { transition: margin-top .25s ease; }
.c3d .bsprite { transform-origin: 50% 90%; transition: filter .3s; }
.c3d .bsprite.tap { animation: c3-squash .42s cubic-bezier(.3,1.6,.5,1); }
@keyframes c3-squash { 0% { scale: 1; } 35% { scale: 1.035 .95; } 70% { scale: .985 1.025; } 100% { scale: 1; } }
/* готово к бесплатному завершению — зелёная галочка над зданием */
.c3-ok { display: grid; place-items: center; width: 34px; height: 34px; margin: 0 auto 4px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #8ff07a, #2f9a2a);
    box-shadow: 0 0 0 2px #e9ffd9, 0 6px 14px rgba(0,0,0,.45), 0 0 16px rgba(120,240,110,.55); animation: c3-bob 1.6s ease-in-out infinite; }
.c3-ok svg { stroke: #fff; stroke-width: 3; }
.c3-ok.pop { animation: c3-pop .35s ease-out forwards; }
@keyframes c3-bob { 50% { translate: 0 -5px; } }
@keyframes c3-pop { to { scale: 1.6; opacity: 0; } }
/* тени облаков бегут по земле — объём и «воздух» */
.c3-shade { position: absolute; inset: 0; pointer-events: none; z-index: 140; overflow: hidden; opacity: .5; }
.c3-shade i { position: absolute; width: 60%; height: 40%; border-radius: 50%; background: radial-gradient(closest-side, rgba(10,16,24,.5), rgba(10,16,24,.2) 55%, transparent); will-change: transform;
    animation: c3-drift 70s linear infinite; }
.c3-shade i:nth-child(2) { width: 45%; height: 30%; top: 45%; animation-duration: 95s; animation-delay: -40s; }
@keyframes c3-drift { from { transform: translate(-70%, -10%); } to { transform: translate(190%, 40%); } }
/* свет по времени суток игрока */
.c3-tint { position: absolute; inset: 0; pointer-events: none; z-index: 150; transition: background 2s; }
.c3d[data-period="morning"] .c3-tint { background: linear-gradient(160deg, rgba(255,196,120,.12), rgba(255,230,190,.03) 60%, transparent); }
.c3d[data-period="evening"] .c3-tint { background: linear-gradient(200deg, rgba(170,80,20,.13), rgba(70,20,60,.10)); }
.c3d[data-period="night"] .c3-tint { background: radial-gradient(120% 90% at 50% 40%, rgba(10,20,60,.30), rgba(5,8,30,.52)); }
/* облака над городом: ближе к «камере», поэтому едут быстрее земли (параллакс) */
.c3-sky { position: absolute; inset: -30%; pointer-events: none; z-index: 5; transform: translate3d(var(--px, 0), var(--py, 0), 0); }
.c3-sky i { position: absolute; width: 55%; height: 22%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,255,255,.16), rgba(255,255,255,.06) 55%, transparent); will-change: transform;
    animation: c3-cloud 80s linear infinite; }
.c3-sky i:nth-child(1) { top: 25%; }
.c3-sky i:nth-child(2) { top: 55%; width: 40%; animation-duration: 110s; animation-delay: -60s; opacity: .7; }
.c3-sky i:nth-child(3) { top: 75%; width: 65%; animation-duration: 140s; animation-delay: -20s; opacity: .5; }
@keyframes c3-cloud { from { transform: translateX(-60%); } to { transform: translateX(200%); } }
.c3d[data-period="night"] .c3-sky i { background: radial-gradient(closest-side, rgba(150,170,230,.12), transparent); }
.c3d.zoomed .c3-sky { opacity: .35; transition: opacity .6s; }
.c3-edge { position: absolute; inset: 0; pointer-events: none; z-index: 6; box-shadow: inset 0 0 70px 10px rgba(0,0,0,.6); border-radius: inherit; }
.c3-ui { position: absolute; right: 10px; bottom: 10px; z-index: 10; display: grid; gap: 8px; justify-items: end; }
.c3-ui button { width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(12,15,22,.78); color: var(--gold2);
    box-shadow: inset 0 0 0 1.5px rgba(216,178,94,.55), 0 4px 12px rgba(0,0,0,.45); cursor: pointer; backdrop-filter: blur(4px); }
.c3-ui button svg { stroke: currentColor; fill: none; }
.c3-ui button:active { transform: scale(.92); }
.c3-ui .c3-names { width: auto; height: 32px; border-radius: 999px; padding: 0 12px; font: inherit; font-size: 12px; font-weight: 700; }
.c3-hint { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 10; pointer-events: none; padding: 7px 14px; border-radius: 999px; font-size: 12.5px;
    background: rgba(10,12,18,.8); color: #f4e7c4; box-shadow: inset 0 0 0 1px rgba(216,178,94,.45); white-space: nowrap; animation: c3-hint 3.2s ease-in-out infinite; transition: opacity .5s; }
.c3-hint.gone { opacity: 0; }
@keyframes c3-hint { 50% { translate: 0 3px; } }
html.lite .c3-sky, html.lite .c3-shade, .c3-lite .c3-sky, .c3-lite .c3-shade { display: none; }
@media (prefers-reduced-motion: reduce) { .c3-sky i, .c3-shade i, .c3-ok, .c3-hint { animation: none; } }
/* ПК: живой город слева во всю высоту окна */
@media (min-width: 1200px) and (hover: hover) { .page[data-screen="city"] .city-cols:not(.one) .city-left .c3d { width: var(--scene); height: var(--scene); margin-top: 0 !important; box-shadow: 0 18px 60px rgba(0,0,0,.65), 0 0 0 1px rgba(216,178,94,.35); } .page[data-screen="city"] .c3d > .city-scene { box-shadow: none; } }

/* ресурсы — строкой под аватаром и кнопками (сверху они упирались в строку состояния телефона) */
.c3-top, .c3-q { display: none; }
/* ================================================================ телефон: живой город на весь экран, шапка и меню поверх */
@media (max-width: 1199px), (hover: none) {
    html.city-live .hud { position: absolute; left: 0; right: 0; top: 0; z-index: 7; border-bottom: 0; box-shadow: none; pointer-events: none;
        background: linear-gradient(180deg, rgba(6,8,12,.92) 0%, rgba(6,8,12,.6) 62%, rgba(6,8,12,0) 100%); padding-bottom: 14px; }
    html.city-live .hud > * { pointer-events: auto; }
    html.city-live .hud .res { background: rgba(0,0,0,.55); backdrop-filter: blur(3px); }
    .page.city-live { padding: 0 !important; overflow: hidden; }
    .page.city-live > .page-head, .page.city-live > .fort-tabs, .page.city-live .city-right { display: none; }
    .page.city-live .city-cols, .page.city-live .city-left { display: block; height: 100%; }
    .page.city-live .c3d { position: absolute; inset: 0; height: auto !important; margin: 0 !important; border-radius: 0; box-shadow: none; border: 0; }
    .page.city-live .c3d.frame::before, .page.city-live .c3d.frame::after { display: none; }
    .page.city-live .c3-edge { box-shadow: inset 0 -40px 60px -20px rgba(0,0,0,.55); }
    .page.city-live .c3-top { display: grid; gap: 6px; position: absolute; left: 10px; right: 10px; top: calc(var(--hud-h, 150px) - 6px); z-index: 9; pointer-events: none; }
    .page.city-live .c3-top > * { pointer-events: auto; }
    .page.city-live .c3-top .fort-tabs { margin: 0; }
    .c3-top-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .c3-top-row .seg { background: rgba(10,12,18,.72); backdrop-filter: blur(4px); }
    .page.city-live .c3-top .c3-hint { position: static; transform: none; justify-self: center; }
    /* очереди — свёрнутой строкой над нижним меню */
    .page.city-live .c3-q { display: block; position: absolute; left: 78px; right: 62px; bottom: calc(var(--nav-h, 64px) + 10px); z-index: 9; max-height: 46vh; overflow-y: auto; }
    .page.city-live .c3-q:empty { display: none; }
    .page.city-live .c3-q .frame { background: rgba(12,15,22,.86); backdrop-filter: blur(5px); }
    .page.city-live .c3-q .q-head { padding: 6px 10px; }
    .page.city-live .c3-q .qitem { padding: 8px 10px; }
    .page.city-live .c3-ui { bottom: calc(var(--nav-h, 64px) + 10px); }
    /* нижнее меню — стекло поверх города */
    html.city-live .nav { background: linear-gradient(180deg, rgba(14,17,25,.55), rgba(6,8,12,.88)); backdrop-filter: blur(8px); border-top-color: rgba(216,178,94,.18); }
}

/* ================================================================ нижнее меню — плавающая панель (телефон) */
.nav-pill { display: none; }
@media (max-width: 1199px), (hover: none) {
    .nav { left: 10px; right: 10px; width: auto; transform: none; bottom: calc(var(--bottom) + 10px); padding: 6px; gap: 0; border-radius: 26px; border: 0;
        background: rgba(14,17,25,.78); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
        box-shadow: inset 0 0 0 1px rgba(216,178,94,.22), 0 10px 30px rgba(0,0,0,.55); }
    html.city-live .nav { background: rgba(14,17,25,.62); }
    .nav button { z-index: 1; padding: 5px 0 3px; border-radius: 20px; transition: color .25s; }
    .nav button.active { background: none; }
    .nav button.active::before { display: none; }
    /* «пилюля» под активной вкладкой — переезжает пружинкой */
    .nav-pill { display: block; position: absolute; z-index: 0; top: 6px; bottom: 6px; left: var(--pill-x, 6px); width: var(--pill-w, 20%); border-radius: 20px;
        background: radial-gradient(90% 120% at 50% 100%, rgba(255,205,110,.30), rgba(255,205,110,.08)); box-shadow: inset 0 0 0 1px rgba(255,214,130,.45), 0 0 18px rgba(255,190,80,.18);
        transition: left .45s cubic-bezier(.3,1.35,.5,1), width .45s cubic-bezier(.3,1.35,.5,1); }
    .nav button.bounce .uico, .nav button.bounce svg { animation: nav-bounce .55s cubic-bezier(.3,1.6,.5,1); }
    @keyframes nav-bounce { 0% { transform: translateY(0) scale(1); } 35% { transform: translateY(-6px) scale(1.18); } 65% { transform: translateY(1px) scale(.96); } 100% { transform: translateY(-2px) scale(1.08); } }
}
@media (prefers-reduced-motion: reduce) { .nav-pill { transition: none !important; } }

/* скорость живого города на телефоне: без тяжёлых фильтров и размытия поверх движущейся картинки */
.c3d .city-scene.layered .bsprite, .c3d .city-scene.layered .bsprite.busy, .c3d .city-scene.layered .bsprite.hov { filter: none; transition: none; }
.c3d .city-scene.layered .bsprite.tap { filter: brightness(1.2); }
@media (max-width: 1199px), (hover: none) {
    html.city-live .hud .res, .page.city-live .c3-q .frame, .c3-top-row .seg, .c3-ui button, html.city-live .nav { backdrop-filter: none; -webkit-backdrop-filter: none; }
    html.city-live .nav { background: rgba(14,17,25,.9); }
    .page.city-live .c3-q .frame { background: rgba(12,15,22,.94); }
    .page.city-live .c3-edge { box-shadow: none; background: linear-gradient(180deg, transparent 75%, rgba(0,0,0,.35)); }
    /* помощник — над нижним меню, а не на кнопке «Город» */
    .sage-btn { bottom: calc(var(--nav-h, 74px) + 10px); }
    /* «картина и список» — только на ПК; на телефоне: живой город или список */
    .seg [data-view="both"] { display: none; }
}
/* очереди в живом городе — компактная пилюля слева, раскрывается по нажатию */
@media (max-width: 1199px), (hover: none) {
    .page.city-live .c3-q { right: auto; max-width: calc(100% - 150px); }
    .page.city-live .c3-q .queues.open { width: calc(100vw - 150px); }
    .page.city-live .c3-q .q-head { border-radius: 999px; padding: 5px 12px 5px 6px; gap: 8px; }
    .page.city-live .c3-q .qh-ico { width: 28px; height: 28px; }
    .page.city-live .c3-q .qh-text b { font-size: 12.5px; }
    .page.city-live .c3-q .qh-text small { font-size: 11px; }
}
/* край мира: картина у краёв растворяется в дымке того же цвета, что и фон окна, — копий города и рамок не видно.
   Дымка ниже зданий: постройки у края не тонут в тумане. */
.c3d { --fog: rgb(17,22,24); background: radial-gradient(120% 90% at 50% 45%, rgb(26,32,34), var(--fog)); }
.c3-around { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.c3-around .c3-fog { position: absolute; inset: 0;
    background: linear-gradient(90deg, var(--fog), rgba(17,22,24,.6) 3%, rgba(17,22,24,.18) 7%, transparent 11%, transparent 89%, rgba(17,22,24,.18) 93%, rgba(17,22,24,.6) 97%, var(--fog)),
                linear-gradient(180deg, var(--fog), rgba(17,22,24,.6) 3%, rgba(17,22,24,.18) 7%, transparent 11%, transparent 89%, rgba(17,22,24,.18) 93%, rgba(17,22,24,.6) 97%, var(--fog)); }
/* «Донесения» → «Обновления»: все патч-ноуты */
.pn-card { padding: 10px 14px; border-radius: var(--r); margin-bottom: 8px; }
.pn-card summary { display: flex; align-items: baseline; gap: 10px; cursor: pointer; list-style: none; }
.pn-card summary::-webkit-details-marker { display: none; }
.pn-card summary b { flex: 1; color: var(--gold2); font-size: 14.5px; }
.pn-card summary small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.pn-card summary::after { content: '▾'; color: var(--muted); }
.pn-card[open] summary::after { content: '▴'; }
.pn-card ul { margin: 8px 0 2px; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; line-height: 1.45; }
.pn-card li b { color: var(--gold2); }

/* ---- альянс: уровень, казна, звания ---- */
.ally-lvl { display: flex; gap: 12px; align-items: center; padding: 10px 12px; margin-bottom: 10px; cursor: pointer; }
.ally-lvl-badge { width: 50px; height: 50px; flex: none; border-radius: 14px; display: grid; place-items: center; align-content: center; line-height: 1;
    background: linear-gradient(180deg, #ffe7a3, #b8862f); color: #2a1a06; box-shadow: 0 0 0 1px #000, inset 0 1px 0 rgba(255,255,255,.5); }
.ally-lvl-badge small { font-size: 10px; font-weight: 700; text-transform: uppercase; opacity: .7; }
.ally-lvl-badge b { font-size: 22px; font-family: 'Cormorant SC', serif; }
.ally-lvl-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.ally-lvl .bar, .ar-card .bar, #atab .frame > .bar { height: 7px; border-radius: 6px; background: rgba(0,0,0,.45); margin: 6px 0; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(216,178,94,.2); }
.ally-lvl .bar i, .ar-card .bar i, #atab .frame > .bar i { display: block; height: 100%; background: linear-gradient(90deg, #c9993f, #ffe08a); border-radius: 6px; }
.ally-perks { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); }
.ally-perks span:first-child { color: var(--green, #7fd18b); }
.tr-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 10px; }
.tr-cell { position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 2px 10px; border-radius: 10px; background: rgba(0,0,0,.35); box-shadow: inset 0 0 0 1px rgba(216,178,94,.15); overflow: hidden; font-size: 13px; }
.tr-cell .ri { width: 26px; height: 26px; }
.tr-cell i { position: absolute; left: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, #c9993f, #ffe08a); }
.tr-line { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 4px 0; }
.tr-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tr-chip .ri { width: 18px; height: 18px; }
.tr-ic .ri { width: 30px; height: 30px; }
.tr-log { margin-top: 12px; font-size: 12.5px; line-height: 1.5; }
.tr-log summary { cursor: pointer; color: var(--muted); padding: 6px 0; }
.tr-log div { padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.ally-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.ally-tabs .badge { flex: none; width: auto; }
.tr-in { width: 92px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: #0b0d12; color: inherit; text-align: center; font-weight: 700; font-size: 15px; outline: none; }
.tr-in:focus, .field select:focus { border-color: var(--gold); }
.field select { width: 100%; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: #0b0d12; color: inherit; padding: 0 12px; font-size: 15px; }
.field textarea { width: 100%; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.5); padding: 10px 12px; font-size: 15px; resize: vertical; }

/* ---- чат: упоминания, перевод, подсказка имён ---- */
.msg b[data-at] { cursor: pointer; }
.msg .mention { color: #8fc7ff; font-weight: 700; }
.msg .mention.me { color: #2a1a06; background: linear-gradient(180deg, #ffe7a3, #c9993f); border-radius: 5px; padding: 0 3px; }
.msg.ping { box-shadow: inset 0 0 0 1px rgba(255,214,120,.55); }
.msg .mtr { display: block; margin-top: 4px; padding-top: 4px; border-top: 1px dashed rgba(255,255,255,.12); color: #d9e6f5; }
.msg .mtr i { display: block; font-size: 10.5px; color: var(--muted); font-style: normal; margin-top: 2px; text-transform: lowercase; }
.chat-sug { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0; }
.chat-sug[hidden] { display: none; }
.chat-sug button { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: rgba(0,0,0,.45); box-shadow: inset 0 0 0 1px rgba(216,178,94,.3); font-size: 13px; font-weight: 700; }
.chat-sug img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
/* свёрнутая очередь в живом городе — узкая: заголовок в одну строку, значок «бесплатно» компактный */
.qh-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page.city-live .c3-q .qh-free { display: inline-flex; align-items: center; gap: 3px; padding: 3px 7px; font-size: 10.5px; }
.page.city-live .c3-q .qh-free svg { stroke: #0f2a0c; fill: none; stroke-width: 3; }
.page.city-live .c3-q .q-head { gap: 8px; }
.page.city-live .c3-q .qh-ico { width: 28px; height: 28px; }

/* исследования альянса */
.ar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.ar-card { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.ar-card.focus { box-shadow: inset 0 0 0 1px rgba(243,217,142,.7); }
.ar-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ar-lvl { font-size: 12px; color: var(--muted); }
.ar-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.ar-row > span { flex: 1; font-size: 12.5px; display: flex; align-items: center; gap: 4px; }
.ar-row .btn.sm svg { width: 13px; height: 13px; }
.ally-tabs { overflow-x: auto; scrollbar-width: none; }
.ally-tabs button { white-space: nowrap; }
.list .row.me { box-shadow: inset 0 0 0 1px rgba(243,217,142,.5); }
.rally-chip { display: flex; align-items: center; gap: 6px; justify-content: center; width: 100%; margin-top: 6px; padding: 7px 10px; border: 0; border-radius: 10px;
    background: rgba(168,50,58,.35); box-shadow: inset 0 0 0 1px rgba(255,120,100,.5); color: #ffd9d2; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.lord-sub { flex-wrap: wrap; row-gap: 0; }
.lord-sub .pw, .lord-sub .def { font-size: 11px; white-space: nowrap; line-height: 1.35; }
.lord-sub .pw b { color: var(--text, #efe6d2); font-size: 12.5px; }
.lord-sub .def b { color: #9fc3ff; font-size: 12.5px; }
/* стройка: «бесплатно» — золотые песочные часы (не путать с галочкой «построено») */
.c3-free { display: flex; flex-direction: column; align-items: center; gap: 1px; margin: 0 auto 4px; width: max-content; padding: 5px 8px 3px; border-radius: 12px;
    background: radial-gradient(circle at 35% 30%, #ffe28a, #c08a1f); color: #2a1a05; box-shadow: 0 2px 8px rgba(0,0,0,.5); cursor: pointer; animation: c3-free 1.6s ease-in-out infinite; will-change: transform; }
.c3-free svg { stroke: #2a1a05; stroke-width: 2.4; }
.c3-free i { font-style: normal; font-size: 9.5px; font-weight: 800; letter-spacing: .02em; }
@keyframes c3-free { 50% { transform: scale(1.08); } }
/* пульс — кольцом на ::after через transform/opacity (считается видеокартой; анимация box-shadow перерисовывала весь живой город) */
.c3-ok.built { cursor: pointer; position: relative; }
.c3-ok.built::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 3px solid rgba(143,240,122,.8);
    animation: c3-built 1.2s ease-out infinite; will-change: transform, opacity; pointer-events: none; }
@keyframes c3-built { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
.bcard > .c3-ok.built { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); z-index: 3; margin: 0; }
@media (prefers-reduced-motion: reduce) { .c3-free, .c3-ok.built::after { animation: none; } }
.lite .c3-free, .lite .c3-ok.built::after { animation: none; }
.barter { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; margin: 10px 0; }
.barter .ask-gift { margin: 0; }
.barter .ask-gift.get { box-shadow: inset 0 0 0 1px rgba(111,211,106,.5); }
.barter-arrow { font-size: 22px; color: var(--gold, #f3d98e); }
@media (max-width: 420px) { .barter { grid-template-columns: 1fr; } .barter-arrow { text-align: center; transform: rotate(90deg); } }
/* армия: сколько дома и сколько едят — крупно */
.army-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.as-tile { background: rgba(0,0,0,.35); border-radius: 12px; padding: 8px 10px; box-shadow: inset 0 0 0 1px rgba(216,178,94,.25); display: flex; flex-direction: column; gap: 2px; }
.as-tile small { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.as-tile small .ri { width: 14px; height: 14px; }
.as-tile b { font-size: 20px; line-height: 1.1; }
/* карточка воина: главное — атака, защита, здоровье */
.ustat-main { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 8px; }
.um { border-radius: 12px; padding: 8px 10px; text-align: center; background: rgba(0,0,0,.4); }
.um small { display: flex; justify-content: center; gap: 4px; align-items: center; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.um b { font-size: 24px; font-family: Georgia, serif; }
.um.atk { box-shadow: inset 0 0 0 1px rgba(255,120,100,.55); } .um.atk b { color: #ff9c8a; }
.um.def { box-shadow: inset 0 0 0 1px rgba(120,170,255,.55); } .um.def b { color: #9fc3ff; }
.um.hp { box-shadow: inset 0 0 0 1px rgba(111,211,106,.55); } .um.hp b { color: #9fe39a; }
.ustat-sub { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.ustat-sub b { color: var(--text, #efe6d2); }
.cls-more { margin: 4px 0 8px; font-size: 13px; }
.cls-more summary { cursor: pointer; color: var(--muted); }
.march-fold { align-self: flex-start; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; background: rgba(8,10,15,.88); color: var(--muted); box-shadow: inset 0 0 0 1px rgba(216,178,94,.3); }
.march-dot { display: flex; align-items: center; gap: 3px; padding: 6px 9px; border-radius: 999px; background: rgba(8,10,15,.9); box-shadow: inset 0 0 0 1px rgba(216,178,94,.4); }
.march-dot.hostile { box-shadow: inset 0 0 0 2px rgba(255,59,48,.8); }
.march-dot i { width: 9px; height: 9px; border-radius: 50%; }
.march-dot b { margin-left: 4px; font-size: 12px; }
.legend-marches { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; }
.legend-marches span { display: inline-flex; align-items: center; gap: 4px; }
.legend-marches b { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
/* недельные награды арены — крупно */
.arena-week { padding: 12px 14px; margin-top: 10px; }
.aw-top b { font-size: 16px; }
.aw-timer { font-size: 12.5px; color: var(--muted); }
.aw-timer b { color: var(--gold2); font-size: 13px; }
.aw-prizes { display: grid; gap: 8px; margin-top: 10px; }
.aw-prize { display: grid; gap: 6px; padding: 8px 10px; border-radius: 12px; background: rgba(0,0,0,.35); box-shadow: inset 0 0 0 1px rgba(216,178,94,.2); }
.aw-prizes > .aw-prize { grid-template-columns: none; }
.aw-prize.first { background: linear-gradient(135deg, rgba(216,178,94,.22), rgba(0,0,0,.35)); box-shadow: inset 0 0 0 1px rgba(243,217,142,.6); }
.aw-prize.mine { box-shadow: inset 0 0 0 2px rgba(111,211,106,.8); }
.aw-place { display: flex; align-items: center; gap: 6px; color: var(--gold2); }
.aw-you { margin-left: auto; font-size: 11px; font-weight: 800; color: #0d1a0c; background: #8fe08a; border-radius: 999px; padding: 1px 8px; }
.aw-loot { display: flex; flex-wrap: wrap; gap: 6px; }
.aw-loot span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: rgba(0,0,0,.35); font-size: 13px; }
.aw-loot .ri { width: 18px; height: 18px; }
.aw-loot small { color: var(--muted); font-size: 11px; }
/* можно улучшить — зелёная стрелка прямо на подписи здания в городе */
.spot .tag .t-up { display: inline-grid; place-items: center; width: 15px; height: 15px; margin-left: 5px; vertical-align: -3px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #a6f08a, #3f9a2f); box-shadow: 0 0 8px rgba(130,230,110,.6); animation: t-up 1.8s ease-in-out infinite; }
.spot .tag .t-up svg { width: 10px; height: 10px; stroke: #0f2a0c; stroke-width: 3.4; fill: none; }
@keyframes t-up { 50% { translate: 0 -2px; } }
@media (prefers-reduced-motion: reduce) { .spot .tag .t-up { animation: none; } }

.quest-track { display: none; }
/* ================================================================ ПК: город во весь экран, всё «моё» — колонкой слева
   Зоны: сверху — лорд, ресурсы, кнопки; слева — задания с советником и очереди; снизу по центру — разделы; справа внизу — камера. */
@media (min-width: 1200px) and (hover: hover) {
    .page[data-screen="city"].city-live { display: block; padding: 0 !important; overflow: hidden; }
    .page[data-screen="city"].city-live > .page-head, .page[data-screen="city"].city-live > .fort-tabs,
    .page[data-screen="city"].city-live > .event-chip, .page[data-screen="city"].city-live .city-right { display: none; }
    .page[data-screen="city"].city-live > .city-cols, .page[data-screen="city"].city-live .city-cols > .city-left { display: block; position: static; height: 100%; }
    .page[data-screen="city"].city-live .city-cols .city-left .c3d { position: absolute; inset: 0; width: auto !important; height: auto !important; margin: 0 !important;
        border-radius: 0; box-shadow: none !important; border: 0; }
    .page[data-screen="city"].city-live .c3d.frame::before, .page[data-screen="city"].city-live .c3d.frame::after { display: none; }
    .page[data-screen="city"].city-live .c3-edge { box-shadow: inset 0 0 90px 10px rgba(0,0,0,.5); border-radius: 0; }
    /* вкладки замков, событие дня и вид — строкой справа сверху */
    .page[data-screen="city"].city-live .c3-top { display: flex; align-items: center; gap: 10px; position: absolute; top: 16px; right: 24px; z-index: 9; }
    .page[data-screen="city"].city-live .c3-top .fort-tabs { margin: 0; }
    .page[data-screen="city"].city-live .c3-top-row { display: flex; align-items: center; gap: 10px; }
    .page[data-screen="city"].city-live .c3-top .c3-hint { position: static; transform: none; }
    .page[data-screen="city"].city-live .c3-top-row .seg { background: rgba(10,12,18,.8); }
    /* очереди — под заданиями, той же колонкой */
    .page[data-screen="city"].city-live .c3-q { display: block; position: absolute; left: 24px; bottom: 24px; width: 330px; z-index: 9; max-height: calc(100% - var(--qk-h, 220px) - 60px); overflow-y: auto; }
    .page[data-screen="city"].city-live .c3-q:empty { display: none; }
    .page[data-screen="city"].city-live .c3-q .frame { background: rgba(12,15,22,.9); }
    .page[data-screen="city"].city-live .c3-ui { right: 24px; bottom: 24px; }
    html.city-live .to-top { display: none; }

    /* — задания: заметная панель слева под лордом; советник — портретом в её шапке — */
    /* на городе и карте — панель; на страницах-списках (армия, альянс…) она закрыла бы текст — там прежняя кнопка */
    :root[data-screen="city"] .quest-tab, :root[data-screen="map"] .quest-tab { display: none; }
    :root[data-screen="city"] .quest-track, :root[data-screen="map"] .quest-track { display: block; }
    .quest-track { position: fixed; z-index: 30; left: 24px; top: calc(var(--hud-h, 78px) + 14px); width: 330px; border-radius: 16px; padding: 10px 12px 12px;
        background: linear-gradient(180deg, rgba(22,26,36,.94), rgba(12,15,22,.94)); box-shadow: inset 0 0 0 1px rgba(216,178,94,.35), 0 12px 34px rgba(0,0,0,.55); }
    :root[data-screen="city"] .sage-btn, :root[data-screen="map"] .sage-btn { left: 34px; top: calc(var(--hud-h, 78px) + 22px); bottom: auto; width: 48px; height: 48px; }
    :root[data-screen="map"] .map-ui { padding-left: 350px; }      /* координаты — правее панели заданий */
    :root[data-screen="city"] .sage-tip, :root[data-screen="map"] .sage-tip { left: 370px; top: calc(var(--hud-h, 78px) + 14px); bottom: auto; }
}
.qk-head { display: flex; align-items: center; gap: 10px; min-height: 50px; padding-left: 56px; cursor: pointer; }
.qk-title { flex: 1; min-width: 0; display: grid; line-height: 1.15; }
.qk-title b { font-family: 'Cormorant SC', Georgia, serif; font-size: 17px; color: var(--gold2); }
.qk-title small { font-size: 12px; color: var(--muted); }
.qk-head .badge { position: static; }
.qk-fold { width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(255,255,255,.05); color: var(--gold2); display: grid; place-items: center; }
.qk-fold svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.4; transition: transform .2s; transform: rotate(90deg); }
.quest-track.fold .qk-fold svg { transform: rotate(-90deg); }
.quest-track.fold .qk-body { display: none; }
.qk-main { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: rgba(0,0,0,.3); box-shadow: inset 0 0 0 1px rgba(216,178,94,.18); }
.qk-main.ready { box-shadow: inset 0 0 0 1.5px rgba(143,224,138,.75), 0 0 18px rgba(120,220,100,.15); }
.qk-text { font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.qk-main .cost { margin-top: 8px; }
.qk-act { margin-top: 10px; display: flex; gap: 8px; }
.qk-act .btn { flex: 1; }
.qk-day { width: 100%; margin-top: 8px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 10px;
    background: rgba(255,255,255,.04); color: var(--text); font: inherit; font-size: 12.5px; text-align: left; position: relative; }
.qk-day:hover, .qk-all:hover { background: rgba(255,255,255,.08); }
.qk-day .pointsbar { margin: 0; height: 6px; }
.qk-day small { color: var(--muted); }
.qk-day .badge { position: absolute; top: -6px; right: -6px; }
.qk-all { width: 100%; margin-top: 6px; padding: 7px; border: 0; border-radius: 10px; background: none; color: var(--gold2); font: inherit; font-size: 12.5px; font-weight: 700; }
.qk-all kbd { margin-left: 6px; padding: 0 5px; border-radius: 4px; font: inherit; font-size: 11px; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }

/* ================================================================ армия и арена: картинки вместо строк */
/* войско портретами с числом */
.troops { display: flex; flex-wrap: wrap; gap: 6px; }
.troop { position: relative; width: 48px; height: 48px; flex: none; border-radius: 10px; overflow: hidden; background: #0b0d12; box-shadow: inset 0 0 0 1px rgba(216,178,94,.35); }
.troop img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; display: block; }
.troop b { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 0 1px; text-align: center; font-size: 11px; line-height: 1; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.9)); }
.troop.more { display: grid; place-items: center; background: rgba(255,255,255,.05); }
.troop.more b { position: static; padding: 0; background: none; color: var(--gold2); }
.march-troops, .rival-troops { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.march-troops > .muted, .rival-troops > .muted { font-size: 12px; }
.row .grow .troops { margin-top: 6px; }
.row .grow .troop { width: 38px; height: 38px; }
/* награды значками */
.prize { display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: 999px; background: rgba(0,0,0,.35); font-size: 13px; }
.prize .ri { width: 18px; height: 18px; }
.prize .ico { stroke: var(--gold2); }
.prize small { font-size: 10.5px; font-weight: 800; color: var(--gold2); }
/* шапка армии: воины и еда шкалами */
.army-sum.v2 { grid-template-columns: minmax(150px, 1fr) 2fr; }
.as-men { flex-direction: row !important; align-items: center; gap: 10px !important; }
.as-men .ico { stroke: var(--gold2); flex: none; }
.as-men b { display: block; font-size: 24px; }
.as-men small { font-size: 11.5px; color: var(--muted); }
.as-food { gap: 5px !important; }
.as-food.bad { box-shadow: inset 0 0 0 1px rgba(255,107,92,.55); }
.fm-head { display: flex; align-items: center; gap: 6px; }
.fm-head .ri { width: 20px; height: 20px; }
.fm-head b { font-size: 18px; }
.fm-warn { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; color: #ff8a7a; }
.fm-warn .ico { stroke: currentColor; }
.fm-head .help-q { margin-left: auto; }
.fm { display: grid; grid-template-columns: 16px 1fr auto; align-items: center; gap: 6px; font-size: 11.5px; }
.fm .ico { stroke: #8fe08a; }
.fm i { height: 7px; border-radius: 4px; background: rgba(255,255,255,.07); overflow: hidden; }
.fm em { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #4f9a3c, #9fe07f); }
.fm.eat .ico { stroke: #ff8a7a; }
.fm.eat em { background: linear-gradient(90deg, #a8382c, #ff8a7a); }
.fm b { min-width: 58px; text-align: right; }
/* карточка отряда: число дома крупно, нет воинов — приглушена, обучение — полоской */
.ucard .count { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.ucard .count .ico { stroke: var(--gold2); }
.ucard .count b { font-size: 16px; }
.ucard.none .portrait img, .ucard.none .portrait video { filter: grayscale(.55) brightness(.62); }
.ucard.none .count b { color: var(--muted); }
.utrain { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; padding: 1px 6px; border-radius: 999px; font-size: 11px; font-weight: 800; color: #0d2333; background: linear-gradient(180deg, #bfe4ff, #6fb2e6); }
.utrain .ico { stroke: currentColor; }
.ucard .ubody .timer, .ucard .ubody .tbar { margin-top: 5px; }
.ucard .lock { gap: 4px; align-content: center; padding: 0; }
.ucard .lock .ico { stroke: var(--muted); margin: 0 auto; }
.ucard .lock .lk { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 3px; border-radius: 999px; background: rgba(0,0,0,.6); box-shadow: inset 0 0 0 1px rgba(216,178,94,.35); color: var(--gold2); font-size: 13px; }
.ucard .lock .lk img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.section-title .cls-ico { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 6px; border-radius: 50%; background: rgba(216,178,94,.14); vertical-align: -5px; }
.section-title .cls-ico .ico { stroke: var(--gold2); }
.locked-cls { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.locked-cls img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; filter: grayscale(.6) brightness(.7); }
.locked-cls b { display: block; }
.locked-cls small { color: var(--muted); }
/* лазарет и академия — картинкой здания со шкалой */
.ward-head { display: flex; align-items: center; gap: 12px; }
.ward-head > img { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; flex: none; }
.ward-head .pointsbar { margin: 6px 0 2px; height: 8px; }
.ward-head small { color: var(--muted); font-size: 12px; }
/* арена */
.aw-top .help-q { margin-left: 4px; }
.aw-timer { display: inline-flex; align-items: center; gap: 4px; }
.aw-timer .ico { stroke: var(--muted); }
.aw-prizes.podium { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.aw-prizes.podium .aw-loot { gap: 4px; }
.aw-need { margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: #ffb4a8; background: rgba(255,107,92,.12); }
.aw-need .ico { stroke: currentColor; }
.arena-mine { padding: 12px; margin-top: 10px; }
.am-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.am-head .ico { stroke: var(--gold2); vertical-align: -2px; }
.army-sum.v2 > * { min-width: 0; }
.fm-head b { white-space: nowrap; }
@media (max-width: 560px) {
    .army-sum.v2 { grid-template-columns: 1fr; }
    .as-men b { font-size: 20px; display: inline; margin-right: 6px; }
    .fm b { min-width: 0; font-size: 12px; }
}

/* ================================================================ времена года */
.season-ico { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.s-winter { --sc: #bfe3ff; } .s-spring { --sc: #9fe07f; } .s-summer { --sc: #ffd36b; } .s-autumn { --sc: #ff9a4a; }
/* значок на аватаре лорда */
.lord-avatar { position: relative; }
.season-dot { position: absolute; top: -3px; right: -5px; z-index: 2; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
    color: var(--sc); background: #11151d; box-shadow: 0 0 0 1.5px var(--sc), 0 2px 6px rgba(0,0,0,.6); cursor: pointer; }
/* плашка в городе */
.season-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; margin-left: 6px; border: 0; border-radius: 999px; font: inherit; font-size: 12.5px;
    color: var(--sc); background: rgba(10,12,18,.8); box-shadow: inset 0 0 0 1px var(--sc); cursor: pointer; }
.season-chip b { color: var(--text); font-weight: 700; }
.season-chip span { color: var(--muted); font-size: 11.5px; }
.c3-top-row .season-chip { margin-left: 0; }
/* окно «Время года» */
.se-head { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; color: var(--sc);
    background: linear-gradient(135deg, color-mix(in srgb, var(--sc) 18%, transparent), rgba(0,0,0,.3)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sc) 55%, transparent); }
.se-head b { display: block; font-family: 'Cormorant SC', Georgia, serif; font-size: 26px; color: var(--text); }
.se-head small { color: var(--muted); font-size: 12.5px; }
.se-favor { margin-top: 8px; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--gold2); }
.se-favor .ico { stroke: currentColor; }
.se-list { display: grid; gap: 6px; margin-top: 10px; }
.se-row { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; background: rgba(0,0,0,.3); font-size: 13.5px; }
.se-arrow { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; }
.se-row.good .se-arrow { background: rgba(111,211,106,.18); } .se-row.good .se-arrow .ico { stroke: #8fe08a; }
.se-row.bad .se-arrow { background: rgba(255,107,92,.16); } .se-row.bad .se-arrow .ico { stroke: #ff8a7a; transform: rotate(180deg); }
.se-row.good b { color: #8fe08a; } .se-row.bad b { color: #ff8a7a; }
.section-title .season-ico { vertical-align: -2px; }
.se-map { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.se-cell { position: relative; display: grid; justify-items: center; gap: 2px; padding: 12px 8px; border-radius: 12px; color: var(--sc); text-align: center;
    background: color-mix(in srgb, var(--sc) 12%, rgba(0,0,0,.35)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sc) 35%, transparent); }
.se-cell b { color: var(--text); font-size: 14px; }
.se-cell small { color: var(--muted); font-size: 11px; }
.se-cell.me { box-shadow: inset 0 0 0 2px var(--sc), 0 0 16px color-mix(in srgb, var(--sc) 35%, transparent); }
.se-you { position: absolute; top: 6px; right: 6px; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 999px; color: #10140c; background: var(--sc); }

/* задания времени года в окне сезона */
.se-quests { display: grid; gap: 8px; }
.se-q { padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.3); }
.se-q-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-size: 13.5px; }
.se-q-top span { display: inline-flex; align-items: center; gap: 5px; }
.se-q-top small { color: var(--muted); white-space: nowrap; }
.se-q .pointsbar { margin: 6px 0 0; height: 7px; }
.se-q.done .se-q-top span { color: #8fe08a; }
.se-q.done .ico { stroke: currentColor; }
.se-reward { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; }
.se-prizes { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.se-reward .green { display: inline-flex; align-items: center; gap: 4px; }
.season-dot .badge.dot, .season-chip .badge.dot { position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; min-width: 0; padding: 0; }
.season-chip { position: relative; }
/* ярмарка урожая */
.fair-cta { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; color: #ff9a4a;
    background: linear-gradient(135deg, rgba(255,154,74,.14), rgba(0,0,0,.3)); box-shadow: inset 0 0 0 1px rgba(255,154,74,.4); font-size: 13.5px; }
.fair-cta .grow { color: var(--text); }
.fair-cta small { display: block; color: #ffb27a; font-size: 12px; }
.fair-head { display: flex; align-items: center; gap: 12px; color: #ff9a4a; margin-bottom: 8px; }
.fair-head b { font-size: 26px; color: var(--text); font-family: 'Cormorant SC', Georgia, serif; }
.fair-head small { display: block; color: var(--muted); font-size: 12px; }
.fair-steps { display: grid; gap: 6px; margin-top: 10px; }
.fair-step { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; background: rgba(0,0,0,.3); }
.fair-step > b { color: var(--muted); }
.fair-step.ok > b { color: #ffb27a; }
.fair-step .green { display: grid; place-items: center; }
.fair-step .green .ico { stroke: #8fe08a; }
/* время года в этой части карты — плашкой рядом с координатами */
.map-ui .map-season { margin-left: 0; padding: 6px 12px; font-size: 13px; }
.map-ui .map-season b { color: var(--text); }

/* ============================================================ заставка «Победа» / «Поражение» (battlefx.js) */
.bfx { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    padding: calc(var(--top) + 16px) 16px calc(var(--bottom) + 24px); cursor: pointer; overflow: hidden; animation: fade .25s;
    background: radial-gradient(90% 70% at 50% 42%, #2e2410, #07080c 70%); }
.bfx.defeat { background: radial-gradient(90% 70% at 50% 42%, #33100c, #07080c 70%); animation: fade .25s, bfx-shake .5s .15s; }
.bfx.out { opacity: 0; transition: opacity .25s; }
.bfx-stage { position: relative; width: min(92vw, 62vh, 560px); aspect-ratio: 1; display: grid; place-items: center; }
.bfx-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
    -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); mask-image: radial-gradient(closest-side, #000 72%, transparent 100%);
    animation: bfx-zoom 3.4s ease-out both; }
.bfx.has-video .bfx-media { animation: fade .3s; }
.bfx.defeat .bfx-media { filter: saturate(.75) contrast(1.05); }
.bfx-rays { position: absolute; inset: 4%; border-radius: 50%; animation: bfx-spin 14s linear infinite, bfx-pop .6s cubic-bezier(.2,1.4,.4,1) both;
    background: repeating-conic-gradient(from 0deg, rgba(243,217,142,.32) 0 8deg, transparent 8deg 22deg);
    -webkit-mask-image: radial-gradient(closest-side, #000 20%, transparent 100%); mask-image: radial-gradient(closest-side, #000 20%, transparent 100%); }
.bfx.defeat .bfx-rays { background: radial-gradient(closest-side, rgba(209,75,63,.45), rgba(110,20,14,.25) 55%, transparent); animation: bfx-pop .6s ease-out both, bfx-throb 2.4s ease-in-out .6s infinite; }
.bfx-emblem { position: relative; width: 42%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
    background: radial-gradient(circle at 50% 35%, #fff1c2, #e0b048 45%, #8a5f1c 100%); box-shadow: 0 0 0 3px #5a3c10, 0 0 0 7px rgba(243,217,142,.5), 0 0 60px rgba(243,217,142,.65);
    animation: bfx-slam .7s cubic-bezier(.2,1.5,.4,1) .1s both; }
.bfx-emblem svg { stroke: #3a2508; stroke-width: 2; width: 52% !important; height: 52% !important; }
.bfx.defeat .bfx-emblem { background: radial-gradient(circle at 50% 35%, #6c6a68, #3a3634 50%, #1a1615 100%); box-shadow: 0 0 0 3px #120c0b, 0 0 0 7px rgba(209,75,63,.45), 0 0 60px rgba(209,75,63,.5);
    animation: bfx-slam .7s cubic-bezier(.2,1.5,.4,1) .1s both, bfx-crack 3s ease-in .8s both; }
.bfx.defeat .bfx-emblem svg { stroke: #e6a49c; }
.bfx-bits { position: absolute; inset: -10% 0; pointer-events: none; }
.bfx-bits i { position: absolute; bottom: 10%; border-radius: 50%; background: #ffe7a0; box-shadow: 0 0 8px 2px rgba(255,214,120,.8); opacity: 0; animation: bfx-rise 2.4s ease-out infinite; }
.bfx.defeat .bfx-bits i { bottom: auto; top: 0; background: #5b4c45; box-shadow: 0 0 6px rgba(255,90,50,.55); animation-name: bfx-fall; }
.bfx-text { position: relative; text-align: center; margin-top: -6%; }
.bfx-title { font-family: 'Cormorant SC', Georgia, serif; font-weight: 700; font-size: clamp(44px, 13vw, 84px); line-height: 1; letter-spacing: .04em; text-transform: uppercase;
    background: linear-gradient(180deg, #fff6d8 10%, #f3d98e 45%, #b8862e 80%); -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 3px 0 #3a2508) drop-shadow(0 0 18px rgba(243,217,142,.55)); animation: bfx-title .8s cubic-bezier(.2,1.4,.4,1) .35s both; }
.bfx.defeat .bfx-title { background: linear-gradient(180deg, #ffd9d2 5%, #e0705f 45%, #7d1d15 85%); -webkit-background-clip: text; background-clip: text;
    filter: drop-shadow(0 3px 0 #200605) drop-shadow(0 0 18px rgba(209,75,63,.5)); }
.bfx.has-video .bfx-title { animation-delay: 1s; }
.bfx-sub { margin-top: 8px; font-size: 15px; color: var(--parch); text-shadow: 0 1px 3px #000; max-width: 34ch; margin-inline: auto; animation: fade .5s .8s both; }
.bfx-skip { position: absolute; bottom: calc(var(--bottom) + 18px); font-size: 12px; color: var(--muted); animation: fade .4s 1.2s both; }
@keyframes bfx-spin { to { rotate: 360deg; } }
@keyframes bfx-pop { from { transform: scale(.3); opacity: 0; } }
@keyframes bfx-throb { 50% { opacity: .6; transform: scale(.94); } }
@keyframes bfx-slam { from { transform: scale(2.4); opacity: 0; } 60% { opacity: 1; } }
@keyframes bfx-crack { to { transform: translateY(14px) rotate(-8deg); filter: brightness(.7); } }
@keyframes bfx-zoom { from { transform: scale(1.12); opacity: 0; } 15% { opacity: 1; } to { transform: scale(1); } }
@keyframes bfx-title { from { transform: scale(1.8); opacity: 0; letter-spacing: .3em; } }
@keyframes bfx-rise { 0% { opacity: 0; transform: translateY(0) scale(1); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-70vh) scale(.4); } }
@keyframes bfx-fall { 0% { opacity: 0; transform: translateY(0) rotate(0); } 15% { opacity: .9; } 100% { opacity: 0; transform: translateY(80vh) translateX(30px) rotate(200deg); } }
@keyframes bfx-shake { 15%, 55% { transform: translateX(-8px); } 35%, 75% { transform: translateX(7px); } 90% { transform: translateX(-2px); } }

/* ============================================================ Бой вживую (battlescene.js) */
.bsc { position: fixed; inset: 0; z-index: 69; display: flex; flex-direction: column; justify-content: center; gap: 8px; overflow: hidden;
    padding: calc(var(--top) + 54px) 10px calc(var(--bottom) + 40px); background: #07080c; gap: 14px; opacity: 0; transition: opacity .25s; user-select: none; cursor: pointer; }
.bsc.in { opacity: 1; }
.bsc.out { opacity: 0; }
.bsc-bg { position: absolute; inset: -4%; background: radial-gradient(80% 60% at 50% 50%, #3a2d1a, #0b0c10 75%) center/cover no-repeat; filter: brightness(.42) saturate(.85); }
.bsc-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7,8,12,.85), transparent 28%, transparent 72%, rgba(7,8,12,.9)); }
.bsc.clash .bsc-bg { animation: bsc-shake .32s; }
.bsc-top { position: absolute; top: calc(var(--top) + 10px); left: 12px; right: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; z-index: 2; }
.bsc-title { font-family: 'Cormorant SC', Georgia, serif; font-size: 18px; color: var(--gold2); text-shadow: 0 2px 4px #000; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bsc-skip { flex: none; border: 1px solid var(--line); background: rgba(13,15,20,.7); color: var(--parch); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.bsc-label { position: relative; text-align: center; font-family: 'Cormorant SC', Georgia, serif; font-size: 17px; color: var(--parch); text-shadow: 0 2px 4px #000; }
.bsc-label.foe { color: #f0a597; }
.bsc-side { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; transition: filter .6s, opacity .6s; }
.bsc-side.broken { filter: grayscale(1) brightness(.55); }
.bsc-unit { position: relative; width: clamp(80px, 27vw, 128px); display: flex; flex-direction: column; align-items: center; gap: 3px; transition: opacity .5s, transform .5s; }
.bsc-pic { position: relative; width: 100%; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 2px solid var(--gold3);
    box-shadow: 0 4px 14px rgba(0,0,0,.6), inset 0 0 0 1px rgba(243,217,142,.25); background: #151923; }
.bsc-side.foe .bsc-pic { border-color: var(--red2); }
.bsc-pic img { width: 100%; height: 100%; object-fit: cover; }
.bsc-cls { position: absolute; left: 3px; top: 3px; font-size: 13px; line-height: 1; filter: drop-shadow(0 1px 2px #000); }
.bsc-hp { width: 100%; height: 6px; border-radius: 4px; background: rgba(0,0,0,.6); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.bsc-hp i { display: block; height: 100%; background: linear-gradient(90deg, #4f9a3d, #8fe08a); transition: width .45s ease-out; }
.bsc-side.foe .bsc-hp i { background: linear-gradient(90deg, #8f2a22, #e0705f); }
.bsc-n { font-size: 15px; color: #fff; text-shadow: 0 1px 3px #000; line-height: 1; }
.bsc-name { font-size: 10.5px; color: var(--muted); text-align: center; line-height: 1.15; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bsc-unit.dead { opacity: .35; transform: scale(.9); }
.bsc-unit.dead .bsc-pic { filter: grayscale(1); }
.bsc-unit.hit .bsc-pic { animation: bsc-hit .4s; }
.bsc-side.mine .bsc-unit.lunge { animation: bsc-up .42s ease-out; }
.bsc-side.foe .bsc-unit.lunge { animation: bsc-down .42s ease-out; }
.bsc.fast .bsc-unit.lunge, .bsc.fast .bsc-unit.hit .bsc-pic { animation-duration: .2s; }
.bsc-mid { position: relative; min-height: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.bsc-round { font-family: 'Cormorant SC', Georgia, serif; font-weight: 700; font-size: 30px; letter-spacing: .04em; color: var(--gold2);
    text-shadow: 0 3px 0 #3a2508, 0 0 16px rgba(243,217,142,.5); }
.bsc-round.pop { animation: bsc-pop .4s cubic-bezier(.2,1.5,.4,1); }
.bsc-round.end { font-size: 36px; animation: bsc-pop .5s cubic-bezier(.2,1.5,.4,1); }
.bsc-round.end.lose { color: #f0a597; text-shadow: 0 3px 0 #200605, 0 0 16px rgba(209,75,63,.5); }
.bsc-wall { display: flex; align-items: center; gap: 8px; width: min(70%, 260px); font-size: 12px; color: var(--parch2); }
.bsc-wall .bsc-hp { flex: 1; }
.bsc-wall .bsc-hp i { background: linear-gradient(90deg, #6f6a60, #c9c1ad); }
.bsc-fx { position: absolute; inset: 0; pointer-events: none; }
.bsc-arrow { position: fixed; width: 18px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, #f3d98e 40%, #fff); transform-origin: 100% 50%;
    rotate: var(--rot); opacity: 0; animation: bsc-fly .5s linear both; }
.bsc-dmg { position: absolute; z-index: 3; transform: translate(-50%, 0); font-weight: 800; font-size: 17px; color: #ff8a78; text-shadow: 0 2px 0 #300a06, 0 0 8px rgba(0,0,0,.8);
    animation: bsc-float 1.05s ease-out both; pointer-events: none; }
.bsc-hint { position: absolute; bottom: calc(var(--bottom) + 12px); left: 0; right: 0; text-align: center; font-size: 12px; color: var(--dim); }
.replay-btn { display: block; margin: 0 auto 8px; }
@keyframes bsc-up { 40% { transform: translateY(-16px) scale(1.04); } }
@keyframes bsc-down { 40% { transform: translateY(16px) scale(1.04); } }
@keyframes bsc-hit { 0% { filter: brightness(2.2) saturate(.3); transform: translateX(-4px); } 40% { transform: translateX(4px); } 100% { filter: none; transform: none; } }
@keyframes bsc-pop { from { transform: scale(1.7); opacity: 0; } }
@keyframes bsc-float { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.7); } 20% { opacity: 1; transform: translate(-50%, -6px) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -38px) scale(1); } }
@keyframes bsc-fly { 0% { opacity: 0; translate: 0 0; } 15% { opacity: 1; } 90% { opacity: 1; } 100% { opacity: 0; translate: var(--dx) var(--dy); } }
@keyframes bsc-shake { 25% { transform: translate(-5px, 2px); } 50% { transform: translate(4px, -3px); } 75% { transform: translate(-2px, 1px); } }

/* ============================================================ Бои: Испытания (trials.js) */
.battle-tabs { margin-bottom: 10px; }
.battle-tabs .badge.dot { position: static; display: inline-block; vertical-align: 2px; margin-left: 2px; }
#btab > .page-head h2 { display: none; }
#btab > .page-head:empty, #btab > .page-head:not(:has(*:not(h2))) { display: none; }
.tr-head { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.tr-ch small { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.tr-ch b { display: block; font-size: 22px; color: var(--gold2); line-height: 1.15; }
.tr-ch p { margin: 6px 0 0; font-size: 13.5px; color: var(--parch2); font-style: italic; }
.tr-steps { display: flex; align-items: center; }
.tr-link { flex: 1; height: 2px; background: var(--line); min-width: 8px; }
.tr-step { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 14px;
    border: 2px solid var(--gold3); background: var(--panel); color: var(--muted); }
.tr-step.done { background: linear-gradient(180deg, #4f7e31, #2b4a1a); border-color: #8fe08a; color: #eaffdf; }
.tr-step.cur { border-color: var(--gold2); color: var(--gold2); box-shadow: 0 0 0 3px rgba(243,217,142,.25), 0 0 16px rgba(243,217,142,.45); animation: tr-pulse 1.8s ease-in-out infinite; }
.tr-step.boss { width: 44px; height: 44px; border-color: var(--red); color: #f0a597; }
.tr-step.boss.done { color: #eaffdf; border-color: #8fe08a; }
.tr-step:disabled { opacity: .45; }
.tr-energy { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--gold2); }
.tr-energy .ico { fill: currentColor; stroke: none; }
.tr-energy .muted { margin-left: auto; font-size: 12.5px; }
.tr-foe, .tr-mine { padding: 12px; margin-top: 10px; }
.tr-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.tr-unit { width: calc((100% - 24px) / 4); min-width: 64px; max-width: 96px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.tr-pic { position: relative; width: 100%; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 2px solid var(--red2); background: var(--bg2); }
.tr-row.mine .tr-pic { border-color: var(--gold3); }
.tr-pic img { width: 100%; height: 100%; object-fit: cover; }
.tr-cls { position: absolute; left: 3px; top: 2px; font-size: 13px; filter: drop-shadow(0 1px 2px #000); }
.tr-unit b { font-size: 14px; }
.tr-unit small { font-size: 10.5px; color: var(--muted); line-height: 1.15; }
.tr-hint { margin: 10px 0 0; font-size: 13px; color: var(--parch2); }
.tr-hint .ico { vertical-align: -2px; }
.tr-tactics { display: flex; flex-direction: column; gap: 8px; }
.tr-tac { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.tr-tac.on { border-color: var(--gold2); background: linear-gradient(180deg, rgba(216,178,94,.18), rgba(216,178,94,.06)); box-shadow: 0 0 0 2px rgba(243,217,142,.25); }
.tr-tac-ico { font-size: 22px; flex: none; width: 30px; text-align: center; }
.tr-tac-main { flex: 1; min-width: 0; }
.tr-tac-main b { display: block; font-size: 15px; }
.tr-tac-main small { display: block; font-size: 12px; color: var(--muted); line-height: 1.3; }
.tr-chance { flex: none; font-weight: 800; font-size: 16px; min-width: 48px; text-align: right; }
.tr-chance.good { color: var(--green); } .tr-chance.mid { color: var(--gold2); } .tr-chance.bad { color: var(--red); }
.tr-reward { padding: 10px 12px; margin: 12px 0; text-align: center; }
.tr-reward small { color: var(--muted); font-size: 12px; }
.tr-go small { opacity: .85; font-weight: 600; margin-left: 6px; }
@keyframes tr-pulse { 50% { box-shadow: 0 0 0 5px rgba(243,217,142,.12), 0 0 22px rgba(243,217,142,.55); } }
.btn.big { padding: 14px 16px; font-size: 17px; }

/* ============================================================ Постепенное знакомство: скрытые разделы и окно «Открыто новое» */
.lock-map [data-nav="map"], .lock-alliance [data-nav="alliance"],
.lock-social [data-chat], .lock-social [data-rank],
.lock-events .event-chip, .lock-events .season-chip, .lock-events .season-dot { display: none !important; }
.unlock { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.unlock-art { width: 150px; height: 150px; border-radius: 50%; overflow: hidden; border: 3px solid var(--gold); box-shadow: 0 0 0 6px rgba(243,217,142,.18), 0 0 40px rgba(243,217,142,.45);
    animation: bfx-slam .7s cubic-bezier(.2,1.5,.4,1) both; display: grid; place-items: center; background: var(--panel); }
.unlock-art img { width: 100%; height: 100%; object-fit: cover; }
.unlock-art.glyph .ico { stroke: var(--gold2); }
.unlock b { font-size: 26px; color: var(--gold2); }
.unlock p { margin: 0 0 6px; color: var(--parch2); font-size: 14.5px; }
