:root {
  --bg: #f6f6f4; --card: #fff; --text: #1d1d1f; --muted: #6b6b70;
  --line: #e4e4e1; --accent: #d9480f; --accent-text: #fff; --danger-bg: #fdecea; --danger: #a4281a;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111113; --card: #1b1b1e; --text: #ececee; --muted: #9a9aa2;
    --line: #2c2c31; --accent: #ff7a3d; --accent-text: #111; --danger-bg: #3a1c19; --danger: #ffb4a8;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; overflow-wrap: break-word; }
a { color: inherit; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px 48px; }
.top { max-width: 960px; margin: 0 auto; padding: 18px 16px; }
.logo { font-weight: 700; font-size: 18px; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.logo .dot { width: 12px; height: 12px; border-radius: 4px; background: var(--accent); }
.muted { color: var(--muted); }
h1 { font-size: clamp(24px, 4vw, 34px); line-height: 1.2; margin: 8px 0; }
h2 { font-size: 18px; margin: 32px 0 12px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }

.hero { padding: 32px 0 8px; }
.search { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.search input { flex: 1 1 280px; min-width: 0; padding: 14px 16px; font-size: 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 18px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.ghost { background: transparent; }
.btn.block { display: flex; width: 100%; margin-top: 10px; }
.btn.tiny { padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.share:not(:disabled) { border-color: var(--accent); color: var(--accent); }

.alert { margin-top: 16px; padding: 12px 16px; border-radius: 12px; background: var(--danger-bg); color: var(--danger); }

.recent { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.recent a { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; text-decoration: none;
  background: var(--card); border: 1px solid var(--line); }
.recent img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: none; }
.recent span { display: flex; flex-direction: column; min-width: 0; }
.recent strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.back { display: inline-block; margin: 8px 0 16px; color: var(--muted); text-decoration: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card.head .title { margin-top: 0; overflow-wrap: anywhere; }
.card h2 { margin-top: 0; }
.facts { display: grid; gap: 12px; margin: 16px 0 0; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts > div, .facts dd { min-width: 0; }
.facts dd { margin: 2px 0 0; }
.facts .btn { flex: none; }
.row { display: flex; gap: 8px; align-items: center; min-width: 0; }
.wrap-row { flex-wrap: wrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; }
@media (max-width: 720px) { .grid { grid-template-columns: 1fr; } }
.player video { width: 100%; max-height: 72vh; border-radius: 12px; background: #000; display: block; }
.side { display: flex; flex-direction: column; gap: 24px; }
.thumb { width: 100%; max-height: 220px; object-fit: contain; border-radius: 10px; background: var(--bg); display: block; }
.kv { width: 100%; border-collapse: collapse; margin-top: 6px; }
.kv th, .kv td { text-align: left; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.kv th { font-weight: 400; color: var(--muted); }
.kv td { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- адаптивность ---------- */
.recent { grid-template-columns: minmax(0, 1fr); }
.recent li, .recent a, .card, .side, .player { min-width: 0; }
.card.head .muted { overflow-wrap: anywhere; }
.player video { max-height: min(72vh, 720px); }
@media (max-width: 480px) {
  .wrap { padding: 0 12px 40px; }
  .top { padding: 14px 12px; }
  .card { padding: 16px; border-radius: 12px; }
  .hero { padding-top: 16px; }
  .search input { flex-basis: 100%; }
  .search .btn { flex: 1 1 auto; }
  .grid { gap: 16px; }
  .kv th, .kv td { font-size: 14px; }
}
@media (min-width: 1280px) {
  .wrap, .top { max-width: 1080px; }
}
