/* ============================================
   Flixio.app — Dark Streaming Theme
   ============================================ */

*, *::before, *::after { box-sizing: border-box; border: 0 solid; margin: 0; padding: 0; }
html, body { min-height: 100%; }
html { line-height: 1.5; -webkit-text-size-adjust: 100%; tab-size: 4; scroll-behavior: smooth; }
body {
  background-color: #0b0d14;
  color: #f5f5f5;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: dark;
  transition: background-color 0.3s ease, color 0.3s ease;
}
html[data-theme="light"] body {
  background-color: #fafafa;
  color: #0a0a0a;
  color-scheme: light;
}
a { color: inherit; text-decoration: none; }
a:hover { color: inherit; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }
ul, ol { list-style: none; }
* { border-color: rgba(255, 255, 255, 0.1); }

/* ============================================
   CSS Variables (Flixio dark theme)
   ============================================ */
:root {
  --background: #0b0d14;
  --foreground: #f5f5f5;
  --card: #161821;
  --card-foreground: #f5f5f5;
  --popover: #161821;
  --popover-foreground: #f5f5f5;
  --primary: #ec305a;
  --primary-foreground: #fcfcfc;
  --secondary: #262626;
  --secondary-foreground: #fafafa;
  --muted: #262626;
  --muted-foreground: #a1a1a1;
  --accent: #262626;
  --accent-foreground: #fafafa;
  --destructive: #ff6568;
  --border: rgba(255, 255, 255, 0.1);
  --input: rgba(255, 255, 255, 0.15);
  --ring: #737373;
  --radius: 0.625rem;
  --spacing: 0.25rem;
  --container-7xl: 80rem;
  --max-width: 1280px;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --leading-relaxed: 1.625;
  --tracking-tight: -0.025em;
  --tracking-wide: 0.025em;
  --tracking-widest: 0.1em;
  --blur-md: 12px;
  --duration: 0.3s;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tailwind v4 color tokens used in gradients */
.c-rose-500    { color: #ff2357; }
.c-rose-600    { color: #e70044; }
.c-pink-500    { color: #f6339a; }
.c-fuchsia-500 { color: #e12afb; }
.c-fuchsia-600 { color: #c600db; }
.c-purple-700  { color: #8200da; }
.c-violet-500  { color: #8d54ff; }
.c-blue-500    { color: #3080ff; }
.c-blue-600    { color: #155dfc; }
.c-cyan-400    { color: #00d2ef; }
.c-cyan-500    { color: #00b7d7; }
.c-emerald-500 { color: #00bb7f; }
.c-teal-600    { color: #009588; }
.c-amber-500   { color: #f99c00; }
.c-yellow-400  { color: #fac800; }
.c-orange-500  { color: #fe6e00; }
.c-red-500     { color: #fb2c36; }
.c-red-600     { color: #e40014; }
.c-slate-500   { color: #62748e; }

/* ============================================
   HEADER
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 13, 20, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}
.site-logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  width: 32px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #ff2357, #c600db);
  color: #fff;
}
.site-logo-icon svg { width: 16px; height: 16px; }
.site-logo-text {
  font-size: var(--text-lg);
  font-weight: 900;
  letter-spacing: var(--tracking-tight);
  color: var(--foreground);
}
.site-logo-text .accent { color: #ff2357; }

.main-nav {
  display: none;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(22, 24, 33, 0.4);
  padding: 4px;
}
@media (min-width: 768px) { .main-nav { display: flex; } }
.main-nav a,
.main-nav button {
  border-radius: 999px;
  padding: 6px 12px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted-foreground);
  transition: color var(--duration) var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.main-nav a:hover,
.main-nav button:hover { color: var(--foreground); }
.main-nav a.active {
  background: var(--primary);
  color: var(--primary-foreground);
}
.main-nav a.active:hover { color: var(--primary-foreground); }
.main-nav button.active {
  background: var(--primary);
  color: var(--primary-foreground);
}
.main-nav button.active:hover { color: var(--primary-foreground); }
.main-nav button svg { width: 14px; height: 14px; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  width: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(22, 24, 33, 0.4);
  color: var(--muted-foreground);
  transition: color var(--duration) var(--ease);
}
.icon-btn:hover { color: var(--foreground); }
.icon-btn svg { width: 16px; height: 16px; }
.lang-pill {
  width: auto;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.mobile-menu-btn { display: flex; }
@media (min-width: 768px) { .mobile-menu-btn { display: none; } }

.mobile-menu {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--background);
  padding: 16px;
}
.mobile-menu.open { display: block; }
@media (min-width: 768px) { .mobile-menu { display: none !important; } }

/* ============================================
   SEARCH MODAL (Fuse.js typeahead)
   ============================================ */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 16px 16px;
  animation: search-modal-in 0.18s var(--ease);
}
.search-modal[hidden] { display: none; }
@keyframes search-modal-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.search-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.search-modal-panel {
  position: relative;
  width: 100%;
  max-width: 640px;
}
.search-modal-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 12px 0 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--popover);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.5);
}
.search-modal-icon {
  width: 20px;
  height: 20px;
  color: var(--muted-foreground);
  flex-shrink: 0;
}
.search-modal-input-wrap input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  outline: 0;
  font-size: 18px;
  color: var(--foreground);
}
.search-modal-input-wrap input::placeholder { color: var(--muted-foreground); }
.search-modal-input-wrap input::-webkit-search-cancel-button { display: none; }
.search-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  color: var(--muted-foreground);
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.search-modal-close:hover { background: var(--accent); color: var(--foreground); }
.search-modal-close svg { width: 18px; height: 18px; }

/* Dropdown in the modal — flows below the input, not absolute */
.search-modal .search-dropdown {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  max-height: calc(100vh - 220px);
  margin-top: 8px;
  padding: 4px;
  background: var(--popover);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  z-index: auto;
}
.search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--foreground);
  text-decoration: none;
  transition: background-color 0.15s var(--ease);
}
.search-item:hover,
.search-item.active { background: var(--accent); }
.search-item img {
  width: 56px;
  height: 32px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--card);
  flex-shrink: 0;
}
.search-item .info { min-width: 0; flex: 1; }
.search-item .title {
  font-size: var(--text-sm);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-item .meta {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  margin-top: 2px;
}
.search-item mark {
  background: transparent;
  color: var(--primary);
  font-weight: 600;
}
.search-empty {
  padding: 24px 12px;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}
.search-footer {
  padding: 8px 10px 4px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  text-align: center;
}
.search-footer kbd {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
  font-family: inherit;
}
body.search-modal-open { overflow: hidden; }

/* ============================================
   PAGE WRAPPERS
   ============================================ */
.section-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  padding: 0 16px;
}
.section-bottom { padding-bottom: 64px; }

/* ============================================
   HERO
   ============================================ */
.hero {
  text-align: center;
  padding: 40px 0 0;
}
.hero h1 {
  font-size: clamp(1.875rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: var(--tracking-tight);
  line-height: 1.2;
  margin-bottom: 12px;
}
.hero h1 .grad {
  background: linear-gradient(90deg, #ff2357, #e12afb, #00d2ef);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  max-width: 42rem;
  margin: 0 auto;
  color: var(--muted-foreground);
  line-height: var(--leading-relaxed);
}

/* ============================================
   TRENDING SECTION HEADER
   ============================================ */
.section-header {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-header svg { width: 16px; height: 16px; color: var(--primary); }
.section-header h2 {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--primary);
}
.section-header .sub {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

/* ============================================
   TRENDING GRID + CARD
   ============================================ */
.trending-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
@media (min-width: 640px)  { .trending-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .trending-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .trending-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.tcard {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(22, 24, 33, 0.4);
  padding: 3px 8px;
  transition: background-color var(--duration) var(--ease);
}
.tcard:hover { background: var(--card); }
.tcard-rank {
  flex-shrink: 0;
  width: 24px;
  text-align: center;
  font-size: var(--text-lg);
  font-weight: 900;
  color: rgba(161, 161, 161, 0.5);
}
.tcard-img {
  position: relative;
  flex-shrink: 0;
  width: 84px;
  aspect-ratio: 16/9;
  border-radius: calc(var(--radius) * 0.8);
  overflow: hidden;
  background: var(--card);
}
.tcard-img img { width: 100%; height: 100%; object-fit: cover; }
.tcard-info { min-width: 0; flex: 1; }
.tcard-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tcard-meta {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tcard-play {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  width: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff2357, #f6339a);
  color: #fff;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  transition: transform var(--duration) var(--ease);
}
.tcard-play:hover { transform: scale(1.1); }
.tcard-play svg { width: 16px; height: 16px; fill: currentColor; }

/* ============================================
   BANDS GRID (1/2/3 cols)
   ============================================ */
.bands-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 768px) { .bands-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .bands-grid { grid-template-columns: repeat(3, 1fr); } }

/* Band wrapper (rounded card with gradient header) */
.band {
  overflow: hidden;
  border-radius: calc(var(--radius) * 1.4);
  border: 1px solid var(--border);
  background: rgba(22, 24, 33, 0.2);
}
.band-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  color: #fff;
  text-decoration: none;
  transition: filter var(--duration) var(--ease);
}
.band-banner:hover { filter: brightness(1.1); }
.band-banner h2 {
  font-size: var(--text-base);
  font-weight: 700;
  color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.band-banner h2 .lang {
  font-size: var(--text-sm);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
}
.band-banner .all {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: rgba(255, 255, 255, 0.9);
  transition: color var(--duration) var(--ease);
}
.band-banner:hover .all { color: #fff; }
.band-banner .all svg { width: 14px; height: 14px; }
.band-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
}

/* ============================================
   LAZY IMAGE LOADING (shimmer + fade-in)
   Applied via .lazy class on <img> tags.
   JS adds .loaded on onload event.
   ============================================ */
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.hcard-img:has(img.lazy:not(.loaded)),
.hcard-thumb:has(img.lazy:not(.loaded)) {
  background-image: linear-gradient(90deg,
    var(--card) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    var(--card) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}
html[data-theme="light"] .hcard-img:has(img.lazy:not(.loaded)),
html[data-theme="light"] .hcard-thumb:has(img.lazy:not(.loaded)) {
  background-image: linear-gradient(90deg,
    var(--card) 0%,
    rgba(0, 0, 0, 0.06) 50%,
    var(--card) 100%
  );
}
img.lazy {
  opacity: 0;
  transition: opacity 0.35s ease;
}
img.lazy.loaded {
  opacity: 1;
}

/* ============================================
   SMALL HORIZONTAL CARD (the requested one)
   group flex gap-3 rounded-lg border border-border/60 bg-card/40 p-2
   ============================================ */
.hcard {
  display: flex;
  gap: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(22, 24, 33, 0.4);
  padding: 8px;
  color: inherit;
  text-decoration: none;
  transition: background-color var(--duration) var(--ease);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.hcard:hover { background: var(--card); }
.hcard-img {
  position: relative;
  flex-shrink: 0;
  width: 150px;
  aspect-ratio: 16/9;
  border-radius: calc(var(--radius) * 0.8);
  overflow: hidden;
  background: var(--card);
}
.hcard-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s var(--ease), filter 0.3s var(--ease);
  filter: contrast(1.12) saturate(1.22) brightness(1.04);
}
.hcard:hover .hcard-img img { transform: scale(1.05); filter: contrast(1.15) saturate(1.28) brightness(1.05); }
.hcard-img-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 13, 20, 0.4);
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
}
.hcard:hover .hcard-img-overlay { opacity: 1; }
.hcard-play {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  width: 32px;
  border-radius: 999px;
  color: #fff;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
}
.hcard-play svg { width: 16px; height: 16px; fill: currentColor; }
.hcard-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  border-radius: 4px;
  background: rgba(11, 13, 20, 0.8);
  padding: 0 4px;
  font-size: 10px;
  font-weight: 500;
  color: var(--foreground);
}
.hcard-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  max-width: 100%;
  overflow: hidden;
}
.hcard-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hcard-meta {
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hcard-meta svg { width: 12px; height: 12px; }
.hcard-meta .dot { color: rgba(161, 161, 161, 0.5); }
.hcard-meta .hcard-cat { color: var(--muted-foreground); }

/* 3 small genre thumbs at bottom of card */
.hcard-thumbs {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}
.hcard-thumb {
  position: relative;
  min-width: 0;
  flex: 1 1 0;
  aspect-ratio: 16/9;
  border-radius: 4px;
  overflow: hidden;
  background: var(--card);
}
.hcard-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  transform: scale(1.34);
  transform-origin: center center;
  filter: contrast(1.12) saturate(1.22) brightness(1.04);
}

/* Category color schemes (banner + play btn gradients) */
.band.violet  .band-banner { background: linear-gradient(90deg, #8d54ff, #e12afb); }
.band.violet  .hcard-play  { background: linear-gradient(135deg, #8d54ff, #e12afb); }
.band.cyan    .band-banner { background: linear-gradient(90deg, #00b7d7, #155dfc); }
.band.cyan    .hcard-play  { background: linear-gradient(135deg, #00b7d7, #155dfc); }
.band.emerald .band-banner { background: linear-gradient(90deg, #00bb7f, #009588); }
.band.emerald .hcard-play  { background: linear-gradient(135deg, #00bb7f, #009588); }
.band.orange  .band-banner { background: linear-gradient(90deg, #fe6e00, #fb2c36); }
.band.orange  .hcard-play  { background: linear-gradient(135deg, #fe6e00, #fb2c36); }
.band.rose    .band-banner { background: linear-gradient(90deg, #e70044, #8200da); }
.band.rose    .hcard-play  { background: linear-gradient(135deg, #e70044, #8200da); }
.band.amber   .band-banner { background: linear-gradient(90deg, #f99c00, #f6339a); }
.band.amber   .hcard-play  { background: linear-gradient(135deg, #f99c00, #f6339a); }

/* ============================================
   HCARD LIST (category / search / series pages)
   Responsive grid of horizontal cards.
   ============================================ */
.hcard-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.hcard-list > * { min-width: 0; }
@media (min-width: 640px)  { .hcard-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .hcard-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Default play button gradient (rose, matches tcard-play) */
.hcard-list .hcard-play { background: linear-gradient(135deg, #ff2357, #f6339a); }
/* Color variants — used by listing pages to match category theme */
.hcard-list.violet  .hcard-play { background: linear-gradient(135deg, #8d54ff, #e12afb); }
.hcard-list.cyan    .hcard-play { background: linear-gradient(135deg, #00b7d7, #155dfc); }
.hcard-list.emerald .hcard-play { background: linear-gradient(135deg, #00bb7f, #009588); }
.hcard-list.orange  .hcard-play { background: linear-gradient(135deg, #fe6e00, #fb2c36); }
.hcard-list.rose    .hcard-play { background: linear-gradient(135deg, #e70044, #8200da); }
.hcard-list.amber   .hcard-play { background: linear-gradient(135deg, #f99c00, #f6339a); }

/* ============================================
   FOOTER (minimal)
   ============================================ */
.site-footer {
  padding: 40px 0 48px;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  text-align: center;
  color: var(--muted-foreground);
}

/* Visually-hidden text — for SEO-friendly extra h1 / breadcrumb nodes that
   would otherwise clutter the visible design. */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Microdata helpers (schema.org itemprop) — these are SEO metadata that
   should never take layout space. Hiding them keeps the grid / flex layout
   intact without sacrificing the inline microdata fallback for crawlers. */
[itemprop],
link[itemprop],
meta[itemprop] {
  display: none !important;
}

/* Focus styles — accessibility / SEO (Core Web Vitals: Interaction to Next Paint) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}
a:focus:not(:focus-visible) { outline: none; }
.footer-tagline {
  font-size: var(--text-sm);
  color: var(--foreground);
  margin-bottom: 6px;
}
.footer-meta {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}
.footer-links {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: var(--text-xs);
}
.footer-links a {
  color: var(--muted-foreground);
  transition: color var(--duration) var(--ease);
}
.footer-links a:hover { color: var(--foreground); }

/* ============================================
   LEGACY (other pages — minimal support)
   ============================================ */
.breadcrumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted-foreground); margin-bottom: 20px; flex-wrap: wrap; }
.breadcrumbs a { color: var(--muted-foreground); }
.breadcrumbs a:hover { color: var(--foreground); }
.breadcrumbs .sep { opacity: 0.5; }
.breadcrumbs .current { color: var(--primary); }

.pagination { display: flex; justify-content: center; align-items: center; gap: 4px; margin-top: 40px; }
.page-link {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted-foreground);
  background: rgba(22, 24, 33, 0.4);
  border: 1px solid var(--border);
  transition: color var(--duration) var(--ease);
}
.page-link:hover { color: var(--foreground); }
.page-link.current {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: transparent;
  font-weight: 600;
}
.page-link.disabled { opacity: 0.4; pointer-events: none; }
html[data-theme="light"] .page-link {
  background: #ffffff;
  color: var(--muted-foreground);
  border-color: rgba(0, 0, 0, 0.1);
}
html[data-theme="light"] .page-link:hover {
  background: #f4f4f5;
  color: var(--foreground);
}

/* ============================================
   PAGE SECTIONS (movies / search / watch related)
   ============================================ */
.section { padding: 32px 0 0; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 16px; }

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.section-head-main { min-width: 0; }
.section-badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--primary);
  margin-bottom: 4px;
}
.section-title {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--foreground);
  margin-bottom: 4px;
}
/* Headings on the watch page must NOT look clickable (no cursor, no anchor symbol, no focus ring) */
.movie-detail-section h1.section-title,
.related-section h2.section-title {
  cursor: default !important;
  user-select: text;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none !important;
  outline: none !important;
  pointer-events: auto;
}
.movie-detail-section h1.section-title:hover,
.movie-detail-section h1.section-title:focus,
.movie-detail-section h1.section-title:active,
.related-section h2.section-title:hover,
.related-section h2.section-title:focus,
.related-section h2.section-title:active {
  text-decoration: none !important;
  outline: none !important;
  color: var(--foreground);
  background: transparent;
}
/* Kill any auto-anchor (¶) symbol that browsers / extensions inject into headings */
.movie-detail-section h1::before,
.movie-detail-section h1::after,
.related-section h2::before,
.related-section h2::after,
.movie-detail-section h1 *::before,
.movie-detail-section h1 *::after,
.related-section h2 *::before,
.related-section h2 *::after {
  content: none !important;
  display: none !important;
}
.section-desc { font-size: var(--text-sm); color: var(--muted-foreground); }

.sort-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.sort-bar-inline {
  padding: 0;
  border: 0;
  margin: 0;
  align-self: flex-end;
  flex-shrink: 0;
  gap: 8px;
}
.sort-label { font-size: var(--text-xs); color: var(--muted-foreground); }
.sort-options { display: flex; gap: 2px; }
.sort-link {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--muted-foreground);
  transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
}
.sort-link:hover { color: var(--foreground); background: var(--card); }
.sort-link.active {
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 600;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 60px 0;
  text-align: center;
  color: var(--muted-foreground);
}
.empty-icon { display: block; font-size: 48px; margin-bottom: 12px; }

.movie-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (min-width: 640px)  { .movie-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .movie-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .movie-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.movie-card {
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(22, 24, 33, 0.4);
  overflow: hidden;
  transition: transform var(--duration) var(--ease), border-color var(--duration) var(--ease);
  color: inherit;
  text-decoration: none;
}
.movie-card:hover {
  transform: translateY(-2px);
  border-color: rgba(236, 48, 90, 0.5);
}
.movie-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--card);
}
.movie-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s var(--ease);
}
.movie-card:hover .movie-poster img { transform: scale(1.05); }
.movie-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 13, 20, 0.45);
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
}
.movie-card:hover .movie-card-overlay { opacity: 1; }
.movie-play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 20px;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.4);
}
.movie-card-info { padding: 10px 12px 12px; }
.movie-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  min-height: 2.4em;
}
.movie-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.movie-category { color: var(--muted-foreground); }
.movie-views { color: var(--muted-foreground); }

html[data-theme="light"] .movie-card { background: rgba(255, 255, 255, 0.6); border-color: rgba(0,0,0,0.1); }
html[data-theme="light"] .movie-card:hover { border-color: rgba(225, 25, 71, 0.5); }

/* ============================================
   LIGHT THEME OVERRIDES
   ============================================ */
html[data-theme="light"] {
  --background: #fafafa;
  --foreground: #0a0a0a;
  --card: #ffffff;
  --card-foreground: #0a0a0a;
  --popover: #ffffff;
  --popover-foreground: #0a0a0a;
  --primary: #e11947;
  --primary-foreground: #ffffff;
  --secondary: #f1f1f1;
  --secondary-foreground: #0a0a0a;
  --muted: #f1f1f1;
  --muted-foreground: #6b6b6b;
  --accent: #f1f1f1;
  --accent-foreground: #0a0a0a;
  --destructive: #dc2626;
  --border: rgba(0, 0, 0, 0.1);
  --input: rgba(0, 0, 0, 0.15);
  --ring: #a1a1a1;
}
html[data-theme="light"] .site-header {
  background: rgba(250, 250, 250, 0.85);
}
html[data-theme="light"] .tcard,
html[data-theme="light"] .hcard {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.1);
}
html[data-theme="light"] .tcard:hover,
html[data-theme="light"] .hcard:hover {
  background: #ffffff;
}
html[data-theme="light"] .band {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(0, 0, 0, 0.1);
}
html[data-theme="light"] .main-nav,
html[data-theme="light"] .icon-btn {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.1);
}
html[data-theme="light"] .hcard-img-overlay {
  background: rgba(250, 250, 250, 0.5);
}
html[data-theme="light"] .hcard-badge {
  background: rgba(250, 250, 250, 0.9);
  color: #0a0a0a;
}
html[data-theme="light"] .tcard-rank {
  color: rgba(0, 0, 0, 0.35);
}
html[data-theme="light"] .site-logo-text .accent {
  color: #e11947;
}
html[data-theme="light"] .site-logo-icon {
  background: linear-gradient(135deg, #e11947, #c600db);
}

/* ============================================
   MOVIE DETAIL PAGE
   ============================================ */
.movie-credit {
  margin-top: 12px;
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}
.movie-credit .fn,
.movie-credit .org { color: var(--foreground); font-weight: 600; }
.movie-credit a.url { color: var(--primary); text-decoration: none; }
.movie-credit a.url:hover { text-decoration: underline; }

/* Related section uses hcard component list */
.related-section .section-title { font-size: var(--text-xl); }
.related-view-all {
  align-self: flex-end;
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted-foreground);
  background: rgba(22, 24, 33, 0.4);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
}
.related-view-all:hover { color: var(--foreground); background: var(--card); }
html[data-theme="light"] .related-view-all {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.1);
}

/* Player error state */
.player-error {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--muted-foreground);
  text-align: center;
  padding: 24px;
  font-size: var(--text-sm);
}

/* Meta line under the player (views, comments, avg) + interactive rating */
.player-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
}
.player-meta-stats {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}
.player-meta-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.player-meta-stat svg {
  width: 14px;
  height: 14px;
  opacity: 0.85;
  flex-shrink: 0;
}
.player-meta-lang {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Full legal disclaimer under the player — subtle, no card, no background */
.player-disclaimer {
  margin-top: 14px;
  font-size: var(--text-xs);
  line-height: 1.55;
  color: var(--muted-foreground);
  opacity: 0.7;
}
.player-disclaimer a {
  color: var(--muted-foreground);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.25);
  text-underline-offset: 2px;
  transition: color var(--duration) var(--ease), text-decoration-color var(--duration) var(--ease);
}
.player-disclaimer a:hover {
  color: var(--foreground);
  text-decoration-color: var(--foreground);
}

/* Episode navigation (watch.php) — shown when the current movie is part of a series */
.ep-nav {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
}
.ep-nav-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  font-size: var(--text-sm);
}
.ep-nav-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(236, 48, 90, 0.12);
  color: var(--primary);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.ep-nav-title {
  font-weight: 600;
  color: var(--foreground);
  transition: color var(--duration) var(--ease);
}
.ep-nav-title:hover { color: var(--primary); }
.ep-nav-position {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}
.ep-nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 640px) {
  .ep-nav-grid { grid-template-columns: 1fr; }
}
.ep-nav-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
  background: var(--card);
  transition: transform var(--duration) var(--ease), border-color var(--duration) var(--ease), background var(--duration) var(--ease);
  min-width: 0;
}
.ep-nav-card:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  background: rgba(236, 48, 90, 0.04);
  color: inherit;
}
.ep-nav-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.ep-nav-next {
  text-align: right;
  flex-direction: row-reverse;
}
.ep-nav-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 96px;
  aspect-ratio: 16/9;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ep-nav-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ep-nav-arrow {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(180deg, rgba(0,0,0,0.35), rgba(0,0,0,0.55));
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
}
.ep-nav-card:hover .ep-nav-arrow { opacity: 1; }
.ep-nav-disabled .ep-nav-arrow {
  position: static;
  background: none;
  color: var(--muted-foreground);
  opacity: 1;
}
.ep-nav-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}
.ep-nav-next .ep-nav-info { align-items: flex-end; }
.ep-nav-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  font-weight: 700;
}
.ep-nav-ep {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}
.ep-nav-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--foreground);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ============================================
   PLAYER (placeholder + Plyr)
   Full-width, no cover image — black canvas.
   ============================================ */
.player-section {
  margin-top: 8px;
  max-width: 100%;
}
.player-wrapper {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  aspect-ratio: 16/9;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
}
.player-placeholder {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: pointer;
  outline: none;
  display: block;
  background: #000;
  overflow: hidden;
}
.player-placeholder:focus-visible {
  box-shadow: inset 0 0 0 3px var(--primary);
}
.player-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s var(--ease), filter 0.4s var(--ease);
}
.player-placeholder:hover .player-cover { transform: scale(1.04); filter: brightness(0.75); }
.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.5) 100%);
  transition: background var(--duration) var(--ease);
}
.player-placeholder:hover .player-overlay { background: linear-gradient(180deg, rgba(236, 48, 90, 0.15) 0%, rgba(0,0,0,0.6) 100%); }
.play-button {
  display: inline-flex;
  filter: drop-shadow(0 8px 24px rgba(99, 102, 241, 0.45));
  transition: transform var(--duration) var(--ease);
}
.player-placeholder:hover .play-button { transform: scale(1.08); }
.player-placeholder:focus-visible .play-button { transform: scale(1.08); }
.play-text {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--muted-foreground);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}
.player-placeholder:hover .play-text { color: var(--foreground); }

/* Live stream badge (top-left, pulsing dot) */
.player-live-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 9px;
  border-radius: 4px;
  background: #e11d48;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.player-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6);
  animation: livePulse 1.6s ease-out infinite;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .player-live-dot { animation: none; }
}

/* Plyr — Flixio theme (rose brand, dark) */
:root {
  --plyr-color-main: #ec305a;
  --plyr-video-control-background-hover: rgba(236, 48, 90, 0.85);
  --plyr-video-controls-background: linear-gradient(0deg, rgba(11, 13, 20, 0.9), transparent);
  --plyr-range-track-height: 4px;
  --plyr-range-thumb-height: 14px;
  --plyr-range-fill-bg: rgba(255, 255, 255, 0.15);
}
.plyr--video { border-radius: 0; }
.plyr__control--overlaid {
  background: rgba(236, 48, 90, 0.9);
  padding: 22px;
  box-shadow: 0 8px 24px rgba(236, 48, 90, 0.35);
}
.plyr__control--overlaid:hover { background: rgba(236, 48, 90, 1); }
.plyr__control.plyr__tab-focus,
.plyr__control:hover { background: var(--plyr-video-control-background-hover); }
.plyr__progress__buffer { color: rgba(255, 255, 255, 0.35); }
.plyr__tooltip { background: var(--plyr-color-main); color: #fff; }
.plyr__menu__container .plyr__control[role="menuitemradio"][aria-checked="true"]::before {
  background: var(--plyr-color-main);
}
@media (prefers-reduced-motion: reduce) {
  .player-overlay, .play-button { transition: none; }
  .player-placeholder:hover .play-button { transform: none; }
}

/* ============================================
   Rating widget — interactive rating on the right of the meta row
   (the avg is also shown in .player-meta-stats, left side, as a stat)
   ============================================ */
.player-rating {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.player-rating-avg {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #f5b301 0%, #ff9500 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 6px rgba(245, 179, 1, 0.3));
}
.player-rating-max {
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--muted-foreground);
  align-self: flex-start;
  margin-top: 0.4rem;
  margin-right: 4px;
  letter-spacing: 0.02em;
}
.player-rating-stars {
  display: inline-flex;
  gap: 1px;
}
.player-rating-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: rgba(245, 179, 1, 0.32);
  border-radius: 3px;
  cursor: pointer;
  transition: color 0.15s var(--ease), text-shadow 0.2s var(--ease), transform 0.15s var(--ease);
}
.player-rating-star svg { width: 13px; height: 13px; }
.player-rating-star:hover { color: rgba(245, 179, 1, 0.75); }
.player-rating-star:focus-visible { outline: none; color: #f5b301; }
.player-rating-star.active {
  color: #f5b301;
  text-shadow: 0 0 8px rgba(245, 179, 1, 0.6);
}
.player-rating-star.pending {
  color: #f5b301;
  text-shadow: 0 0 12px rgba(245, 179, 1, 0.8);
  transform: scale(1.1);
}

.player-rating-count {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.player-rating-yours {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 700;
  color: #f5b301;
  background: rgba(245, 179, 1, 0.08);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ============================================
   Comments — flat, no borders, no card
   ============================================ */
.feedback {
  margin-top: 32px;
}

.comments-heading {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 4px;
}
.comments-count { color: var(--muted-foreground); font-weight: 500; }

.comments-block { margin-top: 28px; }
.comments-list { display: flex; flex-direction: column; }

.comment-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.comment-item:first-child { border-top: 0; padding-top: 4px; }
.comment-main { flex: 1 1 auto; min-width: 0; }
.comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.comment-user { flex: 0 1 auto; min-width: 0; }
.comment-delete {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: var(--muted-foreground);
  background: transparent;
  opacity: 0;
  transition: opacity 0.15s var(--ease), background 0.15s var(--ease), color 0.15s var(--ease), transform 0.15s var(--ease);
  cursor: pointer;
  flex-shrink: 0;
}
.comment-delete svg { width: 14px; height: 14px; }
.comment-item.is-mine .comment-delete { opacity: 0.7; }
.comment-item.is-mine:hover .comment-delete,
.comment-delete:focus-visible { opacity: 1; }
.comment-delete:hover {
  background: rgba(255, 101, 104, 0.15);
  color: var(--destructive);
  transform: scale(1.05);
}
.comment-delete.error {
  background: rgba(255, 101, 104, 0.22);
  color: var(--destructive);
  animation: flixio-shake 0.3s var(--ease);
}
.comment-delete:disabled { cursor: not-allowed; }
@keyframes flixio-shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-2px); }
  75%      { transform: translateX(2px); }
}
.comment-item.removing {
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), padding 0.18s var(--ease), max-height 0.2s var(--ease), border-color 0.18s var(--ease);
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-top-color: transparent;
  overflow: hidden;
}
.comment-user {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--foreground);
  letter-spacing: -0.005em;
}
.comment-body {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--muted-foreground);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Avatar — generated from username hash (no network, no storage) */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.35);
  transition: filter 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.avatar svg { width: 100%; height: 100%; display: block; }
.avatar:hover {
  filter: brightness(1.08);
  transform: scale(1.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    0 3px 8px rgba(0, 0, 0, 0.4);
}

/* ============================================
   Comment form — modern, futuristic
   ============================================ */
.comment-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.comment-form:hover {
  border-color: rgba(255, 255, 255, 0.14);
}
.comment-form:focus-within {
  border-color: rgba(236, 48, 90, 0.4);
  box-shadow: 0 0 0 4px rgba(236, 48, 90, 0.08);
}

.comment-as {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.comment-as-text { display: inline-flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.comment-username {
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: -0.005em;
}
.comment-edit-username {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(236, 48, 90, 0.1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: background 0.15s var(--ease), transform 0.15s var(--ease);
}
.comment-edit-username:hover { background: rgba(236, 48, 90, 0.2); }
.comment-edit-username:active { transform: scale(0.95); }

#commentInput {
  width: 100%;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: transparent;
  color: var(--foreground);
  font-size: 0.9375rem;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
#commentInput:hover { border-color: rgba(255, 255, 255, 0.16); }
#commentInput:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(236, 48, 90, 0.12);
}
#commentInput::placeholder { color: var(--muted-foreground); opacity: 0.6; }

.comment-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.comment-counter {
  font-size: 0.7rem;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  transition: color 0.2s var(--ease);
}
.comment-counter.near-limit { color: #f5b301; }
.comment-counter.at-limit   { color: var(--destructive); }

.comment-submit {
  padding: 10px 24px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.15s var(--ease), transform 0.15s var(--ease), box-shadow 0.2s var(--ease);
}
.comment-submit:hover:not(:disabled) {
  background: #d3284f;
  box-shadow: 0 0 28px rgba(236, 48, 90, 0.55);
  transform: translateY(-1px);
}
.comment-submit:active:not(:disabled) { transform: scale(0.97); }
.comment-submit:disabled { opacity: 0.4; cursor: not-allowed; }

.comment-error {
  margin: 0;
  padding: 8px 12px;
  font-size: 0.75rem;
  color: var(--destructive);
  background: rgba(255, 101, 104, 0.08);
  border-radius: 6px;
  border-left: 2px solid var(--destructive);
}

@media (max-width: 640px) {
  .player-rating { gap: 10px; }
  .player-rating-star { width: 22px; height: 22px; }
  .player-rating-star svg { width: 14px; height: 14px; }
}

/* ============================================
   STATIC PAGES (about / privacy / terms / contact)
   ============================================ */
.static-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 8px 0 64px;
  color: var(--foreground);
}
.static-page .lead {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--muted-foreground);
  margin: 0 0 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.static-page h2 {
  font-size: 1.375rem;
  font-weight: 700;
  margin: 40px 0 14px;
  color: var(--foreground);
  letter-spacing: -0.01em;
  scroll-margin-top: 80px;
}
.static-page h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 24px 0 10px;
  color: var(--foreground);
  scroll-margin-top: 80px;
}
.static-page p {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--muted-foreground);
  margin: 0 0 14px;
}
.static-page p strong { color: var(--foreground); font-weight: 600; }
.static-page a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px dotted rgba(236, 48, 90, 0.4);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.static-page a:hover { color: #ff4d77; border-bottom-color: var(--primary); }
.static-page ul,
.static-page ol {
  margin: 0 0 18px;
  padding-left: 1.4rem;
  color: var(--muted-foreground);
  font-size: 0.9375rem;
  line-height: 1.75;
}
.static-page ul li,
.static-page ol li { margin-bottom: 6px; }
.static-page ul li::marker { color: var(--primary); }
.static-page ol li::marker { color: var(--primary); font-weight: 600; }
.static-page hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 36px 0;
}

.check-list,
.cross-list {
  list-style: none;
  padding-left: 0;
  margin: 0 0 18px;
}
.check-list li,
.cross-list li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 8px;
  color: var(--muted-foreground);
  font-size: 0.9375rem;
  line-height: 1.6;
}
.check-list li::before,
.cross-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px;
}
.check-list li::before {
  background-color: rgba(34, 197, 94, 0.12);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234ade80' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
}
.cross-list li::before {
  background-color: rgba(255, 101, 104, 0.12);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff6568' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><line x1='18' y1='6' x2='6' y2='18'/><line x1='6' y1='6' x2='18' y2='18'/></svg>");
}

.callout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  margin: 20px 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--muted-foreground);
}
.callout-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 18px;
}
.callout-body { flex: 1; min-width: 0; }
.callout-body p:last-child { margin-bottom: 0; }
.callout-body strong,
.callout-body b { color: var(--foreground); font-weight: 600; }
.callout-body a { font-weight: 500; }
.callout-info    { border-color: rgba(96, 165, 250, 0.28); background: rgba(96, 165, 250, 0.05); }
.callout-info    .callout-icon { background: rgba(96, 165, 250, 0.14); color: #60a5fa; }
.callout-success { border-color: rgba(34, 197, 94, 0.28);  background: rgba(34, 197, 94, 0.05); }
.callout-success .callout-icon { background: rgba(34, 197, 94, 0.14); color: #4ade80; }
.callout-warning { border-color: rgba(245, 158, 11, 0.28); background: rgba(245, 158, 11, 0.05); }
.callout-warning .callout-icon { background: rgba(245, 158, 11, 0.14); color: #fbbf24; }
.callout-danger  { border-color: rgba(255, 101, 104, 0.30); background: rgba(255, 101, 104, 0.05); }
.callout-danger  .callout-icon { background: rgba(255, 101, 104, 0.14); color: #ff6568; }

.toc {
  padding: 18px 20px;
  margin: 0 0 32px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}
.toc-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-foreground);
  margin: 0 0 12px;
}
.toc-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 22px;
  padding: 0;
  list-style: none;
}
.toc-list li { margin: 0; padding: 0; }
.toc-list a {
  color: var(--foreground);
  font-size: 0.8125rem;
  border-bottom: none;
  transition: color 0.2s var(--ease);
}
.toc-list a:hover { color: var(--primary); }
.toc-list .toc-num {
  display: inline-block;
  width: 18px;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) {
  .toc-list { grid-template-columns: 1fr; }
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0 28px;
}
@media (max-width: 640px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s var(--ease);
}
.contact-card:hover {
  border-color: rgba(236, 48, 90, 0.35);
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.03);
}
.contact-card-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
}
.contact-card-title { font-size: 0.9375rem; font-weight: 600; color: var(--foreground); margin: 0; }
.contact-card-desc  { font-size: 0.8125rem; line-height: 1.55; color: var(--muted-foreground); margin: 0; }
.contact-card a {
  color: var(--foreground);
  font-weight: 500;
  border-bottom: 1px dotted rgba(236, 48, 90, 0.4);
  word-break: break-all;
}
.contact-card a:hover { color: var(--primary); border-bottom-color: var(--primary); }

.contact-card-static {
  flex-direction: row;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  margin: 8px 0 24px;
  cursor: default;
}
.contact-card-static:hover {
  transform: none;
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.contact-card-static .contact-card-label {
  align-self: flex-start;
  margin-top: 2px;
}
.contact-card-static .contact-email {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color: var(--foreground);
}
.contact-card-static .contact-card-desc { font-size: 0.875rem; line-height: 1.55; }
@media (max-width: 640px) {
  .contact-card-static {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .contact-card-static .contact-email { white-space: normal; word-break: break-all; }
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 28px;
}
@media (max-width: 900px) { .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .feature-grid { grid-template-columns: 1fr; } }
.feature-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  text-align: left;
}
.feature-tile-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 18px;
  background: linear-gradient(135deg, rgba(236, 48, 90, 0.18), rgba(194, 0, 219, 0.18));
  color: var(--primary);
}
.feature-tile h3 { margin: 0; font-size: 0.9375rem; font-weight: 600; }
.feature-tile p  { margin: 0; font-size: 0.8125rem; line-height: 1.55; }

.last-updated {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-style: italic;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.kbd-code {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.8125rem;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--foreground);
}

.faq {
  margin: 24px 0;
  border-top: 1px solid var(--border);
}
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}
.faq-q {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--foreground);
  margin: 0 0 8px;
}

.faq-a {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--muted-foreground);
  margin: 0;
}
.faq-a p:last-child { margin-bottom: 0; }

.section-hero {
  max-width: 820px;
  margin: 0 auto 24px;
  padding: 24px 0 8px;
}
.section-hero p {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--muted-foreground);
  margin: 8px 0 0;
  max-width: 64ch;
}

html[data-theme="light"] .callout,
html[data-theme="light"] .toc,
html[data-theme="light"] .contact-card,
html[data-theme="light"] .feature-tile {
  background: rgba(0, 0, 0, 0.025);
}
html[data-theme="light"] .contact-card:hover { background: rgba(0, 0, 0, 0.04); }
html[data-theme="light"] .contact-card-static { background: rgba(0, 0, 0, 0.025); }
html[data-theme="light"] .contact-card-static:hover { background: rgba(0, 0, 0, 0.025); }
html[data-theme="light"] .kbd-code { background: rgba(0, 0, 0, 0.05); }

