/* играман — тёмная игровая тема. Без сборки и зависимостей. */

:root {
  --bg:        #0e1116;
  --bg-soft:   #161b23;
  --bg-card:   #1a212b;
  --line:      #263040;
  --text:      #e8edf5;
  --text-dim:  #92a0b5;
  --accent:    #5ad36a;
  --accent-2:  #ffcc4d;
  --danger:    #ff6b5e;
  --radius:    14px;
  --shadow:    0 6px 24px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }
.prose a, .warn a, .foot a { color: var(--accent); text-decoration: underline; }
.prose a:hover, .warn a:hover { color: var(--accent-2); }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ------------------------------ шапка ------------------------------ */

.top {
  background: linear-gradient(180deg, #131923, #0e1116);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.top__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
  flex-wrap: wrap;
}

.logo { display: flex; align-items: center; gap: 12px; }

.logo__mark {
  width: 40px; height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), #2f9e4a);
  color: #06210d;
  font-weight: 800;
  font-size: 22px;
}

.logo__text b { display: block; font-size: 19px; letter-spacing: .2px; }
.logo__text small { display: block; color: var(--text-dim); font-size: 12.5px; }

.nav { display: flex; gap: 20px; font-size: 14.5px; color: var(--text-dim); }
.nav a:hover { color: var(--accent); }

/* ------------------------------ сетка ------------------------------ */

.layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
  padding-top: 28px;
  padding-bottom: 56px;
}

.col__title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text-dim);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.col-posts .col__title { margin-top: 40px; }

.col__note { color: var(--text-dim); font-size: 13px; margin-top: 16px; }

.empty {
  color: var(--text-dim);
  background: var(--bg-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

/* --------------------------- лента видео --------------------------- */

.vlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.vcard__link {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 12px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, transform .15s;
}

.vcard__link:hover {
  background: var(--bg-card);
  border-color: var(--line);
  transform: translateX(2px);
}

.vcard__thumb {
  display: block;
  border-radius: 9px;
  overflow: hidden;
  background: var(--bg-soft);
  aspect-ratio: 16 / 9;
}

.vcard__thumb img { width: 100%; height: 100%; object-fit: cover; }

.vcard__title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 600;
}

.vcard__meta { display: block; margin-top: 6px; color: var(--text-dim); font-size: 12.5px; }

/* ------------------------------ герой ------------------------------ */

.hero {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero__thumb, .post-video {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-soft);
}

.hero__thumb img, .post-video img { width: 100%; height: 100%; object-fit: cover; }

.hero__play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 74px; height: 74px;
  border-radius: 50%;
  background: rgba(14, 17, 22, .72);
  border: 2px solid rgba(255, 255, 255, .85);
  transition: background .15s, transform .15s;
}

.hero__play::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0; height: 0;
  border-style: solid;
  border-width: 13px 0 13px 22px;
  border-color: transparent transparent transparent #fff;
  transform: translateX(3px);
}

.hero__thumb:hover .hero__play,
.post-video:hover .hero__play { background: var(--accent); transform: scale(1.06); }

.hero__thumb:hover .hero__play::after { border-left-color: #06210d; }

.hero__text { padding: 20px 22px 24px; }

.tag {
  display: inline-block;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
  color: #06210d;
  background: var(--accent);
  border-radius: 999px;
  padding: 4px 11px;
}

.tag--link { margin-top: 8px; text-decoration: none; }
.tag--link:hover { background: var(--accent-2); }

.hero__title { font-size: 26px; line-height: 1.25; margin: 12px 0 10px; }
.hero__title a:hover { color: var(--accent); }
.hero__desc { color: var(--text-dim); margin: 0; }

/* ------------------------------ посты ------------------------------ */

.post-card {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 18px;
  padding: 16px;
  margin-bottom: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.post-card:not(:has(.post-card__thumb)) { grid-template-columns: 1fr; }

.post-card__thumb {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--bg-card);
}

.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; }

.post-card__date { color: var(--text-dim); font-size: 12.5px; }
.post-card__title { font-size: 19px; line-height: 1.3; margin: 6px 0 8px; }
.post-card__title a:hover { color: var(--accent); }
.post-card__excerpt { color: var(--text-dim); margin: 0 0 10px; font-size: 15px; }

.more { color: var(--accent); font-weight: 600; font-size: 14.5px; }
.more:hover { color: var(--accent-2); }

/* ------------------------- страница ролика ------------------------- */

.player {
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.player iframe, .player video { width: 100%; height: 100%; border: 0; display: block; }

.warn {
  margin: 14px 0 0;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-dim);
  background: rgba(255, 204, 77, .08);
  border: 1px solid rgba(255, 204, 77, .3);
  border-left: 3px solid var(--accent-2);
  border-radius: 10px;
}

.vtitle { font-size: 27px; line-height: 1.25; margin: 22px 0 8px; }
.vmeta { color: var(--text-dim); font-size: 14px; margin: 0 0 20px; }

.post-video { border-radius: var(--radius); overflow: hidden; margin: 18px 0 22px; }

.prose { font-size: 16.5px; }
.prose p { margin: 0 0 16px; }
.prose h2 { font-size: 22px; margin: 28px 0 12px; }
.prose h3 { font-size: 18.5px; margin: 24px 0 10px; }
.prose ul { margin: 0 0 18px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose strong { color: #fff; }

/* ------------------------------ подвал ------------------------------ */

.foot { border-top: 1px solid var(--line); background: var(--bg-soft); }

.foot__inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  padding-bottom: 22px;
  color: var(--text-dim);
  font-size: 14px;
}

/* --------------------------- обычные страницы --------------------------- */

.page { padding-top: 28px; padding-bottom: 60px; }
.page__narrow { max-width: 760px; }

.pagehead { margin-bottom: 30px; }
.pagehead__title { font-size: 32px; line-height: 1.2; margin: 12px 0 10px; }
.pagehead__desc { color: var(--text-dim); max-width: 680px; margin: 0; }

.col__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.col__head .col__title { flex: 1; }

.disclaimer {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 13.5px;
}

/* ------------------------------- игры ------------------------------- */

.gwall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.gwall--promo { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }

.gcard {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .15s, border-color .15s;
}

.gcard:hover { transform: translateY(-3px); border-color: #3a4759; }

.gcard__cover {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
}

.gcard__letter {
  position: absolute;
  right: -14px;
  bottom: -34px;
  font-size: 128px;
  font-weight: 800;
  line-height: 1;
  color: rgba(0, 0, 0, .22);
  user-select: none;
}

.gcard__letter--big { font-size: 190px; right: 12px; bottom: -52px; }

.gcard__name {
  position: absolute;
  left: 16px;
  bottom: 14px;
  right: 16px;
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .45);
}

.gcard__kind {
  position: absolute;
  left: 14px;
  top: 13px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: #fff;
  background: rgba(14, 17, 22, .55);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  padding: 3px 10px;
}

.gcard__kind--hero { position: static; display: inline-block; margin-bottom: 10px; }

.gcard__body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.gcard__title { font-size: 17px; margin: 0; }
.gcard__title a:hover { color: var(--accent); }
.gcard__meta { color: var(--text-dim); font-size: 12.5px; margin: 0; }
.gcard__tagline { font-size: 14.5px; margin: 0; flex: 1; }

.ghero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 220px;
  display: flex;
  align-items: flex-end;
  padding: 26px;
  box-shadow: var(--shadow);
}

.ghero__text { position: relative; }
.ghero__title { font-size: 38px; margin: 0 0 6px; color: #fff; text-shadow: 0 2px 14px rgba(0, 0, 0, .4); }
.ghero__tagline { margin: 0; color: rgba(255, 255, 255, .92); font-size: 17px; }

.gfacts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 20px 0 32px;
}

.gfacts > div { background: var(--bg-soft); padding: 14px 16px; }
.gfacts dt { color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.gfacts dd { margin: 5px 0 0; font-weight: 600; }
.gfacts a { color: var(--accent); }

/* --------------------------- сетка всех видео --------------------------- */

.vwall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.vbig__thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-soft);
}

.vbig__thumb img { width: 100%; height: 100%; object-fit: cover; }
.vbig__thumb .hero__play { width: 58px; height: 58px; }
.vbig__thumb .hero__play::after { border-width: 10px 0 10px 17px; }
.vbig__title { font-size: 16.5px; line-height: 1.35; margin: 12px 0 4px; }
.vbig__title a:hover { color: var(--accent); }
.vbig__meta { color: var(--text-dim); font-size: 13px; margin: 0; }

/* ------------------------------ о канале ------------------------------ */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.stat {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.stat b { display: block; font-size: 30px; line-height: 1.1; color: var(--accent); }
.stat span { color: var(--text-dim); font-size: 13.5px; }

.cta { margin-top: 30px; }

/* ------------------------- кнопки, формы, таблица ------------------------- */

.btn {
  display: inline-block;
  background: var(--accent);
  color: #06210d;
  font-weight: 700;
  font-size: 15px;
  padding: 11px 20px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { background: #6ee07d; }

.form { display: grid; gap: 16px; max-width: 560px; margin-top: 20px; }
.form--wide { max-width: 900px; }

.form label { display: grid; gap: 6px; font-size: 14px; color: var(--text-dim); }
.form label small { color: #6d7c92; font-size: 12px; }

.form input[type=text],
.form input[type=date],
.form input[type=password],
.form select,
.form textarea {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 13px;
  font: inherit;
  font-size: 15px;
}

.form textarea { resize: vertical; line-height: 1.6; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14.5px; }

.form input:focus, .form select:focus, .form textarea:focus {
  outline: 2px solid rgba(90, 211, 106, .5);
  outline-offset: 1px;
  border-color: var(--accent);
}

.form__row { display: flex; gap: 14px; flex-wrap: wrap; align-items: end; }
.form__row > label { flex: 1; min-width: 170px; }

.hint { color: var(--text-dim); font-size: 13.5px; margin: 0; }
.hint code, .prose code, .empty code {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 13.5px;
}

.msg { padding: 12px 16px; border-radius: 10px; font-size: 14.5px; }
.msg--ok  { background: rgba(90, 211, 106, .12); border: 1px solid rgba(90, 211, 106, .4); }
.msg--bad { background: rgba(255, 107, 94, .12); border: 1px solid rgba(255, 107, 94, .45); }

.adminbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.adminbar__right { display: flex; align-items: center; gap: 18px; }

.tabs { display: flex; gap: 8px; }

.tab {
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 600;
}

.tab:hover { color: var(--text); }
.tab--on { background: var(--bg-card); color: var(--text); border-color: #3a4759; }

.gfacts__wide { grid-column: 1 / -1; }

.form input[type=color] {
  width: 100%;
  height: 42px;
  padding: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.table { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 15px; }
.table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding: 0 12px 10px 0;
  border-bottom: 1px solid var(--line);
}
.table td { padding: 13px 12px 13px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table a:hover { color: var(--accent); }
.nowrap { white-space: nowrap; }
.inline { display: inline; }

.linkbtn {
  background: none;
  border: 0;
  color: var(--danger);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 0 0 14px;
}

.linkbtn:hover { text-decoration: underline; }

/* ---------------------- админка: обзор и мелочи ---------------------- */

.listhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.listhead .pagehead__title { margin: 0; font-size: 26px; }

.quick { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 34px; }

.btn--ghost {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--line);
}

.btn--ghost:hover { background: #232c39; }

.lastvideo {
  display: flex;
  gap: 18px;
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 30px;
}

.lastvideo img { width: 200px; border-radius: 10px; flex: none; }
.lastvideo b { display: block; margin-bottom: 4px; }

.badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .8px;
  font-weight: 700;
  color: var(--accent-2);
  background: rgba(255, 204, 77, .12);
  border: 1px solid rgba(255, 204, 77, .35);
  border-radius: 999px;
  padding: 2px 9px;
}

.swatch {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  vertical-align: -6px;
  margin-right: 10px;
  border: 1px solid rgba(255, 255, 255, .15);
}

.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 15px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.form__row--files { align-items: center; gap: 24px; }
.form input[type=file] { font-size: 14px; color: var(--text-dim); }

/* --------------------------- редактор текста --------------------------- */

.editor {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 9px 10px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--line);
}

.toolbar button {
  min-width: 34px;
  height: 30px;
  padding: 0 9px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}

.toolbar button:hover { border-color: var(--accent); color: var(--accent); }
.toolbar__sep { flex: 1; }

.toolbar__img { padding: 0; width: 42px; height: 30px; overflow: hidden; }
.toolbar__img img { width: 100%; height: 100%; object-fit: cover; }

.editor label { padding: 0; gap: 0; }
.editor label > span { display: none; }

.editor textarea {
  border: 0;
  border-radius: 0;
  background: var(--bg-soft);
}

.editor textarea:focus { outline: none; border: 0; }

/* ---------------------------- галерея картинок ---------------------------- */

.mwall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.mcard {
  margin: 0;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.mcard img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg-card); }

.mcard figcaption { padding: 10px 12px 12px; display: grid; gap: 6px; }
.mcard code { font-size: 11.5px; word-break: break-all; display: block; }
.mcard .linkbtn { padding: 0; text-align: left; }

/* Картинки внутри текста записи */
.prose img {
  width: 100%;
  border-radius: 12px;
  margin: 6px 0;
  border: 1px solid var(--line);
}

/* ------------------------------ пожелания ------------------------------ */

.wishlayout {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.wishform .form { margin-top: 0; }

/* Ловушка для роботов: не показываем, но и не прячем через display:none —
   иначе часть ботов её распознаёт. */
.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.wish {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.wish__vote button {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 58px;
  padding: 9px 6px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}

.wish__vote button:hover { border-color: var(--accent); color: var(--accent); }
.wish__arrow { font-size: 12px; line-height: 1; }
.wish__vote b { font-size: 18px; line-height: 1.1; }

.wish__body { flex: 1; min-width: 0; }
.wish__text { margin: 0 0 8px; }
.wish__meta { margin: 0; color: var(--text-dim); font-size: 13px; }

.wish--admin { align-items: center; justify-content: space-between; }
.wish__actions { display: flex; align-items: center; gap: 14px; flex: none; }

.btn--small { padding: 7px 14px; font-size: 14px; }

.stat--warn b { color: var(--accent-2); }

/* ------------------------------ телефон ------------------------------ */

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 26px; }
  .pagehead__title { font-size: 26px; }
  .ghero__title { font-size: 28px; }
  .nav { gap: 14px; font-size: 14px; flex-wrap: wrap; }
  /* На узком экране сначала посты, лента видео уходит вниз. */
  .col-videos { order: 2; }
  .col-posts { order: 1; }
  .col-posts .col__title { margin-top: 28px; }
  .hero__title { font-size: 22px; }
  .post-card { grid-template-columns: 1fr; }
  .post-card__thumb { max-width: 320px; }

  /* Админка: вкладки в строку со скроллом, таблицы — карточками */
  .tabs { overflow-x: auto; padding-bottom: 4px; }
  .tab { white-space: nowrap; }
  .adminbar { align-items: stretch; }

  .table, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .table td { border: 0; padding: 3px 0; }
  .table th { display: none; }

  .lastvideo { flex-direction: column; align-items: flex-start; }
  .lastvideo img { width: 100%; }

  .wishlayout { grid-template-columns: 1fr; gap: 28px; }
  .wish--admin { flex-direction: column; align-items: stretch; gap: 12px; }
}

/* ============================ главная страница ============================ */

.home { padding-top: 26px; padding-bottom: 60px; display: grid; gap: 46px; }
.home > section { min-width: 0; }

/* Свежий ролик */

.lead {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 26px;
  align-items: center;
}

.lead__thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
  box-shadow: var(--shadow);
}

.lead__thumb img { width: 100%; height: 100%; object-fit: cover; }
.lead__title { font-size: 30px; line-height: 1.2; margin: 12px 0 10px; }
.lead__title a:hover { color: var(--accent); }
.lead__desc { color: var(--text-dim); margin: 0 0 18px; }
.lead__buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }

/* Вопрос зрителю */

.askbox {
  background: linear-gradient(140deg, rgba(90, 211, 106, .10), rgba(255, 204, 77, .06));
  border: 1px solid rgba(90, 211, 106, .3);
  border-radius: var(--radius);
  padding: 24px;
}

.askbox__title { font-size: 23px; margin: 0 0 8px; }
.askbox__note { color: var(--text-dim); margin: 0 0 16px; max-width: 640px; }
.askbox__form { display: grid; gap: 12px; max-width: 720px; }

.askbox__form textarea,
.askbox__form input[type=text] {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 14px;
  font: inherit;
  font-size: 15.5px;
}

.askbox__form textarea { resize: vertical; }

.askbox__form textarea:focus,
.askbox__form input:focus { outline: 2px solid rgba(90, 211, 106, .45); border-color: var(--accent); }

.askbox__row { display: flex; gap: 12px; flex-wrap: wrap; }
.askbox__row label { flex: 1; min-width: 180px; }
.askbox__more { margin: 14px 0 0; }

/* Поля-подписи прячем: рядом стоят подсказки внутри полей */
.sr { display: block; }
.sr > span { position: absolute; left: -9999px; }

/* Призыв подписаться */

.subscribe {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}

.subscribe__title { font-size: 22px; margin: 0 0 6px; }
.subscribe__note { color: var(--text-dim); margin: 0; }

.btn--big { padding: 14px 26px; font-size: 16.5px; }
.btn--sub { padding: 8px 16px; font-size: 14px; }

/* Кнопка на странице ролика */

.watch { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 16px 0 0; }
.watch__note { color: var(--text-dim); font-size: 13.5px; max-width: 340px; }

.foot__links { display: flex; gap: 18px; flex-wrap: wrap; }
.foot__links a:hover { color: var(--accent); }

@media (max-width: 760px) {
  .home { gap: 34px; }
  .lead { grid-template-columns: 1fr; gap: 16px; }
  .lead__title { font-size: 23px; }
  .lead__buttons .btn { flex: 1; text-align: center; }
  .askbox { padding: 18px; }
  .askbox__title { font-size: 20px; }
  .subscribe { padding: 20px; }
  .btn--big { width: 100%; text-align: center; }
}

/* ======================= главная с чатом справа ======================= */

.homewrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 34px;
  align-items: start;
  padding-top: 26px;
  padding-bottom: 60px;
}

.homewrap .home { padding: 0; }

.chat {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 120px);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.chat__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.chat__title { font-size: 15px; margin: 0; }
.chat__me { font-size: 12px; color: var(--text-dim); }
.chat__me a { color: var(--accent); }

.chat__list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  min-height: 220px;
  max-height: 46vh;
}

.chat__msg { margin: 0 0 12px; font-size: 14.5px; line-height: 1.45; word-wrap: break-word; }
.chat__msg b { color: var(--accent); }
.chat__msg span { color: var(--text-dim); font-size: 11.5px; }
.chat__empty, .chat__warn { color: var(--text-dim); font-size: 14px; margin: 0; }
.chat__warn { color: var(--danger); }

.chat__form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }

.chat__form input {
  flex: 1;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  padding: 9px 12px;
  font: inherit;
  font-size: 14.5px;
}

.chat__form input:focus { outline: 2px solid rgba(90, 211, 106, .45); border-color: var(--accent); }

.chat__join { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 16px; margin: 0; border-top: 1px solid var(--line); }
.chat__note { color: var(--text-dim); font-size: 12.5px; }

@media (max-width: 1000px) {
  .homewrap { grid-template-columns: 1fr; gap: 30px; }
  .chat { position: static; max-height: none; }
  .chat__list { max-height: 320px; }
}

/* ============================== игра ============================== */

.playfield {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #05070b;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  touch-action: none;
}

.playfield:fullscreen { aspect-ratio: auto; height: 100vh; border-radius: 0; }

#space { width: 100%; height: 100%; display: block; touch-action: none; }

.hud {
  position: absolute;
  left: 14px; top: 12px;
  display: flex;
  gap: 16px;
  font-size: 13.5px;
  color: var(--text-dim);
  text-shadow: 0 1px 4px #000;
  pointer-events: none;
}

.hud b { color: var(--accent); }

.hud__note {
  position: absolute;
  left: 14px; bottom: 12px; right: 14px;
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
  text-shadow: 0 1px 4px #000;
  pointer-events: none;
}

.hud__fire, .hud__full {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(14, 17, 22, .55);
  color: #fff;
  font: inherit;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(2px);
}

.hud__fire {
  right: 18px; bottom: 18px;
  width: 96px; height: 96px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  display: none;
}

.hud__fire:active { background: rgba(90, 211, 106, .45); }

.hud__full { right: 14px; top: 12px; padding: 7px 14px; font-size: 13px; }

/* На телефоне игра во весь экран по ширине и с крупной кнопкой огня */
@media (max-width: 900px), (pointer: coarse) {
  .playfield { aspect-ratio: 3 / 4; }
  .hud__fire { display: block; }
  .hud { font-size: 12.5px; gap: 12px; }
}

/* указатели на чужие корабли и джойстик под пальцем */
.radar {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.radar__dot {
  position: absolute;
  left: 50%; top: 50%;
  width: 0; height: 0;
  transform-origin: 0 0;
}

.radar__dot i {
  position: absolute;
  left: -4px; top: -128px;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 5px 9px 5px;
  border-color: transparent transparent rgba(255, 107, 94, .9) transparent;
}

.radar__dot b {
  position: absolute;
  left: -14px; top: -146px;
  width: 34px;
  text-align: center;
  font-size: 10.5px;
  color: rgba(255, 150, 140, .95);
  text-shadow: 0 1px 3px #000;
}

.stick {
  position: absolute;
  display: none;
  width: 96px; height: 96px;
  margin: -48px 0 0 -48px;
  border: 2px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
  pointer-events: none;
}

.stick::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: rgba(90, 211, 106, .8);
}

/* таблица счёта и кнопка звука в игре */
.board {
  position: absolute;
  right: 14px; top: 54px;
  display: grid;
  gap: 3px;
  min-width: 132px;
  font-size: 12.5px;
  pointer-events: none;
}

.board__row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 9px;
  background: rgba(14, 17, 22, .5);
  border-radius: 7px;
  color: var(--text-dim);
  text-shadow: 0 1px 3px #000;
}

.board__row--me { color: var(--accent); }
.board__row b { color: #fff; }

.hud__sound {
  position: absolute;
  right: 14px; bottom: 18px;
  padding: 7px 14px;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(14, 17, 22, .55);
  color: #fff;
  border-radius: 999px;
  cursor: pointer;
}

@media (max-width: 900px), (pointer: coarse) {
  .hud__sound { bottom: auto; top: 52px; right: 14px; }
  .board { top: 92px; font-size: 11.5px; min-width: 112px; }
}

/* ракеты: показание захвата и кнопка пуска */
.hud__lock {
  padding: 1px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .2);
  color: var(--text-dim);
}

.hud__lock--on {
  color: #06210d;
  background: var(--accent-2);
  border-color: transparent;
  font-weight: 700;
}

.hud__rocket {
  position: absolute;
  right: 128px; bottom: 30px;
  width: 74px; height: 74px;
  display: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  border: 1px solid rgba(255, 204, 77, .5);
  background: rgba(255, 204, 77, .18);
  color: #ffe9ad;
  border-radius: 999px;
  cursor: pointer;
}

.hud__rocket:active { background: rgba(255, 204, 77, .5); color: #2a1c00; }

@media (max-width: 900px), (pointer: coarse) {
  .hud__rocket { display: block; }
}
