:root{ --vh: 1vh; }

/* ВНЕ iframe — даём полную высоту экрана */
html, body{
  min-height: calc(var(--vh) * 100);
}

html,body{
  margin:0; background:rgba(0, 0, 0, 0.678); color:transparent;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  -webkit-text-size-adjust:100%; touch-action:manipulation;
  padding-top:env(safe-area-inset-top); padding-bottom:env(safe-area-inset-bottom);
  -webkit-user-select:none; user-select:none; -webkit-touch-callout:none;
}

.wrap{max-width:1024px; margin:0 auto; padding:12px}
.grid{
  display:flex;
  flex-wrap:nowrap;
  gap:12px;
  overflow-x:auto;
  overflow-y:hidden;
  align-items:flex-start;
  justify-content:flex-start;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}

.grid::-webkit-scrollbar{
  display:none;
}

/* мобильный — 2 колонки */
@media (max-width:820px){
  .grid{ grid-template-columns:repeat(2,1fr); gap:10px; }
  .wrap{ padding:8px }
}

/* !!! тут была ошибка: border:1px solid: transparent; */
.card{
  background:transparent;
  border:1px solid transparent;
  border-radius:0px;
  overflow:hidden
}

.thumb img{display:block; width:100%; height:auto; object-fit:contain}

.upload-btn{
  align-self:flex-start;border-radius:999px;border:1px solid #374151;
  padding:6px 14px;background:#111827;color:#e5e7eb;font-size:13px;cursor:pointer;
  text-decoration:none;display:inline-block
}
.upload-btn:active{transform:scale(0.98)}
.upload-error{
  margin:0 0 10px;padding:8px 10px;border-radius:10px;
  background:#451a1a;color:#fecaca;font-size:13px
}

/* ==== выезжающее меню слева ==== */
.menu-toggle{
  position:fixed;
  top:calc(env(safe-area-inset-top) + 10px);
  left:calc(env(safe-area-inset-left) + 10px);
  z-index:9999;
  width:46px;height:46px;border-radius:14px;
  display:flex;flex-direction:column;justify-content:center;align-items:center;gap:5px;
  background:rgba(0,0,0,.55);
  border:1px solid #2a2a2a;
  box-shadow:0 6px 18px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.06);
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.menu-toggle span{
  display:block;width:22px;height:2px;border-radius:999px;background:#e5e7eb;
  transition:transform .2s ease, opacity .2s ease;
}
.menu-toggle.open span:nth-child(1){ transform:translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2){ opacity:0; }
.menu-toggle.open span:nth-child(3){ transform:translateY(-7px) rotate(-45deg); }

@media (max-width:820px){
  .menu-toggle{ width:54px;height:54px;border-radius:0px }
  .menu-toggle span{ width:24px }
}

.upload-panel{
  position:fixed;
  top:calc(env(safe-area-inset-top) + 70px);
  left:calc(env(safe-area-inset-left) + 10px);
  z-index:9998;
  width:min(360px, 90vw);
  max-width:90vw;
  transform:translateX(-110%);
  opacity:0; pointer-events:none;
  transition:transform .22s ease, opacity .22s ease;
}
.upload-panel.open{
  transform:translateX(0); opacity:1; pointer-events:auto;
}
.upload-panel .card{
  box-shadow:0 20px 40px rgba(0,0,0,.6);
}

/* ===== Share / Embed block ===== */
.share-link{
  margin-top:14px;font-size:14px;font-weight:600;color:#111;
  cursor:pointer;display:inline-flex;align-items:center;gap:6px;
  background:none;border:none;padding:6px 2px;-webkit-tap-highlight-color:transparent;
}
.share-link:active{ transform:scale(.98); }

.embed-wrap{ margin-top:8px; display:none; }
.embed-wrap.open{ display:block; }

.embed-card{ padding:12px 14px; margin-top:6px; }

.embed-box{
  width:100%; min-height:92px; resize:vertical;
  background:#0b1020; color:#e9eef5;
  border:1px solid #1f2638;border-radius:12px;
  padding:10px 12px;font-size:12px;line-height:1.35;
}

/* В iframe: убираем min-height/100vh */
html.embedded, html.embedded body{
  min-height:auto !important;
  height:auto !important;
  padding-top:0 !important;
  padding-bottom:0 !important;
}
.howto{
  margin:16px 12px 8px;
  font-size:13px;
  line-height:1.5;
  color:#6b7280; /* можешь подправить под тёмную/светлую тему */
}
.howto-title{
  font-weight:600;
  margin-bottom:4px;
  color:#e5e7eb; /* для тёмной темы, под себя можно исправить */
}
.howto-list{
  margin:0;
  padding-left:18px;
}
.howto-list li{
  margin:2px 0;
}
.slider-wrap{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  width:100%;
  margin:0 auto 20px;
}

.slider-window{
  width:100%;
  max-width:420px;
  overflow:hidden;
}

.slider-track{
  display:flex;
  transition:transform .28s ease;
  touch-action:pan-y;
}

.slide{
  min-width:100%;
  flex:0 0 100%;
}

.nav-btn{
  width:42px;
  height:42px;
  border:none;
  border-radius:50%;
  background:#111;
  color:#fff;
  font-size:28px;
  line-height:1;
  cursor:pointer;
  flex:0 0 auto;
}

.nav-btn:active{
  transform:scale(.96);
}

@media (max-width:640px){
  .slider-window{
    max-width:100%;
  }

  .nav-btn{
    width:38px;
    height:38px;
    font-size:24px;
  }
}
.modal .btn{
  width:64px;
  height:64px;
  padding:0;
  border:none;
  border-radius:18px;

  display:flex;
  align-items:center;
  justify-content:center;

  background:#0f62fe;
  color:#ffffff;

  box-shadow:0 8px 18px rgba(0,0,0,.22);
}

.modal .btn.secondary{
  background:#5a5a5a;
  color:#ffffff;
}

.modal .btn svg{
  width:28px;
  height:28px;
  display:block;
  flex:0 0 28px;
}

.modal .btn:active{
  transform:scale(.96);
}
.site-footer{
  max-width:1024px;
  margin:0 auto;
  padding:18px 14px calc(env(safe-area-inset-bottom) + 20px);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
}

.site-footer a{
  color:rgba(255, 255, 255, 0.116);
  text-decoration:none;
  font-size:14px;
  font-weight:600;
}

.site-footer a:active{
  opacity:.7;
}