:root {
  --bg: #07070a;
  --panel: rgba(255, 255, 255, 0.035);
  --card: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  --field: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.085);
  --text: #ece9e4;
  --muted: #9a968f;
  --gold: #f5b866;
  --gold2: #ffd9a0;
  --ink: #140d03;
  --r: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* atmospheric background: warm glow from above, cool glow below, faint stars and film grain (static, GPU-cheap) */
body::before, body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
body::before {
  background:
    radial-gradient(90% 55% at 50% -12%, rgba(245, 184, 102, 0.16), transparent 62%),
    radial-gradient(70% 50% at 115% 95%, rgba(96, 112, 210, 0.11), transparent 62%),
    radial-gradient(55% 45% at -15% 60%, rgba(210, 120, 60, 0.08), transparent 62%),
    linear-gradient(180deg, #09090c 0%, #0c0b10 45%, #070609 100%);
}
body::after {
  opacity: 0.8;
  background:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.5) 50%, transparent 51%),
    radial-gradient(1px 1px at 68% 9%, rgba(255, 236, 200, 0.45) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 84% 42%, rgba(255, 255, 255, 0.35) 50%, transparent 51%),
    radial-gradient(1px 1px at 33% 67%, rgba(255, 255, 255, 0.4) 50%, transparent 51%),
    radial-gradient(1px 1px at 52% 88%, rgba(255, 236, 200, 0.35) 50%, transparent 51%),
    radial-gradient(1px 1px at 91% 76%, rgba(255, 255, 255, 0.3) 50%, transparent 51%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.07'/%3E%3C/svg%3E");
  background-size: 420px 420px, 420px 420px, 420px 420px, 420px 420px, 420px 420px, 420px 420px, 180px 180px;
}
a { color: inherit; }
svg { width: 18px; height: 18px; fill: currentColor; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
  background: linear-gradient(rgba(7, 7, 10, 0.92), rgba(7, 7, 10, 0.78));
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.brand {
  font: 900 15px/1 "Cinzel", serif;
  letter-spacing: 0.08em; text-decoration: none;
}
.nav-cta {
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none;
  color: var(--gold2); border: 1px solid rgba(245, 184, 102, 0.35);
  padding: 8px 14px; border-radius: 999px;
}

/* ---------- hero ---------- */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 72px 16px 40px; text-align: center;
}
.stage {
  position: relative; width: min(96vw, 74svh, 680px); aspect-ratio: 1;
  container-type: inline-size;
}
#globe { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 1.4s ease; }
#globe.ready { opacity: 1; }
.axis {
  position: absolute; left: 50%; top: 3%; bottom: 3%; width: 1px; transform: translateX(-50%);
  background: linear-gradient(transparent, rgba(255, 255, 255, 0.6) 22%, rgba(255, 255, 255, 0.6) 78%, transparent);
}
.spark {
  position: absolute; left: 50%; width: 7%; aspect-ratio: 1; background: #fff;
  clip-path: polygon(50% 0, 56% 44%, 100% 50%, 56% 56%, 50% 100%, 44% 56%, 0 50%, 44% 44%);
  transform: translate(-50%, -50%);
  animation: twinkle 3.4s ease-in-out infinite;
}
.s1 { top: 23%; }
.s2 { top: 74%; animation-delay: 1.7s; }
@keyframes twinkle { 50% { opacity: 0.45; transform: translate(-50%, -50%) scale(0.7); } }
.mark {
  position: absolute; inset: 0; margin: 0; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 400; will-change: transform;
}
.mark-main {
  font: 900 13vw/1 "Cinzel", serif;
  font-size: 13.2cqw;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #fff 0%, #e4e4e4 30%, #8b8b8b 49%, #f3f3f3 62%, #a5a5a5 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.95));
}
.mark-sub {
  font: 400 4vw/1 "Cinzel", serif;
  font-size: 4.1cqw;
  letter-spacing: 0.55em; margin: 0.7em -0.55em 0 0;
  color: #ebe6dd; text-shadow: 0 2px 8px #000, 0 0 2px #000;
}
.tag {
  margin: 6px 0 22px; color: var(--muted);
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
}

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 16px 28px; border-radius: 999px;
  font: 600 13px/1 system-ui, -apple-system, sans-serif; letter-spacing: 0.18em; text-transform: uppercase;
  text-decoration: none; color: var(--ink);
  background: linear-gradient(180deg, #ffe2b3, #f2a94e);
  box-shadow: 0 0 0 1px rgba(255, 220, 170, 0.4), 0 10px 40px -10px rgba(245, 170, 80, 0.6);
  transition: transform 0.15s, opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- sections ---------- */
.wrap { max-width: 760px; margin: 0 auto; padding: 64px 16px; scroll-margin-top: 40px; }
h2 {
  font: 600 clamp(22px, 6vw, 32px)/1.2 "Cinzel", serif;
  letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 8px;
}
.lead { color: var(--muted); margin: 0 0 28px; }
.pillars {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px;
  margin: 0; padding: 0; list-style: none;
}
.pillars li { border: 1px solid var(--line); border-radius: var(--r); padding: 18px; background: var(--card); }
.pillars b { display: block; color: var(--gold2); font: 600 14px/1.3 "Cinzel", serif; letter-spacing: 0.1em; margin-bottom: 6px; }
.pillars span { color: var(--muted); font-size: 14px; }

/* ---------- form ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }
label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
input, textarea, select {
  width: 100%; padding: 13px 14px; border-radius: 10px;
  font: 16px/1.4 system-ui, -apple-system, sans-serif; letter-spacing: normal; text-transform: none;
  color: var(--text); background: var(--field); border: 1px solid var(--line);
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: rgba(245, 184, 102, 0.6); box-shadow: 0 0 0 3px rgba(245, 184, 102, 0.12); }
.full { margin-top: 14px; }
.drop {
  position: relative; margin-top: 14px; padding: 26px 16px; align-items: center; text-align: center; cursor: pointer;
  border: 1px dashed rgba(245, 184, 102, 0.45); border-radius: var(--r); background: rgba(245, 184, 102, 0.03);
  font-size: 13px; letter-spacing: normal; text-transform: none;
}
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop strong { color: var(--gold2); font-size: 15px; }
.drop.has { border-style: solid; background: rgba(245, 184, 102, 0.07); }
.tracks { display: grid; gap: 8px; margin-top: 10px; }
.track {
  display: grid; grid-template-columns: 28px 1fr 36px; align-items: start; gap: 10px;
  padding: 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card);
}
.tnum { color: var(--gold2); font: 600 14px/44px "Cinzel", serif; text-align: center; }
.tfields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; min-width: 0; }
.tfields input { padding: 10px 12px; }
.tfields small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) { .tfields { grid-template-columns: 1fr; } }
.tdel { width: 36px; height: 36px; margin-top: 4px; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.hint { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.check {
  flex-direction: row; align-items: center; gap: 10px; margin: 18px 0 20px;
  font-size: 14px; letter-spacing: normal; text-transform: none; color: var(--text);
}
.check input { width: 20px; height: 20px; padding: 0; flex: none; accent-color: var(--gold); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
form .btn { width: 100%; margin-top: 18px; }
#demo-form { padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8); }
@media (max-width: 600px) { #demo-form { padding: 16px; } }
.wrap h2::after { content: ""; display: block; width: 56px; height: 1px; margin-top: 12px; background: linear-gradient(90deg, var(--gold), transparent); }
.progress { height: 4px; margin-top: 16px; border-radius: 4px; overflow: hidden; background: var(--line); }
.progress i { display: block; height: 100%; width: 0; background: var(--gold); transition: width 0.2s; }
.msg { min-height: 1.4em; margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.msg.bad { color: #ff8a7a; }
.done { text-align: center; padding: 32px 0; }
.done h3 { font: 600 24px "Cinzel", serif; letter-spacing: 0.12em; color: var(--gold2); margin: 0 0 8px; }
.done p { color: var(--muted); margin: 0 0 24px; }

footer {
  text-align: center; color: var(--muted); border-top: 1px solid var(--line);
  padding: 36px 16px calc(36px + env(safe-area-inset-bottom));
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
}

/* ---------- admin ---------- */
.login { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 16px; }
.login form { width: min(100%, 360px); display: grid; gap: 12px; text-align: center; }
.login img { width: 150px; height: 150px; margin: 0 auto 8px; border-radius: 16px; }
.bar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(9, 9, 12, 0.92); border-bottom: 1px solid var(--line);
}
.bar img { width: 34px; height: 34px; border-radius: 8px; }
.bar h1 { flex: 1; margin: 0; font: 900 14px/1 "Cinzel", serif; letter-spacing: 0.08em; }
.icon-btn {
  background: none; color: var(--text); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 12px; font-size: 13px; cursor: pointer;
}
.tools { max-width: 900px; margin: 0 auto; padding: 12px 16px; display: grid; gap: 10px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: none; cursor: pointer; padding: 8px 14px; border-radius: 999px; font-size: 13px;
  background: var(--field); color: var(--muted); border: 1px solid var(--line);
}
.tabs button.on { background: var(--gold); color: var(--ink); border-color: transparent; }
.keys { margin: 0 16px 10px; text-align: center; font-size: 12px; color: var(--muted); }
@media (hover: none) { .keys { display: none; } }
#list {
  max-width: 900px; margin: 0 auto; display: grid; gap: 8px;
  padding: 0 16px calc(130px + env(safe-area-inset-bottom));
}
.demo {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px;
  padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
}
.demo.playing { border-color: rgba(245, 184, 102, 0.55); }
.play {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: rgba(245, 184, 102, 0.13); color: var(--gold2);
}
.meta { min-width: 0; cursor: pointer; }
.meta strong, .meta span, .now strong, .now span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta span, .now span { font-size: 13px; color: var(--muted); }
.side { text-align: right; display: grid; gap: 4px; justify-items: end; }
.badge { font-size: 11px; padding: 3px 8px; border-radius: 999px; background: #1a1a1b; color: var(--muted); white-space: nowrap; }
.s-new { background: rgba(245, 184, 102, 0.16); color: var(--gold2); }
.s-shortlist { background: rgba(120, 170, 255, 0.16); color: #a9c6ff; }
.s-signed { background: rgba(110, 220, 150, 0.16); color: #8de0aa; }
.s-rejected { opacity: 0.55; }
.stars { color: var(--gold); font-size: 11px; letter-spacing: 1px; }
.details { grid-column: 1 / -1; display: grid; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }
.details dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; word-break: break-word; }
.row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  cursor: pointer; padding: 8px 12px; border-radius: 999px; font-size: 13px; text-decoration: none;
  background: #141415; color: var(--text); border: 1px solid var(--line);
}
.chip.on { border-color: var(--gold); color: var(--gold2); }
.chip.danger { color: #ff8a7a; }
.rate button { background: none; border: 0; padding: 2px 3px; font-size: 26px; line-height: 1; color: #3a3a3a; cursor: pointer; }
.rate button.on { color: var(--gold); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: #0b0b0e; border-top: 1px solid rgba(245, 184, 102, 0.2);
  box-shadow: 0 -24px 48px -24px rgba(0, 0, 0, 0.9);
}
.pin {
  max-width: 900px; margin: 0 auto; display: grid; align-items: center; gap: 8px 12px;
  grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-areas: "thumb now controls" "seek seek seek";
}
.thumb {
  grid-area: thumb; position: relative; width: 52px; height: 52px; padding: 0; border: 0;
  border-radius: 10px; overflow: hidden; background: #000; cursor: default;
}
.thumb img, .thumb video { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb video { display: none; }
.player.video .thumb { cursor: zoom-in; box-shadow: 0 0 0 1px rgba(245, 184, 102, 0.45); }
.player.video .thumb img { display: none; }
.player.video .thumb video { display: block; }
.player.video .thumb::after { content: "⤢"; position: absolute; right: 4px; bottom: 2px; color: #fff; font-size: 13px; text-shadow: 0 1px 4px #000; }
.player.big .thumb {
  position: fixed; inset: 0; z-index: 30; width: auto; height: auto; border-radius: 0; cursor: zoom-out;
  display: grid; place-items: center; padding: 16px 16px 150px; background: rgba(4, 4, 6, 0.92); box-shadow: none;
}
.player.big .thumb video { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 14px; }
.player.big .thumb::after { content: "✕"; position: fixed; top: calc(14px + env(safe-area-inset-top)); right: 18px; bottom: auto; font-size: 22px; }
.player.big .now, .player.big .controls, .player.big .seek { position: relative; z-index: 31; }
.now { grid-area: now; min-width: 0; }
.controls { grid-area: controls; display: flex; gap: 6px; }
.controls button {
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer; display: grid; place-items: center;
  background: none; color: var(--text); border: 1px solid var(--line);
}
.controls .main { background: linear-gradient(180deg, #ffe2b3, #f2a94e); color: var(--ink); border: 0; }
.seek { grid-area: seek; display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.seek input { -webkit-appearance: none; appearance: none; flex: 1; height: 18px; padding: 0; border: 0; background: transparent; box-shadow: none; }
.seek input::-webkit-slider-runnable-track {
  height: 4px; border-radius: 4px;
  background: linear-gradient(var(--gold), var(--gold)) 0 0 / var(--p, 0%) 100% no-repeat, rgba(255, 255, 255, 0.12);
}
.seek input::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border-radius: 50%; border: 0; background: var(--gold2); }
.seek input::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); }
.seek input::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--gold); }
.seek input::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; border: 0; background: var(--gold2); }
.views { display: flex; gap: 4px; max-width: 900px; margin: 12px auto 0; padding: 0 16px; }
.views button {
  flex: 1; padding: 10px; cursor: pointer; font-size: 14px; border-radius: 10px;
  background: none; color: var(--muted); border: 1px solid var(--line);
}
.views button.on { color: var(--text); border-color: rgba(245, 184, 102, 0.5); background: rgba(245, 184, 102, 0.08); }
.traffic { max-width: 900px; margin: 0 auto; padding: 0 16px calc(140px + env(safe-area-inset-bottom)); display: grid; gap: 12px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpis .live { border-color: rgba(110, 220, 150, 0.35); }
.kpis .live small::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #6edc96; box-shadow: 0 0 0 0 rgba(110, 220, 150, 0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(110, 220, 150, 0); } 100% { box-shadow: 0 0 0 0 rgba(110, 220, 150, 0); } }
@media (max-width: 700px) { .kpis { grid-template-columns: 1fr 1fr; } }
.kpis div, .panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; min-width: 0; }
.kpis small, .kpis span { display: block; color: var(--muted); font-size: 12px; }
.kpis b { display: block; font-size: 28px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.panel h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.readout { margin: 0 0 10px; color: var(--muted); font-size: 12px; min-height: 1.4em; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 140px; border-bottom: 1px solid var(--line); }
.bars button { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; display: flex; align-items: flex-end; justify-content: center; }
.bars button::before { content: ""; display: block; width: min(100%, 44px); height: var(--h); border-radius: 4px 4px 0 0; background: var(--gold); opacity: 0.85; }
.bars button:hover::before, .bars button:focus::before { opacity: 1; background: var(--gold2); }
.axis-x { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 11px; }
.hbars { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.hbars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 13px; }
.hbars span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbars i { grid-column: 1 / -1; grid-row: 2; height: 6px; width: var(--w); min-width: 2px; border-radius: 0 4px 4px 0; background: var(--gold); opacity: 0.8; }
.hbars b { font-weight: 600; font-variant-numeric: tabular-nums; }
.hbars .none { display: block; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spark { animation: none; }
}
