/* Sai: Путь чая — тёмно-зелёный TSAI с золотом, мобильный экран */
:root { --bg: #0F1F17; --card: #183327; --card2: #20412F; --line: #ffffff1a; --ink: #F3EFE4; --muted: #A9BDB0; --gold: #E8B83A; --gold2: #C9A44C; --red: #E0603A; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overscroll-behavior: none; }
body { display: flex; justify-content: center; }
#app, #onb { width: 100%; max-width: 480px; height: 100dvh; display: flex; flex-direction: column; }
#app[hidden], #onb[hidden], [hidden] { display: none !important; }
h1, h2, h3 { margin: .4em 0; line-height: 1.15; } h3 { font-size: 16px; margin-top: 18px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .center { text-align: center; } .big { font-size: 20px; font-weight: 700; } .gold-t { color: var(--gold); }
.err { color: #FF9A80; min-height: 1em; margin: 4px 0; font-size: 13px; }

.btn { display: inline-block; border: 1px solid var(--line); background: var(--card2); color: var(--ink); border-radius: 14px; padding: 11px 16px; font: 600 15px system-ui; text-decoration: none; text-align: center; cursor: pointer; margin: 4px 2px; }
.btn.gold { background: linear-gradient(180deg, #F5CF5A, #D9A22E); color: #2A1C05; border-color: #F5CF5A; box-shadow: 0 3px 0 #9A6E15; }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn:disabled { opacity: .45; filter: grayscale(.6); cursor: default; }
.btn.sm { padding: 7px 11px; font-size: 13px; border-radius: 11px; } .btn.xs { padding: 4px 9px; font-size: 12px; border-radius: 9px; margin: 0; }
.btn.wide { display: block; width: 100%; margin: 8px 0; } .btn.ghost { background: transparent; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

/* Шапка */
#top { display: flex; justify-content: space-between; align-items: center; padding: max(8px, env(safe-area-inset-top)) 12px 8px; background: #0B1812; border-bottom: 1px solid var(--line); }
.who { display: flex; gap: 8px; align-items: center; min-width: 0; }
.who img { width: 40px; height: 48px; object-fit: contain; background: var(--card); border-radius: 12px; }
.who b { display: block; max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.xp { width: 70px; height: 6px; background: #ffffff22; border-radius: 6px; overflow: hidden; } .xp i { display: block; height: 100%; background: var(--gold); }
.cur { display: flex; gap: 8px; } .cur span { background: var(--card); padding: 6px 10px; border-radius: 20px; font-size: 14px; }

main { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.view { padding: 10px 12px 20px; }
#v-battle { padding: 0; height: 100%; display: flex; flex-direction: column; }
#stage { padding: 8px 12px; font-size: 14px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .boss { color: var(--red); font-weight: 800; }
#bosswrap { height: 6px; background: #ffffff22; } #bossbar { height: 100%; background: var(--red); transition: width .1s linear; }
.canvas-wrap { position: relative; flex: 1; min-height: 260px; }
#battle { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: manipulation; cursor: pointer; }
#hint { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); background: #000a; padding: 8px 14px; border-radius: 20px; animation: pulse 1s infinite alternate; pointer-events: none; white-space: nowrap; }
@keyframes pulse { to { transform: translateX(-50%) scale(1.06); } }
.fab { position: absolute; right: 10px; top: 10px; width: 50px; height: 50px; border-radius: 50%; border: 2px solid #F5CF5A; background: #13261Dcc; font-size: 24px; cursor: pointer; }
.fab i { position: absolute; right: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: #FF4D4D; animation: pulse2 .8s infinite alternate; }
@keyframes pulse2 { to { transform: scale(1.3); } }
#skills { position: absolute; left: 8px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.skill { width: 52px; height: 52px; border-radius: 14px; border: 2px solid #ffffff44; background: #13261Dcc; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.skill span { font-size: 20px; line-height: 1; } .skill small { font-size: 9px; } .skill:disabled { opacity: .55; } .skill.on { border-color: var(--gold); box-shadow: 0 0 12px var(--gold); }
#quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 10px; background: #0B1812; }
.qbtn { background: var(--card2); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); padding: 8px 10px; text-align: left; cursor: pointer; display: grid; }
.qbtn small { color: var(--muted); font-size: 11px; } .qbtn i { font-style: normal; color: var(--gold); font-weight: 700; margin-top: 2px; }
.qbtn:not(:disabled) { border-color: #F5CF5A88; } .qbtn:disabled { opacity: .55; } .qbtn:active { transform: scale(.97); }

#tabs { display: grid; grid-template-columns: repeat(5, 1fr); background: #0B1812; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
#tabs button { background: none; border: 0; color: var(--muted); font-size: 11px; padding: 6px 0 8px; display: flex; flex-direction: column; align-items: center; cursor: pointer; }
#tabs button span { font-size: 20px; } #tabs button.on { color: var(--gold); }

/* Герой */
.hero-card { display: flex; gap: 10px; align-items: center; background: var(--card); border-radius: 18px; padding: 10px; position: relative; }
.hero-card img { width: 100px; height: 125px; object-fit: contain; } .hero-card .sai { position: absolute; left: 4px; bottom: 4px; width: 40px; height: 45px; }
.hero-card p { margin: 2px 0; } .stats { font-size: 13px; }
.seg { display: flex; background: var(--card); border-radius: 12px; padding: 3px; margin: 10px 0; overflow-x: auto; }
.seg button { flex: 1; background: none; border: 0; color: var(--muted); padding: 7px 8px; border-radius: 9px; font: 600 13px system-ui; cursor: pointer; white-space: nowrap; } .seg button.on { background: var(--card2); color: var(--gold); }
.row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); } .row > div { flex: 1; } .ico { font-size: 24px; width: 32px; text-align: center; }
.gear { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot { background: var(--card); border: 2px solid; border-radius: 14px; padding: 8px; text-align: center; display: grid; gap: 2px; } .slot span { font-size: 26px; } .slot small { font-size: 11px; color: var(--muted); }
.skins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.skin { background: var(--card); border: 2px solid transparent; border-radius: 14px; padding: 6px; color: var(--ink); display: grid; justify-items: center; gap: 2px; cursor: pointer; font-size: 12px; }
.skin img { width: 64px; height: 72px; object-fit: contain; } .skin small { color: var(--muted); font-size: 10px; line-height: 1.2; }
.skin.on { border-color: var(--gold); } .skin.locked img { filter: grayscale(1) brightness(.5); }
.card { background: var(--card); border-radius: 16px; padding: 12px; margin-bottom: 10px; } .card h3 { margin-top: 0; }
.reflink { background: #0B1812; padding: 10px; border-radius: 10px; word-break: break-all; font-family: ui-monospace, monospace; font-size: 13px; }
.code { font-family: ui-monospace, monospace; color: var(--gold); letter-spacing: 1px; }

/* Игры */
.energy { background: var(--card); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.game { width: 100%; display: flex; gap: 12px; align-items: center; text-align: left; background: linear-gradient(135deg, var(--card2), var(--card)); color: var(--ink); border: 1px solid var(--line); border-radius: 18px; padding: 12px; margin-bottom: 10px; cursor: pointer; }
.game span { font-size: 38px; } .game div { display: grid; gap: 2px; } .game small { color: var(--muted); font-size: 12px; } .game:active { transform: scale(.98); }
.lrow { display: flex; align-items: center; gap: 8px; padding: 6px; border-bottom: 1px solid var(--line); } .lrow b { width: 30px; text-align: center; }
.lrow img { width: 30px; height: 36px; object-fit: contain; } .lrow span { flex: 1; } .lrow i { font-style: normal; color: var(--gold); font-weight: 700; } .lrow.me { background: #E8B83A22; border-radius: 10px; }

/* Модальные окна */
#modal { position: fixed; inset: 0; background: #000b; display: flex; align-items: center; justify-content: center; z-index: 10; padding: 12px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
#modal-in { background: var(--card); border: 1px solid #F5CF5A55; border-radius: 22px; padding: 16px; width: 100%; max-width: 440px; max-height: 92dvh; overflow-y: auto; animation: pop .2s; }
@keyframes pop { from { transform: scale(.9); } }
#modal-in label { display: block; margin: 8px 0; font-size: 13px; color: var(--muted); }
input { width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: #0B1812; color: var(--ink); font-size: 16px; margin-top: 4px; }
input[type=checkbox] { width: 22px; height: 22px; }
.burst { font-size: 50px; animation: spin 1s; } @keyframes spin { from { transform: rotate(-90deg) scale(.2); } }
.chest-open { text-align: center; } .chest-ico { font-size: 70px; animation: shake .5s; }
@keyframes shake { 20%, 60% { transform: rotate(-12deg); } 40%, 80% { transform: rotate(12deg); } }
.chest-open.r2 .chest-ico, .chest-open.r3 .chest-ico { filter: drop-shadow(0 0 18px #F5CF5A); }
.big-img { width: 140px; height: 170px; object-fit: contain; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 8px 0; }
.days .d { background: #0B1812; border-radius: 10px; padding: 6px 2px; text-align: center; font-size: 11px; display: grid; gap: 2px; } .days small { color: var(--muted); font-size: 9px; }
.days .got { opacity: .45; } .days .now { outline: 2px solid var(--gold); }
.pass { background: #E8B83A22; padding: 6px 10px; border-radius: 10px; }
.quest { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); } .quest > div { flex: 1; display: grid; } .quest small { color: var(--muted); font-size: 11px; }
.bar { height: 7px; background: #ffffff22; border-radius: 6px; overflow: hidden; margin: 3px 0; } .bar i { display: block; height: 100%; background: #5FD08A; transition: width .3s; } .bar.red i { background: var(--red); }
.wheel-wrap { position: relative; width: 240px; height: 240px; margin: 10px auto; }
.wheel { width: 240px; height: 240px; border-radius: 50%; border: 5px solid var(--gold); position: relative; transition: transform 4s cubic-bezier(.15, .8, .2, 1); }
.wheel span { position: absolute; left: 50%; top: 50%; translate: -50% -50%; font-size: 12px; font-weight: 700; white-space: nowrap; }
.wpin { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); color: var(--gold); font-size: 26px; }
.duel { display: flex; align-items: center; justify-content: space-around; gap: 8px; } .duel > div { width: 40%; } .duel img { width: 100%; height: 150px; object-fit: contain; }
.flip { transform: scaleX(-1); } .hit { animation: hit .3s; } @keyframes hit { 30% { filter: brightness(2.2); translate: 6px 0; } }
.opp img { width: 44px; height: 52px; object-fit: contain; }

#toasts { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 20; display: grid; gap: 6px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: #0B1812ee; border: 1px solid #F5CF5A66; border-radius: 14px; padding: 10px 14px; text-align: center; animation: pop .2s; }

/* Онбординг */
#onb { overflow-y: auto; background: radial-gradient(circle at 50% 0, #2F5A45, var(--bg) 70%); }
.onb-in { padding: 24px 16px; text-align: center; } .onb-logo { height: 40px; } .onb-in h1 { font-size: 30px; color: var(--gold); }
#onb-heroes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.pick { background: var(--card); border: 3px solid transparent; border-radius: 20px; padding: 10px; color: var(--ink); display: grid; justify-items: center; cursor: pointer; }
.pick img { width: 120px; height: 150px; object-fit: contain; } .pick small { color: var(--muted); font-size: 12px; } .pick.on { border-color: var(--gold); box-shadow: 0 0 20px #E8B83A55; }

/* Мини-игры */
.mg { display: flex; flex-direction: column; height: 78dvh; } .mg canvas { flex: 1; width: 100%; border-radius: 14px; touch-action: none; }
.mg-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.durak { display: flex; flex-direction: column; gap: 8px; min-height: 70dvh; }
.durak .bot { display: flex; align-items: center; gap: 8px; } .durak .bot img { width: 46px; height: 52px; }
.backs { display: flex; flex-wrap: wrap; } .back { display: inline-block; width: 26px; height: 38px; margin-left: -10px; border-radius: 5px; background: repeating-linear-gradient(45deg, #2F5A45 0 4px, #C9A44C 4px 6px); border: 1px solid #fff4; }
.table { flex: 1; background: #1E5A3A; border-radius: 16px; padding: 10px; display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start; position: relative; min-height: 150px; }
.pair { position: relative; width: 50px; height: 86px; } .pair .d { position: absolute; left: 12px; top: 16px; }
.deck { position: absolute; right: 8px; bottom: 8px; display: flex; align-items: center; } .deck .trumpc { transform: rotate(90deg); margin-right: -10px; }
.pc { width: 46px; height: 66px; border-radius: 8px; background: #FFFDF6; color: #111; border: 1px solid #0003; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; margin: 0; font: 700 15px system-ui; cursor: pointer; }
.pc i { font-style: normal; font-size: 18px; } .pc.red { color: #C62828; } .pc.trump { box-shadow: inset 0 0 0 2px var(--gold); }
.hand { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; } .hand .pc:active { transform: translateY(-8px); }
.dmsg { text-align: center; min-height: 1.4em; margin: 0; color: var(--gold); } .dbtns { display: flex; justify-content: center; gap: 6px; min-height: 44px; } .red { color: #FF6B6B; }

/* Выход из мини-игр — крупно и заметно */
.exit { border: 2px solid var(--gold); background: #0B1812; color: var(--ink); border-radius: 999px; padding: 9px 16px; font: 700 14px system-ui; cursor: pointer; flex: none; }
.exit:hover, .exit:active { background: var(--gold); color: #13261D; }
.mg-top span { flex: 1; text-align: center; font-size: 13px; }
/* Магазин */
.pearls { background: var(--card); padding: 6px 6px 6px 10px; border-radius: 20px; font-size: 14px; color: var(--ink); border: 1px solid #F5CF5A66; cursor: pointer; display: flex; gap: 4px; align-items: center; }
.pearls i { font-style: normal; background: var(--gold); color: #13261D; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.promo { background: linear-gradient(90deg, #B4442C, #E07B2E); padding: 10px 12px; border-radius: 12px; margin-bottom: 6px; text-align: center; animation: pulse3 1.4s infinite alternate; }
@keyframes pulse3 { to { filter: brightness(1.15); } }
.tag { background: var(--gold); color: #13261D; border-radius: 6px; padding: 1px 6px; font-size: 10px; font-weight: 800; text-transform: uppercase; vertical-align: 2px; }
.pack s { color: var(--muted); }
.steps { padding-left: 20px; } .steps li { margin: 8px 0; } .kbd { display: inline-block; border: 1px solid var(--line); background: #0B1812; border-radius: 6px; padding: 0 6px; }
.card.install { background: linear-gradient(135deg, #2F5A45, var(--card)); border: 1px solid #F5CF5A55; }

/* Сундуки-слоты */
#slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 8px 10px 0; background: #0B1812; }
.cslot { height: 66px; border-radius: 12px; border: 2px solid var(--c, #ffffff22); background: radial-gradient(circle at 50% 30%, #ffffff14, #0000) , var(--card); color: var(--ink); display: grid; justify-items: center; align-content: center; gap: 0; padding: 2px; cursor: pointer; font: 600 11px system-ui; }
.cslot span { font-size: 24px; line-height: 1.1; } .cslot small { color: var(--muted); font-size: 10px; } .cslot i { font-style: normal; font-size: 10px; color: var(--gold); }
.cslot.empty { border-style: dashed; border-color: #ffffff1a; cursor: default; } .cslot .tmr { color: var(--ink); font-variant-numeric: tabular-nums; }
.cslot.run span { animation: wob 1.6s infinite; } .cslot.ready { box-shadow: 0 0 14px var(--c); animation: pulse2 .7s infinite alternate; } .cslot .go { font-weight: 800; font-size: 11px; }
@keyframes wob { 50% { transform: rotate(-8deg) scale(1.05); } }
.loot { border-left: 4px solid; background: #0B1812; border-radius: 10px; padding: 6px 10px; text-align: left; margin: 6px 0; }
/* Таланты */
.talents { display: grid; gap: 6px; }
.trow { display: grid; grid-template-columns: 1fr 34px 1fr; align-items: center; gap: 6px; } .trow > b { text-align: center; color: var(--gold); background: #0B1812; border-radius: 50%; width: 34px; height: 34px; display: grid; place-items: center; font-size: 13px; }
.tal { background: var(--card); border: 2px solid var(--line); color: var(--ink); border-radius: 12px; padding: 8px 6px; font: 600 12px system-ui; cursor: pointer; min-height: 44px; }
.tal:not(:disabled) { border-color: #F5CF5A; animation: pulse3 1s infinite alternate; } .tal.on { border-color: var(--gold); background: #E8B83A33; } .tal.off, .trow.lock .tal { opacity: .4; }

/* Sai World: три валюты в шапке, онлайн-игры, магазин и окно Дурака онлайн */
.cur { gap: 5px; } .cur span { padding: 5px 8px; font-size: 13px; } .pearls { font-size: 13px; border-color: #8EE3EF88; } .pearls i { background: #8EE3EF; }
#v-shop { padding: 0; height: 100%; } #v-shop iframe, #overlay iframe { width: 100%; height: 100%; border: 0; display: block; background: var(--bg); }
#overlay { position: fixed; inset: 0; z-index: 15; background: var(--bg); display: flex; justify-content: center; }
#overlay iframe { max-width: 480px; }
h3.sec { margin: 16px 2px 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } h3.sec small { font-weight: 500; font-size: 12px; }
.game.hot { background: linear-gradient(135deg, #1E5A3A, #13261D); border: 2px solid #4CAF50; box-shadow: 0 0 22px -8px #4CAF50; }
.game.hot.g2 { background: linear-gradient(135deg, #5A1E3A, #13261D); border-color: #E91E63; box-shadow: 0 0 22px -8px #E91E63; }
.soon { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.soon div { background: var(--card); border: 1px dashed #ffffff33; border-radius: 14px; padding: 10px 6px; text-align: center; display: grid; gap: 2px; opacity: .7; }
.soon span { font-size: 26px; } .soon b { font-size: 12px; } .soon small { font-size: 10px; color: var(--muted); }
.patch { text-align: left; } .patch small { color: var(--gold); font-weight: 800; letter-spacing: 2px; } .patch h2 { margin: 2px 0 8px; font-size: 26px; }
.patch ul { padding-left: 18px; display: grid; gap: 8px; margin: 0 0 12px; } .patch li { line-height: 1.35; }

/* Чайная ферма */
.game.hot.g3 { background: linear-gradient(135deg, #3E6B1E, #13261D 70%); border-color: #9BD35A; box-shadow: 0 0 22px -8px #9BD35A; }
.new { font-style: normal; font-size: 10px; background: #E0603A; color: #fff; padding: 2px 6px; border-radius: 6px; vertical-align: 2px; animation: pulse3 1s infinite alternate; }
#modal:has(.farm) { padding: 0; }
#modal-in:has(.farm) { max-width: 480px; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; padding: max(8px, env(safe-area-inset-top)) 10px max(8px, env(safe-area-inset-bottom));
  background: radial-gradient(120% 60% at 50% 0%, #2A5A3A, #12261B 70%); overflow: hidden; }
.farm { position: relative; display: flex; flex-direction: column; gap: 8px; height: 100%; user-select: none; -webkit-user-select: none; }
.farm .mg-top { margin: 0; }
.fm-bar { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.fm-lvl { font-size: 13px; display: grid; gap: 3px; } .fm-lvl .xp { width: 100%; height: 7px; } .fm-lvl .xp i { transition: width .4s; background: linear-gradient(90deg, #9BD35A, #E8B83A); }
.fm-en { display: flex; align-items: center; gap: 4px; background: #0B1812; color: var(--ink); border: 1px solid #F5CF5A88; border-radius: 999px; padding: 6px 6px 6px 12px; font: 600 14px system-ui; cursor: pointer; }
.fm-en small { color: var(--muted); font-size: 11px; min-width: 52px; } .fm-en i { font-style: normal; background: var(--gold); color: #13261D; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; }
.fm-star { text-align: right; font-size: 15px; } .fm-star small { display: block; font-size: 10px; color: var(--muted); }
.fm-orders { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.fo { background: #F6EEDA; color: #2A1C05; border-radius: 14px; padding: 6px; display: grid; gap: 4px; justify-items: center; position: relative; box-shadow: 0 3px 0 #0005; min-height: 104px; align-content: space-between; }
.fo.ready { background: linear-gradient(180deg, #FFF6D6, #F5CF5A); animation: ready 1s infinite alternate; }
.fo.vip { background: linear-gradient(180deg, #FFE1D6, #F59A7A); } .fo.vip.ready { background: linear-gradient(180deg, #FFF6D6, #F5A35A); }
.fo.arrive { animation: arrive .45s; }
@keyframes ready { to { box-shadow: 0 3px 0 #0005, 0 0 18px #F5CF5A; transform: translateY(-2px); } }
@keyframes arrive { from { transform: translateY(-30px) scale(.8); opacity: 0; } }
.fo-who { display: flex; flex-direction: column; align-items: center; line-height: 1; } .fo-who span { font-size: 26px; } .fo-who small { font-size: 10px; font-weight: 700; margin-top: 2px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.fo-x { position: absolute; top: 3px; right: 3px; border: 0; background: #0001; color: #2A1C05; border-radius: 50%; width: 22px; height: 22px; font-size: 13px; cursor: pointer; padding: 0; }
.fo-need { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.nd { font-size: 20px; width: 30px; height: 30px; display: grid; place-items: center; background: #0000000f; border-radius: 9px; position: relative; }
.nd.ok::after { content: "✓"; position: absolute; right: -3px; bottom: -3px; background: #3E8E4F; color: #fff; font: 800 9px system-ui; width: 13px; height: 13px; border-radius: 50%; display: grid; place-items: center; }
.fo-rw { font-size: 11px; font-weight: 700; opacity: .75; } .fo .btn.xs { padding: 4px 10px; }
.fm-board { --gap: 4px; width: min(100%, calc((100dvh - 372px) * 6 / 7)); margin: auto; display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--gap); padding: 6px;
  background: #5B3A1F; border-radius: 16px; box-shadow: inset 0 2px 8px #0008, 0 4px 0 #3A2412; touch-action: none; }
.fc { aspect-ratio: 1; border-radius: 10px; background: #7A5230; position: relative; display: grid; place-items: center; cursor: pointer; transition: background .15s; }
.fc.alt { background: #6E4A2A; }
.fc.over { background: #9BD35A55; box-shadow: inset 0 0 0 2px #9BD35A; }
.fc.sel .fi { box-shadow: 0 0 0 3px #fff, 0 0 16px #fff9; }
.fc.lift .fi { opacity: .25; }
.fi { width: 90%; height: 90%; border-radius: 12px; display: grid; place-items: center; position: relative; pointer-events: none;
  background: radial-gradient(circle at 35% 30%, #ffffffcc, color-mix(in srgb, var(--c) 45%, #fff) 45%, var(--c)); box-shadow: inset 0 -3px 0 #0003, 0 2px 0 #0004; }
.fi span { font-size: clamp(18px, 6.2vw, 30px); line-height: 1; filter: drop-shadow(0 1px 1px #0005); }
.fi i { position: absolute; right: 2px; bottom: 1px; font: 800 9px system-ui; font-style: normal; color: #fff; text-shadow: 0 1px 2px #000; }
.fi.hi { box-shadow: inset 0 -3px 0 #0003, 0 0 0 2px #F5CF5A, 0 0 10px #F5CF5A88; }
.fi.max { animation: shineMax 1.6s infinite alternate; } @keyframes shineMax { to { box-shadow: inset 0 -3px 0 #0003, 0 0 0 2px #fff, 0 0 18px #FFD76A; } }
.fi.gen { background: radial-gradient(circle at 40% 30%, #FFF6D6, #F5CF5A 55%, #C98A1E); box-shadow: inset 0 -4px 0 #0003, 0 0 0 2px #fff8, 0 0 14px #F5CF5A99; }
.fi.gen b { position: absolute; top: -5px; right: -5px; font-size: 11px; background: #13261D; border-radius: 50%; width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid var(--gold); }
.fc.need .fi::after { content: "✓"; position: absolute; left: 2px; top: 2px; background: #3E8E4F; color: #fff; font: 800 9px system-ui; width: 14px; height: 14px; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 0 0 1px #fff; }
.fc.hint .fi { animation: wiggle .5s infinite alternate; } @keyframes wiggle { from { transform: rotate(-7deg) scale(1.04); } to { transform: rotate(7deg) scale(1.04); } }
.fc.pop .fi { animation: popm .45s cubic-bezier(.3, 1.8, .5, 1); } @keyframes popm { from { transform: scale(.3); filter: brightness(2.2); } }
.fc.spawn .fi { animation: spawn .35s cubic-bezier(.3, 1.6, .5, 1); } @keyframes spawn { from { transform: scale(0) translateY(20px); } }
.fc.tap .fi { animation: tapg .2s; } @keyframes tapg { 50% { transform: scale(.85); } }
.fc.shake .fi { animation: shake .3s; } @keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.fm-ghost { position: fixed; left: 0; top: 0; width: 64px; height: 64px; pointer-events: none; z-index: 30; filter: drop-shadow(0 8px 10px #0008); }
.fm-ghost .fi { width: 100%; height: 100%; }
.fm-float { position: fixed; z-index: 31; transform: translateX(-50%); pointer-events: none; font: 800 16px system-ui; color: #FFE7A3; text-shadow: 0 2px 4px #000, 0 0 10px #000; white-space: nowrap; animation: floatUp 1.1s ease-out forwards; }
@keyframes floatUp { to { transform: translate(-50%, -60px); opacity: 0; } }
.fm-info { min-height: 46px; display: flex; align-items: center; gap: 10px; background: #0B1812cc; border-radius: 12px; padding: 6px 10px; font-size: 13px; }
.fm-info .btn { margin-left: auto; flex: none; } .fi-big { font-size: 28px; }
.fm-foot { display: flex; gap: 4px; justify-content: center; } .fm-foot .btn { margin: 0; flex: 1; padding: 7px 4px; font-size: 12px; }
.fm-panel { position: absolute; inset: 0; background: #000a; display: grid; place-items: center; z-index: 5; animation: fade .15s; }
.fm-pin { background: var(--card); border: 1px solid #F5CF5A55; border-radius: 20px; padding: 16px; width: 100%; max-height: 90%; overflow-y: auto; animation: pop .2s; }
.fm-pin p { margin: 8px 0; }
.bk { margin: 10px 0; } .bk-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 6px; }
.bk-it { background: radial-gradient(circle at 35% 30%, #ffffffaa, var(--c)); border-radius: 12px; padding: 6px 2px; display: grid; justify-items: center; color: #2A1C05; }
.bk-it span { font-size: 24px; } .bk-it small { font-size: 9px; font-weight: 700; text-align: center; line-height: 1.1; }
.bk-it.no { background: #ffffff10; color: var(--muted); } .bk-it.no span { opacity: .5; }

/* Экран «Установить Sai World» (tsai.kz/app) */
#inst { position: fixed; inset: 0; z-index: 40; overflow-y: auto; background: radial-gradient(120% 70% at 50% 0%, #2E5A40, #0F1F17 70%); display: flex; justify-content: center; }
.inst-in { width: 100%; max-width: 440px; padding: max(28px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom)); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.inst-ico { width: 132px; height: 132px; border-radius: 30px; box-shadow: 0 18px 40px -16px #000, 0 0 0 2px #F5CF5A99; animation: instF 2.6s ease-in-out infinite alternate; }
@keyframes instF { to { transform: translateY(-6px) rotate(-2deg); } }
.inst-in h1 { font-size: 32px; color: #F5CF5A; margin: 10px 0 0; }
.inst-sub { color: #D7E3DA; margin: 0 0 12px; }
.inst-in .btn.big { font-size: 18px; padding: 16px; }
.inst-steps { text-align: left; background: #ffffff10; border: 1px solid #ffffff22; border-radius: 16px; padding: 12px 14px 12px 34px; margin: 4px 0 0; width: 100%; }
.inst-arrow { font-size: 34px; color: #F5CF5A; animation: instA 1s ease-in-out infinite alternate; }
@keyframes instA { to { transform: translateY(8px); } }
.inst-qr { width: 190px; height: 190px; background: #fff; border-radius: 16px; padding: 8px; }

/* Бой: блок и зелье */
#combat { position: absolute; right: 10px; bottom: 12px; display: flex; gap: 10px; z-index: 2; }
.cbtn { width: 70px; height: 70px; border-radius: 50%; border: 3px solid #ffffff55; background: #13261Dd9; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; cursor: pointer; touch-action: manipulation; box-shadow: 0 4px 0 #0008; -webkit-user-select: none; user-select: none; }
.cbtn span { font-size: 28px; line-height: 1; } .cbtn small { font-size: 11px; font-weight: 700; margin-top: 2px; }
.cbtn.blk { width: 84px; height: 84px; border-color: #BFE3FF; background: radial-gradient(circle at 40% 30%, #3A6A8A, #13261D 75%); }
.cbtn.blk span { font-size: 34px; }
.cbtn.blk.on { box-shadow: 0 0 0 4px #BFE3FF, 0 0 24px #BFE3FF; }
.cbtn.pot { border-color: #FFB3C8; }
.cbtn:active:not(:disabled) { transform: translateY(3px) scale(.96); box-shadow: none; }
.cbtn:disabled { opacity: .5; }
#quick { grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 8px; }
#quick .qbtn b { font-size: 12px; } #quick .qbtn small { font-size: 10px; }

/* Карта уровней */
#map { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 12px; background: linear-gradient(180deg, #0F1F17ee, #0F1F1799 40%, #0F1F17ee); overflow-y: auto; }
.map-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.map-head div { text-align: center; } .map-head b { display: block; color: var(--gold); font-size: 17px; } .map-head small { color: var(--muted); font-size: 11px; }
.map-path { flex: 1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px 6px; align-content: center; position: relative; padding: 4px 0; }
.mnode { justify-self: center; width: 54px; height: 54px; border-radius: 50%; border: 3px solid #F5CF5A; background: radial-gradient(circle at 35% 30%, #4A7A5A, #1E4030 70%); color: #fff; display: grid; place-items: center; align-content: center; cursor: pointer; padding: 0; box-shadow: 0 4px 0 #0008; transform: translateY(calc(sin(var(--i) * 1.3) * 10px)); }
.mnode b { font-size: 18px; line-height: 1; } .mnode small { font-size: 8px; line-height: 1; margin-top: 2px; letter-spacing: -1px; }
.mnode.boss { border-color: #FF8A5A; background: radial-gradient(circle at 35% 30%, #8A4A3A, #3A1A14 70%); }
.mnode.cur { animation: curN 1s infinite alternate; border-color: #fff; } @keyframes curN { to { box-shadow: 0 4px 0 #0008, 0 0 22px #F5CF5A; } }
.mnode.lock { opacity: .45; border-color: #ffffff44; background: #13261D; cursor: default; }
.map-go { font-size: 17px; padding: 14px; margin: 0; }
.map-note { text-align: center; font-size: 12px; color: var(--muted); margin: 0; }
#stage .btn.xs { margin-left: auto; }
/* Итог уровня */
.lvl-end h2 { font-size: 28px; margin: 2px 0; } .lvl-end.win h2 { color: var(--gold); } .lvl-end.lose h2 { color: #FF8A7A; }
.stars { font-size: 40px; display: flex; justify-content: center; gap: 6px; margin: 6px 0; }
.stars span { filter: grayscale(1) brightness(.4); } .stars span.on { filter: none; animation: starIn .45s both cubic-bezier(.3, 1.8, .5, 1); }
@keyframes starIn { from { transform: scale(0) rotate(-90deg); } }
.loot { display: grid; gap: 6px; margin: 8px 0; text-align: left; }
.li { display: flex; gap: 10px; align-items: center; background: #0B1812; border: 1px solid var(--c); border-radius: 12px; padding: 6px 10px; box-shadow: 0 0 10px -4px var(--c); }
.li span { font-size: 24px; } .li small { display: block; color: var(--muted); font-size: 11px; }
.tea-cta { border-color: #F5CF5A88; }
/* Экран сундуков */
#tabs { grid-template-columns: repeat(6, 1fr); } #tabs button { position: relative; font-size: 10px; }
#cdot, #adot { position: absolute; top: 4px; right: calc(50% - 18px); width: 10px; height: 10px; border-radius: 50%; background: #E0603A; box-shadow: 0 0 0 2px #0B1812; }
.ch-head h2 { margin: 4px 0; } .ch-head p { margin: 0 0 10px; font-size: 13px; }
#slots.big { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0; background: none; }
#slots.big .cslot { height: 120px; border-radius: 18px; font-size: 13px; } #slots.big .cslot span { font-size: 46px; } #slots.big .cslot small, #slots.big .cslot i { font-size: 12px; }
.ch-list { display: grid; gap: 8px; margin-top: 12px; }
.ch-card { display: flex; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; }
.ch-card > span { font-size: 30px; } .ch-card div { flex: 1; } .ch-card small { display: block; color: var(--muted); font-size: 12px; } .ch-card .btn { margin: 0; }
.ch-res { margin-top: 12px; background: var(--card); border: 1px solid #9BD35A55; border-radius: 14px; padding: 10px; }
.ch-res > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0; }
.ch-res span { display: grid; justify-items: center; text-align: center; background: #0B1812; border: 1px solid var(--c); border-radius: 12px; padding: 6px 2px; font-size: 11px; }
.ch-res span b { font-size: 18px; } .ch-res span small { color: var(--muted); font-size: 10px; }
#combat { flex-direction: row; }

.fm-res { display: flex; gap: 6px; align-items: stretch; }
.fr { flex: 1; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0 6px; background: #0B1812; border: 1px solid #9BD35A66; border-radius: 12px; padding: 4px 8px; color: var(--ink); cursor: pointer; text-align: left; }
.fr span { grid-row: span 2; font-size: 22px; } .fr b { font-size: 15px; line-height: 1; } .fr small { font-size: 9px; color: var(--muted); line-height: 1.1; }
.fr:disabled { opacity: .4; cursor: default; }
.fr-note { display: none; }

/* Чайничек-советчик: облачко над питомцем */
.tip { position: absolute; z-index: 5; max-width: min(260px, 72%); background: #FFF8E6; color: #2A1C05; border: 2px solid #F5CF5A; border-radius: 16px 16px 16px 4px; padding: 8px 12px; font: 600 13px/1.3 system-ui; text-align: left; box-shadow: 0 6px 18px #0007; cursor: pointer; animation: tipIn .3s cubic-bezier(.3, 1.6, .5, 1); }
.tip::after { content: ""; position: absolute; left: 10px; bottom: -9px; border: 8px solid transparent; border-top-color: #F5CF5A; border-bottom: 0; }
.tip i { font-style: normal; font-weight: 900; color: #C98A1E; }
.tip.urgent { background: #FFE6E0; border-color: #FF6B5A; } .tip.urgent::after { border-top-color: #FF6B5A; }
.tip.sale { background: linear-gradient(180deg, #FFF8E6, #FFE7A3); }
@keyframes tipIn { from { transform: scale(.4) translateY(10px); opacity: 0; } }

.cbtn.ddg { border-color: #9FE2BF; } .cbtn.ddg.on { box-shadow: 0 0 0 4px #9FE2BF, 0 0 20px #9FE2BF; }
#combat { gap: 8px; } #combat .cbtn { width: 62px; height: 62px; } #combat .cbtn.blk { width: 80px; height: 80px; }

.slot.arm { box-shadow: 0 0 14px -2px #F2B33D; }
.arms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.armc { background: #0B1812; border: 1px dashed #F2B33D66; border-radius: 14px; padding: 8px 4px; color: var(--ink); display: grid; justify-items: center; gap: 2px; cursor: pointer; text-align: center; }
.armc span { font-size: 28px; filter: grayscale(.8) brightness(.7); } .armc b { font-size: 11px; line-height: 1.15; } .armc small { font-size: 10px; color: var(--muted); }
.armc.on { border: 2px solid #F2B33D; background: radial-gradient(circle at 50% 20%, #F2B33D33, #0B1812 70%); } .armc.on span { filter: drop-shadow(0 0 8px #F2B33D); }

/* Чайный город */
.who { cursor: pointer; }
.tdot { position: absolute; top: 4px; right: calc(50% - 18px); width: 10px; height: 10px; border-radius: 50%; background: #E0603A; box-shadow: 0 0 0 2px #0B1812; }
#v-city { background: linear-gradient(180deg, #BFE3D0 0, #8DBFA3 120px, #3E6E4A 260px, #2C5236 100%); min-height: 100%; }
.city-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #0F1F17cc; border-radius: 16px; padding: 10px 12px; margin-bottom: 12px; backdrop-filter: blur(4px); }
.city-head h2 { margin: 0; font-size: 19px; } .city-head small { color: var(--muted); font-size: 12px; } .city-head .btn { margin: 0; white-space: nowrap; }
.city-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 10px; }
.bld { position: relative; border: 0; background: none; color: #fff; padding: 0 0 6px; cursor: pointer; display: grid; justify-items: center; gap: 1px; text-align: center; }
.bart { position: relative; width: 100%; height: 108px; display: grid; place-items: end center; margin-bottom: 16px; }
.bart::before { content: ""; position: absolute; left: 6%; right: 6%; bottom: 0; height: 46px; border-radius: 50%; background: radial-gradient(ellipse at 50% 40%, #7DBF5A, #4F8A5F 70%); box-shadow: 0 8px 0 #2F5A3A, 0 14px 18px #0006; }
.bart span { position: relative; font-size: 64px; line-height: 1; margin-bottom: 14px; filter: drop-shadow(0 6px 4px #0006); transition: transform .2s; }
.bld:active .bart span { transform: scale(.92); }
.bart > i { position: absolute; right: 14%; bottom: 8px; font-style: normal; font: 800 12px system-ui; background: #F5CF5A; color: #2A1C05; border-radius: 10px; padding: 1px 7px; box-shadow: 0 2px 0 #9A6E15; }
.bld b { font-size: 14px; text-shadow: 0 1px 3px #000a; } .bld small { font-size: 11px; color: #E8F4EC; text-shadow: 0 1px 2px #000a; line-height: 1.2; padding: 0 4px; }
.bld.lock .bart span { filter: grayscale(1) brightness(.5); } .bld.lock small { color: #ffffffaa; }
.bld.new .bart span { opacity: .55; } .bld.new .bart::after { content: "🏗️"; position: absolute; font-size: 28px; bottom: 20px; right: 18%; }
.bld.work .bart span { animation: workB .5s infinite alternate; } @keyframes workB { to { transform: translateY(-3px) rotate(-2deg); } }
.bld.work .bart::after { content: "🔨"; position: absolute; font-size: 26px; top: 6px; right: 14%; animation: hammer .4s infinite alternate; transform-origin: 80% 80%; } @keyframes hammer { to { transform: rotate(-40deg); } }
.bld .bar { width: 80%; height: 6px; background: #0006; border-radius: 4px; overflow: hidden; } .bld .bar i { display: block; height: 100%; background: linear-gradient(90deg, #F5CF5A, #FFE7A3); }
.bub { position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 2; font-style: normal; font: 800 13px system-ui; background: #FFF8E6; color: #2A1C05; border: 2px solid #F5CF5A; border-radius: 14px; padding: 3px 9px; white-space: nowrap; box-shadow: 0 4px 10px #0005; animation: bubB .8s infinite alternate ease-in-out; }
.bub.full { background: #FFE6E0; border-color: #FF6B5A; } .bub.road { animation: none; opacity: .9; }
@keyframes bubB { to { transform: translate(-50%, -5px); } }
.fly { position: fixed; z-index: 60; pointer-events: none; font: 900 18px system-ui; color: #BFF2C8; text-shadow: 0 2px 4px #000; transform: translate(-50%, -50%); animation: flyTo .9s cubic-bezier(.5, -0.4, .7, 1) forwards; }
.fly.lead { font-size: 20px; color: #FFE7A3; }
@keyframes flyTo { 30% { transform: translate(-50%, -150%) scale(1.3); } to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.6); opacity: .2; } }
.cur span.pop, #tleaf.pop, #tpearl.pop { animation: popC .35s; } @keyframes popC { 50% { transform: scale(1.5); color: #BFF2C8; } }
#tleaf, #tpearl { display: inline-block; }
.bcard .trips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; } .trips .btn { margin: 0; padding: 8px 4px; display: grid; } .trips small { color: var(--muted); font-size: 11px; }
.bcard p span.no { color: #FF8A7A; }

/* Карта крепости */
#v-city { background: radial-gradient(120% 60% at 50% 0%, #CFEBDD, #9CCFB4 45%, #4F8A5F 100%); }
#citymap { position: relative; width: 100%; aspect-ratio: 1 / 0.86; margin-top: 4px; overflow: hidden; }
#citycv { position: absolute; inset: 0; width: 100%; height: 100%; }
#cityov { position: absolute; inset: 0; }
.plot { position: absolute; transform: translate(-50%, -100%); border: 0; background: none; padding: 0; cursor: pointer; display: grid; justify-items: center; color: #fff; -webkit-tap-highlight-color: transparent; }
.plot .pl { line-height: 1; filter: drop-shadow(0 5px 3px rgba(0,0,0,.35)); transition: transform .15s; }
.plot:active .pl { transform: scale(.9); }
.plot .pl.site { width: 1.9em; height: 1.1em; display: grid; place-items: center; border: 2px dashed #FFF8E6; border-radius: 50%; color: #FFF8E6; font-weight: 900; background: rgba(122,90,52,.75); animation: siteP 1.2s infinite alternate; }
@keyframes siteP { to { box-shadow: 0 0 14px #F5CF5A; } }
.plot .pl.lock { opacity: .85; }
.plot small { margin-top: -2px; font: 700 10px/1.1 system-ui; background: rgba(15,31,23,.78); padding: 2px 6px; border-radius: 8px; white-space: nowrap; }
.plot small i { font-style: normal; background: #F5CF5A; color: #2A1C05; border-radius: 6px; padding: 0 4px; margin-left: 2px; }
.plot.is-lock small { color: #ffffffaa; }
.plot.is-work .pl.b { filter: grayscale(.4) drop-shadow(0 5px 3px rgba(0,0,0,.35)); }
.plot .scaf { position: absolute; bottom: 14px; right: -10px; animation: workB .5s infinite alternate; }
.plot .bub { top: auto; bottom: 100%; margin-bottom: 2px; font-size: 11px; padding: 2px 7px; }
.plot .smoke { position: absolute; top: -6px; right: 4px; font-size: 14px; opacity: 0; animation: smoke 2.4s infinite; }
@keyframes smoke { 0% { transform: translateY(0) scale(.6); opacity: 0; } 30% { opacity: .8; } 100% { transform: translateY(-26px) scale(1.4); opacity: 0; } }
.cloud { position: absolute; font-size: 40px; opacity: .85; pointer-events: none; z-index: 30; filter: drop-shadow(0 6px 6px rgba(0,0,0,.15)); animation: cloudM 38s linear infinite; }
.cloud.c1 { top: 4%; } .cloud.c2 { top: 30%; font-size: 30px; animation-duration: 52s; animation-delay: -20s; }
@keyframes cloudM { from { left: -15%; } to { left: 110%; } }
.camel { position: absolute; z-index: 25; font-size: 22px; transform: translate(-50%, -100%) scaleX(-1); animation: camelW 1s infinite alternate; }
@keyframes camelW { to { margin-top: -3px; } }
.city-head h2 { color: #FFE7A3; }

#citymap { aspect-ratio: auto; height: calc(100dvh - 250px); min-height: 360px; border-radius: 18px; touch-action: none; cursor: grab; box-shadow: inset 0 0 0 1px #ffffff22; }
#cityworld { position: absolute; left: 0; top: 0; will-change: transform; }
.plot .pl.b + small, .plot small:has(i) { background: none; padding: 0; margin-top: -10px; }
.city-note { margin: 6px 0 0; }

/* ===== Дизайн 1.5: тёплое золото на тёмном нефрите ===== */
:root { --bg: #0C1A13; --card: #16301F; --card2: #1D3D2A; --gold: #F5CF5A; }
body { background: radial-gradient(120% 60% at 50% 0%, #1A3A27 0%, #0C1A13 60%) fixed; }
#top { background: linear-gradient(180deg, #102318, #0B1812); border-bottom: 1px solid #F5CF5A33; box-shadow: 0 6px 18px #0007; position: relative; z-index: 4; }
.who img { border-radius: 14px; box-shadow: 0 0 0 2px #F5CF5A, 0 4px 10px #0008; background: radial-gradient(circle at 50% 30%, #2E5A40, #13261D); }
.cur span, .pearls { background: linear-gradient(180deg, #1F3E2B, #142A1E); border: 1px solid #ffffff14; box-shadow: inset 0 1px 0 #ffffff12; }
#tabs { grid-template-columns: repeat(7, 1fr); background: linear-gradient(180deg, #0F2118, #08130D); border-top: 1px solid #F5CF5A26; padding-top: 4px; }
#tabs button { font-size: 9.5px; letter-spacing: -.1px; border-radius: 14px; margin: 0 1px; transition: color .2s, background .2s; }
#tabs button span { font-size: 21px; transition: transform .2s; }
#tabs button.on { color: var(--gold); background: radial-gradient(circle at 50% 30%, #F5CF5A2e, transparent 70%); }
#tabs button.on span { transform: translateY(-2px) scale(1.12); filter: drop-shadow(0 0 6px #F5CF5A88); }
.btn.gold { background: linear-gradient(180deg, #FFE38A, #F5CF5A 45%, #D9A22E); position: relative; overflow: hidden; }
.btn.gold::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, #ffffff66 45%, transparent 60%); transform: translateX(-120%); animation: shine 3.2s infinite; pointer-events: none; }
@keyframes shine { 60%, 100% { transform: translateX(120%); } }
.card, .ch-card, .game, .qbtn { background: linear-gradient(180deg, #1C3B28, #132A1D); border-color: #ffffff17; box-shadow: 0 6px 16px -8px #000a, inset 0 1px 0 #ffffff10; }
.game.hot { box-shadow: 0 0 24px -8px #4CAF50, inset 0 1px 0 #ffffff14; }
#modal-in { background: linear-gradient(180deg, #1C3B28, #11251A); border: 1px solid #F5CF5A44; box-shadow: 0 30px 60px -10px #000c, 0 0 0 1px #00000055; }
h3.sec, .view h3 { letter-spacing: .2px; }
#citymap.night .plot .pl.b { filter: drop-shadow(0 0 10px #FFC85A) drop-shadow(0 5px 3px rgba(0,0,0,.35)); }

/* ===== Кланы ===== */
.clan-hero, .clan-empty { text-align: center; background: radial-gradient(120% 100% at 50% 0%, #2E5A40, #13261D 70%); border: 1px solid #F5CF5A33; border-radius: 20px; padding: 16px; }
.big-emb { font-size: 64px; filter: drop-shadow(0 8px 10px #0008); animation: instF 2.6s ease-in-out infinite alternate; }
.clan-search { display: flex; gap: 6px; margin: 12px 0 4px; } .clan-search input, .chatf input, #clf input, #cle input { flex: 1; width: 100%; box-sizing: border-box; background: #0B1812; border: 1px solid #ffffff22; color: var(--ink); border-radius: 12px; padding: 10px 12px; font: 15px system-ui; }
.clrow { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid #ffffff14; border-radius: 14px; padding: 8px 10px; margin: 6px 0; }
.clrow .pos { width: 24px; text-align: center; } .clrow .emb { font-size: 30px; } .clrow div { flex: 1; min-width: 0; } .clrow small { display: block; color: var(--muted); font-size: 12px; } .clrow .btn { margin: 0; }
.clan-banner { display: flex; align-items: center; gap: 10px; background: linear-gradient(135deg, #3A2A0E, #1D3D2A 60%); border: 1px solid #F5CF5A55; border-radius: 18px; padding: 10px 12px; box-shadow: 0 0 24px -10px #F5CF5A; }
.clan-banner .emb { font-size: 44px; filter: drop-shadow(0 4px 6px #0009); } .clan-banner div { flex: 1; min-width: 0; } .clan-banner h2 { margin: 0; font-size: 18px; color: #FFE7A3; } .clan-banner small { color: var(--muted); font-size: 12px; }
.cchest { margin: 10px 0; } .cbar { height: 8px; background: #0B1812; border-radius: 6px; overflow: hidden; } .cbar i { display: block; height: 100%; background: linear-gradient(90deg, #9BD35A, #F5CF5A); }
.tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0 4px; }
.tier { background: #0B1812; border: 1px solid #ffffff22; border-radius: 12px; color: var(--ink); display: grid; justify-items: center; padding: 6px 2px; cursor: pointer; }
.tier span { font-size: 24px; filter: grayscale(.9) brightness(.6); } .tier b { font-size: 12px; } .tier small { font-size: 10px; color: var(--muted); }
.tier.ok { border-color: #F5CF5A; animation: ready 1s infinite alternate; } .tier.ok span, .tier.got span { filter: none; } .tier.ok small { color: var(--gold); font-weight: 800; } .tier.got { opacity: .6; animation: none; }
#cltabs { margin: 8px 0; }
.chat { height: calc(100dvh - 480px); min-height: 220px; overflow-y: auto; background: #0B1812; border: 1px solid #ffffff14; border-radius: 14px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.msg { position: relative; background: #16301F; border-radius: 12px 12px 12px 4px; padding: 6px 10px 6px; max-width: 88%; align-self: flex-start; }
.msg b { display: block; font-size: 12px; color: #9FE2BF; } .msg b.r-leader { color: #FFD76A; } .msg b.r-deputy { color: #BFE3FF; } .msg b.r-mod { color: #C9A7FF; }
.msg span { font-size: 14px; word-wrap: break-word; } .msg small { display: block; text-align: right; color: var(--muted); font-size: 10px; }
.msg.sys { align-self: center; background: none; color: var(--gold); font-size: 12px; text-align: center; }
.msg.del span { color: var(--muted); font-style: italic; }
.mdel { position: absolute; top: 2px; right: 4px; border: 0; background: none; color: #ffffff55; cursor: pointer; font-size: 11px; }
.chatf { display: flex; gap: 6px; margin-top: 6px; } .chatf .btn { margin: 0; }
.mrow { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid #ffffff12; border-radius: 14px; padding: 6px 10px; margin: 6px 0; }
.mrow.me { border-color: #F5CF5A66; } .mrow img { width: 38px; height: 44px; object-fit: contain; } .mrow div { flex: 1; } .mrow small { display: block; color: var(--muted); font-size: 12px; }
.mrow i.on { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #4FD27A; box-shadow: 0 0 6px #4FD27A; }
.embs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 8px 0; } .embs label { margin: 0 !important; } .embs input { display: none; }
.embs span { display: grid; place-items: center; font-size: 26px; height: 46px; border-radius: 12px; background: #0B1812; border: 2px solid transparent; cursor: pointer; }
.embs input:checked + span { border-color: var(--gold); box-shadow: 0 0 12px #F5CF5A66; }

#citymap { height: calc(100dvh - 290px); min-height: 380px; }
.plot small { font-size: 11px; padding: 2px 8px; }
.city-nav { display: flex; gap: 6px; overflow-x: auto; padding: 8px 2px 2px; scrollbar-width: none; }
.city-nav .cn { flex: none; width: 46px; height: 46px; border-radius: 14px; border: 1px solid #ffffff22; background: linear-gradient(180deg, #1C3B28, #132A1D); font-size: 24px; cursor: pointer; position: relative; }
.city-nav .cn.rdy::after { content: ""; position: absolute; top: 3px; right: 3px; width: 10px; height: 10px; border-radius: 50%; background: #E0603A; box-shadow: 0 0 0 2px #13261D; }
.city-nav .cn.lk { filter: grayscale(1); opacity: .55; }
.plot .smoke.s2 { animation-delay: 1.2s; right: 14px; }

/* ===== Набеги ===== */
.ch-btns { display: flex; flex-direction: column; gap: 4px; } .ch-btns .btn { margin: 0; padding: 7px 12px; font-size: 14px; }
.raid-btn { background: linear-gradient(180deg, #E0603A, #A8341C); border-color: #FF8A5A; color: #fff; box-shadow: 0 3px 0 #6A1E0E; animation: raidP 1.6s infinite alternate; }
@keyframes raidP { to { box-shadow: 0 3px 0 #6A1E0E, 0 0 16px #FF8A5A; } }
#modal-in:has(.worldm) { max-width: 480px; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; padding: max(8px, env(safe-area-inset-top)) 10px 10px; background: #0F1F17; }
#modal:has(.worldm) { padding: 0; }
.worldm { display: flex; flex-direction: column; height: 100%; gap: 6px; }
.wm-note { margin: 0; font-size: 12px; color: var(--muted); }
.wm-map { position: relative; flex: 1; overflow-y: auto; border-radius: 18px; min-height: 900px;
  background: radial-gradient(60% 40% at 30% 20%, #E8C27A 0, transparent 70%), radial-gradient(50% 30% at 75% 60%, #D9A44A 0, transparent 70%),
    repeating-radial-gradient(circle at 50% 120%, #C99652 0 22px, #D2A35E 22px 44px); box-shadow: inset 0 0 40px #0006; }
.bpin { position: absolute; transform: translate(0, 0); border: 0; background: none; color: #fff; cursor: pointer; display: grid; justify-items: center; width: 32%; padding: 0; }
.bpin span { filter: drop-shadow(0 6px 4px #0007); line-height: 1; animation: instF 2.4s ease-in-out infinite alternate; }
.bpin b { font-size: 12px; background: #13261Dd9; padding: 1px 8px; border-radius: 8px; margin-top: 2px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bpin small { font-size: 10px; color: #2A1C05; font-weight: 700; }
.bpin .bub { position: static; transform: none; margin-bottom: 2px; animation: bubB2 .8s infinite alternate; } @keyframes bubB2 { to { margin-bottom: 7px; } }
.wm-empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font-size: 60px; color: #2A1C05; } .wm-empty p { font-size: 14px; font-weight: 700; }
.raid-win .flag { font-size: 70px; animation: flagIn .6s cubic-bezier(.3, 1.8, .5, 1); transform-origin: 20% 100%; } @keyframes flagIn { from { transform: scale(0) rotate(-40deg); } }
.raid-win h2 { color: var(--gold); font-size: 28px; }
.loot-rain { position: relative; height: 60px; overflow: hidden; } .loot-rain i { position: absolute; top: -30px; left: var(--x); font-style: normal; font-size: 24px; animation: lootF 1.1s var(--d) ease-in forwards; }
@keyframes lootF { to { transform: translateY(100px) rotate(200deg); opacity: 0; } }
.roll { font-size: 30px; color: #BFF2C8; } .roll.pop { animation: popC .4s; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: confF linear forwards; }
@keyframes confF { to { transform: translateY(110vh) rotate(var(--r)); } }
#citymap { isolation: isolate; } .cloud { z-index: 3; }
.durak .pc.pcx { width: 54px; height: 78px; } .durak .hand .pc.pcx { margin-left: -10px; } .durak .hand .pc.pcx:first-child { margin-left: 0; }

/* ---------- 1.8: мировой босс и достижения ---------- */
.game.hot.g4 { background: linear-gradient(135deg, #7A1E2E, #1E0F14 70%); border-color: #FF6B5A; box-shadow: 0 0 24px -8px #FF6B5A; }
.wb-btn { margin-top: 8px; background: linear-gradient(180deg, #5A1F2A, #2A0E14); border-color: #FF6B5A88; color: #FFE7A3; }
.wbm { text-align: center; }
.wbm h2 { margin: 2px 0 8px; }
.wb-boss { position: relative; margin: 6px auto 0; width: 132px; height: 132px; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle, #FF6B5A55, transparent 68%); animation: wbFloat 2.4s ease-in-out infinite; }
.wb-boss span { font-size: 86px; filter: drop-shadow(0 8px 16px #000a); }
.wb-boss.dead { filter: grayscale(1) brightness(.7); animation: none; }
@keyframes wbFloat { 50% { transform: translateY(-8px) scale(1.04); } }
.wb-bar { position: relative; height: 22px; border-radius: 12px; background: #0008; border: 1px solid #FF6B5A66; overflow: hidden; margin: 8px 0; }
.wb-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #E0603A, #FF9A5A); transition: width 1.2s cubic-bezier(.2,.8,.2,1); }
.wb-bar b { position: relative; font-size: 12px; line-height: 22px; text-shadow: 0 1px 2px #000; }
.wb-me { margin: 10px 0 6px; }
.wb-top { list-style: none; padding: 0; margin: 6px 0 10px; text-align: left; }
.wb-top li { display: flex; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 10px; background: #ffffff0d; margin-bottom: 4px; }
.wb-top li span { width: 22px; text-align: center; }
.wb-top li b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-top li em { font-style: normal; color: #FFD76A; font-weight: 800; }
.btn.pulse { animation: raidP 1s infinite alternate; }
.achs { display: grid; gap: 6px; }
.ach { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: #ffffff0a; border: 1px solid var(--c); }
.ach > span { font-size: 26px; width: 34px; text-align: center; }
.ach > div { flex: 1; min-width: 0; }
.ach small { display: block; color: #ffffffaa; font-size: 11px; }
.ach .bar { height: 5px; margin: 4px 0 3px; }
.ach em { display: flex; gap: 3px; }
.ach em i { width: 14px; height: 4px; border-radius: 2px; }
.ach.ready { background: linear-gradient(90deg, #F5CF5A22, #ffffff0a); box-shadow: 0 0 14px -6px #F5CF5A; }
.ach.done { background: linear-gradient(90deg, #7FE3FF1c, #ffffff0a); }

/* ================= 1.9: дизайн — ярче, живее, сочнее ================= */
/* карта уровней: светлее, сцена видна, тропа как в Candy Crush */
#map { background: linear-gradient(180deg, #0F1F17d9 0%, #0F1F1733 22%, #0F1F1722 60%, #0F1F17e6 100%); }
.map-head { background: linear-gradient(180deg, #1E4030f2, #13261Df2); border: 1px solid #F5CF5A55; border-radius: 18px; padding: 6px 8px; box-shadow: 0 6px 18px #0006; }
.map-head b { font-size: 19px; text-shadow: 0 2px 0 #0008, 0 0 14px #F5CF5A55; letter-spacing: .3px; }
.map-path { display: block; min-height: 330px; margin: 4px 0; }
.map-trail { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.map-trail path { fill: none; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.tr-bg { stroke: #00000055; stroke-width: 14; }
.tr-bg + .tr-done { stroke: #F5CF5A; stroke-width: 5; stroke-dasharray: 1 0; }
.map-trail .tr-bg { filter: drop-shadow(0 0 0 #0000); }
.map-trail path.tr-bg { stroke: #E8D9B0; stroke-opacity: .5; stroke-width: 10; stroke-dasharray: 2 12; }
.map-trail path.tr-done { stroke-width: 6; stroke-dasharray: 2 10; stroke: #FFE08A; filter: drop-shadow(0 0 4px #F5CF5A); }
.mnode { position: absolute; transform: translate(-50%, -50%); width: 58px; height: 58px; border: 0; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #9BE39A, #3E9A57 45%, #1E5A34 80%); box-shadow: 0 5px 0 #0E2E1C, 0 8px 14px #0008, inset 0 -5px 8px #0004, inset 0 3px 6px #ffffff55;
  animation: nodeIn .5s cubic-bezier(.2, 1.6, .4, 1) both; animation-delay: calc(var(--i) * 45ms); z-index: 2; }
@keyframes nodeIn { from { transform: translate(-50%, -50%) scale(0); } }
.mnode b { font-size: 20px; text-shadow: 0 2px 0 #0006; }
.mnode small { position: absolute; bottom: -13px; font-size: 11px; letter-spacing: -2px; text-shadow: 0 1px 2px #000; }
.mnode.done { background: radial-gradient(circle at 34% 28%, #FFF1B0, #F5C842 45%, #B57D12 85%); box-shadow: 0 5px 0 #7A5208, 0 8px 14px #0008, inset 0 3px 6px #ffffff88; color: #3A2604; }
.mnode.done b { text-shadow: 0 1px 0 #fff8; }
.mnode.boss { width: 70px; height: 70px; background: radial-gradient(circle at 34% 28%, #FFB38A, #E0603A 45%, #7A1E14 85%); box-shadow: 0 5px 0 #4A0F08, 0 0 22px #FF6B3A88, inset 0 3px 6px #ffffff66; }
.mnode.boss b { font-size: 30px; }
.mnode.lock { opacity: 1; background: radial-gradient(circle at 34% 28%, #5A6E62, #2A3A31 70%); box-shadow: 0 4px 0 #111c16, inset 0 2px 4px #ffffff22; filter: saturate(.4); }
.mnode.lock b { font-size: 17px; opacity: .8; }
.mnode.cur { animation: nodeIn .5s cubic-bezier(.2, 1.6, .4, 1) both, curGlow 1.2s ease-in-out infinite alternate; animation-delay: calc(var(--i) * 45ms), 0s; border: 3px solid #fff; z-index: 3; }
@keyframes curGlow { to { box-shadow: 0 5px 0 #0E2E1C, 0 0 0 8px #F5CF5A33, 0 0 30px #F5CF5Acc, inset 0 3px 6px #ffffff55; } }
.mnode.cur::before { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid #F5CF5A; animation: ring 1.6s ease-out infinite; }
@keyframes ring { from { transform: scale(.7); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.mn-hero { position: absolute; bottom: 44px; left: 50%; width: 46px; height: 56px; object-fit: contain; transform: translateX(-50%); animation: heroHop .9s ease-in-out infinite; filter: drop-shadow(0 6px 4px #0007); pointer-events: none; }
@keyframes heroHop { 50% { transform: translateX(-50%) translateY(-8px); } }

/* кнопки: объём, блик пробегает по золотым */
.btn { transition: transform .08s, box-shadow .08s, filter .15s; position: relative; overflow: hidden; }
.btn.gold { background: linear-gradient(180deg, #FFE38A 0%, #F5C842 45%, #D9962A 100%); box-shadow: 0 4px 0 #8A5A0E, 0 8px 16px #E8B83A33, inset 0 2px 0 #fff9; text-shadow: 0 1px 0 #fff6; font-weight: 800; }
.btn.gold:not(:disabled)::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, #ffffffaa, transparent); transform: skewX(-20deg); animation: shine 3.2s ease-in-out infinite; pointer-events: none; }
@keyframes shine { 0%, 55% { left: -60%; } 85%, 100% { left: 130%; } }
.btn.gold:active { box-shadow: 0 1px 0 #8A5A0E, inset 0 2px 0 #fff9; }
.map-go { font-size: 19px; padding: 16px; border-radius: 18px; animation: breathe 2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.025); } }
.wb-btn { position: relative; overflow: hidden; background: linear-gradient(90deg, #7A1E2E, #B33A2A, #7A1E2E); background-size: 200% 100%; animation: fire 3s linear infinite; border-color: #FF8A5A; color: #FFF1C2; font-weight: 800; box-shadow: 0 4px 0 #3A0A10, 0 0 18px #FF6B3A44; }
@keyframes fire { to { background-position: 200% 0; } }

/* шапка и вкладки */
#tabs { background: linear-gradient(180deg, #13261D, #0A1610); box-shadow: 0 -6px 18px #0006; }
#tabs button { position: relative; transition: color .2s; }
#tabs button span { transition: transform .25s cubic-bezier(.2, 1.6, .4, 1); }
#tabs button.on span { transform: translateY(-4px) scale(1.22); filter: drop-shadow(0 4px 6px #F5CF5A88); }
#tabs button.on::before { content: ""; position: absolute; top: 2px; left: 18%; right: 18%; bottom: 4px; border-radius: 14px; background: radial-gradient(ellipse at 50% 30%, #F5CF5A33, transparent 70%); z-index: -1; }
#tabs button.on::after { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); box-shadow: 0 0 10px var(--gold); }

/* экраны появляются плавно, карточки — лесенкой */
.view:not([hidden]) { animation: viewIn .28s ease-out; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }
.view:not([hidden]) :is(.row, .game, .ach, .ch-card, .armc, .skin, .quest) { animation: cardIn .4s cubic-bezier(.2, 1.3, .4, 1) both; }
.view:not([hidden]) :is(.row, .game, .ach, .ch-card, .armc, .skin):nth-child(2) { animation-delay: .04s; }
.view:not([hidden]) :is(.row, .game, .ach, .ch-card, .armc, .skin):nth-child(3) { animation-delay: .08s; }
.view:not([hidden]) :is(.row, .game, .ach, .ch-card, .armc, .skin):nth-child(4) { animation-delay: .12s; }
.view:not([hidden]) :is(.row, .game, .ach, .ch-card, .armc, .skin):nth-child(5) { animation-delay: .16s; }
.view:not([hidden]) :is(.row, .game, .ach, .ch-card, .armc, .skin):nth-child(n+6) { animation-delay: .2s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.game { transition: transform .15s; } .game:active { transform: scale(.97); }
.game > span { filter: drop-shadow(0 4px 8px #0008); animation: icoBob 3s ease-in-out infinite; display: inline-block; }
@keyframes icoBob { 50% { transform: translateY(-3px) rotate(-4deg); } }

/* улучшения: можно купить — светится */
.qbtn { transition: transform .1s, box-shadow .2s; background: linear-gradient(180deg, #24513A, #183327); }
.qbtn:not(:disabled) { border-color: #F5CF5A; box-shadow: 0 0 14px -4px #F5CF5A, inset 0 1px 0 #ffffff22; animation: canBuy 1.6s ease-in-out infinite alternate; }
@keyframes canBuy { to { box-shadow: 0 0 20px -2px #F5CF5A, inset 0 1px 0 #ffffff22; } }
.qbtn:not(:disabled) i { animation: priceHop 1.6s ease-in-out infinite; display: inline-block; }
@keyframes priceHop { 0%, 80%, 100% { transform: none; } 90% { transform: translateY(-3px); } }
.row .btn.gold { animation: canBuy 1.6s ease-in-out infinite alternate; }

/* окна: пружинка, награды — с вращающимися лучами и искрами */
#modal { background: radial-gradient(circle at 50% 40%, #0B1812bb, #000d); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
#modal-in { animation: popIn .38s cubic-bezier(.2, 1.5, .4, 1); box-shadow: 0 20px 60px #000a, 0 0 0 1px #F5CF5A33, inset 0 1px 0 #ffffff14; background: linear-gradient(180deg, #1E4030, #13261D 60%); }
@keyframes popIn { from { transform: scale(.7) translateY(20px); opacity: 0; } }
.burst { position: relative; display: inline-block; font-size: 64px; animation: burstIn .7s cubic-bezier(.2, 1.6, .4, 1); filter: drop-shadow(0 6px 10px #0008); z-index: 0; }
@keyframes burstIn { from { transform: scale(0) rotate(-120deg); } }
.burst::before { content: ""; position: absolute; left: 50%; top: 50%; width: 210px; height: 210px; margin: -105px 0 0 -105px; z-index: -1; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, #F5CF5A55 0deg 10deg, transparent 10deg 24deg); -webkit-mask: radial-gradient(circle, #000 20%, transparent 68%); mask: radial-gradient(circle, #000 20%, transparent 68%); animation: rays 8s linear infinite; }
@keyframes rays { to { transform: rotate(360deg); } }
.burst::after { content: "✦ ✧ ✦"; position: absolute; left: 50%; top: -6px; transform: translateX(-50%); font-size: 16px; color: #FFE38A; letter-spacing: 34px; white-space: nowrap; animation: twinkle 1.2s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .3; transform: translateX(-50%) scale(.8); } to { opacity: 1; transform: translateX(-50%) scale(1.1); } }
.chest-ico { display: inline-block; font-size: 84px; filter: drop-shadow(0 8px 12px #0009); }
.lvl-end.win h2 { font-size: 34px; background: linear-gradient(180deg, #FFF3B8, #F5C842 55%, #D98A1A); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 #6A4208); animation: winPop .6s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes winPop { from { transform: scale(.3); } }
.stars span { display: inline-block; font-size: 40px; filter: grayscale(1) brightness(.4); }
.stars span.on { filter: drop-shadow(0 0 10px #F5CF5A); animation: starIn .5s cubic-bezier(.2, 1.8, .4, 1) both; }
@keyframes starIn { from { transform: scale(0) rotate(-180deg); } 70% { transform: scale(1.35); } }

/* живой фон: летящие чайные листья позади всего */
.bg-leaves { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-leaves i { position: absolute; top: -40px; font-style: normal; font-size: 18px; opacity: .22; animation: leafFall linear infinite; }
@keyframes leafFall { to { transform: translate(var(--dx), 110vh) rotate(var(--r)); } }
#app { position: relative; z-index: 1; }

/* шапка: ресурсы как камушки */
.cur > span, .cur > button { box-shadow: inset 0 1px 0 #ffffff1a, 0 2px 6px #0005; }
.pop { animation: numPop .4s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes numPop { 50% { transform: scale(1.25); color: #FFE38A; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }

/* первый экран: сияющий заголовок, герои дышат, мягкое свечение */
#onb { position: relative; z-index: 1; background: radial-gradient(ellipse at 50% 18%, #2F6A47 0%, #13261D 55%, #0B1812 100%); }
.onb-in h1 { font-size: 38px; margin: 6px 0; background: linear-gradient(100deg, #F5C842 20%, #FFF6CC 40%, #F5C842 60%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: titleShine 3.5s linear infinite; filter: drop-shadow(0 3px 0 #5A3A08) drop-shadow(0 0 18px #F5CF5A55); }
@keyframes titleShine { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.onb-logo { animation: fadeDown .6s ease-out both; } @keyframes fadeDown { from { opacity: 0; transform: translateY(-14px); } }
.pick { transition: transform .2s cubic-bezier(.2, 1.6, .4, 1), box-shadow .2s, border-color .2s; background: linear-gradient(180deg, #24513A, #13261D); animation: cardIn .5s cubic-bezier(.2, 1.3, .4, 1) both; }
.pick:nth-child(2) { animation-delay: .1s; }
.pick img { animation: heroIdle 2.6s ease-in-out infinite; filter: drop-shadow(0 10px 8px #0008); }
.pick:nth-child(2) img { animation-delay: -1.3s; }
@keyframes heroIdle { 50% { transform: translateY(-7px) scale(1.02); } }
.pick.on { transform: scale(1.05); box-shadow: 0 0 0 2px #F5CF5A, 0 0 34px #F5CF5A77; }
.pick.on img { animation: heroIdle 2.6s ease-in-out infinite, heroGlow 1.4s ease-in-out infinite alternate; }
@keyframes heroGlow { to { filter: drop-shadow(0 10px 8px #0008) drop-shadow(0 0 16px #F5CF5A); } }
/* поправки тропы: узлы компактнее, закрытые — стеклянные и неброские */
.mnode { width: 50px; height: 50px; }
.mnode.boss { width: 60px; height: 60px; } .mnode.boss b { font-size: 26px; }
.mnode.lock { width: 40px; height: 40px; background: #0B181299; border: 2px dashed #ffffff40; box-shadow: none; filter: none; }
.mnode.lock b { font-size: 14px; opacity: .55; }
.mnode.lock.boss { width: 48px; height: 48px; border-color: #FF8A5A77; } .mnode.lock.boss b { font-size: 22px; opacity: .7; }
.map-path { min-height: 380px; }
.wb-btn { margin: 0; padding: 11px; font-size: 15px; white-space: nowrap; }
@media (max-height: 760px) { .map-note { display: none; } .map-path { min-height: 330px; } }
.map-trail path.tr-done { stroke-width: 5; stroke: #FFD35A; filter: drop-shadow(0 0 5px #F5CF5A); }
.map-path { flex: 1 1 auto; min-height: 240px; }
@media (max-height: 760px) { .map-path { min-height: 220px; } }
#map { gap: 6px; }

/* ================= 2.0: воскрешение, Чайный пропуск, стартовый набор ================= */
.revive h2 { color: #FF8A7A; margin: 4px 0; }
.rv-loot { color: #FFD3C8; font-size: 14px; }
.rv-ring { position: relative; width: 74px; height: 74px; margin: 6px auto 10px; }
.rv-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rv-ring circle { fill: none; stroke: #FF6B5A; stroke-width: 7; stroke-linecap: round; stroke-dasharray: 283; animation: rvDrain 8s linear forwards; }
@keyframes rvDrain { to { stroke-dashoffset: 283; } }
.rv-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 28px; }
.rv-go { font-size: 19px; animation: breathe 1.2s ease-in-out infinite; }
.x2-note { color: #7FE3FF; font-weight: 700; }

.map-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.map-row .btn { margin: 0; }
.pp-btn { position: relative; background: linear-gradient(180deg, #4A2A7A, #26124A); border-color: #B58CFF; color: #F1E6FF; font-weight: 800; box-shadow: 0 4px 0 #160A2C, 0 0 18px #9B5DE544; padding: 9px 8px 13px; }
.pp-btn b { color: #FFE38A; }
.pp-mini { position: absolute; left: 14px; right: 14px; bottom: 5px; height: 4px; border-radius: 3px; background: #ffffff22; overflow: hidden; }
.pp-mini i { display: block; height: 100%; background: linear-gradient(90deg, #B58CFF, #FFE38A); }
.pp-btn .dot, .dot { position: absolute; top: -4px; right: -4px; width: 14px; height: 14px; border-radius: 50%; background: #FF4D4D; border: 2px solid #13261D; animation: pulse2 .8s infinite alternate; }

.ppm .pp-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ppm h2 { margin: 0; font-size: 20px; background: linear-gradient(90deg, #E2CCFF, #FFE38A); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ppm .pp-head small { color: var(--muted); font-size: 12px; }
.pp-lvl { min-width: 58px; height: 58px; border-radius: 16px; background: linear-gradient(180deg, #6A3FB0, #2E1660); border: 2px solid #B58CFF; display: grid; place-items: center; align-content: center; box-shadow: 0 0 18px #9B5DE566; }
.pp-lvl b { font-size: 24px; line-height: 1; } .pp-lvl small { font-size: 11px; color: #D8C4FF; }
.pp-bar { position: relative; height: 18px; border-radius: 10px; background: #0008; margin: 10px 0 4px; overflow: hidden; border: 1px solid #B58CFF55; }
.pp-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #9B5DE5, #FFD35A); transition: width .6s; }
.pp-bar b { position: relative; display: block; text-align: center; font-size: 11px; line-height: 18px; text-shadow: 0 1px 2px #000; }
.pp-track { display: flex; gap: 6px; overflow-x: auto; padding: 6px 2px 10px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.pp-row.lbl { display: flex; flex-direction: column; justify-content: space-around; padding-top: 22px; position: sticky; left: 0; z-index: 2; background: linear-gradient(90deg, #1A3A2A 70%, transparent); }
.pp-row.lbl em { writing-mode: vertical-rl; transform: rotate(180deg); font-style: normal; font-size: 11px; color: var(--muted); height: 86px; text-align: center; }
.pp-row.lbl em.pr { color: #FFE38A; }
.pp-col { flex: none; width: 72px; display: flex; flex-direction: column; gap: 6px; align-items: center; scroll-snap-align: center; }
.pp-col > b { width: 24px; height: 24px; border-radius: 50%; background: #0B1812; border: 1px solid #ffffff33; display: grid; place-items: center; font-size: 11px; color: var(--muted); }
.pp-col.on > b { background: #9B5DE5; border-color: #E2CCFF; color: #fff; box-shadow: 0 0 10px #9B5DE5; }
.pp-c { position: relative; width: 72px; height: 86px; border-radius: 14px; border: 1px solid #ffffff22; background: #ffffff0c; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 4px; cursor: pointer; }
.pp-c span { font-size: 26px; } .pp-c small { font-size: 9px; line-height: 1.15; text-align: center; color: #ffffffcc; }
.pp-c.pr { background: linear-gradient(180deg, #4A2A7A99, #26124A99); border-color: #B58CFF66; }
.pp-c.big { border-color: #FFD35A; box-shadow: 0 0 16px #FFD35A66; }
.pp-c.ready { border-color: #FFD35A; box-shadow: 0 0 14px #FFD35A88; animation: canBuy 1s ease-in-out infinite alternate; }
.pp-c.ready::after { content: "Забрать"; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); background: var(--gold); color: #2A1C05; font-size: 9px; font-weight: 800; padding: 1px 6px; border-radius: 6px; }
.pp-c.got { opacity: .45; } .pp-c.lock span { filter: saturate(.6); }
.pp-c i { position: absolute; top: 3px; right: 5px; font-style: normal; font-size: 12px; }
.pp-c:disabled { cursor: default; }
.pp-buy { display: flex; gap: 10px; align-items: center; background: linear-gradient(135deg, #4A2A7A, #1E0F3A); border: 1px solid #B58CFF; border-radius: 16px; padding: 12px; box-shadow: 0 0 24px #9B5DE544; }
.pp-buy small { display: block; font-size: 12px; color: #E2D6F5; margin-top: 3px; }
.pp-buy .btn { flex: none; margin: 0; }
.pp-own { background: #9B5DE522; border: 1px solid #B58CFF77; border-radius: 12px; padding: 10px; font-size: 13px; }

.starter .st-tag { display: inline-block; margin: 0; background: #E0603A; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 1px; padding: 3px 10px; border-radius: 8px; }
.starter h2 { margin: 4px 0 10px; font-size: 26px; }
.st-items { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.st-items div { background: #ffffff0d; border: 1px solid #F5CF5A55; border-radius: 14px; padding: 10px 6px; display: grid; }
.st-items span { font-size: 34px; } .st-items b { font-size: 18px; color: #FFE38A; } .st-items small { font-size: 11px; color: var(--muted); }
.st-price { font-size: 26px; margin: 12px 0 2px; } .st-price s { color: var(--muted); font-size: 16px; } .st-price b { color: #7CF29A; }

.pearls.x2 { position: relative; animation: canBuy 1.4s ease-in-out infinite alternate; }
.pearls.x2::after { content: "×2"; position: absolute; top: -8px; right: -6px; background: #E0603A; color: #fff; font-size: 10px; font-weight: 900; padding: 1px 5px; border-radius: 8px; box-shadow: 0 2px 6px #0007; }
.pp-buy { flex-wrap: wrap; } .pp-buy > div { flex: 1 1 60%; } .pp-buy > small { order: 3; flex-basis: 100%; margin: 0; }
.pp-row.lbl { position: static; background: none; flex: none; width: 16px; }
.bpin.npc span { filter: drop-shadow(0 0 8px #FF6B3A); } .bpin.npc b { color: #FFB38A; }
.regp h2 { margin: 4px 0; font-size: 24px; }
.reg-gifts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0; }
.reg-gifts div { background: #ffffff0d; border: 1px solid #F5CF5A66; border-radius: 14px; padding: 8px 4px; display: grid; animation: cardIn .5s cubic-bezier(.2, 1.3, .4, 1) both; }
.reg-gifts div:nth-child(2) { animation-delay: .1s; } .reg-gifts div:nth-child(3) { animation-delay: .2s; }
.reg-gifts span { font-size: 28px; } .reg-gifts b { color: #FFE38A; font-size: 16px; } .reg-gifts small { color: var(--muted); font-size: 11px; }
.reg-why { list-style: none; padding: 0; margin: 4px 0 10px; text-align: left; display: grid; gap: 4px; font-size: 14px; }
