@font-face{font-family:Lumen Sans;src:url('../vendor/fonts/Golos-Text-latin.woff2') format('woff2');font-style:normal;font-weight:400 900;font-display:swap;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-face{font-family:Lumen Sans;src:url('../vendor/fonts/Golos-Text-cyrillic.woff2') format('woff2');font-style:normal;font-weight:400 900;font-display:swap;unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:Lumen Mono;src:url('../vendor/fonts/IBM-Plex-Mono-latin.woff2') format('woff2');font-style:normal;font-weight:400;font-display:swap;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-face{font-family:Lumen Mono;src:url('../vendor/fonts/IBM-Plex-Mono-cyrillic.woff2') format('woff2');font-style:normal;font-weight:400;font-display:swap;unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
:root{
  color-scheme:dark;--deep:#020203;--base:#050506;--elevated:#0A0A0C;
  --accent:#5E6AD2;--on-accent:#FFFFFF;--text:#ECE9E4;--muted:#9A968F;--line:rgba(236,233,228,.14);
  --bg:var(--deep);--panel:var(--elevated);--ink:var(--text);
  --glass:rgba(10,10,12,.96);--error:#e4b8ab;--mono:Lumen Mono,monospace;
  font:400 16px/1.5 Lumen Sans,system-ui,sans-serif;color:var(--text);background:var(--deep);
}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;min-height:100dvh;background:var(--deep)}
button,input,summary{font:inherit}
p{max-width:65ch}h1,h2,h3,h4{font-weight:600;line-height:1.25}
button,summary,a,input{touch-action:manipulation}
button{min-width:44px;min-height:44px;padding:10px 14px;border:1px solid var(--muted);border-radius:6px;background:var(--elevated);color:var(--text);cursor:pointer;transition:opacity 150ms ease,transform 150ms ease}
button:hover:not(:disabled){opacity:.85}button:active:not(:disabled){opacity:.65;transform:translateY(1px)}
button:disabled{opacity:.4;cursor:default}
:where(button,summary,a,input,select,textarea,[tabindex]):focus-visible{outline:2px solid var(--accent);outline-offset:4px}
summary{min-width:44px;min-height:44px;cursor:pointer;padding:12px 0;color:var(--text);text-decoration:underline;text-underline-offset:4px}
a{color:var(--text)}
.site-header{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:24px max(24px,env(safe-area-inset-right)) 16px max(24px,env(safe-area-inset-left));font-size:14px}
.site-header span:first-child{font-size:20px;font-weight:600}.site-header span:last-child{color:var(--muted)}
main{min-width:0}.stage{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;padding:0 max(16px,env(safe-area-inset-right)) 0 max(16px,env(safe-area-inset-left));z-index:-1;background:var(--base)}
#view{height:100dvh;width:auto;max-width:100%;object-fit:contain;aspect-ratio:3/4;display:block;background:var(--base)}
#entry{position:relative;min-height:calc(100dvh - 160px);display:grid;place-items:center;padding:24px max(16px,env(safe-area-inset-right)) 32px max(16px,env(safe-area-inset-left));background:var(--deep)}
.entry-card{width:min(100%,460px);min-width:0;padding:32px;background:var(--elevated);border:1px solid var(--line);border-radius:12px}
.eyebrow{font-size:12px;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);margin:0}
.entry-card h1{font-size:clamp(48px,10vw,72px);letter-spacing:-.05em;margin:16px 0 8px}
.tagline{font-size:20px;margin:0}.steps{font-size:18px;line-height:1.5;margin:24px 0}.consent{font-size:16px;color:var(--muted);margin:0}.consent strong{color:var(--text);font-weight:400}
.loading{margin-top:24px}progress{display:block;width:100%;height:2px;border:0;background:var(--line);accent-color:var(--accent)}
progress::-webkit-progress-bar{background:var(--line)}progress::-webkit-progress-value{background:var(--accent)}progress::-moz-progress-bar{background:var(--accent)}
#load-label{font:12px/1.5 var(--mono);font-variant-numeric:tabular-nums;color:var(--muted);margin:12px 0}
button.primary{width:100%;min-height:48px;margin-top:8px;background:var(--accent);border-color:var(--accent);color:var(--on-accent);font-weight:600}
button.primary:hover:not(:disabled),button.primary:active:not(:disabled){opacity:1}
.conditions{font-size:13px;line-height:1.5;color:var(--muted);margin:20px 0 12px}
#entry-help{margin-top:8px}#entry-help summary{font-size:14px}
/* The expanded guide uses the screen width, independent of the 460px entry card. */
#entry-help[open]{position:relative;width:min(calc(100vw - 64px),1000px);left:50%;transform:translateX(-50%);background:var(--elevated);border-radius:8px}
.site-footer{position:relative;text-align:center;background:var(--deep);padding:16px 24px max(24px,env(safe-area-inset-bottom));margin:0;font-size:12px;color:var(--muted)}
.site-footer>span:nth-child(2){display:block}.text-button{border:0;background:transparent;text-decoration:underline;text-underline-offset:4px;color:var(--muted);font-size:13px;margin-top:8px}
.perform .site-header,.perform .site-footer{display:none}.perform .stage{z-index:0}
.camera-panel{position:absolute;top:max(16px,env(safe-area-inset-top));right:max(16px,env(safe-area-inset-right));margin:0}
.camera-preview{position:relative;width:144px;aspect-ratio:4/3;background:var(--base);border:1px solid var(--line);border-radius:6px;overflow:hidden}
#camera-video,#camera-overlay{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;transform:scaleX(-1)}#camera-overlay{pointer-events:none;background:transparent}
#perform-controls{position:absolute;bottom:max(16px,env(safe-area-inset-bottom));right:max(16px,env(safe-area-inset-right));left:max(16px,env(safe-area-inset-left));display:flex;justify-content:center;gap:8px;transition:opacity 200ms ease}
#perform-controls button{font-size:13px;background:var(--glass);backdrop-filter:blur(8px)}
#perform-controls>button:not([data-dialog]){flex:1;min-width:0;max-width:230px;overflow-wrap:anywhere}
#perform-controls.is-idle{opacity:0;pointer-events:none}#perform-controls:has(:focus-visible){opacity:1;pointer-events:auto}
.ui-icon{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle;flex:none}
.icon-button{display:inline-flex;align-items:center;justify-content:center;gap:8px}
#gesture-echo{position:absolute;bottom:max(80px,calc(env(safe-area-inset-bottom) + 64px));left:max(16px,env(safe-area-inset-left));display:flex;flex-direction:column;align-items:center;gap:6px;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--glass);pointer-events:none;max-width:min(360px,calc(100% - 32px));transition:opacity 200ms ease}
#gesture-echo .gesture-icon{width:40px;height:auto;flex:none}#gesture-echo .echo-name{font-size:12px;color:var(--text);text-align:center;overflow-wrap:anywhere}
#hand-hint,#screen-hint{position:absolute;left:16px;right:16px;max-width:none;text-align:center;font-size:13px;color:var(--text);pointer-events:none;background:var(--glass);margin:0;padding:8px}
#hand-hint{top:max(140px,calc(env(safe-area-inset-top) + 124px))}#screen-hint{top:max(184px,calc(env(safe-area-inset-top) + 168px))}#screen-hint:empty{display:none}
#error{position:fixed;z-index:5;bottom:max(16px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:min(calc(100% - 32px),600px);background:var(--elevated);border:1px solid var(--error);border-radius:8px;padding:24px;max-height:80dvh;overflow:auto;overflow-wrap:anywhere;color:var(--text)}
.error-icon{display:block;color:var(--error);margin-bottom:12px}
#error p{margin:0 0 16px}
dialog{color:var(--text);background:var(--elevated);border:1px solid var(--line);border-radius:12px;padding:24px;width:min(calc(100% - 32px),1080px);max-height:calc(100dvh - 32px);overflow:auto;overscroll-behavior:contain}
dialog::backdrop{background:rgba(2,2,3,.9)}dialog h2{font-size:28px;margin:16px 0 24px}.dialog-close{display:flex;margin-left:auto}
.gesture-grid{display:block}.gesture-group{margin:24px 0}.gesture-group-title{font-size:22px;margin:0 0 16px}.gesture-group-role{display:block;font-size:13px;line-height:1.5;font-weight:400;color:var(--muted);margin-top:6px}
.gesture-group-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:1fr;gap:12px}
.gesture-card{min-width:0;min-height:340px;border:1px solid var(--line);padding:14px;border-radius:8px;text-align:center;background:var(--elevated);overflow-wrap:anywhere}
.gesture-card-icon{height:72px;display:flex;align-items:center;justify-content:center}.gesture-card .gesture-icon{width:72px;height:auto}
.gesture-icon{display:block;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;color:var(--text)}
.gesture-hand-raised,.gesture-motion{stroke:var(--accent)}
.gesture-name{font-size:15px;margin:16px 0 8px}.gesture-pose,.gesture-note{font-size:12px;line-height:1.5;color:var(--muted);margin:8px 0}.gesture-effect{font-size:14px;line-height:1.5;margin:8px 0}
.orientation-hint,.debug-stats{display:none}
/* Existing manual controls retain their layout and behaviour. */
#debug-panel{padding:24px;background:var(--elevated);border-left:1px solid var(--line);min-width:0}.debug #debug-panel{position:fixed;right:0;top:0;bottom:0;overflow:auto;width:370px;max-height:100dvh;z-index:2}.debug .stage{right:370px}.debug #entry{margin-right:370px}.debug #entry-help[open]{width:100%}.debug .debug-stats{display:block;position:absolute;bottom:220px;left:16px;background:var(--glass);padding:12px;font:12px/1.5 var(--mono)}
.debug-stats,output,#count,.layer-note,.layer small,#channel-readout{font-family:var(--mono);font-variant-numeric:tabular-nums}
fieldset{border:0;padding:0;margin:0;min-width:0}fieldset:disabled{opacity:.5}legend,.hint,footer,.layer-note{font-size:12px;color:var(--muted)}legend{padding:16px 0}.panel-top,.layer-head{display:flex;justify-content:space-between;align-items:center;gap:8px}.panel-top h2{font-size:18px}.presets{display:grid;grid-template-columns:1fr 1fr;gap:8px}.settings,.layer{padding:16px 0;border-bottom:1px solid var(--line)}
label{display:block;font-size:13px}output{float:right;color:var(--text)}input[type=range]{display:block;width:100%;height:44px;margin:8px 0;accent-color:var(--accent);cursor:pointer}
.check{display:flex;align-items:center;gap:8px;min-height:44px;margin:8px 0}.check input{width:44px;height:44px;flex:none;margin:0;accent-color:var(--accent)}.check small,.layer small{font-size:12px;color:var(--muted)}.layer h3{font:13px var(--mono);overflow-wrap:anywhere}.layer.unavailable{opacity:.55}.layer-note{margin-top:8px}#channel-readout{white-space:pre-wrap;overflow-wrap:anywhere}
@media(min-width:700px){.gesture-group-cards{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(min-width:1000px){.gesture-group-cards{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:800px){
  .site-header{padding:16px;align-items:flex-start}.site-header span:last-child{font-size:12px;text-align:right;max-width:160px}
  .entry-card{padding:24px}#entry-help[open]{width:calc(100vw - 64px)}
  .camera-preview{width:128px}#gesture-echo{left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 32px)}
  #perform-controls button{padding:10px 8px;font-size:12px}
  dialog{padding:16px}.gesture-card{padding:12px}.gesture-name{font-size:14px}
  .debug .stage{right:0}.debug #entry{margin-right:0}.debug #debug-panel{top:auto;height:55dvh;width:100%;border-top:1px solid var(--line)}.debug.perform #perform-controls{bottom:calc(55dvh + 16px)}
}
@media(orientation:landscape) and (max-height:500px){
  .camera-preview{width:128px}#gesture-echo{left:max(16px,env(safe-area-inset-left));transform:none;bottom:max(16px,env(safe-area-inset-bottom));max-width:180px}
  #perform-controls{left:212px;justify-content:flex-end}#hand-hint,#screen-hint{left:212px;right:160px;top:16px}#screen-hint{top:80px}
}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;scroll-behavior:auto!important;transition-property:opacity!important;transition-duration:150ms!important}
  button:active:not(:disabled){transform:none}
}

/* раскладка режима показа: кадр, кнопки, значок жеста — значок не на кадре (решение Кости 12.09) */
.perform .stage{display:flex;flex-direction:column;align-items:center;justify-content:center}
.perform #view{height:calc(100svh - 150px)}
.perform #perform-controls{position:static;order:2;margin-top:12px;width:auto;padding:0;bottom:auto}
.perform #gesture-echo{position:static;order:3;transform:none;left:auto;bottom:auto;margin:10px 0 max(12px,env(safe-area-inset-bottom));max-width:min(92vw,420px);background:transparent;border-color:transparent;backdrop-filter:none;color:var(--ink)}
.perform #hand-hint{position:static;order:4;margin-top:6px}
.perform #screen-hint{position:static;order:5;margin-top:4px}

/* место под значок жеста и подсказку резервируется всегда — иначе их появление двигает кадр (Костя 12.09) */
.perform #gesture-echo{min-height:56px;align-items:center;justify-content:center}
.perform #gesture-echo[hidden]{display:flex!important;visibility:hidden}
.perform #hand-hint{min-height:18px}
.perform #hand-hint[hidden]{display:block!important;visibility:hidden}
.perform #screen-hint{min-height:0}
/* значок текущего жеста снят по решению Кости 12.09 (двигал кадр, некрасиво). Разметка и код оставлены, включается снятием этой строки. */
#gesture-echo{display:none!important}
/* подсказки под кадром не должны двигать раскладку: место занято всегда, меняется только видимость (Костя 12.09) */
.perform #hand-hint,.perform #screen-hint{min-height:20px;margin-top:6px}
.perform #hand-hint[hidden],.perform #screen-hint[hidden]{display:block!important;visibility:hidden}
.perform #screen-hint:empty{display:block!important;visibility:hidden}
/* кадр одного размера до и после включения камеры; экран входа — поверх, не в потоке (Костя 12.09: «когда выключаю, кадр дёргается») */
#view{height:calc(100svh - 150px)}
#entry{position:fixed;inset:0;z-index:4;overflow:auto;background:#100e0df2;min-height:0}
.debug #entry{margin-right:0}
@media(max-width:800px){#view{height:calc(100svh - 150px);width:auto;max-width:100%}}
/* шапка и подвал в показе прячутся по видимости, а не по месту — иначе кадр прыгает на 101 px при включении и выключении камеры */
.perform .site-header,.perform .site-footer{display:flex!important;visibility:hidden}
/* раскладка кадра одинакова до и после включения камеры: кнопки и подсказки всегда занимают место, меняется только видимость */
.stage{display:flex;flex-direction:column;align-items:center;justify-content:center}
#perform-controls{position:static;order:2;margin-top:12px;width:auto;padding:0;min-height:44px;bottom:auto}
#perform-controls[hidden]{display:flex!important;visibility:hidden}
#hand-hint,#screen-hint{position:static;left:auto;right:auto;bottom:auto;min-height:20px;margin-top:6px;text-align:center}
#hand-hint{order:4}#screen-hint{order:5}
#hand-hint[hidden],#screen-hint[hidden],#screen-hint:empty{display:block!important;visibility:hidden}
/* нижняя область кадра фиксированной высоты в обоих режимах — иначе кадр смещается при включении и выключении камеры */
#gesture-echo,.perform #gesture-echo,.perform #gesture-echo[hidden]{display:none!important}
#perform-controls{height:52px;align-items:center}
#hand-hint,#screen-hint{height:20px;overflow:hidden;line-height:20px;margin-top:6px}
/* 10.10.2026: подсказка о руках — две строки (вторая про системные видеоэффекты), место занято всегда — кадр не прыгает */
/* старое padding:8px при фиксированной высоте и border-box обрезало строку — по вертикали отступа нет */
#hand-hint,#screen-hint{padding-top:0;padding-bottom:0}
#hand-hint{height:40px;font-size:12px;white-space:pre-line}
/* узкий экран: до 4 строк (испанский); кадр короче на ту же высоту — на телефоне он ограничен шириной и не меняется */
@media(max-width:800px){#hand-hint{height:80px}#view{height:calc(100svh - 210px)}}
.dialog-note{font-size:14px;line-height:1.5;color:var(--muted);margin:0 0 8px}
/* кнопка звука (только демо со звуком): видна весь показ, вне самоскрывающейся панели */
/* 11.10.2026: звук и переключатель режимов Show / My hands — всегда видны в левом верхнем углу показа */
.show-controls{position:absolute;top:max(16px,env(safe-area-inset-top));left:max(16px,env(safe-area-inset-left));z-index:3;display:flex;flex-wrap:wrap;align-items:flex-start;gap:8px;max-width:calc(100% - 200px)}
.sound-toggle{font-size:13px;background:var(--glass);backdrop-filter:blur(8px)}
.mode-switch{display:inline-flex;border:1px solid var(--muted);border-radius:6px;background:var(--glass);backdrop-filter:blur(8px)}
.mode-switch button{border:0;border-radius:5px;min-height:44px;font-size:13px;background:transparent;padding:10px 12px}
.mode-switch button[aria-pressed="true"]{background:var(--accent);color:var(--on-accent);font-weight:600}
.mode-switch button.is-invited{box-shadow:0 0 0 2px var(--accent);animation:invite-pulse 1.6s ease-in-out infinite}
@keyframes invite-pulse{50%{box-shadow:0 0 0 6px rgba(94,106,210,.35)}}
.mode-invite{flex-basis:100%;margin:0;padding:6px 10px;font-size:12px;line-height:1.5;border-radius:6px;background:var(--glass);color:var(--text);max-width:280px}
/* меньше движения: без пульсации и без подсветки — только текст */
@media(prefers-reduced-motion:reduce){.mode-switch button.is-invited{animation:none;box-shadow:none}}
/* узкий экран: кнопка звука — только значок (подпись остаётся для чтения с экрана), переключатель под ней */
@media(max-width:800px){.show-controls{flex-direction:column;max-width:calc(100% - 176px)}.sound-toggle span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.mode-switch button{font-size:12px;padding:10px 8px}}
.sound-toggle[aria-pressed="true"]{border-color:var(--accent)}
.sound-toggle .sound-off,.sound-toggle[aria-pressed="true"] .sound-on{display:none}
.sound-toggle[aria-pressed="true"] .sound-off{display:inline}
