:root {
  --bg: #0E1014;
  --bar: #12151A;
  --hero: #14171D;
  --surface: #171A21;
  --surface-2: #1F232C;
  --surface-3: #252A34;
  --line: #2A2F3A;
  --line-2: #3A404D;
  --text: #F2F3F5;
  --text-2: #D5D9E0;
  --muted: #9AA3B2;
  --t: #F0A94A;
  --t-ink: #1A1206;
  --ct: #6AA6FF;
  --ct-text: #7FB2FF;
  --ct-ink: #0A1626;
  --danger: #FF6B6B;
  --radius: 14px;
  --display: "Russo One", Rubik, system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: Rubik, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.4;
  min-height: 100vh;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--t); text-decoration: none; }
svg { display: block; }
.hidden { display: none !important; }

/* ---------- каркас ---------- */
#app { min-height: 100vh; display: flex; flex-direction: column; }
.page { flex: 1; display: flex; flex-direction: column; gap: 18px; padding: 16px 16px 24px; }
.page.with-nav { padding-bottom: calc(92px + var(--safe-b)); }
.page.with-bar { padding-bottom: calc(96px + var(--safe-b)); }

.topbar { display: flex; align-items: center; gap: 12px; }
.topbar .crumbs { flex: 1; min-width: 0; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .heading { flex: 1; font-size: 18px; font-weight: 600; }

.icon-btn {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px;
  border: 0; background: var(--surface-2); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.icon-btn.outline { background: var(--surface); border: 1px solid var(--line); }
.icon-btn.on { color: var(--t); }
.icon-btn.danger { color: var(--danger); }

.section-label {
  font-size: 13px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted);
}
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.muted { color: var(--muted); }

/* ---------- главная ---------- */
.brand { display: flex; align-items: center; justify-content: space-between; }
.brand-left { display: flex; align-items: center; gap: 12px; }
.logo { width: 44px; height: 44px; border-radius: 12px; background: var(--t); display: flex; align-items: center; justify-content: center; }
.brand-name { font-family: var(--display); font-size: 20px; letter-spacing: .5px; }
.brand-sub { font-size: 13px; color: var(--muted); }

.search {
  display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
}
.search:focus-within { border-color: var(--line-2); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; }
.search input::placeholder { color: #8A93A3; }
.search input::-webkit-search-cancel-button { filter: invert(.7); }

.maps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.map-card {
  position: relative; height: 84px; padding: 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
}
.map-card:active { background: var(--surface-2); }
.map-card::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 40%;
  background: repeating-linear-gradient(135deg, transparent 0 9px, rgba(240,169,74,.07) 9px 10px);
  pointer-events: none;
}
.map-card .name { position: relative; z-index: 1; font-family: var(--display); font-size: 17px; letter-spacing: .4px; text-transform: uppercase; }
.map-card .counts { position: relative; z-index: 1; display: flex; gap: 10px; font-size: 12px; font-weight: 500; }
.c-t { color: var(--t); } .c-ct { color: var(--ct-text); } .c-r { color: var(--muted); }

/* ---------- нижняя навигация / панель ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  height: calc(68px + var(--safe-b)); padding-bottom: var(--safe-b);
  border-top: 1px solid var(--line); background: var(--bar);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 11px; color: var(--muted);
}
.bottom-nav a.active { color: var(--t); }

.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; gap: 10px; padding: 12px 16px calc(16px + var(--safe-b));
  border-top: 1px solid var(--line); background: var(--bar);
}
.btn-primary {
  flex: 1; height: 52px; border: 0; border-radius: 12px;
  background: var(--t); color: var(--t-ink); font-size: 16px; font-weight: 600;
}
.btn-primary:disabled { opacity: .55; }
.btn-square { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: flex; align-items: center; justify-content: center; padding: 0; }

/* ---------- экран карты ---------- */
.hero {
  position: relative; overflow: hidden; margin: -16px -16px 0; padding: 16px 16px 20px;
  background: var(--hero); border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 16px;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(135deg, transparent 0 11px, rgba(240,169,74,.08) 11px 12px);
}
.hero > * { position: relative; }
.hero-title { font-family: var(--display); font-size: 34px; letter-spacing: .6px; text-transform: uppercase; line-height: 1.1; }
.hero-sub { font-size: 14px; color: var(--muted); margin-top: 4px; }

.seg {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px;
  border-radius: 14px; background: var(--bg); border: 1px solid var(--line);
}
.seg.flat { background: var(--surface); border-radius: 12px; }
.seg button {
  height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 15px; font-weight: 500;
}
.seg.flat button { height: 40px; border-radius: 9px; font-size: 14px; }
.seg button.on-t { background: var(--t); color: var(--t-ink); font-weight: 600; }
.seg button.on-ct { background: var(--ct); color: var(--ct-ink); font-weight: 600; }

.chips { display: flex; gap: 8px; overflow-x: auto; margin: -4px -16px 0; padding: 0 16px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; height: 36px; padding: 0 14px; border-radius: 18px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: 14px; font-weight: 500;
}
.chip .n { color: var(--muted); margin-left: 4px; }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 600; }
.chip.on .n { color: var(--bg); opacity: .6; }

.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.tabs button {
  height: 44px; border: 0; background: none; color: var(--muted); font-size: 15px; font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.on { color: var(--text); border-bottom-color: var(--t); font-weight: 600; }
.tabs .n { margin-left: 6px; color: var(--muted); font-weight: 500; }
.form .tabs { margin-top: -6px; }
.tag.round { background: rgba(167,139,250,.16); color: #C4B5FD; }

.list { display: flex; flex-direction: column; gap: 10px; }
.item {
  display: flex; gap: 12px; padding: 10px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
}
.item:active { background: var(--surface-2); }
.thumb {
  position: relative; flex: 0 0 96px; height: 72px; border-radius: 10px; overflow: hidden;
  background: repeating-linear-gradient(135deg, #232832 0 8px, #262B36 8px 16px);
  display: flex; align-items: center; justify-content: center;
}
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb .play { position: relative; }
.thumb .dur {
  position: absolute; right: 6px; bottom: 5px; font-size: 11px; font-weight: 500;
  background: rgba(14,16,20,.82); padding: 1px 5px; border-radius: 4px;
}
.item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.item-title { font-size: 15px; font-weight: 500; line-height: 1.3; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.tag { padding: 2px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); }
.tag.t { background: rgba(240,169,74,.15); color: var(--t); }
.tag.ct { background: rgba(106,166,255,.15); color: var(--ct-text); }

.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text-2); font-weight: 500; margin-bottom: 6px; }

/* ---------- лайнап ---------- */
.player {
  position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--line);
  background: repeating-linear-gradient(135deg, #1C2029 0 10px, #1F242E 10px 20px);
  aspect-ratio: 16 / 9;
}
.player video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.player .noplay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; padding: 16px; text-align: center; }
h1.title { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.25; }
.tags.big { font-size: 13px; }
.tags.big .tag { padding: 4px 10px; border-radius: 8px; background: var(--surface-2); }
.tags.big .tag.t { background: rgba(240,169,74,.15); }
.tags.big .tag.ct { background: rgba(106,166,255,.15); }

.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.shot { display: flex; flex-direction: column; gap: 6px; border: 0; background: none; padding: 0; text-align: left; }
.shot .img {
  width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; border: 1px solid var(--line); overflow: hidden;
  background: repeating-linear-gradient(135deg, #232832 0 8px, #262B36 8px 16px);
}
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot span { font-size: 12px; color: var(--text-2); }

.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.steps .num {
  flex: 0 0 26px; height: 26px; border-radius: 13px; background: var(--surface-2); color: var(--t);
  font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center;
}
.steps .txt { font-size: 15px; line-height: 1.45; color: #E3E6EB; padding-top: 2px; white-space: pre-line; }
.desc { font-size: 15px; line-height: 1.5; color: #E3E6EB; white-space: pre-line; margin: 0; }

/* полноэкранный просмотр скриншотов */
.viewer {
  position: fixed; inset: 0; z-index: 50; background: rgba(5,6,8,.96);
  display: flex; flex-direction: column;
}
.viewer-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; }
.viewer-img { flex: 1; display: flex; align-items: center; justify-content: center; padding: 8px; min-height: 0; }
.viewer-img img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.viewer-nav { display: flex; justify-content: center; gap: 16px; padding: 16px 16px calc(20px + var(--safe-b)); }

/* ---------- форма ---------- */
.badge-admin { padding: 4px 10px; border-radius: 8px; background: rgba(106,166,255,.15); color: var(--ct-text); font-size: 12px; font-weight: 500; }
.form { display: flex; flex-direction: column; gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea {
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 15px; outline: 0;
}
.field input, .field select { height: 44px; padding: 0 12px; }
.field textarea { padding: 10px 12px; resize: vertical; min-height: 92px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--line-2); }
.field input::placeholder, .field textarea::placeholder { color: #8A93A3; }
.field .hint { font-size: 12px; color: var(--muted); }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.opt { height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: 13px; padding: 0 4px; }
.opt.on { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 600; }

.drop {
  position: relative; min-height: 76px; border-radius: 12px; border: 1.5px dashed var(--line-2); background: #13161C;
  display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 14px; color: var(--text-2); padding: 12px;
  overflow: hidden;
}
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop video { width: 100%; max-height: 200px; border-radius: 8px; background: #000; }
.drop .x { position: absolute; top: 8px; right: 8px; z-index: 2; }
.shot-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.shot-slot { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-3); border: 1px solid var(--line); }
.shot-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot-slot .rm {
  position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 13px; border: 0;
  background: rgba(14,16,20,.85); color: var(--text); display: flex; align-items: center; justify-content: center; padding: 0;
}
.shot-slot .lbl { position: absolute; left: 6px; bottom: 4px; font-size: 11px; color: var(--text); text-shadow: 0 1px 2px #000; }
.shot-add { position: relative; aspect-ratio: 1; border-radius: 10px; border: 1.5px dashed var(--line-2); background: #13161C; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.shot-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.progress { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--t); transition: width .2s; }
.form-error { color: var(--danger); font-size: 14px; }

/* ---------- прочее ---------- */
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(100px + var(--safe-b)); z-index: 60;
  padding: 12px 16px; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 500;
  text-align: center; transition: opacity .2s, transform .2s; opacity: 0; transform: translateY(8px); pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }
.skeleton { border-radius: var(--radius); background: var(--surface); height: 84px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.fatal { padding: 48px 24px; text-align: center; color: var(--muted); }
.fatal b { display: block; color: var(--text); font-size: 17px; margin-bottom: 8px; }
