:root {
  --bg-color: #f8f9fa;
  --sidebar-color: #ffffff;
  --pantone-yellow: #fedd00;
  --volcanic-grass: #3b3a36;
  --border-radius: 8px;
  --top-gap: 20px;
  --footer-height: 45px;
  --editor-shell-gap: 20px;
  --editor-mobile-header-offset: 68px;
  --editor-mobile-topbar-height: 74px;
  --editor-mobile-sheet-gap: 16px;
  --landing-hero-image: url("../assets/images/landing/dreamboard-wallpaper.jpg");

  --landing-bg: #ececec;
  --landing-bg-2: #f3f3f3;
  --landing-text-dark: #2b2b2b;
  --landing-text-mid: #6b6b6b;
}

body,
html {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "DM Sans", sans-serif;
  background-color: var(--bg-color);
  overflow: hidden;
}

/* =========
           LANDING
           ========= */

.landing-view {
  position: relative;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--landing-bg);
  box-sizing: border-box;

  /* Slides handle header/footer spacing to keep each screen at 100% height */
  padding-top: 0;
  padding-bottom: 0;

  /* One-screen-per-slide */
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

.landing-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 300;

  /* Match editor logo offset to avoid "jump" */
  padding: calc(25px + env(safe-area-inset-top)) 25px 10px 25px;

  /* Keep readable over images without darkening them */
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: auto;
}

.landing-header-inner {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.landing-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Заголовок + кнопка языка как в редакторе */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.editor-mobile-topbar {
  display: none;
}

.editor-mobile-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.editor-mobile-brand {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--volcanic-grass);
  text-transform: uppercase;
}

.editor-mobile-lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 40px;
  border-radius: 20px;
  padding: 0 14px;
  border: 1px solid #e6e6e6;
  background: #fff;
  color: var(--volcanic-grass);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.08);
}

h1 {
  font-size: 28px;
  margin: 0;
  font-weight: 700;
  letter-spacing: -1.5px;
}

.landing-header h1,
.sidebar-header h1 {
  display: inline-flex;
  align-items: center;
}

.lang-switcher button {
  background: transparent !important;
  color: #888 !important;
  border: 1px solid #eee !important;
  padding: 8px 12px !important;
  cursor: pointer;
  font-weight: 700;
  border-radius: 6px;
  font-family: "DM Sans", sans-serif;
  text-transform: uppercase;
  font-size: 12px !important;
  line-height: 1;
  min-width: 44px;
}

.lang-switcher button:hover {
  border-color: #ccc !important;
  color: #000 !important;
}

.landing-section {
  width: 100%;
  box-sizing: border-box;

  /* Exactly one screen per slide (full viewport height). */
  height: calc(var(--landing-vh, 1vh) * 100);

  /* Reserve space for fixed header + footer inside each slide */
  padding-top: var(--landing-header-h, 0px);
  padding-bottom: var(--footer-height);

  /* Layout */
  display: flex;
  align-items: center;

  /* Snap scrolling */
  scroll-snap-align: start;
  scroll-snap-stop: always;

  /* Default horizontal padding (like editor) */
  padding-left: 25px;
  padding-right: 25px;
}

.landing-section.bg-1 {
  background: var(--landing-bg);
}

.landing-section.bg-2 {
  background: var(--landing-bg-2);
}

.landing-wrap {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
}

.landing-wrap-full {
  max-width: none;
}

/* Shared left anchor (desktop only) */
@media (min-width: 901px) {
  .landing-left-anchor {
    margin-left: 50px;
    text-align: left;
  }

  /* Unified landing title container shift (slides 1, 3, 4) */
  .landing-title-unified {
    margin-left: 50px;
    width: calc(100% - 50px);
    text-align: left;
    box-sizing: border-box;
  }
  @media (max-width: 480px) {
    .landing-title-unified {
      margin-left: 20px;
      width: calc(100% - 20px);
    }
  }
}

@media (max-width: 900px) {
  .landing-left-anchor {
    margin-left: 0;
  }
}

.hero-center {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Title on slide 1 and 4: left aligned, button centered below */
.hero-title-center,
.hero-title-final {
  align-self: flex-start;
  max-width: 980px;
}

.cta-btn-center {
  align-self: center;
  margin-top: 26px;
}

/* Fullscreen background image for slide 1 and 4 */
.landing-section.bg-hero {
  background-image:
    radial-gradient(
      circle at top,
      rgba(255, 255, 255, 0.5),
      rgba(255, 255, 255, 0.08) 32%,
      rgba(24, 24, 24, 0.1) 100%
    ),
    var(--landing-hero-image),
    linear-gradient(135deg, #ebe5dc 0%, #d8d4cc 48%, #c1b8ac 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Slide 2 photo layout */
.landing-two-col-what {
  height: 100%;
  width: 100%;
}

.slide-visual-photo {
  height: 100%;
  max-height: calc(
    var(--landing-vh, 1vh) * 100 - var(--footer-height) -
      var(--landing-header-h, 0px) - 40px
  );
  border-radius: 26px;
  overflow: visible; /* allow title to go outside the image */
  background: none;
  box-shadow: none;
  position: relative;
}

.slide-visual-photo .slide-photo {
  width: 100%;
  height: 100%;
  object-fit: cover; /* crop */
  border-radius: 26px;
  display: block;
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.slide-overlay-title {
  position: absolute;
  left: 58%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, 96%);
  font-size: clamp(38px, 5vw, 72px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1.6px;
  color: rgb(224, 224, 224);
  pointer-events: none;
  user-select: none;
  z-index: 2;
  white-space: normal; /* allow 2 lines */
}

/* Slide 3 title sizing to match other screens */
.rules-title-landing {
  font-size: clamp(30px, 4.8vw, 58px);
  line-height: 1.05;
  letter-spacing: -1.5px;
  margin: 0 0 18px 0;
  color: var(--landing-text-dark);
  font-weight: 800;
}

/* Slide 3 layout: keep title + rules visible within 100vh, allow internal scroll on small screens */
#slide3 .landing-wrap {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 18px;
  overflow-y: auto;
  max-height: 100%;
  width: 100%;
}

#slide3 .rules-list {
  margin: 0;
  width: 100%;
  max-width: 900px;
}

/* Slide 3 rules: shift left + smaller bullets */
@media (min-width: 901px) {
  .rules-list-landing {
    margin-left: 50px;
  }
}

.rules-list-landing li::before {
  font-size: 8px; /* 2x smaller */
}

/* Keep arrow button stronger but not affecting editor */
.arrow-only-strong svg {
  width: 34px;
  height: 34px;
}

/* Mobile: keep everything within the viewport */
@media (max-width: 900px) {
  .landing-section {
    padding: 0 16px;
  }

  .slide-overlay-title {
    left: 50%;
    width: 96%;
    font-size: clamp(30px, 8vw, 48px);
  }
}

.landing-hero {
  min-height: calc(100vh - 140px);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: center;
}

.hero-title {
  font-size: clamp(30px, 4.8vw, 58px);
  line-height: 1.05;
  letter-spacing: -1.5px;
  color: var(--landing-text-dark);
  margin: 0 0 18px 0;
  font-weight: 800;
}

.hero-sub {
  color: var(--landing-text-mid);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 26px 0;
  max-width: 560px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.cta-btn {
  height: 54px;
  padding: 0 26px;
  border-radius: 999px;
  border: none;
  background: var(--pantone-yellow);
  color: #000;
  font-weight: 800;
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.1),
    0 2px 6px rgba(0, 0, 0, 0.08);
}

.cta-btn:hover {
  opacity: 0.95;
}

.hero-visual {
  position: relative;
  width: 100%;
  min-height: 420px;
  border-radius: 26px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.6),
    rgba(255, 255, 255, 0.12)
  );
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  overflow: hidden;
}

.hero-visual .soft-text {
  position: absolute;
  left: 18px;
  top: 18px;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -1.5px;
  color: rgba(255, 255, 255, 0.6);
  mix-blend-mode: overlay;
  user-select: none;
  pointer-events: none;
  line-height: 0.9;
}

.hero-visual .hero-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.landing-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: center;
}

.slide-title {
  font-size: clamp(22px, 3.4vw, 40px);
  line-height: 1.08;
  letter-spacing: -1.2px;
  margin: 0 0 14px 0;
  color: var(--landing-text-dark);
  font-weight: 800;
}

.slide-kicker {
  font-size: 14px;
  color: var(--landing-text-mid);
  font-weight: 800;
  letter-spacing: 0.2px;
  margin: 0 0 10px 0;
}

.slide-text {
  font-size: 15px;
  line-height: 1.65;
  color: #000;
  margin: 0 0 18px 0;
  max-width: 620px;
}

.arrow-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: var(--landing-text-dark);
}

.arrow-only svg {
  width: 26px;
  height: 26px;
  display: block;
  stroke: currentColor;
}

.slide-visual {
  width: 100%;
  min-height: 360px;
  border-radius: 26px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.65),
    rgba(255, 255, 255, 0.12)
  );
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  overflow: hidden;
  position: relative;
}

.slide-visual .hero-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.rules-title {
  font-size: clamp(22px, 3.2vw, 40px);
  margin: 0 0 16px 0;
  color: var(--volcanic-grass);
  font-weight: 900;
  letter-spacing: -1.2px;
}

.rules-kicker {
  font-size: 14px;
  color: var(--landing-text-mid);
  font-weight: 900;
  margin: 0 0 10px 0;
}

.rules-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 920px;
}

.rules-list li {
  position: relative;
  padding-left: 28px;
  font-size: 15px;
  line-height: 1.6;
  color: #000;
}

.rules-list li::before {
  content: "★";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--pantone-yellow);
  font-size: 16px;
  line-height: 1.2;
}

/* Mobile landing */
@media (max-width: 900px) {
  .landing-section {
    padding: 46px 16px;
  }

  .landing-hero {
    grid-template-columns: 1fr;
    gap: 18px;
    min-height: auto;
    padding-top: 12px;
  }

  .hero-visual {
    min-height: 320px;
  }

  .landing-two-col {
    grid-template-columns: 1fr;
  }

  .slide-visual {
    min-height: 320px;
  }
}

/* =========
           EDITOR
           ========= */
.editor-view {
  display: none;
  min-height: 100dvh;
  background: var(--bg-color);
  position: relative;
}

.app-container {
  display: flex;
  height: calc(100dvh - var(--footer-height));
  min-height: 0;
  box-sizing: border-box;
}

/* Боковая панель */
.sidebar {
  flex: 0 0 320px;
  width: 320px;
  background: var(--sidebar-color);
  border-right: 1px solid #e0e0e0;
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 10;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
  overflow-y: auto;
  position: relative;
  min-height: 0;
}

.sidebar-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.editor-home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 22px;
  border: 1px solid #ececec;
  background: #fff;
  color: var(--volcanic-grass);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.08);
}

.editor-home-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.tooltip-trigger[data-tooltip] {
  position: relative;
}

@media (hover: hover) {
  .tooltip-trigger[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(100% + 8px);
    background: rgba(120, 120, 120, 0.35);
    color: #fff;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    font-family: "DM Sans", sans-serif;
    text-transform: none;
    white-space: nowrap;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    pointer-events: none;
    z-index: 999;
  }

  .tooltip-trigger[data-tooltip]:hover::before {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(100% + 2px);
    border: 6px solid transparent;
    border-top-color: rgba(120, 120, 120, 0.35);
    pointer-events: none;
    z-index: 999;
  }
}

.section-title {
  font-size: 11px;
  text-transform: uppercase;
  color: #888;
  font-weight: 700;
  margin-bottom: 5px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

/* Стили кнопок */
button {
  padding: 12px;
  border-radius: 20px;
  border: none;
  background: var(--volcanic-grass);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s;
  font-size: 12px;
  font-weight: 700;
  font-family: "DM Sans", sans-serif;
  text-transform: uppercase;
}

button:hover {
  opacity: 0.9;
}

#t-download {
  background: var(--pantone-yellow);
  color: #000;
}

.canvas-area {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--top-gap) var(--editor-shell-gap) var(--editor-shell-gap);
  position: relative;
  overflow: auto;
  box-sizing: border-box;
}

.canvas-wrapper {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  background: white;
  line-height: 0;
  position: relative;
  margin: auto;
  max-width: 100%;
  flex: 0 0 auto;
}

#visionBoard {
  touch-action: none;
}

#fileInput {
  display: none;
}

.file-input-label {
  display: block;
  padding: 12px;
  background: var(--volcanic-grass);
  color: #fff;
  text-align: center;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
}

/* Контекстное меню объекта (Material Design 3 styling) */
.object-menu {
  position: absolute;
  z-index: 50;
  background: #fff;
  border: none;
  border-radius: 28px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.14),
    0 2px 6px rgba(0, 0, 0, 0.12);
  padding: 8px;
  display: none;
  gap: 8px;
  align-items: center;
  max-width: 520px;
}

.object-menu.is-mobile-dock {
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  border-radius: 24px;
  padding: 10px;
  max-width: min(360px, calc(100% - 20px));
}

.object-menu.is-mobile-dock .om-btn,
.object-menu.is-mobile-dock #om-fontFamilyBtn,
.object-menu.is-mobile-dock .om-color-btn {
  flex: 0 0 auto;
}

.object-menu .om-btn {
  height: 40px;
  padding: 0 16px;
  border-radius: 20px;
  border: none;
  background: var(--volcanic-grass);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s;
  font-size: 12px;
  font-weight: 700;
  font-family: "DM Sans", sans-serif;
  text-transform: uppercase;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.object-menu .om-btn:hover {
  opacity: 0.9;
}

.object-menu .om-icon-btn {
  width: 40px;
  min-width: 40px;
  padding: 0;
}

.object-menu .om-icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

/* (1) кнопка выбора шрифта */
#om-fontFamilyBtn {
  height: 40px;
  padding-left: 12px;
  padding-right: 12px;
  border-radius: 20px;
  border: 1px solid #ddd;
  font-size: 14px;
  font-family: "DM Sans", sans-serif;
  background: #fff;
  box-sizing: border-box;
  color: #000;
  text-transform: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 168px;
  cursor: pointer;
}

#om-fontFamilyBtn:hover {
  opacity: 1;
}

#om-fontFamilyBtn .om-font-label {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 210px;
}

#om-fontFamilyBtn .om-font-caret {
  width: 14px;
  height: 14px;
  display: inline-block;
  flex: 0 0 auto;
  opacity: 0.7;
}

/* тултипы */
.object-menu [data-tooltip] {
  position: relative;
}

.object-menu [data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% + 8px);
  background: rgba(120, 120, 120, 0.35);
  color: #fff;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  font-family: "DM Sans", sans-serif;
  text-transform: none;
  white-space: nowrap;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
  z-index: 999;
}

.object-menu [data-tooltip]:hover::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% + 2px);
  border: 6px solid transparent;
  border-top-color: rgba(120, 120, 120, 0.35);
  pointer-events: none;
  z-index: 999;
}

.om-texttool-btn {
  background: transparent !important;
  color: var(--volcanic-grass) !important;
  opacity: 1 !important;
}

.om-texttool-btn:hover {
  opacity: 1 !important;
}

.om-texttool-btn.is-selected {
  background: rgba(120, 120, 120, 0.25) !important;
}

.om-color-btn {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 20px;
  border: none;
  background: transparent;
  color: var(--volcanic-grass);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 16px;
  font-weight: 900;
  font-family: "DM Sans", sans-serif;
  text-transform: none;
}

.om-color-btn::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #ff3b30 0%,
    #ff9500 16%,
    #ffcc00 32%,
    #34c759 48%,
    #0a84ff 64%,
    #5856d6 80%,
    #ff2d55 100%
  );
}

.om-letter {
  font-family: "DM Sans", sans-serif;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  text-transform: none;
}

.color-popup {
  position: absolute;
  z-index: 60;
  background: transparent;
  border: none;
  border-radius: 18px;
  box-shadow: none;
  padding: 0;
  display: none;
  width: 1px;
  height: 1px;
  line-height: normal;
}

.color-popup input[type="color"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.font-popup {
  position: absolute;
  z-index: 60;
  background: #fff;
  border: none;
  border-radius: 18px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.14),
    0 2px 6px rgba(0, 0, 0, 0.12);
  padding: 8px;
  display: none;
  max-height: 320px;
  overflow: auto;
  min-width: 220px;
  color: #000 !important;
  line-height: normal;
}

.font-popup .font-option {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 12px;
  padding-left: 12px;
  padding-right: 12px;
  cursor: pointer;
  user-select: none;
  color: #000 !important;
  line-height: normal;
}

.font-popup .font-option:hover {
  background: rgba(120, 120, 120, 0.1);
}

.font-popup .font-name {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  font-family: "DM Sans", sans-serif;
  color: #000 !important;
  line-height: normal;
}

.font-popup .font-check {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  opacity: 0;
  line-height: normal;
}

.font-popup .font-option.is-selected .font-check {
  opacity: 1;
}

.font-popup .font-check svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: var(--volcanic-grass);
}

/* Футер (как в редакторе) */
.sticky-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #1e1e1ef2;
  font-size: 12px;
  color: #888;
  font-family: Inter, sans-serif;
  z-index: 100;
}

body.is-editor-active .sticky-footer {
  display: none;
}

.sticky-footer a {
  color: #888;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.sticky-footer a:hover {
  color: #888;
}

.footer-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  box-sizing: border-box;
}

.icon-outline {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
}

.icon-outline path,
.icon-outline rect,
.icon-outline circle {
  stroke: currentColor;
}

.footer-copyright-icon {
  width: 10.35px;
  height: 10.35px;
}

.footer-name {
  font-size: 0.85em;
}

/* ==========================
           MOBILE ADAPTATION (<= 900px) — editor sidebar
           ========================== */
.topbar-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: static;
  width: 44px;
  height: 44px;
  border-radius: 22px;
  padding: 0;
  background: #fff;
  color: var(--volcanic-grass);
  border: 1px solid #e6e6e6;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.14),
    0 2px 6px rgba(0, 0, 0, 0.12);
  line-height: 1;
  cursor: pointer;
}

.topbar-icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.mobile-menu-btn {
  font-size: 20px;
  font-weight: 900;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.editor-rotate-hint {
  position: fixed;
  left: max(14px, calc(env(safe-area-inset-left) + 14px));
  right: max(14px, calc(env(safe-area-inset-right) + 14px));
  top: calc(
    var(--editor-mobile-topbar-height) + env(safe-area-inset-top) + 12px
  );
  z-index: 260;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.editor-rotate-hint[hidden] {
  display: none;
}

.editor-rotate-hint.is-visible {
  opacity: 1;
}

.editor-rotate-card {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 18px 20px 16px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(28, 30, 38, 0.42);
  color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  animation: rotate-hint-fade-in 0.26s ease-out;
  pointer-events: auto;
  box-sizing: border-box;
  overflow: hidden;
}

.editor-rotate-header {
  position: relative;
  padding-right: 48px;
  margin-bottom: 12px;
}

.editor-rotate-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 27px;
  min-width: 27px;
  height: 27px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.94);
  box-shadow: none;
}

.editor-rotate-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.18);
}

.editor-rotate-close svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

.editor-rotate-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.editor-rotate-icon {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.94);
  background: rgba(255, 255, 255, 0.12);
  transform-origin: 50% 50%;
  animation: rotate-hint-device-turn 2.4s ease-in-out infinite;
}

.editor-rotate-icon svg {
  width: 24px;
  height: 24px;
}

.editor-rotate-copy {
  min-width: 0;
}

.editor-rotate-card h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.96);
  text-align: left;
}

.editor-rotate-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.86);
  text-align: left;
}

@keyframes rotate-hint-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rotate-hint-device-turn {
  0%,
  18%,
  100% {
    transform: rotate(0deg) scale(1);
  }

  38%,
  62% {
    transform: rotate(90deg) scale(1.04);
  }

  78% {
    transform: rotate(8deg) scale(1);
  }
}

body.is-editor-active .app-container {
  height: 100dvh;
}

@media (max-width: 900px) {
  .landing-header {
    padding: calc(16px + env(safe-area-inset-top)) 16px 8px;
  }

  .landing-header-bar h1 {
    font-size: 24px;
    letter-spacing: -1.2px;
  }

  body:not(.is-editor-active) .sticky-footer {
    background: transparent;
    color: rgba(59, 58, 54, 0.68);
  }

  body:not(.is-editor-active) .sticky-footer a {
    color: rgba(59, 58, 54, 0.68);
  }

  body:not(.is-editor-active) .footer-inner {
    text-shadow: 0 1px 14px rgba(255, 255, 255, 0.9);
  }

  .editor-mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 240;
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    min-height: var(--editor-mobile-topbar-height);
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }

  .editor-mobile-topbar .editor-mobile-brand {
    flex: 1 1 auto;
    text-align: center;
    padding-left: 8px;
    padding-right: 8px;
  }

  .sidebar .sidebar-header .lang-switcher {
    display: none;
  }

  .app-container {
    height: calc(100dvh - var(--footer-height));
  }

  .sidebar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(
      var(--footer-height) + var(--editor-mobile-sheet-gap) +
        env(safe-area-inset-bottom)
    );
    width: auto;
    height: auto;
    max-height: min(
      420px,
      calc(
        100dvh - var(--footer-height) - var(--editor-mobile-topbar-height) -
          40px
      )
    );
    z-index: 200;
    transform: translateY(calc(100% + 24px));
    transition: transform 0.22s ease;
    box-shadow: 0 -10px 36px rgba(0, 0, 0, 0.14);
    border: 1px solid #ececec;
    border-radius: 28px;
    padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
    gap: 16px;
  }

  .sidebar::before {
    content: "";
    width: 44px;
    height: 5px;
    border-radius: 999px;
    background: #d8d8d8;
    align-self: center;
  }

  .sidebar.is-open {
    transform: translateY(0);
  }

  .sidebar-overlay.is-open {
    display: block;
  }

  .sidebar .sidebar-header {
    position: sticky;
    top: 0;
    z-index: 1;
    padding-top: 2px;
    padding-bottom: 10px;
    background: linear-gradient(
      180deg,
      #ffffff 0%,
      rgba(255, 255, 255, 0.92) 100%
    );
  }

  .control-group {
    gap: 12px;
    padding-bottom: 0;
    border-bottom: none;
  }

  .control-group button,
  .file-input-label {
    min-height: 48px;
    border-radius: 24px;
    font-size: 13px;
  }

  .canvas-area {
    padding: calc(
        var(--editor-mobile-topbar-height) + env(safe-area-inset-top) + 14px
      )
      14px calc(var(--footer-height) + 22px + env(safe-area-inset-bottom));
  }

  .canvas-wrapper {
    width: 100%;
    border-radius: 28px;
    overflow: hidden;
  }

  .object-menu.is-mobile-dock {
    width: calc(100% - 20px);
    border-radius: 26px;
    padding: 12px;
    gap: 8px;
  }

  body.is-editor-active .sidebar {
    bottom: calc(var(--editor-mobile-sheet-gap) + env(safe-area-inset-bottom));
    max-height: min(
      420px,
      calc(100dvh - var(--editor-mobile-topbar-height) - 28px)
    );
  }

  body.is-editor-active .canvas-area {
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 900px) {
  .editor-rotate-hint {
    top: calc(
      var(--editor-mobile-topbar-height) + env(safe-area-inset-top) + 10px
    );
  }

  .editor-rotate-card {
    border-radius: 24px;
    padding: 16px;
  }

  .editor-rotate-header {
    margin-bottom: 10px;
  }

  .editor-rotate-card h2 {
    font-size: 17px;
  }

  .editor-rotate-card p {
    font-size: 12px;
  }
}

@media (max-width: 900px) {
  body.is-editor-active .editor-mobile-topbar {
    display: none;
  }

  body.is-editor-active .app-container {
    height: 100dvh;
    flex-direction: row;
  }

  body.is-editor-active .sidebar {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    width: min(220px, 42vw);
    flex: 0 0 min(220px, 42vw);
    max-height: 100dvh;
    transform: none;
    border-radius: 0;
    border: none;
    border-right: 1px solid #ececec;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    padding: calc(18px + env(safe-area-inset-top)) 14px
      calc(18px + env(safe-area-inset-bottom));
  }

  body.is-editor-active .sidebar::before {
    display: none;
  }

  body.is-editor-active .sidebar .sidebar-header {
    position: static;
    padding: 0 0 10px;
    background: transparent;
  }

  body.is-editor-active .sidebar-overlay {
    display: none !important;
  }

  body.is-editor-active .canvas-area {
    align-items: center;
    padding: calc(14px + env(safe-area-inset-top)) 14px
      calc(14px + env(safe-area-inset-bottom));
  }

  body.is-editor-active .canvas-wrapper {
    width: auto;
    max-width: 100%;
    max-height: calc(
      100dvh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom)
    );
  }

  body.is-editor-active .editor-rotate-hint {
    top: max(14px, calc(env(safe-area-inset-top) + 14px));
  }

  body.is-editor-active .object-menu.is-mobile-dock {
    width: min(420px, calc(100% - 28px));
  }
}

@media (max-width: 900px) and (orientation: portrait) {
  body.is-editor-active {
    overflow: hidden;
  }

  body.is-editor-active .editor-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100dvh;
    height: 100dvw;
    transform-origin: top left;
    transform: translateX(100dvw) rotate(90deg);
    z-index: 100;
  }

  body.is-editor-active .app-container {
    height: 100%;
  }

  body.is-editor-active .sticky-footer {
    display: none;
  }

  body.is-editor-active .editor-rotate-hint {
    top: max(14px, calc(env(safe-area-inset-top) + 14px));
  }

  body.is-editor-active .sidebar {
    width: min(158px, 42vw);
    flex: 0 0 min(158px, 42vw);
    padding: calc(10px + env(safe-area-inset-top)) 10px
      calc(10px + env(safe-area-inset-bottom));
    gap: 10px;
    overflow: hidden;
  }

  body.is-editor-active .sidebar .sidebar-header {
    gap: 4px;
    flex-wrap: nowrap;
    min-width: 0;
  }

  body.is-editor-active .sidebar .sidebar-header h1 {
    font-size: 14px;
    letter-spacing: -0.5px;
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
  }

  body.is-editor-active .sidebar .sidebar-header-actions {
    gap: 4px;
    flex: 0 0 auto;
  }

  body.is-editor-active .sidebar .editor-home-btn {
    width: 26px;
    min-width: 26px;
    height: 26px;
  }

  body.is-editor-active .sidebar .editor-home-btn svg {
    width: 10px;
    height: 10px;
  }

  body.is-editor-active .sidebar #langBtnEditor {
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    font-size: 10px;
  }

  body.is-editor-active .sidebar .control-group {
    gap: 8px;
  }

  body.is-editor-active .sidebar .control-group button,
  body.is-editor-active .sidebar .file-input-label {
    min-height: 0;
    height: auto;
    border-radius: 14px;
    font-size: 11px;
    padding: 6px 10px;
    line-height: 1.2;
    letter-spacing: -0.2px;
    white-space: normal;
    display: block;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .editor-rotate-hint {
    transition: none;
  }

  .editor-rotate-card,
  .editor-rotate-icon {
    animation: none;
  }
}

/* --- FIX: unified titles offset must apply always (container shift) --- */
.hero-title.landing-title-unified,
.rules-title.landing-title-unified,
.hero-title-final.landing-title-unified {
  margin-left: 50px !important;
  width: calc(100% - 50px);
  text-align: left;
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .hero-title.landing-title-unified,
  .rules-title.landing-title-unified,
  .hero-title-final.landing-title-unified {
    margin-left: 20px !important;
    width: calc(100% - 20px);
  }
}

/* === Final landing tweaks (titles/buttons) === */
#landingView #slide1 .hero-title,
#landingView #slide3 .rules-title-landing,
#landingView #slide4 .hero-title {
  /* a few tones lighter */
  color: rgb(58, 58, 58);
}

/* Move "Вперед" button lower on slide 1 and 4 */
#landingView #slide1 .cta-btn-center,
#landingView #slide4 .cta-btn-center {
  margin-top: calc(26px + 50px);
}

/* Slide 3: make title much larger and shift it left; move rules text right */
#landingView #slide3 .rules-title-landing {
  font-size: clamp(30px, 4.8vw, 58px);
  line-height: 1.05;
}

#landingView #slide3 .rules-title-landing.landing-title-unified {
  padding-left: 25px; /* prevent left glyph clipping */
  box-sizing: border-box;
  margin-left: -25px !important;
  width: calc(100% + 50px);
}

#landingView #slide3 .rules-list-landing {
  margin-left: 100px !important;
  width: calc(100% - 100px);
}

@media (max-width: 480px) {
  #landingView #slide3 .rules-title-landing.landing-title-unified {
    margin-left: -20px !important;
    width: calc(100% + 20px);
  }
  #landingView #slide3 .rules-list-landing {
    margin-left: 30px !important;
    width: calc(100% - 30px);
  }
  #landingView #slide1 .cta-btn-center,
  #landingView #slide4 .cta-btn-center {
    margin-top: calc(26px + 35px);
  }
}

/* ============================
   RU: растянуть заголовки 1 и 4 экранов
   ============================ */
html[lang="ru"] #slide1 .landing-title-unified,
html[lang="ru"] #slide4 .landing-title-unified {
  max-width: 1200px; /* растягивает контейнер */
  width: calc(100% - 80px); /* даёт больше воздуха по строке */
}

/* Donate modal (glass / Material 3) */
.donate-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
}
.donate-modal {
  width: min(560px, 100%);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.92);
  overflow: hidden;
}
.donate-modal-header {
  position: relative;
  padding: 22px 24px 10px 24px;
}
.donate-modal-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.2px;
}
.donate-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  appearance: none;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition:
    transform 0.12s ease,
    background 0.12s ease;
}
.donate-modal-close:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: scale(1.03);
}
.donate-modal-close:active {
  transform: scale(0.98);
}
.donate-modal-close svg {
  width: 24px;
  height: 24px;
  stroke: rgba(255, 255, 255, 0.92);
}

.donate-modal-content {
  padding: 8px 24px 24px 24px;
}
.donate-modal-text {
  margin: 18px 0 18px 0; /* больше воздуха от заголовка */
  font-size: 14px;
  line-height: 1.55;
  text-align: left;
  color: rgba(255, 255, 255, 0.9);
}
.donate-modal-text a {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.donate-actions {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}
.donate-matecito-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 16px; /* крупнее */
  letter-spacing: 0.2px;
  border: none;
  color: rgba(36, 36, 37, 1);
  background: #fedd00; /* Pantone Yellow C (approx) */
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
  transition:
    transform 0.12s ease,
    filter 0.12s ease,
    box-shadow 0.12s ease;
  text-decoration: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.donate-matecito-link:hover {
  filter: brightness(0.98);
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}
.donate-matecito-link:active {
  transform: translateY(0px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}

/* hide legacy embed assets, keep only text */
.donate-matecito-img {
  display: none !important;
}
.donate-matecito-icon {
  display: none !important;
}

@media (max-width: 480px) {
  .donate-modal {
    border-radius: 22px;
  }
  .donate-modal-title {
    font-size: 20px;
  }
  .donate-modal-text {
    font-size: 14px;
  }
}
