:root {
  --bg: #110f0d;
  --bg2: #1c1a17;
  --panel: #181613;
  --line: #312d28;
  --text: #f2eee7;
  --muted: #ab9e8a;
  --accent: #fd7e2f;
  --accent-soft: rgba(253, 126, 47, .14);
  --shoot: #6fb7ff;
  --view: #8be38b;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }
body { overflow: hidden; }
button { font: inherit; color: inherit; }

#app { display: grid; grid-template-columns: 1fr 360px; height: 100vh; height: 100dvh; }

#stage {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 90% at 40% 35%, #36322c 0%, #1b1916 55%, #0e0d0c 100%);
}
#scene { display: block; width: 100%; height: 100%; outline: none; touch-action: none; }

.title { position: absolute; left: 24px; top: 20px; max-width: 460px; pointer-events: none; }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.title h1 { margin: 4px 0 6px; font-size: 30px; font-weight: 700; letter-spacing: -.01em; }
.title h1 span { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.hint { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.sim-link {
  display: inline-block; margin-top: 12px; pointer-events: auto; text-decoration: none;
  background: var(--accent); color: #1a1007; font-weight: 650; font-size: 13.5px; padding: 8px 13px; border-radius: 9px;
}
.sim-link:hover { filter: brightness(1.08); }

.toolbar {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; align-items: center;
  padding: 6px; border-radius: 14px; background: rgba(24, 22, 19, .78);
  border: 1px solid var(--line); backdrop-filter: blur(10px); max-width: calc(100% - 32px);
}
.tb {
  border: 0; background: transparent; padding: 7px 11px; border-radius: 9px;
  font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tb:hover { background: #2e2a25; color: var(--text); }
.tb.toggle[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; flex: none; }
.tb-toggle { color: var(--muted); }
.tb-toggle .tb-open { display: none; }
.toolbar.min > :not(.tb-toggle) { display: none; }
.toolbar.min .tb-x { display: none; }
.toolbar.min .tb-open { display: inline; }
.tip-close {
  display: none; position: absolute; right: 6px; top: 6px; width: 32px; height: 32px;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 15px; cursor: pointer;
}

.tip {
  position: absolute; left: 0; top: 0; width: 320px; max-width: calc(100% - 24px);
  padding: 12px 14px 13px; border-radius: 12px;
  background: rgba(22, 20, 17, .94); border: 1px solid #433e36;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5); pointer-events: none;
  backdrop-filter: blur(8px); z-index: 5;
}
.tip-head { display: flex; gap: 10px; align-items: flex-start; }
.badge {
  flex: none; min-width: 34px; height: 26px; padding: 0 7px; border-radius: 7px;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
  background: #2e2a24; color: var(--text); border: 1px solid #4a443c;
}
.badge:empty { display: none; }
.tip-name { font-weight: 650; font-size: 15px; line-height: 1.25; }
.tip-alt { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tip-group { margin-top: 8px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.tip-body { margin-top: 5px; font-size: 13.5px; line-height: 1.5; color: #e4dbce; }
.tip-body .mode { display: grid; grid-template-columns: auto 1fr; gap: 8px; margin-top: 6px; }
.tip-body .mode b { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 5px; height: fit-content; }
.tip-body .m-shoot b { background: rgba(111, 183, 255, .15); color: var(--shoot); }
.tip-body .m-view b  { background: rgba(139, 227, 139, .15); color: var(--view); }

.loading {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted); font-size: 14px; pointer-events: none; transition: opacity .4s;
}
.loading.done { opacity: 0; }

#panel { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-left: 1px solid var(--line); }
.panel-head { padding: 18px 18px 12px; border-bottom: 1px solid var(--line); }
.ph-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.panel-head h2 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 6px; }
.count { font-size: 12px; font-weight: 600; color: var(--muted); background: #25221d; border-radius: 6px; padding: 1px 6px; }
.count:empty { display: none; }
.chev { display: none; color: var(--muted); font-size: 14px; transition: transform .25s; }
.sheet-handle { display: none; }
.hint-m { display: none; }
.lang { display: flex; gap: 2px; background: #25221d; border-radius: 8px; padding: 2px; }
.lang-b { border: 0; background: transparent; padding: 3px 9px; border-radius: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.lang-b[aria-pressed="true"] { background: #3a352e; color: var(--text); }
#search {
  width: 100%; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line);
  background: #141210; color: var(--text); font: inherit; font-size: 13.5px; outline: none;
}
#search:focus { border-color: #5d564b; }

#list { position: relative; flex: 1; overflow-y: auto; padding: 6px 10px 14px; overscroll-behavior: contain; }
.grp { margin: 12px 8px 4px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 0; background: transparent; padding: 7px 8px; border-radius: 9px; cursor: pointer;
}
.item:hover, .item.on { background: var(--accent-soft); }
.item.on .item-name { color: var(--accent); }
.item .badge { min-width: 40px; height: 22px; font-size: 10.5px; }
.item .badge.dot::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #847969; }
.item-name { font-size: 13.5px; line-height: 1.3; }
.item-alt { font-size: 11.5px; color: var(--muted); }
.item.hidden { display: none; }

.src { padding: 12px 18px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); line-height: 1.5; }
.src a { color: var(--text); }
.src .note { display: block; margin-top: 3px; }

@media (max-width: 860px) {
  :root { --sheet-min: 62px; --safe-b: env(safe-area-inset-bottom, 0px); }
  #app { display: block; }
  #stage { position: fixed; left: 0; right: 0; top: 0; height: calc(100dvh - var(--sheet-min) - var(--safe-b)); }

  .title { left: 16px; top: 12px; right: 16px; }
  .eyebrow, .hint { display: none; }
  .title h1 { font-size: 21px; margin: 0 0 2px; }
  .title h1 span { font-size: 13px; }
  .hint-m { display: block; margin: 0; font-size: 13px; color: var(--muted); }
  .sim-link { position: absolute; top: 0; right: 0; margin: 0; font-size: 12px; padding: 6px 10px; }

  /* панель видов — одна строка внизу, прокрутка вбок, можно свернуть */
  .toolbar {
    left: 10px; right: 10px; bottom: 10px; transform: none; max-width: none;
    flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; gap: 2px; padding: 5px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .toolbar::-webkit-scrollbar { display: none; }
  .toolbar.min { right: auto; }
  .tb { padding: 8px 10px; font-size: 13px; flex: none; }

  /* подсказка закреплена внизу экрана, над панелью видов */
  .tip {
    left: 10px; right: 10px; top: auto; width: auto; max-width: none;
    bottom: calc(var(--tb-h, 52px) + 18px); transform: none !important;
    pointer-events: auto; max-height: 42%; overflow-y: auto; padding-right: 40px;
  }
  .tip-close { display: block; }
  .tip-body { font-size: 13.5px; }

  /* список — выдвижная панель снизу */
  #panel {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    height: calc(var(--sheet-min) + var(--safe-b));
    padding-bottom: var(--safe-b);
    border-left: 0; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0;
    box-shadow: 0 -12px 32px rgba(0, 0, 0, .45);
    transition: height .28s ease;
    overflow: hidden;
  }
  #panel.open { height: 82dvh; }
  .sheet-handle {
    display: block; width: 100%; height: 18px; border: 0; background: transparent; padding: 0; cursor: pointer;
  }
  .sheet-handle span { display: block; width: 40px; height: 4px; border-radius: 2px; background: #4a443c; margin: 7px auto 0; }
  .panel-head { padding: 0 16px 10px; border-bottom: 1px solid transparent; }
  #panel.open .panel-head { border-bottom-color: var(--line); }
  .ph-row { margin-bottom: 12px; }
  .panel-head h2 { cursor: pointer; flex: 1; }
  .chev { display: inline; }
  #panel.open .chev { transform: rotate(180deg); }
  #search { font-size: 16px; padding: 10px 12px; }   /* 16px — без автозума на iOS */
  .item { padding: 9px 8px; }
}

/* ===== Стиль MVC (01.11.2026, Claude) — бренд-кит matis.academy: тёплый тёмный, Russo One + Montserrat, оранжевый акцент.
   Экран видоискателя и 3D-модель камеры не перекрашены — они повторяют настоящую камеру. ===== */
@font-face{font-family:"Montserrat";font-weight:600;unicode-range:U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;font-display:swap;src:url(https://matis.academy/wp-content/uploads/2026/10/Montserrat-SemiBold-cyrillic-ext.woff2) format("woff2");}
@font-face{font-family:"Montserrat";font-weight:600;unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;font-display:swap;src:url(https://matis.academy/wp-content/uploads/2026/10/Montserrat-SemiBold-cyrillic.woff2) format("woff2");}
@font-face{font-family:"Montserrat";font-weight:600;unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;font-display:swap;src:url(https://matis.academy/wp-content/uploads/2026/10/Montserrat-SemiBold-latin-ext.woff2) format("woff2");}
@font-face{font-family:"Montserrat";font-weight:600;unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;font-display:swap;src:url(https://matis.academy/wp-content/uploads/2026/10/Montserrat-SemiBold-latin.woff2) format("woff2");}
@font-face{font-family:"Montserrat";font-weight:400;unicode-range:U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;font-display:swap;src:url(https://matis.academy/wp-content/uploads/2026/10/Montserrat-Regular-cyrillic-ext.woff2) format("woff2");}
@font-face{font-family:"Montserrat";font-weight:400;unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;font-display:swap;src:url(https://matis.academy/wp-content/uploads/2026/10/Montserrat-Regular-cyrillic.woff2) format("woff2");}
@font-face{font-family:"Montserrat";font-weight:400;unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;font-display:swap;src:url(https://matis.academy/wp-content/uploads/2026/10/Montserrat-Regular-latin-ext.woff2) format("woff2");}
@font-face{font-family:"Montserrat";font-weight:400;unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;font-display:swap;src:url(https://matis.academy/wp-content/uploads/2026/10/Montserrat-Regular-latin.woff2) format("woff2");}
@font-face{font-family:"Russo One";font-weight:400;font-display:swap;src:url(https://matis.academy/wp-content/uploads/2026/10/RussoOne-Regular.ttf) format("truetype");}
:root { --bg: #151311; --bg2: #1d1a17; --panel: #1a1715; --card: #1d1a17; --line: rgba(241,236,226,.14); --text: #f1ece2; --muted: #9d9488;
  --accent: #fd7e2f; --accent-soft: rgba(253,126,47,.16); --font: Montserrat, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --head: "Russo One", Montserrat, sans-serif; }
html, body { background: var(--bg); }
* { scrollbar-width: thin; scrollbar-color: rgba(241,236,226,.24) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(241,236,226,.22); border-radius: 999px; border: 2px solid var(--bg); } ::-webkit-scrollbar-thumb:hover { background: rgba(253,126,47,.6); }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
input[type=range] { accent-color: var(--accent); }
#stage { background: radial-gradient(55% 70% at 92% 0%, rgba(253,126,47,.14), transparent 70%), radial-gradient(45% 60% at 0% 100%, rgba(137,74,31,.34), transparent 70%), radial-gradient(120% 90% at 40% 35%, #2a2520 0%, #171513 55%, #0f0d0c 100%); }
.eyebrow { font-weight: 600; letter-spacing: .14em; color: var(--accent); }
.title h1 { font-family: var(--head); font-weight: 400; text-transform: uppercase; letter-spacing: 0; line-height: 1.05; }
.title h1 span { font-family: var(--font); font-weight: 400; text-transform: none; }
.hint { color: #cfc6b8; }
.sim-link { border-radius: 999px; padding: 11px 20px; font-weight: 600; color: #151311; }
.sim-link:hover { filter: none; background: #ff8f45; }
.toolbar { border-radius: 20px; background: rgba(21,19,17,.82); }
.tb { border-radius: 999px; font-weight: 600; padding: 8px 14px; }
.tb:hover { background: rgba(241,236,226,.08); }
.tb.toggle[aria-pressed="true"] { background: var(--accent); color: #151311; }
.panel-head h2 { font-family: var(--head); font-weight: 400; text-transform: uppercase; letter-spacing: 0; }
.count { font-family: var(--font); }
.lang { border-radius: 999px; }
.lang-b { border-radius: 999px; font-weight: 600; }
.lang-b[aria-pressed="true"] { background: var(--accent); color: #151311; }
#search { border-radius: 999px; padding-left: 16px; background: rgba(241,236,226,.06); }
#search:focus { border-color: var(--accent); }
.grp { font-weight: 600; letter-spacing: .14em; color: var(--accent); }
.item { border-radius: 10px; }
.item .badge, .badge { border-radius: 6px; }
.tip { border-radius: 16px; }
.tip-name { font-family: var(--head); font-weight: 400; text-transform: uppercase; letter-spacing: 0; }
.src a { color: #f1ece2; text-decoration-color: var(--accent); }
.title h1 .alpha { font-style: normal; text-transform: none; }
@media (max-width: 860px) {
  .sim-link { padding: 7px 12px; font-size: 12px; }
  .title h1 { font-size: 20px; }
  .title h1 span { display: none; }
  .hint-m { padding-right: 150px; }
}
