:root {
  --bg: #060b14;
  --panel: #101826;
  --panel-2: #172235;
  --text: #eef2f7;
  --muted: #9fb0c9;
  --line: #24324a;
  --accent: #ff3d00;
  --accent-2: #ff7b33;
  --danger: #e64a4a;
  --website: #1d8f4e;
  --forums: #365dff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

.site-banner-wrap {
  width: 100%;
  background: #08111f;
  border-bottom: 1px solid var(--line);
}

.site-banner-link { display: block; }

.site-banner {
  width: 100%;
  max-height: 210px;
  object-fit: cover;
}

.layout-shell {
  max-width: 1500px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 24px;
  padding: 20px;
}

.sidebar {
  position: sticky;
  top: 20px;
  align-self: start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
}

.sidebar-brand { margin-bottom: 18px; }

.brand {
  font-size: 34px;
  font-weight: 800;
  text-decoration: none;
}

.tagline {
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
}

.side-nav,
.quick-links {
  display: grid;
  gap: 10px;
}

.side-link,
.button,
.chip {
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
}

.button.danger {
  background: var(--danger);
  border-color: transparent;
}

.website-btn {
  background: linear-gradient(135deg, var(--website), #29b36a);
  border-color: transparent;
}

.forums-btn {
  background: linear-gradient(135deg, var(--forums), #5f84ff);
  border-color: transparent;
}

.side-section { margin-top: 22px; }

.side-heading {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.chip {
  width: 100%;
  justify-content: flex-start;
  margin-bottom: 8px;
}

.chip.active {
  background: linear-gradient(135deg, #273a59, #1b2740);
  border-color: #4a628f;
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  margin-bottom: 22px;
}

.menu-toggle {
  display: none;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 24px;
}

.searchbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  width: 100%;
}

.searchbar input,
input[type="text"],
input[type="password"],
input[type="file"],
textarea,
select {
  width: 100%;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}

.hero,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
}

.hero h1,
.watch-meta h1,
.auth-card h1,
.narrow h1 {
  margin-top: 0;
}

.hero h1 {
  font-size: 44px;
  margin-bottom: 12px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 14px;
}

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

.video-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.video-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: #0d1420;
}

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

.thumb-category {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
}

.video-meta { padding: 16px; }

.video-meta h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.video-meta h3,
.watch-meta h1,
.brand,
.share-label {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.video-meta p { line-height: 1.45; }

.compact-grid { margin-bottom: 26px; }

.watch-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 20px;
}

.video-player {
  width: 100%;
  border-radius: 16px;
  background: black;
}

.player-note { margin-top: 12px; }

.description {
  margin: 18px 0;
  line-height: 1.55;
  color: #dce6f5;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.description,
.description * {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.description a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

label {
  display: block;
  margin: 14px 0 8px;
  font-weight: 700;
}

.alert {
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 12px;
}

.alert.error {
  background: rgba(230, 74, 74, 0.12);
  border: 1px solid rgba(230, 74, 74, 0.5);
}

.alert.success {
  background: rgba(58, 167, 109, 0.12);
  border: 1px solid rgba(58, 167, 109, 0.5);
}

.narrow {
  max-width: 820px;
  margin: 0 auto;
}

.muted { color: var(--muted); }
.small { font-size: 14px; }
.empty-state { text-align: center; }
.share-label { margin-top: 18px; }

.share-box {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  min-width: 0;
}

.share-box input {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main-area { min-width: 0; }

.watch-meta p,
.watch-meta a,
.video-meta p,
.video-meta a,
.side-link,
.chip,
.tagline {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.searchbar input { min-width: 0; }

.login-inline,
.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.login-inline {
  justify-self: end;
}

.login-inline input {
  width: 250px;
  min-width: 0;
}

.topbar-actions {
  justify-self: end;
}

.top-upload-btn { white-space: nowrap; }

.watch-meta,
.card,
.video-meta,
.share-box,
.login-inline,
.searchbar,
.topbar-actions {
  min-width: 0;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .searchbar {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .login-inline,
  .topbar-actions {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .login-inline input {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 960px) {
  .layout-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(86vw, 330px);
    border-radius: 0 22px 22px 0;
    transform: translateX(-105%);
    transition: transform .2s ease;
    z-index: 20;
    overflow-y: auto;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .watch-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .layout-shell {
    padding: 12px;
  }

  .site-banner {
    max-height: 120px;
  }

  .hero,
  .card {
    padding: 18px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: stretch;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
  }

  .searchbar,
  .login-inline,
  .topbar-actions,
  .share-box {
    width: 100%;
    min-width: 0;
  }

  .searchbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    min-width: 0;
  }

  .searchbar input {
    width: 100%;
    min-width: 0;
  }

  .login-inline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    width: 100%;
    margin-top: 0;
    justify-self: stretch;
  }

  .login-inline input {
    width: 100%;
    min-width: 0;
  }

  .searchbar .button,
  .topbar-actions .button {
    width: 100%;
  }

  .share-box {
    flex-direction: column;
  }
}

.section-title-row,
.hero-actions {
  flex-wrap: wrap;
}

.watch-meta,
.video-card,
.sidebar,
.card {
  min-width: 0;
}

.watch-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0;
}

.description a {
  color: #8ec5ff;
  text-decoration: underline;
}

.description a:hover {
  text-decoration-thickness: 2px;
}


.watch-layout {
  display: grid;
  gap: 20px;
}

.player-wrap {
  padding: 16px;
}

.video-player {
  width: 100%;
  max-width: 100%;
  border-radius: 16px;
  background: #000;
}

.watch-meta .description {
  margin: 18px 0;
  line-height: 1.7;
  white-space: normal;
  overflow-wrap: anywhere;
}

.watch-meta .description a {
  color: #8fc7ff;
  text-decoration: underline;
}

.notice {
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid #3a4e6d;
  border-radius: 14px;
  background: #0e1524;
  color: #d5deec;
}

.share-label {
  display: block;
  margin: 14px 0 8px;
  color: var(--muted);
  font-size: 14px;
}

.share-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.watch-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0;
}

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  margin: 10px 0 18px;
}

.alert.error {
  background: rgba(230, 74, 74, .15);
  border: 1px solid rgba(230, 74, 74, .5);
}

.alert.success {
  background: rgba(29, 143, 78, .15);
  border: 1px solid rgba(29, 143, 78, .5);
}

.narrow {
  max-width: 900px;
  margin: 0 auto;
}

.embed-body {
  margin: 0;
  background: #060b14;
  color: #eef2f7;
  font-family: Arial, Helvetica, sans-serif;
}

.embed-shell {
  width: 100%;
  min-height: 100vh;
  background: #060b14;
}

.embed-toplink {
  display: block;
  padding: 14px 16px;
  text-decoration: none;
  color: #eef2f7;
  background: linear-gradient(180deg, rgba(16,24,38,.98), rgba(16,24,38,.92));
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.embed-toplink strong {
  display: block;
  font-size: 16px;
}

.embed-kicker {
  display: block;
  margin-bottom: 4px;
  color: #9fb0c9;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.embed-player-wrap {
  width: 100%;
  background: #000;
}

.embed-player {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0;
}

@media (max-width: 960px) {
  .share-box {
    grid-template-columns: 1fr;
  }
}


.prompt-login-form { display: inline-flex; gap: 12px; align-items: center; }
.auth-help { margin-top: 12px; }
