/* ========================================
   RE:Kaze — Main Stylesheet
   Clean Dark Matte / Green Tech Theme
   ======================================== */

/* ---------- Design Tokens & Variables ---------- */
:root {
  /* Background Palette (OLED Clean Dark) */
  --bg-primary: #0A0F0C;
  --bg-secondary: #0F1A14;
  --bg-tertiary: #14221A;
  --bg-card: rgba(15, 26, 20, 0.85);
  --bg-card-hover: rgba(20, 34, 26, 0.95);
  --bg-hover: #182B21;
  --bg-overlay: rgba(10, 15, 12, 0.94);
  --bg-glass: rgba(15, 26, 20, 0.75);

  /* Typography Colors */
  --text-primary: #E2E8F0;
  --text-secondary: #94A3B8;
  --text-muted: #5E7266;
  --text-dim: #475569;

  /* Clean Green Accents (Matte / Non-Neon) */
  --accent: #A6E3A1;
  --accent-light: #C1F0BC;
  --accent-hover: #22C55E;
  --accent-dim: rgba(166, 227, 161, 0.12);
  --accent-border: rgba(166, 227, 161, 0.18);

  /* Status & Auxiliary Colors */
  --purple: #A78BFA;
  --green: #22C55E;
  --red: #F87171;
  --red-dim: rgba(248, 113, 113, 0.12);
  --blue: #38BDF8;
  --gold: #FBBF24;
  --gold-dim: rgba(251, 191, 36, 0.12);

  /* Borders & Dividers */
  --border: rgba(166, 227, 161, 0.08);
  --border-hover: rgba(166, 227, 161, 0.2);
  --border-glass: rgba(255, 255, 255, 0.06);

  /* Corner Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows (Natural, Non-Glowing) */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.65);

  /* Layout */
  --header-height: 68px;
  --sidebar-width: 360px;
  --max-width: 1560px;

  /* Typography */
  --font-body: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', 'Plus Jakarta Sans', sans-serif;

  /* Animation */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- CSS Reset & Base ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

body.site-gif-background-active,
body.profile-background-active { position: relative; background-color: transparent; }

body.site-gif-background-active::before,
body.profile-background-active::before { position: fixed; z-index: 0; inset: 0; content: ""; background-position: center; background-size: cover; }

body.site-gif-background-active::before { background-image: var(--login-gif-url, none), radial-gradient(circle at 15% 20%, rgba(166, 227, 161, 0.3), transparent 28%), radial-gradient(circle at 85% 75%, rgba(137, 180, 250, 0.28), transparent 30%), linear-gradient(125deg, #0a1510, #111914 50%, #0c1319); }
body.profile-background-active::before {
  background-image: linear-gradient(rgba(7, 11, 8, 0.38), rgba(7, 11, 8, 0.62)), var(--profile-background-url, none), radial-gradient(circle at 15% 20%, rgba(166, 227, 161, 0.3), transparent 28%), linear-gradient(125deg, #0a1510, #111914 50%, #0c1319);
  filter: blur(10px);
  transform: scale(1.04);
}
#app { position: relative; z-index: 1; min-height: 100vh; }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  outline: none;
}

img {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ---------- Typography & Utility ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

svg {
  vertical-align: middle;
  flex-shrink: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
}

.btn-primary {
  background: var(--accent);
  color: #0A0F0C;
  border: 1px solid transparent;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #0A0F0C;
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--accent-light);
  transform: translateY(-1px);
}

/* Badges & Chips */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.badge-accent {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: transparent;
}

.badge-tech {
  background: rgba(56, 189, 248, 0.1);
  color: var(--blue);
  border-color: rgba(56, 189, 248, 0.2);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.badge-score {
  background: var(--gold-dim);
  color: var(--gold);
  border-color: rgba(251, 191, 36, 0.2);
}

.badge-filler {
  background: var(--red-dim);
  color: var(--red);
  border-color: rgba(248, 113, 113, 0.2);
}

/* ---------- Global Layout ---------- */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#page-content {
  flex: 1;
  padding-top: var(--header-height);
}

/* Loading & Empty States */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 55vh;
  gap: 16px;
  color: var(--text-secondary);
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

.loading-text {
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

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

.error-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 55vh;
  gap: 12px;
  color: var(--text-secondary);
  text-align: center;
  padding: 24px;
}

.error-screen svg {
  color: var(--red);
  margin-bottom: 8px;
}

.account-page { display: grid; place-items: center; min-height: 65vh; padding: 32px 16px; }
.account-card { width: min(100%, 430px); padding: 32px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-card); box-shadow: var(--shadow-lg); text-align: center; }
.auth-page { position: relative; isolation: isolate; min-height: calc(100vh - var(--header-height)); overflow: hidden; }
.auth-page-background { position: absolute; z-index: 0; inset: 0; overflow: hidden; pointer-events: none; background: radial-gradient(circle at 15% 20%, rgba(166, 227, 161, 0.3), transparent 28%), radial-gradient(circle at 85% 75%, rgba(137, 180, 250, 0.28), transparent 30%), linear-gradient(125deg, #0a1510, #111914 50%, #0c1319); }
.auth-page-background::after { position: absolute; inset: 0; content: ""; background: rgba(7, 11, 8, 0.57); }
.auth-page-background img { width: 100%; height: 100%; object-fit: cover; animation: login-background-drift 24s ease-in-out infinite alternate; }
.auth-page-background:not(.has-image)::before { position: absolute; width: 48vw; height: 48vw; content: ""; border-radius: 50%; background: rgba(166, 227, 161, 0.14); filter: blur(26px); animation: login-background-orb 13s ease-in-out infinite alternate; }
.auth-page .account-card { position: relative; z-index: 1; background: rgba(24, 28, 24, 0.76); backdrop-filter: blur(7px); }
@keyframes login-background-drift { from { transform: scale(1.02); } to { transform: scale(1.1); } }
@keyframes login-background-orb { from { transform: translate(-10%, -8%); } to { transform: translate(125%, 78%); } }
.account-page-icon { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%; color: var(--accent); background: var(--accent-dim); }
.account-card h1 { margin: 0; font-size: 24px; }
.account-page-lead { margin: 10px 0 24px; color: var(--text-secondary); font-size: 14px; line-height: 1.6; }
.account-form { display: grid; gap: 14px; text-align: left; }
.account-form label { display: grid; gap: 7px; color: var(--text-secondary); font-size: 13px; font-weight: 600; }
.account-form input { width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); outline: none; color: var(--text-primary); background: var(--bg-primary); }
.account-form input:focus { border-color: var(--accent); }
.account-form .btn { justify-content: center; margin-top: 4px; }
.account-form-note { margin: 18px 0 0; color: var(--text-muted); font-size: 13px; }
.account-link-btn { padding: 0; border: 0; color: var(--accent); background: transparent; cursor: pointer; font: inherit; font-weight: 700; }

/* ---------- Profiles & Watch History ---------- */
.profile-page,
.history-page {
  width: min(100% - 32px, 1120px);
  margin: 0 auto;
  padding: 34px 0 64px;
}

.profile-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
}

.profile-background-active .profile-hero,
.profile-background-active .profile-settings-card,
.profile-background-active .public-profile-bio,
.profile-background-active .public-profile-stats {
  background: rgba(15, 26, 20, 0.76);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.profile-banner {
  position: relative;
  height: 236px;
  overflow: hidden;
  background: var(--bg-tertiary);
}

.profile-banner::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(7, 11, 8, 0.08) 10%, rgba(7, 11, 8, 0.72) 100%);
  pointer-events: none;
}

.profile-banner-image,
.profile-banner-fallback {
  display: block;
  width: 100%;
  height: 100%;
}

.profile-banner-image {
  object-fit: cover;
}

.profile-banner-fallback {
  background:
    radial-gradient(circle at 82% 16%, rgba(166, 227, 161, 0.36), transparent 27%),
    radial-gradient(circle at 18% 86%, rgba(137, 180, 250, 0.25), transparent 33%),
    linear-gradient(125deg, #182820 0%, #0d1711 48%, #18211c 100%);
}

.profile-identity {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 18px;
  min-height: 140px;
  margin-top: -64px;
  padding: 0 28px 26px;
}

.profile-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 134px;
  height: 134px;
  overflow: hidden;
  place-items: center;
  border: 4px solid var(--bg-card);
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-dim);
  box-shadow: var(--shadow-md);
  font-size: 45px;
  font-weight: 800;
}

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

.profile-identity-text {
  flex: 1;
  min-width: 0;
  padding-bottom: 2px;
}

.profile-eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.profile-identity-text h1,
.history-heading h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(25px, 4vw, 34px);
  letter-spacing: -0.03em;
}

.profile-identity-text > p:last-child,
.history-heading > div > p:last-child {
  margin: 5px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.profile-view-link,
.history-heading .btn,
.history-resume-link,
.button-icon {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.profile-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 20px;
  margin-top: 22px;
}

.profile-settings-card,
.public-profile-bio {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.profile-settings-card {
  padding: 24px;
}

.settings-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 22px;
}

.settings-card-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  color: var(--accent);
  background: var(--accent-dim);
}

.settings-card-heading h2,
.public-profile-bio h2,
.history-empty h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 18px;
}

.settings-card-heading p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.profile-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.profile-upload-control {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.profile-upload-control:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

.profile-upload-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.profile-upload-preview {
  display: block;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--bg-tertiary);
}

.avatar-upload-preview {
  border-radius: 50%;
}

.profile-upload-avatar {
  display: grid;
  width: 100%;
  height: 100%;
  overflow: hidden;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-dim);
  font-size: 19px;
  font-weight: 800;
}

.banner-upload-preview .profile-banner {
  height: 56px;
}

.profile-upload-control strong,
.profile-upload-control small {
  display: block;
}

.profile-upload-control strong {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-upload-control small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.profile-upload-control .btn {
  grid-column: 1 / -1;
  justify-content: center;
  padding: 8px 10px;
  font-size: 12px;
}

.profile-upload-control .btn.is-loading {
  opacity: 0.7;
}

.profile-bio-form {
  display: grid;
  gap: 9px;
}

.profile-bio-form label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.profile-bio-form textarea {
  width: 100%;
  min-height: 122px;
  resize: vertical;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--text-primary);
  background: var(--bg-primary);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
}

.profile-bio-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.profile-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.profile-input-icon {
  position: absolute;
  left: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.2s ease;
}

.profile-bio-form input[type="text"],
.profile-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--text-primary);
  background: var(--bg-primary);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.profile-bio-form input[type="text"]:focus,
.profile-input:focus {
  border-color: var(--accent);
  background: rgba(166, 227, 161, 0.04);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.profile-input-wrap:focus-within .profile-input-icon {
  color: var(--accent);
}

.profile-bio-form input[type="text"]::placeholder,
.profile-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
  font-weight: 400;
}

.profile-bio-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.form-status {
  min-height: 19px;
  margin: 10px 0 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.form-status.is-error {
  color: var(--red);
}

.public-profile-bio {
  margin-top: 22px;
  padding: 28px;
}

.public-profile-bio p {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.75;
}

.history-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.history-card {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  overflow: hidden;
  min-height: 176px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), border-color var(--transition);
}

.history-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.history-card-cover {
  position: relative;
  display: grid;
  overflow: hidden;
  place-items: center;
  color: var(--text-muted);
  background: var(--bg-tertiary);
}

.history-card-cover > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}

.history-card:hover .history-card-cover > img {
  transform: scale(1.05);
}

.history-cover-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background: linear-gradient(145deg, var(--bg-tertiary), var(--bg-primary));
}

.history-card-play {
  position: absolute;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: var(--bg-primary);
  background: var(--accent);
  box-shadow: var(--shadow-md);
}

.history-card-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 16px;
}

.history-card-title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.history-card-title {
  flex: 1;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-card-title:hover,
.history-resume-link:hover {
  color: var(--accent);
}

.history-remove {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
}

.history-remove:hover:not(:disabled) {
  color: var(--red);
  background: rgba(243, 139, 168, 0.12);
}

.history-card-meta,
.history-card-progress {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.history-progress {
  height: 5px;
  overflow: hidden;
  margin-top: auto;
  border-radius: var(--radius-full);
  background: var(--bg-primary);
}

.history-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.history-resume-link {
  width: fit-content;
  margin-top: 11px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.history-empty {
  display: grid;
  justify-items: center;
  max-width: 580px;
  margin: 58px auto;
  padding: 44px 28px;
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-lg);
  text-align: center;
}

.history-empty-icon {
  display: grid;
  width: 62px;
  height: 62px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-dim);
}

.history-empty p {
  max-width: 440px;
  margin: 9px 0 22px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.65;
}

.admin-page {
  width: min(100% - 32px, 960px);
  margin: 0 auto;
  padding: 34px 0 64px;
}

.admin-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.admin-heading h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(25px, 4vw, 34px);
  letter-spacing: -0.03em;
}

.admin-heading > div > p:last-child {
  margin: 5px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.admin-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.admin-stat {
  display: grid;
  min-width: 128px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.admin-stat strong {
  color: var(--accent);
  font-size: 23px;
  line-height: 1.1;
}

.admin-stat span {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

/* ===== Admin Tabs Navigation ===== */
.admin-tabs-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  overflow-x: auto;
}

.admin-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.admin-tab-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

.admin-tab-btn.active {
  color: #0b140e;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 2px 12px color-mix(in srgb, var(--accent) 35%, transparent);
}

.admin-tab-btn.active svg {
  stroke: #0b140e;
}

.admin-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-hover);
  color: var(--text-primary);
}

.admin-tab-btn.active .admin-tab-badge {
  background: rgba(0, 0, 0, 0.18);
  color: #0b140e;
}

.admin-live-pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  animation: adminPulse 1.8s infinite;
}

@keyframes adminPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.55; }
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
  animation: adminFadeIn 0.25s ease;
}

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

.admin-gif-upload-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  margin-top: 16px;
}

.admin-gif-empty-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-align: center;
  gap: 8px;
  margin-top: 16px;
}

.admin-system-card {
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
}

.admin-system-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.admin-live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 20px;
  font-size: 12px;
  color: #22c55e;
  font-weight: 700;
}

.admin-panel {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.admin-appearance-panel {
  display: block;
  margin-bottom: 18px;
}

.admin-appearance-heading h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 17px;
}

.admin-appearance-heading p {
  max-width: 560px;
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.admin-appearance-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.admin-appearance-controls input {
  min-width: 0;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
}

.admin-invite-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.admin-invite-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.admin-invite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.admin-invite-details { min-width: 0; }

.admin-invite-code-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-invite-code {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.admin-invite-state {
  padding: 3px 8px;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
}

.admin-invite-state.is-used {
  color: var(--text-muted);
  background: var(--bg-hover);
}

.admin-invite-meta {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.admin-invite-actions { flex-shrink: 0; }

.admin-gif-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.admin-gif-item {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: linear-gradient(125deg, #0a1510, #1c3022);
}

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

.admin-gif-remove {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: white;
  background: rgba(10, 15, 12, 0.72);
}

.admin-gif-remove:hover:not(:disabled) { color: var(--red); background: rgba(10, 15, 12, 0.92); }
.admin-gif-remove:disabled { opacity: 0.5; cursor: wait; }
.admin-appearance-panel .form-status { margin: 12px 0 0; }

.admin-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.admin-controls input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--text-primary);
  background: var(--bg-primary);
  font: inherit;
  font-size: 13px;
}

.admin-controls input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.admin-counter {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-user-list {
  display: grid;
  gap: 8px;
}

.admin-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
}

.admin-user-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.admin-user-identity:hover strong {
  color: var(--accent);
}

.admin-user-initial {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-dim);
  font-size: 14px;
  font-weight: 800;
}

.admin-user-initial img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.admin-user-identity strong,
.admin-role {
  display: block;
}

.admin-user-identity strong {
  overflow: hidden;
  max-width: 360px;
  color: var(--text-primary);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-role {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.admin-role.is-admin {
  color: var(--accent);
}

.admin-role.is-banned {
  color: #ff5252;
}

.admin-user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.admin-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.admin-action-btn:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.admin-action-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.admin-action-btn.is-admin {
  color: #ffd54f;
  background: rgba(255, 213, 79, 0.12);
  border-color: rgba(255, 213, 79, 0.35);
}

.admin-action-btn.is-admin:hover:not(:disabled) {
  color: #ff5252;
  background: rgba(255, 82, 82, 0.12);
  border-color: rgba(255, 82, 82, 0.35);
}

.admin-action-btn.is-banned {
  color: #ff5252;
  background: rgba(255, 82, 82, 0.12);
  border-color: rgba(255, 82, 82, 0.35);
}

.admin-action-btn.is-banned:hover:not(:disabled) {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
}

.admin-action-btn.ban-btn:hover:not(:disabled) {
  color: #ff9800;
  border-color: #ff9800;
  background: rgba(255, 152, 0, 0.12);
}

.admin-action-btn.delete-btn:hover:not(:disabled) {
  color: #ff5252;
  border-color: #ff5252;
  background: rgba(255, 82, 82, 0.12);
}

.admin-role-action {
  flex: 0 0 auto;
  justify-content: center;
  min-width: 142px;
  padding: 8px 10px;
  font-size: 12px;
}

.admin-empty {
  margin: 8px 0;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* ---------- Header Component ---------- */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(10, 15, 12, 0.76);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 28px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  gap: 24px;
}

/* Brand Logo */
.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-badge {
  display: flex;
  align-items: center;
  gap: 2px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.5px;
}

.logo-prefix {
  color: var(--accent);
}

.logo-name {
  color: var(--text-primary);
}

/* Search Bar */
.search-container {
  position: relative;
  flex: 1;
  max-width: 480px;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0 16px;
  height: 42px;
  transition: all var(--transition);
}

.search-input-wrap:focus-within {
  border-color: var(--accent);
  background: var(--bg-tertiary);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.search-icon {
  color: var(--text-muted);
  margin-right: 10px;
  transition: color var(--transition);
}

.search-input-wrap:focus-within .search-icon {
  color: var(--accent);
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-kbd {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border);
  user-select: none;
}

/* Search Autocomplete Suggestions */
.search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: none;
  z-index: 1100;
  animation: dropdown-fade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdown-fade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-suggestions.active {
  display: block;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
  border-bottom: 1px solid var(--border);
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.focused {
  background: var(--bg-hover);
  border-left: 3px solid var(--accent);
  padding-left: 11px;
}

.suggestion-poster {
  width: 38px;
  height: 52px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-tertiary);
}

.suggestion-info {
  flex: 1;
  min-width: 0;
}

.suggestion-info h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.suggestion-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.suggestion-tag {
  background: var(--accent-dim);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  font-weight: 600;
  font-size: 10px;
}

.suggestion-view-all {
  justify-content: space-between;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  padding: 12px 16px;
  background: rgba(166, 227, 161, 0.05);
}

.suggestion-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;
  color: var(--text-muted);
  font-size: 13px;
  justify-content: center;
}

/* Nav Buttons */
.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
  border: 1px solid transparent;
}

.nav-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-btn.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: var(--border-hover);
}

.nav-btn-random:hover {
  color: var(--purple);
  background: rgba(167, 139, 250, 0.1);
  border-color: rgba(167, 139, 250, 0.2);
}

/* ---------- Hero Carousel Section ---------- */
.hero-section {
  position: relative;
  width: 100%;
  height: 540px;
  overflow: hidden;
  background: var(--bg-primary);
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.7s;
  display: flex;
  align-items: flex-end;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center 25%;
  filter: brightness(0.65) saturate(105%);
}

.hero-gradient-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    linear-gradient(180deg, rgba(10, 15, 12, 0.2) 0%, rgba(10, 15, 12, 0.8) 70%, var(--bg-primary) 100%),
    linear-gradient(90deg, rgba(10, 15, 12, 0.95) 0%, rgba(10, 15, 12, 0.6) 45%, transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 5;
  padding: 0 48px 56px;
  max-width: 800px;
}

.hero-spotlight-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--accent-dim);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 14px;
}

.spotlight-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}

.hero-title {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 14px;
  color: #FFFFFF;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.hero-genres {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.hero-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 680px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-hero-watch {
  padding: 12px 28px;
  font-size: 15px;
  border-radius: var(--radius-full);
}

.btn-hero-details {
  padding: 12px 24px;
  font-size: 15px;
  border-radius: var(--radius-full);
}

/* Hero Footer Navigation Controls */
.hero-footer-bar {
  position: absolute;
  bottom: 24px;
  right: 48px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 20px;
}

.hero-slide-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.25);
  transition: all var(--transition);
  padding: 0;
}

.hero-dot.active {
  width: 24px;
  background: var(--accent);
}

.hero-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  padding: 4px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.hero-nav button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  transition: all var(--transition);
}

.hero-nav button:hover {
  background: var(--accent);
  color: #0A0F0C;
}

.hero-counter {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 0 4px;
}

/* ---------- Genre Quick Bar ---------- */
.genre-bar-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 28px 0;
}

.genre-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 4px;
  scrollbar-width: none;
}

.genre-bar::-webkit-scrollbar {
  display: none;
}

.genre-bar-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  margin-right: 4px;
}

.genre-pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: all var(--transition);
}

.genre-pill:hover {
  background: var(--bg-hover);
  color: var(--accent-light);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

/* ---------- Main Content Grid Layout ---------- */
.content-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 36px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px;
}

.content-main {
  min-width: 0;
}

/* Tab Bar */
.section-header {
  margin-bottom: 24px;
}

.tab-bar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--accent);
  color: #0A0F0C;
}

/* ---------- Anime Card Component ---------- */
.anime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.anime-card {
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: transform var(--transition);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.anime-card:hover {
  transform: translateY(-5px);
}

.anime-card-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  transition: border-color var(--transition);
}

.anime-card:hover .anime-card-poster {
  border-color: var(--border-hover);
}

.anime-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.anime-card:hover .anime-card-img {
  transform: scale(1.05);
}

/* Play Hover Overlay */
.anime-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 15, 12, 0.45);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition);
}

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

.anime-card-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #0A0F0C;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.9);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Card Badges */
.anime-card-top-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  z-index: 2;
}

.anime-card-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  background: rgba(10, 15, 12, 0.85);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-airing .status-dot {
  background: var(--accent);
}

.status-finished .status-dot {
  background: var(--blue);
}

.status-upcoming .status-dot {
  background: var(--purple);
}

.anime-card-score-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  background: rgba(10, 15, 12, 0.85);
  color: var(--gold);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.anime-card-bottom-badges {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  z-index: 2;
}

.card-format-tag {
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-size: 10px;
  font-weight: 700;
  background: rgba(10, 15, 12, 0.85);
  color: var(--accent);
  border: 1px solid var(--border);
}

.card-ep-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-size: 10px;
  font-weight: 600;
  background: rgba(10, 15, 12, 0.85);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* Card Info */
.anime-card-info {
  padding: 10px 2px 4px;
  min-width: 0;
  overflow: hidden;
}

.anime-card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--transition);
  margin-bottom: 4px;
  word-break: break-word;
  overflow-wrap: break-word;
}

.anime-card:hover .anime-card-title {
  color: var(--accent);
}

.anime-card-genres {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.card-genre {
  font-size: 11px;
  color: var(--text-muted);
}

/* ---------- Sidebar Rankings ---------- */
.content-sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.sidebar-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-title svg {
  color: var(--accent);
}

.sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.sidebar-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  transform: translateX(3px);
}

.sidebar-rank {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: var(--text-muted);
  width: 24px;
  text-align: center;
}

.sidebar-rank.top-rank {
  color: var(--accent);
}

.sidebar-item-poster {
  width: 48px;
  height: 64px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-tertiary);
}

.sidebar-item-info {
  flex: 1;
  min-width: 0;
}

.sidebar-item-info h4 {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.sidebar-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar-tag {
  background: var(--accent-dim);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  font-weight: 700;
}

.sidebar-score {
  color: var(--gold);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* ---------- Anime Detail Page ---------- */
.detail-banner {
  position: relative;
  width: 100%;
  height: 380px;
  overflow: hidden;
}

.detail-banner-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center 25%;
  filter: blur(16px) brightness(0.35);
  transform: scale(1.1);
}

.detail-banner-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(10, 15, 12, 0.3) 0%, var(--bg-primary) 100%);
}

.detail-info-container {
  max-width: var(--max-width);
  margin: -220px auto 0;
  padding: 0 36px;
  position: relative;
  z-index: 5;
}

.detail-header {
  display: flex;
  gap: 36px;
  align-items: flex-start;
}

.detail-poster-wrap {
  flex-shrink: 0;
}

.detail-poster {
  width: 240px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
}

.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-main-info {
  flex: 1;
  padding-top: 36px;
}

.detail-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

/* Next Airing Countdown Banner */
.next-airing-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: var(--radius-full);
  color: var(--accent);
  font-size: 13px;
  margin-bottom: 12px;
}

.next-airing-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse-dot 1.8s infinite;
  flex-shrink: 0;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

.next-airing-text {
  color: var(--text-primary);
}

.next-airing-text strong {
  color: var(--accent);
}

.next-airing-date {
  color: var(--text-muted);
  font-size: 12px;
}

/* Watch Page Next Airing */
.watch-next-airing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 12px;
  margin-top: 8px;
}

.watch-next-airing svg {
  color: var(--accent);
  flex-shrink: 0;
}

.watch-next-airing strong {
  color: var(--accent);
}

.detail-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.detail-title {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 6px;
  color: #FFFFFF;
}

.detail-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Detail Stats Grid */
.detail-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
  max-width: 600px;
}

.detail-stat-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.stat-icon {
  color: var(--accent);
}

.stat-icon.star-icon {
  color: var(--gold);
}

.stat-data {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-value small {
  font-size: 10px;
  color: var(--text-muted);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
}

.detail-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.btn-watch-primary {
  padding: 12px 28px;
  font-size: 15px;
  border-radius: var(--radius-full);
}

.detail-external-link {
  font-size: 13px;
  padding: 10px 18px;
  border-radius: var(--radius-full);
}

.anilist-link:hover {
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--blue);
}

.mal-link:hover {
  border-color: rgba(167, 139, 250, 0.4);
  color: var(--purple);
}

.detail-description-wrap {
  margin-bottom: 20px;
}

.detail-description {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.detail-description.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more-btn {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 8px;
  display: inline-block;
}

.read-more-btn:hover {
  text-decoration: underline;
}

.detail-studio-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.studio-name {
  color: var(--text-primary);
  font-weight: 600;
}

/* Detail Tabs Section */
.detail-tabs {
  max-width: var(--max-width);
  margin: 40px auto 0;
  padding: 0 36px 60px;
}

.detail-tab-bar {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 28px;
  overflow-x: auto;
}

.detail-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
}

.detail-tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.detail-tab-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--border-hover);
}

/* Episodes Grid on Detail Page */
.episodes-tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.episodes-count-badge {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.episodes-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.detail-episodes-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: min(100%, 290px);
  padding: 9px 11px;
  color: var(--text-muted);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.detail-episodes-search:focus-within {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.detail-episodes-search input {
  width: 100%;
  padding: 0;
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  background: transparent;
  border: 0;
  outline: 0;
}

.detail-episodes-search input::placeholder { color: var(--text-muted); }

.episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.episodes-search-empty {
  grid-column: 1 / -1;
  padding: 28px;
  margin: 0;
  color: var(--text-muted);
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.episode-card {
  display: flex;
  gap: 14px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.episode-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.episode-thumb {
  position: relative;
  width: 120px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-tertiary);
}

.episode-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.episode-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--text-muted);
}

.episode-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 15, 12, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  opacity: 0;
  transition: opacity var(--transition);
}

.episode-card:hover .episode-play-overlay {
  opacity: 1;
}

.episode-num-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(10, 15, 12, 0.9);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  color: var(--text-primary);
}

.episode-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.episode-header-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.episode-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}

.episode-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

/* Character Cards Grid */
.characters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.character-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.character-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

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

.character-info h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.character-role {
  font-size: 11px;
  color: var(--text-muted);
}

.character-role.role-main {
  color: var(--accent);
  font-weight: 600;
}

.character-va {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.va-name {
  color: var(--text-secondary);
}

/* ---------- Watch Page Component ---------- */
.watch-page-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 28px 40px;
}

.watch-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.breadcrumb-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.breadcrumb-link:hover {
  color: var(--accent);
}

.breadcrumb-current {
  color: var(--accent);
  font-weight: 600;
}

.watch-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 24px;
}

.watch-main {
  min-width: 0;
}

/* Player Frame */
.player-frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000000;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.player-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 14px;
}

.audio-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.audio-toggle {
  display: inline-flex;
  background: var(--bg-primary);
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.audio-toggle button {
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  transition: all var(--transition);
}

.audio-toggle button.active {
  background: var(--accent);
  color: #0A0F0C;
}

/* Server Switcher */
.server-select-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.server-pill-list {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.server-pill {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-primary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.server-pill:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--accent-light);
}

.server-pill.active {
  background: var(--accent);
  color: #0A0F0C;
  border-color: transparent;
  font-weight: 700;
}

.watch-nav-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-ep-nav {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: var(--radius-full);
}

/* Subtitle Settings Buttons */
.sub-settings-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-primary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}

.sub-settings-trigger-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--accent-light);
  transform: translateY(-1px);
}

.sub-settings-trigger-btn svg {
  color: var(--accent);
}

.player-sub-overlay-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 15;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  background: rgba(10, 15, 12, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.player-wrapper:hover .player-sub-overlay-btn {
  opacity: 0.95;
  pointer-events: auto;
}

.player-sub-overlay-btn:hover {
  opacity: 1;
  background: rgba(18, 32, 23, 0.95);
  border-color: var(--accent);
  color: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.player-sub-overlay-btn svg {
  color: var(--accent);
}

/* Subtitle Settings Modal */
.sub-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 1;
  animation: subModalFadeIn 0.2s ease-out;
}

.sub-modal-overlay.sub-modal-closing {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in;
}

@keyframes subModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.sub-modal-dialog {
  width: 100%;
  max-width: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.65), 0 0 24px rgba(74, 222, 128, 0.1);
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: subModalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes subModalSlideUp {
  from {
    transform: scale(0.95) translateY(16px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.sub-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.sub-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.sub-modal-title svg {
  color: var(--accent);
}

.sub-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.sub-modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Subtitle Live Preview Section */
.sub-preview-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
}

.sub-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.sub-preview-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.sub-scene-switch {
  display: flex;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 2px;
  gap: 2px;
}

.sub-scene-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.sub-scene-btn.active {
  background: var(--accent);
  color: #0A0F0C;
  font-weight: 700;
}

.sub-preview-box {
  position: relative;
  width: 100%;
  height: 120px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 14px 16px;
  overflow: hidden;
  transition: background 0.3s ease;
}

.sub-preview-box.preview-dark {
  background: radial-gradient(circle at 50% 30%, #1c3b2b 0%, #0d1a13 70%, #060a08 100%);
}

.sub-preview-box.preview-light {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 50%, #e2e8f0 100%);
}

.sub-preview-watermark {
  position: absolute;
  top: 8px;
  left: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  opacity: 0.4;
  color: var(--text-muted);
  pointer-events: none;
}

.preview-light .sub-preview-watermark {
  color: #475569;
  opacity: 0.7;
}

.sub-preview-cue {
  display: inline-block;
  text-align: center;
  max-width: 92%;
  line-height: 1.35;
  transition: all 0.15s ease;
}

/* Modal Body */
.sub-modal-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 52vh;
  overflow-y: auto;
}

.sub-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sub-group-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.sub-group-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.sub-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sub-pill {
  padding: 7px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.sub-pill:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--accent-light);
}

.sub-pill.active {
  background: var(--accent);
  color: #0A0F0C;
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(74, 222, 128, 0.25);
}

/* Toggle row */
.sub-toggle-row {
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sub-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.sub-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.sub-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 24px;
  transition: .25s;
}

.sub-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-muted);
  border-radius: 50%;
  transition: .25s;
}

.sub-switch input:checked + .sub-slider {
  background-color: var(--accent);
  border-color: var(--accent);
}

.sub-switch input:checked + .sub-slider:before {
  transform: translateX(20px);
  background-color: #0A0F0C;
}

/* Color swatches */
.sub-color-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.sub-color-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.sub-color-pill:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.sub-color-pill.active {
  border-color: var(--accent);
  background: rgba(74, 222, 128, 0.1);
  color: var(--text-primary);
}

.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.3);
  display: inline-block;
}

/* Modal Footer */
.sub-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  gap: 12px;
}

.sub-reset-btn {
  font-size: 13px;
  padding: 8px 14px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sub-save-btn {
  font-size: 13px;
  padding: 8px 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Player Issue Report Notice */
.player-issue-notice {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(15, 26, 20, 0.85);
  border: 1px solid rgba(166, 227, 161, 0.15);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.issue-notice-icon {
  display: flex;
  align-items: center;
  color: var(--accent);
  flex-shrink: 0;
}

.issue-notice-text {
  flex: 1;
}

.issue-notice-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

.issue-notice-link:hover {
  color: var(--accent-light);
}

/* Watch Relations Section */
.watch-relations-section {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.watch-relations-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 18px;
}

.watch-relations-header svg {
  color: var(--accent);
}

/* Watch Info Card */
.watch-info-card {
  margin-top: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.watch-info-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.watch-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
}

.watch-episode-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.watch-ep-badge {
  background: var(--accent-dim);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
}

.watch-episode-title {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Watch Sidebar Episodes */
.episodes-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  position: sticky;
  top: 84px;
  overflow-y: auto;
}

.episodes-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.sidebar-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
}

.ep-total-pill {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--accent-dim);
  color: var(--accent);
}

.episodes-search-box input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
}

.episodes-search-box input:focus {
  border-color: var(--accent);
}

.account-menu { position: relative; }
.account-trigger { display: flex; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.account-avatar { display: grid; place-items: center; width: 36px; height: 36px; overflow: hidden; border: 1px solid var(--border-hover); border-radius: 50%; color: var(--accent); background: var(--accent-dim); font-size: 14px; font-weight: 800; }
.account-trigger:hover .account-avatar { border-color: var(--accent); }
.account-dropdown { position: absolute; top: calc(100% + 10px); right: 0; display: none; min-width: 195px; width: max-content; padding: 6px; border: 1px solid var(--border-hover); border-radius: var(--radius-md); background: var(--bg-secondary); box-shadow: var(--shadow-lg); }
.account-menu.open .account-dropdown { display: block; }
.account-dropdown-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 13px; font-weight: 600; white-space: nowrap; }
.account-dropdown-item:hover { color: var(--text-primary); background: var(--bg-hover); }
.account-signout { width: 100%; border: 0; text-align: left; background: transparent; cursor: pointer; }
.account-signout:hover:not(:disabled) { color: var(--red); background: rgba(243, 139, 168, 0.1); }
.account-signout:disabled { opacity: 0.55; cursor: wait; }

.is-guest .search-container,
.is-guest .header-nav > .nav-btn {
  display: none;
}

.is-guest .header-inner {
  justify-content: space-between;
}

.episode-range-select {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.episode-range-select select {
  min-width: 100px;
  margin-left: auto;
  padding: 7px 10px;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  cursor: pointer;
}

.episode-range-select select:focus {
  border-color: var(--accent);
  outline: none;
}

.episodes-sidebar-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
}

.ep-sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.ep-sidebar-item:hover {
  background: var(--bg-hover);
}

.ep-sidebar-item.active {
  background: var(--accent-dim);
  border-color: var(--border-hover);
}

.ep-sidebar-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ep-sidebar-num {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  width: 24px;
}

.ep-sidebar-item.active .ep-sidebar-num {
  color: var(--accent);
}

.ep-sidebar-center {
  flex: 1;
  min-width: 0;
}

.ep-sidebar-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.ep-sidebar-item.active .ep-sidebar-title {
  color: var(--text-primary);
  font-weight: 700;
}

/* Equalizer Bars */
.ep-playing-equalizer {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.eq-bar {
  width: 2px;
  background: var(--accent);
  border-radius: 1px;
  animation: eq-bounce 1s ease-in-out infinite;
}

.eq-1 { height: 60%; animation-delay: 0.1s; }
.eq-2 { height: 100%; animation-delay: 0.3s; }
.eq-3 { height: 40%; animation-delay: 0.2s; }

@keyframes eq-bounce {
  0%, 100% { height: 30%; }
  50% { height: 100%; }
}

/* ---------- Schedule Page ---------- */
.schedule-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 28px 60px;
}

.schedule-header {
  margin-bottom: 24px;
}

.search-page-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 6px;
}

.title-icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--border);
}

.schedule-subtitle, .search-page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

.schedule-days-container {
  margin-bottom: 28px;
}

.schedule-days {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.schedule-day-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition);
  min-width: 84px;
  position: relative;
}

.schedule-day-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.schedule-day-btn .day-name {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.schedule-day-btn .day-num {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
}

.today-dot {
  font-size: 9px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  margin-top: 2px;
}

.schedule-day-btn.active {
  background: var(--accent);
  color: #0A0F0C;
  border-color: transparent;
  transform: translateY(-2px);
}

.schedule-day-btn.active .today-dot {
  color: #0A0F0C;
}

.schedule-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.schedule-item {
  display: flex;
  gap: 14px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.schedule-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.schedule-item-poster-wrap {
  position: relative;
  width: 72px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-tertiary);
}

.schedule-item-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.schedule-item-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 15, 12, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  opacity: 0;
  transition: opacity var(--transition);
}

.schedule-item:hover .schedule-item-overlay {
  opacity: 1;
}

.schedule-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.schedule-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.schedule-item-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}

.schedule-ep-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.schedule-item-info h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.schedule-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.schedule-format-tag {
  background: var(--accent-dim);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  font-weight: 700;
}

/* ---------- Search Page ---------- */
.search-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 28px 60px;
}

.search-page-header {
  margin-bottom: 24px;
}

.filter-bar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 32px;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.filter-select {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 40px;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
}

.pagination-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--accent-light);
  transform: translateY(-1px);
}

.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pagination-current-pill {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 13px;
}

/* ---------- Footer ---------- */
#site-footer {
  border-top: 1px solid var(--border);
  background: rgba(15, 26, 20, 0.76);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 36px 28px;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
}

.footer-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 600px;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 6px;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--accent);
  border-color: var(--border-hover);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

/* ---------- Responsive Media Queries ---------- */
@media (max-width: 1100px) {
  .content-layout {
    grid-template-columns: 1fr;
  }
  .content-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .watch-layout {
    grid-template-columns: 1fr;
  }
  .episodes-sidebar {
    height: auto;
    position: static;
    max-height: 440px;
  }
}

/* ===== Account Dropdown User ===== */
.account-dropdown-user {
  display: flex;
  flex-direction: column;
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.account-dropdown-user strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}
.account-dropdown-user span {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== Profile Username Sub ===== */
.profile-username-sub {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: -2px;
}

/* ===== Level Badge ===== */
.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--level-color, #8b8b8b);
  background: color-mix(in srgb, var(--level-color, #8b8b8b) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--level-color, #8b8b8b) 30%, transparent);
  text-transform: uppercase;
  margin-top: 6px;
}

/* ===== Profile Stats Grid ===== */
.public-profile-stats {
  padding: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}
.public-profile-stats h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}
.profile-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
}
.profile-stat-card.profile-progress-card {
  grid-column: 1 / -1;
  align-items: stretch;
}
.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}
.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ===== Glowing User Display Name & Level Gradients ===== */
.user-display-name {
  display: inline-block;
  font-weight: 800;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: all 0.3s ease;
}

/* Level 1: Почетник — Смарагдно-зелени сјај (Emerald Jade & Mint Aurora Glow) */
.user-display-name.level-1 {
  background-image: linear-gradient(135deg, #a7f3d0 0%, #34d399 45%, #059669 100%);
  filter: drop-shadow(0 0 6px rgba(52, 211, 153, 0.35)) drop-shadow(0 0 12px rgba(16, 185, 129, 0.15));
}
.level-badge-large.level-1 {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.15), rgba(16, 185, 129, 0.25));
  border: 1px solid rgba(52, 211, 153, 0.5);
  color: #34d399;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.18);
  text-shadow: 0 0 8px rgba(52, 211, 153, 0.4);
}

/* Level 2: Гледалац — Neon Cyan / Electric Blue Glow */
.user-display-name.level-2 {
  background-image: linear-gradient(135deg, #38bdf8 0%, #00f2fe 50%, #60a5fa 100%);
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.35)) drop-shadow(0 0 12px rgba(56, 189, 248, 0.15));
}
.level-badge-large.level-2 {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(0, 242, 254, 0.25));
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.18);
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

/* Level 3: Отаку — Mystic Violet / Neon Pink Glow */
.user-display-name.level-3 {
  background-image: linear-gradient(135deg, #f472b6 0%, #c084fc 50%, #a855f7 100%);
  filter: drop-shadow(0 0 6px rgba(192, 132, 252, 0.4)) drop-shadow(0 0 14px rgba(217, 70, 239, 0.18));
}
.level-badge-large.level-3 {
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.15), rgba(217, 70, 239, 0.25));
  border: 1px solid rgba(192, 132, 252, 0.5);
  color: #c084fc;
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.18);
  text-shadow: 0 0 8px rgba(192, 132, 252, 0.4);
}

/* Level 4: Ветеран — Fiery Sunset Flame / Crimson Orange Glow */
.user-display-name.level-4 {
  background-image: linear-gradient(135deg, #ff416c 0%, #fb923c 50%, #f97316 100%);
  filter: drop-shadow(0 0 7px rgba(251, 146, 60, 0.4)) drop-shadow(0 0 14px rgba(249, 115, 22, 0.2));
}
.level-badge-large.level-4 {
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.15), rgba(255, 65, 108, 0.25));
  border: 1px solid rgba(251, 146, 60, 0.55);
  color: #fb923c;
  box-shadow: 0 0 12px rgba(251, 146, 60, 0.2);
  text-shadow: 0 0 8px rgba(251, 146, 60, 0.45);
}

/* Level 5: Легенда — Radiant Solar Gold Glow */
.user-display-name.level-5 {
  background-image: linear-gradient(135deg, #fef08a 0%, #facc15 45%, #f59e0b 100%);
  filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.45)) drop-shadow(0 0 16px rgba(245, 158, 11, 0.2));
}
.level-badge-large.level-5 {
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.15), rgba(245, 158, 11, 0.28));
  border: 1px solid rgba(250, 204, 21, 0.6);
  color: #facc15;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.22);
  text-shadow: 0 0 8px rgba(250, 204, 21, 0.45);
}

/* Level 6: Бог Анимеа — Mythic Prismatic Astral Flare */
.user-display-name.level-6 {
  background-image: linear-gradient(135deg, #ff0844 0%, #ff1744 35%, #ff5252 70%, #f43f5e 100%);
  filter: drop-shadow(0 0 8px rgba(255, 23, 68, 0.5)) drop-shadow(0 0 18px rgba(255, 8, 68, 0.25));
  animation: astralPulse 2.8s ease-in-out infinite alternate;
}
.level-badge-large.level-6 {
  background: linear-gradient(135deg, rgba(255, 23, 68, 0.18), rgba(255, 8, 68, 0.3));
  border: 1px solid rgba(255, 23, 68, 0.7);
  color: #ff1744;
  box-shadow: 0 0 16px rgba(255, 23, 68, 0.25);
  text-shadow: 0 0 10px rgba(255, 23, 68, 0.5);
  animation: astralPulse 2.8s ease-in-out infinite alternate;
}

@keyframes astralPulse {
  0% {
    filter: drop-shadow(0 0 8px rgba(255, 23, 68, 0.45)) drop-shadow(0 0 14px rgba(255, 8, 68, 0.2));
  }
  100% {
    filter: drop-shadow(0 0 12px rgba(255, 23, 68, 0.55)) drop-shadow(0 0 20px rgba(255, 8, 68, 0.3));
  }
}

.level-badge-large {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 900;
  line-height: 1.1;
  padding: 8px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 4px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.level-badge-large:hover {
  transform: scale(1.05);
}

/* ===== Level Progress Bar ===== */
.level-progress-bar {
  width: 100%;
  height: 10px;
  background: var(--bg-hover);
  border-radius: 5px;
  overflow: hidden;
  margin: 4px 0;
}
.level-progress-fill {
  height: 100%;
  border-radius: 5px;
  background: var(--level-gradient, var(--accent));
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--level-glow, 0 0 8px color-mix(in srgb, var(--accent) 50%, transparent));
}
.progress-text {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-align: center;
}

/* ===== Onboarding Page ===== */
.onboarding-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px);
  padding: 40px 16px;
}
.onboarding-card {
  width: 100%;
  max-width: 480px;
  padding: 40px 32px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.onboarding-logo {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 16px;
}
.onboarding-logo .logo-prefix {
  color: var(--accent);
}
.onboarding-logo .logo-name {
  color: var(--text-primary);
}
.onboarding-card h1 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
}
.onboarding-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.onboarding-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}
.stepper-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-hover);
  transition: all 0.3s ease;
}
.stepper-dot.active {
  width: 28px;
  border-radius: 5px;
  background: var(--accent);
}
.stepper-dot.done {
  background: var(--accent);
}
.onboarding-steps {
  position: relative;
  overflow: hidden;
}
.onboarding-step {
  display: none;
  text-align: left;
  animation: fadeSlideIn 0.3s ease;
}
.onboarding-step.active {
  display: block;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
.onboarding-step h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}
.onboarding-step p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.onboarding-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.onboarding-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.onboarding-counter {
  display: block;
  text-align: right;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  margin-bottom: 16px;
}
.onboarding-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}
.onboarding-avatar-preview {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 2px solid var(--border-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  color: var(--text-muted);
  margin: 0 auto 16px;
  overflow: hidden;
}
.onboarding-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =======================================================
   MOBILE RESPONSIVE STYLES (Screen width <= 768px)
   DESKTOP STYLES (> 768px) REMAIN 100% UNTOUCHED!
======================================================= */

/* Base: Mobile Bottom Navigation is hidden on Desktop */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  /* Prevent ANY horizontal overflow on mobile */
  html, body, #app {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  /* Page layout padding for mobile header and bottom nav */
  #page-content {
    padding-top: 56px;
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
  }

  /* Fixed Top Header on Mobile */
  #site-header {
    height: 56px;
    padding: 0 12px;
  }

  .header-inner {
    gap: 8px;
    justify-content: space-between;
  }

  .logo-badge {
    font-size: 18px;
    letter-spacing: -0.3px;
  }

  /* Search input fits neatly on mobile header */
  .search-container {
    flex: 1;
    max-width: none;
    margin: 0 4px;
    min-width: 0;
  }

  .search-input-wrap {
    height: 36px;
    padding: 0 10px;
    border-radius: 18px;
  }

  .search-icon {
    margin-right: 6px;
    width: 15px;
    height: 15px;
  }

  .search-input {
    font-size: 13px;
  }

  /* Hide physical desktop keyboard shortcut on mobile phones */
  .search-kbd {
    display: none !important;
  }

  /* Hide desktop text nav items from top bar (moved to mobile bottom bar) */
  .header-nav > .nav-btn {
    display: none !important;
  }

  /* Keep account trigger avatar always visible in top bar */
  .header-nav {
    gap: 0;
    flex-shrink: 0;
  }

  .account-avatar {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }

  .account-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 200px;
    width: max-content;
    max-width: calc(100vw - 24px);
  }

  /* Search Suggestions on mobile */
  .search-suggestions {
    position: fixed;
    left: 10px;
    right: 10px;
    top: 58px;
    max-height: 65vh;
    width: auto;
  }

  /* Fixed Mobile Bottom Navigation Bar */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 58px;
    background: rgba(10, 15, 12, 0.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--border);
    z-index: 1000;
    align-items: center;
    justify-content: space-around;
    padding: 0 4px calc(env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    height: 100%;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    background: transparent;
    border: none;
    padding: 4px 0;
    cursor: pointer;
    transition: color 0.2s ease;
  }

  .mobile-nav-item:hover,
  .mobile-nav-item.active {
    color: var(--accent);
  }

  .mobile-nav-item svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
  }

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

  .mobile-nav-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    color: var(--accent);
    display: grid;
    place-items: center;
    font-size: 10px;
    font-weight: 800;
  }

  /* Hero Section on Mobile */
  .hero-section {
    height: clamp(380px, 58vh, 440px) !important;
    min-height: 380px !important;
    width: 100% !important;
    max-width: 100vw !important;
    position: relative !important;
    touch-action: pan-y !important;
  }

  .hero-bg {
    background-position: center 20% !important;
  }

  .hero-gradient-overlay {
    background: linear-gradient(
      180deg,
      rgba(10, 15, 12, 0.25) 0%,
      rgba(10, 15, 12, 0.45) 30%,
      rgba(10, 15, 12, 0.84) 65%,
      var(--bg-primary) 100%
    ) !important;
  }

  .hero-footer-bar {
    display: flex !important;
    position: absolute !important;
    top: 14px !important;
    right: 14px !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 10 !important;
    gap: 8px !important;
    align-items: center !important;
  }

  .hero-slide-dots {
    display: none !important;
  }

  .hero-nav {
    display: flex !important;
    align-items: center !important;
    gap: 2px !important;
    padding: 3px 6px !important;
    background: rgba(10, 15, 12, 0.8) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(166, 227, 161, 0.18) !important;
    border-radius: var(--radius-full) !important;
  }

  .hero-nav button {
    width: 28px !important;
    height: 28px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .hero-nav button svg {
    width: 14px !important;
    height: 14px !important;
  }

  .hero-counter {
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 0 4px !important;
    color: var(--text-secondary) !important;
  }

  .hero-content {
    padding: 0 14px 18px !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .hero-spotlight-badge {
    padding: 3px 9px !important;
    font-size: 11px !important;
    margin-bottom: 8px !important;
    max-width: calc(100% - 90px) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .hero-title {
    font-size: 21px !important;
    line-height: 1.25 !important;
    margin-bottom: 8px !important;
    -webkit-line-clamp: 2 !important;
    font-weight: 800 !important;
  }

  .hero-meta {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 5px !important;
    margin-bottom: 6px !important;
    font-size: 11.5px !important;
  }

  .hero-meta .badge {
    font-size: 11px !important;
    padding: 2px 7px !important;
    border-radius: var(--radius-xs) !important;
  }

  .hero-genres {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    margin-bottom: 12px !important;
  }

  .hero-genres .badge-accent {
    font-size: 11px !important;
    padding: 2px 7px !important;
  }

  /* Hide description on mobile hero so action buttons & title are prominent */
  .hero-desc {
    display: none !important;
  }

  .hero-actions {
    display: flex !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .hero-actions .btn {
    flex: 1 !important;
    min-width: 0 !important;
    padding: 10px 14px !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    border-radius: var(--radius-full) !important;
    justify-content: center !important;
    letter-spacing: 0.2px !important;
  }

  /* Genre Quick Bar */
  .genre-bar-container {
    padding: 14px 12px 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .genre-bar {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 6px !important;
    padding: 4px 2px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }

  .genre-bar::-webkit-scrollbar {
    display: none !important;
  }

  .genre-bar-label {
    flex-shrink: 0 !important;
    font-size: 12px !important;
    margin-right: 2px !important;
  }

  .genre-pill {
    flex-shrink: 0 !important;
    padding: 5px 12px !important;
    font-size: 12px !important;
  }

  /* Content Layout & Tabs */
  .content-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    padding: 12px 10px !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  .content-main {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .content-sidebar {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    box-sizing: border-box !important;
  }

  .section-header {
    margin-bottom: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .tab-bar {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 4px !important;
    padding: 3px !important;
    background: var(--bg-secondary) !important;
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border) !important;
    box-sizing: border-box !important;
  }

  .tab-bar::-webkit-scrollbar {
    display: none !important;
  }

  .tab-btn {
    white-space: nowrap !important;
    flex: 0 0 auto !important;
    padding: 6px 10px !important;
    font-size: 11.5px !important;
    gap: 5px !important;
    justify-content: center !important;
    text-align: center !important;
    border-radius: var(--radius-sm) !important;
  }

  .tab-btn svg {
    width: 13px !important;
    height: 13px !important;
    flex-shrink: 0 !important;
  }

  #anime-grid-container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* 2-Column Compact Anime Cards Grid on Mobile */
  .anime-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .anime-card {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .anime-card:hover {
    transform: none !important;
  }

  .anime-card:active {
    transform: scale(0.98) !important;
  }

  .anime-card-poster {
    width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: 2 / 3 !important;
    border-radius: var(--radius-sm) !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .anime-card-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  /* Badges positioning and sizing on mobile */
  .anime-card-top-badges {
    top: 4px !important;
    left: 4px !important;
    right: 4px !important;
    gap: 3px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .anime-card-status-pill {
    padding: 2px 5px !important;
    font-size: 8.5px !important;
    gap: 3px !important;
    max-width: 65% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .anime-card-status-pill .status-dot {
    width: 4px !important;
    height: 4px !important;
    flex-shrink: 0 !important;
  }

  .anime-card-score-pill {
    padding: 2px 5px !important;
    font-size: 9px !important;
    gap: 2px !important;
    flex-shrink: 0 !important;
  }

  .anime-card-score-pill svg {
    width: 9px !important;
    height: 9px !important;
  }

  .anime-card-bottom-badges {
    bottom: 4px !important;
    left: 4px !important;
    right: 4px !important;
    gap: 3px !important;
    display: flex !important;
    align-items: center !important;
  }

  .card-format-tag,
  .card-ep-tag {
    padding: 1px 4px !important;
    font-size: 8.5px !important;
    gap: 2px !important;
  }

  .card-ep-tag svg {
    width: 9px !important;
    height: 9px !important;
  }

  .anime-card-info {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 5px 2px 2px !important;
    overflow: hidden !important;
  }

  .anime-card-title {
    font-size: 11.5px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    margin-bottom: 2px !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }

  .anime-card-genres {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 3px !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .card-genre {
    font-size: 9.5px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
  }

  @media (min-width: 481px) and (max-width: 768px) {
    .anime-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
      gap: 10px !important;
    }
  }

  /* Sidebar Rankings on Mobile */
  .sidebar-section {
    padding: 14px 12px !important;
    border-radius: var(--radius-md) !important;
    background: var(--bg-card) !important;
  }

  .sidebar-title {
    font-size: 15px !important;
    font-weight: 700 !important;
    margin-bottom: 12px !important;
    padding-bottom: 8px !important;
  }

  .sidebar-title svg {
    width: 16px !important;
    height: 16px !important;
  }

  .sidebar-list {
    gap: 8px !important;
  }

  .sidebar-item {
    gap: 10px !important;
    padding: 6px 8px !important;
    border-radius: var(--radius-sm) !important;
  }

  .sidebar-item:hover {
    transform: none !important;
  }

  .sidebar-item:active {
    background: var(--bg-hover) !important;
  }

  .sidebar-rank {
    font-size: 14px !important;
    width: 20px !important;
  }

  .sidebar-item-poster {
    width: 44px !important;
    height: 60px !important;
    border-radius: var(--radius-xs) !important;
  }

  .sidebar-item-info h4 {
    font-size: 13px !important;
    line-height: 1.3 !important;
    margin-bottom: 3px !important;
  }

  .sidebar-item-meta {
    font-size: 11px !important;
    gap: 5px !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
  }

  .sidebar-tag {
    font-size: 9.5px !important;
    padding: 1px 5px !important;
  }

  .sidebar-score {
    font-size: 10.5px !important;
  }

  @media (max-width: 400px) {
    .hero-section {
      height: 380px !important;
      min-height: 380px !important;
    }

    .hero-title {
      font-size: 18px !important;
    }

    .hero-actions .btn {
      padding: 9px 10px !important;
      font-size: 12.5px !important;
    }

    .anime-grid {
      gap: 6px !important;
    }

    .tab-btn {
      padding: 5px 8px !important;
      font-size: 10.5px !important;
      gap: 3px !important;
    }
  }

  /* Anime Detail Page on Mobile */
  .detail-hero-banner {
    height: 220px;
  }

  .detail-info-container {
    margin: -110px auto 0 !important;
    padding: 0 14px !important;
  }

  .detail-header {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 16px !important;
  }

  .detail-poster {
    width: 150px !important;
    margin: 0 auto !important;
  }

  .detail-main-info {
    padding-top: 0 !important;
    width: 100% !important;
  }

  .detail-title {
    font-size: 22px !important;
    text-align: center !important;
  }

  .detail-subtitle {
    text-align: center !important;
    font-size: 13px !important;
  }

  .detail-badge-row,
  .detail-genres {
    justify-content: center !important;
  }

  .detail-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    max-width: 100% !important;
    gap: 8px !important;
  }

  .detail-stat-card {
    padding: 8px 10px;
  }

  .detail-actions {
    justify-content: center !important;
    width: 100% !important;
    flex-wrap: wrap;
  }

  .detail-actions .btn {
    flex: 1;
    min-width: 120px;
  }

  .detail-layout {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .episodes-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* Watch Page on Mobile */
  .watch-page-container {
    padding: 10px 12px 30px !important;
  }

  .watch-layout {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .player-controls-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 12px !important;
  }

  .audio-toggle-wrap,
  .server-select-wrap {
    width: 100% !important;
    justify-content: space-between !important;
  }

  .episodes-sidebar {
    width: 100% !important;
    max-height: 400px !important;
  }

  .player-issue-notice {
    padding: 9px 12px !important;
    font-size: 12px !important;
    gap: 8px !important;
    margin-top: 10px !important;
  }

  .watch-relations-section {
    margin-top: 24px !important;
    padding-top: 18px !important;
  }

  .watch-relations-header {
    font-size: 17px !important;
    margin-bottom: 14px !important;
  }

  .next-airing-banner {
    width: 100% !important;
    padding: 7px 12px !important;
    font-size: 12px !important;
    border-radius: var(--radius-sm) !important;
    margin-bottom: 12px !important;
    justify-content: center !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }

  .watch-next-airing {
    font-size: 11.5px !important;
    padding: 4px 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Schedule Page on Mobile */
  .schedule-page {
    padding: 16px 12px !important;
  }

  .schedule-days {
    gap: 6px !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .schedule-day-btn {
    padding: 8px 12px !important;
    font-size: 12px !important;
    min-width: 56px !important;
  }

  /* Search Page on Mobile */
  .search-page {
    padding: 16px 12px 40px !important;
  }

  .search-page-title {
    font-size: 20px !important;
  }

  .filter-bar {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  /* Profiles, Settings, Admin on Mobile */
  .profile-page,
  .history-page {
    width: 100% !important;
    max-width: 100vw !important;
    padding: 0 12px !important;
    box-sizing: border-box !important;
  }

  .admin-page {
    width: 100% !important;
    max-width: 100vw !important;
    padding: 14px 12px 70px !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .profile-banner {
    height: 130px !important;
  }

  .profile-identity {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    margin-top: -45px !important;
    gap: 10px !important;
  }

  .profile-avatar {
    width: 84px !important;
    height: 84px !important;
    font-size: 30px !important;
  }

  .profile-settings-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .profile-upload-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .profile-stats-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .admin-stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .admin-tabs {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
  }

  .admin-tab-btn {
    white-space: nowrap !important;
    flex-shrink: 0;
    padding: 7px 12px !important;
    font-size: 12px !important;
  }

  .admin-user-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  .admin-user-actions {
    width: 100% !important;
    justify-content: flex-end !important;
  }

  .history-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .history-card {
    grid-template-columns: 90px 1fr !important;
    min-height: 120px !important;
  }

  .footer-inner {
    padding: 20px 16px calc(76px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* ========= Admin Panel Mobile ========= */
  .admin-heading {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  .admin-heading h1 {
    font-size: 22px !important;
  }

  .admin-tabs-nav {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px !important;
    padding-bottom: 10px !important;
  }

  .admin-tabs-nav::-webkit-scrollbar {
    display: none;
  }

  .admin-tab-btn {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    padding: 8px 14px !important;
    font-size: 13px !important;
    gap: 6px !important;
  }

  .admin-stats {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .admin-stat {
    padding: 12px !important;
    min-width: 0 !important;
  }

  .admin-panel {
    padding: 12px !important;
  }

  .admin-controls {
    flex-direction: column !important;
    gap: 8px !important;
  }

  .admin-controls input {
    width: 100% !important;
  }

  .admin-user-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    padding: 10px !important;
  }

  .admin-user-identity {
    width: 100% !important;
    min-width: 0 !important;
  }

  .admin-user-identity strong {
    max-width: 200px !important;
    font-size: 13px !important;
  }

  .admin-user-actions {
    width: 100% !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .admin-action-btn {
    width: 34px !important;
    height: 34px !important;
  }

  .admin-role-action {
    min-width: auto !important;
    padding: 6px 10px !important;
    font-size: 11px !important;
  }

  /* Admin GIF Gallery */
  .admin-gif-gallery {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .admin-appearance-heading h2 {
    font-size: 15px !important;
  }

  .admin-appearance-heading p {
    font-size: 12px !important;
  }

  .admin-appearance-controls {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .admin-appearance-controls input {
    width: 100% !important;
  }

  /* Admin System / Memory Card */
  .admin-system-card {
    padding: 14px !important;
  }

  .admin-system-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  .admin-system-header h2 {
    font-size: 15px !important;
  }

  /* Login/Auth pages on mobile */
  .auth-page {
    padding: 16px !important;
  }

  .auth-card {
    padding: 20px !important;
    max-width: 100% !important;
  }

  /* Onboarding on mobile */
  .onboarding-card {
    padding: 24px 16px !important;
    max-width: 100% !important;
  }

  .onboarding-avatar-preview {
    width: 80px !important;
    height: 80px !important;
    font-size: 28px !important;
  }

  /* Ban screen on mobile */
  .banned-overlay {
    padding: 20px !important;
  }

  .banned-overlay h1 {
    font-size: 28px !important;
  }

  .banned-overlay p {
    font-size: 16px !important;
  }

  /* Characters grid on mobile */
  .characters-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .character-card {
    padding: 10px !important;
    gap: 10px !important;
  }

  /* Detail tab bar scrollable on mobile */
  .detail-tab-bar {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 4px !important;
  }

  .detail-tab-bar::-webkit-scrollbar {
    display: none;
  }

  .detail-tab-btn {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    padding: 8px 14px !important;
    font-size: 12px !important;
  }

  /* Subtitle modal on mobile */
  .sub-modal-dialog {
    max-height: 90vh;
  }

  .sub-modal-body {
    max-height: 48vh !important;
    padding: 14px 16px !important;
    gap: 12px !important;
  }

  .sub-pill {
    padding: 6px 11px !important;
    font-size: 11px !important;
  }
}
