:root {
  /* «ночное логово»: тёплый сливово-коричневый фон, кремовый текст, акценты — из опорной палитры арта (#E07A2E / #2E8A8A) */
  --bg: #1c1626; --bg2: #251d31; --card: #2c2339; --card2: #382d48; --line: #45385a;
  --text: #fbf1e3; --hint: #ab9dbb; --accent: #ffa340; --accent2: #3cc0b4; --good: #5fcf6f; --bad: #ff5d68; --warn: #ffcc4d;
  --q0: #c3bccb; --q1: #5fcf6f; --q2: #4b9cf5; --q3: #b06cf5; --q4: #ff9a1f; --q5: #ff3b4e;
  --r: 16px; --nav: 66px; --ink: #1a1020;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #110d17; color: var(--text); font: 15px/1.35 "Nunito", -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; }
#phone { max-width: 430px; height: 100%; margin: 0 auto; background: var(--bg); position: relative; display: flex; flex-direction: column; overflow: hidden; }

/* демо-переключатель (только в прототипе) */
.demo { display: flex; gap: 6px; padding: 6px 10px; background: #0d1016; font-size: 12px; align-items: center; color: var(--hint); }
.demo button { padding: 5px 10px; border-radius: 99px; background: #222838; font-size: 12px; }
.demo button.on { background: var(--accent2); color: #fff; }

/* шапка */
.top { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px 8px; }
.top h1 { margin: 0; font-size: 19px; font-weight: 700; }
.wallet { display: flex; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 99px; background: var(--card); font-weight: 600; font-size: 14px; }

main { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 0 12px 16px; }
.screen-title { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 2px 10px; }
.screen-title h2 { margin: 0; font-size: 22px; }
.sub { color: var(--hint); font-size: 13px; }

/* нижняя навигация */
nav.tabs { height: var(--nav); display: grid; grid-template-columns: repeat(5, 1fr); background: var(--bg2); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
nav.tabs button { background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--hint); position: relative; }
nav.tabs button .i { font-size: 22px; line-height: 1; filter: grayscale(.6); opacity: .8; }
nav.tabs button.on { color: var(--text); }
nav.tabs button.on .i { filter: none; opacity: 1; transform: scale(1.1); }
.badge { position: absolute; top: 6px; right: calc(50% - 22px); background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px; }

/* общие элементы */
.card { background: var(--card); border-radius: var(--r); padding: 12px; margin-bottom: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 14px; background: var(--card2); font-weight: 700; box-shadow: 0 3px 0 #0006; }
.btn.primary { background: linear-gradient(#ffb75c, #f28a2a); color: var(--ink); box-shadow: 0 3px 0 #a3501a; }
.btn.blue { background: linear-gradient(#4fd3c6, #2a9c92); color: var(--ink); box-shadow: 0 3px 0 #1b6a63; }
.btn.danger { background: #3a2329; color: #ff8d94; }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); box-shadow: none; }
.btn.big { min-height: 54px; font-size: 17px; width: 100%; }
.btn:disabled { opacity: .45; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #0006; }
.row { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.q { font-weight: 700; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 8px; background: var(--card2); font-size: 12.5px; margin: 2px 4px 2px 0; }
.tag.pos { background: #1e3a2a; color: #8ff0a8; } .tag.neg { background: #3d2228; color: #ff9aa2; } .tag.mix { background: #3a3220; color: #ffd98a; }
.tag.hl { background: linear-gradient(90deg, #4a2f6e, #2f3f6e); color: #fff; font-weight: 600; }
.hint { color: var(--hint); font-size: 13px; }

/* Логово */
.room-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.room-head .arrows button { width: 40px; height: 40px; border-radius: 12px; background: var(--card); font-size: 18px; }
.room { position: relative; border-radius: 20px; overflow: hidden; height: 215px; background: url(../ui/room_bg.jpg) center 62%/cover, linear-gradient(#3b3355 0 48%, #6b4f3a 48% 100%); border: 3px solid #0004; }
.room canvas { width: 100%; height: 100%; display: block; }
.room .wallpaper { position: absolute; inset: 0 0 52% 0; background: radial-gradient(circle at 20% 30%, #ffffff10 0 18px, transparent 19px) 0 0/70px 70px; pointer-events: none; }
.dots { display: flex; justify-content: center; gap: 6px; margin: 8px 0; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); } .dots i.on { background: var(--accent); }
.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.slot { background: var(--card); border-radius: 12px; padding: 6px; text-align: center; border: 2px solid transparent; position: relative; }
.slot.sel { border-color: var(--accent); }
.slot img { width: 100%; height: 64px; object-fit: contain; }
.slot .n { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .mini { display: flex; gap: 2px; justify-content: center; font-size: 11px; }
.slot.empty { border: 2px dashed var(--line); display: grid; place-items: center; min-height: 104px; color: var(--hint); font-size: 13px; }
.need { display: grid; grid-template-columns: 26px 1fr 42px; align-items: center; gap: 6px; margin: 6px 0; font-size: 13px; }
.bar { height: 10px; border-radius: 6px; background: #12151d; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; transition: width .4s; }
.actions4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.actions4 .btn { flex-direction: column; gap: 2px; min-height: 64px; font-size: 12px; padding: 4px; }
.actions4 .btn b { font-size: 22px; }

/* Коллекция */
.seg { display: flex; background: var(--card); border-radius: 12px; padding: 3px; margin-bottom: 8px; }
.seg button { flex: 1; min-height: 38px; border-radius: 10px; background: none; color: var(--hint); font-weight: 600; font-size: 14px; }
.seg button.on { background: var(--card2); color: var(--text); }
.search { width: 100%; min-height: 44px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--text); padding: 0 12px; font: inherit; margin-bottom: 8px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 4px; scrollbar-width: none; }
.chips button { flex: none; min-height: 36px; padding: 0 12px; border-radius: 99px; background: var(--card); font-size: 13.5px; border: 1px solid transparent; white-space: nowrap; }
.chips button.on { border-color: var(--accent); background: #3a2f1c; }
.toolbar { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 8px; gap: 8px; }
.toolbar select { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 10px; min-height: 36px; padding: 0 8px; font: inherit; font-size: 13.5px; }
.pgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pc { position: relative; background: var(--card); border-radius: 14px; padding: 4px 4px 6px; border: 2px solid var(--qc); box-shadow: 0 0 0 0 var(--qc); text-align: center; content-visibility: auto; contain-intrinsic-size: 150px; }
.pc.q4, .pc.q5 { box-shadow: 0 0 14px -2px var(--qc); }
.pc img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--qc) 22%, transparent), transparent 70%); border-radius: 10px; }
.pc .n { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc .s { font-size: 11.5px; color: var(--hint); }
.pc .tl { position: absolute; top: 6px; left: 7px; font-size: 14px; }
.pc .tr { position: absolute; top: 5px; right: 6px; font-size: 13px; display: flex; gap: 1px; }
.pc .chk { position: absolute; inset: 0; border-radius: 12px; background: #00000055; display: none; place-items: start end; padding: 6px; font-size: 22px; }
.selmode .pc .chk { display: grid; background: transparent; }
.pc.picked .chk { background: #ffb54733; }
.selbar { position: sticky; bottom: 0; background: var(--bg2); border-radius: 14px; padding: 8px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; box-shadow: 0 -6px 20px #0008; }
.selbar .btn { flex-direction: column; min-height: 56px; font-size: 11.5px; gap: 0; padding: 2px; }
.selbar .btn b { font-size: 20px; }

/* шторки (bottom sheet) и модалки */
.sheet-bg { position: absolute; inset: 0; background: #000a; z-index: 20; display: flex; align-items: flex-end; animation: fade .15s; }
.sheet { background: var(--bg2); width: 100%; max-height: 92%; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 8px 14px 18px; animation: up .22s ease-out; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 2px auto 10px; }
.sheet h3 { margin: 4px 0 10px; font-size: 19px; }
@keyframes up { from { transform: translateY(40%); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }
.stage { height: 230px; border-radius: 16px; background: radial-gradient(ellipse at 50% 85%, color-mix(in srgb, var(--qc) 35%, #232a3b) 0 30%, #1a1f2c 70%); position: relative; overflow: hidden; }
.stage canvas { width: 100%; height: 100%; display: block; }
.qline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.qbadge { padding: 4px 10px; border-radius: 99px; font-weight: 700; font-size: 13px; color: #111; background: var(--qc); }
.statrow { display: grid; grid-template-columns: 22px 92px 1fr 34px; align-items: center; gap: 6px; font-size: 13px; margin: 5px 0; }
.statbar { height: 12px; background: #12151d; border-radius: 6px; position: relative; overflow: hidden; }
.statbar i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 6px; }
.potline { display: flex; justify-content: space-between; font-size: 13px; margin-top: 4px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13.5px; }
.kv span:nth-child(odd) { color: var(--hint); }
.toast { position: absolute; left: 50%; bottom: calc(var(--nav) + 16px); transform: translateX(-50%); background: #2b3346; padding: 10px 16px; border-radius: 12px; z-index: 50; font-weight: 600; box-shadow: 0 6px 20px #0009; animation: up .2s; white-space: nowrap; }

/* Ловля */
.traps { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; scrollbar-width: none; }
.trap { flex: none; background: var(--card); border-radius: 12px; padding: 8px 10px; min-width: 104px; }
.trap b { display: block; font-size: 14px; } .trap .stars { color: var(--accent); font-size: 12px; letter-spacing: 1px; }
.gcard { background: var(--card); border-radius: 16px; padding: 12px; margin-bottom: 10px; }
.gcard .gh { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.gcard .gn { font-weight: 700; font-size: 16px; }
.eco { font-size: 12px; padding: 3px 8px; border-radius: 8px; background: #1e3a2a; color: #8ff0a8; white-space: nowrap; }
.eco.mid { background: #3a3220; color: #ffd98a; }
.pop { display: flex; gap: 10px; font-size: 13px; margin: 8px 0; flex-wrap: wrap; }
.trapbox { display: flex; align-items: center; gap: 12px; background: var(--card2); border-radius: 12px; padding: 10px; }
.ring { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; flex: none; }
.caught { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px #ffb54740; } }
.legend { background: linear-gradient(120deg, #4a2a10, #2a1a3a); border: 1px solid #ff9a1f66; border-radius: 14px; padding: 10px 12px; margin: 8px 0; }

/* поимка */
.reveal { text-align: center; }
.reveal .stage { height: 260px; }
.burst { position: absolute; inset: 0; background: radial-gradient(circle, var(--qc) 0 10%, transparent 60%); opacity: 0; animation: burst 1.1s ease-out .9s both; pointer-events: none; }
@keyframes burst { 0% { opacity: 0; transform: scale(.2); } 30% { opacity: .9; } 100% { opacity: 0; transform: scale(2.2); } }
.rv-title { font-size: 22px; font-weight: 800; margin: 10px 0 2px; }
.ruleinfo { background: var(--card); border-radius: 12px; padding: 8px 10px; font-size: 13px; margin: 8px 0; text-align: left; }

/* мини-игра */
.mg { text-align: center; }
.mg .lane { position: relative; height: 26px; border-radius: 13px; background: #12151d; margin: 16px 6px; overflow: hidden; }
.mg .zone { position: absolute; top: 0; bottom: 0; background: #4cc46a88; border-left: 2px solid #4cc46a; border-right: 2px solid #4cc46a; }
.mg .cursor { position: absolute; top: -3px; bottom: -3px; width: 6px; border-radius: 3px; background: #fff; box-shadow: 0 0 8px #fff; }

/* Арена */
.team { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.fighter { background: var(--card); border-radius: 12px; padding: 6px; text-align: center; transition: transform .2s, opacity .4s; position: relative; }
.fighter img { width: 100%; height: 52px; object-fit: contain; }
.fighter.act { transform: translateY(-6px) scale(1.04); box-shadow: 0 0 0 2px var(--accent); }
.fighter.hit { animation: hit .35s; }
.fighter.dead { opacity: .3; filter: grayscale(1); }
@keyframes hit { 30% { transform: translateX(6px); background: #5a2a30; } 60% { transform: translateX(-4px); } }
.hp { height: 7px; background: #12151d; border-radius: 4px; overflow: hidden; margin-top: 3px; }
.hp i { display: block; height: 100%; background: var(--good); transition: width .35s; }
.log { background: #10131a; border-radius: 12px; padding: 10px; height: 210px; overflow-y: auto; font-size: 13.5px; margin-top: 10px; }
.log p { margin: 0 0 6px; animation: fade .3s; } .log p.funny { color: #ffd98a; } .log p.res { color: var(--accent); font-weight: 700; font-size: 15px; }

/* Рынок */
.lot { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; background: var(--card); border-radius: 14px; padding: 8px; margin-bottom: 8px; border-left: 4px solid var(--qc); }
.lot img { width: 64px; height: 64px; object-fit: contain; }
.lot .price { font-weight: 800; font-size: 16px; text-align: right; }

/* демо-чат Telegram */
.chat { flex: 1; overflow-y: auto; background: #0e1621 url() ; padding: 10px 8px 70px; }
.chathead { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #17212b; border-bottom: 1px solid #0b1118; }
.chathead .av { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #5fb36b, #2f7f56); display: grid; place-items: center; font-size: 20px; }
.msg { max-width: 84%; margin: 4px 0; padding: 6px 10px 6px; border-radius: 12px; background: #182533; font-size: 14.5px; white-space: pre-wrap; position: relative; }
.msg .who { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.msg.bot { background: #182533; border-top-left-radius: 4px; }
.msg.me { margin-left: auto; background: #2b5278; }
.msg .time { font-size: 11px; color: #6d8299; float: right; margin: 6px 0 -4px 10px; }
.msg img { width: 100%; max-height: 190px; object-fit: contain; border-radius: 8px; display: block; margin: 2px 0 6px; background: radial-gradient(ellipse at 50% 90%, #2f4a3a, #1b2733 70%); }
.msg img.bush { background: radial-gradient(ellipse at 50% 100%, #3f7a45 0 35%, #24432c 36% 50%, #1b2733 70%); }
.msg .kb { display: grid; gap: 4px; margin: 6px -6px -2px; }
.msg .kb button { background: #2b3a4d; border-radius: 8px; min-height: 38px; font-size: 14px; color: #e8f2ff; }
.chatbar { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px; background: #17212b; display: flex; gap: 6px; }
.chatbar button { flex: 1; min-height: 42px; border-radius: 10px; background: #2b3a4d; font-size: 13px; }
.sysmsg { text-align: center; margin: 8px 0; } .sysmsg span { background: #1c2b3a; color: #8ea4bb; font-size: 12.5px; padding: 4px 10px; border-radius: 10px; }
.selmode .pc .tr { display: none; }

/* ===== единый стиль v2: иконки, обучение, упрощённые экраны ===== */
.ic { width: 28px; height: 28px; object-fit: contain; flex: none; vertical-align: middle; }
.ic.sm { width: 20px; height: 20px; } .ic.dim { filter: grayscale(.7) opacity(.6); }
.brand { display: flex; align-items: center; gap: 6px; font-weight: 900; font-size: 19px; letter-spacing: .2px; }
.brand .logo { width: 30px; height: 30px; }
.wallet { align-items: center; }
.wallet .chip { gap: 3px; padding: 3px 10px 3px 4px; box-shadow: 0 2px 0 #0005; }
.wallet .chip .ic { width: 24px; height: 24px; }
.help { width: 32px; height: 32px; border-radius: 50%; background: var(--card); font-weight: 900; color: var(--accent); box-shadow: 0 2px 0 #0005; }
nav.tabs button .ti { width: 30px; height: 30px; filter: grayscale(.85) brightness(.75); transition: transform .15s; }
nav.tabs button.on .ti { filter: none; transform: scale(1.15) translateY(-2px); }
nav.tabs button.on { color: var(--accent); font-weight: 700; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 11px; }
.btn.on { background: #4a3520; box-shadow: 0 3px 0 #0006, inset 0 0 0 1.5px var(--accent); }
.link { background: none; color: var(--hint); font-size: 13.5px; text-decoration: underline dotted; padding: 6px; display: block; margin: 2px auto 0; }
.qbadge.sm { font-size: 11.5px; padding: 2px 8px; vertical-align: 2px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--qc); margin-right: 5px; box-shadow: 0 0 6px var(--qc); }

/* «главное дело на сейчас» */
.next { display: flex; align-items: center; gap: 10px; background: linear-gradient(100deg, #3d2a1c, #2c2339 70%); border: 1.5px solid #ffa34055; border-radius: var(--r); padding: 8px 10px; margin-bottom: 10px; }
.next .ic { width: 40px; height: 40px; }
.next b { font-size: 15px; }

/* логово */
.roomnav { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; background: #1a1020b3; border-radius: 99px; padding: 2px; font-size: 13px; font-weight: 700; backdrop-filter: blur(4px); white-space: nowrap; }
.roomnav span { padding: 0 8px; }
.roomnav button { width: 30px; height: 30px; border-radius: 50%; background: #ffffff1a; font-size: 18px; line-height: 1; }
.slot.sel { border-color: var(--accent); background: #3d2c22; }
.slot img { filter: drop-shadow(0 3px 0 #0005); }
.slot .mini { color: var(--hint); }
.slot .warn { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--bad); color: #fff; font-weight: 900; display: grid; place-items: center; font-size: 14px; box-shadow: 0 2px 0 #0006; }
.slot.empty b { display: block; font-size: 24px; }
.pname { font-size: 18px; }
.needs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.need { display: flex; align-items: center; gap: 5px; margin: 0; font-size: 12px; }
.need .ic { width: 26px; height: 26px; }
.need .nl { display: flex; justify-content: space-between; color: var(--hint); font-size: 11.5px; margin-bottom: 2px; }
.need .nl b { color: var(--text); }
.need .bar { height: 8px; }
.need.low .ic { animation: wob 1s infinite; }
@keyframes wob { 50% { transform: rotate(-12deg) scale(1.1); } }
.warnline { grid-column: 1 / -1; color: #ffb3b8; margin-top: -2px; }
.actions4 .btn { min-height: 76px; font-size: 12px; }
.actions4 .btn .ic { width: 34px; height: 34px; }

/* коллекция */
.searchrow { display: flex; gap: 8px; margin-bottom: 8px; }
.searchrow .search { margin: 0; flex: 1; min-width: 0; }
.qchips button { display: inline-flex; align-items: center; }
.qchips button.on { background: #3a2a1c; }
.toolbar { gap: 6px; }
.toolbar select { min-height: 34px; }
.pc { padding: 4px 4px 7px; border-width: 2.5px; box-shadow: 0 3px 0 #0005; }
.pc img { filter: drop-shadow(0 2px 0 #0005); }
.pc .s { color: var(--text); font-weight: 700; opacity: .85; }
.pc .tr { top: 4px; right: 5px; font-size: 14px; }
.pc .chk { font-size: 20px; }
.selmode .pc { opacity: .75; } .selmode .pc.picked { opacity: 1; }
.selbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.selbar .btn { flex-direction: row; min-height: 44px; font-size: 12.5px; gap: 4px; }
.selinfo { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; font-size: 13.5px; }
.selinfo .link { margin: 0 0 0 auto; padding: 0; }
.flabel { font-weight: 800; font-size: 13px; color: var(--hint); text-transform: uppercase; letter-spacing: .5px; margin: 12px 0 6px; }
.elgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.elgrid button { background: var(--card); border-radius: 12px; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 20px; border: 1.5px solid transparent; }
.elgrid button span { font-size: 11.5px; color: var(--hint); }
.elgrid button.on { border-color: var(--accent); background: #3a2a1c; }

/* ловля */
.gcard { box-shadow: 0 3px 0 #0005; }
.trapbox { width: 100%; text-align: left; margin-top: 8px; }
.trapbox.empty { border: 1.5px dashed var(--line); background: transparent; }
.trapbox .ic { width: 40px; height: 40px; }
.trapbox .ring { width: 54px; height: 54px; }
.trapbox .ring .ic { width: 42px; height: 42px; background: var(--card2); border-radius: 50%; padding: 3px; }
.trapbox.caught { background: linear-gradient(100deg, #3d2a1c, var(--card2)); }
.legend { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.legend .ic { width: 40px; height: 40px; } .legend .go { font-size: 24px; color: var(--accent); }
.who { margin-top: 8px; font-size: 13px; }
.who summary { color: var(--hint); cursor: pointer; list-style: none; padding: 4px 0; }
.who summary::before { content: "▸ "; } .who[open] summary::before { content: "▾ "; }
.pop span { display: inline-flex; align-items: center; }
.trapopt { width: 100%; text-align: left; gap: 10px; }
.trapopt img { width: 52px; height: 52px; }
.trapopt .cnt { font-size: 17px; }
.stars { color: var(--accent); letter-spacing: 1px; font-size: 12px; }

/* кошелёк */
.res { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border-radius: 14px; padding: 10px; margin-bottom: 8px; }
.res .ic { width: 44px; height: 44px; }
.trapgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.trapc { background: var(--card); border-radius: 12px; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; font-size: 11.5px; text-align: center; }
.trapc img { width: 44px; height: 44px; } .trapc.none { opacity: .45; }

/* приветствие и подсказки-прожекторы */
.welcome { text-align: center; }
.wl-hero { display: flex; justify-content: center; align-items: end; gap: 4px; margin: 6px 0 2px; }
.wl-hero .ic { width: 64px; height: 64px; animation: bob 2s infinite ease-in-out; }
.wl-hero .ic:nth-child(2) { animation-delay: .3s; width: 76px; height: 76px; } .wl-hero .ic:nth-child(3) { animation-delay: .6s; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.steps3 { display: grid; gap: 8px; margin: 8px 0 14px; text-align: left; }
.steps3 > div { display: grid; grid-template-columns: 48px 1fr; grid-template-rows: auto auto; column-gap: 10px; background: var(--card); border-radius: 14px; padding: 8px 10px; align-items: center; }
.steps3 .ic { width: 48px; height: 48px; grid-row: span 2; }
.steps3 span { color: var(--hint); font-size: 13px; }
#coach { position: absolute; inset: 0; z-index: 60; }
#coach .hole { position: absolute; border-radius: 16px; box-shadow: 0 0 0 9999px #0d0812c4; border: 2px solid var(--accent); animation: fade .2s; pointer-events: none; }
#coach .bubble { position: absolute; left: 14px; right: 14px; background: #fbf1e3; color: var(--ink); border-radius: 16px; padding: 12px 14px; font-weight: 700; font-size: 15px; box-shadow: 0 6px 24px #000a; animation: up .25s; }
#coach .bubble .sub { color: #6b5a78; }
.toast { background: #fbf1e3; color: var(--ink); }
.toast { bottom: auto; top: 62px; animation: drop .2s; } @keyframes drop { from { transform: translate(-50%, -12px); opacity: 0; } }

/* ===== v3: обустройство комнат, ночь, валюты-иконки, устойчивость к длинным переводам ===== */
html, body { font-family: var(--font-lang,) "Nunito", -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; }
:lang(zh) body { line-height: 1.45; }
.cur { height: 1.15em; width: auto; vertical-align: -0.22em; margin: 0 1px; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ell2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.minw0 { min-width: 0; } .wrap { flex-wrap: wrap; } .center { text-align: center; justify-content: center; }
.btn { text-align: center; line-height: 1.15; overflow-wrap: anywhere; hyphens: auto; }
.btn.col { flex-direction: column; gap: 0; }
.ic.big { width: 64px; height: 64px; }
nav.tabs button .tl { max-width: 100%; padding: 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
:lang(de) nav.tabs button .tl { font-size: 10px; }
.wallet { gap: 4px; } .wallet .chip { padding: 3px 8px 3px 3px; }
.help { width: 30px; height: 30px; font-size: 14px; flex: none; }
.brand span { white-space: nowrap; }
.top { gap: 6px; }
.langs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.actions4 .btn { padding: 4px 2px; }
.actions4 .btn .ell2 { font-size: 12px; line-height: 1.15; }
:lang(de) .actions4 .btn .ell2 { font-size: 11px; }
.need .nl span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs { text-align: center; font-weight: 800; color: var(--accent); margin: 2px 0; }
.fighter .fn { font-size: 12px; font-weight: 600; }
.log p.crit { color: #ffb3b8; font-weight: 700; }
.selbar .btn { min-width: 0; }

/* комната 3:2 — координаты мебели в процентах совпадают с фоном */
.room { height: auto; aspect-ratio: 3 / 2; background: url(../ui/room_empty.jpg) center/cover, #4a2a3a; }
.room .furn { position: absolute; transform: translateX(-50%); pointer-events: none; filter: drop-shadow(0 3px 0 #0005); }
.room .furn.rug { object-fit: fill; filter: none; }
.room canvas { position: absolute; inset: 0; z-index: 2; }
.room .win-night { position: absolute; left: 50%; top: 16.4%; width: 18.2%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; display: none;
  background: radial-gradient(circle at 64% 36%, #fff6c8 0 8%, #fff6c855 9%, transparent 16%), radial-gradient(circle at 25% 60%, #fff 0 1.5%, transparent 2.5%), radial-gradient(circle at 40% 25%, #fff 0 1.2%, transparent 2%), radial-gradient(circle at 75% 72%, #fff 0 1.2%, transparent 2%), linear-gradient(#141a44, #2b2f6e); }
.room.night .win-night { display: block; }
.room .nightfx { position: absolute; inset: 0; z-index: 3; pointer-events: none; background: #10154a; mix-blend-mode: multiply; opacity: 0; transition: opacity .6s; }
.room.night .nightfx { opacity: .62; }
.room .glow { position: absolute; z-index: 4; width: 34%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; background: radial-gradient(circle, #ffd27a88, #ffb54722 45%, transparent 70%); mix-blend-mode: screen; animation: flick 3s infinite ease-in-out; }
.room .glow[style*="bottom"] { transform: translate(-50%, 50%); }
@keyframes flick { 50% { opacity: .8; } }
.roomnav, .daynight, .fslot { z-index: 5; }
.daynight { position: absolute; top: 8px; left: 8px; width: 32px; height: 32px; border-radius: 50%; background: #1a1020b3; font-size: 16px; }
.room.editing { outline: 2px dashed var(--accent); outline-offset: -2px; }
.fslot { position: absolute; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; background: #ffa340e6; color: var(--ink); font-weight: 900; font-size: 18px; box-shadow: 0 3px 0 #a3501a, 0 0 0 3px #fff8; animation: bob 1.6s infinite ease-in-out; }
.fslot[style*="bottom"] { transform: translate(-50%, 50%); }
.fslot.has { background: #fbf1e3e6; font-size: 15px; }
.roominfo { display: flex; gap: 6px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.roominfo #furnish { margin-left: auto; }
.pill { display: inline-flex; align-items: center; gap: 4px; background: var(--card); border-radius: 99px; padding: 5px 10px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.pill.dim { color: var(--hint); font-weight: 600; }
.pill.btnlike { box-shadow: 0 2px 0 #0005; }
.furngrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.fcard { background: var(--card); border-radius: 14px; padding: 8px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; border: 2px solid transparent; box-shadow: 0 3px 0 #0005; }
.fcard.here { border-color: var(--accent); }
.fcard img { height: 64px; max-width: 100%; object-fit: contain; }
.fcard b { font-size: 13.5px; }
.fcard .fx { font-size: 11.5px; color: #8ff0a8; line-height: 1.3; min-height: 2.6em; }
.fcard .price { font-weight: 800; font-size: 13px; color: var(--accent); }
.res .ic { flex: none; }
.bubble .skip { margin: 0; padding: 0; color: #6b5a78; font-size: 12.5px; }
img.cur { height: 1.15em !important; width: auto !important; max-width: none !important; filter: none !important; vertical-align: -0.22em !important; margin: 0 1px !important; aspect-ratio: auto !important; background: none !important; display: inline !important; }
.actions4 .btn { padding: 4px 1px; } .actions4 .btn .ell2 { font-size: 11.5px; overflow-wrap: break-word; hyphens: auto; } .btn { overflow-wrap: break-word; }
@media (max-width: 370px) { .brand span { display: none; } .help { width: 28px; height: 28px; } .wallet .chip { font-size: 13px; padding: 2px 7px 2px 2px; } .wallet .chip .ic { width: 22px; height: 22px; } }

.toast { white-space: normal; width: max-content; max-width: calc(100% - 24px); text-align: center; }
.fcard.sure { border-color: var(--accent2); } .fcard.sure .price { color: var(--accent2); }

/* ===== v4: клиент на сервере — старт, уровень ловца, «Путь ловца», замки разделов ===== */
.boot { flex: 1; display: grid; place-content: center; justify-items: center; gap: 8px; font-weight: 900; font-size: 22px; color: var(--hint); }
.boot img { width: 72px; height: 72px; animation: bob 1.4s infinite ease-in-out; }
#app.busy [data-care], #app.busy .btn.primary, #app.busy .fcard, #app.busy .trapbox { pointer-events: none; }
.top { gap: 6px; padding: 8px 12px 8px; }
.lvl { display: flex; align-items: center; gap: 7px; background: none; min-width: 0; flex: 1 1 auto; text-align: left; padding: 0; }
.lvl .lvn { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 16px; color: var(--ink);
  background: radial-gradient(circle at 35% 30%, #ffd08a, #f28a2a); box-shadow: 0 2px 0 #a3501a, 0 0 0 2px #0004; }
.lvl .lvt { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; max-width: 120px; }
.lvl .lvt b { font-size: 12.5px; line-height: 1; }
.xpbar { height: 6px; border-radius: 4px; background: #0006; overflow: hidden; display: block; }
.xpbar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #3cc0b4, #7fe0d6); transition: width .5s; }
.wallet { flex: none; }
nav.tabs button.locked { opacity: .55; }
nav.tabs button.locked .ti { filter: grayscale(1) brightness(.6); }
nav.tabs button.locked .tl { font-size: 10.5px; }

/* «Путь ловца» */
.next { align-items: flex-start; }
.next.quest { border-color: #3cc0b488; background: linear-gradient(100deg, #1f3a3a, #2c2339 75%); }
.next .qtag { font-size: 10.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--accent2); margin-bottom: 1px; }
.next .qrew { font-size: 12px; color: var(--accent); margin-top: 3px; font-weight: 700; }
.next #nx { align-self: center; flex: none; }
#coach.pass { pointer-events: none; }
#coach.pass .bubble { font-size: 14px; font-weight: 700; }

/* уровень */
.lvup { text-align: center; }
.lvup .res { text-align: left; align-items: center; }
.lvbig { width: 84px; height: 84px; margin: 4px auto 6px; border-radius: 50%; display: grid; place-items: center; font-size: 36px; font-weight: 900; color: var(--ink);
  background: radial-gradient(circle at 35% 30%, #ffd08a, #f28a2a); box-shadow: 0 4px 0 #a3501a, 0 0 0 4px #ffffff22, 0 0 40px #ffa34066; animation: bob 2s infinite ease-in-out; }
.unl { flex: none; min-width: 44px; text-align: center; font-weight: 800; color: var(--accent); font-size: 13px; }
.lvup .btn.big { margin-top: 10px; }

/* выбор первого пета и служебные экраны */
.start { flex: 1; overflow-y: auto; padding: 14px 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.start h2 { margin: 4px 0 0; font-size: 24px; text-align: center; }
.start > .hint { text-align: center; margin: 0; }
.start .stage { height: 200px; flex: none; }
.qline.center { justify-content: center; }
.starters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.starters button { background: var(--card); border-radius: 14px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 1px; border: 2px solid transparent; box-shadow: 0 3px 0 #0005; min-width: 0; }
.starters button.on { border-color: var(--accent); background: #3d2c22; }
.starters .el { font-size: 22px; }
.starters b { font-size: 13.5px; max-width: 100%; }
.starters .sub { font-size: 11.5px; max-width: 100%; }
.steps3.mini { margin: 4px 0; gap: 6px; }
.steps3.mini > div { grid-template-columns: 34px 1fr; grid-template-rows: auto; padding: 6px 10px; }
.steps3.mini .ic { width: 34px; height: 34px; grid-row: auto; }
.steps3.mini span { font-size: 12.5px; color: var(--text); }
.lockscr { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 24px; min-height: 60%; }
.lockscr h2 { margin: 0; }
.lockscr .hint { max-width: 300px; }
.ic.huge { width: 110px; height: 110px; filter: grayscale(.7) brightness(.8); }
.bigemo { font-size: 64px; }

/* логово: места и кнопки */
.slot.lockedslot { color: var(--hint); opacity: .7; border-style: dotted; }
.slot .swap { position: absolute; top: -7px; left: -7px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent2); color: var(--ink); font-weight: 900; font-size: 14px; box-shadow: 0 2px 0 #1b6a63; z-index: 2; }
.actions4 .btn.oncd { opacity: .6; }
.daynight { display: grid; place-items: center; }
.fcard.dim { opacity: .55; }
.mini-btn { width: 30px; height: 30px; border-radius: 50%; background: var(--card2); font-size: 14px; flex: none; }
.qline .ell { max-width: 60%; }

/* мир */
.bul { margin: 8px 0 6px; padding-left: 18px; font-size: 13.5px; display: grid; gap: 5px; }
.trapopt.nohave img { filter: grayscale(.8) opacity(.6); }
.trapopt { cursor: pointer; }
.gcard.invite { border: 1.5px dashed var(--line); background: transparent; box-shadow: none; }

/* петы */
.selbar.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pc .s { font-weight: 700; }
.toast { z-index: 80; }
@media (max-width: 370px) { .lvl .lvt { display: none; } .lvl { flex: none; } .top { justify-content: space-between; } }

/* ===== v5: подземелья ===== */
.pill.torch { background: #3d2a1c; }
.pill.good { background: #1e3a2a; color: #8ff0a8; margin: 6px 4px 0; }
.dlock { border: 1.5px dashed var(--line); background: transparent; box-shadow: none; }
.dtier { display: flex; align-items: center; gap: 8px; margin: 10px 0 6px; }
.dtier button, .rsw button { width: 38px; height: 38px; border-radius: 12px; background: var(--card2); font-size: 20px; line-height: 1; box-shadow: 0 2px 0 #0005; }
.dtier button:disabled { opacity: .3; }
.rsw button { width: 26px; height: 26px; font-size: 15px; border-radius: 8px; }
.dgrid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.dcell { position: relative; aspect-ratio: 1; border-radius: 12px; background: var(--card2); font-size: 20px; display: grid; place-items: center; box-shadow: 0 2px 0 #0005; }
.dcell.done { background: #24382e; }
.dcell i { position: absolute; right: 2px; bottom: 0; font-size: 11px; font-style: normal; font-weight: 900; color: #8ff0a8; }
.dsheet h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dadvice { display: grid; gap: 3px; margin: 8px 0; font-size: 13.5px; }
.dpath { display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; font-size: 20px; background: var(--card); border-radius: 14px; padding: 8px; margin: 8px 0 4px; }
.dpath i { font-style: normal; color: var(--hint); font-size: 13px; }
.dpower { margin-top: 10px; }
.dpower .bar i { background: var(--warn); }
.dpower.ok .bar i { background: var(--good); } .dpower.low .bar i { background: var(--bad); }
.dpower .vline { font-size: 13px; color: var(--hint); }
.dpower.ok .vline b { color: var(--good); } .dpower.edge .vline b { color: var(--warn); } .dpower.low .vline b { color: var(--bad); }
.dteam .fighter img { height: 56px; }
.fighter.worn { opacity: .6; }
.twarn { font-size: 11px; color: #ffb3b8; font-weight: 700; }
.dloot { display: flex; flex-wrap: wrap; gap: 6px; }
.dloot span { background: var(--card); border-radius: 10px; padding: 5px 9px; font-size: 13px; }
.dblock { background: #3d2228; color: #ffb3b8; border-radius: 12px; padding: 8px 10px; font-size: 13.5px; margin: 10px 0 8px; }
.rsw { display: inline-flex; align-items: center; gap: 6px; }
.matlist { display: grid; gap: 4px; }
.matrow { display: flex; gap: 8px; align-items: center; background: var(--card); border-radius: 10px; padding: 7px 10px; font-size: 13.5px; margin-bottom: 4px; }
#scene { position: absolute; inset: 0; z-index: 30; background: var(--bg); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; animation: fade .2s; }
.sc-top { display: flex; align-items: center; gap: 6px; }
.sc-top .btn.on { background: #4a3520; }
.sc-path { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; }
.sc-path span { width: 34px; height: 34px; border-radius: 10px; background: var(--card); display: grid; place-items: center; font-size: 17px; opacity: .45; }
.sc-path span.past { opacity: .8; background: #24382e; }
.sc-path span.on { opacity: 1; background: #4a3520; box-shadow: 0 0 0 2px var(--accent); }
.sc-ins { grid-column: 1 / -1; text-align: center; font-size: 54px; padding: 10px 0; animation: bob 1.4s infinite ease-in-out; }
#scene .log { flex: 1; min-height: 120px; height: auto; margin-top: 4px; }
#scene .fighter.boss { box-shadow: 0 0 0 2px var(--q4); }
.runres { text-align: center; }
.runres .bigemo { font-size: 54px; }
.runres .matrow, .runres .flabel { text-align: left; }
.runres.lose h3 { color: #ffb3b8; }
#app.busy [data-go] { pointer-events: none; }
