/* Сортувальна станція — індустріальний стиль: графіт, сталь, сигнальний жовтий, жовто-чорні смуги. Шрифти Barlow / Barlow Condensed.
   ПК (≥1100px): ліва колонка HUD+меню, права панель завжди відкрита. Телефон: HUD зверху, меню знизу, панель — висувний лист. */
:root {
    --bg: #15181b; --panel: rgba(28, 32, 36, .97); --line: rgba(255, 255, 255, .08); --line2: rgba(242, 183, 5, .35);
    --t1: #ece6d6; --t2: #a9a497; --t3: #78756d;
    --y: #f2b705; --y2: #ffd34d; --ok: #7ccf6a; --bad: #ff6b5b; --warn: #ff9a3c; --steel: #4a525b;
    --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 Barlow, 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, #24282c, #181b1e); border-right: 3px solid #0e1012; z-index: 5; box-shadow: inset -1px 0 0 rgba(255,255,255,.04); }
#side::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: repeating-linear-gradient(-45deg, var(--y) 0 10px, #1a1a1a 10px 20px); }
.hud { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.brand b { display: block; font: 800 22px/1.05 "Barlow Condensed", sans-serif; letter-spacing: .04em; color: var(--y); }
.brand small { color: var(--t3); font-size: 13px; }
.coins { display: flex; align-items: center; gap: 10px; background: #111315; border: 1px solid #000; border-radius: 6px; padding: 9px 12px; box-shadow: inset 0 2px 6px rgba(0,0,0,.6); }
.coins b { font: 800 24px "Barlow Condensed", sans-serif; color: var(--y2); font-variant-numeric: tabular-nums; letter-spacing: .02em; white-space: nowrap; }
.coins small { white-space: nowrap; }
.coins small { margin-left: auto; color: var(--ok); font-weight: 700; font-size: 13px; }
.coin { width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff2b0, #e0a800 60%, #8a6400); flex: none; box-shadow: 0 0 0 2px #1a1a1a; }
.lvl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; padding: 9px 12px; border-radius: 6px; border: 1px solid #000; background: #23272b; cursor: pointer; text-align: left; }
.lvl .lv { grid-row: span 2; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 4px; background: var(--y); color: #1a1a1a; }
.lvl .lv small { font-size: 9px; font-weight: 700; margin-bottom: -4px; text-transform: uppercase; } .lvl .lv b { font: 900 22px "Barlow Condensed", sans-serif; }
.lvl .bar { height: 7px; border-radius: 2px; background: #111315; overflow: hidden; border: 1px solid #000; } .lvl .bar i { display: block; height: 100%; width: 0; background: var(--y); 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 { padding: 7px 9px; border-radius: 6px; background: #1d2024; border: 1px solid #000; min-width: 0; }
.m span { display: block; font: 700 10px "Barlow Condensed", sans-serif; color: var(--t3); letter-spacing: .1em; }
.m b { display: block; font: 700 16px "Barlow Condensed", sans-serif; white-space: nowrap; font-variant-numeric: tabular-nums; }
.m.warn b { color: var(--warn); }
.shift { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 10px; border-radius: 6px; border: 0; cursor: pointer; background: linear-gradient(180deg, #ff8a2a, #e0650c); color: #1a1006; box-shadow: 0 3px 0 #8a3c06, inset 0 1px 0 rgba(255,255,255,.35); }
.shift b { font: 900 18px "Barlow Condensed", sans-serif; letter-spacing: .06em; } .shift small { font-weight: 700; font-size: 12px; opacity: .85; }
.shift:active { transform: translateY(2px); box-shadow: 0 1px 0 #8a3c06; }
.shift.boost { background: linear-gradient(180deg, #f2b705, #c89200); box-shadow: 0 3px 0 #6e5000, 0 0 18px rgba(242,183,5,.45); }
.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: 4px; 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(242,183,5,.12); color: var(--y2); box-shadow: inset 3px 0 0 var(--y); }
.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); }

/* ---------- права панель ---------- */
#panel { position: fixed; right: 0; top: 0; bottom: 0; width: 380px; background: var(--panel); border-left: 3px solid #0e1012; z-index: 6; display: flex; flex-direction: column; }
#panel header { display: flex; align-items: center; gap: 10px; padding: 16px 16px 10px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
#panel h2 { margin: 0; font: 800 22px "Barlow Condensed", sans-serif; flex: 1; letter-spacing: .03em; text-transform: uppercase; }
#panel .x { width: 36px; height: 36px; border-radius: 6px; border: 0; background: rgba(255,255,255,.06); cursor: pointer; display: none; }
#panelBody { flex: 1; overflow-y: auto; padding: 0 16px 20px; }

/* ---------- блоки ---------- */
.card { background: #1d2024; border: 1px solid #0c0d0f; border-radius: 6px; padding: 12px; margin-bottom: 10px; box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.card h3 { margin: 0 0 8px; font: 700 13px "Barlow Condensed", sans-serif; color: var(--y); letter-spacing: .12em; text-transform: uppercase; }
.card.done { border-color: rgba(124,207,106,.5); }
.card.lock { opacity: .55; }
.card p { margin: 0 0 8px; }
.note { color: var(--t3); font-size: 12.5px; margin: 6px 0 0; line-height: 1.45; }
.sub { margin: 14px 0 8px; font: 700 13px "Barlow Condensed", sans-serif; color: var(--t2); letter-spacing: .12em; text-transform: uppercase; }
.hint { padding: 9px 11px; border-radius: 6px; margin-bottom: 10px; font-size: 13px; background: #1d2024; border-left: 4px solid var(--steel); }
.hint.warn { border-left-color: var(--warn); background: rgba(255,154,60,.08); } .hint.ok { border-left-color: var(--ok); background: rgba(124,207,106,.07); }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 42px; padding: 8px 12px; margin-top: 8px; border-radius: 5px; border: 1px solid #000; cursor: pointer; font: 700 15px "Barlow Condensed", sans-serif; letter-spacing: .04em; background: linear-gradient(180deg, #3a4047, #2b3035); color: var(--t1); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
.btn:hover { background: linear-gradient(180deg, #444b53, #32383e); }
.btn.go { background: linear-gradient(180deg, #f6c51c, #d9a300); color: #1a1406; box-shadow: 0 2px 0 #6e5000, inset 0 1px 0 rgba(255,255,255,.4); }
.btn.go:hover { background: linear-gradient(180deg, #ffd23d, #e6ae00); }
.btn.bad { background: rgba(255,107,91,.1); border-color: rgba(255,107,91,.5); color: #ffb0a6; }
.btn.ghost { background: none; border-color: var(--line); color: var(--t2); }
.btn:disabled { opacity: .4; cursor: default; box-shadow: none; }
.btn small { font-weight: 600; opacity: .8; font-family: Barlow, sans-serif; font-size: 12px; }
.btn.sm { width: auto; min-height: 34px; margin-top: 0; padding: 5px 10px; font-size: 14px; flex: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bulk { display: flex; gap: 4px; margin-top: 4px; } .bulk button { flex: 1; padding: 6px; border-radius: 4px; border: 1px solid #000; background: #1d2024; color: var(--t2); cursor: pointer; font: 700 13px "Barlow Condensed", sans-serif; }
.bulk button.on { background: var(--y); color: #1a1406; }
.row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.row:last-of-type { border-bottom: 0; }
.row .ic { width: 42px; height: 42px; flex: none; display: grid; place-items: center; } .row .ic img { width: 100%; height: 100%; }
.row .ic.big { width: 64px; height: 64px; }
.row .tx { flex: 1; min-width: 0; } .row .tx b { display: block; font-size: 14.5px; } .row .tx small { display: block; color: var(--t3); font-size: 12.5px; line-height: 1.35; }
.buy .row { border: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.stats div { background: #15181b; border: 1px solid #000; border-radius: 5px; padding: 6px 8px; } .stats small { display: block; color: var(--t3); font-size: 11px; } .stats b { font: 700 17px "Barlow Condensed", sans-serif; }
.warn { color: var(--warn); } .bad { color: var(--bad); }
.mt { width: 100%; border-collapse: collapse; font-size: 13px; } .mt th { text-align: right; color: var(--t3); font-weight: 600; font-size: 11.5px; padding: 3px 4px; } .mt td { text-align: right; padding: 4px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.mt td:first-child, .mt th:first-child { text-align: left; } .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.ct .pay { font: 800 17px "Barlow Condensed", sans-serif; color: var(--y2); white-space: nowrap; }
.ct.act { border-left: 4px solid var(--y); }
.pbar { height: 8px; border-radius: 2px; background: #111315; border: 1px solid #000; overflow: hidden; margin: 8px 0 4px; } .pbar i { display: block; height: 100%; background: repeating-linear-gradient(-45deg, var(--y) 0 8px, #d29a00 8px 16px); }
.crow { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--t3); } .crow small.bad { color: var(--bad); }
.finds { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.fi { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 5px; background: #15181b; border: 1px solid #000; text-align: center; }
.fi span { font-size: 18px; color: var(--t3); } .fi small { font-size: 10px; line-height: 1.15; color: var(--t3); }
.fi.got span { color: var(--y2); text-shadow: 0 0 8px rgba(242,183,5,.5); } .fi.got small { color: var(--t1); }
.fi i { position: absolute; right: 2px; top: 1px; font-style: normal; font-size: 10px; color: var(--y); }
.ach { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; } .ach .a { padding: 8px; border-radius: 5px; background: #1d2024; color: var(--t3); font-size: 13px; display: flex; gap: 6px; align-items: center; }
.ach .a.on { color: var(--t1); border-left: 3px solid var(--y); }
.big { font: 900 34px "Barlow Condensed", sans-serif; color: var(--y2); }

/* ---------- зміна вручну ---------- */
#shift { position: fixed; inset: 0; z-index: 40; background: var(--bg); }
#shiftCv { position: absolute; inset: 0; touch-action: none; }
.shud { position: absolute; left: 50%; top: calc(10px + var(--sat)); transform: translateX(-50%); display: flex; gap: 8px; align-items: stretch; z-index: 2; }
.shud > div { min-width: 92px; padding: 6px 12px; border-radius: 6px; background: rgba(17,19,21,.92); border: 1px solid #000; text-align: center; position: relative; }
.shud small { display: block; font: 700 10px "Barlow Condensed", sans-serif; color: var(--t3); letter-spacing: .12em; } .shud b { font: 900 26px "Barlow Condensed", sans-serif; color: var(--y2); }
.shud i { position: absolute; left: 0; right: 0; bottom: -18px; font-style: normal; font: 700 13px "Barlow Condensed", sans-serif; color: var(--ok); }
#shiftQuit { padding: 0 12px; border-radius: 6px; border: 1px solid #000; background: rgba(17,19,21,.92); color: var(--t2); cursor: pointer; font-weight: 600; }
#shiftRes { position: absolute; inset: 0; z-index: 3; background: rgba(10,12,14,.75); display: flex; align-items: center; justify-content: center; padding: 16px; }
#shiftRes .box, #modal .box { width: 100%; max-width: 440px; background: #1d2024; border: 1px solid #000; border-top: 8px solid var(--y); border-radius: 8px; padding: 20px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.6); max-height: 90vh; overflow-y: auto; }
#shiftRes h2, #modal h2 { margin: 0 0 10px; font: 800 26px "Barlow Condensed", sans-serif; color: var(--y); text-transform: uppercase; letter-spacing: .03em; }
#shiftRes p, #modal p { color: var(--t2); margin: 10px 0; line-height: 1.5; }

/* ---------- модалка й тости ---------- */
#modal { position: fixed; inset: 0; z-index: 60; background: rgba(5,6,8,.72); display: flex; align-items: center; justify-content: center; padding: 16px; }
#modal .btns { display: flex; gap: 8px; } #modal .btns .btn { flex: 1; }
#modal .list { text-align: left; font-size: 13.5px; color: var(--t2); margin: 0 0 6px; padding: 8px 12px; border-radius: 5px; background: #15181b; display: flex; flex-direction: column; gap: 6px; }
#modal .list b { color: var(--t1); }
#toasts { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 45; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: #1d2024; border: 1px solid #000; border-left: 4px solid var(--steel); border-radius: 5px; padding: 9px 14px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.5); animation: tin .25s ease-out; max-width: 90vw; }
.toast.good { border-left-color: var(--ok); } .toast.bad { border-left-color: var(--bad); } .toast.gold { border-left-color: var(--y); }
@keyframes tin { from { transform: translateY(-8px); opacity: 0; } }
::-webkit-scrollbar { width: 8px; } ::-webkit-scrollbar-thumb { background: rgba(242,183,5,.25); border-radius: 4px; } ::-webkit-scrollbar-track { 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; box-shadow: none; }
    #side::before { display: none; }
    .hud { position: fixed; top: 0; left: 0; right: 0; margin: 0; padding: 6px 8px; padding-top: calc(6px + var(--sat)); display: grid; grid-template-columns: auto 1fr auto; gap: 6px; background: #1b1e21; border-bottom: 2px solid #0e1012; pointer-events: auto; }
    .brand, .meters { display: none; }
    .coins { padding: 5px 9px; gap: 6px; } .coins b { font-size: 19px; } .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: 16px; } .lvl .lv small { font-size: 7px; } .lvl > small { font-size: 11px; }
    .shift { padding: 4px 10px; } .shift b { font-size: 14px; } .shift small { font-size: 10px; }
    .nav { position: fixed; left: 0; right: 0; bottom: 0; height: 62px; flex-direction: row; gap: 0; margin: 0; background: #1b1e21; border-top: 2px solid #0e1012; 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: 10px; text-align: center; min-width: 0; }
    .nav button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
    .nav button.on { box-shadow: inset 0 3px 0 var(--y); }
    .dot { left: calc(50% + 6px); top: 5px; }
    #panel { top: auto; left: 0; width: auto; max-height: 72vh; border-left: 0; border-top: 3px solid var(--y); border-radius: 10px 10px 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; }
    #toasts { top: calc(72px + var(--sat)); width: 92vw; }
    .toast { font-size: 13px; padding: 7px 11px; text-align: center; }
    .shud > div { min-width: 70px; padding: 4px 8px; } .shud b { font-size: 21px; }
}
@media (max-width: 420px) { .lvl > small { display: none; } .lvl .bar { align-self: center; } }
