/* app/static/css/album.css */
:root{
  --bg:#0b0b0c;
  --ink:#eaeaea;
  --muted:#9aa0a6;
  --panel:#121212;
  --border:#222;
  --album-bg:#0b0d10;
  --album-card:#12151a;
  --album-text:#e8edf3;
  --album-muted:#8a93a2;
  --album-accent:#4ea1ff;

  /* цвет «полоски» и активных элементов */
  --stripe:#c59d5f;
  --stripe-dark:#a68245;

  /* сетка/тайлы */
  --tile-size:282px;
  --tile-gap:30px;
  --tile-radius:12px;
  --tile-border-w:3px;

  /* нижняя полоса */
  --stripe-height:14px;

  --like-red: #ff4d4d;
  --like-red-dark: #e24545;

  --edge-inset: 30px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  background:#111;
  color:var(--ink);
}

/* Контейнер */
.wrap{max-width:1200px;margin:0 auto;padding:14px}

/* Шапка и верхняя строка — ФИКС наложения */
header{
  position:sticky; top:0;
  background:#111;
  padding:12px 16px;
  border-bottom:1px solid #222;
  z-index:3; /* поверх полосы */
}
.topline{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap; /* ← не даём налезать */
  padding-left: var(--edge-inset);
  padding-right: var(--edge-inset);
}
.downloads{
  display:flex;
  gap:10px;
  flex-wrap:wrap; /* ← не даём налезать */
}

/* Панель инструментов под шапкой */
.toolbar{
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--tile-size));
  justify-content: center;
  justify-items: start;
  align-items: center;
  gap: var(--tile-gap);
  margin: 8px 0 14px;
  padding-left: var(--edge-inset);
  padding-right: var(--edge-inset);
}

/* Кнопки */
.btn{
  appearance:none;
  border:1px solid #2a2a2a;
  background:#181818;
  color:var(--ink);
  padding:8px 12px;
  border-radius:10px;
  text-decoration:none;
  font-size:14px;
  cursor:pointer;
  transition:background .2s ease,border-color .2s ease,color .2s ease,transform .2s ease;
}
.btn:hover{background:#202020}
.btn.primary{
  background:var(--stripe);
  border-color:var(--stripe);
  color:#111;
}
.btn.primary:hover{
  background:var(--stripe-dark);
  border-color:var(--stripe-dark);
}

/* Табы — активные цвета полоски */
.tabs{display:flex;gap:6px}
.tabs a{
  padding:6px 10px;
  border-radius:8px;
  border:1px solid #2a2a2a;
  color:#ddd;
  text-decoration:none;
  transition:background .2s,border-color .2s,color .2s;
}
.tabs a.active{
  background:var(--stripe);
  border-color:var(--stripe);
  color:#111;
}
.tabs a.active:hover{
  background:var(--stripe-dark);
  border-color:var(--stripe-dark);
}

/* Сетка: фиксированная ширина плиток 282px и большие промежутки */
.grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, var(--tile-size));
  justify-content:center;
  gap:var(--tile-gap);
  padding-left: var(--edge-inset);
  padding-right: var(--edge-inset);
}

/* Плитка */
.tile{
  position:relative;
  width:var(--tile-size);
  border:var(--tile-border-w) solid var(--stripe);
  border-radius:var(--tile-radius);
  overflow:hidden;
  background:#0e0e0e;
  transition:border-color .18s ease, box-shadow .18s ease;
}
.tile:hover{ border-color:var(--stripe-dark); }

/* Кликабельная область и изображение */
.tile a.figure{display:block; line-height:0}
.tile a.figure,
.tile a.figure > img{
  width:100%;
  height:var(--tile-size); /* 282px */
}
.tile a.figure > img{
  display:block;
  object-fit:cover;
  background:#0c0c0c;
  transform:scale(1);
  transition:transform .22s ease;
  will-change:transform;
}
.tile:hover a.figure > img{ transform:scale(1.10); }

/* Нижняя панель на тайле */
.bar{
  position:absolute;
  inset:auto 8px 8px 8px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  pointer-events:none;
}
.bar > *{pointer-events:auto}


.download{
  cursor:pointer; user-select:none;
  padding:8px 12px;
  border-radius:999px;
  background:rgba(0,0,0,.45);
  backdrop-filter:blur(4px);
  border:1px solid rgba(255,255,255,.08);
  font-size:19px;
  color:#111;          /* ← как у лайка */
  text-decoration:none;   /* ← убрать подчёркивание */
  transition:background .18s ease,border-color .18s ease,transform .18s ease;
}

/* Кнопка лайка */
.like{
  cursor:pointer; user-select:none;
  padding:8px 12px;
  border-radius:999px;
  background:rgba(0,0,0,.45);
  backdrop-filter:blur(4px);
  border:1px solid rgba(255,255,255,.08);
  font-size:19px;
  color:#111;
  text-decoration:none;
  transition:background .18s ease,border-color .18s ease,transform .18s ease;
}

.like.on{
  background:rgba(255,77,77,.22);
  border-color:var(--like-red-dark);
  color:#fff;
}

/* Вспомогательный текст */
.muted{color:var(--muted)}

.card{
  background: rgba(0,0,0,.55);
  border: 1px solid var(--album-border, rgba(255,255,255,0.08));
  border-radius: 10px;
  padding: 14px;
  max-width:560px;
  width:100%
}

.card-body{
  padding:16px;
}

.card-title{
  margin:0 0 6px;
  font-size:18px;
  line-height:1.2;
  color: var(--album-text, #e8edf3);
}
.actions{
  display: flex;              /* на случай, если где-то не задано */
  justify-content: center;    /* по центру по горизонтали */
  align-items: center;        /* по центру по вертикали */
  gap: 10px;                  /* расстояние между кнопками */
  margin-top: 12px;           /* общий отступ сверху у блока actions */
}

.field{
  margin-bottom: 12px;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.field input,
.field select,
.field textarea{
  width:100%;
  padding:10px 12px;
  background: #181818;
  color: var(--album-text, #e8edf3);
  border:1px solid var(--album-border, rgba(255,255,255,0.08));
  border-radius:10px;
  outline:none;
}

.field input:focus,
.field select:focus,
.field textarea:focus{
  border-color: var(--album-accent, #4ea1ff);
  box-shadow: 0 0 0 3px rgba(78,161,255,0.15);
}

.text{
  color: var(--album-text, #e8edf3);
  font-size:14px;
  line-height:1.5;
}

.stage { position: relative; overflow: hidden; }

.tile.is-video .figure { position: relative; }

.tile .play-badge{
  position:absolute; right:8px; bottom:8px;
  background:rgba(0,0,0,.6); color:#fff; font-size:12px;
  padding:4px 6px; border-radius:6px; line-height:1; user-select:none;
}

/* Нижняя полоса прогресса (создаётся JS) */
#scrollStripe{
  position:fixed;
  left:0; bottom:0;
  height:var(--stripe-height);
  width:0;                     /* управляет JS */
  background:var(--stripe);    /* без градиента */
  opacity:.9;
  z-index:1;                   /* под шапкой/контентом */
  pointer-events:none;
  border-top-right-radius:8px;
}

/* Анимация ошибки */
@keyframes shake{
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX( 2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX( 4px); }
}
.shake{ animation:shake .4s ease both; }
