/* ДУБЛЬ — темна й світла теми, мобільний перший. */

/* --- Токени: світла тема за замовчуванням --------------------------------- */
:root {
  color-scheme: light dark;
  --bg: #f2efe9;
  --bg2: #fffdf8;
  --bg3: #e8e3d9;
  --line: #d9d2c6;
  --fg: #16181b;
  --muted: #5c6068;
  --accent: #a35a10;
  --accent-fg: #ffffff;
  --teal: #0f6f66;
  --bad: #a32020;
  --warn: #8a5a00;
  --good: #14663a;
  --shadow: 0 1px 2px rgba(20,18,14,.10), 0 8px 24px rgba(20,18,14,.08);
  --r: 14px;
  --r-s: 10px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;
  --wall: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1114;
    --bg2: #171a1f;
    --bg3: #101316;
    --line: #2a2f37;
    --fg: #eceef1;
    --muted: #9aa3ae;
    --accent: #f0a03c;
    --accent-fg: #16181b;
    --teal: #45c9b8;
    --bad: #ff6b5e;
    --warn: #ffc663;
    --good: #6ee7a5;
    --shadow: 0 1px 2px rgba(0,0,0,.5), 0 10px 30px rgba(0,0,0,.45);
    --wall: url('../assets/ui/bg_wall.webp');
  }
}
:root[data-theme="dark"] {
  --bg: #0f1114; --bg2: #171a1f; --bg3: #101316; --line: #2a2f37;
  --fg: #eceef1; --muted: #9aa3ae; --accent: #f0a03c; --accent-fg: #16181b;
  --teal: #45c9b8; --bad: #ff6b5e; --warn: #ffc663; --good: #6ee7a5;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 10px 30px rgba(0,0,0,.45);
  --wall: url('../assets/ui/bg_wall.webp');
}

/* --- База ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--fg);
  background: var(--bg);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 8px; }
img { max-width: 100%; height: auto; display: block; }
button, input { font: inherit; color: inherit; touch-action: manipulation; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
b { font-variant-numeric: tabular-nums; }
.note { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.is-bad { color: var(--bad); }
.is-warn { color: var(--warn); }
.is-dim { opacity: .5; }
.is-off { opacity: .45; }

/* --- Титульний екран ------------------------------------------------------ */
.title {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: var(--bg); overflow: hidden;
}
.title__art {
  position: absolute; inset: 0;
  background: url('../assets/rooms/bg_studio.webp') center/cover no-repeat;
  opacity: .55; filter: saturate(.85);
  animation: slow-zoom 24s ease-in-out infinite alternate;
}
@keyframes slow-zoom { from { transform: scale(1); } to { transform: scale(1.08); } }
.title::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 30%, transparent) 0%, var(--bg) 78%);
}
.title__inner {
  position: relative; z-index: 1;
  padding: 24px 20px calc(28px + var(--safe-b));
  max-width: 560px; width: 100%; margin: 0 auto;
}
.title__h { font-size: clamp(44px, 15vw, 72px); letter-spacing: .16em; line-height: .95; margin: 0 0 6px; }
.title__tag { color: var(--accent); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: 13px; margin-bottom: 10px; }
.title__sub { color: var(--muted); margin-bottom: 20px; }
.title__btns { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

.field { display: block; }
.field__l { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.field__i { width: 100%; padding: 12px 14px; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-s); }

/* --- Кнопки --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px; min-height: 44px;
  background: var(--bg2); color: var(--fg);
  border: 1px solid var(--line); border-radius: var(--r-s);
  font-weight: 600; text-align: center;
}
.btn--primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn--ghost { background: transparent; color: var(--muted); }
.btn--big { min-height: 52px; font-size: 16px; }
.btn--tiny { min-height: 32px; padding: 4px 10px; font-size: 12px; }
.btn:active { transform: translateY(1px); }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }

.chip { padding: 6px 10px; min-height: 32px; background: transparent; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; color: var(--muted); }
.chip.is-on { color: var(--accent); border-color: var(--accent); }

/* --- Каркас --------------------------------------------------------------- */
.app { display: flex; flex-direction: column; height: 100dvh; max-width: 560px; margin: 0 auto; background: var(--bg); position: relative; }

.hud { padding: calc(8px + var(--safe-t)) 14px 8px; background: var(--bg2); border-bottom: 1px solid var(--line); }
.hud__row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.hud__studio { display: flex; flex-direction: column; min-width: 0; }
.hud__name { font-weight: 700; letter-spacing: .06em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud__lv { font-size: 12px; color: var(--muted); }
.hud__day { text-align: right; }
.hud__daynum { display: block; font-weight: 700; font-variant-numeric: tabular-nums; }
.hud__week { display: block; font-size: 12px; color: var(--muted); }
.hud__stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; border-radius: var(--r-s); background: color-mix(in srgb, var(--fg) 5%, transparent); }
.stat__k { font-size: 10px; color: var(--muted); letter-spacing: .06em; }
.stat__v { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.stat--bad .stat__v { color: var(--bad); }
.lvbar { height: 3px; margin-top: 8px; background: color-mix(in srgb, var(--fg) 10%, transparent); border-radius: 2px; overflow: hidden; }
.lvbar i { display: block; height: 100%; background: var(--accent); transition: width .4s ease; }

.focus { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; }
.fchip {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 6px 2px; min-height: 40px;
  background: transparent; border: 1px solid var(--line); border-radius: var(--r-s);
  color: var(--muted); font-size: 12px; font-weight: 600;
}
.fchip b { font-size: 13px; }
.fchip.is-on { color: var(--accent-fg); background: var(--accent); border-color: var(--accent); }

.view { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px 14px 152px; -webkit-overflow-scrolling: touch; }

/* --- Стрічка дня ---------------------------------------------------------- */
.ticker { position: relative; height: 0; z-index: 4; display: flex; justify-content: center; pointer-events: none; }
.ticker__i {
  position: absolute; top: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--bg2); border: 1px solid var(--line);
  font-size: 12px; color: var(--muted); white-space: nowrap;
  box-shadow: var(--shadow);
  animation: tick-in .25s ease-out;
}
.ticker--good { color: var(--teal); border-color: color-mix(in srgb, var(--teal) 45%, var(--line)); }
@keyframes tick-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* --- Спливні числа -------------------------------------------------------- */
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 6; overflow: hidden; }
.float {
  position: absolute; bottom: 180px;
  font-weight: 700; font-size: 18px; color: var(--good);
  text-shadow: 0 2px 8px rgba(0,0,0,.35);
  animation: float-up 1.8s ease-out forwards;
}
.float--bad { color: var(--bad); }
@keyframes float-up {
  0% { opacity: 0; transform: translateY(10px) scale(.9); }
  15% { opacity: 1; transform: translateY(0) scale(1.05); }
  100% { opacity: 0; transform: translateY(-90px) scale(1); }
}

/* --- Нижній док ----------------------------------------------------------- */
.dock {
  position: fixed; z-index: 5;
  left: 50%; transform: translateX(-50%);
  bottom: calc(64px + var(--safe-b));
  width: min(94vw, 532px);
  display: grid; grid-template-columns: 52px 1fr 52px; gap: 8px;
}
.dock__play, .dock__speed {
  display: flex; align-items: center; justify-content: center;
  min-height: 50px; border-radius: 999px;
  background: var(--bg2); color: var(--fg);
  border: 1px solid var(--line); font-weight: 700;
  box-shadow: var(--shadow);
}
.dock__play.is-on { background: var(--teal); color: #06120f; border-color: var(--teal); animation: pulse 1.6s ease-in-out infinite; }
.dock__icon { font-size: 15px; line-height: 1; }
.dock__speed { font-size: 13px; }
.dock__next {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 50px; padding: 6px 12px;
  background: var(--accent); color: var(--accent-fg);
  border: 0; border-radius: 999px; box-shadow: var(--shadow);
}
.dock__t { font-weight: 700; font-size: 15px; }
.dock__d { font-size: 11px; opacity: .8; }
.dock__next:active { transform: translateY(1px); }
@keyframes pulse { 0%,100% { box-shadow: var(--shadow); } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--teal) 22%, transparent); } }

/* --- Таб-бар -------------------------------------------------------------- */
.tabs { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--bg2); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 6px; min-height: 52px; background: none; border: 0; color: var(--muted); }
.tab__i { font-size: 17px; line-height: 1; }
.tab__t { font-size: 11px; }
.tab.is-on { color: var(--accent); }
.tab.is-on::before { content: ''; position: absolute; top: 0; left: 22%; right: 22%; height: 2px; background: var(--accent); }
.tab__b { position: absolute; top: 4px; right: 20%; min-width: 16px; height: 16px; padding: 0 4px; background: var(--accent); color: var(--accent-fg); border-radius: 999px; font-size: 10px; font-weight: 700; line-height: 16px; }

/* --- Панелі --------------------------------------------------------------- */
.panel { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin-bottom: 12px; }
.panel__h { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
.panel__hrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.panel__hrow .panel__h { margin: 0; }
.rows { display: flex; flex-direction: column; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row > span:first-child { color: var(--muted); }
.row b { white-space: nowrap; }
.row--done > span:first-child { color: var(--fg); }
.empty { text-align: center; padding: 22px 10px; color: var(--muted); }

/* --- Мапа студії ---------------------------------------------------------- */
.map {
  position: relative;
  padding: 12px; margin-bottom: 12px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg3);
  overflow: hidden;
}
.map::before {
  content: ''; position: absolute; inset: 0;
  background-image: var(--wall); background-size: cover; background-position: center;
  opacity: .5;
}
/* У світлій темі бетонна стіна виглядала б чужою — там тонка технічна сітка. */
.map::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(color-mix(in srgb, var(--fg) 5%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--fg) 5%, transparent) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 85%);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .map::after { opacity: .4; } }
.map > * { position: relative; }
.map__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.map__h { font-size: 14px; text-transform: uppercase; letter-spacing: .1em; }
.map__sub { font-size: 12px; color: var(--muted); }

.grid-rooms { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.room {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  aspect-ratio: 3 / 2; padding: 0; overflow: hidden;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-s);
  color: var(--fg); text-align: left;
}
.room__art { position: absolute; inset: 0; background-image: var(--art); background-size: cover; background-position: center; transition: transform .5s ease; }
.room::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 28%, rgba(8,9,11,.9) 100%); }
.room:active .room__art { transform: scale(1.05); }
.room__body { position: relative; z-index: 2; padding: 7px 8px 9px; color: #fff; }
.room__name { display: block; font-weight: 700; font-size: 13px; }
.room__meta { display: block; font-size: 10.5px; opacity: .85; }

.room.is-live { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.room__glow {
  position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(120% 80% at 50% 20%, color-mix(in srgb, var(--accent) 45%, transparent) 0%, transparent 62%);
  animation: room-breathe 3.4s ease-in-out infinite;
}
@keyframes room-breathe { 0%,100% { opacity: .38; } 50% { opacity: .8; } }
.room__tag {
  position: absolute; top: 6px; left: 6px; z-index: 3;
  padding: 2px 7px; border-radius: 999px;
  background: var(--accent); color: var(--accent-fg);
  font-size: 10px; font-weight: 700;
}
.room__tag.is-off-site { background: var(--bg2); color: var(--muted); border: 1px solid var(--line); }
.room__crew { position: absolute; top: 6px; right: 6px; z-index: 3; display: flex; }
.room__face {
  width: 24px; height: 24px; border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(0,0,0,.5); margin-left: -8px;
  animation: bob 2.6s ease-in-out infinite;
}
.room__face:nth-child(2) { animation-delay: .4s; }
.room__face:nth-child(3) { animation-delay: .8s; }
.room__face:nth-child(4) { animation-delay: 1.2s; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
.room__bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; height: 3px; background: rgba(255,255,255,.16); }
.room__bar i { display: block; height: 100%; background: var(--accent); transition: width .45s ease; }

.room--empty, .room--locked {
  align-items: center; justify-content: center;
  border-style: dashed; color: var(--muted); background: color-mix(in srgb, var(--bg) 55%, transparent);
}
.room--empty::after, .room--locked::after { content: none; }
.room__plus { font-size: 26px; line-height: 1; }
.room__lock { font-size: 18px; }
.room__hint { font-size: 10.5px; }

.caps { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px; }
.cap { padding: 8px; border-radius: var(--r-s); background: color-mix(in srgb, var(--fg) 5%, transparent); }
.cap.is-on { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.cap__n { display: block; font-size: 11px; color: var(--muted); }
.cap__v { display: block; font-weight: 700; font-size: 12px; }

/* --- Картки --------------------------------------------------------------- */
.card { display: block; width: 100%; text-align: left; padding: 12px; margin-bottom: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); color: var(--fg); }
.card:last-child { margin-bottom: 0; }
.card--btn:active { border-color: var(--accent); }
.card.is-owned { border-color: color-mix(in srgb, var(--teal) 50%, var(--line)); }
.card.is-late { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); }
.card__top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.card__h { font-size: 15px; }
.card__sub { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.card__num { text-align: right; white-space: nowrap; }
.card__num b { display: block; font-size: 14px; }
.card__num span { font-size: 12px; color: var(--muted); }
.card__flavor { font-size: 13px; color: var(--muted); margin: 8px 0 0; font-style: italic; }
.card__foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 8px; }

.qline { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 6px; font-size: 12px; color: var(--muted); }
.qval { font-size: 18px; font-weight: 700; color: var(--fg); font-variant-numeric: tabular-nums; }
.qeta { margin-left: auto; }

.sbars { display: flex; flex-direction: column; gap: 4px; }
.sbar { display: grid; grid-template-columns: 70px 1fr 62px; align-items: center; gap: 8px; padding: 5px 6px; background: transparent; border: 1px solid transparent; border-radius: var(--r-s); color: var(--muted); font-size: 12px; text-align: left; }
.sbar.is-cur { border-color: var(--accent); color: var(--fg); }
.sbar.is-done .sbar__n { text-decoration: line-through; opacity: .6; }
.sbar__track { height: 6px; background: color-mix(in srgb, var(--fg) 10%, transparent); border-radius: 3px; overflow: hidden; }
.sbar__track i { display: block; height: 100%; background: var(--teal); transition: width .45s ease; }
.sbar.is-cur .sbar__track i { background: var(--accent); }
.sbar__v { text-align: right; font-variant-numeric: tabular-nums; }

/* --- Люди ----------------------------------------------------------------- */
.pwrap { padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.pwrap:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.person { display: flex; gap: 10px; width: 100%; text-align: left; padding: 0; background: none; border: 0; color: var(--fg); }
.person__ava { width: 56px; height: 56px; border-radius: var(--r-s); object-fit: cover; flex: none; background: var(--bg); }
.person__body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.person__top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.person__role { font-size: 11px; color: var(--accent); white-space: nowrap; }
.person__skill { font-size: 12px; color: var(--muted); }
.person__where { font-size: 12px; color: var(--muted); }
.person__where.is-work { color: var(--teal); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.tag { padding: 1px 6px; font-size: 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.pbars { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.mbar { display: grid; grid-template-columns: 58px 1fr 30px; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.mbar__t { height: 5px; background: color-mix(in srgb, var(--fg) 10%, transparent); border-radius: 3px; overflow: hidden; }
.mbar__t i { display: block; height: 100%; background: var(--teal); transition: width .4s ease; }
.mbar__t i.is-bad { background: var(--bad); }
.mbar__t i.is-warn { background: var(--warn); }
.mbar b { text-align: right; font-size: 11px; color: var(--fg); }

/* --- Сегменти ------------------------------------------------------------- */
.segs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.segs--3 { margin-bottom: 8px; }
.seg { padding: 10px 6px; min-height: 42px; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-s); color: var(--muted); font-size: 13px; font-weight: 600; }
.seg.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }

/* --- Пітч ----------------------------------------------------------------- */
.pcards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 12px; }
.pcard {
  display: flex; flex-direction: column; gap: 2px; text-align: left;
  padding: 9px 10px; min-height: 74px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-s); color: var(--fg);
  transition: border-color .15s, transform .15s;
}
.pcard.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg)); transform: translateY(-2px); }
.pcard__i { font-size: 15px; color: var(--accent); line-height: 1; }
.pcard__n { font-weight: 700; font-size: 13px; }
.pcard__d { font-size: 11px; color: var(--muted); }

.warnline { margin: 8px 0 0; padding: 8px 10px; border-radius: var(--r-s); font-size: 13px; color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }
.odds { margin-top: 12px; padding: 10px 12px; border-radius: var(--r-s); background: color-mix(in srgb, var(--fg) 5%, transparent); }
.odds__t { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted); }
.odds__t b { font-size: 20px; color: var(--fg); }
.odds__bar { height: 8px; margin-top: 6px; background: color-mix(in srgb, var(--fg) 12%, transparent); border-radius: 4px; overflow: hidden; }
.odds__bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--bad), var(--warn) 45%, var(--good)); transition: width .3s ease; }

.qbig { display: flex; flex-direction: column; align-items: center; margin-bottom: 10px; animation: pop .28s ease-out; }
.qbig b { font-size: 46px; line-height: 1; font-variant-numeric: tabular-nums; }
.qbig span { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.qbig.is-good b { color: var(--good); }
.qbig.is-low b { color: var(--bad); }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }

.ev__text { font-size: 15px; }

/* --- Модалка -------------------------------------------------------------- */
.modal { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.modal__scrim { position: absolute; inset: 0; background: rgba(6,7,9,.62); }
.modal__box {
  position: relative; z-index: 1; width: 100%; max-width: 560px; max-height: 88dvh;
  display: flex; flex-direction: column;
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0;
  box-shadow: var(--shadow); animation: sheet-in .2s ease-out;
}
@keyframes sheet-in { from { transform: translateY(20px); opacity: .3; } to { transform: none; opacity: 1; } }
.modal__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 14px 8px; }
.modal__h { font-size: 17px; }
.modal__x { width: 34px; height: 34px; background: none; border: 0; color: var(--muted); font-size: 16px; }
.modal__body { padding: 0 14px 12px; overflow-y: auto; overscroll-behavior: contain; }
.modal__art { width: 100%; border-radius: var(--r-s); margin-bottom: 10px; }
.modal__actions { display: flex; flex-direction: column; gap: 8px; padding: 10px 14px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); }
.pdet { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.pdet img { width: 76px; height: 76px; border-radius: var(--r-s); object-fit: cover; flex: none; }
.pdet p { margin: 0; }

.picks { display: flex; flex-direction: column; gap: 8px; }
.pick { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 10px 12px; min-height: 44px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-s); color: var(--fg); }
.pick.is-on { border-color: var(--accent); }
.pick__n { font-weight: 600; font-size: 14px; }
.pick__d { font-size: 12px; color: var(--muted); }
.pick__c { font-size: 12px; color: var(--accent); }

/* --- Журнал --------------------------------------------------------------- */
.logs { display: flex; flex-direction: column; gap: 6px; }
.logline { font-size: 12px; color: var(--muted); display: flex; gap: 8px; }
.logline span { font-family: var(--mono); font-size: 11px; opacity: .7; flex: none; }
.log--good { color: var(--good); }
.log--bad { color: var(--bad); }

/* --- Катсцена ------------------------------------------------------------- */
.scene { position: fixed; inset: 0; z-index: 40; background: #05070a; display: flex; align-items: center; justify-content: center; }
.scene__v { width: 100%; height: 100%; object-fit: cover; }
.scene__grad { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,7,10,.35) 0%, transparent 30%, transparent 55%, rgba(5,7,10,.92) 100%); }
.scene__cap { position: absolute; left: 0; right: 0; bottom: calc(56px + var(--safe-b)); padding: 0 24px; text-align: center; }
.scene__t { color: #fff; font-size: clamp(17px, 5vw, 22px); font-weight: 700; letter-spacing: .01em; margin: 0; text-shadow: 0 2px 14px rgba(0,0,0,.6); animation: cap-in .6s ease-out .3s both; }
@keyframes cap-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.scene__skip { position: absolute; top: calc(14px + var(--safe-t)); right: 14px; padding: 8px 14px; min-height: 40px; background: rgba(0,0,0,.45); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; font-size: 13px; font-weight: 600; }

/* --- Тост ----------------------------------------------------------------- */
.toast {
  position: fixed; z-index: 30; left: 50%; transform: translate(-50%, 12px);
  bottom: calc(126px + var(--safe-b)); max-width: min(92vw, 460px);
  padding: 10px 14px; background: var(--fg); color: var(--bg);
  border-radius: 999px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast--bad { background: var(--bad); color: #fff; }
.toast--good { background: var(--good); color: #fff; }

/* --- Повага до налаштувань ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (min-width: 480px) {
  .grid-rooms { grid-template-columns: repeat(3, 1fr); }
  body { font-size: 16px; }
}
