/* телефон */

:root {
  --marquee-band-h: clamp(84px, 21vw, 120px);
  --marquee-band-item: clamp(66px, 16.5vw, 96px);
}

@media (max-width: 768px) {
  .totem-marquee-panel {
    display: none !important;
  }

  .totem-marquee-band {
    position: fixed;
    left: 0;
    right: 0;
    height: var(--marquee-band-h);
    z-index: 5;
    pointer-events: none;
    overflow: hidden;
    contain: layout style paint;
    isolation: isolate;
    transform: translate3d(0, 0, 0);
    background: rgba(12, 10, 8, 0.5);
    border-color: rgba(0, 0, 0, 0.65);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 10%, #000 90%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, #000 10%, #000 90%, transparent 100%);
  }

  .totem-marquee-band--top {
    top: 0;
    border-bottom: 2px solid #1a1510;
  }

  .totem-marquee-band--bottom {
    bottom: 0;
    border-top: 2px solid #1a1510;
  }

  .totem-marquee-track--horizontal {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: clamp(12px, 3.75vw, 21px);
    height: 100%;
    width: max-content;
    padding: 0 10px;
    box-sizing: border-box;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
  }

  .totem-marquee-band .totem-marquee-item {
    width: var(--marquee-band-item);
    height: var(--marquee-band-item);
    flex: 0 0 auto;
  }

  .totem-marquee-track--horizontal.totem-marquee-track--left:not(.totem-marquee-track--loading) {
    animation: totem-marquee-x-left 16s linear infinite;
  }

  .totem-marquee-track--horizontal.totem-marquee-track--right:not(.totem-marquee-track--loading) {
    animation: totem-marquee-x-right 16s linear infinite;
  }

  body.landing-with-marquee {
    padding-top: var(--marquee-band-h);
    padding-bottom: var(--marquee-band-h);
  }

  body.landing-with-marquee .app-shell,
  body.landing-with-marquee .preview-header {
    z-index: 2;
  }

  .frame-picker-modal__backdrop {
    left: 0;
    right: 0;
  }

  body[data-i18n-page="getting_skin"] .site-top-bar,
  body[data-i18n-page="index"] .site-top-bar {
    top: calc(var(--marquee-band-h) + 10px);
    left: 10px;
    right: 10px;
  }

  body[data-i18n-page="getting_skin"] .site-top-bar--lang-only,
  body[data-i18n-page="index"] .site-top-bar--lang-only {
    justify-content: flex-end;
  }

  body[data-i18n-page="getting_skin"] .site-top-bar .lang-switcher,
  body[data-i18n-page="index"] .site-top-bar .lang-switcher {
    position: relative;
    top: auto;
    right: auto;
    z-index: auto;
  }

  .device-pick-page > .lang-switcher {
    top: 16px;
    right: 10px;
    z-index: 500;
  }

  .layout-switcher {
    top: calc(var(--marquee-band-h) + 10px);
    left: 10px;
    z-index: 300;
  }

  body.has-site-support:not(.editor-page) {
    display: flex;
    flex-direction: column;
    padding-bottom: var(--marquee-band-h);
    min-height: 100vh;
    box-sizing: border-box;
  }

  body.has-site-support:not(.editor-page) .site-support-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(var(--marquee-band-h) + 10px);
    transform: none;
    width: auto;
    max-width: none;
    margin: 0;
    z-index: 450;
    flex-shrink: 0;
  }

  body[data-i18n-page="getting_skin"].has-site-support:not(.editor-page) .site-support-bar {
    z-index: 450;
  }

  body.has-site-support:not(.editor-page) .app-shell {
    order: 1;
    flex: 1;
    min-height: 0;
  }

  body.has-site-support:not(.editor-page) .site-support-bar .btn--site-support {
    font-size: 10px;
    padding: 14px 12px 12px;
  }

  .landing-hero {
    min-height: calc(100vh - var(--marquee-band-h) * 2 - 120px);
    padding: 8px 14px 16px;
    justify-content: center;
  }

  .landing-hero > .landing-subtitle {
    margin-bottom: 10px;
    font-size: 7px;
  }

  .landing-panel {
    max-width: none;
    width: 100%;
    padding: 22px 16px;
  }

  .landing-panel h1 {
    font-size: clamp(9px, 3.2vw, 12px);
    line-height: 1.55;
  }

  .landing-panel .lead,
  .landing-panel .landing-intro {
    font-size: 8px;
    line-height: 1.65;
    margin-bottom: 12px;
  }

  .landing-panel .landing-note {
    font-size: 7px;
    line-height: 1.6;
    margin-bottom: 16px;
  }

  .preview-header {
    position: fixed;
    top: var(--marquee-band-h);
    left: 0;
    right: 0;
    height: 48px;
    z-index: 40;
    padding: 0 12px;
  }

  .preview-header a {
    font-size: 8px;
    padding: 8px 10px;
  }

  body.landing-with-marquee:not(.editor-page) .app-shell[style] {
    min-height: auto !important;
    padding-top: calc(var(--marquee-band-h) + 52px);
    padding-bottom: calc(var(--marquee-band-h) + 76px);
    padding-left: 12px;
    padding-right: 12px;
    justify-content: center;
    align-items: center;
  }

  #previewContainer.preview-step--form-only {
    max-width: none;
    padding-top: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .controls-card--resource-pack {
    padding: 20px 14px 18px;
    gap: 14px;
  }

  .controls-card--resource-pack label {
    font-size: 9px;
  }

  .controls-card--resource-pack .hint {
    font-size: 7px;
    line-height: 1.6;
  }

  .controls-card--resource-pack .grid-2 {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
  }

  .controls-card--resource-pack .pack-icon-row {
    flex-direction: column;
    align-items: center;
  }

  .controls-card--resource-pack .pack-icon-upload-row {
    flex-direction: column;
    width: 100%;
  }

  .controls-card--resource-pack .btn--pack-icon {
    width: 100%;
    font-size: 8px;
  }

  .export-card--done {
    margin-top: 8px;
    padding: 22px 16px;
  }

  .export-done-title {
    font-size: 11px;
  }

  .export-done-desc {
    font-size: 8px;
  }

  body[data-i18n-page="done"].landing-with-marquee {
    padding-top: var(--marquee-band-h);
    padding-bottom: var(--marquee-band-h);
    box-sizing: border-box;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }

  body[data-i18n-page="done"] .app-shell {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--marquee-band-h) + 16px) 12px calc(var(--marquee-band-h) + 16px);
    position: relative;
    z-index: 10;
  }

  body.export-ready--mobile .export-download-btn {
    display: block;
    width: 100%;
    max-width: none;
    margin-top: 12px;
    padding: 14px 16px 12px;
    font-size: 10px;
    box-sizing: border-box;
  }

  body.export-ready--mobile .export-done-desc {
    margin-bottom: 12px;
  }

  .editor-page {
    --editor-chrome-h: 50px;
    --editor-sidebar-w: 50px;
    --editor-preview-w: 100%;
  }

  body.editor-page.has-site-support {
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    height: 100vh;
    overflow: hidden;
    box-sizing: border-box;
  }

  body.editor-page .editor-header--dock {
    position: sticky;
    top: 0;
    flex-shrink: 0;
    z-index: 50;
    margin-top: 0;
  }

  body.editor-page .editor-body {
    position: relative;
    flex: 1;
    min-height: 0;
    margin-top: 0;
    flex-direction: row;
    overflow: hidden;
  }

  .editor-page .editor-header .btn-header-support {
    display: none;
  }

  .editor-page .editor-header .btn--ghost {
    font-size: 6px;
    padding: 5px 4px;
    line-height: 1.35;
    max-width: 48px;
  }

  body.editor-page .totem-marquee-band,
  body.editor-page .totem-marquee-panel {
    display: none !important;
  }

  .editor-page .sidebar--dock {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    height: auto;
    padding-top: 0;
    z-index: 25;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .editor-page .canvas-container {
    padding-top: 0;
    box-sizing: content-box;
    contain: layout paint;
    transform: translateZ(0);
    touch-action: pan-y;
  }

  .editor-workspace {
    flex-direction: column;
    align-items: center;
  }

  .editor-preview-panel--frame-tail {
    position: relative;
    width: calc(100% - 8px);
    max-width: none;
    margin: 12px auto 0;
    margin-left: auto;
    margin-right: auto;
    padding: 12px 14px 14px;
    border-left: none;
    border-top: none;
    border: 2px solid #000;
    outline: 2px solid #555;
    box-shadow: var(--mc-panel-inset), var(--shadow-lg);
  }

  .editor-preview-panel--frame-tail .preview-rotate-mode {
    display: none;
  }

  .editor-page .viewport {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
    padding: 0;
  }

  .editor-page .editor-workspace {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    width: 100%;
  }

  .editor-page .editor-wrapper {
    flex: 0 0 auto;
    min-height: auto;
    overflow: visible;
    justify-content: center;
  }

  .editor-page #editorCanvas {
    transform: translateZ(0);
  }

  .editor-page .frame-highlight {
    transform: translateZ(0);
    will-change: top;
  }

  .editor-page .editor-preview-panel--frame-tail {
    flex-shrink: 0;
  }

  .totem-marquee-band {
    z-index: 400;
  }

  .frame-picker-modal {
    padding: var(--marquee-band-h) 10px var(--marquee-band-h);
    z-index: 350;
  }

  .frame-picker-modal__backdrop {
    top: var(--marquee-band-h);
    bottom: var(--marquee-band-h);
    left: 0;
    right: 0;
  }

  body.editor-page .frame-picker-modal {
    padding: 12px 10px;
  }

  body.editor-page .frame-picker-modal__backdrop {
    top: 0;
    bottom: 0;
  }

  .btn-header-resource-pack__full {
    display: none;
  }

  .btn-header-resource-pack__short {
    display: inline;
  }

  .editor-page .editor-header .btn-header-resource-pack {
    font-size: 8px;
    padding: 8px 10px 6px;
    max-width: none;
    white-space: nowrap;
    line-height: 1.35;
    text-align: center;
  }

  .editor-page .hist-row--header .hist-btn {
    width: 34px;
    height: 34px;
  }

  .sidebar--dock {
    width: var(--editor-sidebar-w);
    padding: 8px 0 10px;
    gap: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .editor-page .sidebar--dock .color-wheel {
    width: 28px;
    height: 28px;
    margin: 0;
  }

  .editor-page .sidebar--dock .active-colors {
    width: 32px;
    height: 32px;
    margin: 2px 0;
  }

  .editor-page .sidebar--dock .palette {
    justify-content: center;
    grid-template-columns: repeat(2, 14px);
    gap: 5px 7px;
  }

  .editor-page .sidebar--dock .tool-btn {
    width: 36px;
    height: 30px;
    min-height: 30px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .editor-page .sidebar--dock .tool-btn img {
    width: 30px;
    height: 22px;
    object-fit: contain;
  }

  .editor-page .sidebar--dock .size-control {
    width: 44px;
    padding: 0;
    margin-top: 4px;
    align-items: center;
  }

  .editor-page .sidebar--dock .size-control input[type="range"] {
    width: 40px;
  }

  .sidebar-support-mobile {
    display: flex;
    margin-top: auto;
  }

  .tool-btn {
    width: 40px;
    height: 32px;
    min-height: 32px;
  }

  .tool-btn img {
    width: 36px;
    height: 26px;
  }

  .size-control {
    width: 100%;
    padding: 0 4px;
  }

  .size-control label {
    font-size: 5px;
  }

  .size-control strong {
    font-size: 5px;
  }

  .frame-picker-modal {
    padding: calc(var(--marquee-band-h) + 12px) 12px calc(var(--marquee-band-h) + 12px);
  }

  .frame-picker-value {
    font-size: 12px;
  }

  .scene--frame-picker {
    width: min(200px, 72vw);
    height: min(200px, 52vw);
  }

  .editor-page .viewport.viewport--with-sidebar {
    margin-left: var(--editor-sidebar-w);
    margin-right: 0;
    width: calc(100% - var(--editor-sidebar-w));
    min-height: 0;
    overflow: hidden;
  }

  .viewport--with-preview {
    margin-right: 0;
  }

  .editor-preview-panel--dock {
    position: relative;
    top: auto;
    right: auto;
    width: calc(100% - var(--editor-sidebar-w));
    margin-left: var(--editor-sidebar-w);
    height: auto;
    min-height: 0;
    border-left: none;
    border-top: 2px solid #000;
    box-shadow: none;
    padding: 12px 10px 16px;
  }

  .editor-page .sidebar--dock #zoomBtn,
  .editor-page .sidebar--dock .tool-btn[data-tool="zoom"] {
    display: none !important;
  }

  .scene--editor-preview {
    width: 100%;
    max-width: 100%;
    height: min(300px, 46vh);
    min-height: 280px;
    max-height: 320px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .scene--editor-preview #totemStack {
    width: 100%;
    height: 100%;
    max-width: 260px;
    max-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .scene--editor-preview .totem-preview-host {
    transform: none;
    transform-origin: center center;
  }

  .labels-column {
    display: none !important;
  }

  .editor-wrapper {
    justify-content: center;
  }

  .editor-page .viewport {
    justify-content: center;
    align-items: center;
  }

  body.editor-page .editor-body {
    flex-direction: row;
    overflow: hidden;
  }

  .frame-label {
    font-size: 7px;
  }

  .editor-page .btn-support-vertical {
    display: flex;
  }
}

@keyframes totem-marquee-x-left {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(calc(0px - var(--marquee-shift, 0px)), 0, 0);
  }
}

@keyframes totem-marquee-x-right {
  from {
    transform: translate3d(calc(0px - var(--marquee-shift, 0px)), 0, 0);
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

@media (min-width: 769px) {
  html:not(.layout-mobile-active) .sidebar-support-mobile {
    display: none !important;
  }

  html:not(.layout-mobile-active) .totem-marquee-band {
    display: none !important;
  }
}

.btn-support-vertical {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 40px;
  min-height: 120px;
  padding: 8px 4px;
  margin-top: 8px;
  font-size: 8px;
  line-height: 1;
  text-transform: none;
  text-decoration: none;
  text-align: center;
  box-sizing: border-box;
}

.btn-support-vertical__char {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .totem-marquee-track--horizontal.totem-marquee-track--left,
  .totem-marquee-track--horizontal.totem-marquee-track--right {
    animation: none;
  }
}
