/* IRONCORE product surfaces. Explicit section scopes keep game scenes untouched. */
#screen:is([data-section="shop"],[data-section="top"],[data-section="bonuses"],[data-section="other"],[data-section="catalogue"],[data-section="inventory"],[data-section="investments"],[data-section="referral"],[data-section="gifts"],[data-section="wallet"],[data-section="settings"],[data-section="currency"]),
#profile {
  --product-surface: #1b2027;
  --product-raised: #242a32;
  --product-border: #41444a;
  --product-copy: #f0ede6;
  --product-muted: #b3b5ba;
  --product-gold: #dfbe83;
  --muted: #aeb2bb;
  --panel: #1b2027;
  --panel2: #242a32;
  --line: #393e47;
  --text: #f0ede6;
  --gold: #dfbe83;
  color: var(--product-copy);
  background: #11151b;
}
body.light #screen:is([data-section="shop"],[data-section="top"],[data-section="bonuses"],[data-section="other"],[data-section="catalogue"],[data-section="inventory"],[data-section="investments"],[data-section="referral"],[data-section="gifts"],[data-section="wallet"],[data-section="settings"],[data-section="currency"]),
body.light #profile {
  --product-surface: #fffdfa;
  --product-raised: #f0eadd;
  --product-border: #d4c8b3;
  --product-copy: #292b2e;
  --product-muted: #62656a;
  --product-gold: #805c27;
  --muted: #62656a;
  --panel: #fffdfa;
  --panel2: #f0eadd;
  --line: #d4c8b3;
  --text: #292b2e;
  --gold: #805c27;
  background: #f3efe7;
}
/* The exchange stylesheet previously forces a blue backdrop on these menus. */
#screen:is([data-section="other"],[data-section="catalogue"],[data-section="investments"]):is([data-section="other"],[data-section="catalogue"],:has([data-p2p-root])) { background: #11151b !important; }
body.light #screen:is([data-section="other"],[data-section="catalogue"],[data-section="investments"]):is([data-section="other"],[data-section="catalogue"],:has([data-p2p-root])) { background: #f3efe7 !important; }
#screen:is([data-section="shop"],[data-section="top"],[data-section="bonuses"],[data-section="other"],[data-section="catalogue"],[data-section="inventory"],[data-section="investments"],[data-section="referral"],[data-section="gifts"],[data-section="wallet"],[data-section="settings"],[data-section="currency"]) > .screen-head {
  grid-template-columns: 44px minmax(0,1fr);
  gap: 2px 11px;
  padding: max(9px,env(safe-area-inset-top)) 16px 10px;
  background: var(--bg);
  border-bottom-color: var(--product-border);
}
#screen:is([data-section="shop"],[data-section="top"],[data-section="bonuses"],[data-section="other"],[data-section="catalogue"],[data-section="inventory"],[data-section="investments"],[data-section="referral"],[data-section="gifts"],[data-section="wallet"],[data-section="settings"],[data-section="currency"]) > .screen-head #back {
  grid-row: 1 / 3;
  width: 44px;
  min-height: 44px;
  border-color: var(--product-border);
  background: var(--product-surface);
}
#screen:is([data-section="shop"],[data-section="top"],[data-section="bonuses"],[data-section="other"],[data-section="catalogue"],[data-section="inventory"],[data-section="investments"],[data-section="referral"],[data-section="gifts"],[data-section="wallet"],[data-section="settings"],[data-section="currency"]) > .screen-head h2 {
  font: 750 21px/1.25 system-ui,-apple-system,Segoe UI,sans-serif;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}
#screen:is([data-section="shop"],[data-section="top"],[data-section="bonuses"],[data-section="other"],[data-section="catalogue"],[data-section="inventory"],[data-section="investments"],[data-section="referral"],[data-section="gifts"],[data-section="wallet"],[data-section="settings"],[data-section="currency"]) > #screen-body {
  padding: 16px 16px calc(24px + var(--iron-bottom-nav-space));
}
#screen:is([data-section="shop"],[data-section="wallet"],[data-section="inventory"],[data-section="bonuses"]) .tabs {
  gap: 4px;
  padding: 4px;
  background: var(--product-raised);
  border: 1px solid var(--product-border);
  border-radius: 13px;
}
#screen:is([data-section="shop"],[data-section="wallet"],[data-section="inventory"],[data-section="bonuses"]) .tabs button {
  min-height: 44px;
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--product-muted);
}
#screen:is([data-section="shop"],[data-section="wallet"],[data-section="inventory"],[data-section="bonuses"]) .tabs :is(button.selected,button[aria-pressed="true"]) {
  background: var(--product-surface);
  color: var(--product-gold);
  border-color: #b7955855;
  box-shadow: 0 2px 5px #0002;
}

/* Shop: artwork and price remain prominent without oversized empty cards. */
#screen[data-section="shop"] .compact-category { margin-bottom: 12px; }
#screen[data-section="shop"] .category-trigger {
  min-height: 48px;
  padding: 12px 14px;
  background: linear-gradient(110deg,var(--product-raised),var(--product-surface));
  border-color: #b795587d;
  color: var(--product-gold);
  font-size: 14px;
  box-shadow: inset 0 1px #ffffff09;
}
#screen[data-section="shop"] .category-options {
  padding: 6px;
  background: var(--product-surface);
  border-color: #b795587d;
}
#screen[data-section="shop"] .category-options [role="option"] { min-height: 46px; }
#screen[data-section="shop"] .equipment-tabs { margin-bottom: 12px; }
#screen[data-section="shop"] :is(.d1-equipment,.d1-auto,.d1-business-row,.d1-storage,.cosmetic-product) {
  border-color: var(--product-border);
  background: linear-gradient(125deg,var(--product-raised),var(--product-surface) 70%);
  color: var(--product-copy);
  box-shadow: inset 0 1px #ffffff08,0 3px 10px #0002;
}
#screen[data-section="shop"] .d1-equipment {
  grid-template-columns: 92px minmax(0,1fr);
  gap: 6px 12px;
  min-height: 128px;
  padding: 12px;
  margin: 0 0 10px;
}
#screen[data-section="shop"] .d1-equipment::before { display: none; }
#screen[data-section="shop"] .d1-equipment > .equipment-icon {
  width: 92px;
  height: 96px;
  filter: drop-shadow(0 3px 5px #0004);
}
#screen[data-section="shop"] :is(.d1-equipment,.d1-auto) h3,
#screen[data-section="shop"] :is(.d1-business-name,.cosmetic-product-heading h3) {
  font: 700 15px/1.3 system-ui,-apple-system,Segoe UI,sans-serif;
  color: var(--product-copy);
  letter-spacing: -.015em;
  text-shadow: none;
  margin: 0 0 5px;
}
#screen[data-section="shop"] .d1-equipment .level { font-size: 10px; color: var(--product-muted); }
#screen[data-section="shop"] :is(.d1-equipment,.d1-auto) .income { font: 11px/1.5 system-ui; color: var(--product-muted); }
#screen[data-section="shop"] :is(.d1-equipment,.d1-auto) .purchase button {
  min-height: 44px;
  padding: 10px 12px;
  font: 750 12px/1.3 system-ui;
  border-radius: 10px;
  box-shadow: inset 0 1px #fff3;
}
#screen[data-section="shop"] .equipment-information > summary { width: 36px; height: 36px; }
#screen[data-section="shop"] .equipment-information[open] > div { padding-top: 12px; line-height: 1.5; }
#screen[data-section="shop"] #screen-body > .d1-auto { grid-template-columns: 104px minmax(0,1fr); min-height: 144px; margin: 10px 0; }
#screen[data-section="shop"] .d1-auto > .d1-product-art { width: 104px; height: 104px; }
#screen[data-section="shop"] .d1-auto > .purchase { flex-wrap: wrap; gap: 8px; padding-bottom: 12px; }
#screen[data-section="shop"] :is(.d1-product-info,.d1-section-info) { padding: 10px 12px; font-size: 12px; line-height: 1.5; color: var(--product-muted); }
#screen[data-section="shop"] :is(.d1-product-info,.d1-section-info) summary { min-height: 24px; color: var(--product-gold); }
#screen[data-section="shop"] .d1-storage { padding: 14px; gap: 10px; }
#screen[data-section="shop"] .d1-storage > button { min-height: 44px; }
#screen[data-section="shop"] .d1-storage :is(.storage-status,.storage-amount small,.storage-summary) { font-size: 11px; line-height: 1.5; }
#screen[data-section="shop"] .cosmetics-grid { gap: 14px; }
#screen[data-section="shop"] .cosmetic-product { padding: 12px; }
#screen[data-section="shop"] .cosmetic-preview,
.cosmetic-dialog .cosmetic-preview {
  min-height: 214px;
  padding: 54px 16px 20px;
  border-radius: 12px;
}
#screen[data-section="shop"] .cosmetic-preview .avatar,
.cosmetic-dialog .cosmetic-preview .avatar { width: 66px; height: 66px; min-width: 66px; min-height: 66px; }
#screen[data-section="shop"] .preview-person,
.cosmetic-dialog .preview-person { gap: 18px; }
#screen[data-section="shop"] .preview-stats,
.cosmetic-dialog .preview-stats { gap: 8px; margin-top: 18px; }
#screen[data-section="shop"] .cosmetic-product-heading { margin: 14px 0 10px; gap: 5px 10px; }
#screen[data-section="shop"] .cosmetic-purchase { gap: 10px; }
#screen[data-section="shop"] .cosmetic-purchase strong { font-size: 14px; }

/* Bonus catalogue: readable summaries, compact illustrations, reachable actions. */
#screen[data-section="bonuses"] .reward-list .bonus-hub { gap: 12px; }
#screen[data-section="bonuses"] .reward-list .bonus-hub-card {
  grid-template-columns: 86px minmax(0,1fr);
  column-gap: 12px;
  row-gap: 7px;
  padding: 16px 14px;
  min-height: 158px;
  border-radius: 16px;
  border-color: var(--product-border);
  background: radial-gradient(ellipse at 0 50%,color-mix(in srgb,var(--bonus-accent) 9%,transparent),transparent 65%),var(--product-surface);
  box-shadow: inset 0 1px #ffffff07;
}
#screen[data-section="bonuses"] .reward-list .bonus-hub-card::before { display: none; }
#screen[data-section="bonuses"] .reward-list .bonus-hub-art { width: 86px; height: 96px; margin-top: 12px; }
#screen[data-section="bonuses"] .reward-list .bonus-hub-art > :is(.ic-loot-illustration,.bonus-feature-art) { width: 98px; height: 98px; max-height: 98px; }
#screen[data-section="bonuses"] .reward-list .bonus-hub-card h3 { font: 700 16px/1.3 system-ui; margin: 0; color: var(--product-copy); }
#screen[data-section="bonuses"] .reward-list .bonus-hub-caption { font-size: 12px; line-height: 1.45; color: var(--product-muted); }
#screen[data-section="bonuses"] .reward-list .bonus-hub-footer > button {
  min-height: 44px;
  padding: 10px;
  font-size: 13px;
  border-radius: 11px;
  background: var(--product-raised);
  border-color: #b7955866;
  color: var(--product-copy);
}
#screen[data-section="bonuses"] .reward-list .bonus-hub-card:has([data-runner-start]) { min-height: 196px; height: auto; }

/* Leaderboard has its own ceremonial podium; keep portraits at native scale. */
#screen[data-section="top"] .leaderboard-controls { margin-bottom: 14px; }
#screen[data-section="top"] .top-category-tabs [role="tab"] { min-height: 44px; padding: 10px 12px; border-radius: 11px; }
#screen[data-section="top"] .leaderboard-information > summary { height: 44px; min-height: 44px; }
#screen[data-section="top"] .podium-player {
  min-height: 188px;
  grid-template-rows: 96px minmax(0,1fr);
  background: linear-gradient(160deg,var(--product-raised),var(--product-surface));
  border-color: #b7955866;
  border-radius: 15px;
  box-shadow: inset 0 1px #ffffff08;
}
#screen[data-section="top"] .podium-rank-1 { min-height: 200px; border-color: #b79558bb; }
#screen[data-section="top"] .podium-player .rank-copy { grid-template-rows: 2.6em minmax(2.2em,auto); gap: 4px; }
#screen[data-section="top"] .podium-player .rank-copy > b { font: 700 12px/1.3 system-ui; color: var(--product-copy); }
#screen[data-section="top"] .podium-player .rank-metric { color: var(--product-gold); }
#screen[data-section="top"] .compact-rank-row { padding: 10px; min-height: 58px; border-color: var(--product-border); background: var(--product-surface); }
#screen[data-section="top"] .own-rank { background: var(--product-surface); border-color: #b7955899; color: var(--product-gold); }

/* Collection inventory and market filters retain their distinct card artwork. */
#screen[data-section="inventory"] .impulse-card {
  background: linear-gradient(125deg,var(--product-raised),var(--product-surface));
  border-color: var(--product-border);
  border-radius: 15px;
}
#screen[data-section="inventory"] .impulse-card .impulse-heading > b { font: 700 14px/1.4 system-ui; color: var(--product-copy); }
#screen[data-section="investments"] .ic-market-heading { padding: 16px; border-radius: 16px; background: var(--product-surface); border-color: var(--product-border); }
#screen[data-section="investments"] .ic-market-heading h3 { margin: 0; font: 750 22px/1.25 system-ui; color: var(--product-copy); }
#screen[data-section="investments"] .ic-market-heading .note { font-size: 12px; line-height: 1.55; color: var(--product-muted); }
#screen[data-section="investments"] .ic-market-heading > .row { margin: 12px 0; }
#screen[data-section="investments"] .ic-market-heading [data-card-market-settings] { flex: 0 0 44px; padding: 8px; }
#screen[data-section="investments"] .ic-market-filters { margin: 12px 0 0; }
#screen[data-section="investments"] .ic-market-filters select { min-height: 44px; font-size: 12px; padding: 10px 8px; background: var(--product-raised); border-color: var(--product-border); color: var(--product-copy); }

/* Other remains a tile menu, with consistent hierarchy and icon alignment. */
#screen:is([data-section="other"],[data-section="catalogue"]) .other-sections { gap: 10px; }
#screen:is([data-section="other"],[data-section="catalogue"]) .other-sections > button {
  min-height: 100px;
  padding: 13px 12px;
  gap: 10px;
  border-radius: 14px;
  background: var(--product-surface);
  border-color: var(--product-border);
  box-shadow: inset 0 1px #ffffff06;
}
#screen:is([data-section="other"],[data-section="catalogue"]) .other-sections b { font-size: 14px; line-height: 1.3; font-weight: 700; }
#screen:is([data-section="other"],[data-section="catalogue"]) .other-sections small { margin-top: 5px; font-size: 11px; line-height: 1.45; color: var(--product-muted); }
#screen:is([data-section="other"],[data-section="catalogue"]) .other-icon { align-self: flex-start; margin-top: 2px; flex-basis: 22px; }

/* Wallet and settings use comfortable native form controls on narrow phones. */
#screen[data-section="wallet"] .wallet-transfer { padding: 15px; border-radius: 15px; }
#screen[data-section="wallet"] .wallet-transfer > summary { min-height: 26px; font-size: 15px; line-height: 1.5; }
#screen[data-section="wallet"] #search-form .row { flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
#screen[data-section="wallet"] #player-query { flex: 1 1 180px; min-width: 0; min-height: 46px; font-size: 16px; }
#screen[data-section="wallet"] #search-form button { min-height: 46px; font-size: 13px; }
#screen[data-section="wallet"] .wallet-history-tools { gap: 12px; margin: 16px 0 8px; }
#screen[data-section="wallet"] .wallet-history-tools label { line-height: 1.45; color: var(--product-muted); }
#screen[data-section="wallet"] .wallet-history-tools input { flex-shrink: 0; width: 20px; height: 20px; }
#screen[data-section="wallet"] .wallet-history-tools > button { min-height: 44px; padding: 9px 12px; font-size: 12px; }
#screen[data-section="wallet"] .wallet-event { padding: 15px 0; }
#screen[data-section="wallet"] .wallet-event-main p { color: var(--product-copy); font-size: 13px; font-weight: 650; }
#screen[data-section="wallet"] :is(.wallet-event-age,.wallet-event-date) { font-size: 11px; line-height: 1.6; }
#screen[data-section="wallet"] .wallet-event-details summary { padding: 4px 0; }
#screen[data-section="settings"] .settings-profile { gap: 22px; padding: 22px 20px; }
#screen[data-section="settings"] .settings-profile:has(.avatar-decoration) { padding-top: 58px; padding-bottom: 24px; }
#screen[data-section="settings"] .settings-profile > .avatar { width: 64px; height: 64px; min-width: 64px; min-height: 64px; font-size: 24px; flex-shrink: 0; }
#screen[data-section="settings"] .settings-profile b { font-size: 17px; }
#screen[data-section="settings"] .settings-label { min-height: 62px; padding: 12px 0; font-size: 14px; }
#screen[data-section="settings"] .settings-label select { min-height: 44px; max-width: 55%; font-size: 14px; padding: 8px 12px; }
#screen[data-section="currency"] .currency-guide { padding: 18px; }
#screen[data-section="currency"] .currency-guide .note { font-size: 13px; line-height: 1.65; }

/* Portrait and ornament share the original 100-unit face geometry. Reserve the
   SVG's 60-unit headroom in the scroll body instead of shrinking or clipping it. */
#profile { width: min(94vw,410px); border-radius: 20px; border-color: var(--product-border); }
#profile .profile-head { height: 56px; padding: 7px 10px; }
#profile .profile-head > .close { width: 42px; height: 42px; min-height: 42px; font-size: 25px; }
#profile #profile-body { max-height: calc(90dvh - 56px); padding: 0 18px 20px; scroll-padding-block: 14px; }
#profile.has-bottom-nav #profile-body { max-height: calc(100dvh - var(--iron-bottom-nav-space) - 80px); }
#profile #profile-body > .avatar { width: 84px; height: 84px; min-width: 84px; min-height: 84px; margin: 12px auto 16px; padding: 0; }
#profile #profile-body > .avatar:has(.avatar-decoration) { margin-top: 56px; margin-bottom: 20px; }
#profile #profile-body > .avatar > img[data-coin-avatar-photo] { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
#profile #profile-body > h2 { max-width: 100%; font: 750 21px/1.3 system-ui; overflow-wrap: anywhere; margin: 7px auto; }
#profile .profile-balance { margin: 14px 0; padding: 14px; background: var(--product-surface); }
#profile .profile-balance b { font-size: clamp(17px,5vw,22px); line-height: 1.4; }
#profile .profile-income { margin: 12px 0; padding: 14px; background: var(--product-surface); }
#profile .profile-income-grid { gap: 12px; }
#profile .profile-income-grid b { font-size: 12px; line-height: 1.55; }
#profile .profile-achievements { gap: 8px; margin: 12px 0; }
#profile .profile-achievements > div { padding: 11px 8px; background: var(--product-surface); }
#profile .profile-achievements small { font-size: 11px; }
#profile .profile-achievements b { font-size: 17px; }
#profile .profile-more-stats { margin: 12px 0; padding: 0 12px; border: 1px solid var(--product-border); border-radius: 12px; background: var(--product-surface); }
#profile .profile-more-stats > summary { min-height: 44px; padding: 12px 0; text-align: left; }
#profile .profile-more-stats p { padding: 8px 0; line-height: 1.5; border-top: 1px solid var(--line); }
#profile .profile-more-stats p > b { min-width: 0; overflow-wrap: anywhere; }
/* Three income metrics are peers. Legacy first/last spans assumed a two-column
   grid and left mining alone at half width; use equal full-width compact rows. */
#profile .profile-more-stats .profile-stats {
  grid-template-columns: minmax(0,1fr);
  gap: 8px;
  margin: 12px 0;
  padding: 0;
  border: 0;
  background: transparent;
}
#profile .profile-more-stats .profile-stats > div {
  grid-column: 1 / -1;
  min-width: 0;
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--product-raised);
}
#profile .profile-more-stats .profile-stats small { margin: 0; font-size: 11px; line-height: 1.4; }
#profile .profile-more-stats .profile-stats b { margin-top: 4px; font-size: 14px; line-height: 1.45; color: var(--product-gold); }
#profile #transfer-form { display: grid; gap: 14px; margin-top: 20px; text-align: left; }
#profile #transfer-form label { display: grid; gap: 8px; font-size: 13px; }
#profile #transfer-form :is(input,select) { width: 100%; min-width: 0; min-height: 48px; padding: 12px; font-size: 16px; border-radius: 11px; }
#profile #transfer-form .wide { margin-top: 2px; min-height: 46px; }

/* Main navigation gets a clear selected state only on these product surfaces. */
.app > .home-top button { min-height: 60px; padding: 9px 6px; font-size: 11px; line-height: 1.25; }
.app > .home-top .nav-icon svg { width: 22px; height: 22px; }
#screen:is([data-section="shop"],[data-section="top"],[data-section="bonuses"],[data-section="other"],[data-section="catalogue"],[data-section="inventory"],[data-section="investments"],[data-section="referral"],[data-section="gifts"],[data-section="wallet"],[data-section="settings"],[data-section="currency"]) > .home-bottom > button[aria-current="page"] {
  background: #b795581a;
  border-color: #b79558aa;
  color: var(--product-gold);
}
@media (max-width: 370px) {
  #screen[data-section="shop"] .d1-equipment { grid-template-columns: 76px minmax(0,1fr); gap: 6px 10px; padding: 11px; }
  #screen[data-section="shop"] .d1-equipment > .equipment-icon { width: 76px; height: 86px; }
  #screen[data-section="shop"] .d1-equipment > div:nth-child(2) { padding-right: 26px; }
  #screen[data-section="shop"] .d1-equipment h3 { font-size: 14px; }
  #screen[data-section="bonuses"] .reward-list .bonus-hub-card { grid-template-columns: 72px minmax(0,1fr); gap: 7px 10px; padding: 14px 12px; }
  #screen[data-section="bonuses"] .reward-list .bonus-hub-art { width: 72px; height: 90px; }
  #screen[data-section="bonuses"] .reward-list .bonus-hub-art > :is(.ic-loot-illustration,.bonus-feature-art) { width: 88px; height: 88px; }
  #screen:is([data-section="other"],[data-section="catalogue"]) .other-sections { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #screen:is([data-section="other"],[data-section="catalogue"]) .other-sections > button { padding: 12px 10px; gap: 8px; }
  #screen:is([data-section="other"],[data-section="catalogue"]) .other-sections b { font-size: 13px; }
  #screen:is([data-section="other"],[data-section="catalogue"]) .other-icon { flex-basis: 18px; }
  #screen:is([data-section="other"],[data-section="catalogue"]) .other-icon svg { width: 18px; height: 18px; }
}
@media (max-width: 340px) {
  #screen:is([data-section="other"],[data-section="catalogue"]) .other-sections { grid-template-columns: minmax(0,1fr); }
  #screen:is([data-section="other"],[data-section="catalogue"]) .other-sections > button { min-height: 76px; }
  #screen[data-section="wallet"] .wallet-history-tools { align-items: flex-start; }
}
