/* Structural anchors used by the refactored frontend shell. */
html.gp-core-ready body {
  min-height: 100%;
}

html.gp-core-ready .app-shell {
  isolation: isolate;
}

html.gp-core-ready .modal,
html.gp-core-ready .gift-sheet,
html.gp-core-ready .tonkeeper-sheet,
html.gp-core-ready .gp-sort-sheet {
  transition-timing-function: var(--gp-motion-ease-emphasis) !important;
}

/* Isolate expensive card/grid repaints from global layout updates. */
html.gp-core-ready .gift-grid {
  contain: layout paint style;
}

html.gp-core-ready .gift-card {
  contain: layout paint;
  content-visibility: auto;
  contain-intrinsic-size: clamp(140px, 45vw, 320px) 340px;
}

/* Some Telegram phone webviews render virtualized cards with corrupted strips.
   Disable card content-visibility there to keep painting deterministic. */
html.gp-core-ready.tg-webapp.tg-phone .gift-card {
  content-visibility: visible;
  contain-intrinsic-size: auto;
}

/* Prevent NFT grid flash on reload when Stars/profile tab was active.
   boot-head-init.js sets gp-restoring-stars before first paint;
   stars-section.js removes it once the section is ready to display. */
html.gp-restoring-stars main {
  visibility: hidden !important;
}

/* Keep overlay animations on the compositor where possible. */
html.gp-core-ready .boot-loader,
html.gp-core-ready .modal-overlay,
html.gp-core-ready .gift-sheet-overlay,
html.gp-core-ready .tonkeeper-overlay {
  transform: translateZ(0);
}
