/* ================================================================
   TABLET (≤920px)
   ================================================================ */
@media (max-width: 920px) {
  .homepage-layout {
    grid-template-columns: 1fr;
  }

  .split-sections {
    grid-template-columns: 1fr;
  }

  .right-sidebar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

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

  .forum-item,
  .forum-item:nth-child(6n),
  .forum-item:nth-child(3n),
  .forum-item:nth-last-child(-n + 3) {
    border-right: 1px solid #252a1f;
    border-bottom: 1px solid #252a1f;
  }

  .forum-item:nth-child(2n) {
    border-right: 0;
  }

  .forum-item:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .hero-overlay {
    padding-left: min(208px, 28vw);
  }

  .hero-shell::after {
    height: 34px;
  }

  .hero-title {
    font-size: clamp(17px, 2.4vw + 8px, 24px);
  }

  .section-header h2 {
    font-size: 24px;
  }

  .mini-card h3 {
    font-size: 18px;
  }

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

  .footer-bottom {
    flex-wrap: wrap;
    gap: 8px;
  }

  .footer-copyright {
    order: 3;
    flex-basis: 100%;
    text-align: center;
  }
}

/* ================================================================
   MOBILE (≤760px)
   ================================================================ */
@media (max-width: 760px) {
  /* --- Base --- */
  .container {
    width: min(1200px, calc(100% - 14px));
  }

  /* ---- HEADER ---- */
  .top-header {
    min-height: 58px;
    padding: 0 10px;
    gap: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  /* Hamburger */
  .mobile-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 2px;
    flex-shrink: 0;
  }

  .mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: #c7df42;
    border-radius: 2px;
    transition: background 0.2s;
  }

  /* Logo — centered */
  .logo {
    flex: 1;
    display: flex;
    justify-content: center;
  }

  .logo-plague,
  .logo-base {
    font-size: 20px;
  }

  .logo-emblem {
    font-size: 46px;
    height: 55px;
    color: #8fa032 !important;
    filter: drop-shadow(0 0 5px rgba(140, 165, 40, 0.5));
  }

  .logo-sub {
    font-size: 7px;
    letter-spacing: 0.22em;
  }

  /* Hide desktop-only elements */
  .social-links {
    display: none;
  }

  .header-actions {
    display: none;
  }

  /* Mobile user icon */
  .mobile-user-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #2b3520;
    background: #121808;
    color: #8f927e;
    flex-shrink: 0;
    overflow: hidden;
  }

  .mobile-user-btn svg {
    width: 20px;
    height: 20px;
    stroke: #8f927e;
  }

  .mobile-user-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
  }

  /* Hide desktop nav, show bottom nav */
  .main-nav {
    display: none;
  }

  /* ---- MOBILE NAV DRAWER ---- */
  .mobile-nav-drawer {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(5, 7, 5, 0.98);
    border-bottom: 1px solid #2b321d;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s ease;
  }

  .mobile-nav-open .mobile-nav-drawer {
    max-height: 420px;
  }

  .mob-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    color: #b0a898;
    font-size: 13px;
    font-family: var(--font-heading, "Teko", Arial, sans-serif);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(40, 46, 26, 0.5);
    transition: background 0.15s, color 0.15s;
  }

  .mob-nav-link:last-child {
    border-bottom: 0;
  }

  .mob-nav-link:hover,
  .mob-nav-link.is-active {
    background: rgba(199, 223, 66, 0.07);
    color: #c7df42;
  }

  .mob-nav-ico {
    font-size: 16px;
    color: #8a9060;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
  }

  /* Hamburger → X animation when open */
  .mobile-nav-open .mobile-menu-btn span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .mobile-nav-open .mobile-menu-btn span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }

  .mobile-nav-open .mobile-menu-btn span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .mobile-menu-btn span {
    transition: transform 0.22s ease, opacity 0.18s ease;
  }

  /* ---- HERO ---- */
  .page-shell::before {
    top: 58px;
    height: min(280px, 75vw);
    max-height: 340px;
    background-position: 18% 10%;
    background-size: auto 130%;
  }

  .page-shell::after {
    background:
      linear-gradient(90deg, #010201, rgba(1, 2, 1, 0.0) 10%, rgba(1, 2, 1, 0.0) 90%, #010201),
      linear-gradient(
        180deg,
        rgba(2, 3, 2, 0.55) 0%,
        transparent 60px,
        rgba(2, 3, 2, 0.10) 200px,
        #0b0b0b calc(58px + min(280px, 75vw)),
        #0b0b0b 100%
      );
  }

  .hero-shell {
    min-height: 0;
    padding-bottom: 20px;
    display: block;
  }

  .hero-shell::after {
    height: 28px;
    transform: none;
    opacity: 1;
  }

  .hero-overlay {
    padding: min(280px, 75vw) 16px 22px;
    max-width: 100%;
    text-align: center;
  }

  .hero-title {
    font-size: clamp(20px, 6.5vw, 28px);
    line-height: 1.15;
    max-width: 100%;
  }

  .hero-lead {
    font-size: 13px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-cta {
    justify-content: center;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
    margin-top: 14px;
  }

  .hero-cta .btn {
    flex: 1;
    text-align: center;
    padding: 0 10px;
    min-width: 0;
    font-size: 11px;
  }

  .hero-dots {
    bottom: 8px;
  }

  /* ---- CONTENT LAYOUT ---- */
  .homepage-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* Sidebar comes first on mobile: Hero → Promo → News */
  .right-sidebar {
    grid-template-columns: 1fr;
    order: -1;
  }

  .left-flow {
    order: 0;
  }

  /* ---- SECTIONS ---- */
  .section-header h2 {
    font-size: 18px;
  }

  .section-header h2::before {
    transform: translateY(-2px);
  }

  .mini-card h3 {
    font-size: 17px;
  }

  .side-title {
    font-size: 18px;
  }

  .cards-row {
    grid-template-columns: 1fr;
  }

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

  .forum-item,
  .forum-item:nth-child(6n),
  .forum-item:nth-child(2n),
  .forum-item:nth-child(3n),
  .forum-item:nth-last-child(-n + 2),
  .forum-item:nth-last-child(-n + 3) {
    border-right: 1px solid #252a1f;
    border-bottom: 1px solid #252a1f;
  }

  .forum-item:nth-child(2n) {
    border-right: 0;
  }

  .forum-item:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .guide-row {
    grid-template-columns: 52px 1fr;
  }

  .guide-thumb {
    width: 52px;
    height: 48px;
  }

  .news-row {
    grid-template-columns: 56px 1fr;
  }

  .news-card .thumb {
    width: 56px;
    height: 48px;
  }

  /* ---- PROMO CARD ---- */
  .side-title {
    font-size: 16px;
  }

  /* ---- FOOTER ---- */
  .site-footer {
    margin-bottom: 64px;
  }

  .footer-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 10px 0;
  }

  .stat-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 3px;
    padding: 8px 6px;
  }

  .stat-icon {
    display: none;
  }

  .stat-value {
    font-size: 18px;
  }

  .stat-label {
    font-size: 9px;
    line-height: 1.3;
    white-space: normal;
    text-align: center;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
  }

  .footer-copyright {
    order: 0;
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }

  /* ---- BOTTOM NAV ---- */
  .mobile-bottom-nav {
    position: fixed;
    z-index: 20;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border-top: 1px solid #2b321d;
    background: rgba(5, 7, 5, 0.97);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.6);
  }

  .mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px 6px;
    color: #6b6e60;
    text-decoration: none;
    transition: color 0.18s, background 0.18s;
  }

  .mobile-bottom-nav a.is-active {
    color: #c7df42;
    background: rgba(199, 223, 66, 0.06);
  }

  .mobile-bottom-nav a:active {
    background: rgba(199, 223, 66, 0.1);
  }

  .mobile-bottom-nav .mob-ico {
    display: block;
    font-size: 18px;
    line-height: 1;
  }

  .mobile-bottom-nav .mob-label {
    display: block;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
  }
}

/* ================================================================
   EXTRA SMALL (≤480px)
   ================================================================ */
@media (max-width: 480px) {
  .forum-grid {
    grid-template-columns: 1fr;
  }

  .forum-item,
  .forum-item:nth-child(6n),
  .forum-item:nth-child(2n),
  .forum-item:nth-child(3n),
  .forum-item:nth-last-child(-n + 2),
  .forum-item:nth-last-child(-n + 3) {
    border-right: 0;
    border-bottom: 1px solid #252a1f;
  }

  .forum-item:last-child {
    border-bottom: 0;
  }

  .hero-cta .btn {
    font-size: 10px;
    padding: 0 8px;
  }

  .footer-stats {
    gap: 3px;
    padding: 8px 0;
  }

  .stat-value {
    font-size: 16px;
  }

  .stat-label {
    font-size: 8px;
  }
}
