/* Shared Energy artwork, compact discovery controls and purchase sheet. */
#homeView .discovery-energy-balance, #homeView .discovery-search-open-btn { display: none !important; }
@media (max-width: 960px) {
 #homeView .discovery-heading { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#homeView .discovery-energy-balance {
  display: inline-flex !important; align-items: center; gap: 8px; min-height: 44px;
  padding: 4px 5px 4px 8px; border: 1px solid var(--border); border-radius: 24px;
  background: var(--card); color: #ffd449; font: inherit; cursor: pointer;
}
.discovery-energy-balance img { width: 30px; height: 30px; object-fit: contain; }
.discovery-energy-balance strong { font-size: 18px; font-weight: 800; }
.discovery-energy-plus { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; background: var(--surface); }
.discovery-energy-plus svg { display: block; width: 18px; height: 18px; }
#homeView .home-hero { display: block; }
#homeView .home-hero > div:first-child, #homeView .mobile-home-copy { width: 100%; }
#homeView .discovery-title-row { display: flex; justify-content: space-between; width: 100%; }
#homeView .home-toolbar { display: none; }
#homeView .discovery-search-open-label { display: none !important; }
#homeView .mobile-discovery-search-clear-btn { display: none !important; }
#homeView .discovery-search-open-btn, #homeView .discovery-search-open-btn.has-search-value {
  display: inline-flex !important;
  width: 44px !important; min-width: 44px !important; max-width: 44px !important;
  height: 44px !important; padding: 0 !important; justify-content: center !important; border-radius: 50% !important;
}
#homeView .discovery-tab { flex: 0 0 auto !important; min-width: 0 !important; width: auto !important; padding: 8px 10px !important; min-height: 44px !important; font-size: 12px !important; }
#homeView .discovery-tab-icon { width: 17px !important; height: 17px !important; flex-basis: 17px !important; }
#homeView .discovery-tab-label { font-size: 12px !important; }
#homeView .discovery-tabs { min-height: 44px !important; }
}
#dailyCreditsBtn.daily-refill-waiting { background: #fff !important; color: #24212e !important; border-color: #fff !important; opacity: 1 !important; }
.energy-purchase-overlay { position: fixed; inset: 0; display: flex; align-items: flex-end; justify-content: center; background: rgba(5,5,8,.78); opacity: 0; transition: opacity .24s ease; z-index: 25000; }
.energy-purchase-overlay.hidden { display: none; }
.energy-purchase-overlay.is-open { opacity: 1; }
.energy-purchase-sheet { width: 100%; max-width: 640px; max-height: 88dvh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 24px 24px 0 0; overflow: hidden; transform: translateY(100%); transition: transform .24s ease; }
.is-open .energy-purchase-sheet { transform: translateY(0); }
.energy-purchase-head { display: flex; align-items: center; gap: 12px; padding: 20px; flex-shrink: 0; }
.energy-purchase-head > div { flex: 1; }
.energy-purchase-head h2 { font-size: 23px; }
.energy-purchase-head p, .energy-purchase-note { font-size: 12px; color: var(--sub); margin-top: 5px; }
.energy-purchase-close { min-width: 44px; min-height: 44px; background: transparent; border: 0; color: var(--text); font-size: 28px; cursor: pointer; }
.energy-purchase-packs { min-height: 0; overflow-y: auto; padding: 0 20px 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(112px,1fr)); gap: 12px; }
.energy-purchase-pack { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 18px; color: var(--text); font: inherit; cursor: pointer; }
.energy-purchase-pack.selected { border-color: var(--accent); }
.energy-purchase-pack strong { color: #ffd449; font-size: 24px; overflow-wrap: anywhere; }
.energy-purchase-pack > span:last-child { font-size: 12px; color: var(--sub); }
.energy-purchase-badge { color: #ffd449; font-size: 11px; text-align: center; }
.energy-purchase-art { width: 54px; height: 54px; object-fit: contain; }
.energy-purchase-footer { flex-shrink: 0; border-top: 1px solid var(--border); padding: 20px 20px calc(20px + env(safe-area-inset-bottom,0px)); display: grid; gap: 12px; }
.energy-purchase-footer.hidden { display: none; }
.energy-purchase-amount { display: flex; justify-content: center; align-items: center; gap: 10px; }
.energy-purchase-amount .energy-amount { font-size: 36px; font-weight: 800; color: #ffd449; }
.energy-purchase-amount .energy-inline-icon { width: 48px; height: 48px; }
.energy-purchase-amount > span:last-child { font-size: 14px; color: var(--sub); }
.energy-purchase-note { text-align: center; line-height: 18px; }
.energy-purchase-footer > div:empty { display: none; }
body:has(.energy-purchase-overlay.is-open) { overflow: hidden; }
@media (max-width: 960px) {
  #homeView .mobile-home-topbar { min-height: calc(60px + env(safe-area-inset-top,0px)) !important; }
  #homeView .discovery-energy-balance { position: fixed; left: 16px; top: calc(8px + env(safe-area-inset-top,0px)); z-index: 1902; }
  #homeView .discovery-search-open-btn { left: auto !important; right: 16px !important; top: calc(8px + env(safe-area-inset-top,0px)) !important; }
  body.native-app-shell #homeView .discovery-energy-balance, body.capacitor-app #homeView .discovery-energy-balance { position: absolute; }
  body.native-app-shell #homeView .discovery-search-open-btn, body.capacitor-app #homeView .discovery-search-open-btn,
  body.native-app-shell #homeView .discovery-search-open-btn.has-search-value, body.capacitor-app #homeView .discovery-search-open-btn.has-search-value {
    left: auto !important; right: 16px !important; width: 44px !important; min-width: 44px !important; max-width: 44px !important;
    height: 44px !important; top: calc(8px + env(safe-area-inset-top,0px)) !important; padding: 0 !important; justify-content: center !important; border-radius: 50% !important;
  }
  body.native-app-shell #homeView .discovery-search-open-label, body.capacitor-app #homeView .discovery-search-open-label { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .energy-purchase-overlay, .energy-purchase-sheet { transition: none; }
}
