:root {
  --bg-body: #0a0a0c;
  --bg-sidebar: #0e0e11;
  --bg-card: #121216;
  --bg-hover: #1a1a20;
  --bg-dropdown: #16161a;
  --accent: #ffb800;
  --accent-soft: rgba(255, 184, 0, 0.15);
  --text-main: #f0f0f0;
  --text-muted: #a0a0a0;
  --text-dim: #606060;
  --border: #222226;
  --radius: 8px;
  --transition: 0.25s cubic-bezier(0.2, 0, 0, 1);
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
  --z-sidebar: 100;
  --z-dropdown: 200;
  --z-toast: 1000;
  --plyr-color-main: #ffb800;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  outline: none;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background:
    radial-gradient(circle at 15% -10%, rgba(255, 184, 0, 0.12), transparent 35%),
    radial-gradient(circle at 85% 0%, rgba(255, 122, 0, 0.08), transparent 40%),
    var(--bg-body);
  color: var(--text-main);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14px;
  width: 100%;
  max-width: 100vw;
}

html {
  overflow-x: hidden;
  width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #444;
}

.sidebar {
  width: var(--sidebar-width);
  background: rgba(14, 14, 17, 0.92);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--border);
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  transition: width var(--transition), transform var(--transition);
}

body.collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
}

.logo-area {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
}

body.collapsed .logo span {
  display: none;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
}

.sidebar-section {
  margin-bottom: 2rem;
}

.sidebar-section h3,
.sidebar-section .sidebar-heading {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
  padding-left: 0.75rem;
  white-space: nowrap;
}

body.collapsed .sidebar-section h3,
body.collapsed .sidebar-section .sidebar-heading {
  display: none;
}

body.collapsed .genre-grid {
  display: none;
}

body.collapsed .sidebar-section:last-child {
  display: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius);
  transition: var(--transition);
  font-weight: 500;
  margin-bottom: 2px;
  white-space: nowrap;
}

.nav-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-link:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  transform: translateX(2px);
}

.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
}

body.collapsed .nav-link {
  justify-content: center;
  padding: 0.75rem 0;
}

body.collapsed .nav-link span {
  display: none;
}

.genre-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 0.75rem;
}

.genre-link {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  transition: var(--transition);
}

.genre-link:hover {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.03);
}

.content-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left var(--transition);
  max-width: 1720px;
  margin-right: auto;
}

body.collapsed .content-wrapper {
  margin-left: var(--sidebar-collapsed-width);
}

.top-bar {
  height: 64px;
  background: rgba(10, 10, 12, 0.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

@media (max-width: 768px) {
  .top-bar {
    gap: 0.5rem;
    padding: 0 0.75rem;
  }
}

.top-bar>* {
  min-width: 0;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  order: 1; /* Sidebar toggle first */
}

@media (max-width: 768px) {
  .icon-btn {
    width: 32px;
    height: 32px;
  }
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.btn-login {
  background: linear-gradient(180deg, rgba(255, 184, 0, 0.16), rgba(255, 184, 0, 0.06));
  color: #ffd264;
  border: 1px solid rgba(255, 184, 0, 0.38);
  border-radius: 8px;
  padding: 0.52rem 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(255, 184, 0, 0.16);
  border-color: rgba(255, 184, 0, 0.55);
}

.account-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0.5rem; /* Small gap from topbar-extras */
  order: 20; /* Always last, after topbar-extras */
}

.user-chip {
  border: 1px solid rgba(255, 184, 0, 0.32);
  background: linear-gradient(135deg, rgba(255, 184, 0, 0.15), rgba(255, 136, 0, 0.07));
  color: #fff3d4;
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-login.btn-logout {
  color: #ffacac;
  border-color: rgba(255, 143, 143, 0.4);
  background: linear-gradient(180deg, rgba(255, 143, 143, 0.15), rgba(255, 143, 143, 0.06));
}

.btn-login.btn-anilist {
  color: #9adaff;
  border-color: rgba(143, 209, 255, 0.42);
  background: linear-gradient(180deg, rgba(143, 209, 255, 0.16), rgba(143, 209, 255, 0.05));
}

.btn-login.btn-anilist:hover {
  box-shadow: 0 10px 24px rgba(143, 209, 255, 0.16);
  border-color: rgba(143, 209, 255, 0.62);
}

.catalog-sync-status {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.auth-modal {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 184, 0, 0.14), transparent 35%),
    radial-gradient(circle at 80% 90%, rgba(255, 105, 0, 0.12), transparent 40%),
    rgba(5, 5, 8, 0.82);
  backdrop-filter: blur(10px);
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.auth-card {
  width: min(560px, 100%);
  background:
    linear-gradient(180deg, rgba(22, 22, 30, 0.9), rgba(12, 12, 18, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.1rem;
  display: grid;
  gap: 0.82rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  animation: authIn 0.26s cubic-bezier(0.2, 0, 0, 1);
}

.auth-card--firebase {
  width: min(560px, 100%);
}

.auth-card h3 {
  margin: 0;
  color: var(--accent);
  font-size: 1.42rem;
  letter-spacing: 0.2px;
}

.auth-card p {
  color: #c3c7d5;
  line-height: 1.52;
  margin-bottom: 0.15rem;
}

.auth-card label {
  color: #e5e9f7;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.2px;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.56rem;
  margin-top: 0.3rem;
}

.auth-card input {
  width: 100%;
  background: rgba(11, 12, 18, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  color: var(--text-main);
  padding: 0.76rem 0.84rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.auth-card input:focus {
  border-color: rgba(255, 184, 0, 0.66);
  box-shadow: 0 0 0 3px rgba(255, 184, 0, 0.16);
  background: rgba(14, 14, 22, 0.9);
}

.btn-action {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #f0f0f0;
  border-radius: 10px;
  font-weight: 700;
  padding: 0.68rem 0.9rem;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.btn-action:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
}

.auth-btn {
  width: 100%;
  min-height: 42px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
}

.auth-btn-google {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #ffc400 0%, #ff9a0a 100%);
  color: #1a1100;
  border: 1px solid rgba(255, 196, 0, 0.75);
  font-weight: 800;
}

.auth-btn-secondary {
  border-color: rgba(112, 174, 255, 0.52);
  background: linear-gradient(180deg, rgba(112, 174, 255, 0.18), rgba(112, 174, 255, 0.07));
  color: #cae4ff;
}

.auth-btn-ghost {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
  color: #e4e4e9;
}

.auth-status {
  font-size: 0.82rem;
  color: #b5bccf;
  min-height: 1.2rem;
  line-height: 1.3;
}

.journey-list {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 2rem;
  width: 100%;
  max-width: 100%;
}

.journey-item-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.journey-item-wrapper .journey-item {
  flex: 1;
  min-width: 0;
}

.journey-remove-btn {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.35rem 0.5rem;
  line-height: 1;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.journey-remove-btn:hover {
  background: rgba(220, 60, 60, 0.18);
  border-color: rgba(220, 60, 60, 0.5);
  color: #ff6b6b;
}

.journey-item {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  text-decoration: none;
  color: var(--text-main);
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.journey-item:hover {
  transform: translateY(-1px);
  border-color: #474752;
  background: rgba(255, 255, 255, 0.035);
}

.journey-poster {
  width: 46px;
  height: 62px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.journey-info {
  flex: 1;
  min-width: 0;
}

.journey-title {
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.journey-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.journey-progress {
  margin-top: 0.4rem;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.journey-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ffbf00, #ff8f1f);
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.8rem;
}

.account-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.85rem;
}

.account-card h4 {
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--accent);
  margin-bottom: 0.55rem;
}

.account-lines {
  display: grid;
  gap: 0.38rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.account-actions {
  display: grid;
  gap: 0.45rem;
}

.account-btn {
  width: 100%;
  justify-content: center;
  font-size: 0.78rem;
  padding: 0.55rem 0.7rem;
}

.search-wrapper {
  position: relative;
  flex: 1;
  max-width: 540px;
  order: 5; /* Before topbar-extras */
}

.search-input-box {
  position: relative;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-input-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 184, 0, 0.12);
}

.search-input-box svg {
  margin-left: 1rem;
  color: var(--text-dim);
}

.search-input-box input {
  width: 100%;
  background: transparent;
  border: none;
  padding: 0.7rem 1rem 0.7rem 0.75rem;
  color: var(--text-main);
  font-size: 0.9rem;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-dropdown);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  z-index: var(--z-dropdown);
  display: none;
  max-height: 400px;
  overflow-y: auto;
}

.search-results.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

.search-item {
  display: flex;
  gap: 1rem;
  padding: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.search-item:last-child {
  border-bottom: none;
}

.search-item:hover {
  background: var(--bg-hover);
}

.search-recent-chip {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-main);
  border-radius: 999px;
  padding: 0.36rem 0.58rem;
  font-size: 0.74rem;
  margin: 0.38rem 0.2rem 0.15rem;
  cursor: pointer;
}

.search-poster {
  width: 40px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  background: #222;
}

.search-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.search-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.search-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.home-page .hero-section {
  padding: 1.9rem 2.4rem 1.7rem;
}

.home-page .hero-banner {
  --hero-shift-x: 0px;
  --hero-shift-y: 0px;
  height: min(44vw, 460px);
  min-height: 340px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(20, 20, 25, 0.95), rgba(10, 10, 12, 0.95));
  position: relative;
  display: flex;
  align-items: flex-end;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
  isolation: isolate;
}

.home-page .hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate(var(--hero-shift-x), var(--hero-shift-y)) scale(1.01);
  filter: saturate(1.1);
  transition: transform 0.2s ease;
  will-change: transform;
}

.home-page .hero-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #0a0a0c 0%, rgba(10, 10, 12, 0.92) 30%, rgba(10, 10, 12, 0.28) 100%);
}

.home-page .hero-content {
  position: relative;
  z-index: 2;
  padding: 2.5rem;
  max-width: 850px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero-carousel-wrap {
  position: absolute;
  right: 3.2rem;
  top: 50%;
  transform: translateY(-52%);
  width: 240px;
  height: 240px;
  z-index: 2;
  perspective: 1000px;
}

.hero-carousel {
  --carousel-rotate: 0deg;
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateY(var(--carousel-rotate));
  transition: transform 0.8s cubic-bezier(0.2, 0, 0, 1);
}

.carousel-card {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(14, 14, 18, 0.92);
  transform: rotateY(calc(var(--i) * var(--carousel-step, 72deg))) translateZ(170px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

.carousel-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-page .hero-title {
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-weight: 800;
  line-height: 1.08;
  margin-bottom: 0.75rem;
  text-wrap: balance;
  min-height: 2.2em;
}

.home-page .hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
  min-height: 24px;
}

.home-page .hero-desc {
  color: #d4d4d4;
  line-height: 1.6;
  margin-bottom: 1.4rem;
  max-width: 66ch;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 6.4em;
}

.home-page .hero-actions {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.home-page .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: linear-gradient(140deg, #ffbf00, #ffa200);
  color: #111;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.3px;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  border: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}

.home-page .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(255, 184, 0, 0.3);
}

.hero-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(4px);
  margin-left: 0.5rem;
  vertical-align: middle;
}

.hero-share-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 184, 0, 0.1);
}

.home-page .main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 2rem;
  padding: 0.75rem 2.4rem 3.2rem;
}

.home-page .primary-content,
.home-page .side-content {
  min-width: 0;
}

.home-page section {
  margin-bottom: 1.7rem;
}

.home-page .anime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1.3rem;
  margin-bottom: 2.2rem;
}

.site-footer {
  margin: 0 2.4rem 2.1rem;
  padding: 1.7rem 1.8rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(20, 20, 25, 0.85), rgba(12, 12, 16, 0.85));
  overflow: hidden;
}

.footer-top h2,
.footer-top h3 {
  font-size: 1.4rem;
  color: var(--text-main);
  margin-bottom: 0.45rem;
}

.footer-top p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.az-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.az-links a {
  text-decoration: none;
  color: var(--text-main);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  padding: 0.3rem 0.55rem;
  font-weight: 600;
  font-size: 0.78rem;
}

.az-links a:hover {
  border-color: rgba(255, 184, 0, 0.45);
  color: var(--accent);
}

.footer-bottom {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--text-muted);
  align-items: center;
}

.watch-page .watch-container {
  padding: 2rem 2.5rem 2.4rem;
  max-width: 1720px;
  margin: 0 auto;
}

.account-page .account-container {
  padding: 1.4rem 2rem 2.4rem;
  max-width: 1400px;
}

.account-page .account-hero {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(255, 184, 0, 0.1), rgba(18, 18, 25, 0.85));
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}

.account-page .account-hero h1 {
  font-size: clamp(1.15rem, 2vw, 1.7rem);
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.account-page .account-hero p {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.empty-state,
.account-empty {
  border: 1px dashed var(--border);
  color: var(--text-muted);
  border-radius: 10px;
  padding: 0.85rem;
  font-size: 0.84rem;
}

.error-state {
  border: 1px solid rgba(229, 62, 62, 0.7);
  color: #fecaca;
  background: rgba(229, 62, 62, 0.08);
  border-radius: 10px;
  padding: 0.85rem;
  font-size: 0.84rem;
}

.watch-page .watch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 380px;
  gap: 2rem;
  align-items: start;
}

.watch-page .player-column {
  min-width: 0;
}

.watch-page .video-wrapper-premium {
  background: #000;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  position: relative;
}

.watch-page .video-wrapper-premium video,
.watch-page .video-wrapper-premium iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.watch-page .video-wrapper-premium .plyr {
  width: 100%;
  height: 100%;
}

.watch-page .video-wrapper-premium .plyr--video {
  background: #000;
}

.watch-page .video-wrapper-premium .plyr__controls {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.74), rgba(0, 0, 0, 0.14));
}

.watch-page .video-wrapper-premium .plyr__menu__container {
  background: #11131a;
  border: 1px solid #2a2e3b;
}

.watch-page .video-wrapper-premium .plyr__control:hover {
  background: rgba(255, 184, 0, 0.18);
}

.watch-page .video-wrapper-premium .plyr--full-ui input[type='range'] {
  color: var(--accent);
}

.watch-page .player-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.watch-page .action-group {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.watch-page .btn-action {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.watch-page .btn-action:hover {
  transform: translateY(-1px);
  background: #2a2a30;
  border-color: var(--text-muted);
}

.watch-page .btn-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.watch-page .btn-action.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.watch-page .anime-details-premium {
  margin-top: 1.8rem;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 1.7rem;
  padding: 1.6rem 1.7rem;
}

.comments-section {
  margin-top: 1.9rem;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 1.45rem 1.6rem 1.3rem;
}

.comments-meta-small {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.comment-window-label {
  font-size: 0.74rem;
  color: var(--text-dim);
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.comment-auth-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.comment-form {
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.75rem 0.85rem 0.8rem;
  margin-bottom: 0.9rem;
  display: grid;
  gap: 0.55rem;
}

.comment-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 70px;
  background: rgba(8, 8, 12, 0.96);
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.6rem 0.7rem;
}

.comment-form textarea::placeholder {
  color: var(--text-dim);
}

.comment-form textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.comment-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.comment-submit-btn {
  padding-inline: 0.9rem;
  font-size: 0.8rem;
}

.comment-status-text {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.comment-list {
  display: grid;
  gap: 0.85rem;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.2rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.comment-empty {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.comment-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.55rem 0.75rem;
  padding: 0.6rem 0.7rem 0.65rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background:
    linear-gradient(135deg, rgba(255, 184, 0, 0.06), transparent 55%),
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.03), transparent 55%),
    rgba(10, 10, 14, 0.96);
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(140deg, #ffbf00, #ff8f1f);
  color: #111;
  font-weight: 800;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
}

.comment-author {
  font-size: 0.86rem;
  font-weight: 600;
}

.comment-meta {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.comment-body {
  font-size: 0.84rem;
  line-height: 1.5;
  color: #e1e1e5;
  white-space: pre-wrap;
}

.watch-page .ep-sidebar-premium.is-mobile-inline {
  position: static;
  height: auto;
  max-height: none;
  margin-top: 1.4rem;
  border-radius: 14px;
}

.watch-page .ep-sidebar-premium.is-mobile-inline .ep-scroll-premium {
  max-height: 260px;
}

.watch-page .info-poster {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.watch-page .info-title {
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.watch-page .info-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.watch-page .info-desc {
  color: #d0d0d0;
  line-height: 1.62;
  max-height: 11.5rem;
  overflow: auto;
  padding-right: 0.3rem;
}

.watch-page .pill {
  background: var(--bg-hover);
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.watch-page .pill.accent {
  color: var(--accent);
  border-color: var(--accent-soft);
}

.watch-page .ep-sidebar-premium {
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 96px);
  position: sticky;
  top: 80px;
  overflow: hidden;
}

.watch-page .ep-header-premium {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
}

.watch-page .ep-header-premium h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.watch-page .ep-count {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
}

.watch-page .ep-tools-premium {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.watch-page select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.6rem;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
}

#audioSelect {
  display: none;
}

#dubSelect {
  display: block;
}

.watch-page .subtitles-box {
  margin-top: 0.2rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem;
  background: rgba(255, 255, 255, 0.015);
}

.watch-page .player-subtitles-box {
  margin-top: 0.85rem;
  display: none;
}

.watch-page .player-subtitles-box.open {
  display: block;
}

.watch-page .subtitles-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
}

.watch-page .subtitle-search-btn {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(255, 184, 0, 0.35);
  border-radius: 7px;
  padding: 0.35rem 0.6rem;
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
}

.watch-page .subtitles-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.watch-page .subtitle-hi {
  margin-top: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.watch-page .subtitle-list {
  margin-top: 0.5rem;
  max-height: 180px;
  overflow-y: auto;
  display: grid;
  gap: 0.4rem;
}

.watch-page .subtitle-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  padding: 0.45rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.watch-page .subtitle-item button {
  border: 1px solid rgba(255, 184, 0, 0.35);
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 6px;
  font-size: 0.72rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font-weight: 700;
}

.watch-page .subtitle-item small {
  color: var(--text-dim);
  display: block;
  margin-top: 1px;
}

.watch-page .ep-scroll-premium {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.watch-page .ep-grid-premium {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 10px;
}

.watch-page .ep-btn-premium {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
}

.watch-page .ep-btn-premium:hover {
  border-color: var(--accent);
  color: var(--text-main);
  transform: translateY(-1px);
}

.watch-page .ep-btn-premium.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent-soft);
}

.card {
  position: relative;
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-poster {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.card:hover .card-poster {
  transform: translateY(-4px);
  border-color: #4b4b52;
  box-shadow: 0 18px 22px rgba(0, 0, 0, 0.28);
}

.poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-info {
  margin-top: 0.65rem;
}

.card-title {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
  color: #f3f3f3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  display: inline-block;
}

.tag-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: linear-gradient(140deg, #f7c94f, #f5aa2c);
  color: #111;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 800;
}

.tag-eps {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.85);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
}

.card-action-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.52);
  color: #fff;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(-4px);
  transition: var(--transition);
  cursor: pointer;
}

.card:hover .card-action-btn {
  opacity: 1;
  transform: translateY(0);
}

.card-action-btn.active {
  opacity: 1;
  color: #111;
  background: var(--accent);
  border-color: var(--accent);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.section-title {
  font-size: 0.92rem;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 1.15px;
  font-weight: 700;
}

.continue-resume-btn {
  padding: 0.4rem 0.68rem;
  font-size: 0.73rem;
  border-radius: 7px;
}

.list-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.list-item {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.65rem;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.list-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.list-rank {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-dim);
  width: 30px;
  text-align: center;
}

.list-img {
  width: 48px;
  height: 64px;
  border-radius: 4px;
  object-fit: cover;
}

.list-info {
  min-width: 0;
}

.list-title {
  font-size: 0.88rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
}

.list-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.reveal-item {
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  animation: revealIn 0.45s ease forwards;
}

.skeleton-card {
  display: block;
}

.skeleton-poster {
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.skeleton-line {
  height: 10px;
  border-radius: 999px;
  margin-top: 0.65rem;
  background: rgba(255, 255, 255, 0.05);
}

.skeleton-line.short {
  width: 62%;
  margin-top: 0.4rem;
}

.skeleton-list-item .list-img {
  border-radius: 4px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
}

.skeleton-list-item .list-info {
  width: 100%;
}

.skeleton-shimmer {
  position: relative;
  overflow: hidden;
}

.skeleton-shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0),
      rgba(255, 255, 255, 0.08),
      rgba(255, 255, 255, 0));
  animation: skeletonSweep 1.1s linear infinite;
}

body.theater-mode .watch-container {
  padding: 0;
  max-width: 100%;
}

body.theater-mode .video-wrapper-premium {
  border-radius: 0;
  border: none;
  height: 100vh;
}

body.theater-mode .sidebar,
body.theater-mode .top-bar {
  display: none;
}

body.theater-mode .content-wrapper {
  margin: 0;
}

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.85rem 1.15rem;
  border-radius: 8px;
  z-index: var(--z-toast);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes revealIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes authIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes skeletonSweep {
  to {
    transform: translateX(100%);
  }
}

@media (max-width: 1300px) {
  .home-page .main-layout {
    grid-template-columns: 1fr;
  }

  .home-page .side-content {
    display: none;
  }

  .account-grid {
    grid-template-columns: 1fr;
  }

  .hero-carousel-wrap {
    width: 210px;
    height: 210px;
    right: 1.4rem;
  }

  .carousel-card {
    transform: rotateY(calc(var(--i) * 72deg)) translateZ(145px);
  }

  .home-page .hero-content {
    max-width: calc(100% - 240px);
    padding: 2rem;
  }
}

@media (max-width: 1100px) {
  /* Prevent horizontal overflow on all containers */
  .content-wrapper,
  .top-bar,
  .main-layout,
  .hero-section,
  .anime-grid,
  .account-container,
  .watch-container {
    max-width: 100vw;
    overflow-x: hidden;
  }

  .watch-page .watch-grid {
    grid-template-columns: 1fr;
  }

  .watch-page .ep-sidebar-premium {
    position: static;
    height: auto;
    max-height: none;
  }

  .watch-page .ep-sidebar-premium {
    overflow: visible;
  }

  .watch-page .anime-details-premium {
    grid-template-columns: 1fr;
  }

  .watch-page .info-poster {
    width: 150px;
    margin: 0 auto;
  }

  .sidebar {
    transform: translateX(-105%);
    width: min(88vw, 320px) !important;
    z-index: 999;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  }

  body.mobile-menu-open .sidebar {
    transform: translateX(0);
  }

  .sidebar::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 40px;
    background: linear-gradient(to top, rgba(10, 10, 12, 0.9), transparent);
    pointer-events: none;
  }

  /* Mobile drawer should always show labels */
  body .logo span {
    display: inline !important;
  }

  body .sidebar-section h3,
  body .sidebar-section .sidebar-heading {
    display: block !important;
  }

  body .sidebar-section:last-child {
    display: block !important;
  }

  body .genre-grid {
    display: grid !important;
  }

  body .nav-link {
    justify-content: flex-start !important;
    padding: 0.72rem 0.82rem !important;
  }

  body .nav-link span {
    display: inline !important;
    font-size: 0.9rem;
    letter-spacing: 0.1px;
  }

  .content-wrapper {
    margin-left: 0 !important;
  }
}

@media (max-width: 820px) {
  /* Ensure all text wraps properly */
  * {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Prevent cards from causing overflow */
  .anime-card,
  .account-card,
  .journey-item,
  .card {
    max-width: 100%;
  }

  .top-bar {
    padding: 0 0.65rem;
    gap: 0.55rem;
    flex-wrap: nowrap;
  }

  .search-wrapper {
    max-width: none;
    min-width: 0;
    flex: 1;
  }

  .search-input-box {
    width: 100%;
  }

  .search-input-box input {
    font-size: 0.82rem;
    padding-right: 0.55rem;
    width: 100%;
  }

  .btn-login {
    padding: 0.5rem 0.62rem;
    font-size: 0.78rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .account-controls {
    gap: 0.35rem;
    flex-shrink: 0;
  }

  .user-chip {
    max-width: 120px;
    font-size: 0.72rem;
    padding: 0.34rem 0.5rem;
  }

  .auth-card {
    padding: 1rem;
  }

  .auth-card h3 {
    font-size: 1.2rem;
  }

  .auth-actions {
    grid-template-columns: 1fr;
  }

  .auth-btn-google {
    grid-column: auto;
  }

  .home-page .hero-section,
  .home-page .main-layout,
  .account-page .account-container,
  .watch-page .watch-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .site-footer {
    margin: 0 1rem 1rem;
  }

  .home-page .hero-content {
    padding: 1.25rem;
    min-height: 220px;
  }

  .home-page .hero-title {
    font-size: 1.7rem;
    min-height: auto;
  }

  .home-page .hero-desc {
    -webkit-line-clamp: 3;
    min-height: auto;
  }

  .hero-carousel-wrap {
    display: none;
  }

  .home-page .hero-content {
    max-width: 100%;
  }

  /* Account grid — 2 columns on tablets */
  .account-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Journey list — single column on tablets */
  .journey-list {
    grid-template-columns: 1fr;
  }

  .watch-page .player-controls-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem;
  }

  .watch-page .action-group {
    width: 100%;
    flex-wrap: wrap;
  }

  .watch-page .btn-action {
    flex: 1;
    justify-content: center;
    padding: 0.56rem 0.7rem;
    font-size: 0.82rem;
    min-width: 120px;
  }

  .watch-page .ep-tools-premium {
    padding: 0.75rem;
  }

  .watch-page .subtitles-row {
    grid-template-columns: 1fr;
  }

  .watch-page .subtitle-list {
    max-height: 220px;
  }

  .watch-page .ep-scroll-premium {
    padding: 0.75rem;
  }

  .watch-page .ep-grid-premium {
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 8px;
  }

  .watch-page .anime-details-premium {
    padding: 1rem;
    gap: 0.95rem;
    grid-template-columns: 140px minmax(0, 1fr);
  }

  .watch-page .info-title {
    font-size: 1.35rem;
  }

  .home-page .anime-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.95rem;
  }

  .card-title {
    font-size: 0.84rem;
  }
}

/* ── 480px — mid-size phones ─────────────────────────── */
@media (max-width: 480px) {
  /* Force all containers to fit within viewport */
  body,
  html,
  .content-wrapper,
  .main-layout,
  .hero-section,
  .account-container,
  .watch-container {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  /* Top bar: shrink search, hide AniList button */
  .top-bar {
    padding: 0 0.5rem;
    gap: 0.4rem;
    max-width: 100vw;
  }

  .btn-login.btn-anilist {
    display: none;
  }

  .search-input-box {
    flex: 1;
    min-width: 0;
    max-width: 100%;
  }

  .search-input-box input {
    font-size: 0.78rem;
    width: 100%;
    min-width: 0;
  }

  /* Hero — compact */
  .home-page .hero-section {
    padding: 0.75rem 0.75rem 0.5rem;
  }

  .home-page .hero-banner {
    min-height: 240px;
    height: 58vw;
  }

  .home-page .hero-content {
    padding: 0.85rem;
    min-height: 160px;
  }

  .home-page .hero-title {
    font-size: 1.3rem;
  }

  .home-page .hero-desc {
    -webkit-line-clamp: 2;
  }

  .home-page .main-layout {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-bottom: 2rem;
  }

  /* Anime grid — 2 cols */
  .home-page .anime-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }

  .card-title {
    font-size: 0.8rem;
  }

  .card-meta {
    font-size: 0.68rem;
  }

  /* Account page */
  .account-grid {
    grid-template-columns: 1fr !important;
  }

  .account-page .account-container {
    padding: 0.75rem 0.75rem 2rem;
  }

  /* Watch page */
  .watch-page .watch-container {
    padding: 0.75rem 0.75rem 2rem;
  }

  .watch-page .anime-details-premium {
    grid-template-columns: 1fr !important;
  }

  .watch-page .info-poster {
    width: 110px !important;
    margin: 0 auto;
    display: block;
  }

  .watch-page .player-controls-bar {
    padding: 0.6rem;
    gap: 0.5rem;
  }

  /* Footer */
  .site-footer {
    margin: 0 0.5rem 0.75rem;
    padding: 0.85rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.75rem;
  }

  /* Auth modals */
  .auth-card {
    padding: 1rem 0.85rem;
    gap: 0.6rem;
  }

  .auth-card h3 {
    font-size: 1.1rem;
  }
}

@media (max-width: 560px) {
  .top-bar {
    gap: 0.45rem;
    padding: 0 0.5rem;
  }

  .btn-login {
    padding: 0.46rem 0.55rem;
    font-size: 0.72rem;
  }

  .account-controls {
    gap: 0.25rem;
  }

  .btn-login.btn-anilist {
    display: none;
  }

  .user-chip {
    max-width: 90px;
  }

  .auth-card {
    border-radius: 14px;
    gap: 0.65rem;
  }

  .auth-card input {
    padding: 0.7rem 0.74rem;
  }

  .search-input-box svg {
    margin-left: 0.65rem;
  }

  .search-input-box input {
    padding: 0.6rem 0.5rem 0.6rem 0.45rem;
    font-size: 0.78rem;
  }

  /* Account grid — single column on very small screens */
  .account-grid {
    grid-template-columns: 1fr !important;
  }

  /* Journey list — single column */
  .journey-list {
    grid-template-columns: 1fr !important;
  }

  /* Account container tighter padding */
  .account-page .account-container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  /* Watch page action buttons — stack vertically */
  .watch-page .action-group {
    flex-direction: column;
  }

  .watch-page .btn-action {
    width: 100%;
  }

  /* Watch page details panel — smaller poster */
  .watch-page .anime-details-premium {
    grid-template-columns: 1fr !important;
    padding: 0.85rem;
  }

  .watch-page .info-poster {
    width: 120px !important;
  }

  /* Hero section tighter on small phones */
  .home-page .hero-section {
    padding: 0.75rem 0.75rem 0.5rem;
  }

  .home-page .hero-banner {
    min-height: 260px;
    height: 60vw;
  }

  .home-page .hero-content {
    padding: 1rem;
    min-height: 180px;
  }

  .home-page .hero-title {
    font-size: 1.25rem;
    min-height: auto;
  }

  .home-page .hero-desc {
    display: none;
  }

  .home-page .hero-meta {
    font-size: 0.75rem;
    gap: 0.5rem;
    min-height: auto;
  }

  /* Anime grid — 2 columns minimum on phones */
  .home-page .anime-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  /* Footer tighter */
  .site-footer {
    margin: 0 0.5rem 0.75rem;
    padding: 1rem;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    font-size: 0.78rem;
  }

  /* Top bar — hide logout text, keep icon feel */
  .btn-login.btn-logout {
    font-size: 0.68rem;
    padding: 0.4rem 0.45rem;
  }

  .home-page .hero-title {
    font-size: 1.05rem;
    min-height: 2em;
  }

  .home-page .hero-meta {
    gap: 0.45rem;
    font-size: 0.72rem;
  }

  .home-page .hero-desc {
    font-size: 0.83rem;
    line-height: 1.45;
    min-height: 4.35em;
  }

  .home-page .btn-primary {
    padding: 0.58rem 0.75rem;
    font-size: 0.82rem;
  }

  .home-page .hero-actions {
    min-height: 38px;
  }

  .home-page .main-layout {
    padding-bottom: 1.6rem;
  }

  .site-footer {
    margin: 0 0.6rem 0.7rem;
    padding: 0.85rem 0.7rem;
    border-radius: 10px;
  }

  .footer-top h2,
  .footer-top h3 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
  }

  .footer-top p {
    font-size: 0.74rem;
    line-height: 1.32;
    margin-bottom: 0.55rem;
  }

  .az-links {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.3rem;
  }

  .az-links a {
    text-align: center;
    padding: 0.28rem 0.1rem;
    font-size: 0.66rem;
    border-radius: 5px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    font-size: 0.7rem;
    margin-top: 0.65rem;
    padding-top: 0.55rem;
  }

  .journey-item {
    padding: 0.58rem;
    gap: 0.65rem;
    font-size: 0.85rem;
  }

  .journey-poster {
    width: 40px;
    height: 56px;
    flex-shrink: 0;
  }
  
  .journey-title {
    font-size: 0.82rem;
  }
  
  .journey-meta {
    font-size: 0.7rem;
  }
  
  .journey-remove-btn {
    padding: 0.3rem 0.4rem;
    font-size: 0.7rem;
  }

  .account-card {
    padding: 0.72rem;
    border-radius: 10px;
  }

  .account-lines {
    font-size: 0.75rem;
    gap: 0.3rem;
  }

  .watch-page .watch-container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .account-page .account-container {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }

  .watch-page .video-wrapper-premium {
    border-radius: 10px;
  }

  .watch-page .ep-header-premium {
    padding: 1rem 0.85rem;
  }

  .watch-page .ep-count {
    font-size: 0.7rem;
  }
}

@media (max-width: 420px) {
  .site-footer {
    margin: 0 0.4rem 0.45rem;
    padding: 0.58rem 0.52rem;
  }

  .footer-top p {
    display: none;
  }

  .az-links {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 0.24rem;
  }

  .az-links a {
    padding: 0.22rem 0.08rem;
    font-size: 0.62rem;
  }

  .footer-bottom {
    font-size: 0.66rem;
  }
}

@media (min-width: 1440px) {
  .home-page .hero-section {
    padding-left: 3rem;
    padding-right: 3rem;
  }

  .home-page .main-layout {
    padding-left: 3rem;
    padding-right: 3rem;
    gap: 2.4rem;
    grid-template-columns: minmax(0, 1.4fr) 360px;
  }

  .home-page .anime-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1.4rem;
  }

  .site-footer {
    margin-left: 3rem;
    margin-right: 3rem;
  }

  .watch-page .watch-container {
    padding-left: 3rem;
    padding-right: 3rem;
  }

  .watch-page .watch-grid {
    grid-template-columns: minmax(0, 1.5fr) 400px;
    gap: 2.6rem;
  }

  .watch-page .anime-details-premium,
  .comments-section {
    max-width: 1120px;
  }
}

/* ============================================================ ANIKAI FEATURES ============================================================ */

/* â”€â”€ Native Ad Section â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.native-ad-section {
  padding: 0 2rem;
  margin-bottom: 0.5rem;
}

.native-ad-tag {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 0.45rem;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.native-ad-grid-wrap {
  width: 100%;
}

/* Adsterra renders its own layout — only set width, font, link color */
#container-b7b05568585173256a38bfef51f1ed41 {
  width: 100% !important;
  font-family: 'Inter', system-ui, sans-serif;
}

#container-b7b05568585173256a38bfef51f1ed41 a {
  color: var(--text-main) !important;
  text-decoration: none !important;
}


/* Native ad cards — light theming only, DO NOT override layout/display/overflow */
#container-b7b05568585173256a38bfef51f1ed41 [class*="__title"] {
  color: var(--text-main) !important;
  font-family: 'Inter', system-ui, sans-serif !important;
}

/* Responsive hardening: final overrides for small screens */
.home-page .anime-grid > *,
.home-page .main-layout > *,
.watch-page .watch-grid > *,
.section-header > * {
  min-width: 0;
}

.native-ad-section {
  padding-inline: clamp(0.75rem, 2vw, 2rem);
}

@media (max-width: 1100px) {
  .content-wrapper {
    margin-left: 0 !important;
    margin-right: 0;
    max-width: none;
    width: 100%;
  }

  .home-page .hero-section {
    padding: 1rem 1rem 0.75rem;
  }

  .home-page .main-layout {
    padding: 0.65rem 1rem 2rem;
    gap: 1.2rem;
  }

  .site-footer {
    margin: 0 1rem 1rem;
  }
}

@media (max-width: 768px) {
  .top-bar {
    height: auto;
    min-height: 64px;
    padding: 0.55rem 0.75rem;
    gap: 0.55rem;
    flex-wrap: wrap;
    align-items: center;
  }

  .icon-btn {
    order: 1;
  }

  .account-controls {
    order: 2;
    margin-left: auto;
    gap: 0.3rem;
    min-width: 0;
    max-width: 100%;
    flex-wrap: nowrap;
  }

  .search-wrapper {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
  }

  .search-input-box input {
    font-size: 0.82rem;
    padding: 0.62rem 0.6rem 0.62rem 0.5rem;
  }

  .user-chip {
    max-width: 96px;
    padding: 0.3rem 0.45rem;
    font-size: 0.7rem;
  }

  .btn-login {
    padding: 0.42rem 0.52rem;
    font-size: 0.72rem;
  }

  .home-page .hero-banner {
    min-height: 260px;
    height: clamp(260px, 60vw, 340px);
  }

  .home-page .hero-content {
    padding: 1rem;
    min-height: 0;
  }

  .home-page .hero-title {
    font-size: clamp(1.05rem, 5vw, 1.5rem);
    min-height: 0;
  }

  .home-page .hero-meta {
    gap: 0.5rem;
    min-height: 0;
    font-size: 0.74rem;
  }

  .home-page .hero-desc {
    -webkit-line-clamp: 2;
    min-height: 0;
    font-size: 0.82rem;
    line-height: 1.4;
  }

  .home-page .hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
    min-height: 0;
  }

  .home-page .main-layout {
    padding: 0.6rem 0.75rem 1.7rem;
    gap: 1rem;
  }

  .home-page .anime-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.62rem;
    margin-bottom: 1.4rem;
  }

  .card-title {
    font-size: 0.8rem;
  }

  .card-meta {
    font-size: 0.68rem;
  }

  .section-header {
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
  }

  .site-footer {
    margin: 0 0.75rem 0.75rem;
    padding: 0.9rem 0.8rem;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .native-ad-section {
    padding-inline: 0;
  }
}

@media (max-width: 560px) {
  .btn-login.btn-anilist {
    display: none;
  }

  .account-controls {
    gap: 0.24rem;
  }

  .home-page .hero-desc {
    display: none;
  }

  .az-links {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.28rem;
  }

  .az-links a {
    text-align: center;
    padding: 0.25rem 0.1rem;
    font-size: 0.66rem;
  }
}

@media (max-width: 360px) {
  .home-page .anime-grid {
    grid-template-columns: 1fr;
  }
}
