@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&family=Sora:wght@300;400;500;600&display=swap');

:root {
  --bg: #0c0f12;
  --bg-soft: #10151b;
  --panel: #141a21;
  --panel-strong: #171f29;
  --line: #242c36;
  --text: #f4f6fb;
  --muted: #9aa7b6;
  --accent: #53d6c7;
  --accent-2: #f3b369;
  --shadow: 0 22px 40px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --max-width: 1100px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Sora", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(900px 480px at 80% -10%, rgba(83, 214, 199, 0.16), transparent 60%),
    radial-gradient(700px 380px at 10% -20%, rgba(243, 179, 105, 0.12), transparent 50%),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.04) 0%, transparent 45%),
    repeating-linear-gradient(0deg,
      rgba(255, 255, 255, 0.035),
      rgba(255, 255, 255, 0.035) 1px,
      transparent 1px,
      transparent 120px);
  pointer-events: none;
  opacity: 0.2;
  z-index: -1;
}

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

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

button,
input {
  font: inherit;
  color: inherit;
}

.wrap {
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(12, 15, 18, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

body[data-page="player"] {
  background:
    radial-gradient(900px 500px at 70% -40%, rgba(83, 214, 199, 0.08), transparent 60%),
    #050607;
}

.player-topbar {
  background: rgba(5, 6, 7, 0.95);
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
}

.brand {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-weight: 600;
  letter-spacing: 0.03em;
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(83, 214, 199, 0.15);
  border: 1px solid rgba(83, 214, 199, 0.35);
}

.nav {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.nav-link {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: 0.2s ease;
}

.nav-link:hover {
  color: var(--text);
  border-color: var(--line);
}

.nav-link.is-active {
  color: var(--text);
  /* border-color: rgba(83, 214, 199, 0.45); */
  /* background: rgba(83, 214, 199, 0.12); */
}

/* Player Page Specifics */
body[data-page="player"],
body[data-page="home"] {
  background: #000;
}

.player-topbar {
  background: #000;
  border-bottom: none;
}

.player-topbar .brand {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  font-family: sans-serif;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  border: none;
  outline: none;
}

.brand-mark {
  height: 40px;
  width: auto;
  object-fit: contain;
  border: none;
}

.player-nav {
  gap: 20px;
}

.player-nav .nav-link {
  color: #ccc;
  font-weight: 600;
  text-transform: lowercase;
  border: none;
  padding: 0;
  border-radius: 0;
}

.player-nav .nav-link:hover,
.player-nav .nav-link.is-active {
  color: #fff;
  background: transparent;
  border: none;
}

.player-actions .topbar-search {
  background: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  width: 250px;
  color: #333;
  font-size: 0.9rem;
}

.player-actions .search-shell::before,
.player-actions .search-shell::after {
  display: none;
  /* Hide the custom search icon from main style */
}

.player-actions .topbar-search::placeholder {
  color: #888;
}

/* Video Player Area */
.player-view {
  gap: 0;
}

.video-shell-wrapper {
  position: relative;
  width: 100%;
  background: #000;
  /* margin-bottom: 0; */
}

.video-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: none;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

.iframe-overlay-fix {
  /* If iframe captures clicks, we might need a transparent overlay or similar, 
       but for visual clone we'll just put the controls on top */
}

.video-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Let clicks pass to iframe if needed, or set to auto if we simulate everything */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.center-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #00bfa5;
  /* Teal color */
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  pointer-events: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

.video-controls-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  padding: 20px 16px 16px;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-bar-container {
  height: 4px;
  width: 100%;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.progress-bar {
  position: absolute;
  inset: 0;
}

.progress-fill {
  height: 100%;
  background: #00bfa5;
  border-radius: 2px;
}

.progress-thumb {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
}

.controls-left,
.controls-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.control-icon-btn {
  background: transparent;
  border: none;
  padding: 0;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.control-icon-btn:hover {
  opacity: 1;
}

.time-display {
  font-size: 0.85rem;
  font-family: sans-serif;
  display: flex;
  align-items: center;
  gap: 12px;
}

.volume-icon {
  display: flex;
  align-items: center;
}

.volume-slider-container {
  width: 80px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  position: relative;
  margin-right: 8px;
}

.volume-slider {
  position: absolute;
  inset: 0;
}

.volume-fill {
  height: 100%;
  background: #00bfa5;
  border-radius: 2px;
}

.volume-thumb {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
}

/* Control Strip (Server/Episode/Quality) */
.control-strip {
  background: #111;
  /* Darker background */
  border: none;
  border-radius: 0;
  padding: 0;
  display: flex;
  gap: 1px;
  /* Divider effect */
}

.control-segment {
  background: #222;
  border: none;
  border-radius: 0;
  color: #ccc;
  font-family: sans-serif;
  font-size: 0.85rem;
  padding: 14px 20px;
  justify-content: flex-start;
  /* Left align content usually, or center */
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  /* For caret positioning if needed */
}

.control-segment:hover {
  background: #2a2a2a;
  color: #fff;
}

.control-segment--server {
  background: #000;
  color: #fff;
  min-width: 150px;
  justify-content: center;
}

.control-label-text {
  font-weight: 600;
}

.control-caret-up {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 4px solid #fff;
  margin-left: auto;
  /* Push to right if needed, or gap */
  opacity: 0.5;
}

#episodeSegment {}

#qualitySegment {}

#downloadLink {
  background: #111;
  color: #ccc;
  text-decoration: none;
}

/* Info Section */
.player-info-new {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: #000;
  color: #fff;
  align-items: flex-start;
}

.poster-thumb {
  width: 60px;
  flex-shrink: 0;
}

.poster-img {
  width: 100%;
  aspect-ratio: 1;
  /* Square or close to it in screenshot */
  border-radius: 4px;
  object-fit: cover;
}

.info-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.anime-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  font-family: sans-serif;
}

.anime-meta {
  font-size: 0.8rem;
  color: #888;
}

.meta-item {}

display: flex;
gap: 10px;
}

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

.player-nav {
  margin-left: 18px;
}

.search-shell {
  position: relative;
}

.topbar-search {
  width: min(240px, 42vw);
  padding: 10px 14px 10px 34px;
  border-radius: 6px;
  background: #e9eef6;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #0c0f12;
  font-size: 0.9rem;
}

.topbar-search::placeholder {
  color: #5c6572;
}

.search-shell::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 14px;
  height: 14px;
  border: 2px solid #5c6572;
  border-radius: 50%;
  transform: translateY(-50%);
}

.search-shell::after {
  content: "";
  position: absolute;
  left: 20px;
  top: 58%;
  width: 8px;
  height: 2px;
  background: #5c6572;
  transform: rotate(45deg);
}

.ghost-button {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  transition: 0.2s ease;
}

.ghost-button:hover {
  border-color: rgba(83, 214, 199, 0.4);
  color: var(--accent);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 32px;
  padding: 34px 0 20px;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.7rem;
  color: var(--accent);
  margin: 0;
}

.hero-title {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: clamp(2rem, 2.6vw, 2.8rem);
  margin: 0;
}

.hero-subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 500px;
}

.search-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 220px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 16px;
  outline: none;
  transition: 0.2s ease;
}

.search-input:focus {
  border-color: rgba(83, 214, 199, 0.5);
  box-shadow: 0 0 0 3px rgba(83, 214, 199, 0.16);
}

.primary-button {
  border: none;
  padding: 12px 18px;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(83, 214, 199, 0.8), rgba(83, 214, 199, 0.3));
  color: #031715;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease;
}

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

.stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-card {
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 12px 14px;
  min-width: 140px;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.hero-card {
  background: linear-gradient(170deg, rgba(23, 31, 41, 0.95), rgba(14, 19, 26, 0.95));
  border: 1px solid rgba(83, 214, 199, 0.2);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.hero-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.badge {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(83, 214, 199, 0.4);
  color: var(--accent);
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(83, 214, 199, 0.6);
  animation: pulse 2s infinite;
}

.hero-list {
  list-style: none;
  margin: 14px 0 18px;
  padding: 0;
  color: var(--muted);
}

.hero-list li {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.hero-footnote {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0 18px;
}

.section-header h2 {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  margin: 0 0 6px;
}

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

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--muted);
  cursor: pointer;
  transition: 0.2s ease;
}

.filter-btn.is-active,
.filter-btn:hover {
  border-color: rgba(83, 214, 199, 0.45);
  color: var(--text);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
  padding-bottom: 40px;
}

.post-card {
  background: linear-gradient(160deg, rgba(22, 29, 38, 0.98), rgba(13, 18, 26, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: rgba(83, 214, 199, 0.3);
}

.post-link {
  display: block;
  color: inherit;
}

.post-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: #0b0f15;
}

.post-body {
  padding: 14px;
}

.post-title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--muted);
}

.pill {
  border: 1px solid rgba(83, 214, 199, 0.4);
  color: var(--accent);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.7rem;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.08) 50%, transparent 100%);
  transform: translateX(-120%);
  animation: shimmer 1.5s infinite;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  color: var(--muted);
}

.player-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr);
  gap: 24px;
  padding: 28px 0 40px;
}

.player-page {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 24px 0 50px;
}

.player-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.video-shell {
  background: #0b0d10;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px;
  border-radius: 6px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.player-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 4px;
  background: #000;
}

.control-strip {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.9fr 0.6fr;
  gap: 10px;
  background: #161718;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 10px;
}

.control-segment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #1a1b1d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e8ecf4;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
}

.control-segment--server {
  cursor: default;
}

.control-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #7b8490;
}

.control-caret {
  width: 10px;
  height: 10px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #b5bcc7;
}

.control-segment.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.server-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.server-btn {
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #1a1b1d;
  color: #cdd3db;
  cursor: pointer;
  transition: 0.2s ease;
}

.server-btn.is-active,
.server-btn:hover {
  border-color: rgba(83, 214, 199, 0.5);
  color: #ffffff;
}

.server-empty {
  font-size: 0.8rem;
  color: #7b8490;
}

.player-status {
  margin: 0;
  font-size: 0.85rem;
}

.player-info {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 18px;
  background: #0f1114;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 16px;
}

.poster-frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(83, 214, 199, 0.2), rgba(15, 20, 28, 0.9));
}

.poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.poster-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.85rem;
  background: rgba(10, 15, 20, 0.6);
}

.details-body h1,
.info-body h1 {
  margin: 0 0 6px;
  font-size: 1.4rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(83, 214, 199, 0.14);
  color: var(--accent);
  font-size: 0.75rem;
}

.install-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 24px;
  padding: 36px 0 50px;
}

.install-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.install-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

.install-help {
  background: rgba(16, 22, 30, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 22px;
}

.steps {
  padding-left: 18px;
  color: var(--muted);
}

.steps li {
  margin-bottom: 10px;
}

.callout {
  margin-top: 18px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(83, 214, 199, 0.08);
  border: 1px solid rgba(83, 214, 199, 0.18);
}

.footer {
  border-top: 1px solid var(--line);
  padding: 18px 0 30px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

@keyframes shimmer {
  100% {
    transform: translateX(120%);
  }
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 8px rgba(83, 214, 199, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(83, 214, 199, 0);
  }
}

@media (max-width: 980px) {

  .hero,
  .player-grid,
  .install-grid {
    grid-template-columns: 1fr;
  }

  .nav {
    margin-left: 0;
  }

  .topbar-inner {
    flex-wrap: wrap;
  }

  .player-actions {
    width: 100%;
  }

  .topbar-search {
    width: 100%;
  }

  .control-strip {
    grid-template-columns: 1fr;
  }

  .player-info {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-title {
    font-size: 2rem;
  }

  .posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}