/* «Кофейня капибары» — оболочка полной версии: 3D-сцена на весь экран, прозрачный холст интерфейса поверх,
   полоса кнопок сверху, листы (лифт, «пока тебя не было», следующая точка). Вид — как у соседей по «Норе»:
   системная гарнитура, тёмная обводка, пухлые кнопки. */
:root { --ink: #3a2930; --wall: #e9dcc8; --teal: #25b3a5; --green: #3cb371; --gold: #ffd36a; --bar: 52px; --side: 0px; --right: 0px; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--wall); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
#app { position: fixed; inset: 0; }
#app > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; }

#bar { position: absolute; left: var(--side); right: var(--right); top: 0; height: var(--bar); display: flex; align-items: center; justify-content: flex-end; gap: 6px;
  padding: 8px max(10px, env(safe-area-inset-right)) 6px 10px; pointer-events: none; z-index: 3; }
#bar > * { pointer-events: auto; }
.chip { height: 38px; min-width: 38px; padding: 0 12px; border: 3px solid var(--ink); border-radius: 999px; background: #fff;
  color: var(--ink); font: 800 15px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; box-shadow: 0 3px 0 rgba(58, 41, 48, .25); }
.chip.icon { padding: 0; justify-content: center; width: 38px; font-size: 18px; }
.chip[aria-pressed="false"] { background: #ddd; text-decoration: line-through; }
.chip:focus-visible, .btn:focus-visible { outline: 3px solid #3c8ce0; outline-offset: 2px; }
.chip .prog { color: #8a6a52; font-weight: 700; }

#goal { position: absolute; left: calc(var(--side) + (100% - var(--side) - var(--right)) / 2); transform: translateX(-50%); bottom: max(14px, env(safe-area-inset-bottom)); z-index: 3;
  background: rgba(255, 255, 255, .95); border: 3px solid var(--ink); border-radius: 999px; padding: 8px 16px; font-weight: 800; font-size: 15px;
  white-space: nowrap; max-width: 94vw; overflow: hidden; text-overflow: ellipsis; pointer-events: none; box-shadow: 0 3px 0 rgba(58, 41, 48, .25); }
#goal[hidden] { display: none; }
#goal b { color: #1c8f84; }
#toast { position: absolute; left: calc(var(--side) + (100% - var(--side) - var(--right)) / 2); top: 22%; width: max-content; transform: translateX(-50%); background: var(--ink); color: #fff;
  font-weight: 800; padding: 10px 18px; border-radius: 999px; z-index: 5; max-width: 92vw; text-align: center; pointer-events: none; font-size: 16px; }
#toast[hidden] { display: none; }

/* Боковая колонка на широком экране: точки, цель, управление */
#side { position: absolute; left: 0; top: 0; bottom: 0; width: var(--side); padding: 14px 16px; display: none; flex-direction: column; gap: 10px;
  background: linear-gradient(180deg, #fff7ea, #f3e6d2); border-right: 4px solid var(--ink); z-index: 3; overflow-y: auto; }
#side.on { display: flex; }
#side h1 { margin: 0; font-size: 22px; font-weight: 900; line-height: 1.1; }
#side h1 small { display: block; font-size: 13px; font-weight: 700; color: #8a6a52; margin-top: 4px; }
#side .hint { font-size: 14px; line-height: 1.45; color: #5a4650; margin: 0; }
#side .hint kbd { display: inline-block; min-width: 22px; padding: 1px 5px; border: 2px solid var(--ink); border-radius: 6px; background: #fff; font: 800 12px system-ui, sans-serif; text-align: center; }
#side .links { margin-top: auto; font-size: 13px; display: flex; gap: 12px; }
#side a, .card a { color: #2f6fd6; }
.ad[hidden] { display: none; }
#ad-side { position: absolute; right: 0; top: 0; bottom: 0; width: 316px; padding: 16px; background: #f6efe4; border-left: 4px solid var(--ink); z-index: 3; }

.sheet { position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; padding: 12px;
  background: rgba(40, 30, 50, .45); overflow-y: auto; }
.sheet[hidden] { display: none; }
.card { width: 100%; max-width: 420px; max-height: 100%; overflow-y: auto; background: #fff; border: 4px solid var(--ink); border-radius: 22px;
  padding: 18px; box-shadow: 0 8px 0 rgba(58, 41, 48, .25); text-align: center; }
.card-head { display: flex; align-items: center; justify-content: space-between; text-align: left; }
.card h2 { margin: 0 0 6px; font-size: 26px; font-weight: 900; }
.card .big { font-size: 40px; font-weight: 900; margin: 6px 0; color: #c98510; }
.x { width: 40px; height: 40px; border: 3px solid var(--ink); border-radius: 50%; background: #fff; font-size: 24px; line-height: 1; cursor: pointer; color: var(--ink); }
.note { font-size: 15px; margin: 8px 0; color: #5a4650; }
.buttons { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 12px; }
.btn { min-height: 48px; border: 3px solid var(--ink); border-radius: 16px; background: #fff; color: var(--ink); font: 800 16px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; cursor: pointer; padding: 6px 10px; }
.btn.primary { background: var(--green); color: #fff; font-size: 19px; min-height: 54px; }
.btn.gold { background: var(--gold); }
.btn[hidden] { display: none; }
.floors-list { display: grid; gap: 8px; margin: 10px 0; }
#side .floors-list { gap: 5px; margin: 0; }
#side .floor-btn { padding: 5px 10px; font-size: 14px; }
#side .floor-btn .n { width: 26px; height: 26px; font-size: 13px; }
.floor-btn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 3px solid var(--ink); border-radius: 14px; background: #fff;
  padding: 8px 12px; font: 800 15px system-ui, sans-serif; color: var(--ink); cursor: pointer; }
.floor-btn small { display: block; font-weight: 600; color: #8a6a52; font-size: 12px; }
.floor-btn .n { width: 32px; height: 32px; border-radius: 50%; background: var(--gold); display: inline-flex; align-items: center; justify-content: center; border: 3px solid var(--ink); flex: none; }
.floor-btn.cur { background: #e3f6f3; }
.floor-btn:disabled { background: #f1edf3; color: #a99fae; border-color: #c9c3d0; cursor: default; }
.floor-btn:disabled .n { background: #ddd; border-color: #c9c3d0; }
