/* «Пока шеф не видит» — оболочка полной версии: холст на весь экран, полоса кнопок сверху, листы (итоги, лифт,
   заначка, смена дня) поверх. Цвета — как в сцене: тёплая стена, тёмная обводка #3a2930, чистые казуальные цвета. */
:root { --ink: #3a2930; --wall: #f3e2c3; --pink: #ff8fb8; --green: #3cb371; --gold: #ffd36a; --bar: 48px; }
* { 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; }
/* до первой 3D-сцены экран закрывает общий прелоадер «Норы» (/nora-loader.css); под ним — фон цвета сцены */
#app { position: fixed; inset: 0; background: #f3dfbd; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }

#bar { position: absolute; left: 0; right: 0; top: 0; height: var(--bar); display: flex; align-items: center; gap: 6px;
  padding: 6px max(8px, env(safe-area-inset-right)) 6px max(8px, env(safe-area-inset-left)); pointer-events: none; }
#bar > * { pointer-events: auto; }
.grow { flex: 1; }
.chip { height: 36px; min-width: 36px; 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: 56vw; }
.chip.icon { padding: 0; justify-content: center; width: 36px; font-size: 18px; }
.chip.ghost { background: var(--gold); cursor: default; }
.chip[aria-pressed="false"] { background: #ddd; text-decoration: line-through; }
.chip:focus-visible, .btn:focus-visible { outline: 3px solid #3c8ce0; outline-offset: 2px; }
.lift-ico { font-size: 16px; }

#toast { position: absolute; left: 50%; bottom: max(120px, 16vh); width: max-content; transform: translateX(-50%); background: var(--ink); color: #fff;
  font-weight: 800; padding: 10px 16px; border-radius: 999px; z-index: 5; max-width: 92vw; text-align: center; pointer-events: none; }

.sheet { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; padding: 12px;
  background: rgba(40, 30, 50, .45); overflow-y: auto; }
.card { width: 100%; max-width: 440px; 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); }
.card.wide { max-width: 680px; }
.card-head { display: flex; align-items: center; justify-content: space-between; }
.card h2 { margin: 0 0 6px; font-size: 26px; font-weight: 900; }
.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); }
.rank { margin: 0 0 8px; font-weight: 700; }
.note { font-size: 15px; margin: 8px 0; }
.stars { display: flex; gap: 10px; justify-content: center; margin: 10px 0; }
.stars i { width: 52px; height: 52px; background: #e5e0e8; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); transform: scale(.85); transition: transform .25s, background .25s; }
.stars i.on { background: var(--gold); transform: scale(1); }
.lines { list-style: none; padding: 0; margin: 8px 0; font-weight: 600; }
.lines li { padding: 4px 0; border-bottom: 2px dashed #eee; display: flex; justify-content: space-between; gap: 8px; }
.buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.btn { min-height: 46px; 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 { grid-column: 1 / -1; background: var(--green); color: #fff; font-size: 19px; min-height: 54px; }
.btn.ghost { background: #f4f1f6; }
.btn[hidden] { display: none; }
.btn.glow { background: var(--gold); animation: glow 1s ease-in-out infinite alternate; }
@keyframes glow { to { box-shadow: 0 0 0 5px rgba(255, 211, 106, .55); } }

.day-btn { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; margin: 6px 0 12px;
  background: linear-gradient(90deg, #ffe7a3, #ffd0e0); border: 3px solid var(--ink); border-radius: 16px; padding: 10px 14px; cursor: pointer; color: var(--ink); font: inherit; }
.day-btn b { font-size: 19px; }
.floors { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.floors button { aspect-ratio: 1; border: 3px solid var(--ink); border-radius: 12px; background: #fff; font: 900 18px system-ui, sans-serif; color: var(--ink);
  cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0; }
.floors button small { font-size: 11px; color: #d49a00; letter-spacing: -1px; }
.floors button.cur { background: var(--gold); }
.floors button:disabled { background: #ece8ef; color: #aaa; border-color: #c9c3d0; cursor: default; }
@media (max-width: 420px) { .floors { grid-template-columns: repeat(5, 1fr); } }

#stash-cv, #stash-3d { width: 100%; aspect-ratio: 600 / 380; height: auto; display: block; border: 3px solid var(--ink); border-radius: 14px; background: #4a3550; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.item { border: 3px solid var(--ink); border-radius: 14px; padding: 8px 10px; background: #fff; text-align: left; cursor: pointer; font: inherit; color: var(--ink); }
.item b { display: block; font-size: 15px; }
.item span { font-size: 13px; }
.item .cost { font-weight: 900; }
.item.own { background: #e6f7ec; cursor: default; }
.item.cant { opacity: .55; cursor: default; }
.item.perk span.p { display: block; color: #2a7a4a; font-weight: 700; }

.board { padding-left: 28px; margin: 8px 0; font-weight: 600; }
.board li { padding: 4px 0; }
.board li.me { color: #c0507a; font-weight: 900; }

.ad { margin-top: 12px; min-height: 90px; }
.ad[hidden] { display: none; }

#bosskey { position: absolute; inset: 0; z-index: 10; background: #fff; color: #222; font: 13px/1.2 Calibri, "Segoe UI", Arial, sans-serif; display: flex; flex-direction: column; cursor: pointer; }
.xl-top { background: #217346; color: #fff; padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; }
.xl-top span { font-size: 12px; opacity: .85; }
.xl-formula { display: flex; gap: 10px; padding: 4px 8px; border-bottom: 1px solid #ccc; background: #f6f6f6; white-space: nowrap; overflow: hidden; }
.xl-formula span:first-child { color: #777; font-style: italic; }
.xl-grid { flex: 1; overflow: hidden; display: grid; grid-auto-rows: 22px; }
.xl-grid div { border-right: 1px solid #e1e1e1; border-bottom: 1px solid #e1e1e1; padding: 3px 5px; overflow: hidden; white-space: nowrap; text-align: right; }
.xl-grid div.h { background: #f0f0f0; color: #555; text-align: center; font-weight: 600; }
.xl-grid div.t { text-align: left; }
.xl-foot { background: #f0f0f0; border-top: 1px solid #ccc; padding: 4px 10px; font-size: 12px; color: #444; }
.xl-foot i { color: #888; }
[hidden] { display: none !important; }

.note.msg { background: #e6f7ec; border: 2px solid var(--green); border-radius: 12px; padding: 8px 10px; font-weight: 800; }

/* Заначка: комната — половина листа, список вещей прокручивается под ней */
.card.stash { display: flex; flex-direction: column; height: 100%; max-height: 100%; overflow: hidden; }
.card.stash #stash-3d { flex: none; height: min(48vh, 420px); aspect-ratio: auto; }
.card.stash .note { flex: none; }
.card.stash .items { flex: 1 1 auto; min-height: 120px; overflow-y: auto; padding-bottom: 4px; }
@media (min-width: 720px) { .card.stash { height: auto; } .card.stash #stash-3d { height: auto; aspect-ratio: 600 / 380; } }
