/* Дата-центр — чистий неон: темне скло, один акцент (ціан), шрифт Exo 2.
   ПК (≥1100px): ліва панель HUD+меню, права панель завжди відкрита. Телефон: HUD зверху, меню знизу, панель — висувний лист. */
:root {
    --bg: #060a14; --glass: rgba(11, 18, 34, .94); --line: rgba(103, 232, 249, .14); --line2: rgba(103, 232, 249, .3);
    --t1: #e2e8f0; --t2: #94a3b8; --t3: #64748b;
    --cy: #22d3ee; --cy2: #67e8f9; --ok: #4ade80; --bad: #f87171; --warn: #facc15; --gold: #fbbf24;
    --sat: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--t1); font: 14px/1.4 "Exo 2", system-ui, sans-serif; user-select: none; }
#cv { position: fixed; inset: 0; display: block; touch-action: none; }
button { font: inherit; color: inherit; }
.off { display: none !important; }

/* ---------- ліва панель / HUD ---------- */
#side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; padding: 16px 14px; display: flex; flex-direction: column; gap: 12px; background: linear-gradient(180deg, #0b1222, #060a14); border-right: 1px solid var(--line); z-index: 5; }
.hud { display: flex; flex-direction: column; gap: 10px; }
.brand b { display: block; font-size: 20px; font-weight: 900; letter-spacing: .12em; color: var(--cy2); text-shadow: 0 0 12px rgba(34,211,238,.5); }
.brand small { color: var(--t3); font-size: 12px; }
.coins { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; }
.coins b { font-size: 22px; font-weight: 800; color: #fde68a; font-variant-numeric: tabular-nums; }
.coins small { margin-left: auto; color: var(--ok); font-weight: 700; font-size: 12px; }
.coin { width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fef3c7, #f59e0b 60%, #b45309); flex: none; }
.lvl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(34,211,238,.07); cursor: pointer; text-align: left; }
.lvl .lv { grid-row: span 2; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; border: 1.5px solid var(--cy); color: var(--cy2); box-shadow: 0 0 12px rgba(34,211,238,.35) inset; }
.lvl .lv small { font-size: 9px; margin-bottom: -3px; color: var(--t2); } .lvl .lv b { font-size: 19px; font-weight: 900; }
.lvl .bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; } .lvl .bar i { display: block; height: 100%; width: 0; background: var(--cy); box-shadow: 0 0 8px var(--cy); transition: width .3s; }
.lvl > small { color: var(--t2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.m { position: relative; padding: 7px 9px; border-radius: 10px; background: rgba(255,255,255,.03); border: 1px solid var(--line); min-width: 0; }
.m span { display: block; font-size: 10px; color: var(--t3); font-weight: 700; letter-spacing: .08em; }
.m b { display: block; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.m .mb { display: block; height: 3px; border-radius: 2px; background: rgba(255,255,255,.08); margin-top: 4px; overflow: hidden; } .m .mb i { display: block; height: 100%; width: 0; background: var(--cy); }
.m.warn b { color: var(--warn); } .m.warn .mb i { background: var(--warn); } .m.hot b { color: var(--bad); }
#heatBtn { position: absolute; right: 6px; top: 6px; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line2); background: rgba(255,255,255,.04); cursor: pointer; font-size: 14px; }
#heatBtn.on { background: rgba(249,115,22,.25); border-color: #f97316; }
.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 2px; }
.nav button { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 10px; background: none; color: var(--t2); cursor: pointer; text-align: left; font-weight: 600; }
.nav button:hover { background: rgba(255,255,255,.04); }
.nav button.on { background: rgba(34,211,238,.12); color: var(--cy2); box-shadow: inset 2px 0 0 var(--cy); }
.nav svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.dot { position: absolute; left: 28px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 6px var(--ok); }

/* ---------- режим розстановки ---------- */
#mode { position: fixed; z-index: 7; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 14px; background: rgba(11,18,34,.96); border: 1px solid var(--cy); box-shadow: 0 0 20px rgba(34,211,238,.3); font-weight: 600; max-width: 94vw; }
#mode button { border: 0; border-radius: 10px; padding: 8px 12px; background: rgba(255,255,255,.08); cursor: pointer; font-weight: 700; }

/* ---------- права панель ---------- */
#panel { position: fixed; right: 0; top: 0; bottom: 0; width: 380px; background: var(--glass); border-left: 1px solid var(--line); z-index: 6; display: flex; flex-direction: column; backdrop-filter: blur(10px); }
#panel header { display: flex; align-items: center; gap: 10px; padding: 16px 16px 10px; }
#panel h2 { margin: 0; font-size: 18px; font-weight: 800; flex: 1; letter-spacing: .02em; }
#panel .x { width: 36px; height: 36px; border-radius: 10px; border: 0; background: rgba(255,255,255,.06); cursor: pointer; display: none; }
#panelBody { flex: 1; overflow-y: auto; padding: 0 16px 20px; }

/* ---------- блоки панелі ---------- */
.card { background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; }
.card h3 { margin: 0 0 8px; font-size: 12px; color: var(--t2); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.note { color: var(--t3); font-size: 12px; margin: 6px 0 0; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 42px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line2); cursor: pointer; font-weight: 700; font-size: 14px; background: rgba(255,255,255,.04); color: var(--t2); }
.btn.cy { background: var(--cy); border-color: var(--cy); color: #04202a; box-shadow: 0 0 14px rgba(34,211,238,.35); }
.btn.ok { background: rgba(74,222,128,.15); border-color: var(--ok); color: var(--ok); }
.btn.bad { background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.5); color: #fca5a5; }
.btn.gold { background: rgba(251,191,36,.15); border-color: var(--gold); color: #fde68a; }
.btn:disabled { opacity: .45; cursor: default; box-shadow: none; }
.btn small { font-weight: 600; opacity: .85; }
.btn.sm { min-height: 32px; width: auto; font-size: 12.5px; padding: 5px 10px; }
.btns2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 8px; }
.row:last-child { border-bottom: 0; } .row:hover { background: rgba(255,255,255,.03); }
.row.lock { opacity: .4; cursor: default; }
.row .ic { width: 46px; height: 46px; flex: none; display: grid; place-items: center; }
.row .ic img { width: 46px; height: 46px; }
.row .t { flex: 1; min-width: 0; } .row .t b { display: block; font-size: 14px; } .row .t small { color: var(--t3); font-size: 12px; display: block; }
.row .r { flex: none; text-align: right; font-weight: 700; font-size: 13px; color: #fde68a; }
.row .r.no { color: var(--t3); }
.stats { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 10px; font-size: 13px; align-items: center; }
.stats span { color: var(--t2); } .stats b { text-align: right; font-variant-numeric: tabular-nums; } .stats em { color: var(--ok); font-style: normal; text-align: right; }
.objh { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.objh img { width: 64px; height: 64px; } .objh b { display: block; font-size: 17px; } .objh small { color: var(--t3); }
.ct { padding: 10px; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 8px; background: rgba(255,255,255,.02); }
.ct.bad { border-color: rgba(248,113,113,.5); }
.ct .h { display: flex; align-items: center; gap: 8px; font-weight: 700; } .ct .h i { font-style: normal; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(34,211,238,.12); }
.ct .h span { flex: 1; } .ct .h em { font-style: normal; color: #fde68a; }
.ct .req { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--t2); margin: 6px 0; }
.ct .req b { color: var(--t1); } .ct .req .no { color: var(--bad); }
.ct .pb { height: 5px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; margin: 6px 0 4px; } .ct .pb i { display: block; height: 100%; background: var(--cy); }
.ct small { color: var(--t3); font-size: 12px; }
.ach { display: flex; gap: 10px; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.ach .medal { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--t3); font-weight: 900; flex: none; }
.ach.got .medal { border-color: var(--cy); color: var(--cy2); box-shadow: 0 0 10px rgba(34,211,238,.4); }
.ach b { display: block; font-size: 13px; } .ach small { color: var(--t3); font-size: 12px; }
.big { font-size: 28px; font-weight: 900; color: var(--cy2); text-shadow: 0 0 14px rgba(34,211,238,.4); }
.city { padding: 10px; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 6px; } .city b { display: block; } .city small { color: var(--t2); }
.city.cur { border-color: var(--cy); background: rgba(34,211,238,.06); }
.tabs { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
.tabs button { flex: 1; padding: 6px 4px; border-radius: 8px; border: 1px solid var(--line); background: none; color: var(--t2); cursor: pointer; font-weight: 700; font-size: 12px; white-space: nowrap; }
.tabs button.on { background: rgba(34,211,238,.14); border-color: var(--cy); color: var(--cy2); }

/* ---------- модалка й тости ---------- */
#modal { position: fixed; inset: 0; z-index: 60; background: rgba(2,4,10,.7); display: flex; align-items: center; justify-content: center; padding: 16px; }
#modal .box { width: 100%; max-width: 440px; background: #0b1222; border: 1px solid var(--cy); border-radius: 18px; padding: 20px; text-align: center; box-shadow: 0 0 40px rgba(34,211,238,.2); max-height: 90vh; overflow-y: auto; }
#modal h2 { margin: 0 0 8px; color: var(--cy2); font-size: 20px; }
#modal p { color: var(--t2); margin: 0 0 14px; line-height: 1.5; }
#modal .btns { display: flex; gap: 8px; }
#modal .list { text-align: left; font-size: 13px; color: var(--t2); margin: 0 0 14px; padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.03); }
#toasts { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 15; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: rgba(11,18,34,.97); border: 1px solid var(--line2); border-radius: 12px; padding: 9px 14px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.45); animation: tin .25s ease-out; max-width: 90vw; }
.toast.good { border-color: var(--ok); } .toast.bad { border-color: var(--bad); } .toast.cy { border-color: var(--cy); }
@keyframes tin { from { transform: translateY(-8px); opacity: 0; } }

/* ---------- телефон / вузьке вікно ---------- */
/* ---------- скролбари (тонкі, в кольорах гри) ---------- */
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: rgba(103,232,249,.28) transparent; } }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(103,232,249,.28); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(103,232,249,.5); background-clip: padding-box; }
::-webkit-scrollbar-button { display: none; height: 0; }
::-webkit-scrollbar-corner { background: transparent; }

@media (max-width: 1099px) {
    #side { inset: 0 0 auto 0; width: auto; height: auto; padding: 0; background: none; border: 0; display: block; pointer-events: none; }
    .hud { position: fixed; top: 0; left: 0; right: 0; padding: 6px 8px; padding-top: calc(6px + var(--sat)); display: grid; grid-template-columns: auto 1fr; gap: 6px; background: rgba(6,10,20,.97); border-bottom: 1px solid var(--line); pointer-events: auto; }
    .brand { display: none; }
    .coins { padding: 5px 9px; gap: 6px; } .coins b { font-size: 16px; } .coin { width: 16px; height: 16px; } .coins small { font-size: 11px; }
    .lvl { padding: 4px 8px; gap: 1px 8px; } .lvl .lv { width: 34px; height: 34px; } .lvl .lv b { font-size: 15px; } .lvl .lv small { font-size: 8px; } .lvl > small { font-size: 11px; }
    .meters { grid-column: span 2; grid-template-columns: repeat(4, 1fr); gap: 4px; }
    .m { padding: 4px 6px; } .m span { font-size: 9px; } .m b { font-size: 12px; } #heatBtn { width: 22px; height: 22px; right: 3px; top: 3px; font-size: 11px; }
    .nav { position: fixed; left: 0; right: 0; bottom: 0; height: 62px; flex-direction: row; gap: 0; margin: 0; background: rgba(6,10,20,.98); border-top: 1px solid var(--line); pointer-events: auto; padding-bottom: env(safe-area-inset-bottom); }
    .nav button { flex: 1; flex-direction: column; gap: 2px; padding: 7px 0 5px; border-radius: 0; font-size: 9.5px; text-align: center; min-width: 0; }
    .nav button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
    .nav button.on { background: none; box-shadow: inset 0 2px 0 var(--cy); }
    .dot { left: calc(50% + 6px); top: 5px; }
    #panel { top: auto; left: 0; width: auto; max-height: 70vh; border-left: 0; border-top: 1px solid var(--line2); border-radius: 18px 18px 0 0; bottom: 62px; transition: transform .2s ease, visibility .2s; box-shadow: 0 -12px 40px rgba(0,0,0,.6); }
    #panel.closed { transform: translateY(calc(100% + 90px)); visibility: hidden; pointer-events: none; }
    #panel .x { display: grid; place-items: center; }
    #mode { bottom: 74px; font-size: 13px; }
    #toasts { top: calc(110px + var(--sat)); width: 92vw; }
    .toast { font-size: 13px; padding: 7px 11px; text-align: center; }
}
