/* Frame-time pass. Loaded last on purpose: every rule here trades a decoration
   that cost GPU time on a mid-range phone for one that does not. The lag the
   owner saw came from three things stacked - a full-screen backdrop blur under
   every popup while infinite animations kept the compositor awake, the board's
   SVG filters being re-rasterised whenever its box-shadow animated, and
   `filter` on things that move. None of that survives this file. */

/* 1. No backdrop blur anywhere. The scrim does the job with opacity. */
.overlay { backdrop-filter: none; -webkit-backdrop-filter: none;
  background: radial-gradient(circle at 50% 42%, rgba(60, 26, 20, .80), rgba(24, 8, 6, .93)); }
.setup-cta { backdrop-filter: none; -webkit-backdrop-filter: none;
  background: linear-gradient(180deg, transparent, rgba(20, 10, 8, .9) 32%, rgba(20, 10, 8, .97)); }
.chat-scrim { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(20, 8, 6, .62); }
.gift-scrim { backdrop-filter: none; -webkit-backdrop-filter: none; }

/* 2. The board: the artwork gets its own composited layer, rasterised once per
   game, and the "your turn" glow moves to a pseudo-element so a turn change
   animates opacity instead of invalidating the filtered SVG underneath. */
.grid { will-change: transform; contain: strict; }
.board { transition: none; }
.board::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  box-shadow: 0 0 16px 2px color-mix(in srgb, var(--pc) 34%, transparent);
  opacity: 0; transition: opacity .5s ease;
}
.board-wrap.is-you .board { box-shadow: 0 2px 0 rgba(255, 236, 200, .16), 0 26px 44px -14px rgba(0, 0, 0, .8), 0 0 0 1px rgba(0, 0, 0, .55); }
.board-wrap.is-you .board::before { opacity: 1; }

/* 3. Nothing that moves carries a filter. */
.pawn::after { filter: none; }
.pawn-render.pawn-cowrie, .pawn-render.pawn-coin { filter: drop-shadow(0 0 1px var(--pc)); }
.setup-preview-piece { filter: none; }
.setup-preview-piece::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: -6px; height: 10px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .55), transparent); z-index: -1; }
@keyframes ico-pulse { 0%, 100% { transform: scale(1); opacity: .88; } 50% { transform: scale(1.07); opacity: 1; } }
.ico-live { filter: none; }
#screen-menu .home-live-ico { box-shadow: inset 0 0 14px rgba(255, 200, 110, .05), 0 3px 10px rgba(20, 6, 4, .26), 0 0 10px rgba(255, 120, 90, .22); }
.tab .tab-ico img.ico, .tab.is-on .tab-ico img.ico { transition-property: transform; }

/* 4. Infinite animations that changed paint properties now change only
   transform or opacity, and the two glossy sheens get a real layer. */
.coach-hole { animation: none; box-shadow: 0 0 0 9999px rgba(14, 6, 4, .68); }
.coach-hole::after { content: ""; position: absolute; inset: -6px; border-radius: 20px; pointer-events: none;
  box-shadow: 0 0 28px 6px rgba(255, 198, 96, .55); animation: holeGlow 2s var(--ease-out) infinite; }
@keyframes holeGlow { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.skeleton-row { animation: none; background: var(--well); position: relative; overflow: hidden; }
.skeleton-row::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 236, 200, .07), transparent);
  animation: sheen 1.6s linear infinite; }
.hero-card::after, .league-badge.lg::after { will-change: transform; }
.hero-card, .league-badge.lg { contain: paint; }
/* a sheen nobody can see (under a popup) should not keep the GPU warm */
body.has-overlay .hero-card::after,
body.has-overlay .league-badge.lg::after,
body.has-overlay .ico-live,
body.has-overlay .ico-turns,
body.has-overlay .ico-bell,
body.has-overlay .ico-shop { animation-play-state: paused; }

/* 5. Screen entry: one rise for the whole column instead of eight layers in one frame. */
.screen.is-active .menu-wrap { animation: riseIn .32s cubic-bezier(.2, .8, .3, 1) both; }
.screen.is-active .menu-wrap > * { animation: none; }

/* 6. Scroll fast paths. */
body { background-attachment: scroll; }
.scroller, .shop-body, .chat-log, .lf-list { overscroll-behavior: contain; }
/* the shop strip: fades are painted by the wrapper, not a mask on the scroller */
#screen-shop .shop-tabs.can-left, #screen-shop .shop-tabs.can-right, #screen-shop .shop-tabs.can-left.can-right { -webkit-mask-image: none; mask-image: none; }
.shop-tabs-wrap { position: relative; }
.shop-tabs-wrap::before, .shop-tabs-wrap::after { content: ""; position: absolute; top: 0; bottom: 6px; width: 52px; pointer-events: none; opacity: 0; transition: opacity .2s ease; z-index: 2; }
.shop-tabs-wrap::before { left: 0; background: linear-gradient(90deg, var(--stage-1) 18%, rgba(93, 35, 32, 0)); }
.shop-tabs-wrap::after { right: 0; background: linear-gradient(270deg, var(--stage-1) 18%, rgba(93, 35, 32, 0)); }
.shop-tabs-wrap.can-left::before, .shop-tabs-wrap.can-right::after { opacity: 1; }

/* the turn timer is driven by transform now (ui.js), not width */
.turn-timer i { width: 100%; transform-origin: 0 50%; transition: transform 1s linear; }
