html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html,
body {
  min-height: 100%;
}

:root {
  --page-bg: #f4f6fb;
  --text-color: #0f172a;
  --card-bg: #ffffff;
  --card-border: #d1d5db;
  --nav-bg: #ffffff;
}

html[data-theme='dark'] {
  --page-bg: #000000;
  --text-color: #ffffff;
  --card-bg: #1e293b;
  --card-border: #334155;
  --nav-bg: #111827;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text-color);
}

.navbar {
  background: var(--nav-bg) !important;
}

.nav-link,
.navbar-brand {
  color: var(--text-color) !important;
}

.watchly-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.85rem;
}

.watchly-brand img {
  width: 30px;
  height: 30px;
  object-fit: cover;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: #fff;
}

.watchly-brand span {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.settings-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.08rem;
  font-weight: 600;
  text-decoration: none;
  border: 0;
}

.settings-icon {
  font-size: 1.18rem;
  line-height: 1;
}

.quick-settings-menu {
  min-width: 270px;
  border-radius: 12px;
  background: #0f172a;
  border: 1px solid #334155;
  color: #ffffff;
}

.quick-section-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  opacity: 1;
  color: #ffffff;
  margin-bottom: 0.4rem;
}

.quick-settings-menu .btn-outline-secondary {
  color: #ffffff;
  border-color: #64748b;
}

.quick-settings-menu .btn-outline-secondary:hover,
.quick-settings-menu .btn-outline-secondary:focus {
  color: #ffffff;
  background: #1e293b;
  border-color: #94a3b8;
}

.quick-settings-menu .form-range {
  accent-color: #ffffff;
}

.profile-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
}

.profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  background: #111827;
  color: #fff;
  overflow: hidden;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-menu {
  min-width: 300px;
  border-radius: 14px;
  overflow: hidden;
}

.profile-block {
  padding: 0.9rem 1rem;
}

.profile-name {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: #ffffff;
}

.profile-handle {
  margin: 0;
  font-size: 0.92rem;
  opacity: 0.75;
  color: #e5e7eb;
}

.auth-page {
  background: #02050c;
}

.auth-page .container {
  max-width: 100%;
  padding: 0;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background: radial-gradient(circle at 70% 10%, #131a2a 0%, #060a14 45%, #02050c 100%);
}

.auth-card-wrap {
  width: min(560px, 95vw);
  text-align: center;
}

.auth-hero-image {
  width: 190px;
  height: 190px;
  object-fit: cover;
  margin-bottom: -28px;
  position: relative;
  z-index: 2;
}

.auth-card {
  text-align: left;
  border: 1px solid #2b3345;
  background: #0d1220;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
}

.auth-title {
  font-size: 1.95rem;
  margin-bottom: 1.2rem;
  color: #ffffff;
}

.auth-label {
  color: #f8fafc;
  font-weight: 600;
}

.auth-input {
  background: #0b1020;
  border-color: #334155;
  color: #f8fafc;
}

.auth-input:focus {
  background: #0b1020;
  color: #fff;
  border-color: #f28c28;
  box-shadow: 0 0 0 0.2rem rgba(242, 140, 40, 0.2);
}

.auth-primary-btn {
  background: #f28c28;
  border-color: #f28c28;
  color: #111827;
  font-weight: 700;
}

.auth-primary-btn:hover,
.auth-primary-btn:focus {
  background: #e6760b;
  border-color: #e6760b;
  color: #111827;
}

.google-circle-btn {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 800;
  color: #ffffff;
  background: #f28c28;
}

.google-circle-btn:hover {
  color: #fff;
  background: #e6760b;
}

.auth-bottom-link {
  margin-top: 1rem;
  color: #d1d5db;
  text-align: center;
}

.auth-bottom-link a {
  color: #f28c28;
  text-decoration: none;
  font-weight: 600;
}

.auth-page .auth-card {
  background: #0d1220 !important;
  border-color: #2b3345 !important;
}

.profile-page .container {
  max-width: 1280px;
}

.profile-shell {
  border-radius: 16px;
  overflow: hidden;
  background: #111827;
  border: 1px solid #374151;
  min-height: 78vh;
}

.profile-hero {
  min-height: 300px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.profile-upload-form {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
}

.profile-header-card {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.9rem 1.3rem 1.2rem;
  background: #111827;
  border-top: 1px solid #374151;
}

.profile-avatar-wrap {
  width: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 10px;
}

.profile-avatar-lg {
  width: 122px;
  height: 122px;
  border-radius: 50%;
  border: 3px solid #f28c28;
  object-fit: cover;
  background: #0f172a;
  display: block;
  box-shadow: 0 10px 25px rgba(2, 6, 23, 0.45);
}

.profile-avatar-fallback {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
}

.profile-title-area {
  color: #c46954;
  background: #000000;
  border: 1px solid #c46954;
  border-radius: 12px;
  padding: 0.65rem 0.9rem;
}

.profile-name-lg {
  margin: 0;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 800;
}

.profile-subtitle {
  margin: 0.35rem 0 0;
  color: #c46954;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding: 1.1rem;
}

.profile-future-space {
  min-height: 220px;
  border-top: 1px solid rgba(0, 0, 0, 0.2);
  background: #c46954;
}

html[data-theme='light'] .profile-header-card,
html[data-theme='light'] .profile-stat-card,
html[data-theme='light'] .profile-future-space {
  background: #111827;
  border-color: #374151;
}

html[data-theme='light'] .profile-shell {
  background: #111827;
  border-color: #374151;
}

html[data-theme='light'] .profile-title-area,
html[data-theme='light'] .profile-subtitle,
html[data-theme='light'] .profile-name-lg {
  color: #111827 !important;
}

html[data-theme='light'] .profile-stat-card,
html[data-theme='light'] .profile-stat-number,
html[data-theme='light'] .profile-stat-label {
  color: #111827 !important;
}

html[data-theme='light'] .profile-menu {
  background: #ffffff;
}

html[data-theme='light'] .profile-menu .profile-name,
html[data-theme='light'] .profile-menu .profile-handle,
html[data-theme='light'] .profile-menu .btn {
  color: #000000 !important;
}

html[data-theme='light'] .profile-menu .btn-outline-danger {
  color: #dc3545 !important;
}

html[data-theme='light'] .profile-future-space {
  background: #111827;
  border-top-color: #374151;
}

html[data-theme='light'] .profile-title-area {
  background: #bfdbfe;
  border-color: #93c5fd;
}

html[data-theme='light'] .profile-stat-card {
  background: #bfdbfe;
  border-color: #93c5fd;
}

html[data-theme='light'] .profile-menu,
html[data-theme='light'] .profile-menu .profile-block,
html[data-theme='light'] .profile-menu .profile-name,
html[data-theme='light'] .profile-menu .profile-handle,
html[data-theme='light'] .profile-menu .btn {
  color: #111827 !important;
}

html[data-theme='light'] .profile-menu .profile-handle {
  opacity: 1 !important;
}

html[data-theme='light'] .profile-menu p,
html[data-theme='light'] .profile-menu span,
html[data-theme='light'] .profile-menu a,
html[data-theme='light'] .profile-menu button {
  color: #111827 !important;
}

html[data-theme='light'] .profile-menu .btn-dark {
  background: #e5e7eb;
  border-color: #d1d5db;
  color: #111827 !important;
}

html[data-theme='dark'] .profile-shell {
  background: #c46954;
  border-color: #8a4839;
}

html[data-theme='dark'] .profile-header-card {
  background: #c46954;
  border-top-color: rgba(0, 0, 0, 0.2);
}

html[data-theme='dark'] .profile-stat-card {
  background: #000000;
  border-color: #c46954;
}

html[data-theme='dark'] .profile-future-space {
  background: #c46954;
}

.profile-stat-card {
  border: 1px solid #c46954;
  border-radius: 12px;
  background: #000000;
  color: #c46954;
  padding: 1rem;
}

.profile-stat-number {
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 800;
  color: #c46954;
}

.profile-stat-label {
  opacity: 0.85;
  margin-top: 0.2rem;
  color: #c46954;
}

.profile-menu .btn-outline-secondary {
  background: #c46954 !important;
  border-color: #c46954 !important;
  color: #000000 !important;
}

.profile-menu .btn-outline-secondary:hover,
.profile-menu .btn-outline-secondary:focus {
  background: #b65d49 !important;
  border-color: #b65d49 !important;
  color: #000000 !important;
}

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

  .profile-avatar-wrap {
    margin-top: -46px;
  }

  .profile-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.card {
  background: var(--card-bg);
  border-color: var(--card-border);
}

.list-group-item {
  background: var(--card-bg);
  color: var(--text-color);
  border-color: var(--card-border);
}

.text-muted {
  color: color-mix(in srgb, var(--text-color) 60%, #9ca3af 40%) !important;
}

html[data-theme='dark'] .text-muted {
  color: #ffffff !important;
}

body.index-page {
  background: var(--page-bg);
}

html[data-theme='dark'] .btn-outline-dark {
  color: #f8fafc;
  border-color: #94a3b8;
}

html[data-theme='dark'] .btn-outline-dark:hover,
html[data-theme='dark'] .btn-outline-dark:focus {
  background: #334155;
  color: #ffffff;
  border-color: #cbd5e1;
}

html[data-theme='dark'] .dropdown-menu {
  background: #111827;
  border-color: #334155;
}

html[data-theme='dark'] .dropdown-item {
  color: #f8fafc;
}

html[data-theme='dark'] .dropdown-item:hover {
  background: #1f2937;
  color: #ffffff;
}

html[data-theme='light'] .category-form-card,
html[data-theme='light'] .category-list-card {
  background: #111827;
  border-color: #111827;
}

html[data-theme='light'] .category-form-card h2,
html[data-theme='light'] .category-list-card h2,
html[data-theme='light'] .category-list-card span,
html[data-theme='light'] .category-list-card p {
  color: #ffffff !important;
}

html[data-theme='light'] .category-list-card .list-group-item {
  background: transparent;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

html[data-theme='light'] .category-list-card .text-muted {
  color: #ffffff !important;
}

html[data-theme='light'] .category-form-card .form-control {
  color: #111827;
  border-color: #374151;
}

html[data-theme='dark'] .category-form-card,
html[data-theme='dark'] .category-list-card {
  background: #c46954;
  border-color: #c46954;
}

html[data-theme='dark'] .category-form-card,
html[data-theme='dark'] .category-form-card *,
html[data-theme='dark'] .category-list-card,
html[data-theme='dark'] .category-list-card * {
  color: #000000 !important;
}

html[data-theme='dark'] .category-form-card .form-control,
html[data-theme='dark'] .category-list-card .form-control {
  color: #000000;
  background: #f8f1ee;
  border-color: #5b372e;
}

html[data-theme='dark'] .category-list-card .list-group-item {
  background: transparent;
  color: #000000;
  border-color: rgba(0, 0, 0, 0.25);
}

html[data-theme='dark'] .category-list-card .media-item-title,
html[data-theme='dark'] .category-list-card .media-item-line,
html[data-theme='dark'] .category-list-card .media-item-line strong,
html[data-theme='dark'] .category-list-card .media-item-poster-empty,
html[data-theme='dark'] .random-result-card h2,
html[data-theme='dark'] .category-list-card h2 {
  color: #ffffff !important;
}

html[data-theme='light'] .category-list-card .media-item-title,
html[data-theme='light'] .category-list-card .media-item-line,
html[data-theme='light'] .category-list-card .media-item-line strong,
html[data-theme='light'] .category-list-card .media-item-poster-empty,
html[data-theme='light'] .random-result-card h2 {
  color: #111827 !important;
}

html[data-theme='light'] .category-list-card h2 {
  color: #ffffff !important;
}

html[data-theme='dark'] .category-list-card .media-item-title a,
html[data-theme='dark'] .watched-panel .media-item-title a {
  color: #ffffff !important;
}

html[data-theme='light'] .category-list-card .media-item-title a,
html[data-theme='light'] .watched-panel .media-item-title a {
  color: #111827 !important;
}

html[data-theme='light'] .random-result-card h2 {
  color: #22c55e !important;
}

html[data-theme='dark'] .category-list-card .btn-outline-danger {
  color: #ff4d5a !important;
  border-color: #ff4d5a !important;
}

html[data-theme='dark'] .category-list-card .btn-outline-danger:hover,
html[data-theme='dark'] .category-list-card .btn-outline-danger:focus {
  color: #ffffff !important;
  background: #ff4d5a !important;
  border-color: #ff4d5a !important;
}

html[data-theme='dark'] .category-list-card .btn-outline-secondary {
  color: #ffffff !important;
  border-color: #ffffff !important;
}

html[data-theme='dark'] .category-list-card .btn-outline-secondary:hover,
html[data-theme='dark'] .category-list-card .btn-outline-secondary:focus {
  color: #111827 !important;
  background: #ffffff !important;
  border-color: #ffffff !important;
}

html[data-theme='dark'] .category-sidebar {
  background: #c46954;
}

html[data-theme='dark'] .sidebar-label {
  color: #000000;
}

html[data-theme='dark'] .category-link {
  color: #000000;
}

html[data-theme='dark'] .category-link:hover,
html[data-theme='dark'] .category-link.active {
  background: #f28c28;
  color: #000000;
}

html[data-theme='dark'] .category-icon {
  background: rgba(255, 255, 255, 0.45);
  color: #000000;
}

html[data-theme='dark'] .category-count {
  background: rgba(0, 0, 0, 0.15);
  color: #000000;
}

html[data-theme='dark'] .category-form-card .btn-primary,
html[data-theme='dark'] .category-form-card .btn-success {
  background: #f28c28;
  border-color: #f28c28;
  color: #000000 !important;
}

html[data-theme='dark'] .category-form-card .btn-primary:hover,
html[data-theme='dark'] .category-form-card .btn-primary:focus,
html[data-theme='dark'] .category-form-card .btn-success:hover,
html[data-theme='dark'] .category-form-card .btn-success:focus {
  background: #e6760b;
  border-color: #e6760b;
  color: #000000 !important;
}

.settings-panel {
  max-height: 70vh;
  overflow-y: auto;
}

.settings-option {
  display: flex;
  justify-content: flex-start;
}

.settings-button {
  min-width: min(420px, 90%);
  font-size: 1.5rem;
  font-weight: 700;
  text-align: left;
  padding-left: 1rem;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

.settings-menu {
  min-width: min(420px, 90%);
  font-size: 1.1rem;
}

.settings-music-row {
  align-items: center;
  gap: 0.9rem;
}

.settings-volume-panel {
  width: min(300px, 42%);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  background: var(--card-bg);
}

.settings-volume-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.settings-volume-panel input[type='range'] {
  width: 100%;
}

.dashboard-layout {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.dashboard-page {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 0 1rem 0 0;
}

.category-sidebar {
  width: 72px;
  min-height: 70vh;
  background: #111827;
  border-radius: 14px;
  padding: 12px 10px;
  transition: width 0.25s ease;
  overflow: hidden;
  position: sticky;
  top: 0.75rem;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.category-sidebar:hover {
  width: 280px;
}

.sidebar-label {
  color: #9ca3af;
  font-size: 0.8rem;
  margin: 0 6px 14px;
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.category-sidebar:hover .sidebar-label {
  opacity: 1;
}

.category-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #e5e7eb;
  border-radius: 10px;
  padding: 10px 8px;
}

.category-link:hover {
  background: #1f2937;
  color: #fff;
}

.category-link.active {
  background: #2563eb;
  color: #fff;
}

.category-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.category-text,
.category-count {
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.category-sidebar:hover .category-text,
.category-sidebar:hover .category-count {
  opacity: 1;
}

.category-count {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 0.8rem;
}

.category-main {
  flex: 1;
  min-width: 0;
}

.category-content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(560px, 40vw, 700px);
  gap: 1rem;
  align-items: start;
}

.category-primary-column {
  min-width: 0;
}

.watched-panel {
  position: sticky;
  top: 0.75rem;
  min-height: 260px;
}

.category-action-row {
  display: flex;
  align-items: stretch;
  gap: 0.7rem;
}

.add-item-form {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(150px, 1fr);
  gap: 0.6rem;
}

.add-input-wrap,
.add-button-wrap {
  display: flex;
}

.add-input-wrap {
  position: relative;
}

.catalog-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 70;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.catalog-result-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  text-align: left;
  padding: 0.55rem 0.7rem;
}

.catalog-result-item:hover {
  background: rgba(37, 99, 235, 0.1);
}

.catalog-thumb {
  width: 40px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: #334155;
}

.catalog-thumb-empty {
  display: inline-block;
}

.catalog-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.catalog-title {
  font-weight: 700;
  line-height: 1.2;
}

.catalog-sub {
  font-size: 0.82rem;
  opacity: 0.82;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.catalog-no-result {
  padding: 0.7rem 0.8rem;
  font-size: 0.9rem;
}

html[data-theme='dark'] .catalog-search-results {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

html[data-theme='dark'] .category-form-card .catalog-search-results,
html[data-theme='dark'] .category-form-card .catalog-search-results *,
html[data-theme='dark'] .category-form-card .catalog-title,
html[data-theme='dark'] .category-form-card .catalog-sub,
html[data-theme='dark'] .category-form-card .catalog-no-result {
  color: #f8fafc !important;
}

html[data-theme='dark'] .catalog-result-item:hover {
  background: rgba(148, 163, 184, 0.18);
}

html[data-theme='light'] .catalog-search-results {
  background: #ffffff;
  border-color: #d1d5db;
  color: #0f172a;
}

html[data-theme='light'] .catalog-result-item:hover {
  background: rgba(15, 23, 42, 0.06);
}

.add-button-wrap .btn {
  width: 100%;
}

.random-form-inline {
  width: clamp(150px, 16vw, 220px);
  display: flex;
}

.random-inline-btn {
  width: 100%;
  white-space: nowrap;
}

.media-item-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.media-item-card {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: start;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  background: color-mix(in srgb, var(--card-bg) 85%, #0f172a 15%);
}

.media-item-poster {
  width: 52px;
  height: 74px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #0f172a;
}

.media-item-poster-empty {
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  text-align: center;
  padding: 0.2rem;
}

.media-item-content {
  min-width: 0;
}

.media-item-title {
  margin: 0 0 0.35rem;
  font-size: 1.06rem;
  font-weight: 700;
  line-height: 1.15;
}

.media-item-line {
  margin: 0.14rem 0;
  font-size: 0.98rem;
  line-height: 1.25;
}

.media-item-summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-clamp: 2;
  min-height: 2.45em;
}

.media-item-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-end;
}

.media-item-actions .btn {
  min-width: 106px;
}

@media (max-width: 991px) {
  .dashboard-layout {
    flex-direction: column;
  }

  .category-sidebar,
  .category-sidebar:hover {
    width: 100%;
    min-height: auto;
    position: static;
  }

  .sidebar-label,
  .category-text,
  .category-count,
  .category-sidebar:hover .sidebar-label,
  .category-sidebar:hover .category-text,
  .category-sidebar:hover .category-count {
    opacity: 1;
  }

  .category-action-row {
    flex-direction: column;
  }

  .add-item-form {
    grid-template-columns: 1fr;
  }

  .random-form-inline {
    width: 100%;
  }

  .category-content-layout {
    grid-template-columns: 1fr;
  }

  .watched-panel {
    position: static;
  }

  .media-item-card {
    grid-template-columns: 1fr;
  }

  .media-item-actions {
    align-items: stretch;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .settings-music-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .settings-volume-panel {
    width: min(420px, 90%);
  }
}

/* Home page layout */
.home-shell {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  width: 100%;
  position: relative;
}

.home-main {
  flex: 1;
  min-width: 0;
  padding-right: 4rem;
}

.home-top-gap {
  height: 1.75rem;
}

.home-row {
  display: grid;
  grid-template-columns: 240px minmax(380px, 1fr);
  align-items: stretch;
  gap: 1rem;
  margin-bottom: 1rem;
}

.home-category-label {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #0f172a;
  font-weight: 800;
  font-size: clamp(2rem, 3.2vw, 3rem);
  letter-spacing: 0.03em;
  line-height: 1;
  padding-left: 0.25rem;
}

.home-category-label:hover {
  color: #1d4ed8;
}

.home-popular-box {
  min-height: 118px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  padding: 0.9rem 1rem;
}

.home-popular-box h2 {
  margin: 0;
  font-size: clamp(1rem, 1.5vw, 1.35rem);
  text-transform: uppercase;
  font-weight: 700;
}

.home-popular-placeholder {
  height: 70px;
}

.right-hover-panel {
  position: fixed;
  top: 108px;
  right: 0;
  width: 56px;
  min-height: 70vh;
  background: #0f172a;
  border-top-left-radius: 14px;
  border-bottom-left-radius: 14px;
  transition: width 0.25s ease;
  overflow: hidden;
  z-index: 20;
}

.right-hover-panel:hover {
  width: 300px;
}

.right-hover-tab {
  color: #f8fafc;
  font-size: 0.9rem;
  font-weight: 700;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: center;
  padding: 1rem 0;
  width: 56px;
  height: 100%;
}

.right-hover-content {
  position: absolute;
  inset: 0 0 0 56px;
}

@media (max-width: 1200px) {
  .home-main {
    padding-right: 0;
  }

  .right-hover-panel,
  .right-hover-panel:hover {
    width: 100%;
    min-height: 56px;
    position: static;
    border-radius: 10px;
  }

  .right-hover-tab {
    writing-mode: horizontal-tb;
    transform: none;
    width: auto;
    height: auto;
    padding: 0.8rem 1rem;
  }

  .right-hover-content {
    position: static;
    min-height: 0;
  }
}

@media (max-width: 900px) {
  .home-row {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .home-category-label {
    font-size: clamp(1.8rem, 8vw, 2.4rem);
  }
}

.media-detail-page {
  display: grid;
  gap: 1rem;
}

.media-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.media-detail-category {
  font-weight: 700;
}

.media-detail-card {
  display: grid;
  gap: 1rem;
  grid-template-columns: 280px 1fr;
  background: var(--surface-bg);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  padding: 1rem;
}

.media-detail-poster img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
}

.media-detail-no-poster {
  width: 100%;
  min-height: 280px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px dashed var(--surface-border);
}

.media-detail-content h1 {
  margin-bottom: 0.75rem;
}

.media-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}

.media-detail-meta {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.media-detail-summary h2,
.media-detail-similar h2 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.media-detail-summary p {
  white-space: pre-wrap;
  line-height: 1.55;
}

.media-detail-trailer {
  margin-bottom: 1rem;
}

.media-detail-trailer iframe,
.media-detail-trailer video {
  width: 100%;
  min-height: 320px;
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: #000;
}

.media-detail-similar {
  background: var(--surface-bg);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  padding: 1rem;
}

.media-similar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.8rem;
}

.media-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.media-gallery-item {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--surface-border);
  display: block;
}

.media-gallery-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.media-cast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.75rem;
}

.media-cast-card {
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--item-bg);
}

.media-cast-card img {
  width: 100%;
  height: 170px;
  object-fit: cover;
}

.media-cast-body {
  padding: 0.55rem;
  display: grid;
  gap: 0.25rem;
}

.media-cast-body span {
  font-size: 0.86rem;
  opacity: 0.9;
}

.media-similar-card {
  text-decoration: none;
  color: inherit;
  background: var(--item-bg);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  grid-template-rows: 170px 1fr;
}

.media-similar-card img {
  width: 100%;
  height: 170px;
  object-fit: cover;
}

.media-similar-body {
  padding: 0.6rem;
  display: grid;
  gap: 0.25rem;
}

.media-similar-body span {
  opacity: 0.85;
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .media-detail-card {
    grid-template-columns: 1fr;
  }
}

.media-item-title a {
  color: inherit;
  text-decoration: none;
}

.catalog-result-item {
  text-decoration: none;
  color: inherit;
}

.profile-future-space .profile-stat-number {
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 700;
  word-break: break-word;
}

.rating-modal-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  min-height: 36px;
  padding-right: 120px;
}

.rating-modal-character {
  position: absolute;
  top: -92px;
  right: 58px;
  width: 154px;
  height: auto;
  max-height: 170px;
  object-fit: contain;
  z-index: 4;
  pointer-events: none;
  filter: drop-shadow(0 13px 12px rgba(15, 23, 42, 0.35));
  transform: rotate(1.5deg);
}

#ratingModal .modal-dialog {
  margin-top: 6.5rem;
}

#ratingModal .modal-content {
  position: relative;
  overflow: visible;
}

#ratingModal .modal-header {
  position: relative;
  overflow: visible;
}

#ratingModal .modal-header::after {
  content: "";
  position: absolute;
  right: 48px;
  bottom: -1px;
  width: 170px;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, 0.22), rgba(15, 23, 42, 0));
  z-index: 3;
}

#ratingModal .btn-close {
  position: relative;
  z-index: 5;
}

.rating-level-btn {
  border: 1px solid transparent;
  font-weight: 700;
  color: #000000 !important;
  min-height: 40px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.rating-level-btn.active {
  border-color: #ffffff;
  transform: translateX(6px) scale(1.025);
  box-shadow:
    0 0 0 2px rgba(17, 24, 39, 0.86),
    0 0 0 5px rgba(255, 255, 255, 0.58),
    0 12px 24px rgba(15, 23, 42, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.55);
  filter: saturate(1.12) brightness(1.03);
}

.rating-level-btn:hover,
.rating-level-btn:focus {
  transform: translateX(4px) scale(1.01);
  filter: saturate(1.15) brightness(1.04);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.18);
}

.rating-level-1 {
  background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 55%, #b91c1c 100%) !important;
}

.rating-level-2 {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 58%, #f87171 100%) !important;
}

.rating-level-3 {
  background: linear-gradient(135deg, #eab308 0%, #facc15 55%, #fde047 100%) !important;
}

.rating-level-4 {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 55%, #60a5fa 100%) !important;
}

.rating-level-5 {
  background: linear-gradient(135deg, #15803d 0%, #22c55e 55%, #86efac 100%) !important;
}

.rating-level-6 {
  background: linear-gradient(135deg, #000000 0%, #111827 62%, #374151 100%) !important;
  color: #ffffff !important;
}

@media (max-width: 560px) {
  .rating-modal-heading {
    padding-right: 82px;
  }

  .rating-modal-character {
    top: -68px;
    right: 40px;
    width: 112px;
  }

  #ratingModal .modal-dialog {
    margin-top: 5rem;
  }
}

.muk-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.muk-card {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.34), rgba(15, 23, 42, 0.24));
  padding: 0.6rem;
  display: grid;
  gap: 0.45rem;
  justify-items: center;
  text-align: center;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.16);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.muk-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.22);
}

.muk-label {
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0.9;
}

.muk-poster {
  width: 100%;
  max-width: 120px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: #0b1222;
}

.muk-name {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  word-break: break-word;
}

html[data-theme='dark'] .profile-future-space h2,
html[data-theme='dark'] .muk-label,
html[data-theme='dark'] .muk-name {
  color: #000000 !important;
}

html[data-theme='dark'] .muk-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.34));
  border-color: rgba(0, 0, 0, 0.32);
}

html[data-theme='light'] .profile-future-space h2,
html[data-theme='light'] .muk-label,
html[data-theme='light'] .muk-name {
  color: #ffffff !important;
}

html[data-theme='light'] .muk-card {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
}

@media (max-width: 860px) {
  .muk-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .muk-grid {
    grid-template-columns: 1fr;
  }
}

.rating-modal-title {
  color: #111827 !important;
}

.rating-item-name {
  color: #2563eb !important;
}

.rating-note {
  color: #111827 !important;
}


/* =====================================================================
   v2 eklemeleri (mevcut gorunumu degistirmez, sadece yeni ogeler)
   ===================================================================== */

/* Anasayfa: "Haftanin populerleri" kutusundaki poster seridi
   (eski bos 70px alanin icine oturur, kutunun boyutu degismez) */
.home-popular-strip {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.45rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

.home-popular-item {
  flex: 0 0 auto;
  height: 70px;
  width: 50px;
  border-radius: 6px;
  overflow: hidden;
  background: #334155;
  scroll-snap-align: start;
  transition: transform 0.15s ease;
}

.home-popular-item:hover {
  transform: translateY(-2px);
}

.home-popular-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Arama sonuclari: klavye ile secilen satir + yil */
.catalog-result-item.active {
  background: rgba(37, 99, 235, 0.14);
}

html[data-theme='dark'] .catalog-result-item.active {
  background: rgba(148, 163, 184, 0.22);
}

.catalog-year {
  font-weight: 400;
  opacity: 0.7;
}

/* =====================================================================
   Sosyal: profil, arkadaslar, mesajlar, sohbet
   ===================================================================== */
.social-badge {
  display: none;
  min-width: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #f28c28;
  color: #000;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.25rem;
  text-align: center;
  vertical-align: middle;
}
.social-badge.show { display: inline-block; }

.social-shell {
  max-width: 820px;
  margin: 0 auto;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 1.1rem;
}
.social-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.social-tabs a {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
}
.social-tabs a.active { background: #c46954; border-color: #c46954; color: #000; }
.social-h { font-size: 1rem; font-weight: 700; margin: 1.2rem 0 0.6rem; }
.social-empty { opacity: 0.8; }
.social-empty a { color: #f28c28; }
.social-search { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.social-list { display: grid; gap: 0.5rem; }

.social-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  color: var(--text-color);
  text-decoration: none;
  flex-wrap: wrap;
}
a.social-card:hover { border-color: #c46954; color: var(--text-color); }
.social-card-user {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  flex: 1 1 220px;
  color: inherit;
  text-decoration: none;
}
.social-card-text { display: flex; flex-direction: column; min-width: 0; }
.social-card-name { font-weight: 700; }
.social-card-bio {
  font-size: 0.85rem;
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.social-card-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.social-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  border: 2px solid #c46954;
  background: #0f172a;
}
.social-avatar-fallback {
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
}
.social-convo.unread .social-card-name,
.social-convo.unread .social-card-bio { font-weight: 800; opacity: 1; }
.social-convo-meta { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; opacity: 0.85; }

/* Sohbet */
.chat-shell { display: flex; flex-direction: column; height: calc(100vh - 140px); min-height: 420px; padding: 0; overflow: hidden; }
.chat-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--card-border);
}
.chat-back { font-size: 1.4rem; color: var(--text-color); text-decoration: none; padding: 0 0.3rem; }
.chat-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.35rem; }
.chat-older { align-self: center; margin-bottom: 0.5rem; }
.chat-msg { max-width: 78%; display: flex; flex-direction: column; }
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-msg.theirs { align-self: flex-start; }
.chat-body {
  padding: 0.5rem 0.8rem;
  border-radius: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.chat-msg.mine .chat-body { background: #c46954; color: #000; border-bottom-right-radius: 4px; }
.chat-msg.theirs .chat-body { background: color-mix(in srgb, var(--card-bg) 70%, #64748b 30%); color: var(--text-color); border-bottom-left-radius: 4px; }
.chat-meta { font-size: 0.7rem; opacity: 0.65; margin: 0.1rem 0.3rem 0.2rem; }
.chat-form { display: flex; gap: 0.5rem; padding: 0.7rem; border-top: 1px solid var(--card-border); align-items: flex-end; }
.chat-form textarea { resize: none; max-height: 160px; }
.chat-locked { padding: 1rem; border-top: 1px solid var(--card-border); display: grid; gap: 0.6rem; }

/* Profil ekleri */
.profile-actions { margin-left: auto; display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.profile-bio, .profile-lists, .profile-friends {
  padding: 1.1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.2);
  background: #111827;
  color: #e5e7eb;
}
.profile-bio-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-bio textarea { background: #0b1222; color: #fff; border-color: #374151; }
.profile-list-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.profile-list-tab {
  border: 1px solid #c46954;
  background: transparent;
  color: #e5e7eb;
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-weight: 600;
}
.profile-list-tab span { opacity: 0.7; font-size: 0.8rem; margin-left: 0.2rem; }
.profile-list-tab.active { background: #c46954; color: #000; }
.profile-list-panel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 0.8rem;
}
.profile-list-item img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 10px;
  background: #0f172a;
}
.profile-list-name {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.profile-list-status { font-size: 0.75rem; opacity: 0.7; }
.profile-list-status.done { color: #f28c28; opacity: 1; }
.profile-friends-row { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.profile-friend {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  width: 72px;
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.8rem;
  text-align: center;
  overflow-wrap: anywhere;
}
.profile-friend .social-avatar { width: 56px; height: 56px; }

@media (max-width: 600px) {
  .profile-actions { margin-left: 0; }
  .chat-msg { max-width: 90%; }
  .social-shell { padding: 0.8rem; }
}
