/* Ultimate Stars stylesheet 9.
   Original style id: us-runtime-performance-v46.
   Keep file order stable unless you are intentionally changing the cascade. */
  html, body { -webkit-text-size-adjust: 100%; }

  #homeScreen .menu-card .menu-card-bg,
  #homeScreen .home-task-panel img,
  #packshopScreen img,
  #packOpeningView img,
  #playerBattleDeck img,
  #myCardsGrid img {
    transform: none;
  }

  #playerBattleDeck .battle-hand-card,
  #playerBattleDeck .game-card,
  #myCardsGrid .game-card,
  #packOpeningView .opening-pack-button,
  #packOpeningView .cinematic-reveal-card-wrap {
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent;
  }

  /* Mobile/tablet: keep the same layout, but remove the repaint-heavy effects that made scrolling and taps feel delayed. */
  @media (max-width: 1180px), (hover: none), (pointer: coarse) {
    body::before,
    body::after {
      display: none !important;
    }

    .panel,
    .hero-card,
    .menu-card,
    .modal-shell,
    .home-task-panel,
    #myCardsModal .modal-shell,
    #packOpeningView,
    #us26QuestModal,
    #ultimateStarsDisplayNameModal,
    #us23SurrenderOverlay {
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
    }

    .panel,
    .hero-card,
    .menu-card,
    .modal-shell,
    .home-task-panel {
      box-shadow: 0 10px 24px rgba(0,0,0,.24) !important;
    }

    .menu-card::before,
    .menu-card::after,
    .hero-card::after,
    .deck-status-card::after,
    .deck-metric-card::after {
      filter: none !important;
      animation: none !important;
    }

    .us26-quest-grid .task-card {
      content-visibility: visible !important;
      contain-intrinsic-size: auto !important;
    }

    #myCardsModal .collection-list,
    #allCardsGrid,
    #myCardsGrid,
    #packshopScreen,
    #homeScreen,
    #playScreen,
    #battleScreen {
      -webkit-overflow-scrolling: touch;
      overscroll-behavior: contain;
    }

    #myCardsGrid .game-card,
    #allCardsGrid .game-card,
    #playerBattleDeck .game-card,
    #playerBattleDeck .battle-hand-card {
      transition: opacity .08s linear, transform .08s linear !important;
      will-change: auto !important;
      filter: none !important;
    }

    #myCardsGrid .card-art img,
    #allCardsGrid .card-art img,
    #playerBattleDeck .card-art img,
    #battleScreen .card-art img {
      filter: drop-shadow(0 5px 8px rgba(0,0,0,.20)) !important;
    }

    #playerBattleDeck .battle-hand-card:active,
    #myCardsGrid .game-card:active,
    #packOpeningView .opening-pack-button:active,
    #packOpeningView .cinematic-reveal-card-wrap.is-current:active {
      transform: scale(.985) !important;
    }

    /* Packopening lite mode: same flow, much less GPU/CPU work on phones/tablets. */
    #packOpeningView.cinematic-opening,
    #packOpeningView.cinematic-opening.screen-shake,
    #packOpeningView.cinematic-opening.screen-shake-strong {
      animation: none !important;
      transform: none !important;
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
    }

    #packOpeningView.cinematic-opening::before,
    #packOpeningView.cinematic-opening::after,
    #packOpeningView .cinematic-particle,
    #packOpeningView .cinematic-light-splinter,
    #packOpeningView .cinematic-release-flash,
    #packOpeningView .opening-pack-button.cinematic-pack::before,
    #packOpeningView .opening-pack-button.cinematic-pack::after {
      display: none !important;
      animation: none !important;
    }

    #packOpeningView.cinematic-opening .pack-opening-stage {
      transform: none !important;
      perspective: none !important;
    }

    #packOpeningView .opening-pack-button.cinematic-pack,
    #packOpeningView #openingPackBtn {
      transition: transform .08s linear, opacity .08s linear !important;
      filter: none !important;
      box-shadow: 0 12px 24px rgba(0,0,0,.26) !important;
      pointer-events: auto !important;
      z-index: 250 !important;
    }

    #packOpeningView .opening-pack-button.cinematic-pack.press-1,
    #packOpeningView .opening-pack-button.cinematic-pack.press-2,
    #packOpeningView .opening-pack-button.cinematic-pack.press-3,
    #packOpeningView .opening-pack-button.cinematic-pack.press-4,
    #packOpeningView .opening-pack-button.cinematic-pack.press-5,
    #packOpeningView .opening-pack-button.cinematic-pack.press-6 {
      transform: scale(1.04) !important;
    }

    #packOpeningView .cinematic-reveal-card-wrap,
    #packOpeningView .cinematic-reveal-card-wrap.is-current,
    #packOpeningView .cinematic-reveal-card-wrap.rarity-icon.is-current,
    #packOpeningView .cinematic-reveal-card-wrap.rarity-star.is-current,
    #packOpeningView .cinematic-reveal-card-wrap.rarity-evolution.is-current {
      animation: none !important;
      transition: transform .08s linear, opacity .08s linear !important;
      filter: none !important;
      box-shadow: none !important;
    }

    #packOpeningView .cinematic-reveal-card-wrap.is-current {
      pointer-events: auto !important;
      z-index: 320 !important;
    }

    #packOpeningView .pulled-cards.cinematic-card-stack.has-reveal-cards {
      pointer-events: auto !important;
    }
  }
