/* Global Text Size & Anti-Aliasing Lock for Perfect Mobile Proportions (iOS & Android) */
html {
  -webkit-text-size-adjust: 100% !important;
  -moz-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
  text-rendering: optimizeLegibility !important;
}
body {
  -webkit-text-size-adjust: 100% !important;
  -moz-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}
*, *::before, *::after {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Telegram Floating Bar Styling for Arab Wrestling */
:root {
  --tg-blue: #24A1DE;
  --tg-blue-hover: #1c8cbd;
  --tg-blue-soft: rgba(36, 161, 222, 0.12);
}

.tg-float-bar {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99990;
  background: var(--card);
  border: 1.5px solid var(--tg-blue);
  border-radius: 20px;
  padding: 18px 22px;
  max-width: 400px;
  width: calc(100% - 48px);
  box-shadow: 0 20px 48px -10px rgba(0, 0, 0, 0.35), 0 0 20px rgba(36, 161, 222, 0.15);
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  font-family: 'Tajawal', sans-serif;
  color: var(--ink);
  direction: rtl;
}

.tg-float-bar.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.tg-close-btn {
  position: absolute;
  top: 14px;
  left: 14px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.tg-close-btn:hover {
  color: var(--ink);
  background: var(--bg);
}

.tg-float-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tg-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--tg-blue);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(36, 161, 222, 0.35);
}

.tg-title {
  font-family: 'Cairo', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
}

.tg-subtitle {
  font-size: 12px;
  font-weight: 700;
  color: var(--tg-blue);
  margin-top: 2px;
}

.tg-float-body {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
}

.tg-float-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.tg-float-btn {
  flex: 1;
  background: linear-gradient(135deg, #24A1DE 0%, #1B83B8 100%);
  color: #ffffff !important;
  border: none;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 6px 18px rgba(36, 161, 222, 0.3);
  font-family: 'Tajawal', sans-serif;
}

.tg-float-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(36, 161, 222, 0.45);
  background: linear-gradient(135deg, #28aae8 0%, #1d8fc9 100%);
}

.tg-float-dismiss {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Tajawal', sans-serif;
}

.tg-float-dismiss:hover {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--bg);
}

@media (max-width: 480px) {
  .tg-float-bar {
    right: 12px;
    left: 12px;
    bottom: 14px;
    width: auto;
    max-width: none;
    padding: 12px 14px;
    border-radius: 16px;
    gap: 9px;
  }
  .tg-close-btn {
    top: 9px;
    left: 9px;
    padding: 2px;
  }
  .tg-float-header {
    gap: 9px;
  }
  .tg-icon-badge {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }
  .tg-icon-badge svg {
    width: 18px;
    height: 18px;
  }
  .tg-title {
    font-size: 14px;
  }
  .tg-subtitle {
    font-size: 11px;
  }
  .tg-float-body {
    font-size: 11.5px;
    line-height: 1.48;
  }
  .tg-float-actions {
    gap: 8px;
    margin-top: 2px;
  }
  .tg-float-btn {
    padding: 8px 14px;
    font-size: 12.5px;
    border-radius: 10px;
  }
  .tg-float-dismiss {
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 10px;
  }
}

/* ===== Site-wide Mobile 2-Column Cards & Proportional Layout ===== */
@media (max-width: 680px) {
  /* Navigation & Header */
  header {
    position: sticky !important;
    top: 0 !important;
  }
  .nav {
    padding: 8px 12px 9px !important;
    gap: 7px !important;
  }
  .brand {
    font-size: 18px !important;
  }
  .brand img.brand-logo {
    width: 28px !important;
    height: 28px !important;
  }
  .site-search {
    height: 35px !important;
    padding: 2px 3px 2px 10px !important;
  }
  .site-search input {
    font-size: 12.5px !important;
    padding: 3px 4px !important;
  }
  .site-search input::placeholder {
    font-size: 12px !important;
  }
  .site-search button {
    width: 29px !important;
    height: 29px !important;
  }
  .site-search button svg {
    width: 14px !important;
    height: 14px !important;
  }
  #navMenu {
    gap: 5px 4px !important;
    padding-top: 2px !important;
  }
  #navMenu a.navlink {
    font-size: 12px !important;
    padding: 5.5px 10px !important;
  }
  #navMenu a.navlink.support-btn {
    font-size: 12px !important;
    padding: 5.5px 12px !important;
  }
  #navMenu a.navlink.support-btn svg {
    width: 13px !important;
    height: 13px !important;
  }
  #navMenu li.utility-row {
    gap: 8px !important;
    margin-top: 2px !important;
  }
  #navMenu .theme-toggle, #navMenu .telegram-btn {
    width: 33px !important;
    height: 33px !important;
  }
  #navMenu .theme-toggle svg, #navMenu .telegram-btn svg {
    width: 15px !important;
    height: 15px !important;
  }

  /* Page & Section Structure */
  section.content {
    padding: 24px 12px 38px !important;
  }
  .wrap {
    padding: 0 !important;
  }
  .section-head {
    margin-bottom: 14px !important;
    gap: 6px !important;
  }
  .section-head h2 {
    font-size: 19px !important;
    letter-spacing: 0 !important;
    gap: 8px !important;
  }
  .section-head p {
    font-size: 12px !important;
    margin-top: 3px !important;
  }
  .page-head {
    padding: 30px 14px 18px !important;
  }
  .page-head h1, .page-head h2 {
    font-size: 20px !important;
    margin-bottom: 4px !important;
  }
  .page-head p {
    font-size: 12px !important;
  }

  /* 2-Column Grid Across All Pages */
  .grid-12 {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .grid-12 > * {
    grid-column: span 1 !important;
  }

  /* Proportional Cards */
  .show-card, .news-card, .series-card {
    border-radius: 14px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 14px -6px rgba(0,0,0,0.08) !important;
    display: block !important;
  }
  .show-thumb, .news-thumb, .series-thumb {
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    width: 100% !important;
    position: relative !important;
    overflow: hidden !important;
  }
  .show-thumb img, .news-thumb img, .series-thumb img {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
  }
  .play-btn {
    width: 36px !important;
    height: 36px !important;
  }
  .play-btn svg {
    width: 15px !important;
    height: 15px !important;
  }
  .show-body, .news-body, .series-body {
    padding: 9px 10px 11px !important;
    display: block !important;
  }
  .kind-badge, .cat, .fed-badge {
    display: inline-flex !important;
    align-items: center !important;
    width: auto !important;
    max-width: fit-content !important;
    font-size: 9.5px !important;
    padding: 2px 7px !important;
    margin-bottom: 5px !important;
    margin-inline-end: 4px !important;
    line-height: 1 !important;
    border-radius: 999px !important;
  }
  .show-body h3, .news-body h3, .series-body h3 {
    font-size: 12.5px !important;
    font-weight: 800 !important;
    line-height: 1.36 !important;
    margin: 2px 0 5px !important;
    display: block !important;
    overflow: visible !important;
    word-break: break-word !important;
  }
  .show-body .desc, .news-body p, .series-body .desc {
    font-size: 10.5px !important;
    line-height: 1.42 !important;
    margin-bottom: 7px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }
  .show-body .foot, .news-body .date, .series-body .foot {
    font-size: 10px !important;
    padding-top: 7px !important;
    margin-top: auto !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    white-space: nowrap !important;
    border-top: 1px solid var(--line) !important;
  }

  /* Federation Cards */
  .feds-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 9px !important;
  }
  .fed-card {
    border-radius: 13px !important;
  }
  .fed-mark {
    height: 68px !important;
    font-size: 20px !important;
  }
  .fed-card .info {
    padding: 8px 10px !important;
  }
  .fed-card .info p {
    font-size: 11px !important;
  }
  .view-all {
    font-size: 12px !important;
    padding: 8px 16px !important;
  }

  /* Tags Cloud */
  .tags-cloud {
    gap: 8px !important;
  }
  .tag-card {
    padding: 8px 14px !important;
    font-size: 13px !important;
    border-radius: 999px !important;
  }
  .tag-badge {
    font-size: 11px !important;
    padding: 1px 7px !important;
  }

  /* Hero Section */
  .hero {
    padding: 44px 16px 36px !important;
  }
  .hero h1, .hero h1.hero-title {
    font-size: clamp(23px, 6.8vw, 30px) !important;
    line-height: 1.28 !important;
    margin-bottom: 12px !important;
  }
  .hero h1.hero-title .u, .hero h1 .u {
    font-size: clamp(18px, 4.8vw, 24px) !important;
    margin-top: 4px !important;
  }
  .hero h1.news-hero-title {
    font-size: 18px !important;
    line-height: 1.35 !important;
  }
  .hero p {
    font-size: 13px !important;
    line-height: 1.5 !important;
    margin-bottom: 20px !important;
  }
  .eyebrow {
    font-size: 11.5px !important;
    padding: 5px 14px !important;
    margin-bottom: 14px !important;
  }
  .cta-row {
    gap: 8px !important;
  }
  .cta-row .btn {
    padding: 10px 16px !important;
    font-size: 13px !important;
  }
  .quicknav {
    margin-top: 24px !important;
    gap: 8px !important;
  }
  .qn {
    padding: 9px 14px !important;
    font-size: 12.5px !important;
    border-radius: 11px !important;
  }

  /* Single Article Post View */
  .post-wrap {
    padding: 22px 14px !important;
  }
  .post-wrap h1, .post-wrap h2 {
    font-size: 18.5px !important;
    line-height: 1.35 !important;
    margin-bottom: 10px !important;
  }
  .post-sub-title {
    font-size: 13.5px !important;
    margin-bottom: 12px !important;
  }
  .post-desc {
    font-size: 13.5px !important;
    line-height: 1.65 !important;
    padding: 12px 14px !important;
    margin-bottom: 18px !important;
    border-radius: 10px !important;
  }
  .server-tabs {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 9px !important;
    margin-bottom: 16px !important;
  }
  .server-tab {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 96px !important;
    min-height: 40px !important;
    font-size: 13.5px !important;
    font-weight: 800 !important;
    padding: 10px 18px !important;
    border-radius: 999px !important;
    text-align: center !important;
    white-space: nowrap !important;
  }
  .quality-notice {
    font-size: 12px !important;
    padding: 9px 12px !important;
    margin-bottom: 14px !important;
    border-radius: 8px !important;
  }
  .quality-grid {
    gap: 8px !important;
  }
  .quality-btn {
    padding: 12px 10px !important;
    border-radius: 12px !important;
    gap: 6px !important;
  }
  .quality-icon {
    width: 32px !important;
    height: 32px !important;
  }
  .quality-icon svg {
    width: 16px !important;
    height: 16px !important;
  }
  .quality-label {
    font-size: 13px !important;
  }
  .quality-sub {
    font-size: 11px !important;
  }
  .download-links {
    padding: 14px 16px !important;
    border-radius: 14px !important;
    margin-bottom: 20px !important;
  }
  .download-links h3 {
    font-size: 14.5px !important;
    margin-bottom: 10px !important;
  }
  .dl-btn {
    padding: 8px 14px !important;
    font-size: 12.5px !important;
  }
  .post-body {
    font-size: 15px !important;
    line-height: 1.8 !important;
  }
  .post-tags {
    gap: 6px !important;
    margin-top: 18px !important;
  }
  .tag-pill {
    font-size: 12px !important;
    padding: 5px 12px !important;
  }
  .back-link {
    font-size: 12.5px !important;
    margin-bottom: 14px !important;
  }
  .post-meta-bar {
    display: flex !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 6px !important;
    margin-bottom: 14px !important;
    font-size: 12px !important;
  }

  /* Pagination */
  .pagination-nav {
    margin-top: 28px !important;
    margin-bottom: 16px !important;
  }
  .pagination-wrap {
    gap: 4px !important;
    padding: 4px 6px !important;
    border-radius: 12px !important;
  }
  .page-link {
    min-width: 32px !important;
    height: 32px !important;
    padding: 0 8px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
  }
  .page-link.prev, .page-link.next {
    padding: 0 10px !important;
    font-size: 11.5px !important;
  }
  .page-ellipsis {
    min-width: 18px !important;
    height: 32px !important;
    font-size: 12px !important;
  }
}

@media (max-width: 415px) {
  section.content {
    padding: 20px 8px 32px !important;
  }
  .grid-12 {
    gap: 8px !important;
  }
  .show-body, .news-body, .series-body {
    padding: 8px 8px 10px !important;
  }
  .show-body h3, .news-body h3, .series-body h3 {
    font-size: 12px !important;
    line-height: 1.35 !important;
  }
  .show-body .desc, .news-body p, .series-body .desc {
    font-size: 10px !important;
    line-height: 1.4 !important;
  }
  .kind-badge, .cat, .fed-badge {
    font-size: 9px !important;
    padding: 2px 6px !important;
  }
  .show-body .foot, .news-body .date, .series-body .foot {
    font-size: 9.5px !important;
    padding-top: 6px !important;
  }
  .nav {
    padding: 6px 8px 7px !important;
    gap: 5px !important;
  }
  .brand {
    font-size: 16.5px !important;
  }
  #navMenu a.navlink {
    font-size: 11px !important;
    padding: 4.5px 7px !important;
  }
}

/* ==========================================================================
   Global Overflow Protection & Fluid Desktop Navbar (720p, Laptops, 2K & 4K)
   ========================================================================== */
html, body {
  overflow-x: clip !important;
  max-width: 100vw;
}

/* Sticky Desktop Header (Web Only - min-width: 769px) */
@media (min-width: 769px) {
  header {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    background: var(--bg) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid var(--line) !important;
    box-shadow: 0 4px 20px -6px rgba(0, 0, 0, 0.08) !important;
  }
}

/* Fluid Desktop Navbar Scaling for screens between 1151px and 1580px (1366x768, 1440x900, 1536x864) */
@media (min-width: 1151px) and (max-width: 1580px) {
  .nav {
    max-width: 100% !important;
    padding: 12px 16px !important;
    gap: clamp(8px, 1.2vw, 14px) !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
  }
  .brand {
    font-size: 19.5px !important;
    gap: 7px !important;
    flex-shrink: 0 !important;
  }
  .brand img.brand-logo {
    width: 34px !important;
    height: 34px !important;
  }
  .site-search {
    flex: 0 1 240px !important;
    width: 240px !important;
    min-width: 160px !important;
    max-width: 260px !important;
    padding: 4px 6px 4px 12px !important;
  }
  .site-search input {
    font-size: 13px !important;
    padding: 4px 4px !important;
  }
  .site-search button {
    width: 32px !important;
    height: 32px !important;
  }
  .site-search button svg {
    width: 15px !important;
    height: 15px !important;
  }
  #navMenu {
    gap: clamp(2px, 0.35vw, 4px) !important;
    flex-shrink: 0 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
  }
  #navMenu li {
    display: inline-flex !important;
    flex-shrink: 0 !important;
  }
  #navMenu a.navlink {
    font-size: 13.5px !important;
    padding: 7px 11px !important;
    white-space: nowrap !important;
  }
  #navMenu a.navlink.support-btn {
    font-size: 13px !important;
    padding: 7px 13px !important;
    gap: 6px !important;
  }
  #navMenu a.navlink.support-btn svg {
    width: 14px !important;
    height: 14px !important;
  }
  .utility-row {
    gap: 6px !important;
    display: inline-flex !important;
    flex-wrap: nowrap !important;
  }
  .theme-toggle, .telegram-btn, .bookmarks-btn {
    width: 36px !important;
    height: 36px !important;
    flex-shrink: 0 !important;
  }
  .theme-toggle svg, .telegram-btn svg, .bookmarks-btn svg {
    width: 16px !important;
    height: 16px !important;
  }
}

/* Extra Fine-Tuned Scaling for 720p / 1280px / 1366px screens (1151px - 1340px) */
@media (min-width: 1151px) and (max-width: 1340px) {
  .nav {
    padding: 10px 12px !important;
    gap: 8px !important;
  }
  .brand {
    font-size: 18px !important;
    gap: 6px !important;
  }
  .brand img.brand-logo {
    width: 30px !important;
    height: 30px !important;
  }
  .site-search {
    flex: 0 1 185px !important;
    width: 185px !important;
    min-width: 140px !important;
    max-width: 200px !important;
    padding: 3px 5px 3px 10px !important;
  }
  .site-search input {
    font-size: 12.5px !important;
  }
  .site-search input::placeholder {
    font-size: 12px !important;
  }
  .site-search button {
    width: 28px !important;
    height: 28px !important;
  }
  .site-search button svg {
    width: 14px !important;
    height: 14px !important;
  }
  #navMenu {
    gap: 2px !important;
  }
  #navMenu a.navlink {
    font-size: 12.5px !important;
    padding: 6px 8px !important;
  }
  #navMenu a.navlink.support-btn {
    font-size: 12px !important;
    padding: 6px 10px !important;
    gap: 5px !important;
  }
  #navMenu a.navlink.support-btn svg {
    width: 13px !important;
    height: 13px !important;
  }
  .utility-row {
    gap: 5px !important;
  }
  .theme-toggle, .telegram-btn, .bookmarks-btn {
    width: 33px !important;
    height: 33px !important;
  }
  .theme-toggle svg, .telegram-btn svg, .bookmarks-btn svg {
    width: 15px !important;
    height: 15px !important;
  }
}

/* Hero Section Proportional Adaptation for 720p / Laptops */
@media (max-width: 1366px) {
  .hero {
    padding: clamp(55px, 8vh, 95px) 20px clamp(40px, 6vh, 75px) !important;
  }
  .eyebrow {
    margin-bottom: 18px !important;
    padding: 6px 15px !important;
    font-size: 12.5px !important;
  }
  .hero h1 {
    font-size: clamp(30px, 3.8vw, 48px) !important;
    margin-bottom: 16px !important;
    line-height: 1.22 !important;
  }
  .hero p {
    font-size: 15.5px !important;
    margin-bottom: 24px !important;
  }
  .cta-row {
    gap: 12px !important;
  }
  .cta-row .btn {
    padding: 11px 22px !important;
    font-size: 14px !important;
  }
  .quicknav {
    margin-top: 30px !important;
    gap: 10px !important;
  }
  .qn {
    padding: 10px 16px !important;
    font-size: 13px !important;
  }
}

