@font-face {
  font-family: "CoolveticaLocal";
  src: local("Arial");
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #05050a;
  --bg2: #0b0b12;
  --fg: #f7f4e8;
  --muted: #a9a1ad;
  --glass: rgba(255, 250, 230, 0.055);
  --glass-strong: rgba(255, 250, 230, 0.105);
  --warm: #ffd47a;
  --warm-soft: rgba(255, 212, 122, 0.34);
  --cool: #94e8ff;
  --rose: #ff8fcf;
  --red: #ff4d6d;
  --border: rgba(255, 244, 210, 0.16);
  --border-hover: rgba(255, 236, 170, 0.58);
  --shadow: 0 24px 70px rgba(0,0,0,.45);
}

html { scroll-behavior: smooth; }
body {
  font-family: "CoolveticaLocal", Arial, sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 212, 122, 0.12), transparent 28%),
    radial-gradient(circle at 82% 20%, rgba(148, 232, 255, 0.10), transparent 24%),
    radial-gradient(circle at 50% 100%, rgba(255, 143, 207, 0.08), transparent 34%),
    linear-gradient(180deg, #080810 0%, #030305 55%, #09070a 100%);
  color: var(--fg);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before, body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
body::before {
  opacity: .45;
  background:
    radial-gradient(circle at 11% 72%, rgba(255,255,255,0.18) 0 1px, transparent 2px),
    radial-gradient(circle at 34% 38%, rgba(255,255,255,0.13) 0 1.5px, transparent 3px),
    radial-gradient(circle at 67% 64%, rgba(255,255,255,0.15) 0 1px, transparent 2px),
    radial-gradient(circle at 89% 30%, rgba(255,255,255,0.11) 0 1px, transparent 2px);
  background-size: 280px 280px, 360px 360px, 420px 420px, 310px 310px;
}
body::after {
  background:
    linear-gradient(rgba(255,255,255,.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 70px 70px;
  mask-image: radial-gradient(circle at center, black 20%, transparent 80%);
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }

#particles-js {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .45;
}

.content {
  position: relative;
  z-index: 2;
  padding: 104px clamp(18px, 4vw, 52px) 118px;
  max-width: 1380px;
  margin: 0 auto;
}

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  height: 66px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(18px, 4vw, 44px);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(19, 3, 6, .86), rgba(0, 0, 0, .54));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 18px 42px rgba(0,0,0,.36), 0 0 40px rgba(255,24,51,.08);
  backdrop-filter: blur(16px) saturate(1.2);
}

.logo { font-size: 18px; letter-spacing: .04em; text-shadow: 0 0 16px rgba(255,77,109,.45); font-weight: 900; }
.header-nav { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; gap: clamp(16px, 3vw, 34px); }
.header-nav a, .header-nav button {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: .05em;
  text-transform: lowercase;
  transition: color .2s ease, text-shadow .2s ease;
  background: none;
  border: 0;
  cursor: pointer;
}
.header-nav a:hover, .header-nav button:hover { color: var(--fg); text-shadow: 0 0 18px var(--warm-soft); }

.side-dock {
  position: fixed;
  z-index: 21;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(10,10,16,.54);
  backdrop-filter: blur(14px);
  display: grid;
  gap: 10px;
  box-shadow: var(--shadow);
}
.dock-link {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.055);
  border: 1px solid transparent;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.dock-link:hover, .dock-link.active { transform: translateY(-2px); border-color: var(--border-hover); background: rgba(255,255,255,.1); }
.dock-icon { width: 22px; height: 22px; object-fit: contain; }

.hero {
  min-height: 72vh;
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  align-items: center;
  gap: clamp(24px, 6vw, 80px);
}
.hero-title, .page-title {
  font-size: clamp(54px, 9.5vw, 128px);
  line-height: .83;
  letter-spacing: -.075em;
  text-transform: lowercase;
  text-shadow: 0 0 18px rgba(255, 77, 109, .22), 0 0 40px rgba(255, 212, 122, .12);
}
.page-title { font-size: clamp(46px, 8vw, 96px); margin-bottom: 16px; }
.hero-subtitle, .page-subtitle {
  margin-top: 22px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.55;
  max-width: 760px;
}
.hero-actions, .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.hero-btn, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--fg);
  cursor: pointer;
  font-weight: 900;
  letter-spacing: .02em;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.hero-btn:hover, .btn:hover { transform: translateY(-2px); border-color: var(--border-hover); background: rgba(255,255,255,.11); }
.hero-btn-primary, .btn.primary { border-color: transparent; background: linear-gradient(135deg, var(--red), var(--warm)); color: #080810; }
.btn.danger { background: rgba(255,77,109,.16); border-color: rgba(255,77,109,.45); color: #ffd7de; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; }

.live-panel, .glass-card, .video-card, .admin-card, .form-card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.035));
  border-radius: 26px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(12px);
}
.live-panel { overflow: hidden; }
.panel-topbar {
  height: 44px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  color: var(--muted);
  text-transform: lowercase;
  letter-spacing: .08em;
}
.panel-body { padding: 20px; display: grid; gap: 14px; }
.pulse-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(0,0,0,.24);
  border: 1px solid rgba(255,255,255,.09);
}
.pulse-card span { color: var(--muted); display: block; text-transform: lowercase; margin-bottom: 6px; }
.pulse-card strong { font-size: 28px; letter-spacing: -.04em; }

.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-hover), transparent);
  margin: 20px 0 42px;
}
.section-title {
  font-size: clamp(28px, 5vw, 54px);
  letter-spacing: -.055em;
  margin-bottom: 18px;
  text-transform: lowercase;
}
.grid { display: grid; gap: 18px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.video-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.video-card { overflow: hidden; cursor: pointer; transition: transform .2s ease, border-color .2s ease; }
.video-card:hover { transform: translateY(-6px); border-color: var(--border-hover); }
.video-thumb {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: radial-gradient(circle at 25% 20%, rgba(255,77,109,.65), transparent 32%), linear-gradient(135deg, #161622, #08080d);
}
.video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-thumb::after {
  content: "▶";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 54px;
  color: rgba(255,255,255,.92);
  text-shadow: 0 10px 26px rgba(0,0,0,.45);
}
.video-info { padding: 16px; }
.video-info h3 { font-size: 22px; margin-bottom: 8px; letter-spacing: -.035em; }
.video-info p { color: var(--muted); line-height: 1.45; }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.08);
  color: var(--muted);
  font-size: 12px;
  text-transform: lowercase;
}

input, textarea, select {
  width: 100%;
  color: var(--fg);
  background: rgba(0,0,0,.28);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 13px 14px;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--border-hover); }
textarea { min-height: 120px; resize: vertical; }
label { display: grid; gap: 8px; color: var(--muted); font-weight: 900; }
.form-stack { display: grid; gap: 14px; }
.form-card { padding: 22px; }

.message {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.08);
  color: var(--muted);
}
.message.show { display: block; }
.message.error { color: #ffd7de; background: rgba(255,77,109,.13); }
.message.success { color: #d6fff9; background: rgba(148,232,255,.11); }

.player-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.player-topbar {
  height: 64px;
  padding: 0 18px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,.58);
}
.video-player-wrap { padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; }
.video-player-card { min-width: 0; }
video { width: 100%; max-height: 70vh; background: #000; border-radius: 20px; border: 1px solid var(--border); }
.watch-info, .comments-panel { padding: 18px; }
.comment {
  display: flex; gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover;
  display: grid; place-items: center;
  background: rgba(255,255,255,.1);
  color: var(--warm);
  font-weight: 900;
  flex: 0 0 auto;
}

.admin-layout {
  display: grid;
  grid-template-columns: 250px minmax(0,1fr);
  gap: 22px;
}
.admin-sidebar {
  position: sticky;
  top: 86px;
  align-self: start;
  padding: 14px;
}
.admin-sidebar a {
  display: flex;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--muted);
}
.admin-sidebar a:hover, .admin-sidebar a.active {
  color: var(--fg);
  background: rgba(255,255,255,.08);
}
.admin-card { padding: 20px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 13px; text-transform: lowercase; }

.search-row { display: flex; gap: 12px; margin: 20px 0; }
.search-row input { max-width: 460px; }

.footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--border);
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.hidden { display: none !important; }

@media (max-width: 960px) {
  .side-dock { display: none; }
  .hero, .grid.three, .grid.two, .video-player-wrap, .admin-layout { grid-template-columns: 1fr; }
  .content { padding-top: 92px; }
  .header-nav { gap: 14px; }
  .admin-sidebar { position: static; }
}

@media (max-width: 620px) {
  .topbar { height: auto; min-height: 66px; flex-wrap: wrap; gap: 10px; padding-top: 12px; padding-bottom: 12px; }
  .header-nav { width: 100%; justify-content: flex-start; overflow-x: auto; padding-bottom: 4px; }
  .content { padding-top: 118px; }
}


/* Mobile layout only activates when app.js detects a phone and adds html.is-mobile.
   Desktop/tablet layout is untouched. */
html.is-mobile,
html.is-mobile body {
  overflow-x: hidden;
}

html.is-mobile .content {
  max-width: 100%;
  padding-left: 14px;
  padding-right: 14px;
  padding-bottom: 100px;
}

html.is-mobile .hero {
  grid-template-columns: 1fr;
  gap: 22px;
  min-height: auto;
}

html.is-mobile .hero-title,
html.is-mobile .page-title {
  font-size: clamp(42px, 16vw, 70px);
  line-height: .9;
  word-break: break-word;
}

html.is-mobile .hero-subtitle,
html.is-mobile .page-subtitle {
  font-size: 16px;
  line-height: 1.5;
}

html.is-mobile .grid,
html.is-mobile .grid.two,
html.is-mobile .grid.three,
html.is-mobile .video-grid,
html.is-mobile .admin-layout,
html.is-mobile .video-player-wrap {
  grid-template-columns: 1fr !important;
}

html.is-mobile .hero-actions,
html.is-mobile .actions {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
}

html.is-mobile .hero-btn,
html.is-mobile .btn {
  width: 100%;
  min-height: 46px;
}

html.is-mobile .topbar {
  min-height: 64px;
  height: auto;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  padding-bottom: 10px;
}

html.is-mobile .header-nav {
  width: 100%;
  overflow-x: auto;
  flex-wrap: nowrap;
  justify-content: flex-start;
  -webkit-overflow-scrolling: touch;
}

html.is-mobile .header-nav a,
html.is-mobile .header-nav button {
  white-space: nowrap;
  flex: 0 0 auto;
}

html.is-mobile .side-dock {
  position: fixed;
  left: 50%;
  right: auto;
  top: auto;
  bottom: 12px;
  transform: translateX(-50%);
  width: auto;
  max-width: calc(100vw - 24px);
  display: flex;
  grid-auto-flow: column;
  gap: 8px;
  padding: 8px;
  border-radius: 999px;
}

html.is-mobile .dock-link {
  width: 42px;
  height: 42px;
}

html.is-mobile .admin-sidebar {
  position: static;
  display: flex;
  overflow-x: auto;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}

html.is-mobile .admin-sidebar a {
  white-space: nowrap;
  flex: 0 0 auto;
}

html.is-mobile .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

html.is-mobile table {
  min-width: 620px;
}

html.is-mobile input,
html.is-mobile textarea,
html.is-mobile select {
  font-size: 16px;
  min-height: 46px;
}

html.is-mobile video {
  max-height: 58vh;
}

html.is-mobile .footer {
  padding-bottom: 86px;
}
