/* Кухня «три в ряд» — затишна тема (як у Кав'ярні): темне дерево зліва, кремова панель справа.
   ПК (≥1100px): ліва панель HUD+меню, права панель завжди відкрита. Телефон: HUD зверху, меню знизу, панель — висувний лист. */
:root {
    --bg: #2a1c14; --wood: #3b281c; --wood2: #4a3324; --line: rgba(255, 226, 190, .14);
    --t1: #fff4e4; --t2: #d9bf9e; --t3: #a88d6e;
    --cream: #fff8ee; --cream2: #f6ead8; --ink: #3b2a20; --ink2: #7c5a3a; --ink3: #a08060; --cline: #ecd9bd;
    --gold: #f59e0b; --gold2: #fde68a; --ok: #22c55e; --bad: #ef4444; --star: #f59e0b;
    --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 Rubik, 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: 14px; background: linear-gradient(180deg, #3b281c, #2a1c14); border-right: 1px solid var(--line); z-index: 5; }
.hud { display: flex; flex-direction: column; gap: 10px; }
.brand b { display: block; font-size: 21px; font-weight: 900; color: var(--gold2); }
.brand small { color: var(--t3); font-size: 12px; }
.money { display: flex; flex-direction: column; gap: 8px; }
.coins, .stars { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.28); border: 1px solid var(--line); border-radius: 14px; padding: 9px 12px; }
.coins b, .stars b { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.coins b { color: #fcd34d; } .stars b { color: #fde68a; }
.coin { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fef3c7, #f59e0b 60%, #b45309); box-shadow: 0 0 0 2px rgba(0,0,0,.3); flex: none; }
.star { font-style: normal; font-size: 22px; line-height: 1; color: var(--star); text-shadow: 0 1px 0 #92400e; width: 22px; text-align: center; flex: none; }
.lvl { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 2px 10px; align-items: center; padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(245,158,11,.3); background: rgba(245,158,11,.1); 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: 50%; background: radial-gradient(circle at 35% 30%, #fde68a, #f59e0b 70%); color: #3b1d0e; }
.lvl .lv small { font-size: 9px; font-weight: 700; margin-bottom: -3px; } .lvl .lv b { font-size: 19px; font-weight: 900; }
.lvl .bar { height: 8px; border-radius: 4px; background: rgba(0,0,0,.35); overflow: hidden; } .lvl .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #fbbf24, #fde68a); transition: width .3s; }
.lvl > small { color: var(--t2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.nav button { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 0; border-radius: 12px; background: none; color: var(--t2); cursor: pointer; text-align: left; font-weight: 500; }
.nav button:hover { background: rgba(255,255,255,.05); }
.nav button.on { background: rgba(245,158,11,.16); color: var(--gold2); }
.nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.dot { position: absolute; left: 30px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px #2a1c14; }

/* ---------- життя ---------- */
.lives { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 14px; background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3); }
.lives span { color: #f87171; font-size: 18px; letter-spacing: 1px; } .lives span i { font-style: normal; opacity: .25; }
.lives small { margin-left: auto; color: var(--t2); font-size: 12px; font-variant-numeric: tabular-nums; }

/* ---------- екран ресторану (поверх інтер'єру на полотні) ---------- */
#map { position: fixed; z-index: 3; padding: 14px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
#map > * { pointer-events: auto; }
.rtabs { display: flex; gap: 6px; flex-wrap: wrap; max-width: 620px; margin: 0 auto; width: 100%; }
.rtabs button { flex: 1; min-width: 110px; padding: 8px; border-radius: 14px; border: 2px solid transparent; background: rgba(255,255,255,.94); color: var(--ink); font-weight: 800; cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,.18); font-family: inherit; }
.rtabs button small { display: block; font-weight: 600; color: var(--ink3); font-size: 11px; }
.rtabs button.on { border-color: var(--rc, #f59e0b); }
.rtabs button.lock { opacity: .55; }
.rcard { max-width: 620px; width: 100%; margin: 0 auto; background: rgba(255,250,242,.97); border-radius: 22px; padding: 14px; box-shadow: 0 10px 34px rgba(0,0,0,.3); border-top: 6px solid var(--rc, #f59e0b); color: var(--ink); display: flex; flex-direction: column; gap: 10px; }
.rtop { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .rtop b { font-size: 18px; display: block; } .rtop small { color: var(--ink3); }
.rtop .ings { display: flex; margin-left: auto; } .rtop .ings img { width: 32px; height: 32px; }
.rbar { height: 10px; border-radius: 5px; background: #efe2cf; overflow: hidden; } .rbar i { display: block; height: 100%; background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.rtask { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 14px; background: #fff; border: 1px solid var(--cline); }
.rtask .ti { font-size: 28px; } .rtask b { display: block; } .rtask small { color: var(--ink3); font-size: 12px; }
.rtask .btn { width: auto; margin-left: auto; min-height: 38px; padding: 6px 16px; }
.rcard .play { min-height: 54px; font-size: 19px; }
.btn.hard { background: linear-gradient(180deg, #f87171, #dc2626); color: #fff; box-shadow: 0 3px 0 #991b1b; }
.rcard .dailyb { min-height: 38px; font-size: 13px; }
.row.done { opacity: .6; }

/* ---------- інструменти під полем ---------- */
#tools { position: fixed; z-index: 4; display: flex; gap: 8px; justify-content: center; }
#tools button { border: 0; border-radius: 12px; padding: 9px 14px; font-weight: 800; cursor: pointer; background: #fff; color: var(--ink); box-shadow: 0 3px 0 #d6bf9e; font-size: 15px; font-family: inherit; }
#tools button.on { background: #fecaca; box-shadow: 0 3px 0 #ef4444; }
#tools button:disabled { opacity: .45; cursor: default; }
#tools button.ghost { background: #fff; color: var(--ink3); font-weight: 600; font-size: 13px; }
.res { font-size: 46px; letter-spacing: 6px; color: #f59e0b; text-shadow: 0 2px 0 #b45309; margin: 4px 0 10px; }
.res i { font-style: normal; color: #e7d3b8; text-shadow: none; }
.guestlist { text-align: left; margin: 0 0 14px; color: var(--ink); }
.guestlist div { display: flex; align-items: center; gap: 4px; padding: 6px 0; border-bottom: 1px dashed #ecd9bd; flex-wrap: wrap; }
.guestlist b { min-width: 120px; } .guestlist img { width: 26px; height: 26px; } .guestlist span { font-weight: 700; margin-right: 6px; }

/* ---------- інфо-рядок над полем ---------- */
#info { position: fixed; z-index: 4; display: flex; align-items: center; gap: 8px; padding: 0 6px 0 4px; border-radius: 12px; background: rgba(255,248,238,.95); color: var(--ink); box-shadow: 0 3px 10px rgba(0,0,0,.3); font-size: 13px; overflow: hidden; }
#info img { width: 30px; height: 30px; flex: none; }
#info .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#info .t b { color: var(--ink); } #info .t small { color: var(--ink3); margin-left: 6px; }
#info .hint { color: var(--ink2); padding-left: 6px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#info button { flex: none; border: 0; border-radius: 9px; padding: 6px 10px; font-weight: 800; font-size: 12px; cursor: pointer; background: #f3e2c7; color: var(--ink); }
#info button.gold { background: linear-gradient(180deg, #fbbf24, #f59e0b); color: #3b1d0e; }
#info button.green { background: linear-gradient(180deg, #4ade80, #16a34a); color: #052e16; }

/* ---------- права панель ---------- */
#panel { position: fixed; right: 0; top: 0; bottom: 0; width: 380px; background: var(--cream); color: var(--ink); border-left: 1px solid #00000040; z-index: 6; display: flex; flex-direction: column; }
#panel header { display: flex; align-items: center; gap: 10px; padding: 16px 16px 10px; }
#panel h2 { margin: 0; font-size: 19px; font-weight: 800; flex: 1; color: #5b3418; }
#panel .x { width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--cream2); cursor: pointer; display: none; }
#panelBody { flex: 1; overflow-y: auto; padding: 0 16px 20px; }

/* ---------- блоки панелі ---------- */
.card { background: #fff; border: 1px solid var(--cline); border-radius: 16px; padding: 12px; margin-bottom: 10px; box-shadow: 0 2px 0 #f0e0c8; }
.card h3 { margin: 0 0 8px; font-size: 14px; color: var(--ink2); font-weight: 700; }
.note { color: var(--ink3); font-size: 12px; margin: 6px 0 0; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 12px; border: 0; cursor: pointer; font-weight: 800; font-size: 15px; background: #e7dccb; color: #8a7560; }
.btn.gold { background: linear-gradient(180deg, #fbbf24, #f59e0b); color: #3b1d0e; box-shadow: 0 3px 0 #b45309; }
.btn.green { background: linear-gradient(180deg, #4ade80, #16a34a); color: #052e16; box-shadow: 0 3px 0 #166534; }
.btn.berry { background: linear-gradient(180deg, #f472b6, #db2777); color: #fff; box-shadow: 0 3px 0 #9d174d; }
.btn.ghost { background: var(--cream2); color: var(--ink); font-weight: 600; box-shadow: none; }
.btn:disabled { cursor: default; box-shadow: none; opacity: .75; }
.btn small { font-weight: 700; opacity: .85; }
.btn.sm { min-height: 34px; width: auto; font-size: 13px; padding: 6px 12px; border-radius: 10px; }
.step { display: flex; gap: 12px; align-items: center; }
.step .pic { width: 64px; height: 64px; border-radius: 14px; background: var(--cream2); display: grid; place-items: center; font-size: 30px; flex: none; }
.step b { display: block; font-size: 16px; color: var(--ink); } .step small { color: var(--ink3); }
.decor { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.decor div { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 7px 9px; border-radius: 10px; background: var(--cream2); font-size: 12.5px; }
.pips { display: flex; gap: 3px; } .pips i { width: 8px; height: 8px; border-radius: 50%; background: #dccab0; } .pips i.on { background: var(--gold); }
.unl { display: flex; gap: 8px; align-items: center; padding: 6px 2px; border-bottom: 1px dashed var(--cline); font-size: 13px; color: var(--ink2); }
.unl:last-child { border-bottom: 0; } .unl b { min-width: 46px; color: var(--ink3); font-weight: 700; font-size: 12px; } .unl.done { color: var(--ink3); text-decoration: line-through; }
.row { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--cline); }
.row:last-child { border-bottom: 0; }
.row .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--cream2); }
.row .ic img { width: 40px; height: 40px; }
.row .t { flex: 1; min-width: 0; } .row .t b { display: block; font-size: 14px; } .row .t small { color: var(--ink3); font-size: 12px; display: block; }
.row .r { flex: none; }
.chain { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chain img { width: 34px; height: 34px; border-radius: 9px; background: var(--cream2); }
.chain img.no { filter: grayscale(1) brightness(.4) opacity(.35); }
.ach { display: flex; gap: 10px; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--cline); }
.ach .medal { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #ece2d2; color: #b8a58c; font-weight: 900; flex: none; }
.ach.got .medal { background: radial-gradient(circle at 35% 35%, #fef3c7, #f59e0b); color: #78350f; }
.ach b { display: block; font-size: 13px; } .ach small { color: var(--ink3); font-size: 12px; }
.stats { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 13px; }
.stats span { color: var(--ink2); } .stats b { text-align: right; font-variant-numeric: tabular-nums; }
.big { font-size: 30px; font-weight: 900; color: #b45309; }
.city { padding: 12px; border-radius: 14px; background: var(--cream2); margin-bottom: 8px; }
.city b { display: block; color: #5b3418; } .city small { color: var(--ink2); }
.city.cur { outline: 2px solid var(--gold); background: #fff3d9; }

/* ---------- модалка й тости ---------- */
#modal { position: fixed; inset: 0; z-index: 60; background: rgba(20,12,6,.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
#modal .box { width: 100%; max-width: 420px; background: var(--cream); color: var(--ink); border: 2px solid #e8c9a0; border-radius: 20px; padding: 20px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
#modal h2 { margin: 0 0 8px; color: #7c4a21; font-size: 21px; }
#modal p { color: var(--ink2); margin: 0 0 14px; line-height: 1.5; }
#modal .btns { display: flex; gap: 8px; }
#modal .gift { display: flex; justify-content: center; gap: 18px; margin: 4px 0 14px; font-size: 22px; font-weight: 900; color: #b45309; }
#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(255,248,238,.97); color: var(--ink); border: 1px solid #e8c9a0; border-radius: 12px; padding: 9px 14px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.35); animation: tin .25s ease-out; max-width: 90vw; }
.toast.gold { border-color: #f59e0b; background: #fff3d1; }
.toast.bad { border-color: #fca5a5; }
@keyframes tin { from { transform: translateY(-8px); opacity: 0; } }

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

@media (max-width: 1099px) {
    .hud .lives { padding: 5px 8px; border-radius: 12px; flex: 1; min-width: 0; } .lives span { font-size: 13px; } .lives small { font-size: 10.5px; }
    #map { padding: 8px; } .rtabs button { min-width: 0; font-size: 12px; padding: 6px 4px; } .rcard { padding: 10px; gap: 8px; border-radius: 18px; } .rtop .ings { display: none; } .rcard .play { min-height: 48px; font-size: 17px; }
    #tools button { padding: 7px 10px; font-size: 13px; }
    #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; height: calc(58px + var(--sat)); padding: 6px 10px; padding-top: calc(6px + var(--sat)); flex-direction: row; align-items: center; gap: 8px; background: rgba(42,28,20,.97); border-bottom: 1px solid var(--line); pointer-events: auto; }
    .brand { display: none; }
    .money { flex-direction: row; gap: 6px; }
    .coins, .stars { padding: 6px 9px; border-radius: 12px; gap: 6px; } .coins b, .stars b { font-size: 17px; } .coin { width: 17px; height: 17px; } .star { font-size: 18px; width: 18px; }
    .lvl { flex: 1; min-width: 0; padding: 4px 8px; gap: 1px 8px; border-radius: 12px; }
    .lvl .lv { width: 36px; height: 36px; } .lvl .lv b { font-size: 15px; } .lvl .lv small { font-size: 8px; }
    .lvl > small { font-size: 11px; }
    .nav { position: fixed; left: 0; right: 0; bottom: 0; height: 66px; flex-direction: row; gap: 0; margin: 0; background: rgba(42,28,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: 3px; padding: 8px 0 6px; border-radius: 0; font-size: 10.5px; text-align: center; }
    .nav button.on { background: none; }
    .dot { left: calc(50% + 6px); top: 6px; }
    #panel { top: auto; left: 0; width: auto; max-height: 72vh; border-left: 0; border-radius: 20px 20px 0 0; bottom: 66px; transition: transform .2s ease, visibility .2s; box-shadow: 0 -12px 40px rgba(0,0,0,.5); }
    #panel.closed { transform: translateY(calc(100% + 90px)); visibility: hidden; pointer-events: none; }
    #panel .x { display: grid; place-items: center; }
    #info { font-size: 12px; } #info img { width: 26px; height: 26px; } #info button { padding: 5px 8px; font-size: 11.5px; }
    #toasts { top: calc(64px + var(--sat)); width: 92vw; }
    .toast { font-size: 13px; padding: 7px 11px; border-radius: 10px; text-align: center; }
}
