/* Lunara Forge V13 Mobile Compatibility Layer
   Safe patch: CSS-only mobile refinement. Non tocca home.tpl e non cambia logica CodeIgniter/Smarty. */

/* Tablet / small laptop */
@media (max-width: 1180px){
  html, body{overflow-x:hidden!important;}
  .lunara-forge-page{padding-left:14px!important;padding-right:14px!important;}
  .lunara-shell{grid-template-columns:300px minmax(0,1fr)!important;gap:14px!important;width:100%!important;}
  .navbar{min-height:68px!important;}
  .navbar-brand .navbar-item{width:205px!important;min-height:68px!important;}
  .navbar-brand .navbar-item:before{width:196px!important;height:58px!important;}
  .navbar .navbar-item,.navbar .navbar-link{font-size:11px!important;min-height:68px!important;padding-left:10px!important;padding-right:10px!important;}
  .lunara-hero-panel{min-height:420px!important;}
  .lunara-hero-slide{min-height:420px!important;}
  .lunara-news-grid,.lunara-premium-grid{grid-template-columns:1fr 1fr!important;}
  .lunara-news-featured{grid-column:auto!important;}
  .lunara-live-strip{grid-template-columns:1fr 1fr!important;}
}

/* Mobile main layout */
@media (max-width: 900px){
  body{padding-top:0!important;}
  .lunara-forge-page{padding-top:86px!important;padding-left:10px!important;padding-right:10px!important;padding-bottom:86px!important;}
  .lunara-shell{display:flex!important;flex-direction:column!important;gap:12px!important;}
  .lunara-main-stack{order:1!important;width:100%!important;}
  .lunara-left-stack{order:2!important;width:100%!important;}
  .lunara-card,.lunara-hero-panel,.lunara-tabs-bar,.lunara-news-card,.lunara-ranking-preview,.lunara-bottom-features,.lunara-live-strip,.lunara-premium-grid,.lunara-feature-card,.lunara-v12-world-panel,.lunara-v12-live-card,.lunara-v12-boss-card,.lunara-v12-wiki,.lunara-v12-journey,.lunara-v12-showcase-card{border-radius:12px!important;}

  /* Navbar mobile: logo pulito + menu compatibile Bulma */
  .navbar{min-height:70px!important;padding:0 8px!important;}
  .navbar-brand{width:100%!important;display:flex!important;align-items:center!important;justify-content:space-between!important;}
  .navbar-brand .navbar-item{width:168px!important;min-height:66px!important;}
  .navbar-brand .navbar-item:before{width:160px!important;height:52px!important;background-size:contain!important;}
  .navbar-burger{display:flex!important;align-items:center!important;justify-content:center!important;width:52px!important;height:66px!important;margin-left:auto!important;}
  .navbar-menu{position:absolute!important;top:70px!important;left:8px!important;right:8px!important;max-height:calc(100vh - 92px)!important;overflow:auto!important;background:rgba(3,7,12,.97)!important;border:1px solid rgba(126,226,255,.22)!important;border-radius:0 0 14px 14px!important;box-shadow:0 22px 44px rgba(0,0,0,.72)!important;backdrop-filter:blur(10px)!important;padding:8px!important;}
  .navbar-menu:not(.is-active){display:none!important;}
  .navbar-menu.is-active{display:block!important;}
  .navbar-start,.navbar-end{display:block!important;}
  .navbar .navbar-item,.navbar .navbar-link{min-height:44px!important;display:flex!important;justify-content:flex-start!important;border-bottom:1px solid rgba(126,226,255,.08)!important;font-size:12px!important;padding:10px 14px!important;}
  .navbar .navbar-item:after{display:none!important;}

  /* Hero e sezioni principali */
  .lunara-hero-panel,.lunara-hero-slide{min-height:420px!important;}
  .lunara-hero-caption{left:16px!important;right:16px!important;bottom:18px!important;max-width:none!important;padding:16px!important;}
  .lunara-hero-caption h1,.lunara-hero-caption h2{font-size:30px!important;line-height:1.05!important;}
  .lunara-hero-caption p{font-size:13px!important;line-height:1.45!important;}
  .lunara-hero-caption .button,.lunara-hero-caption a.button{width:100%!important;margin-top:8px!important;}

  .lunara-tabs-bar{display:flex!important;overflow-x:auto!important;white-space:nowrap!important;gap:6px!important;padding:8px!important;scroll-snap-type:x mandatory!important;-webkit-overflow-scrolling:touch!important;}
  .lunara-tabs-bar a,.lunara-tabs-bar label,.lunara-tabs-bar button{flex:0 0 auto!important;scroll-snap-align:start!important;}
  .lunara-tabs-bar::-webkit-scrollbar{height:0!important;}

  .lunara-news-grid,.lunara-premium-grid,.lunara-v12-showcase-grid,.lunara-v12-wiki-grid{display:grid!important;grid-template-columns:1fr!important;gap:12px!important;}
  .lunara-news-card{min-height:auto!important;}
  .lunara-news-image img,.lunara-news-card img{height:auto!important;max-height:230px!important;object-fit:cover!important;}
  .lunara-news-content{padding:14px!important;}

  .lunara-live-strip{grid-template-columns:1fr 1fr!important;gap:8px!important;background:transparent!important;border:0!important;box-shadow:none!important;}
  .lunara-live-strip div{border:1px solid rgba(126,226,255,.16)!important;border-radius:10px!important;background:linear-gradient(180deg,rgba(12,18,25,.92),rgba(3,6,9,.94))!important;padding:12px!important;}

  .lunara-channel-grid,.lunara-v12-live-metrics{grid-template-columns:1fr 1fr!important;}
  .lunara-v12-dashboard-grid{grid-template-columns:1fr!important;}
  .lunara-v12-map-wrap{margin:10px!important;min-height:280px!important;}
  .lunara-v12-map-wrap img{height:300px!important;}
  .lunara-map-info{left:10px!important;right:10px!important;bottom:10px!important;max-width:none!important;padding:12px!important;}
  .lunara-map-pin{width:36px!important;height:36px!important;font-size:13px!important;}
  .lunara-v12-boss-card{grid-template-columns:1fr!important;}
  .lunara-v12-boss-card img{height:190px!important;}
  .lunara-v12-journey-tabs{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important;}
  .lunara-v12-journey-tabs button{width:100%!important;padding:10px 8px!important;font-size:11px!important;}
  .lunara-v12-journey-content{margin:10px!important;padding:14px!important;}

  .lunara-login-card{order:1!important;}
  .lunara-recaptcha-wrap{max-width:100%!important;overflow:hidden!important;}
  .lunara-recaptcha-wrap .g-recaptcha{transform:scale(.88)!important;transform-origin:left top!important;margin-bottom:-8px!important;}
  .lunara-login-actions{display:grid!important;grid-template-columns:1fr!important;gap:9px!important;text-align:center!important;}
  .lunara-btn-primary,.lunara-btn-secondary,.button{min-height:44px!important;touch-action:manipulation!important;}

  .lunara-bottom-features{grid-template-columns:1fr!important;}
  .lunara-card-head{height:auto!important;min-height:48px!important;padding:12px 14px!important;}
  .lunara-card-body{padding:14px!important;}

  /* Effetti più leggeri su mobile */
  .lunara-aurora-layer{opacity:.55!important;}
  .lunara-particles-layer{opacity:.28!important;animation-duration:60s!important;}
  .lunara-fog-layer{opacity:.32!important;height:30vh!important;}
}

/* Phones */
@media (max-width: 560px){
  .lunara-forge-page{padding-top:78px!important;padding-left:8px!important;padding-right:8px!important;}
  .navbar{min-height:64px!important;}
  .navbar-menu{top:64px!important;left:6px!important;right:6px!important;}
  .navbar-brand .navbar-item{width:142px!important;min-height:62px!important;}
  .navbar-brand .navbar-item:before{width:138px!important;height:46px!important;}
  .navbar-burger{height:62px!important;width:48px!important;}

  .lunara-hero-panel,.lunara-hero-slide{min-height:360px!important;}
  .lunara-hero-caption{padding:13px!important;bottom:12px!important;}
  .lunara-hero-caption h1,.lunara-hero-caption h2{font-size:24px!important;}
  .lunara-hero-caption p{font-size:12px!important;max-height:72px!important;overflow:hidden!important;}

  .lunara-live-strip,.lunara-channel-grid,.lunara-v12-live-metrics{grid-template-columns:1fr!important;}
  .lunara-v12-channel-bars label{grid-template-columns:38px 1fr 48px!important;font-size:11px!important;}
  .lunara-v12-map-wrap{min-height:245px!important;}
  .lunara-v12-map-wrap img{height:255px!important;}
  .lunara-map-info{position:relative!important;left:auto!important;right:auto!important;bottom:auto!important;margin:10px!important;}
  .pin-village{left:18%!important;top:25%!important;}.pin-dungeon{left:58%!important;top:28%!important;}.pin-boss{left:72%!important;top:51%!important;}.pin-farm{left:31%!important;top:61%!important;}
  .lunara-v12-section-head{padding:12px!important;}
  .lunara-v12-section-head span{font-size:13px!important;}
  .lunara-v12-wiki-grid a,.lunara-v12-showcase-card{min-height:auto!important;}
  .lunara-v12-wiki-grid img,.lunara-v12-showcase-card img{height:135px!important;}
  .lunara-v12-journey-tabs{grid-template-columns:1fr!important;}
  .lunara-event-banner{height:62px!important;font-size:20px!important;}
  .lunara-event-list li{padding:9px!important;}
  .lunara-stat-list li{font-size:12px!important;}
  .lunara-mobile-dock{display:grid!important;left:8px!important;right:8px!important;bottom:8px!important;}
}

/* Very small devices */
@media (max-width: 380px){
  .lunara-brand .navbar-item:before,.navbar-brand .navbar-item:before{width:124px!important;height:42px!important;}
  .navbar-brand .navbar-item{width:128px!important;}
  .lunara-hero-caption h1,.lunara-hero-caption h2{font-size:21px!important;}
  .lunara-card-head{font-size:12px!important;}
  .lunara-v12-live-metrics div{padding:10px 8px!important;}
  .lunara-v12-live-metrics b{font-size:19px!important;}
}

/* Motion/accessibility */
@media (prefers-reduced-motion: reduce){
  .lunara-particles-layer,.lunara-fog-layer,.lunara-aurora-layer,*{animation-duration:.001ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.001ms!important;}
}
