/* Store screen layout: the same look as the lobby's other screens (deep purple plates with a lime rim, cream info
   cards, round chunky buttons, no tilt). At most two rows of controls:
   row 1 = section switch (貝殼幣商品 cyan / SOZO 限定 gold) + the section's filters,
   row 2 = search, sort, rarity + the section's helper button (每日任務 / 購買說明);
   then one card strip that scrolls sideways (half a card shows at the right), and a one-line hint. */
#store { z-index: 22; --sec: #29e6ff; --gap: 16px; }
#store.sec-coin { --sec: #ffe23f; }
#store.enter .st-wrap { animation: stIn .3s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes stIn { from { transform: translateY(24px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }

/* outside the lobby (opened over the loadout) the back button and title get their own line, left of the wallet */
.st-wrap { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  grid-template-areas: "top" "tabs" "row2" "body" "foot"; column-gap: 14px; row-gap: 12px;
  padding: 12px calc(24px + env(safe-area-inset-right, 0px)) 10px calc(24px + env(safe-area-inset-left, 0px)); }
/* inside the lobby the tab bar already names the screen and holds the wallet */
body.lb-on.lb-sub #store .st-top { display: none !important; }
body.lb-on.lb-sub #store .st-wrap { grid-template-areas: "tabs" "row2" "body" "foot"; grid-template-rows: auto auto minmax(0, 1fr) auto; }

.st-top { grid-area: top; display: flex; align-items: center; gap: 12px; min-height: 52px; }
.st-back { padding: 2px 16px 2px 10px; font-size: 17px; }
.st-title { display: flex; align-items: center; gap: 6px; font-size: 24px; font-weight: 900; color: #1b1033; white-space: nowrap; background: #ffe23f; border: 3px solid #1b1033; border-radius: 999px; padding: 2px 18px 2px 8px; box-shadow: 0 4px 0 #1b1033; }
.st-title img { width: 34px; height: 34px; object-fit: contain; }

/* ---------- row 1: section switch + filters on one purple plate ---------- */
.st-tabs { grid-area: tabs; display: flex; align-items: center; gap: 14px; min-width: 0; justify-self: start; max-width: 100%;
  padding: 5px 8px 5px 5px; border-radius: 999px; background: rgba(27,16,51,.92); border: 3px solid #c6ff3a; box-shadow: 0 5px 0 rgba(27,16,51,.45); }
.st-secs, .st-subs { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.st-subs { padding-left: 14px; border-left: 2px solid rgba(255,255,255,.18); gap: 4px; }
.st-tab { font-family: var(--font); font-weight: 900; color: #d9d0f2; min-height: 44px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  background: transparent; border: 3px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 6px; outline: none;
  transition: transform .12s cubic-bezier(.34,1.56,.64,1), background .12s, color .12s; }
.st-tab:hover { color: #fff; transform: translateY(-1px); }
.st-tab:active { transform: scale(.94); }
.st-tab.st-sec { font-size: 18px; padding: 2px 18px 2px 8px; background: #3a2a63; border-color: #1b1033; }
.st-tab.st-sec .tab-cur { width: 30px; height: 30px; object-fit: contain; }
.st-tab.st-sec:not(.on) .tab-cur { filter: grayscale(.5) brightness(.85); }
.st-tab.st-sec.shell.on { background: #29e6ff; color: #1b1033; }
.st-tab.st-sec.coin.on { background: #ffe23f; color: #1b1033; }
.st-tab.st-sub { font-size: 16px; padding: 2px 16px; }
.st-tab.st-sub.on { background: var(--sec); color: #1b1033; border-color: #1b1033; }
.st-tab.focus, .st-back.focus, #st-daily.focus, #st-topup.focus { outline: 4px solid #ff3fa4; outline-offset: 3px; }

/* ---------- row 2: search, sort, rarity + the helper button ---------- */
.st-row2 { grid-area: row2; display: flex; align-items: center; gap: 12px; min-width: 0; }
#st-tools { flex: 1 1 auto; min-width: 0; gap: 12px; justify-content: flex-start; }
#st-tools .br-rars { display: none; }
#st-tools .br-rarcycle { display: inline-flex; }
#st-tools .br-search { max-width: 260px; }
.st-acts { display: flex; gap: 10px; flex: 0 0 auto; }
#st-daily, #st-topup { min-height: 44px; padding: 2px 18px; font-size: 16px; flex: 0 0 auto; }
#st-daily { background: #29e6ff; }
#st-topup { background: #ffe23f; }
#st-daily img, #st-topup img { width: 26px; height: 26px; object-fit: contain; margin: -4px 0; }

/* ---------- the card strip on a purple plate rimmed in the section's colour ---------- */
.st-body { grid-area: body; position: relative; min-height: 0; border-radius: 24px; background: rgba(27,16,51,.55); border: 3px solid var(--sec); box-shadow: 0 5px 0 rgba(27,16,51,.35); overflow: hidden; }
.st-arrow { display: none !important; }
.st-items { position: absolute; inset: 0; display: grid; grid-auto-flow: column; grid-template-rows: minmax(0, 1fr); grid-auto-columns: calc((100% - 4 * var(--gap)) / 4.5);
  gap: var(--gap); align-content: stretch; overflow-x: auto; overflow-y: hidden; padding: 14px 16px 18px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-x pan-y; }
.st-items::-webkit-scrollbar { display: none; }
.st-items.sec-in { animation: secIn .28s cubic-bezier(.34,1.56,.64,1); }
@keyframes secIn { from { transform: translateX(26px); opacity: .3; } to { transform: none; opacity: 1; } }
/* tall screens: two rows of cards, five and a half across */
@media (min-height: 940px) {
  .st-items { grid-template-rows: repeat(2, minmax(0, 1fr)); grid-auto-columns: calc((100% - 5 * var(--gap)) / 5.5); }
}

/* ---------- item cards: one size, fixed spacing ---------- */
.scard { --rc: #8fd16a; position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-width: 0; min-height: 0;
  padding: 8px 9px 10px; border-radius: 18px; background: #fffaf0; border: 4px solid #1b1033; box-shadow: 0 5px 0 #1b1033; color: #1b1033; cursor: pointer;
  animation: cardIn .3s cubic-bezier(.34,1.56,.64,1) both; transition: transform .14s cubic-bezier(.34,1.56,.64,1), box-shadow .14s; }
.scard.r-rare { --rc: #29b8ff; }
.scard.r-epic { --rc: #b45cff; }
.scard.r-legendary { --rc: #ffb11f; }
@keyframes cardIn { from { transform: translateY(24px) scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.scard:hover { transform: translateY(-3px); }
.scard.prem { background: #fff6cf; }
.scard.equipped { box-shadow: 0 0 0 4px #c6ff3a, 0 5px 0 4px #1b1033; }
.scard.focus { transform: translateY(-4px) scale(1.02); outline: 4px solid #ff3fa4; outline-offset: 4px; }
.scard.shake { animation: cardShake .38s ease-in-out; }
@keyframes cardShake { 0%, 100% { transform: none; } 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
.scard.bought { animation: cardWin .5s cubic-bezier(.34,1.56,.64,1); }
@keyframes cardWin { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
.scard > :not(.s-art) { flex-shrink: 0; }
.s-badge { position: absolute; top: 7px; left: 7px; z-index: 2; display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 900; padding: 2px 9px 2px 6px; border-radius: 999px; color: #fff; background: #1b1033; max-width: calc(100% - 14px); white-space: nowrap; }
.scard.owned .s-badge { background: #13a05a; }
.scard.equipped .s-badge { background: #ff3fa4; }
.s-tag { position: absolute; top: 34px; right: 12px; z-index: 2; font-size: 11px; font-weight: 900; padding: 1px 8px; border-radius: 999px; background: #29e6ff; color: #1b1033; border: 2px solid #1b1033; white-space: nowrap; }
.s-art { position: relative; flex: 1 1 auto; min-height: 40px; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 12px; margin-top: 22px;
  background: radial-gradient(ellipse 60% 55% at 50% 55%, color-mix(in srgb, var(--rc) 55%, transparent), transparent 72%), #f3eee3; }
.s-art > img { max-width: 100%; max-height: 100%; object-fit: contain; pointer-events: none; }
.s-art .rar-tag { position: absolute; left: 4px; top: 4px; z-index: 1; transform: scale(.85); transform-origin: left top; }
.scard.weapon .s-art > img, .scard.slot-paint .s-art > img { transform: scale(1.4); }
.scard.otter .s-art > img { height: 100%; }
.scard.rainbow .s-art > img, .dlg-art.rainbow img { animation: hueSpin 2.4s linear infinite; }
@keyframes hueSpin { from { filter: saturate(2) hue-rotate(0deg); } to { filter: saturate(2) hue-rotate(360deg); } }
.s-mini { position: absolute; left: 0; right: 0; bottom: 3px; display: flex; justify-content: center; gap: 2px; }
.s-mini img { width: 24px; height: 24px; object-fit: contain; background: #fff; border-radius: 7px; border: 2px solid #1b1033; padding: 1px; }
.s-name { font-size: 16px; font-weight: 900; text-align: center; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the price: big number with its icon and the currency's word, right above the button */
.s-buy { display: flex; align-items: center; justify-content: center; min-height: 30px; }
.s-buy .cur-chip { font-size: 22px; gap: 4px; }
.s-buy .cur-chip img { width: 28px; height: 28px; }
.s-buy .cur-chip .cn { font: 900 12px var(--font); font-style: normal; padding: 1px 7px; border-radius: 999px; color: #fff; background: #0a6f98; margin-left: 2px; letter-spacing: .2px; }
.s-buy .cur-chip.pearl .cn { background: #9a5b00; }
.s-own { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 900; color: #13a05a; }
.s-own .ico-check { filter: brightness(0) saturate(100%) invert(39%) sepia(80%) saturate(560%) hue-rotate(110deg); }
.s-act { width: 100%; min-height: 44px; font-size: 16px; padding: 2px 6px; background: #c6ff3a; }
.s-act .cur-chip { color: #1b1033; }
.s-act .cur-chip img { width: 20px; height: 20px; }
.s-act.short { background: #ece6f7; color: #b0005d; }
.s-act.short .cur-chip { color: #b0005d; }
.s-act.done { background: #e8e4ee; color: #6d6488; cursor: default; }
.s-act.alt { background: #fff; }

/* ---------- one short line under the cards ---------- */
.st-foot { grid-area: foot; display: flex; align-items: center; justify-content: center; min-height: 28px; min-width: 0; }
.st-hint { min-width: 0; max-width: 100%; font-size: 15px; font-weight: 900; color: #fff; text-align: center; padding: 3px 16px 3px 12px; border-radius: 999px; background: rgba(27,16,51,.85);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-flex; align-items: center; gap: 8px; }
.st-hint::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--sec); flex: none; box-shadow: 0 0 0 2px #1b1033; }

/* ---------- phones (the page is about 704×396) ---------- */
@media (max-height: 460px) {
  #store { --gap: 12px; }
  .st-wrap { row-gap: 8px; column-gap: 8px; padding: 8px calc(16px + env(safe-area-inset-right, 0px)) 6px calc(16px + env(safe-area-inset-left, 0px)); }
  .st-top { min-height: 44px; gap: 8px; }
  .st-title { display: none; }
  .st-back { font-size: 15px; padding: 2px 12px 2px 8px; }
  .st-tabs { gap: 10px; padding: 3px 6px 3px 3px; }
  .st-subs { padding-left: 10px; gap: 2px; }
  .st-tab.st-sec { font-size: 15px; padding: 2px 12px 2px 5px; }
  .st-tab.st-sec .tab-cur { width: 24px; height: 24px; }
  .st-tab.st-sub { font-size: 14px; padding: 2px 11px; }
  .st-row2 { gap: 8px; }
  #st-tools { gap: 8px; }
  #st-tools .br-search { max-width: 190px; }
  #st-daily, #st-topup { font-size: 14px; padding: 2px 12px; }
  #st-daily img, #st-topup img { width: 22px; height: 22px; }
  .st-body { border-radius: 18px; }
  .st-items { padding: 8px 12px 12px; }
  .st-wrap { row-gap: 6px; }
  .scard { padding: 5px 6px 6px; gap: 2px; border-radius: 16px; }
  /* the badge, slot and rarity sit on the picture so it keeps its height */
  .s-badge { top: 7px; left: 8px; font-size: 11px; padding: 1px 7px 1px 5px; }
  .s-tag { top: 7px; right: 9px; font-size: 10px; padding: 0 6px; }
  .s-art { margin-top: 0; min-height: 0; flex-basis: 0; }
  .s-art .rar-tag { top: 20px; left: 2px; transform: scale(.72); }
  .s-name { font-size: 14px; }
  .s-buy { min-height: 22px; }
  .s-buy .cur-chip { font-size: 17px; gap: 3px; }
  .s-buy .cur-chip img { width: 22px; height: 22px; }
  .s-buy .cur-chip .cn { font-size: 10px; padding: 0 5px; }
  .s-own { font-size: 12px; }
  .s-act { min-height: 44px; font-size: 14px; }
  .st-foot { min-height: 22px; }
  .st-hint { font-size: 12px; padding: 2px 12px 2px 9px; }
}
