:root {
  --bg-main: #07080c;
  --bg-surface: #0f1118;
  --bg-card: #141722;
  --bg-card-hover: #1a1e2d;
  --border: #222638;
  --border-focus: #ff334b;
  --text-main: #f0f2f8;
  --text-muted: #82879c;
  --accent: #ff334b;
  --accent-glow: rgba(255, 51, 75, 0.35);
  --accent-hover: #ff4d63;
  --gold: #f59e0b;
  --glass: rgba(15, 17, 24, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px var(--accent-glow);
  --transition: 220ms cubic-bezier(0.16, 1, 0.3, 1);
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: "Syne", var(--font-sans);
}

[data-theme="light"] {
  --bg-main: #f4f5fa;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8f9fd;
  --border: #e3e6f0;
  --text-main: #0f1118;
  --text-muted: #697089;
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.08);
  --glass: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(0, 0, 0, 0.06);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  scroll-behavior: smooth;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* NAVBAR */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  padding: 0.85rem 0;
}

.navbar__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  color: var(--text-main);
  flex-shrink: 0;
}

.brand__icon {
  background: var(--accent);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px var(--accent-glow);
}

.brand__name span {
  color: var(--accent);
}

.nav-search {
  flex: 1;
  max-width: 440px;
  position: relative;
  display: flex;
  align-items: center;
}

.nav-search__ico {
  position: absolute;
  left: 0.9rem;
  color: var(--text-muted);
  pointer-events: none;
}

.nav-search__input {
  width: 100%;
  padding: 0.65rem 2.2rem 0.65rem 2.4rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.9rem;
  transition: all var(--transition);
}

.nav-search__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-card);
}

.nav-search__clear {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
  background: var(--bg-surface);
}

.nav-link.active {
  color: var(--accent);
}

.badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 99px;
}

.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.btn-icon {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

/* HERO PROMO BANNER */
.hero-banner {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: flex-end;
  padding: 5rem 0 3.5rem;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero-banner__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 25%;
  background-repeat: no-repeat;
  filter: brightness(0.65) saturate(1.2);
  transition: opacity 600ms ease;
}

.hero-banner__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--bg-main) 0%, rgba(7, 8, 12, 0.7) 50%, rgba(7, 8, 12, 0.3) 100%);
}

.hero-banner__content {
  position: relative;
  z-index: 10;
  max-width: 760px;
}

.hero-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.hero-rating {
  color: var(--gold);
  font-weight: 700;
}

.hero-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-btns {
  display: flex;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
}

.btn--sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

.btn--accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn--accent:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px var(--accent-glow);
}

.btn--glass {
  background: var(--glass);
  backdrop-filter: blur(8px);
  color: var(--text-main);
  border-color: var(--glass-border);
}

.btn--glass:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

/* MAIN LAYOUT */
.main-layout {
  flex: 1;
  padding: 2.5rem 0 4rem;
}

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.4rem 0.85rem;
  border-radius: 99px;
  cursor: pointer;
  transition: all var(--transition);
}

.chip:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
}

.chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.filter-dropdowns {
  display: flex;
  gap: 0.75rem;
}

.dropdown-select {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition);
}

.dropdown-select:focus {
  border-color: var(--accent);
}

.section-title-wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.section-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* CATALOG GRID */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 1.5rem;
}

.anime-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}

.anime-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 51, 75, 0.4);
  box-shadow: var(--shadow-card), 0 0 20px rgba(255, 51, 75, 0.15);
}

.anime-card__poster-box {
  position: relative;
  aspect-ratio: 3 / 4.2;
  background: var(--bg-surface);
  overflow: hidden;
}

.anime-card__poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.anime-card:hover .anime-card__poster {
  transform: scale(1.06);
}

.anime-card__badge-rating {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  background: rgba(7, 8, 12, 0.85);
  backdrop-filter: blur(6px);
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.anime-card__fav-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: rgba(7, 8, 12, 0.85);
  backdrop-filter: blur(6px);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
}

.anime-card__fav-btn:hover {
  transform: scale(1.15);
}

.anime-card__fav-btn.active {
  color: var(--accent);
}

.anime-card__hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(7, 8, 12, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.anime-card:hover .anime-card__hover-overlay {
  opacity: 1;
}

.anime-card__play-icon {
  background: var(--accent);
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px var(--accent-glow);
  transform: scale(0.85);
  transition: transform var(--transition);
}

.anime-card:hover .anime-card__play-icon {
  transform: scale(1);
}

.anime-card__content {
  padding: 0.85rem;
}

.anime-card__title {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.35rem;
}

.anime-card__meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* SKELETONS */
.skeleton {
  pointer-events: none;
}

.skeleton .anime-card__poster-box,
.skeleton .anime-card__title,
.skeleton .anime-card__meta {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton .anime-card__title {
  height: 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.skeleton .anime-card__meta {
  height: 0.8rem;
  width: 60%;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.state-box {
  text-align: center;
  padding: 5rem 1rem;
}

.state-box__icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.state-box__title {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.state-box__desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* MODAL CINEMA ROOM */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 8, 12, 0.92);
  backdrop-filter: blur(16px);
}

.modal__window {
  position: relative;
  width: 100%;
  max-width: 1040px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card), 0 0 40px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
}

.modal__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.modal__title-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
  flex: 1;
}

.modal__type-pill {
  font-size: 0.75rem;
  font-weight: 800;
  background: var(--bg-card);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.modal__heading {
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* STUDIO & SERVER CONTROLS */
.player-controls-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.studio-selector,
.server-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.studio-label,
.server-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.server-dropdown {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all var(--transition);
}

.server-dropdown:hover,
.server-dropdown:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.server-hint-bar {
  position: absolute;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(7, 8, 12, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  padding: 0.35rem 0.85rem;
  border-radius: 99px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  z-index: 10;
  pointer-events: auto;
  transition: opacity var(--transition);
  opacity: 0.85;
}

.server-hint-bar:hover {
  opacity: 1;
}

.server-quick-switch-btn {
  background: rgba(255, 51, 75, 0.18);
  border: 1px solid var(--accent);
  color: #ff8595;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  cursor: pointer;
  transition: all var(--transition);
}

.server-quick-switch-btn:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 10px var(--accent-glow);
}

.studio-pills {
  display: inline-flex;
  flex-wrap: wrap;
  background: var(--bg-card);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  gap: 0.25rem;
}

.studio-pill {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.studio-pill:hover {
  color: var(--text-main);
}

.studio-pill.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 10px var(--accent-glow);
}

.studio-pill.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.modal__topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-act-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1.2rem;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.modal-act-btn:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
}

.modal-act-btn--close {
  font-size: 1.6rem;
  line-height: 1;
}

.modal__viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.modal__loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: #000;
  z-index: 10;
}

.loading-ring {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.loader-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.source-fallback {
  position: absolute;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
}

.source-fallback__card {
  text-align: center;
  max-width: 400px;
  padding: 2rem;
}

.source-fallback__card h4 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.source-fallback__card p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.next-toast {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 25;
  background: rgba(20, 23, 34, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--accent);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  animation: slideToast 250ms ease-out;
}

@keyframes slideToast {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.next-toast__content {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-main);
}

.btn-cancel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-cancel:hover {
  color: var(--text-main);
  border-color: var(--text-main);
}

.modal__bottombar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  gap: 1rem;
}

.modal__meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  color: var(--text-muted);
}

.modal__bottom-btns {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-action {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  transition: color var(--transition);
}

.btn-action:hover {
  color: var(--accent);
}

/* MOBILE BOTTOM NAVIGATION BAR */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 80;
  background: rgba(7, 8, 12, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 0.5rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom));
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.mobile-nav__item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  position: relative;
  min-width: 60px;
}

.mobile-nav__item svg {
  transition: transform var(--transition);
}

.mobile-nav__item.active {
  color: var(--accent);
}

.mobile-nav__item.active svg {
  transform: translateY(-2px);
}

.mobile-nav__icon-wrap {
  position: relative;
  display: inline-flex;
}

.mobile-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.1rem 0.35rem;
  border-radius: 99px;
  line-height: 1;
}

/* RESPONSIVE STYLES */
@media (max-width: 960px) {
  .hero-banner {
    min-height: 380px;
    padding: 4.5rem 0 2rem;
  }
  .hero-title {
    font-size: 2rem;
  }
  .player-controls-wrap {
    gap: 0.6rem;
  }
}

@media (max-width: 768px) {
  .mobile-nav {
    display: flex;
  }
  
  .nav-links {
    display: none;
  }
  
  .app-body {
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
  }
  
  /* МОБИЛЬНАЯ ШАПКА: 2 ряда (Логотип + Кнопка темы, затем Полноширинный Поиск) */
  .navbar {
    padding: 0.65rem 0 0.75rem;
  }

  .navbar__inner {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 0.6rem 0.5rem;
    align-items: center;
  }

  .brand {
    grid-column: 1;
    font-size: 1.15rem;
  }

  .brand__name {
    display: inline-block !important;
    font-size: 1.1rem;
  }

  .nav-actions {
    grid-column: 2;
    margin-left: 0;
  }

  .btn-icon {
    width: 36px;
    height: 36px;
  }

  .nav-search {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
    margin-top: 0.1rem;
    position: relative;
  }

  .nav-search__input {
    font-size: 16px !important; /* Предотвращает авто-зум Safari на iOS */
    height: 42px;
    padding: 0 2.2rem 0 2.4rem;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border-color: var(--border);
  }

  .nav-search__ico {
    left: 0.85rem;
    width: 18px;
    height: 18px;
  }

  .nav-search__clear {
    right: 0.65rem;
    width: 30px;
    height: 30px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .hero-banner {
    min-height: auto;
    padding: 1.5rem 0 1.25rem;
  }
  
  .hero-title {
    font-size: 1.55rem;
  }
  
  .hero-desc {
    -webkit-line-clamp: 2;
    font-size: 0.85rem;
  }
  
  .hero-btns {
    flex-direction: column;
    width: 100%;
  }
  
  .hero-btns .btn {
    width: 100%;
    justify-content: center;
  }

  .filters-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .filter-chips {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.3rem;
  }
  .filter-chips::-webkit-scrollbar {
    display: none;
  }

  .filter-dropdowns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
  }

  .dropdown-select {
    width: 100%;
  }

  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }

  .anime-card__title {
    font-size: 0.82rem;
  }

  .anime-card__meta {
    font-size: 0.72rem;
  }

  /* MODAL ON MOBILE */
  .modal {
    padding: 0;
  }

  .modal__window {
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
    display: flex;
    flex-direction: column;
  }

  .modal__topbar {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .modal__title-box {
    width: 100%;
    order: 1;
  }

  .player-controls-wrap {
    width: 100%;
    order: 3;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .studio-selector {
    width: 100%;
    overflow-x: auto;
  }

  .studio-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    scrollbar-width: none;
  }
  .studio-pills::-webkit-scrollbar {
    display: none;
  }

  .server-selector {
    width: 100%;
  }

  .server-dropdown {
    width: 100%;
  }

  .modal__topbar-actions {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    z-index: 5;
  }

  .modal__bottombar {
    padding: 0.75rem 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .modal__bottom-btns {
    width: 100%;
    justify-content: space-around;
  }

  .modal__bottom-btns .btn-action {
    flex: 1;
    justify-content: center;
    background: var(--bg-card);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
  }
}
