/* Android WebView performance layer. Keeps layout/classes intact, reduces GPU-heavy effects on old phones. */
body.afcc-native-android,
body.afcc-native-android .afcc-shell{
  background:#04131c!important;
}

body.afcc-native-android .afcc-shell:before,
body.afcc-native-android .afcc-shell::before{
  position:absolute!important;
  background:linear-gradient(180deg,#04131c 0%,#052634 48%,#031018 100%)!important;
  filter:none!important;
}

body.afcc-native-android *,
body.afcc-native-android *::before,
body.afcc-native-android *::after{
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
  text-shadow:none!important;
  scroll-behavior:auto!important;
}

body.afcc-native-android .afcc-panel,
body.afcc-native-android .afcc-fish-card,
body.afcc-native-android .afcc-gateway-card,
body.afcc-native-android .afcc-category-tab,
body.afcc-native-android .afcc-result-panel,
body.afcc-native-android .afcc-step-block,
body.afcc-native-android .afcc-modal{
  box-shadow:0 8px 18px rgba(0,0,0,.22)!important;
}

body.afcc-native-android .afcc-fish-card,
body.afcc-native-android .afcc-category-tab,
body.afcc-native-android .afcc-gateway-card,
body.afcc-native-android .afcc-plant-detail-card{
  contain:layout paint;
  content-visibility:auto;
  contain-intrinsic-size:220px;
}

body.afcc-native-android img{
  -webkit-transform:translateZ(0);
  transform:translateZ(0);
}

@media (hover:none){
  body.afcc-native-android .afcc-fish-card:hover,
  body.afcc-native-android .afcc-gateway-card:hover,
  body.afcc-native-android .afcc-category-tab:hover,
  body.afcc-native-android .afcc-btn:hover{
    transform:none!important;
  }
}

@media (max-width:760px){
  body.afcc-native-android *,
  body.afcc-native-android *::before,
  body.afcc-native-android *::after{
    animation:none!important;
    transition-duration:.08s!important;
  }

  body.afcc-native-android .afcc-fish-card__art,
  body.afcc-native-android .afcc-modal-fish,
  body.afcc-native-android .afcc-empty-aquarium__bubble,
  body.afcc-native-android .afcc-ui-icon-img{
    filter:none!important;
  }
}


/* v167: direct gateway views without scroll hunting */
html.afcc-focus-fish #catalog > .afcc-section__head,
html.afcc-focus-plants #catalog > .afcc-section__head,
html.afcc-focus-inverts #catalog > .afcc-section__head {
  display: none !important;
}

html.afcc-focus-fish #catalog #plantCatalog,
html.afcc-focus-fish #catalog #invertCatalog {
  display: none !important;
}

html.afcc-focus-plants #catalog > .afcc-toolbar--catalog,
html.afcc-focus-plants #catalog > .afcc-catalog-row-head,
html.afcc-focus-plants #catalog #categoryTabs,
html.afcc-focus-plants #catalog #fishGrid,
html.afcc-focus-plants #catalog #invertCatalog {
  display: none !important;
}

html.afcc-focus-inverts #catalog > .afcc-toolbar--catalog,
html.afcc-focus-inverts #catalog > .afcc-catalog-row-head,
html.afcc-focus-inverts #catalog #categoryTabs,
html.afcc-focus-inverts #catalog #fishGrid,
html.afcc-focus-inverts #catalog #plantCatalog {
  display: none !important;
}

html.afcc-focus-fish #catalog > .afcc-toolbar--catalog,
html.afcc-focus-plants #catalog #plantCatalog,
html.afcc-focus-inverts #catalog #invertCatalog {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

html.afcc-focus-plants #catalog .afcc-toolbar--plants,
html.afcc-focus-inverts #catalog .afcc-toolbar--invert {
  margin-top: 0 !important;
}

/* v168: hide catalog footer only in direct gateway catalog screens; stretch info cards on Android */
html.afcc-focus-fish #catalog > .afcc-universal-footer[data-afcc-final-info="true"],
html.afcc-focus-plants #catalog > .afcc-universal-footer[data-afcc-final-info="true"],
html.afcc-focus-inverts #catalog > .afcc-universal-footer[data-afcc-final-info="true"]{
  display:none!important;
}

@media (max-width:760px){
  body.afcc-native-android #info{
    padding-left:0!important;
    padding-right:0!important;
  }
  body.afcc-native-android #info > .afcc-section__head{
    padding-left:16px!important;
    padding-right:16px!important;
  }
  body.afcc-native-android #info .afcc-info-stack,
  body.afcc-native-android #info .afcc-panel--presets-info,
  body.afcc-native-android #info #presetGrid,
  body.afcc-native-android #info .afcc-preset-card{
    width:100%!important;
    max-width:none!important;
  }
  body.afcc-native-android #info .afcc-info-stack{
    margin-left:0!important;
    margin-right:0!important;
  }
  body.afcc-native-android #info .afcc-panel--presets-info{
    margin-left:0!important;
    margin-right:0!important;
    padding-left:12px!important;
    padding-right:12px!important;
    border-radius:0!important;
  }
  body.afcc-native-android #info #presetGrid.afcc-card-grid{
    padding-left:0!important;
    padding-right:0!important;
    grid-template-columns:1fr!important;
  }
}

/* v170: info tab — remove side gaps around preset cards, keep rounded card frame */
@media (max-width:760px){
  body.afcc-native-android #info #presetGrid.afcc-card-grid{
    width:100vw!important;
    max-width:100vw!important;
    margin-left:calc(50% - 50vw)!important;
    margin-right:calc(50% - 50vw)!important;
    padding-left:0!important;
    padding-right:0!important;
    grid-template-columns:1fr!important;
    overflow:visible!important;
  }

  body.afcc-native-android #info .afcc-preset-card{
    width:100%!important;
    max-width:none!important;
    margin-left:0!important;
    margin-right:0!important;
    border-radius:22px!important;
    overflow:hidden!important;
    border-left:1px solid rgba(170,232,255,.16)!important;
    border-right:1px solid rgba(170,232,255,.16)!important;
    box-shadow:0 16px 38px rgba(0,0,0,.22),inset 0 1px 0 rgba(255,255,255,.05)!important;
  }
}


/* v171: info tab — remove presets intro block and remove footer frame only on info screen */
@media (max-width:760px){
  body.afcc-native-android #info .afcc-panel--presets-info{
    background:transparent!important;
    border:0!important;
    box-shadow:none!important;
    padding:0!important;
    border-radius:0!important;
  }

  body.afcc-native-android #info .afcc-panel--presets-info > .afcc-section__head--inline{
    display:none!important;
  }

  body.afcc-native-android #info .afcc-universal-footer__inner{
    border:0!important;
    border-left:0!important;
    box-shadow:none!important;
  }
}


/* v173: Android WebView aquarium background — fixed GPU layer, no scroll repaint */
body.afcc-native-android,
body.afcc-native-android .afcc-shell{
  background:#04131c!important;
}

body.afcc-native-android .afcc-shell{
  position:relative!important;
  isolation:isolate!important;
  overflow:hidden!important;
}

body.afcc-native-android .afcc-shell::before{
  content:""!important;
  position:fixed!important;
  inset:-1px!important;
  z-index:-3!important;
  pointer-events:none!important;
  background-image:
    linear-gradient(180deg,rgba(2,14,20,.32) 0%,rgba(2,14,20,.20) 34%,rgba(2,10,15,.46) 72%,rgba(1,6,10,.78) 100%),
    url("../img/aquarium-webview-bg.webp")!important;
  background-size:cover!important;
  background-position:center center!important;
  background-repeat:no-repeat!important;
  opacity:.92!important;
  filter:none!important;
  -webkit-transform:translate3d(0,0,0)!important;
  transform:translate3d(0,0,0)!important;
  -webkit-backface-visibility:hidden!important;
  backface-visibility:hidden!important;
  will-change:transform!important;
  contain:strict!important;
}

body.afcc-native-android .afcc-shell::after{
  content:""!important;
  position:fixed!important;
  inset:0!important;
  z-index:-2!important;
  pointer-events:none!important;
  background:
    radial-gradient(circle at 50% 6%,rgba(175,248,255,.12),transparent 25%),
    linear-gradient(180deg,rgba(2,13,19,.10),rgba(2,13,19,.22) 52%,rgba(1,7,11,.50) 100%)!important;
  filter:none!important;
  -webkit-transform:translate3d(0,0,0)!important;
  transform:translate3d(0,0,0)!important;
  contain:strict!important;
}

body.afcc-native-android .afcc-panel,
body.afcc-native-android .afcc-fish-card,
body.afcc-native-android .afcc-gateway-card,
body.afcc-native-android .afcc-category-tab,
body.afcc-native-android .afcc-result-panel,
body.afcc-native-android .afcc-step-block,
body.afcc-native-android .afcc-plant-detail-card,
body.afcc-native-android .afcc-modal{
  background-color:rgba(4,19,28,.82)!important;
}

body.afcc-native-android .afcc-fish-card,
body.afcc-native-android .afcc-gateway-card,
body.afcc-native-android .afcc-category-tab,
body.afcc-native-android .afcc-panel,
body.afcc-native-android .afcc-result-panel{
  border-color:rgba(127,229,255,.24)!important;
}

@media (max-width:760px){
  body.afcc-native-android .afcc-shell::before{
    background-position:center center!important;
    opacity:.88!important;
  }
}

body.afcc-native-android .afcc-app-main,
body.afcc-native-android .afcc-screen{
  background:transparent!important;
}


/* v174-site-nav: restore web bottom navigation on the website version only.
   Android app uses native bottom nav, but the website must keep this HTML nav visible. */
html body:not(.afcc-native-android) .afcc-bottom-nav{
  display:grid!important;
  visibility:visible!important;
  pointer-events:auto!important;
  position:fixed!important;
  left:50%!important;
  right:auto!important;
  bottom:calc(env(safe-area-inset-bottom,0px) + 14px)!important;
  z-index:2147483647!important;
  transform:translateX(-50%)!important;
  grid-template-columns:repeat(4,minmax(72px,1fr))!important;
  gap:8px!important;
  width:min(560px,calc(100% - 24px))!important;
  max-width:calc(100% - 24px)!important;
  margin:0!important;
  padding:8px!important;
  border-radius:24px!important;
  background:rgba(3,20,31,.92)!important;
  border:1px solid rgba(107,222,255,.22)!important;
  box-shadow:0 18px 42px rgba(0,0,0,.34),inset 0 1px 0 rgba(255,255,255,.06)!important;
  -webkit-backdrop-filter:blur(16px)!important;
  backdrop-filter:blur(16px)!important;
}

html body:not(.afcc-native-android) .afcc-bottom-nav button{
  display:grid!important;
  visibility:visible!important;
  pointer-events:auto!important;
}

html body:not(.afcc-native-android){
  padding-bottom:104px!important;
}

html body:not(.afcc-native-android) .afcc-app-main,
html body:not(.afcc-native-android) .afcc-footer{
  padding-bottom:104px!important;
}

html body:not(.afcc-native-android) .afcc-fab-check{
  display:none!important;
}
