/* ===== anime-freak style player ===== */
.alert-welcome .alert-content,
.alert-welcome .alert-title {
  text-align: center;
}

.alert-welcome .alert-title .site-highlight {
  display: inline-block;
  vertical-align: middle;
  line-height: 1.25;
}

.af-player {
  --chrome: #1e1e1e;
  --crt: #000;
  --green: var(--sage);
}

.af-chrome {
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* top bar: faux window + badge */
.af-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--soft);
  border-bottom: 1px dashed color-mix(in srgb, var(--border) 70%, transparent);
}

.af-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff6, #0000), var(--pink);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--border) 70%, transparent);
}

.af-bar .af-title {
  margin-left: auto;
  color: var(--ink);
  letter-spacing: .03em;
}

.af-badge {
  margin-left: auto;
  font-size: .75rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
}

/* layout */
.af-body {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 14px;
  padding: 12px;
}

.af-body--solo {
  grid-template-columns: 1fr;
}

@media (max-width: 800px) {
  .af-body {
    grid-template-columns: 1fr;
  }

  /* on small screens, keep the dot row but hide title/badge */
  .af-bar {
    justify-content: center;
    flex-wrap: wrap;
    text-align: center;
  }

  .af-bar .af-dot {
    display: inline-block;
  }

  .af-bar .af-title,
  .af-bar .af-badge {
    display: none;
  }
}

/* player screen */
.af-screen .embed {
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 0 0 2px #000, var(--shadow);
  position: relative;
}

.af-screen .embed iframe,
.af-screen .embed video {
  display: block;
  width: 100%;
  border: 0;
}

.af-screen .embed iframe {
  height: 100%;
}

.af-screen .embed--native-video {
  aspect-ratio: auto;
}

.af-screen .embed--native-video video {
  height: auto;
}

.af-screen .embed::after {
  /* faint scanlines */
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, #fff1 0 2px, #0000 2px 4px);
  mix-blend-mode: overlay;
  opacity: .25;
  pointer-events: none;
}

.af-notes {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.af-direct-link {
  margin-top: 10px;
  text-align: center;
  font-size: 0.82rem;
  color: color-mix(in srgb, var(--ink) 76%, #7b6a74);
}

.af-direct-link a {
  color: color-mix(in srgb, #7d5f7c 72%, var(--ink));
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.af-direct-link a:hover,
.af-direct-link a:focus-visible {
  color: color-mix(in srgb, #5f6f8b 74%, var(--ink));
}

.af-notes--warning {
  position: relative;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, #d8a9ae 55%, var(--border));
  border-radius: 14px;
  background:
    linear-gradient(180deg, color-mix(in srgb, #fffaf7 94%, var(--soft)), #fff),
    repeating-linear-gradient(90deg, rgba(216, 169, 174, 0.1) 0 14px, transparent 14px 28px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.af-notes--warning .chip {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  white-space: nowrap;
}

.af-notes--warning .chip--warning-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.35rem 1rem;
  border-radius: 10px;
  background: linear-gradient(180deg, #7f8e85, #6d7e74);
  border: 1px solid color-mix(in srgb, #6d7e74 72%, #fff);
  color: #fff;
  box-shadow: 0 8px 18px rgba(109, 126, 116, 0.18);
  text-align: center;
  line-height: 1;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.af-notes--warning .af-notes-close {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 1.65rem;
  height: 1.65rem;
  border: 1px solid color-mix(in srgb, var(--border) 80%, #fff);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, color 0.2s ease;
}

.af-notes--warning .af-drawer-close {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 1.65rem;
  height: 1.65rem;
  border: 1px solid color-mix(in srgb, var(--border) 80%, #fff);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, color 0.2s ease;
}

.af-notes--warning .af-notes-close:hover,
.af-notes--warning .af-notes-close:focus-visible {
  background: color-mix(in srgb, var(--soft) 70%, #fff);
  color: var(--coral);
}

.af-notes--warning .af-drawer-close:hover,
.af-notes--warning .af-drawer-close:focus-visible {
  background: color-mix(in srgb, var(--soft) 70%, #fff);
  color: var(--coral);
}

.af-notes--warning .chip--warning {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.35rem 1rem;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff7f6, #f7e7e3);
  border: 1px solid color-mix(in srgb, #d6aaa4 68%, var(--border));
  color: color-mix(in srgb, #6d403f 86%, var(--ink));
  box-shadow: 0 6px 14px rgba(124, 91, 90, 0.08);
  text-align: center;
  line-height: 1;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.af-notes--warning .chip--warning:hover,
.af-notes--warning .chip--warning:focus-visible {
  background: linear-gradient(180deg, #fff, #f9ece8);
}

.af-video-title {
  display: none;
  margin: 12px 0 6px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

@media (max-width: 800px) {
  .af-video-title {
    display: block;
  }
}

/* episode list */
.af-episodes {
  border: 1px dashed color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 12px;
  padding: 10px;
  background: color-mix(in srgb, var(--soft) 30%, white);
}

.af-head {
  color: var(--sage);
  font-weight: 700;
  margin: 4px 0 8px;
}

.af-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
  max-height: 420px;
  overflow: auto;
}

.af-list a {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: .92rem;
  line-height: 1.3;
}

.af-list a:hover {
  background: color-mix(in srgb, var(--soft) 50%, white);
}

.chat-wrap {
  max-width: 780px;
  margin: 2rem auto;
  background: var(--card, #fff);
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 18px;
  box-shadow: var(--shadow, 0 10px 30px rgba(0, 0, 0, .06));
  padding: 12px;
}


.sr-only {
  position: absolute;
  left: -9999px
}

.site-highlight {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--pink) 75%, var(--coral));
  text-decoration-thickness: .16em;
  text-underline-offset: .12em;
}

/* mobile-friendly alert welcome */
@media (max-width: 768px) {
  .alert-welcome {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto 1fr;
    gap: 0.75rem;
    padding: 1rem;
    max-width: 100%;
    align-items: start;
  }

  .alert-welcome .language-toggle-row {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    justify-content: flex-start;
  }

  .alert-welcome .alert-close {
    grid-column: 2;
    grid-row: 1;
    align-self: flex-start;
    margin: 0;
    width: 28px;
    height: 28px;
  }

  .alert-welcome .alert-content {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .alert-welcome .alert-title {
    font-size: 0.8rem;
    line-height: 1.35;
    margin: 0;
  }

  .lang-toggle-btn {
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
    height: auto;
  }
}
