:root {
  --bg: #040208;
  --panel-width: min(calc(100% - 2rem), 1132px);
  --content-width: min(calc(100% - 7.75rem), 1008px);
  --topbar-height: 127px;
  --font-main: "Exo 2", "Segoe UI", sans-serif;
  --text-main: #ffffff;
  --text-soft: rgba(255, 255, 255, 0.72);
  --text-muted: rgba(255, 255, 255, 0.5);
  --topbar-bg: #250033;
  --nav-bg: rgba(106, 80, 118, 0.48);
  --nav-bg-active: rgba(134, 95, 158, 0.62);
  --chip-bg: rgba(0, 0, 0, 0.42);
  --chip-bg-hover: rgba(20, 10, 28, 0.66);
  --chip-border: rgba(255, 255, 255, 0.08);
  --accent: #b329d6;
  --shadow-soft: 0 8px 18px rgba(0, 0, 0, 0.24);
  --shadow-strong: 0 18px 42px rgba(0, 0, 0, 0.36);
}

body {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.78) 0, rgba(0, 0, 0, 0.24) 22%, rgba(0, 0, 0, 0.82) 100%),
    url("img/Back.png") center top / cover no-repeat;
  color: var(--text-main);
  font-family: var(--font-main);
}

.page {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

.page__panel {
  position: absolute;
  inset: 0 auto 0 50%;
  width: var(--panel-width);
  transform: translateX(-50%);
  background:
    linear-gradient(180deg, rgba(79, 2, 109, 0.9), rgba(59, 0, 81, 0.94)),
    url("img/Rectangle 2.svg") center top / 100% 100% no-repeat;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.page__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 18%, rgba(0, 0, 0, 0.08));
  opacity: 0.3;
  pointer-events: none;
}

.topbar {
  position: relative;
  z-index: 1;
  background: var(--topbar-bg);
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.38),
    inset 0 4px 50px rgba(0, 0, 0, 0.24);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  width: min(calc(100% - 3rem), 1560px);
  min-height: var(--topbar-height);
  margin: 0 auto;
}

.brand {
  flex-shrink: 0;
}

.brand img {
  width: clamp(140px, 10.5vw, 200px);
  height: auto;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

.main-nav {
  display: flex;
  flex: 1;
  justify-content: center;
  align-items: center;
  gap: clamp(1rem, 3vw, 4rem);
}

.main-nav__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: clamp(120px, 10.5vw, 200px);
  min-height: 50px;
  padding: 0 1.5rem;
  border: 1px solid rgba(0, 0, 0, 0.78);
  border-radius: 15px;
  background: var(--nav-bg);
  box-shadow: var(--shadow-soft);
  color: rgba(255, 255, 255, 0.56);
  font-size: clamp(18px, 1.3vw, 24px);
  font-weight: 600;
  letter-spacing: 0.01em;
  backdrop-filter: blur(10px);
  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease;
}

.main-nav__link:hover {
  transform: translateY(-1px);
  background: rgba(134, 95, 158, 0.68);
  color: var(--text-main);
}

.main-nav__link--active {
  background: var(--nav-bg-active);
  color: var(--text-main);
}

.profile-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.profile-actions__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.profile-actions__button:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.profile-actions__button img {
  width: 56px;
  height: 56px;
}

.profile-actions__button--compact {
  width: 36px;
  height: 36px;
}

.profile-actions__button--compact img {
  width: 20px;
  height: 20px;
}

.page__main {
  position: relative;
  z-index: 1;
  width: var(--panel-width);
  margin: 0 auto;
  padding: 38px 0 72px;
}

.content-shell {
  width: var(--content-width);
  margin: 0 auto;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  color: var(--text-muted);
  font-size: 16px;
}

.breadcrumbs a:first-child,
.breadcrumbs span {
  color: rgba(255, 255, 255, 0.46);
}

.breadcrumbs a:last-child {
  color: rgba(255, 255, 255, 0.78);
}

.hero {
  margin-top: 10px;
}

.hero__header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.hero__title {
  margin: 0;
  max-width: 760px;
  color: var(--text-main);
  font-size: clamp(2rem, 1.9vw, 36px);
  line-height: 1.15;
  font-weight: 700;
  text-shadow: 0 8px 26px rgba(0, 0, 0, 0.36);
}

.hero__rating {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: auto;
  padding-top: 8px;
  flex-shrink: 0;
}

.hero__favorite {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.hero__favorite img {
  width: 24px;
  height: 24px;
}

.hero__rating p {
  margin: 0;
  color: var(--accent);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.hero__controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 28px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 20px;
}

.chip-select {
  display: inline-flex;
}

.chip-select select,
.share-button {
  border: 1px solid var(--chip-border);
  border-radius: 15px;
  background: var(--chip-bg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.chip-select select {
  min-width: 122px;
  height: 39px;
  padding: 0 1rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.01em;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-width: 155px;
  height: 39px;
  margin-left: auto;
  padding: 0 0.9rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
}

.chip-select select:hover,
.share-button:hover {
  background: var(--chip-bg-hover);
}

.share-button img {
  width: 16px;
  height: 20px;
}

.share-button[disabled] {
  opacity: 0.82;
  cursor: wait;
}

.hero__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(179, 41, 214, 0.94), rgba(120, 20, 168, 0.9));
  box-shadow: var(--shadow-soft);
  color: var(--text-main);
  font-size: 16px;
  font-weight: 600;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease,
    background-color 0.2s ease;
}

.hero__button:hover {
  transform: translateY(-1px);
}

.hero__button--ghost {
  background: rgba(0, 0, 0, 0.32);
  color: rgba(255, 255, 255, 0.78);
}

.player {
  width: 100%;
  margin-top: 20px;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(13, 8, 22, 0.92), rgba(2, 1, 6, 0.9)),
    linear-gradient(90deg, #040404 0, #000000 28%, #030303 100%);
  box-shadow: var(--shadow-strong);
}

.page [id] {
  scroll-margin-top: 145px;
}

.player__shell {
  display: grid;
  gap: 1rem;
}

.player__video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 22px;
  background: #000000;
}

.player__meta {
  display: grid;
  gap: 0.7rem;
}

.player__eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.player__title {
  margin: 0;
  font-size: clamp(1.45rem, 2.1vw, 2rem);
  line-height: 1.15;
}

.player__description,
.player__published {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.5;
}

.player__published {
  color: var(--text-muted);
}

.player__state {
  display: grid;
  place-items: center;
  min-height: min(60vw, 520px);
  padding: 2rem;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  background: rgba(0, 0, 0, 0.26);
  color: rgba(255, 255, 255, 0.82);
  font-size: 1rem;
  text-align: center;
  line-height: 1.5;
}

.player__state--error {
  border-color: rgba(255, 107, 107, 0.28);
  color: rgba(255, 218, 218, 0.94);
}

.community {
  margin-top: 1.25rem;
  padding: 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(11, 7, 20, 0.92), rgba(4, 2, 10, 0.88));
  box-shadow: var(--shadow-strong);
}

.community__header {
  display: grid;
  gap: 0.75rem;
}

.community__eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.community__title {
  margin: 0;
  font-size: clamp(1.7rem, 2.8vw, 2.45rem);
  line-height: 1.05;
}

.community__lead {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.55;
}

.community__status {
  margin: 1rem 0 0;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.26);
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.45;
}

.community__status[data-tone="error"] {
  border-color: rgba(255, 107, 107, 0.25);
  color: rgba(255, 214, 214, 0.94);
}

.community__list {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.community__composer {
  margin-top: 1rem;
}

.community-compose {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.24);
}

.community-compose__label {
  color: var(--text-soft);
  font-size: 0.95rem;
}

.community-compose__textarea {
  width: 100%;
  min-height: 110px;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.26);
  color: var(--text-main);
  resize: vertical;
}

.community-compose__submit {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(179, 41, 214, 0.94), rgba(120, 20, 168, 0.9));
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.community-compose__submit:disabled {
  opacity: 0.72;
  cursor: wait;
}

.community__empty {
  margin: 0;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--text-soft);
  line-height: 1.5;
}

.community-comment {
  padding: 1rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.24);
}

.community-comment__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.community-comment__author {
  color: var(--text-main);
  font-weight: 700;
}

.community-comment__body {
  margin: 0.7rem 0 0;
  color: var(--text-soft);
  line-height: 1.55;
}

.community-comment__actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.community-comment__action {
  min-height: 34px;
  padding: 0 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  cursor: pointer;
}

.community-comment__action--danger {
  border-color: rgba(255, 107, 107, 0.35);
  color: rgba(255, 214, 214, 0.96);
}

.main-nav__link:focus-visible,
.profile-actions__button:focus-visible,
.hero__favorite:focus-visible,
.chip-select select:focus-visible,
.share-button:focus-visible,
.hero__button:focus-visible,
.community-compose__textarea:focus-visible,
.community-compose__submit:focus-visible,
.community-comment__action:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.92);
  outline-offset: 3px;
}

@media (max-width: 1080px) {
  :root {
    --content-width: min(calc(100% - 3rem), 1008px);
  }

  .topbar__inner {
    width: min(calc(100% - 2rem), 1560px);
    gap: 1.25rem;
  }

  .main-nav {
    gap: 1rem;
  }

  .hero__header {
    flex-wrap: wrap;
  }

  .hero__rating {
    margin-left: 0;
    padding-top: 0;
  }
}

@media (max-width: 820px) {
  :root {
    --panel-width: min(calc(100% - 1rem), 1132px);
    --content-width: min(calc(100% - 2rem), 1008px);
  }

  .page__panel {
    width: 100%;
    transform: translateX(-50%);
  }

  .topbar__inner {
    flex-wrap: wrap;
    justify-content: center;
    padding: 1rem 0;
  }

  .main-nav {
    order: 3;
    width: 100%;
    flex-wrap: wrap;
  }

  .main-nav__link {
    flex: 1 1 180px;
  }

  .profile-actions {
    margin-left: auto;
  }

  .hero__controls {
    flex-wrap: wrap;
  }

  .share-button {
    margin-left: 0;
  }

  .hero__actions {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .page__main {
    padding: 28px 0 40px;
  }

  .content-shell {
    width: min(calc(100% - 1.25rem), 1008px);
  }

  .breadcrumbs {
    font-size: 14px;
  }

  .hero__title {
    font-size: 1.8rem;
  }

  .hero__controls {
    align-items: stretch;
  }

  .chip-select,
  .chip-select select,
  .share-button,
  .hero__button {
    width: 100%;
  }

  .share-button {
    min-width: 0;
  }

  .player,
  .community {
    border-radius: 24px;
    padding: 1rem;
  }
}
