* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; background: #050507; overflow: hidden; }
body { font-family: 'Press Start 2P', 'Courier New', monospace; color: #e8e8f0; user-select: none; cursor: crosshair; }

#wrap { position: absolute; left: 50%; top: 50%; width: 960px; height: 540px; transform-origin: center center; transform: translate(-50%, -50%); background: #000; overflow: hidden; }
#game { position: absolute; inset: 0; width: 960px; height: 540px; image-rendering: pixelated; display: block; }
#crt { position: absolute; inset: 0; pointer-events: none; z-index: 50;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px, rgba(0,0,0,.10) 3px); mix-blend-mode: multiply; }

.screen { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 18px 40px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.25), rgba(0,0,0,.75)); }
.screen.dim { background: rgba(4,4,10,.82); }
.screen.hidden { display: none; }

.logo { display: flex; flex-direction: column; align-items: center; line-height: 1.1; margin-bottom: 4px; animation: bob 2.4s steps(6) infinite; }
.logo .l1 { font-size: 46px; color: #ffd040; text-shadow: 0 4px #c06010, 0 8px #5a2a08, 4px 4px 0 #000, 0 12px 0 #000; letter-spacing: 2px; }
.logo .l2 { font-size: 64px; color: #ff70e0; text-shadow: 0 5px #8a2a8a, 0 10px #3a0e4a, 4px 5px 0 #000, 0 15px 0 #000; letter-spacing: 4px; animation: flick 3.1s steps(1) infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes flick { 0%,92%,100% { opacity: 1; } 93% { opacity: .55; } 95% { opacity: 1; } 97% { opacity: .7; } }
.tagline { font-size: 8px; color: #b8b8d0; text-align: center; line-height: 1.8; }
.foot { font-size: 8px; color: #888; position: absolute; bottom: 14px; }
.foot b { color: #ffd040; }

.h2 { font-size: 22px; color: #ffd040; text-shadow: 3px 3px 0 #000, 0 4px #8a4a10; }
.h2.green { color: #7dff8a; text-shadow: 3px 3px 0 #000, 0 4px #1a6a2a; }
.h2.red { color: #ff4050; text-shadow: 3px 3px 0 #000, 0 4px #6a1018; font-size: 34px; }
.h2.gold { color: #ffd040; font-size: 30px; animation: bob 1.6s steps(5) infinite; }

.btns { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 14px; }
.row { display: flex; gap: 16px; align-items: center; }
.btn { font-family: inherit; font-size: 11px; color: #fff; background: #3a2a5a; border: 0; padding: 12px 20px; cursor: pointer;
  box-shadow: inset -4px -4px 0 #1c1230, inset 4px 4px 0 #6a54a0, 0 0 0 3px #000; text-shadow: 2px 2px 0 #000; }
.btn:hover { background: #55408a; transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn.big { font-size: 14px; padding: 16px 28px; background: #a02a6a; box-shadow: inset -4px -4px 0 #5a1038, inset 4px 4px 0 #e060a8, 0 0 0 3px #000; }
.btn.big:hover { background: #c83a88; }

.panel { background: rgba(10,8,24,.88); border: 3px solid #000; box-shadow: inset 0 0 0 3px #4a3a7a; padding: 16px 20px; max-width: 840px; font-size: 9px; line-height: 2; color: #d8d8ea; }
.panel.small, .small { font-size: 8px; line-height: 1.9; }
.panel p { margin-bottom: 8px; }
.keys { border-collapse: collapse; width: 100%; font-size: 9px; line-height: 2.1; }
.keys td:first-child { color: #ffd040; padding-right: 20px; white-space: nowrap; }

/* ---- выбор героя ---- */
#select { justify-content: flex-start; gap: 8px; padding-top: 14px; }
#cards { display: flex; gap: 16px; }
.card { width: 288px; height: 232px; background: #14102a; border: 3px solid #000; box-shadow: inset 0 0 0 3px #3a2f66; padding: 10px 12px; cursor: pointer; position: relative; transition: transform .1s steps(2); }
.card:hover { transform: translateY(-4px); }
.card.sel { box-shadow: inset 0 0 0 3px #ffd040, 0 0 0 3px #000, 0 0 24px rgba(255,208,64,.35); background: #1d1640; }
.card .nm { font-size: 14px; color: #ffd040; text-shadow: 2px 2px 0 #000; }
.card .tt { font-size: 7px; color: #ff8ae8; margin: 6px 0 8px; }
.card .body { display: flex; gap: 10px; }
.portrait { width: 132px; height: 165px; background: #000; border: 3px solid #000; box-shadow: 0 0 0 2px #6a54a0; position: relative; overflow: hidden; }
.portrait canvas { width: 100%; height: 100%; image-rendering: pixelated; filter: url(#poster) contrast(1.15) saturate(1.25); display: block; }
.portrait::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.18) 2px 3px); }
.card .side { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.card .spr { width: 64px; height: 64px; image-rendering: pixelated; background: radial-gradient(circle at 50% 80%, #2a2250, transparent 70%); }
.stat { display: flex; align-items: center; gap: 4px; font-size: 7px; color: #aaa; }
.stat span.l { width: 24px; }
.pip { width: 8px; height: 8px; background: #2a2540; display: inline-block; }
.pip.on.hp { background: #e03050; } .pip.on.spd { background: #40d0ff; } .pip.on.dmg { background: #ffb030; }
.wic { display: flex; gap: 4px; margin-top: 2px; }
.wic canvas { width: 36px; height: 24px; image-rendering: pixelated; background: #0a0818; border: 1px solid #3a2f66; }

#detail { width: 912px; min-height: 150px; background: rgba(10,8,24,.9); border: 3px solid #000; box-shadow: inset 0 0 0 3px #4a3a7a; padding: 12px 16px; font-size: 8px; line-height: 1.85; color: #d8d8ea; }
#detail b { color: #ffd040; font-weight: normal; }
#detail .ab { color: #ffb040; }
#detail .pv { color: #7dff8a; }
#select .row { margin-top: 2px; }

/* ---- сложность / сид / настройки ---- */
#setup { justify-content: flex-start; gap: 10px; padding-top: 14px; }
#setupBody { display: flex; gap: 14px; width: 912px; }
#diffList { display: flex; flex-direction: column; gap: 6px; width: 250px; }
.df { font-family: inherit; text-align: left; color: #fff; background: #14102a; border: 0; padding: 9px 12px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; box-shadow: inset 0 0 0 2px #3a2f66, 0 0 0 2px #000; }
.df b { font-size: 10px; color: var(--c); font-weight: normal; }
.df i { font-size: 7px; color: #9a9ac0; font-style: normal; }
.df:hover { background: #231d48; transform: translateX(3px); }
.df.sel { background: #231d48; box-shadow: inset 0 0 0 3px var(--c), 0 0 0 2px #000; }
#diffInfo { flex: 1; min-height: 300px; background: rgba(10,8,24,.92); border: 3px solid #000; box-shadow: inset 0 0 0 3px #4a3a7a; padding: 12px 16px; font-size: 8px; line-height: 1.8; color: #d8d8ea; }
#diffInfo .dn { font-size: 13px; margin-bottom: 8px; text-shadow: 2px 2px 0 #000; }
#diffInfo p { margin-bottom: 8px; }
.dt { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.dt td { padding: 2px 0; border-bottom: 1px solid #2a2450; }
.dt td:last-child { text-align: right; color: #ffd040; }
.cu { display: flex; flex-direction: column; gap: 5px; }
.cu label { display: flex; align-items: center; gap: 8px; font-size: 7px; }
.cu label span { width: 190px; }
.cu input[type=range] { flex: 1; accent-color: #c080ff; }
.cu b { width: 34px; text-align: right; color: #ffd040; font-weight: normal; }
.cu .chk span { width: auto; }
#seedRow { width: 912px; display: flex; align-items: center; gap: 12px; font-size: 8px; color: #c8c8d8; }
#seedIn { font-family: inherit; font-size: 12px; letter-spacing: 3px; width: 250px; padding: 8px 10px; background: #0a0818; color: #7dff8a; border: 0; box-shadow: inset 0 0 0 2px #4a3a7a, 0 0 0 2px #000; text-transform: none; }
#seedErr { color: #ff6060; }
#setPanel { width: 620px; display: flex; flex-direction: column; gap: 14px; }
.vr { display: flex; align-items: center; gap: 14px; font-size: 10px; color: #ffd040; }
.vr span { width: 110px; }
.vr input { flex: 1; accent-color: #ff70e0; height: 18px; }
.vr b { width: 50px; text-align: right; color: #7dff8a; font-weight: normal; }

/* ---- древо навыков ---- */
#tree { justify-content: flex-start; gap: 8px; padding-top: 12px; }
#treeHead { width: 900px; display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: #ffd040; text-shadow: 2px 2px 0 #000; }
#treeHead .pts { color: #7dff8a; }
#treeHead .xpb { width: 220px; height: 10px; background: #10202a; border: 2px solid #000; position: relative; }
#treeHead .xpb i { position: absolute; left: 0; top: 0; bottom: 0; background: #58c0ff; }
#treeCols { display: flex; gap: 12px; width: 912px; }
.col { flex: 1; display: flex; flex-direction: column; gap: 14px; background: rgba(10,8,24,.8); border: 3px solid #000; padding: 8px 8px 12px; position: relative; }
.col h3 { font-size: 10px; text-align: center; text-shadow: 2px 2px 0 #000; margin-bottom: 2px; }
.col .node { position: relative; }
.col .node::before { content: ''; position: absolute; left: 50%; top: -14px; width: 4px; height: 14px; margin-left: -2px; background: #3a3260; }
.col .node:first-of-type::before { display: none; }
.node { font-family: inherit; text-align: left; color: #fff; background: #1a1636; border: 0; padding: 7px 8px; cursor: pointer; box-shadow: inset 0 0 0 2px #3a3260, 0 0 0 2px #000; min-height: 52px; }
.node .nn { font-size: 8px; line-height: 1.4; display: block; margin-bottom: 4px; }
.node .nr { font-size: 6px; color: #9a9ac0; display: block; line-height: 1.6; }
.node .pp { display: inline-block; width: 8px; height: 8px; background: #2a2540; margin-right: 2px; }
.node.avail { box-shadow: inset 0 0 0 2px var(--c), 0 0 0 2px #000; background: #231d48; }
.node.avail:hover { background: #33296a; transform: translateY(-2px); }
.node.maxed { box-shadow: inset 0 0 0 2px #ffd040, 0 0 0 2px #000; background: #3a3010; }
.node.locked { opacity: .55; }
.node.locked .nn { color: #aaa; }
.node .pp.on { background: var(--c); }
#treeInfo { width: 912px; min-height: 44px; background: rgba(10,8,24,.92); border: 3px solid #000; box-shadow: inset 0 0 0 3px #4a3a7a; padding: 8px 12px; font-size: 8px; line-height: 1.8; color: #d8d8ea; }
#treeInfo .bad { color: #ff8a8a; }

/* ---- магазин ---- */
#shop { justify-content: flex-start; gap: 8px; padding-top: 12px; }
#shopHead { width: 912px; display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: #ffd040; text-shadow: 2px 2px 0 #000; }
#shopHead { gap: 16px; }
#shopHead .sk { font-size: 7px; color: #c8c8d8; text-shadow: none; flex: 1; line-height: 1.7; }
#shop, #tree { background: rgba(4,4,10,.96); }
#shopHead .coins { color: #ffd040; font-size: 14px; }
#shopGrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 912px; }
.si { font-family: inherit; text-align: left; color: #fff; background: #1a1636; border: 0; padding: 8px; cursor: pointer; min-height: 106px; box-shadow: inset 0 0 0 2px var(--c, #3a3260), 0 0 0 2px #000; display: flex; flex-direction: column; gap: 4px; }
.si:hover { background: #2a2250; transform: translateY(-2px); }
.si canvas { width: 100%; height: 30px; image-rendering: pixelated; background: #0a0818; }
.si .n { font-size: 8px; line-height: 1.4; color: var(--c, #fff); }
.si .st { font-size: 6px; color: #9a9ac0; line-height: 1.6; }
.si .pr { font-size: 9px; color: #ffd040; margin-top: auto; }
.si .rq { font-size: 6px; color: #ff9a6a; }
.si.sold { opacity: .35; cursor: default; }
.si.poor .pr { color: #ff6060; }
#shopSlots { display: flex; gap: 8px; width: 912px; align-items: stretch; }
#shopSlots .lbl { font-size: 7px; color: #9a9ac0; width: 140px; line-height: 1.8; align-self: center; }
#shopSlots .sl { flex: 1; font-family: inherit; font-size: 7px; line-height: 1.6; text-align: left; color: #fff; background: #12102a; border: 0; padding: 6px 8px; box-shadow: inset 0 0 0 2px var(--c), 0 0 0 2px #000; }
#shopSlots .sl i { color: var(--c); font-style: normal; }
#shopSlots .sl.pick { cursor: pointer; animation: bob 1s steps(4) infinite; }
#shopSlots .sl.pick:hover { background: #2a2250; }
#shopInfo { width: 912px; min-height: 28px; font-size: 8px; color: #d8d8ea; line-height: 1.8; text-align: center; }

/* ---- перки ---- */
#perks { display: flex; gap: 16px; margin-top: 10px; }
.perk { width: 260px; min-height: 130px; background: #14102a; border: 3px solid #000; box-shadow: inset 0 0 0 3px #3a8a4a; padding: 16px; cursor: pointer; font-family: inherit; color: #fff; text-align: left; }
.perk:hover { background: #1c2a3a; transform: translateY(-4px); }
.perk .k { color: #7dff8a; font-size: 10px; margin-bottom: 10px; display: block; }
.perk .n { color: #ffd040; font-size: 11px; line-height: 1.5; margin-bottom: 10px; display: block; }
.perk .d { font-size: 8px; line-height: 1.8; color: #cfd; display: block; }
