/* ==========================================================================
   MangaLite â€” Ruby Crimson UI v5.0 PREMIUM EDITION
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&family=Inter:wght@400;600;700;800&display=swap');

/* --- 1. CORE RESET & BASE --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
    width: 100%;
}

:root {
  /* --- Core Site Tokens --- */
  --bg: #08080a;
  --surface: #0f0f13;
  --surface-light: #16161c;
  --surface-hover: #1e1e26;
  --surface-card: #121217;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --primary: #e61c31;
  --primary-hover: #ff2a40;
  --primary-glow: rgba(230, 28, 49, 0.25);
  --primary-soft: rgba(230, 28, 49, 0.08);
  --primary-gradient: linear-gradient(135deg, #e61c31, #ff4757);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --text: #eeeef5;
  --text-muted: #8a8a98;
  --text-dim: #4e4e5a;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --header-h: 64px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s ease;
  
  /* --- Layout & Glass --- */
  --tr-h: 70px;
  --br-h: 56px;
  --header-glass: blur(25px) saturate(180%);
  --header-bg: rgba(10, 10, 14, 0.85);
  --header-border: rgba(255, 255, 255, 0.08);
  --glass-blur: blur(25px) saturate(180%);
  --glass-bg: rgba(10, 10, 14, 0.82);
  --glass-border: 1px solid rgba(255, 255, 255, 0.08);
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Tajawal', 'Inter', sans-serif;
    margin: 0;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* --- 2. GLOBAL COMPONENTS --- */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-glow);
    filter: brightness(1.1);
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
}


/* â”€â”€ Manga Master Diamond UI Components â”€â”€ */
.mm-rainbow-text {
  background: var(--grad-royal);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: mm-rainbow-flow 3s linear infinite;
  font-weight: 900;
}

@keyframes mm-fire-pulse {
  0%, 100% { box-shadow: 0 0 10px var(--mm-fire); }
  50% { box-shadow: 0 0 25px var(--mm-fire); }
}

@keyframes mm-rainbow-flow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes mm-sapphire-twinkle {
  0%, 100% { filter: brightness(1) drop-shadow(0 0 5px var(--mm-sap-glow)); }
  50% { filter: brightness(1.5) drop-shadow(0 0 15px var(--mm-sap)); }
}


/* --- 3. SOCIAL & HUB (Diamond Edition) --- */
.reactions-bar {
    margin: 40px auto;
    padding: 24px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(15px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    text-align: center;
    animation: mm-fade-in-up 0.8s ease;
}

.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 22px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text);
    margin: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.reaction-btn:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.reaction-btn.active {
    background: var(--primary-soft);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* --- 4. COMMENTS V4 RADICAL --- */
.comments-v4-container {
    margin-top: 50px;
    padding: 30px;
    background: rgba(10, 10, 15, 0.4);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
}

.comment-input-area textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 15px;
    color: #fff;
    min-height: 120px;
    transition: var(--transition);
}

.comment-input-area textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

/* --- 5. GLOBAL CARDS --- */
.manga-card {
    position: relative;
    background: var(--surface-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--transition);
}

.manga-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);
}

@keyframes mm-fade-in-up {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 6. RADICAL LAYOUT --- */
.main-wrapper {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  margin-top: 28px;
  padding-bottom: 60px;
}

/* ====================== RADICAL MANGA MASTER HEADER v7.0 ====================== */

.mm-header-radical {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100vw;
  max-width: 100%;
  z-index: 4000;
  background: var(--header-bg);
  backdrop-filter: var(--header-glass);
  -webkit-backdrop-filter: var(--header-glass);
  border-bottom: 1px solid var(--header-border);
  font-family: 'Inter', 'Tajawal', sans-serif;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex !important;
  flex-direction: column !important;
}

.mm-header-radical.mm-hidden {
  transform: translateY(-100%);
}

.mm-top-row {
  width: 100% !important;
  display: block !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mm-row-flex {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  height: var(--tr-h);
  width: 100% !important;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
}

.mm-nav-container {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  height: var(--br-h);
}

/* 1. Branding Slot */
.mm-brand {
  display: flex !important;
  align-items: center;
  gap: 15px;
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mm-brand:hover {
  transform: scale(1.02);
}

.mm-logo-container {
  width: auto;
  height: 45px;
  max-height: 45px;
  background: var(--grad-metal);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  flex-shrink: 0;
}

.mm-logo-container img {
  height: 100%;
  width: auto;
  max-height: 45px;
  object-fit: contain;
  padding: 4px;
}

.mm-logo-placeholder {
  font-size: 1.5em;
  color: var(--mm-accent);
  text-shadow: 0 0 10px var(--mm-accent-glow);
  width: 45px;
}

/* branding & search suite */
.header-brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.header-brand-container:hover {
  transform: scale(1.02);
}
.header-logo {
  height: 55px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(230, 28, 49, 0.4));
}
.header-title, .mm-brand-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
}

.mm-brand-search-group {
    display: flex;
    align-items: center;
    gap: 30px;
}

@media (max-width: 991px) {
    .mm-brand-search-group { gap: 15px; }
}

@media (max-width: 768px) {
    .mm-brand-search-group { gap: 10px; }
    .header-logo { height: 40px; }
    .header-title, .mm-brand-name { font-size: 1.1rem; }
}


/* 2. Integrated Search Bar (v7.2 Attractive) */
.mm-search-v7 {
  flex: 1;
  max-width: 450px;
  margin: 0 15px;
}

.mm-search-inner {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 5px 15px;
  transition: all 0.3s ease;
}

.mm-search-inner:focus-within {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--mm-accent);
  box-shadow: 0 0 15px var(--mm-accent-glow);
  transform: translateY(-1px);
}

.mm-search-inner input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  padding: 8px 0;
  font-size: 0.9em;
  font-weight: 600;
  outline: none;
}

.mm-search-inner input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.mm-search-btn {
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s;
}

.mm-search-btn:hover {
  color: var(--primary);
  transform: scale(1.1);
}

/* fallback placeholders */
.mm-logo-placeholder {
  background: var(--primary-gradient);
  color: #fff;
  font-size: 1.25em;
  width: 42px;
  /* Square placeholder for icon */
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(230, 28, 49, 0.3);
}

.mm-avatar-fallback {
  background: linear-gradient(135deg, #1e1e26, #0f0f13);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.mm-avatar-initials {
  font-size: 1em;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.mm-member-suite {
  display: flex;
  align-items: center;
  gap: 15px;
}

@media (max-width: 768px) {
    .mm-member-suite { gap: 8px; }
    .mm-icon-btn span { display: none; }
    .mm-icon-btn.admin-glow-btn { padding: 8px !important; border-radius: 50% !important; }
}

.mm-member-card {
  display: flex !important;
  align-items: center !important;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 6px 15px;
  border-radius: 14px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mm-member-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.mm-card-avatar {
  width: 54px;
  height: 54px;
  position: relative;
  border-radius: 50%;
  padding: 4px;
  background: var(--grad-metal);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Complex Frame: Fire Top, Sapphire Bottom */
.mm-card-avatar::before,
.mm-card-avatar::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  z-index: -1;
}

.mm-card-avatar::before {
  background: var(--grad-fire);
  clip-path: polygon(0 0, 100% 0, 100% 50%, 0 50%);
  animation: mm-fire-pulse 2s infinite;
}

.mm-card-avatar::after {
  background: var(--grad-sap);
  clip-path: polygon(0 50%, 100% 50%, 100% 100%, 0 100%);
  border-bottom: 3px solid #60a5fa;
  /* Blue Diamonds effect */
  animation: mm-sapphire-twinkle 3s infinite;
}

.mm-card-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #000;
}

/* Resource Wallet */
.mm-wallet {
  display: flex;
  gap: 15px;
  background: var(--grad-metal);
  padding: 8px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5);
}

.mm-wallet-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 0.95em;
}

.mm-wallet-item i {
  font-size: 1.1em;
}

.mm-wallet-sep {
  width: 1px;
  height: 25px;
  background: rgba(255, 255, 255, 0.1);
}

.item-points {
  color: var(--mm-accent);
  text-shadow: 0 0 10px var(--mm-accent-glow);
}

.item-mana {
  color: var(--mm-sap);
  text-shadow: 0 0 10px var(--mm-sap-glow);
}

/* Advanced Search */
.mm-search-v7 {
  position: relative;
  width: 320px;
}

.mm-search-inner {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--header-border);
  border-radius: 30px;
  padding: 2px 5px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mm-search-inner:focus-within {
  border-color: var(--mm-accent);
  box-shadow: 0 0 20px var(--mm-accent-glow);
  background: #000;
}

.mm-search-inner input {
  flex: 1;
  background: transparent;
  padding: 10px 15px;
  color: #fff;
  font-size: 0.9em;
  font-weight: 600;
}

.mm-search-filter {
  padding: 8px 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  font-size: 0.75em;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  transition: 0.3s;
  white-space: nowrap;
}

.mm-search-filter:hover {
  background: var(--mm-accent);
  color: #fff;
}

.mm-card-avatar.has-frame {
  padding: 8px;
  /* Room for the frame background-image */
}

.mm-card-avatar.has-frame img {
  border-radius: 50%;
}

.mm-status-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #000;
}

.mm-status-dot.online {
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

.mm-card-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mm-card-name {
  font-weight: 800;
  font-size: 0.95em;
  color: #fff;
  white-space: nowrap;
  line-height: 1.2;
}

.mm-card-lv {
  font-size: 0.75em;
  font-weight: 900;
  color: var(--mm-accent);
  background: rgba(230, 28, 49, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 5px;
}

.mm-card-title {
  font-size: 0.72em;
  font-weight: 700;
  margin-top: 2px;
  letter-spacing: 0.5px;
}

.mm-card-stats {
  display: flex;
  gap: 10px;
  margin-top: 2px;
}

.mm-card-stats span {
  font-size: 0.72em;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-p {
  color: var(--mm-gold);
}

.stat-m {
  color: var(--mm-mana);
}

.mm-quick-admin {
  width: 42px;
  height: 42px;
  background: var(--primary-soft);
  border: 1px solid var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.1em;
  transition: all 0.3s ease;
}

.mm-quick-admin:hover {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-glow);
  transform: rotate(90deg);
}

/* Auth Buttons */
.mm-guest-actions {
  display: flex;
  gap: 10px;
}

.mm-btn-ghost {
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 800;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mm-btn-neon {
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 800;
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

/* ROW 2: NAV & SEARCH */
/* Mobile Nav Mobile View */
@media (max-width: 768px) {
  .mm-bottom-nav {
    display: none !important;
    /* Force hide by default */
  }

  .mm-bottom-nav.mm-active {
    display: block !important;
    position: fixed;
    top: var(--tr-h);
    left: 0;
    right: 0;
    height: auto;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-bottom: 2px solid var(--mm-accent);
    padding: 20px 0;
    z-index: 3000;
  }
}

.mm-main-menu {
  display: flex;
  gap: 20px;
}

.mm-main-menu li a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #999;
  font-weight: 700;
  font-size: 0.9em;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.mm-main-menu li a i {
  font-size: 1.1em;
  opacity: 0.7;
}

.mm-main-menu li a:hover,
.mm-main-menu li a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.mm-main-menu li a.active i {
  color: var(--mm-accent);
  text-shadow: 0 0 10px var(--mm-accent);
  opacity: 1;
}

.mm-menu-special {
  color: var(--mm-gold) !important;
  background: rgba(252, 207, 49, 0.08) !important;
}

.mm-menu-special:hover {
  background: var(--mm-gold) !important;
  color: #000 !important;
}

/* Minimal Search */
.mm-search-minimal {
  width: 280px;
}

.mm-search-minimal form {
  position: relative;
  display: flex;
  align-items: center;
}

.mm-search-minimal i {
  position: absolute;
  right: 15px;
  color: #555;
  font-size: 0.9em;
  pointer-events: none;
}

.mm-search-minimal input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 8px 40px 8px 15px;
  border-radius: 20px;
  color: #fff;
  font-size: 0.85em;
  font-weight: 500;
  transition: all 0.3s ease;
}

.mm-search-minimal input:focus {
  background: #000;
  border-color: var(--mm-accent);
  box-shadow: 0 0 15px rgba(230, 28, 49, 0.15);
}

/* MOBILE TOGGLE */
.mm-mobile-toggle {
  display: none;
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--header-border);
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.mm-burger {
  width: 18px;
  height: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mm-burger span {
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: block;
}

.mm-mobile-toggle.mm-active .mm-burger span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.mm-mobile-toggle.mm-active .mm-burger span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mm-mobile-toggle.mm-active .mm-burger span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* Floating Context Bar (Chapter Info) */
.mm-context-float {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: linear-gradient(to bottom, var(--header-bg), #000);
  border-bottom: 2px solid var(--mm-accent);
  padding: 8px 0;
}

.mm-float-flex {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
}

.mm-float-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.back-link {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary-soft);
  border: 1px solid var(--primary);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.manga-title {
  font-weight: 900;
  font-size: 1.1em;
  color: #fff;
}

.ch-num {
  color: var(--mm-gold);
  margin-right: 5px;
}

.mm-float-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #222;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s;
}

.nav-btn:hover {
  background: var(--mm-accent);
  transform: scale(1.1);
}

.ch-current {
  font-weight: 800;
  font-size: 0.9em;
  padding: 5px 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
}

/* --- LEVEL 2: MEGA MENU v7.0 --- */
.mm-has-mega {
  position: static;
}

.mm-mega-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  width: 90%;
  max-width: 1100px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-top: 2px solid var(--mm-accent);
  border-radius: 0 0 24px 24px;
  padding: 30px;
  visibility: hidden;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  z-index: 3500;
}

.mm-has-mega:hover .mm-mega-menu {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.mm-mega-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.mm-mega-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  background: #1a1a24;
  border-radius: 8px;
  padding: 12px 15px;
  border: 1px solid #2a2a35;
  transition: all 0.3s ease;
  text-decoration: none;
}


.mm-mega-item:hover {
  background: #23232e;
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 0 15px var(--primary-glow);
}


.mm-mega-item span {
  font-weight: 800;
  font-size: 0.95em;
  text-align: center;
  color: #fff;
  letter-spacing: 0.5px;
}

/* --- LEVEL 3: CONTEXT BAR v7.0 --- */
.mm-context-v7 {
  background: linear-gradient(to bottom, #000, #08080a);
  border-bottom: 2px solid var(--mm-accent);
  padding: 12px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.mm-logo-v7 {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 1.3em;
  letter-spacing: 2px;
  color: #fff;
}

.mm-logo-v7 .gold {
  color: var(--mm-gold);
  text-shadow: 0 0 10px var(--mm-gold-glow);
}

.back-link-v7 {
  width: 42px;
  height: 42px;
  background: rgba(230, 28, 49, 0.1);
  border: 1px solid var(--mm-accent);
  border-radius: 10px;
  color: var(--mm-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.3s;
}

.back-link-v7:hover {
  background: var(--mm-accent);
  color: #fff;
  box-shadow: 0 0 15px var(--mm-accent-glow);
}

.manga-title-v7 {
  font-weight: 900;
  font-size: 1.1em;
  color: #fff;
}

.manga-title-v7 .ch-num {
  color: var(--mm-accent);
}

.nav-btn-v7 {
  width: 44px;
  height: 44px;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s;
}

.nav-btn-v7:hover {
  background: var(--grad-fire);
  border-color: var(--mm-fire);
  box-shadow: 0 0 20px var(--mm-accent-glow);
  transform: scale(1.1);
}

/* Chapter Dropdown */
.ch-select-v7 {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 25px;
  border-radius: 30px;
  font-weight: 800;
  font-size: 0.9em;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: 0.3s;
}

.ch-select-v7:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--mm-gold);
}

.ch-dropdown-v7 {
  position: absolute;
  bottom: 120%;
  right: 0;
  width: 250px;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 10px;
  list-style: none;
  visibility: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: 0.3s;
  z-index: 4000;
}

.ch-select-v7:hover .ch-dropdown-v7 {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.ch-dropdown-v7 li {
  padding: 12px 15px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: 0.2s;
}

.ch-dropdown-v7 li:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--mm-gold);
}

.ch-dropdown-v7 li.active {
  background: rgba(252, 207, 49, 0.1);
  color: var(--mm-gold);
}

.gold {
  color: var(--mm-gold);
}

@keyframes mmSlideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 991px) {
  .mm-search-v7 {
    display: none; /* Hide complex search on tablets/phones to save space */
  }
  .header-brand-container {
      gap: 8px;
  }
}

@media (max-width: 768px) {
  .mm-brand-name {
    display: block; /* Keep brand name but smaller */
    font-size: 1rem;
  }
  
  .header-logo {
      height: 38px;
  }

  .mm-logo-container {
    height: 40px;
    max-height: 40px;
  }

  .mm-logo-container img {
    max-height: 40px;
  }

  .mm-mobile-toggle {
    display: flex !important;
  }

  /* Mobile Nav Mobile View */
  .mm-bottom-nav {
    position: fixed;
    top: var(--tr-h);
    left: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: rgba(10, 10, 14, 0.98); /* More opaque for readability */
    backdrop-filter: blur(15px);
    transform: translateX(100%); /* Slide from right for RTL feel */
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 1px solid var(--mm-accent);
    padding: 20px;
    z-index: 5000;
    overflow-y: auto;
  }

  .mm-bottom-nav.mm-active {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
  }

  .mm-nav-container {
    flex-direction: column;
    height: auto;
    align-items: flex-start;
  }

  .mm-main-menu {
    flex-direction: column;
    width: 100%;
    gap: 2px;
  }

  .mm-main-menu li {
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,0.03);
  }

  .mm-main-menu li a {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 10px;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .mm-card-info {
    display: none;
  }
}

/* ====================== BUTTONS ====================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.88em;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  border: none;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  border: none
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  color: #fff
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted)
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft)
}

.btn-outline.active {
  background: var(--primary-gradient);
  border-color: var(--primary);
  color: #fff
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.8em
}

.btn-block {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--primary-gradient);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  transition: var(--transition);
  border: none;
  cursor: pointer
}

.btn-block:hover {
  box-shadow: var(--shadow-glow);
  color: #fff;
  transform: translateY(-1px)
}

.btn-danger:hover {
  background: #b91c1c;
  color: #fff
}

/* Explore Button (Phase 21) */
.btn-explore {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.85em;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-explore i {
  color: var(--primary);
  filter: drop-shadow(0 0 5px var(--primary-glow));
  transition: var(--transition);
}

.btn-explore:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(230, 28, 49, 0.2);
}

.btn-explore:hover i {
  transform: rotate(45deg);
}

/* Quick-Nav Mega Menu (Phase 21) */
.quick-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 10, 0.85);
  backdrop-filter: blur(20px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 40px;
}

.quick-nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

.quick-nav-container {
  max-width: 900px;
  width: 100%;
  text-align: center;
  transform: translateY(30px) scale(0.95);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.quick-nav-overlay.active .quick-nav-container {
  transform: translateY(0) scale(1);
}

.quick-nav-title {
  margin-bottom: 40px;
  color: #fff;
}

.quick-nav-title h2 {
  font-size: 2em;
  font-weight: 900;
  margin-bottom: 10px;
  color: #fff;
}

.quick-nav-title p {
  color: var(--text-muted);
}

.quick-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 20px;
}

.quick-nav-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 25px 15px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
}

.quick-nav-overlay.active .quick-nav-item {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered load animation */
.quick-nav-item:nth-child(1) {
  transition-delay: 0.1s;
}

.quick-nav-item:nth-child(2) {
  transition-delay: 0.15s;
}

.quick-nav-item:nth-child(3) {
  transition-delay: 0.2s;
}

.quick-nav-item:nth-child(4) {
  transition-delay: 0.25s;
}

.quick-nav-item:nth-child(5) {
  transition-delay: 0.3s;
}

.quick-nav-item:nth-child(6) {
  transition-delay: 0.35s;
}

.quick-nav-item i {
  font-size: 2em;
  color: var(--primary);
  transition: var(--transition);
}

.quick-nav-item span {
  font-weight: 700;
  font-size: 0.95em;
  color: var(--text-muted);
}

.quick-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
  transform: translateY(-8px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(230, 28, 49, 0.1);
}

.quick-nav-item:hover i {
  transform: scale(1.1);
  filter: drop-shadow(0 0 10px var(--primary-glow));
}

.quick-nav-item:hover span {
  color: #fff;
}

.quick-nav-close {
  position: absolute;
  top: 40px;
  left: 40px;
  width: 50px;
  height: 50px;
  background: var(--surface-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border);
}

.quick-nav-close:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: rotate(90deg);
}

@media (max-width: 768px) {
  .quick-nav-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .quick-nav-overlay {
    padding: 20px;
  }

  .quick-nav-close {
    top: 20px;
    left: 20px;
  }
}

/* ====================== SECTION TITLE ====================== */
.sec-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.sec-title h2 {
  font-size: 1.4em;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sec-title h2 span {
  color: var(--primary)
}

/* ====================== TRENDING HERO ====================== */
.trending-box {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.trending-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 2/3;
  cursor: pointer;
  box-shadow: var(--shadow-card);
}

.trending-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.trending-card:hover img {
  transform: scale(1.1)
}

.trending-card .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 50px 14px 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.5) 40%, transparent 100%);
  transition: var(--transition);
}

.trending-card:hover .overlay {
  padding-bottom: 18px
}

.trending-card .overlay h4 {
  font-size: 0.9em;
  font-weight: 800;
  color: #fff;
  line-height: 1.5;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

/* Trending rank badge */
.trending-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
  z-index: 2;
  opacity: 0;
  transition: var(--transition);
}

.trending-card:hover::before {
  opacity: 1
}

/* ====================== MANGA GRID ====================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.manga-card-v2 {
  display: flex;
  gap: 14px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.manga-card-v2::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary-gradient);
  opacity: 0;
  transition: var(--transition);
}

.manga-card-v2:hover {
  border-color: rgba(230, 28, 49, 0.3);
  background: var(--surface-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.manga-card-v2:hover::after {
  opacity: 1
}

.thumb-area {
  width: 85px;
  flex-shrink: 0;
  position: relative
}

.thumb-area img {
  width: 100%;
  height: 115px;
  object-fit: cover;
  border-radius: var(--radius-sm)
}

.badge-type {
  position: absolute;
  top: 5px;
  right: 5px;
  background: var(--primary-gradient);
  color: #fff;
  font-size: 0.58em;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0
}

.content-area h3 {
  font-size: 0.92em;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: var(--transition);
}

.content-area h3:hover {
  color: var(--primary)
}

.chapter-list {
  display: flex;
  flex-direction: column;
  gap: 3px
}

.chapter-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 5px;
  font-size: 0.76em;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
}

.chapter-link:hover {
  background: var(--primary-soft);
  color: var(--primary)
}

.new-tag {
  background: var(--success);
  color: #fff;
  font-size: 0.62em;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 3px;
  animation: pulse-tag 2s ease-in-out infinite;
}

@keyframes pulse-tag {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: 0.5
  }
}

/* ====================== SIDEBAR ====================== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px
}

.sidebar-widget {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: var(--transition);
}

.sidebar-widget:hover {
  border-color: var(--border-hover)
}

.widget-title {
  font-size: 1em;
  font-weight: 900;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.widget-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to left, transparent, var(--border));
}

.social-grid {
  display: flex;
  flex-direction: column;
  gap: 6px
}

.social-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85em;
  transition: var(--transition);
  border: 1px solid transparent;
}

.social-item:hover {
  transform: translateX(-3px);
  border-color: var(--border);
  background: var(--surface-hover)
}

/* ====================== FOOTER ====================== */
.main-footer {
  background: linear-gradient(135deg, rgba(15, 15, 19, 0.95) 0%, rgba(12, 12, 16, 0.98) 100%);
  border-top: 1px solid var(--border);
  padding: 28px 0 20px;
  margin-top: 40px;
  position: relative;
  backdrop-filter: blur(10px);
}

.main-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--primary-gradient);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 24px;
  margin-bottom: 16px;
}

.footer-desc {
  color: var(--text-muted);
  font-size: 0.82em;
  line-height: 1.4;
  margin-top: 4px;
}

.footer-section h4 {
  font-size: 0.92em;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
  position: relative;
  padding-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-section h4 i {
  color: var(--primary);
  font-size: 0.9em;
}

.footer-section h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 1.5px;
  background: var(--primary-gradient);
  border-radius: 1px;
}

.footer-logo {
  font-size: 1.2em;
  font-weight: 900;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.footer-logo span {
  color: var(--primary);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 5px;
  list-style: none;
}

.footer-links li a {
  color: var(--text-muted);
  font-size: 0.80em;
  font-weight: 500;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.footer-links li a i {
  font-size: 0.85em;
  opacity: 0.6;
  transition: var(--transition);
}

.footer-links li a::before {
  content: 'â€¢';
  color: var(--primary);
  opacity: 0;
  margin-right: -8px;
  transition: var(--transition);
  font-size: 1.2em;
}

.footer-links li a:hover {
  color: var(--primary);
  transform: translateX(-4px);
}

.footer-links li a:hover i {
  opacity: 1;
  transform: scale(1.15);
}

.footer-links li a:hover::before {
  opacity: 1;
  margin-right: 0;
}

/* Social Links Styling */
.social-link {
  transition: var(--transition);
}

.social-link.discord:hover {
  color: #7289da;
  text-shadow: 0 0 8px rgba(114, 137, 218, 0.4);
}

.social-link.twitter:hover {
  color: #1da1f2;
  text-shadow: 0 0 8px rgba(29, 161, 242, 0.4);
}

.social-link.tiktok:hover {
  color: #ff2a40;
  text-shadow: 0 0 8px rgba(255, 42, 64, 0.4);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.75em;
  letter-spacing: 0.3px;
}

/* ====================== MANGA DETAIL HERO ====================== */
.manga-hero {
  position: relative;
  overflow: hidden
}

.manga-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(40px) brightness(0.2) saturate(1.8);
  transform: scale(1.15);
  z-index: 0;
}

.manga-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(230, 28, 49, 0.05) 0%, transparent 50%),
    linear-gradient(to top, var(--bg) 0%, transparent 100%);
  z-index: 1;
}

.manga-hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 40px;
  padding: 40px;
  margin-top: 30px;
  margin-bottom: 30px;
  align-items: center;
  background: rgba(15, 15, 19, 0.65);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.hero-cover-container {
  width: 240px;
  flex-shrink: 0;
  position: relative;
}

.hero-cover-container img {
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hero-cover-container:hover img {
  transform: scale(1.03) translateY(-5px);
}

.hero-info {
  flex: 1;
}

.hero-info h1 {
  font-size: 2.8em;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #fff 0%, #aaa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
}

.hero-meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.9em;
  transition: all 0.3s ease;
}

.meta-item:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
}

.meta-item.rating {
  border-color: rgba(255, 193, 7, 0.3);
  color: #ffc107;
  text-shadow: 0 0 10px rgba(255, 193, 7, 0.4);
}

.meta-item.views {
  border-color: rgba(0, 210, 255, 0.3);
  color: #00d2ff;
  text-shadow: 0 0 10px rgba(0, 210, 255, 0.4);
}

.meta-item.status {
  border-color: rgba(34, 197, 94, 0.3);
  color: #22c55e;
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}

.meta-item.type {
  border-color: rgba(230, 28, 49, 0.3);
  color: var(--primary);
  text-shadow: 0 0 10px var(--primary-glow);
}

.meta-label {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8em;
  font-weight: 600;
}

.meta-value {
  font-weight: 800;
}

.hero-description {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.05em;
  line-height: 1.7;
  margin-bottom: 30px;
  max-width: 800px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ====================== CHAPTER LIST ====================== */
.chapter-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 600px;
  overflow-y: auto;
  padding-left: 4px;
}

.chapter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  color: var(--text);
}

.chapter-item:hover {
  border-color: var(--primary);
  background: var(--surface-light);
  color: var(--text);
  transform: translateX(-3px);
  box-shadow: 3px 0 0 var(--primary);
}

.ch-number {
  font-weight: 900;
  font-size: 0.92em;
  color: var(--primary);
  white-space: nowrap;
  min-width: 65px
}

.ch-info-mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px
}

.ch-title {
  font-size: 0.82em;
  color: var(--text-muted);
  font-weight: 600
}

.ch-date {
  font-size: 0.72em;
  color: var(--text-dim);
  font-family: 'Inter', sans-serif
}

/* ====================== READER ====================== */
.reader-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  position: sticky;
  top: var(--header-h);
  z-index: 100;
  backdrop-filter: blur(12px);
}

/* ====================== REACTIONS ====================== */
.reactions-bar {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-top: 16px;
  text-align: center;
}

.reactions-bar .title {
  font-weight: 800;
  font-size: 0.85em;
  color: var(--text-muted);
  margin-bottom: 14px
}

.reactions-grid {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap
}

.reaction-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 16px;
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition);
  cursor: pointer;
}

.reaction-btn:hover {
  transform: scale(1.12) translateY(-3px);
  background: var(--surface-hover);
  color: var(--text)
}

.reaction-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 12px var(--primary-glow)
}

.reaction-btn .emoji {
  font-size: 1.5em
}

.reaction-btn .count {
  font-size: 0.72em;
  font-weight: 800;
  color: var(--text-muted)
}

/* ====================== COMMENTS ====================== */
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 16px
}

.comment-node {
  padding: 16px;
  background: var(--surface-light);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.comment-node:hover {
  border-color: var(--border-hover)
}

.comment-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px
}

.comment-author-info {
  display: flex;
  flex-direction: column;
  gap: 1px
}

.comment-author-name {
  font-weight: 800;
  font-size: 0.92em;
  display: flex;
  align-items: center;
  gap: 5px
}

.comment-badge {
  background: var(--primary);
  color: #fff;
  font-size: 0.58em;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

.comment-badge.premium-badge {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #000;
  font-weight: 900;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

.premium-comment-glow {
  border-left: 3px solid #ffd700 !important;
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.04) 0%, transparent 100%) !important;
}

.comment-time {
  font-size: 0.72em;
  color: var(--text-dim);
  font-family: 'Inter', sans-serif
}

.comment-body {
  color: var(--text-muted);
  font-size: 0.9em;
  line-height: 1.8;
  margin-bottom: 10px;
  padding-right: 50px
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 50px
}

.comment-vote {
  display: flex;
  gap: 6px
}

.comment-action-item {
  font-size: 0.78em;
  color: var(--text-dim);
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  transition: var(--transition);
}

.comment-action-item:hover {
  color: var(--primary);
  background: var(--primary-soft)
}

.replies-wrap {
  margin-top: 10px;
  padding-right: 20px;
  border-right: 2px solid var(--border)
}

/* ====================== AUTH PAGES ====================== */
.auth-page-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - var(--header-h) - 200px);
  padding: 40px 20px;
}

.auth-box {
  background: var(--surface);
  padding: 36px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.auth-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-gradient)
}

.auth-box h2 {
  margin-bottom: 24px;
  font-size: 1.7em;
  font-weight: 900;
  color: var(--text)
}

.auth-box .err {
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
  padding: 10px 14px;
  margin-bottom: 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85em;
  font-weight: 600;
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.auth-box form label {
  display: block;
  text-align: right;
  margin-bottom: 16px;
  font-size: 0.85em;
  font-weight: 700;
  color: var(--text-muted)
}

.auth-box input {
  width: 100%;
  padding: 11px 14px;
  margin-top: 6px;
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  color: var(--text);
  transition: var(--transition);
}

.auth-box input::placeholder {
  color: var(--text-dim)
}

.auth-box input:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-glow)
}

.auth-box button {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95em;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}

.auth-box button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow)
}

.auth-box .register-link,
.auth-box .login-link {
  margin-top: 18px;
  font-size: 0.85em;
  color: var(--text-muted)
}

.auth-box .register-link a,
.auth-box .login-link a {
  color: var(--primary);
  font-weight: 700
}

.auth-box .register-link a:hover,
.auth-box .login-link a:hover {
  text-decoration: underline
}

/* ====================== CATEGORIES ====================== */
.genre-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.genre-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), 0 0 16px var(--primary-glow)
}

.genre-card .card-content h3 {
  color: var(--primary) !important
}

.genre-card .card-content p {
  color: var(--text-muted) !important
}

/* ====================== FAVORITES ====================== */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md)
}

.card img.cover {
  width: 100%;
  height: 260px;
  object-fit: cover
}

.card-content {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between
}

.card-content h3 {
  margin: 0 0 6px 0;
  font-size: 1em;
  font-weight: 800;
  color: var(--text)
}

.card-content .meta {
  font-size: 0.82em;
  color: var(--text-muted);
  margin-bottom: 10px
}

.card-actions {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto
}

.card-actions .btn {
  flex: 1;
  text-align: center;
  padding: 7px 0;
  font-size: 0.82em;
  border-radius: var(--radius-sm)
}

/* ====================== PROFILE ====================== */
.profile-header {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-top: 20px
}

.profile-cover {
  width: 100%;
  height: 280px;
  object-fit: cover;
  filter: brightness(0.45)
}

.profile-meta-wrap {
  position: relative;
  margin-top: -75px;
  padding: 0 36px 36px;
  display: flex;
  align-items: flex-end;
  gap: 24px;
}

.profile-avatar-big {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 5px solid var(--bg);
  object-fit: cover;
  box-shadow: var(--shadow-lg);
  z-index: 10;
}

.profile-basic-info h1 {
  font-size: 2em;
  font-weight: 900
}

.profile-points-large {
  background: var(--primary-gradient);
  color: #fff;
  padding: 5px 16px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.85em;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.profile-tabs {
  display: flex;
  gap: 3px;
  margin-top: 20px;
  background: var(--surface);
  padding: 4px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  border: 1px solid var(--border);
}

.profile-tab {
  padding: 9px 18px;
  color: var(--text-muted);
  font-weight: 700;
  cursor: pointer;
  border-radius: 7px;
  white-space: nowrap;
  font-size: 0.85em;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.profile-tab:hover {
  color: var(--text);
  background: var(--surface-light)
}

.profile-tab.active {
  background: var(--primary-gradient);
  color: #fff
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px
}

.history-item {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  transition: var(--transition);
  position: relative;
}

.history-item:hover {
  border-color: var(--primary);
  background: var(--surface-light);
  transform: scale(1.01)
}

.history-thumb {
  width: 50px;
  height: 68px;
  border-radius: 5px;
  object-fit: cover;
  margin-left: 12px
}

.history-info {
  flex: 1
}

.history-title {
  display: block;
  font-weight: 800;
  font-size: 0.95em;
  margin-bottom: 3px
}

.history-meta {
  font-size: 0.75em;
  color: var(--text-dim)
}

.history-badge {
  background: var(--info);
  color: #fff;
  font-size: 0.65em;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  position: absolute;
  left: 12px;
  top: 12px;
}

.settings-section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 36px 0 22px
}

.settings-section-header::before,
.settings-section-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to left, var(--primary), transparent)
}

.settings-section-header::after {
  background: linear-gradient(to right, var(--primary), transparent)
}

.settings-section-header span {
  font-weight: 900;
  font-size: 1.05em;
  color: var(--text);
  padding: 0 8px;
  white-space: nowrap
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px
}

.form-group {
  margin-bottom: 18px
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.85em;
  text-align: right
}

.form-control {
  width: 100%;
  background: var(--surface-light);
  border: 1px solid var(--border);
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.9em;
  text-align: right;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-glow)
}

.profile-sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 16px
}

.info-title {
  font-size: 1.1em;
  font-weight: 900;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px
}

.info-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px
}

.info-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.85em;
  font-weight: 700
}

.info-icon {
  font-size: 1.1em;
  color: var(--primary)
}

.info-value {
  font-weight: 900;
  color: var(--warning);
  font-family: 'Inter', sans-serif
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 18px
}

.shop-card {
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.shop-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md), var(--shadow-glow)
}

.shop-card.premium {
  border-color: #ffd700
}

.shop-card .icon {
  font-size: 2.8em;
  margin-bottom: 12px;
  display: block
}

.shop-card h3 {
  font-size: 1.1em;
  margin-bottom: 8px;
  color: #ffd700
}

.shop-card .price {
  font-size: 1.4em;
  font-weight: 900;
  color: #fff;
  margin: 12px 0;
  display: block
}

.shop-card .price span {
  font-size: 0.6em;
  color: var(--text-muted);
  font-weight: 400
}

/* ====================== SCROLL TO TOP ====================== */
.scroll-top {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 44px;
  height: 44px;
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.2em;
  cursor: pointer;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: var(--transition);
  box-shadow: var(--shadow-glow);
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0)
}

.scroll-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 40px var(--primary-glow)
}

/* ====================== ANIMATIONS ====================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

/* Legendary Frames (Phase 19) */
.border-void {
  border: 2px solid transparent !important;
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(45deg, #6c5ce7, #a29bfe, #000) border-box;
  animation: voidRotate 3s linear infinite;
  box-shadow: 0 0 15px rgba(108, 92, 231, 0.5);
}

@keyframes voidRotate {
  0% {
    filter: hue-rotate(0deg) brightness(1);
  }

  50% {
    filter: hue-rotate(180deg) brightness(1.5);
  }

  100% {
    filter: hue-rotate(360deg) brightness(1);
  }
}

.border-solar {
  border: 2px solid transparent !important;
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(45deg, #ff9f43, #ee5253, #feca57) border-box;
  animation: solarPulse 2s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(255, 159, 67, 0.6);
}

@keyframes solarPulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 10px rgba(255, 159, 67, 0.4);
  }

  50% {
    transform: scale(1.02);
    box-shadow: 0 0 25px rgba(255, 159, 67, 0.8);
  }
}

/* Custom Cursors */
body.cursor-sword {
  cursor: crosshair, auto !important;
}

body.cursor-magic {
  cursor: cell, auto !important;
}

/* Site Themes */
body.theme-space {
  --surface: #0a0a12;
  --surface-light: #12121e;
  background-image: radial-gradient(circle at 50% 50%, #1a1a2e 0%, #0a0a12 100%);
  background-attachment: fixed;
}

body.theme-hacker {
  --primary: #00ff00;
  --primary-hover: #00cc00;
  --surface: #000;
  --surface-light: #050505;
  --text: #00ff00;
  --text-muted: #00aa00;
  font-family: 'Courier New', Courier, monospace;
}

body.theme-classic {
  --primary: #000;
  --surface: #fff;
  --surface-light: #f5f5f5;
  --text: #000;
  --text-muted: #666;
  --border: #ddd;
  filter: grayscale(1);
}

/* Entrance Effects */
@keyframes entranceSparkle {
  0% {
    transform: scale(0.9) translateY(10px);
    opacity: 0;
  }

  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.entrance-effect {
  animation: entranceSparkle 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0
  }

  100% {
    background-position: 200% 0
  }
}

.manga-card-v2,
.trending-card,
.sidebar-widget,
.chapter-item,
.genre-card,
.card {
  animation: fadeInUp 0.4s ease backwards
}

.manga-card-v2:nth-child(1) {
  animation-delay: .03s
}

.manga-card-v2:nth-child(2) {
  animation-delay: .06s
}

.manga-card-v2:nth-child(3) {
  animation-delay: .09s
}

.manga-card-v2:nth-child(4) {
  animation-delay: .12s
}

.manga-card-v2:nth-child(5) {
  animation-delay: .15s
}

.manga-card-v2:nth-child(6) {
  animation-delay: .18s
}

.trending-card:nth-child(1) {
  animation-delay: .03s
}

.trending-card:nth-child(2) {
  animation-delay: .08s
}

.trending-card:nth-child(3) {
  animation-delay: .13s
}

.trending-card:nth-child(4) {
  animation-delay: .18s
}

/* ====================== RESPONSIVE ====================== */
@media(max-width:1024px) {
  .main-wrapper {
    grid-template-columns: 1fr
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 18px
  }

  .manga-hero-content {
    flex-direction: column;
    align-items: center;
    text-align: center
  }

  .hero-cover-container {
    width: 160px
  }

  .hero-meta-grid {
    justify-content: center
  }

  .profile-meta-wrap {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 16px 24px
  }

  .form-grid {
    grid-template-columns: 1fr
  }
}

@media(max-width:768px) {
  .header-content {
    flex-wrap: wrap;
    height: auto;
    padding: 8px 12px;
    gap: 8px;
    justify-content: space-between;
  }

  body {
    padding-top: var(--mm-header-h, 130px) !important;
  }

  body.no-scroll {
    overflow: hidden;
  }

  .user-menu {
    gap: 5px;
  }

  .user-info-combined {
    padding: 3px 10px 3px 4px;
  }

  .user-avatar-small {
    width: 28px;
    height: 28px;
  }

  .user-points-badge {
    display: none;
  }

  /* Hide points on mobile header to save space */

  body {
    padding-top: var(--mm-header-h, 56px)
  }

  .main-nav {
    display: flex;
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: rgba(12, 12, 16, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 15px;
    z-index: 1000;
    padding: 80px 25px 40px;
    overflow-y: auto;
    transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
    border-left: 1px solid var(--border);
  }

  .main-nav.open {
    right: 0;
  }

  .close-menu {
    display: block;
    position: absolute;
    top: 20px;
    left: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    color: var(--text-muted);
    cursor: pointer;
    background: var(--surface-light);
    border-radius: 50%;
    line-height: 1;
    z-index: 5100;
    transition: 0.3s;
  }

  .menu-trigger {
    display: flex;
  }

  .close-menu:hover {
    color: var(--primary);
    transform: rotate(90deg);
  }

  .main-nav.open {
    display: flex
  }

  .main-nav .nav-link {
    font-size: 1.15em;
    padding: 12px 28px;
    width: 100%;
    text-align: center;
    border-radius: var(--radius-md)
  }

  .hamburger {
    display: flex
  }

  .search-form {
    order: 3;
    flex: 0 0 100%;
    max-width: 100%;
    margin-top: 5px;
    margin-bottom: 5px;
  }

  .search-form input {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  }

  .search-form button {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  }

  .trending-box {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px
  }

  .grid {
    grid-template-columns: 1fr
  }

  .sec-title h2 {
    font-size: 1.15em
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 14px
  }

  .profile-avatar-big {
    width: 110px;
    height: 110px
  }

  .profile-basic-info h1 {
    font-size: 1.5em
  }

  .hero-info h1 {
    font-size: 1.5em
  }

  .reader-nav .container {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    text-align: center
  }

  .shop-grid {
    grid-template-columns: 1fr
  }
}

@media(max-width:480px) {
  .container {
    padding: 0 12px
  }

  .trending-box {
    grid-template-columns: 1fr 1fr
  }

  .manga-card-v2 {
    flex-direction: column
  }

  .thumb-area {
    width: 100%
  }

  .thumb-area img {
    height: 150px;
    width: 100%
  }

  .hero-cover-container {
    width: 130px
  }

  .auth-box {
    padding: 24px 16px
  }

  /* ====================== COMMENTS & ANIMATIONS (Phase 11) ====================== */

  /* Animations */
  @keyframes slideUpFade {
    from {
      opacity: 0;
      transform: translateY(20px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes pulseBorder {
    0% {
      box-shadow: 0 0 0 0 rgba(230, 28, 49, 0.4);
    }

    70% {
      box-shadow: 0 0 0 10px rgba(230, 28, 49, 0);
    }

    100% {
      box-shadow: 0 0 0 0 rgba(230, 28, 49, 0);
    }
  }

  /* Comment Structure */
  .comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .comment-node {
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    animation: slideUpFade 0.4s ease-out forwards;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
  }

  .comment-node:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
  }

  .comment-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
  }

  .comment-author-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .comment-author-name {
    font-weight: 800;
    font-size: 1.05em;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .comment-time {
    font-size: 0.75em;
    color: var(--text-muted);
  }

  .comment-body {
    font-size: 0.95em;
    line-height: 1.6;
    color: var(--text2);
    margin-bottom: 15px;
    padding-right: 56px;
    /* Align with text, not avatar */
  }

  /* Actions */
  .comment-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-right: 56px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    padding-top: 12px;
  }

  .comment-action-item {
    font-size: 0.85em;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }

  .comment-action-item:hover {
    color: var(--primary);
  }

  /* Replies Wrap */
  .replies-wrap {
    margin-top: 20px;
    margin-right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-right: 2px solid var(--primary);
    padding-right: 20px;
  }

  .replies-wrap .comment-node {
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 0;
    box-shadow: none;
  }

  .replies-wrap .comment-node:hover {
    transform: none;
    box-shadow: none;
  }

  .replies-wrap .comment-body,
  .replies-wrap .comment-actions {
    padding-right: 48px;
  }

  /* Beautiful Reply Input Focus */
  #comments textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(230, 28, 49, 0.2);
  }

  /* Submit Button Pulse */
  .btn-pulse {
    animation: pulseBorder 2s infinite;
  }

  /* Mention Tag Styles */
  .mention-tag {
    color: var(--primary);
    font-weight: 900;
    font-size: 0.95em;
    display: inline-block;
    margin-left: 6px;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
  }

  .mention-tag:hover {
    text-shadow: 0 0 10px rgba(230, 28, 49, 0.5);
  }
}

/* ====================== PREMIUM COMMENTS (Phase 11) ====================== */
@keyframes premiumAvatarGlow {
  0% {
    box-shadow: 0 0 5px #ffd700, 0 0 10px #ffd700, inset 0 0 5px #ffd700;
    border-color: #ffd700;
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 15px #ffaa00, 0 0 25px #ffaa00, inset 0 0 10px #ffaa00;
    border-color: #ffaa00;
    transform: scale(1.05);
  }

  100% {
    box-shadow: 0 0 5px #ffd700, 0 0 10px #ffd700, inset 0 0 5px #ffd700;
    border-color: #ffd700;
    transform: scale(1);
  }
}

@keyframes premiumNameShine {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.premium-avatar-animate {
  animation: premiumAvatarGlow 2.5s infinite ease-in-out;
  border: 2px solid #ffd700;
  padding: 2px;
}

.premium-name-animate {
  background: linear-gradient(90deg, #ffd700, #ff8c00, #ffd700);
  background-size: 200% auto;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
  color: var(--text-muted);
}

.title-legendary {
  color: #ffd700;
  text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.title-critic {
  color: #a29bfe;
}

.title-elder {
  color: #55efc4;
}

/* Character Cards (Phase 13) */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.char-card {
  background: var(--surface-light);
  border: 2px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: 0.3s;
  position: relative;
  cursor: pointer;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.char-card:hover {
  transform: translateY(-8px);
  border-color: var(--primary);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.char-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.char-card .card-info {
  padding: 12px;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.char-card .rarity-tag {
  font-size: 0.65em;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 5px;
  display: inline-block;
  width: fit-content;
  margin: 0 auto 5px;
}

/* Rarity Variations */
.char-card.common {
  border-color: #7f8c8d !important;
}

.char-card.common .rarity-tag {
  background: #7f8c8d;
  color: white;
}

.char-card.rare {
  border-color: #3498db !important;
  box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

.char-card.rare .rarity-tag {
  background: #3498db;
  color: white;
}

.char-card.epic .rarity-tag {
  background: #9b59b6;
  color: white;
}

.char-card.legendary {
  border-color: #ffd700 !important;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
  animation: legendary-glow 2s infinite, holographic 5s infinite;
}

.char-card.legendary .rarity-tag {
  background: linear-gradient(90deg, #ffd700, #fff, #ffd700);
  background-size: 200% auto;
  color: #000;
  animation: shine 2s linear infinite;
}

@keyframes legendary-glow {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
  }

  50% {
    box-shadow: 0 0 35px rgba(255, 215, 0, 0.8);
  }
}

@keyframes holographic {

  0%,
  100% {
    filter: hue-rotate(0deg) brightness(1);
  }

  50% {
    filter: hue-rotate(15deg) brightness(1.2);
  }
}

/* Favorites Library UI (Phase 15) */
.manga-lib-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  margin-top: 20px;
}

.manga-lib-card {
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  overflow: hidden;
  transition: 0.3s;
  height: 140px;
  position: relative;
}

.manga-lib-card:hover {
  border-color: var(--primary);
  background: var(--surface);
  transform: translateX(-5px);
}

.manga-lib-thumb {
  width: 100px;
  height: 100%;
  object-fit: cover;
}

.manga-lib-body {
  flex: 1;
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.manga-lib-info h3 {
  margin: 0;
  font-size: 1.1em;
  color: var(--text);
}

.manga-lib-info .meta {
  font-size: 0.8em;
  color: var(--text-muted);
  margin-top: 4px;
}

.manga-lib-progress {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin: 10px 0;
  overflow: hidden;
}

.manga-lib-progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
}

.manga-lib-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-lib-sm {
  font-size: 0.75em;
  padding: 5px 12px;
}

.char-card.legendary {
  border-color: #f1c40f !important;
  box-shadow: 0 0 25px rgba(241, 196, 15, 0.6);
  animation: legendary-sparkle 2s infinite;
}

.char-card.legendary .rarity-tag {
  background: #f1c40f;
  color: #000;
}

@keyframes epic-glow {

  0%,
  100% {
    box-shadow: 0 0 15px rgba(155, 89, 182, 0.4);
  }

  50% {
    box-shadow: 0 0 25px rgba(155, 89, 182, 0.7);
  }
}

@keyframes legendary-sparkle {

  0%,
  100% {
    box-shadow: 0 0 25px rgba(241, 196, 15, 0.6);
    filter: brightness(1);
  }

  50% {
    box-shadow: 0 0 40px rgba(241, 196, 15, 0.9);
    filter: brightness(1.2);
  }
}

/* --- Manga Master v7.1 Ultimate Header Additions --- */
.mm-has-mega {
  position: static;
}

.mm-mega-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  width: 90%;
  max-width: 1100px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-top: 2px solid var(--mm-accent);
  border-radius: 0 0 24px 24px;
  padding: 30px;
  visibility: hidden;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  z-index: 3500;
  pointer-events: none;
}

.mm-has-mega:hover .mm-mega-menu {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: all;
}

.mm-mega-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.mm-mega-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: 0.3s;
}

.mm-mega-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--mm-accent);
  transform: translateY(-5px);
}

.mm-mega-item img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 8px;
}

.mm-mega-item span {
  font-weight: 800;
  font-size: 0.9em;
  text-align: center;
  color: #fff;
}

.mm-context-v7 {
  background: linear-gradient(to bottom, #000, #08080a);
  border-bottom: 2px solid var(--mm-accent);
  padding: 12px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.mm-logo-v7 {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 1.3em;
  letter-spacing: 2px;
  color: #fff;
  display: flex !important;
  gap: 5px;
}

.mm-logo-v7 .gold {
  color: var(--mm-gold);
  text-shadow: 0 0 10px var(--mm-gold-glow);
}

.back-link-v7 {
  width: 42px;
  height: 42px;
  background: rgba(230, 28, 49, 0.1);
  border: 1px solid var(--mm-accent);
  border-radius: 10px;
  color: var(--mm-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.3s;
}

.back-link-v7:hover {
  background: var(--mm-accent);
  color: #fff;
  box-shadow: 0 0 15px var(--mm-accent-glow);
}

.manga-title-v7 {
  font-weight: 900;
  font-size: 1.1em;
  color: #fff;
}

.manga-title-v7 .ch-num {
  color: var(--mm-accent);
}

.nav-btn-v7 {
  width: 44px;
  height: 44px;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s;
}

.nav-btn-v7:hover {
  background: var(--grad-fire);
  border-color: var(--mm-fire);
  box-shadow: 0 0 20px var(--mm-accent-glow);
  transform: scale(1.1);
}

.ch-select-v7 {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 25px;
  border-radius: 30px;
  font-weight: 800;
  font-size: 0.9em;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: 0.3s;
}

.ch-select-v7:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--mm-gold);
}

.ch-dropdown-v7 {
  position: absolute;
  bottom: 120%;
  right: 0;
  width: 250px;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 10px;
  list-style: none;
  visibility: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: 0.3s;
  z-index: 4000;
}

.ch-select-v7:hover .ch-dropdown-v7 {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.ch-dropdown-v7 li {
  padding: 12px 15px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: 0.2s;
}

.ch-dropdown-v7 li:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--mm-gold);
}

.ch-dropdown-v7 li.active {
  background: rgba(252, 207, 49, 0.1);
  color: var(--mm-gold);
}

/* branding & search suite */
.header-brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.header-brand-container:hover {
  transform: scale(1.02);
}
.header-logo {
  height: 55px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(230, 28, 49, 0.4));
}
.header-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
}

.mm-search-btn {
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s;
}

.mm-search-btn:hover {
  color: var(--primary);
  transform: scale(1.1);
}

.gold {
  color: var(--mm-gold);
}

.mm-float-flex {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

.mm-float-left,
.mm-float-right {
  display: flex !important;
  align-items: center !important;
  gap: 15px !important;
}

/* â”€â”€ Phase 5: Responsive & Performance Fixes â”€â”€ */
.mm-main-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 30px;
  margin-bottom: 40px;
  width: 100%;
}

@media (max-width: 1024px) {
  .mm-main-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .mm-update-grid {
    grid-template-columns: 1fr !important;
  }
  .mm-trend-row {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .header-brand-container .header-title {
    display: none;
  }
  .mm-mobile-toggle {
    display: flex !important;
  }
  .mm-search-v7 {
    display: none !important;
  }
  .mm-header-radical {
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
  }
  .mm-row-flex {
    padding: 0 15px !important;
  }
  .mm-hero-slide {
    height: 280px !important;
  }
  .mm-hero-title {
    font-size: 1.3rem !important;
  }
}

@media (max-width: 480px) {
  .mm-trend-row {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .mm-hero-slide {
    height: 220px !important;
  }
}

/* Fix Swiper Overflow */
.swiper-wrapper {
  display: flex !important;
}
.trendSwiper {
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
}

/* =============================================
   PAGE SPEED OPTIMIZATIONS (A11Y & UX)
   ============================================= */
.swiper-pagination-bullet {
    width: 8px !important;
    height: 8px !important;
    margin: 0 8px !important;
    box-sizing: content-box;
    border: 12px solid transparent !important;
    background-clip: padding-box !important;
}
/* ============================================================
   ?? CREATOR MODE — Professional Studio UI (Isolated)
   ============================================================ */

.cm-active { overflow-x: hidden; }
.cm-hidden { display: none !important; }
.cm-pages-fullscreen { 
    max-width: 100vw !important; 
    width: 100vw !important; 
    margin: 0 !important; 
    padding: 0 !important;
    border-radius: 0 !important; 
    transform-origin: center top; 
    will-change: transform;
    display: block !important;
}
.cm-pages-fullscreen img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto !important;
}
.cm-dock { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%) translateY(150px); background: rgba(10, 10, 16, 0.85); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 50px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255,255,255,0.2); z-index: 2147483647 !important; opacity: 0; pointer-events: none; transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1); display: flex; align-items: center; padding: 8px 12px; gap: 12px; max-width: 95vw; overflow-x: auto; scrollbar-width: none; }
.cm-dock.cm-visible { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
body.cm-active { 
    overflow: hidden !important; 
    background: #000 !important; 
    margin: 0 !important;
    padding: 0 !important;
}
body.cm-active .mm-header-radical, 
body.cm-active footer,
body.cm-active .reactions-bar,
body.cm-active .comments-v4-container,
body.cm-active .sec-title,
body.cm-active .ch-countdown,
body.cm-active .manga-grid aside,
body.cm-active .manga-grid .sidebar,
body.cm-active .btn-support,
body.cm-active .floating-support-btn,
body.cm-active .fixed-buttons,
body.cm-active .reading-nav { 
    display: none !important; 
}

/* v32.0 Brutal Isolation: Fixed Staging */
body.cm-active .cm-pages-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2000000 !important;
    background: #000 !important;
    overflow-y: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

body.cm-active .cm-pages-fullscreen img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto !important;
    transition: width 0.4s ease;
}

/* Ensure child images inside zoomed wrap are responsive */
.cm-zoom-wrap {
    position: relative !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
    transition: width 0.4s ease, transform 0.4s ease;
}

/* v33.0: Professional Commander UI — The Restoration */
.cm-dock { 
    position: fixed; 
    bottom: 25px; 
    left: 50%; 
    transform: translateX(-50%) translateY(150px); 
    background: rgba(10, 10, 16, 0.85); 
    backdrop-filter: blur(20px) saturate(180%); 
    -webkit-backdrop-filter: blur(20px) saturate(180%); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    border-radius: 50px; 
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255,255,255,0.2); 
    z-index: 2147483647 !important; 
    opacity: 0; 
    pointer-events: none; 
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1); 
    display: flex; 
    align-items: center; 
    padding: 8px 12px; 
    gap: 12px; 
    max-width: 95vw; 
    overflow-x: auto; 
    scrollbar-width: none; 
}
.cm-dock.cm-visible { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.cm-dock.cm-collapsed { width: 60px; overflow: hidden; padding: 8px; }
.cm-drag-handle { cursor: pointer; color: #fff; font-size: 1.2rem; padding: 0 10px; opacity: 0.7; transition: 0.3s; }
.cm-drag-handle:hover { opacity: 1; transform: scale(1.1); }

.cm-btn-group { display: flex; align-items: center; gap: 8px; padding: 0 10px; border-right: 1px solid rgba(255,255,255,0.1); }
.cm-btn-group:last-child { border: none; }
.cm-btn-icon { 
    background: none; 
    border: none; 
    color: #fff; 
    font-size: 1.2rem; 
    width: 44px; 
    height: 44px; 
    border-radius: 50%; 
    cursor: pointer; 
    transition: 0.3s; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    opacity: 0.8; 
    padding: 10px; /* Larger hitarea */
}
.cm-btn-icon:hover { background: rgba(255,255,255,0.1); opacity: 1; transform: translateY(-2px); }
.cm-active-btn { background: var(--accent) !important; color: #fff !important; opacity: 1 !important; box-shadow: 0 0 15px var(--accent); }
.cm-btn-record { color: #ef4444; }

.cm-speed-slider { width: 80px; accent-color: var(--accent); cursor: pointer; }
.cm-speed-hint { color: var(--accent); font-size: 0.8rem; font-weight: 800; min-width: 35px; }

/* Floating Panels */
.cm-floating-panel { 
    position: fixed; 
    bottom: 90px; 
    right: 30px; 
    background: rgba(15, 15, 25, 0.9); 
    backdrop-filter: blur(20px); 
    border: 1px solid rgba(255,255,255,0.1); 
    border-radius: 20px; 
    padding: 20px; 
    z-index: 2147483647 !important; 
    width: 300px; 
    opacity: 0; 
    pointer-events: none; 
    transform: translateY(20px); 
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); 
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}
.cm-floating-panel.cm-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.cm-panel-title { color: #aaa; font-weight: 800; font-size: 0.9rem; text-transform: uppercase; margin-bottom: 15px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px; }
.cm-floating-panel button { width: 100%; padding: 12px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); color: #ccc; border-radius: 12px; margin-bottom: 8px; cursor: pointer; transition: 0.3s; text-align: left; display: flex; align-items: center; gap: 10px; }
.cm-floating-panel button:hover { background: rgba(255,255,255,0.1); color: #fff; transform: scale(1.02); }
.cm-upload-btn { background: rgba(59, 130, 246, 0.1) !important; color: #60a5fa !important; border-color: rgba(59,130,246,0.2) !important; }
.cm-stop-btn { background: rgba(239, 68, 68, 0.1) !important; color: #f87171 !important; border-color: rgba(239,68,68,0.2) !important; }

/* v36.0: The Cinematic Lens (Aspect Ratio Fix & VFX Pulse) */
.cm-camera-mask { 
    position: fixed; 
    top: 50% !important; 
    left: 50% !important; 
    transform: translate(-50%, -50%) !important; 
    pointer-events: none; 
    z-index: 1999999; 
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1); 
    box-shadow: 0 0 0 5000px rgba(0,0,0,0) !important; /* Start transparent */
    border: 0px solid rgba(255,255,255,0.05);
}
.cm-camera-mask.cm-visible { 
    box-shadow: 0 0 0 5000px rgba(0,0,0,0.95), inset 0 0 200px rgba(0,0,0,0.8) !important; 
    border-width: 1px;
}
.cm-camera-mask.has-fire { 
    box-shadow: 0 0 0 5000px rgba(230, 28, 49, 0.2), 0 0 100px rgba(230, 28, 49, 0.4) !important; 
}

/* Lengthened Cinematic VFX Keyframes */
.cm-flash-overlay { 
    animation: cm-flash-v2 2.5s ease-out forwards !important; 
}
.cm-ripple-wave { 
    animation: cm-ripple-v2 2.5s ease-out forwards !important; 
}

@keyframes cm-flash-v2 { 
    0% { background: #fff; opacity: 1; } 
    10% { background: #fff; opacity: 1; }
    100% { background: #fff; opacity: 0; } 
}
@keyframes cm-ripple-v2 { 
    0% { transform: scale(0.5); opacity: 0.8; } 
    100% { transform: scale(3.5); opacity: 0; } 
}

.cm-glitch { animation: cm-glitch 0.4s 5 !important; } /* Slower & Repeated */
.cm-colordrain { filter: grayscale(100%); transition: filter 3.5s !important; }
.cm-depth-snap { transform: scale(1.05); transition: transform 2.5s ease-out !important; }

.cm-watermark { position: fixed; bottom: 30px; left: 30px; opacity: 0; transition: 0.5s; z-index: 2000002; color: #fff; font-weight: 800; font-size: 1.5rem; filter: drop-shadow(0 0 10px rgba(0,0,0,1)); }
.cm-watermark.cm-visible { opacity: 0.4; }

.cm-exit-cinema-btn { position: fixed; top: 30px; right: 30px; background: rgba(0,0,0,0.8); color: #fff; border: 1px solid rgba(255,255,255,0.1); border-radius: 50px; padding: 12px 25px; cursor: pointer; z-index: 2000003; opacity: 0; pointer-events: none; transform: translateY(-20px); transition: 0.4s; }
.cm-exit-cinema-btn.cm-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

@keyframes cm-blink { 50% { opacity: 0; } }
@keyframes cm-glitch { 
    0% { transform: translate(0); } 
    20% { transform: translate(-5px, 5px); filter: hue-rotate(90deg); }
    40% { transform: translate(5px, -5px); filter: hue-rotate(180deg); }
    60% { transform: translate(-5px, -5px); filter: hue-rotate(270deg); }
    80% { transform: translate(5px, 5px); filter: hue-rotate(360deg); }
    100% { transform: translate(0); }
}
.cm-glitch { animation: cm-glitch 0.2s 3; }

/* v35.0: The Unstoppable Creator Toggle (Absolute Stacking Victory) */
.cm-toggle-btn {
    position: fixed !important;
    bottom: 40px !important;
    right: 40px !important;
    background: linear-gradient(135deg, #ff1a2f 0%, #7f0000 100%) !important;
    color: #ffffff !important;
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 50px !important;
    padding: 16px 28px !important;
    font-weight: 900 !important;
    font-size: 1.1rem !important;
    cursor: pointer !important;
    z-index: 2147483647 !important; /* Ultimate Top Level */
    pointer-events: auto !important;
    isolation: isolate !important;
    box-shadow: 0 0 25px rgba(255, 0, 0, 0.6), 0 10px 40px rgba(0, 0, 0, 0.9), inset 0 2px 4px rgba(255, 255, 255, 0.4) !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1) !important;
    animation: cm-super-pulse 2.5s infinite !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.cm-toggle-btn:hover {
    transform: scale(1.15) translateY(-5px) !important;
    box-shadow: 0 0 40px rgba(255, 0, 0, 0.9), 0 20px 50px rgba(0, 0, 0, 1) !important;
    background: #ff0015 !important;
}

.cm-toggle-btn i {
    font-size: 1.4rem !important;
    filter: drop-shadow(0 0 5px #fff) !important;
}

/* Specific centering fix for Isolated Reader v35.0 */
body.cm-active .cm-pages-fullscreen {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    background: #000000 !important;
}

body.cm-active .cm-pages-fullscreen img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 auto !important;
    object-fit: contain !important;
}

@keyframes cm-super-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 26, 47, 0.8), 0 10px 40px rgba(0, 0, 0, 0.9); }
    70% { box-shadow: 0 0 0 30px rgba(255, 26, 47, 0), 0 10px 40px rgba(0, 0, 0, 0.9); }
    100% { box-shadow: 0 0 0 0 rgba(255, 26, 47, 0), 0 10px 40px rgba(0, 0, 0, 0.9); }
}

/* ============================================================
   EMPEROR'S VAULT v37.0 - UNIFIED GRAPHICS ENGINE
   Architectural Precision: Senior Engineer Edition
   ============================================================ */

:root {
    --luxury-deep-bg: #05050a;
    --luxury-card-bg: rgba(13, 13, 25, 0.7);
    --rarity-legendary-glow: 0 0 30px rgba(245, 158, 11, 0.3);
    --rarity-epic-glow: 0 0 30px rgba(168, 85, 247, 0.3);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-border-hover: rgba(255, 255, 255, 0.2);
}

.luxury-store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 40px 20px;
    perspective: 1000px;
}

.shop-card-v37 {
    position: relative;
    background: var(--luxury-card-bg);
    border-radius: 24px;
    border: 1px solid var(--card-border);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: visible !important; /* Boundary Breaking Engine Active */
}

.shop-card-v37:hover {
    transform: translateY(-10px) rotateX(5deg);
    border-color: var(--card-border-hover);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
}

.avatar-boundary-engine {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 20px auto 40px;
    /* 🛡️ Quantum Isolation: The secret for professional video blending */
    isolation: isolate; 
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    overflow: visible !important;
}

.base-user-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    z-index: 1;
    border: 3px solid rgba(255, 255, 255, 0.05);
    background: #000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.frame-breaking-overlay {
    position: absolute;
    /* 🚀 Hardware Acceleration for 60fps Motion */
    will-change: transform, opacity;
    pointer-events: none;
    z-index: 10;
    object-fit: contain;
    /* Professional Context: Ensures transform starts from center */
    transform-origin: center center;
    transition: filter 0.3s ease;
}

.shop-card-v37:hover .frame-breaking-overlay {
    filter: brightness(1.2) drop-shadow(0 0 10px rgba(255,255,255,0.3));
}

.card-rarity-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 16px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    z-index: 20;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.rarity-legendary { background: linear-gradient(90deg, #f59e0b, #d97706); color: #fff; box-shadow: var(--rarity-legendary-glow); }
.rarity-epic { background: linear-gradient(90deg, #a855f7, #7c3aed); color: #fff; box-shadow: var(--rarity-epic-glow); }

.price-tag-luxury {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: auto;
    font-weight: 900;
    font-size: 1.2rem;
    color: #fcd34d;
}

.btn-purchase-diamond {
    margin-top: 20px;
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    border: none;
    background: #fff;
    color: #000;
    font-weight: 900;
    cursor: pointer;
    transition: 0.3s;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.btn-purchase-diamond:hover {
    background: #8b5cf6;
    color: #fff;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

/* ============================================================
   IMPERIAL STUDIO v42.0 - DIRECTOR'S CUT VFX CORE
   The Absolute Professional Graphics Engine
   ============================================================ */

.imperial-studio-v42 {
    --studio-neon-purple: #a855f7;
    --studio-neon-green: #22c55e;
    --studio-neon-blue: #2563eb;
    --studio-neon-red: #dc2626;
    --studio-neon-orange: #ea580c;
}

/* 🎥 Split-Screen Architecture */
.studio-split-view {
    position: relative;
    display: flex;
}

.control-room {
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    scrollbar-width: thin;
    scrollbar-color: var(--studio-neon-purple) transparent;
}

.director-studio {
    background: radial-gradient(circle at center, #0a0a15 0%, #020205 100%);
    overflow: hidden;
    /* 🛡️ Quantum Isolation: Ensures blending stays within the studio stage */
    isolation: isolate; 
}

/* ⚡ VFX Keyframes & Auras */
@keyframes studio-shake {
    0%, 100% { transform: translate(0, 0); }
    10%, 30%, 50%, 70%, 90% { transform: translate(-8px, -4px) rotate(-1deg); }
    20%, 40%, 60%, 80% { transform: translate(8px, 4px) rotate(1deg); }
}

@keyframes studio-flash {
    0% { filter: brightness(1) contrast(1); }
    10% { filter: brightness(3) contrast(2) saturate(0); }
    100% { filter: brightness(1) contrast(1); }
}

@keyframes vfx-aura-pulse {
    0% { transform: scale(1); opacity: 0.3; filter: blur(20px); }
    100% { transform: scale(1.1); opacity: 0.6; filter: blur(35px); }
}

.vfx-impact {
    animation: studio-shake 0.45s cubic-bezier(.36,.07,.19,.97) both;
}

.vfx-aura-active {
    position: absolute;
    inset: -30px;
    border-radius: 50%;
    z-index: 4;
    transition: 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    mix-blend-mode: color-dodge;
}

.aura-lightning { 
    box-shadow: 0 0 70px var(--studio-neon-blue), inset 0 0 40px var(--studio-neon-blue);
    animation: vfx-aura-pulse 1s infinite alternate;
}

.aura-fire { 
    box-shadow: 0 0 70px var(--studio-neon-orange), inset 0 0 40px var(--studio-neon-orange);
    animation: vfx-aura-pulse 0.7s infinite alternate-reverse;
}

/* 📐 Precision Sliders & Glass UI */
.studio-section {
    padding: 15px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.02);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    margin-bottom: 20px;
}

.upload-zone:hover {
    background: rgba(168, 85, 247, 0.1) !important;
    border-color: var(--studio-neon-purple) !important;
    transform: translateY(-2px);
}

.bgm-player-ui {
    animation: floating-bgm 3s ease-in-out infinite;
}

@keyframes floating-bgm {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* 🛠️ Quantum Blending Overrides */
.director-studio video.frame-breaking-overlay,
.director-studio img.frame-breaking-overlay {
    /* Critical for Screen mode transparency on black backgrounds */
    backface-visibility: hidden;
    perspective: 1000px;
    transform-style: preserve-3d;
}

/* 📱 Studio Responsiveness Overhaul (v43.2) */
@media (max-width: 1200px) {
    .studio-split-view {
        flex-direction: column-reverse !important;
        height: auto !important;
        overflow-y: visible !important;
    }
    .control-room {
        width: 100% !important;
        border-right: none !important;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }
    .director-studio {
        height: 600px !important;
    }
    #engine-v42-container {
        transform: scale(0.8);
    }
}

/* 🎨 Shop Grid Resilience */
.luxury-store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    padding: 40px 20px;
}

/* 🛡️ Header Z-Index Fix */
.imperial-header { 
    z-index: 9999 !important; 
}
.imperial-studio-v42 { 
    position: relative; 
    z-index: 100 !important; 
}

/* 📛 Royal Name Auras (v45.0) */
.royal-name-aura {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 5px 15px;
    isolation: isolate;
    vertical-align: middle;
}
#name-preview-layer {
    background: rgba(168, 85, 247, 0.05);
    border-radius: 8px;
    border: 1px dashed rgba(168, 85, 247, 0.2);
}
