/* V54 final commerce layout: loaded last so legacy shop rules cannot override it. */
html body:not(.view-game) section#shopModal.commerce-page {
  padding: clamp(5px,1vw,12px) !important;
  background: linear-gradient(135deg,rgba(3,25,82,.86),rgba(66,24,133,.78)),url('../assets/bg-main.png') center/cover no-repeat !important;
}
html body:not(.view-game) section#shopModal.commerce-page > .shop-card {
  box-sizing: border-box !important;
  width: min(1180px,98vw) !important;
  height: min(920px,97dvh) !important;
  max-height: 97dvh !important;
  overflow: hidden !important;
  padding: clamp(8px,1vw,14px) !important;
  display: grid !important;
  grid-template-rows: auto auto auto 92px auto minmax(0,1fr) !important;
  gap: clamp(3px,.55vh,7px) !important;
  background: radial-gradient(circle at 8% 0,rgba(65,225,255,.22),transparent 25%),linear-gradient(145deg,rgba(8,67,163,.98),rgba(30,25,111,.98)) !important;
}
html body:not(.view-game) #shopModal .shop-header {
  position: relative !important;
  min-height: 74px !important;
  padding: 8px 150px 8px 12px !important;
  border-radius: 17px !important;
}
html body:not(.view-game) #shopModal .shop-header::before { font-size: 31px !important; margin-right: 9px !important; }
html body:not(.view-game) #shopModal .shop-header h2 { font-size: clamp(22px,2.5vw,34px) !important; }
html body:not(.view-game) #shopModal .shop-header p { font-size: clamp(10px,1vw,14px) !important; }
html body:not(.view-game) #shopModal .panel-kicker {
  display: inline-flex !important;
  padding: 4px 10px !important;
  border: 2px solid #fff !important;
  border-radius: 999px !important;
  color: #172554 !important;
  background: linear-gradient(135deg,#fff36a,#ffbd2f) !important;
  text-shadow: none !important;
  box-shadow: 0 3px 0 #bf7010 !important;
}
html body:not(.view-game) #shopModal a#closeShopBtn.commerce-back-btn {
  position: absolute !important;
  top: 14px !important;
  right: 14px !important;
  width: 126px !important;
  height: 42px !important;
  min-width: 126px !important;
  min-height: 42px !important;
  padding: 7px 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  border-radius: 13px !important;
  color: #fff !important;
  font-size: 13px !important;
  line-height: 1 !important;
  background: linear-gradient(135deg,#ff6a55,#e83767) !important;
  box-shadow: 0 4px 0 #911e48 !important;
}
html body:not(.view-game) #shopModal .shop-balance-row {
  margin: 0 !important;
  padding: 5px !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr auto !important;
  align-items: center !important;
  gap: 6px !important;
}
html body:not(.view-game) #shopModal .coin-line,
html body:not(.view-game) #shopModal .shop-topup-inline {
  box-sizing: border-box !important;
  min-height: 34px !important;
  margin: 0 !important;
  padding: 5px 9px !important;
  font-size: 11px !important;
}
html body:not(.view-game) #shopModal .shop-section-title {
  margin: 0 !important;
  font-size: clamp(13px,1.45vw,18px) !important;
  line-height: 1.2 !important;
}
html body:not(.view-game) #shopModal #specialItemGrid.special-grid {
  min-height: 0 !important;
  height: 92px !important;
  display: grid !important;
  grid-template-columns: repeat(4,minmax(0,1fr)) !important;
  gap: 7px !important;
}
html body:not(.view-game) #shopModal #specialItemGrid .special-item-card {
  box-sizing: border-box !important;
  width: auto !important;
  height: 88px !important;
  min-height: 0 !important;
  padding: 6px 8px !important;
}
html body:not(.view-game) #shopModal #skinGrid.skin-grid {
  min-width: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow: hidden !important;
  display: grid !important;
  grid-template-columns: repeat(4,minmax(0,1fr)) !important;
  grid-template-rows: repeat(2,minmax(0,1fr)) !important;
  gap: 7px !important;
}
html body:not(.view-game) #shopModal #skinGrid > .skin-card {
  box-sizing: border-box !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 5px !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
}
html body:not(.view-game) #shopModal #skinGrid > .skin-card > img.avatar-art {
  width: clamp(40px,6vh,62px) !important;
  height: clamp(40px,6vh,62px) !important;
  padding: 3px !important;
  flex: 0 0 auto !important;
}
html body:not(.view-game) #shopModal #skinGrid h4 { margin: 4px 0 1px !important; font-size: clamp(10px,1vw,14px) !important; }
html body:not(.view-game) #shopModal #skinGrid .avatar-desc { display: none !important; }
html body:not(.view-game) #shopModal #skinGrid .avatar-price { min-height: 16px !important; margin: 0 0 3px !important; font-size: 10px !important; }
html body:not(.view-game) #shopModal #skinGrid button { min-height: 25px !important; padding: 3px 6px !important; font-size: 9px !important; }
html body:not(.view-game) #shopModal img[src*="coin-icon.svg"] {
  width: 15px !important; height: 15px !important; min-width: 15px !important; max-width: 15px !important;
  min-height: 15px !important; max-height: 15px !important; padding: 0 !important; margin: 0 !important;
  border: 0 !important; border-radius: 0 !important; object-fit: contain !important; background: transparent !important;
  box-shadow: none !important; transform: none !important;
}
@media (max-height: 560px) {
  html body:not(.view-game) section#shopModal.commerce-page > .shop-card { grid-template-rows: 50px 36px 16px 62px 16px minmax(0,1fr) !important; }
  html body:not(.view-game) #shopModal .shop-header { min-height: 50px !important; padding: 4px 105px 4px 8px !important; }
  html body:not(.view-game) #shopModal .shop-header::before,
  html body:not(.view-game) #shopModal .shop-header p { display: none !important; }
  html body:not(.view-game) #shopModal .shop-header h2 { font-size: 18px !important; }
  html body:not(.view-game) #shopModal a#closeShopBtn.commerce-back-btn { top: 7px !important; right: 7px !important; width: 92px !important; min-width: 92px !important; height: 32px !important; min-height: 32px !important; font-size: 10px !important; }
  html body:not(.view-game) #shopModal #specialItemGrid.special-grid { height: 62px !important; }
  html body:not(.view-game) #shopModal #specialItemGrid .special-item-card { height: 60px !important; }
  html body:not(.view-game) #shopModal #skinGrid > .skin-card > img.avatar-art { width: 34px !important; height: 34px !important; }
}
@media (max-width: 620px) and (orientation: portrait) {
  html body:not(.view-game) #shopModal #specialItemGrid.special-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; grid-template-rows: repeat(2,minmax(0,1fr)) !important; height: 122px !important; }
  html body:not(.view-game) #shopModal #specialItemGrid .special-item-card { height: 58px !important; }
  html body:not(.view-game) #shopModal #skinGrid.skin-grid { grid-template-columns: repeat(4,minmax(0,1fr)) !important; grid-template-rows: repeat(2,minmax(0,1fr)) !important; }
}
