:root {
  --bg: #020617;
  --panel: rgba(9, 14, 28, 0.98);
  --panel-soft: rgba(15, 23, 42, 0.92);
  --accent: #22c55e;
  --accent-soft: rgba(34, 197, 94, 0.12);
  --border: rgba(71, 85, 105, 0.45);
  --text: #f8fafc;
  --muted: #a8b3c7;
  --radius-lg: 1.25rem;
  --radius-md: 1rem;
  --shadow-soft: 0 20px 50px rgba(0, 0, 0, 0.42);
  --transition-fast: 0.15s ease-out;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.92) 0, rgba(2, 6, 23, 0.98) 34%, #000 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.page,
.shell {
  width: 100%;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem 1.5rem;
  padding: 1.2rem 1.2rem 0.6rem;
}

.title-block {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}

.disc-badge {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  flex-shrink: 0;
  position: relative;
  background: radial-gradient(circle at 30% 30%, #22c55e, #16a34a 45%, #052e16 100%);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.5), 0 14px 28px rgba(0, 0, 0, 0.65);
}

.disc-badge::before,
.disc-badge::after {
  content: "";
  position: absolute;
  border-radius: inherit;
}

.disc-badge::before {
  inset: 10px;
  border: 2px solid rgba(15, 23, 42, 0.6);
}

.disc-badge::after {
  inset: 5px;
  border: 2px solid rgba(190, 242, 100, 0.35);
}

.eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #86efac;
}

.title-copy h1,
.hero-copy h2,
.video-copy h3 {
  margin: 0;
}

.title-copy h1 {
  font-size: 1.4rem;
  letter-spacing: 0.03em;
}

.subtitle {
  max-width: 58ch;
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.lang-switch {
  display: flex;
  gap: 0.4rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
}
.lang-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-family: inherit;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), transform 0.1s ease-out;
}
.lang-btn.active {
  background: var(--accent-soft);
  color: #bbf7d0;
  font-weight: 600;
}
.lang-btn:hover { transform: translateY(-1px); }

.back-link {
  padding: 0.72rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  color: #e2e8f0;
  transition: border var(--transition-fast), transform var(--transition-fast), background var(--transition-fast);
}

.back-link:hover {
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(34, 197, 94, 0.08);
  transform: translateY(-1px);
}

.panel {
  background: linear-gradient(180deg, rgba(11, 17, 32, 0.98), rgba(2, 6, 23, 0.98));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.library {
  padding: 0 1.2rem 1.2rem;
}

.library-controls {
  padding: 1rem 1.05rem;
  margin-bottom: 1rem;
}

.search-label {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.search-input {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(71, 85, 105, 0.5);
  background: rgba(15, 23, 42, 0.95);
  color: var(--text);
  outline: none;
  transition: border var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input:focus {
  border-color: rgba(34, 197, 94, 0.65);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.45);
}

.filter-group + .filter-group {
  margin-top: 0.9rem;
}

.filter-group-label {
  margin-bottom: 0.45rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.filter-pill {
  appearance: none;
  border: 1px solid rgba(71, 85, 105, 0.45);
  background: rgba(15, 23, 42, 0.95);
  color: #e2e8f0;
  border-radius: 999px;
  padding: 0.58rem 0.9rem;
  cursor: pointer;
  transition: border var(--transition-fast), background var(--transition-fast), transform var(--transition-fast), color var(--transition-fast);
}

.filter-pill:hover,
.filter-pill:focus-visible,
.filter-pill.active {
  border-color: rgba(34, 197, 94, 0.58);
  background: rgba(34, 197, 94, 0.12);
  color: #d1fae5;
  transform: translateY(-1px);
  outline: none;
}

.results-copy {
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.video-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  border: 1px solid rgba(71, 85, 105, 0.38);
  background: linear-gradient(180deg, rgba(9, 14, 28, 1), rgba(2, 6, 23, 1));
  overflow: hidden;
  min-width: 0;
}

.video-card[hidden] {
  display: none;
}

.video-frame {
  min-height: 230px;
  background: #020617;
  border-bottom: 1px solid rgba(71, 85, 105, 0.32);
}

.video-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 230px;
  border: 0;
  background: #020617;
}

.video-frame--custom {
  padding: 0;
}

.video-copy {
  padding: 0.95rem 1rem 1rem;
}

.video-copy h3 {
  font-size: 1.06rem;
  line-height: 1.25;
}

.video-copy p {
  margin: 0.7rem 0 0;
  color: #d5deea;
  line-height: 1.58;
  font-size: 0.92rem;
}

.video-meta {
  color: #95a6bd !important;
}

.yt-shell {
  height: 100%;
}

.yt-player {
  position: relative;
  min-height: 230px;
  height: 100%;
  overflow: hidden;
  background: #000;
  cursor: pointer;
}

.yt-player iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 230px;
  border: 0;
}

.yt-shell--mirrored iframe {
  transform: scaleX(-1);
  transform-origin: center;
}

.yt-overlay-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.38);
  background: rgba(2, 6, 23, 0.74);
  color: #f8fafc;
  border-radius: 999px;
  padding: 0.75rem 1.1rem;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  transition: opacity var(--transition-fast), border var(--transition-fast), background var(--transition-fast);
  z-index: 2;
}

.yt-overlay-play:hover,
.yt-overlay-play:focus-visible {
  border-color: rgba(34, 197, 94, 0.6);
  background: rgba(34, 197, 94, 0.12);
  outline: none;
}

.yt-shell.is-playing .yt-overlay-play {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 1100px) {
  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

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

@media (max-width: 520px) {
  .topbar,
  .library,
  .hero {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .hero {
    margin-left: 0.85rem;
    margin-right: 0.85rem;
  }

  .topbar {
    padding-top: 1rem;
  }

  .title-copy h1 {
    font-size: 1.2rem;
  }

  .library-controls {
    padding: 0.9rem;
  }

  .video-frame,
  .video-frame iframe,
  .yt-player,
  .yt-player iframe {
    min-height: 220px;
  }
}
