:root {
  --bg: #0f0f12;
  --bg-elevated: rgba(19, 19, 24, 0.92);
  --bg-soft: rgba(30, 30, 38, 0.82);
  --line: rgba(255, 255, 255, 0.08);
  --text: #f5f7fb;
  --muted: #b7bcc8;
  --accent: #ff415c;
  --accent-gold: #ffcf73;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Roboto", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 87, 115, 0.25), transparent 26%),
    radial-gradient(circle at top right, rgba(255, 207, 115, 0.14), transparent 24%),
    linear-gradient(180deg, #111115 0%, #0b0b0e 100%);
}

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

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "left right"
    "search search";
  gap: 0.9rem;
  padding: 0.95rem 1rem 1rem;
  backdrop-filter: blur(20px);
  background: rgba(10, 10, 14, 0.8);
  border-bottom: 1px solid var(--line);
}

.topbar__left,
.topbar__right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar__left {
  grid-area: left;
  min-width: 0;
}

.topbar__right {
  grid-area: right;
  justify-content: flex-end;
}

.icon-button {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  flex: none;
}

.icon-button span {
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  text-decoration: none;
}

.brand img {
  width: 72px;
  height: 34px;
  padding: 4px 6px;
  object-fit: contain;
  object-position: center;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
  flex: none;
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
}

.brand__text strong {
  font-size: 1rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand__text span {
  display: none;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.searchbox {
  grid-area: search;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.searchbox input {
  min-width: 0;
  padding: 0.9rem 1rem;
  color: var(--text);
  border: 0;
  background: transparent;
}

.searchbox__button {
  padding: 0.9rem 1.05rem;
  color: var(--text);
  border: 0;
  background: rgba(255, 255, 255, 0.06);
}

.topbar__right .chip-button {
  display: none;
}

.page {
  display: block;
}

.sidebar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  padding: 0.7rem 0.8rem calc(0.7rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(10, 10, 14, 0.88);
  backdrop-filter: blur(22px);
}

.sidebar__item {
  display: grid;
  gap: 0.35rem;
  justify-items: center;
  padding: 0.6rem 0.25rem;
  color: var(--muted);
  text-decoration: none;
  border-radius: 18px;
  font-size: 0.7rem;
  text-align: center;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.sidebar__item:hover,
.sidebar__item--active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.content-grid {
  display: grid;
  gap: 1rem;
  padding: 1rem 1rem calc(7.1rem + env(safe-area-inset-bottom));
}

.watch-column,
.playlist-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.player-card,
.channel-card,
.message-card,
.comments-card,
.playlist-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}

.player-card {
  padding: 1rem;
}

.player-frame {
  position: relative;
  width: min(100%, 360px);
  margin: 0 auto;
  aspect-ratio: 9 / 16;
  max-height: 64vh;
  overflow: hidden;
  border-radius: 26px;
  background: #000;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
}

.player-frame__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-frame__gradient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), transparent 38%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.66), transparent 34%);
  pointer-events: none;
}

.player-badges,
.player-caption {
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  z-index: 1;
  display: flex;
  gap: 0.55rem;
}

.player-badges {
  top: 0.9rem;
  flex-wrap: wrap;
}

.player-badges span {
  padding: 0.45rem 0.72rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.82rem;
}

.player-caption {
  bottom: 1rem;
  flex-direction: column;
}

.player-caption p,
.player-caption strong {
  margin: 0;
}

.player-caption p {
  color: rgba(255, 255, 255, 0.84);
}

.player-caption strong {
  font-size: 1.2rem;
  line-height: 1.2;
}

.start-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(6, 6, 9, 0.74);
  z-index: 2;
}

.start-overlay[hidden] {
  display: none;
}

.start-overlay__card {
  width: min(100%, 300px);
  padding: 1.3rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  text-align: center;
  background: rgba(18, 18, 23, 0.95);
  box-shadow: var(--shadow);
}

.start-overlay__card p {
  margin: 0 0 1rem;
  line-height: 1.45;
}

.start-overlay__card button,
.subscribe-button,
.chip-button,
.avatar-button {
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.start-overlay__card button:hover,
.subscribe-button:hover,
.chip-button:hover,
.avatar-button:hover {
  transform: translateY(-2px);
}

.start-overlay__card button,
.chip-button,
.subscribe-button {
  border: 1px solid transparent;
  border-radius: 999px;
}

.start-overlay__card button,
.chip-button--primary,
.subscribe-button {
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, #ff6e7f 100%);
}

.watch-meta {
  width: min(100%, 420px);
  margin: 0.95rem auto 0;
  display: grid;
  gap: 0.95rem;
}

.watch-meta h1,
.channel-card h2,
.message-card h3,
.comments-card h3,
.playlist-card h3 {
  margin: 0;
}

.watch-meta h1 {
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  line-height: 1.05;
}

.watch-meta p {
  margin: 0.5rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.watch-meta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.chip-button {
  padding: 0.82rem 1rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.chip-button--primary {
  border-color: rgba(255, 255, 255, 0.1);
}

.avatar-button {
  width: 40px;
  height: 40px;
  color: #1c1309;
  font-weight: 700;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffcf73 0%, #ffe7b9 100%);
}

.channel-card,
.message-card,
.comments-card,
.playlist-card {
  padding: 1rem;
}

.channel-card {
  display: grid;
  gap: 1rem;
}

.channel-card__main {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.channel-card__main img {
  width: 78px;
  height: 46px;
  padding: 5px 6px;
  object-fit: contain;
  object-position: center;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  flex: none;
}

.channel-card__main h2 {
  font-size: 1.4rem;
}

.channel-card__main p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.subscribe-button {
  width: 100%;
  padding: 0.95rem 1.15rem;
}

.message-card p {
  margin: 1rem 0 0;
  line-height: 1.7;
  color: #dde1ea;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.section-heading span {
  color: var(--muted);
  font-size: 0.88rem;
}

.comment {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 0.8rem;
  padding-top: 1rem;
}

.comment + .comment {
  margin-top: 0.3rem;
}

.comment__avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: #1b1020;
  font-weight: 700;
  background: linear-gradient(135deg, #ffcf73 0%, #ff7b8f 100%);
}

.comment__meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.comment__meta span,
.comment p,
.suggestion__body p,
.suggestion__body small,
.audio-filename {
  color: var(--muted);
}

.comment p {
  margin: 0.45rem 0 0;
  line-height: 1.55;
}

.playlist-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.playlist-card--compact {
  gap: 0.5rem;
}

.suggestion {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 0.75rem;
  align-items: center;
}

.suggestion__thumb {
  position: relative;
  height: 72px;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 65, 92, 0.5), rgba(255, 207, 115, 0.55));
}

.suggestion__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  background: #fff;
}

.suggestion__thumb span {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  padding: 0.28rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  background: rgba(0, 0, 0, 0.68);
}

.suggestion__thumb--rose {
  background:
    linear-gradient(135deg, rgba(255, 76, 120, 0.85), rgba(255, 157, 177, 0.35)),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.18), transparent 45%);
}

.suggestion__thumb--gold {
  background:
    linear-gradient(135deg, rgba(255, 207, 115, 0.95), rgba(130, 82, 24, 0.45)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.2), transparent 42%);
}

.suggestion__thumb--sky {
  background:
    linear-gradient(135deg, rgba(105, 190, 255, 0.8), rgba(255, 89, 124, 0.45)),
    radial-gradient(circle at center, rgba(255, 255, 255, 0.18), transparent 40%);
}

.suggestion__body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.suggestion__body strong {
  line-height: 1.3;
}

.suggestion__body p,
.suggestion__body small,
.audio-filename {
  margin: 0;
}

.audio-filename {
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  overflow-wrap: anywhere;
}

@media (min-width: 400px) {
  .brand__text span {
    display: block;
  }
}

@media (min-width: 720px) {
  .topbar {
    grid-template-columns: auto minmax(300px, 1fr) auto;
    grid-template-areas: "left search right";
    align-items: center;
    padding: 1rem 1.25rem;
  }

  .topbar__right .chip-button {
    display: inline-flex;
  }

  .brand img {
    width: 86px;
    height: 38px;
  }

  .player-frame {
    width: min(100%, 420px);
    max-height: none;
  }

  .page {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .sidebar {
    position: sticky;
    top: 86px;
    left: auto;
    right: auto;
    bottom: auto;
    height: calc(100vh - 86px);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 0.75rem;
    border-top: 0;
    border-right: 1px solid var(--line);
    background: rgba(10, 10, 14, 0.55);
  }

  .content-grid {
    padding: 1.25rem 1.25rem 1.5rem;
  }

  .sidebar__item {
    min-height: 74px;
  }

  .channel-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .subscribe-button {
    width: auto;
    white-space: nowrap;
  }
}

@media (min-width: 1100px) {
  .content-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.85fr);
    align-items: start;
    gap: 1.35rem;
  }

  .player-card {
    padding: 1.2rem;
  }
}

@media (max-width: 380px) {
  .topbar {
    padding: 0.85rem 0.85rem 0.95rem;
  }

  .content-grid {
    padding: 0.85rem 0.85rem calc(7rem + env(safe-area-inset-bottom));
  }

  .brand img {
    width: 66px;
    height: 31px;
  }

  .brand__text strong {
    font-size: 0.92rem;
  }

  .player-card,
  .channel-card,
  .message-card,
  .comments-card,
  .playlist-card {
    padding: 0.9rem;
  }

  .player-frame {
    border-radius: 22px;
  }

  .suggestion {
    grid-template-columns: 96px 1fr;
  }

  .suggestion__thumb {
    height: 64px;
  }
}
