/* BigPool UI refresh — store. Uses the shared design language from app.css (Oct 2026). */

/* ---------- Rarity palette ----------
   One colour per catalogue rarity (platform/locker-catalog.js): Starter, Pro,
   Rare, Elite, Mythic, Legendary. Everything rarity-tinted reads --r. */
.store-page .store-item { --r: #9aa59f; --r-rgb: 154, 165, 159; }
.store-page .rarity-pro { --r: #6fd6c0; --r-rgb: 111, 214, 192; }
.store-page .rarity-rare { --r: #76afe0; --r-rgb: 118, 175, 224; }
.store-page .rarity-elite { --r: #b394ff; --r-rgb: 179, 148, 255; }
.store-page .rarity-mythic { --r: #ff7b8f; --r-rgb: 255, 123, 143; }
.store-page .rarity-legendary { --r: #f2c14e; --r-rgb: 242, 193, 78; }

.store-page { padding-top: 26px; }

/* ---------- Hero: copy, equipped loadout, balance ---------- */
.store-page .store-hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); align-items: center; gap: 28px;
  padding: 30px 30px; border-radius: 22px; border: 1px solid rgba(255,255,255,.07);
  background:
    radial-gradient(90% 120% at 100% 0%, rgba(217,180,93,.10), transparent 55%),
    radial-gradient(70% 120% at 0% 100%, rgba(104,211,145,.08), transparent 60%),
    linear-gradient(160deg, #111712 0%, #0b0f0c 100%);
  box-shadow: 0 30px 70px -40px rgba(0,0,0,.9);
}
.store-page .store-hero::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(217,180,93,.7) 30%, rgba(104,211,145,.6) 70%, transparent); pointer-events: none; }
/* The equipped table, ghosted behind the copy so the hero is the player's own table. */
.store-hero-art { position: absolute; z-index: -1; top: 50%; right: -6%; width: 62%; max-width: 760px; transform: translateY(-50%) rotate(-4deg); opacity: .22; filter: saturate(1.1) blur(.3px); -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 55%); mask-image: linear-gradient(90deg, transparent 0%, #000 55%); pointer-events: none; }
.store-hero-copy { min-width: 0; }
.store-page .store-hero h1 { max-width: 560px; margin: 10px 0 8px; font: 900 clamp(32px, 4.2vw, 50px)/1.02 BigPoolDisplay, var(--font-heading); letter-spacing: -.01em; text-wrap: balance; }
.store-page .store-hero p { max-width: 520px; margin: 0; color: #cdd5d0; font-size: 15px; line-height: 1.55; }
.store-hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.store-chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 11px; border-radius: 999px; border: 1px solid rgba(255,255,255,.12); background: rgba(7,9,8,.55); color: var(--text-soft); font: 800 11px var(--font-heading); letter-spacing: 1.1px; text-transform: uppercase; backdrop-filter: blur(6px); }
.store-chip b { color: var(--gold); font-size: 12px; letter-spacing: .3px; }

.store-hero-side { display: grid; gap: 10px; min-width: 0; }
.store-label, .store-page .store-balance > span { color: var(--muted); font: 800 10px var(--font-heading); letter-spacing: 1.5px; text-transform: uppercase; }
.store-loadout { display: grid; grid-template-columns: 112px minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 8px 12px; padding: 12px; border-radius: 16px; border: 1px solid rgba(255,255,255,.08); background: rgba(10,14,11,.62); backdrop-filter: blur(8px); }
.store-loadout .store-label { grid-column: 1 / -1; }
.store-loadout b { display: block; overflow: hidden; color: var(--text); font: 800 12px var(--font-heading); text-overflow: ellipsis; white-space: nowrap; }
.store-loadout-table { display: grid; gap: 6px; min-width: 0; }
.store-loadout-table img { width: 100%; aspect-ratio: 1280 / 770; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); }
.store-loadout-cue { align-self: stretch; display: grid; align-content: center; gap: 8px; min-width: 0; padding: 0 10px; border-radius: 10px; background: radial-gradient(120% 140% at 50% 50%, #1c5a37, #0e2c1b 75%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), inset 0 8px 18px rgba(0,0,0,.35); }
.store-loadout-cue img { width: 100%; height: 22px; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(0,0,0,.55)); }
.store-loadout-cue b { color: rgba(255,255,255,.86); }

.store-page .store-balance { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 12px; padding: 12px 12px 12px 14px; border: 1px solid rgba(217,180,93,.28); border-left: 1px solid rgba(217,180,93,.28); border-radius: 16px; background: linear-gradient(180deg, rgba(217,180,93,.08), rgba(255,255,255,.02)); }
.store-page .store-balance strong { grid-column: 1; display: inline-flex; align-items: center; gap: 8px; color: var(--text); font: 900 24px/1.1 BigPoolDisplay, var(--font-heading); font-variant-numeric: tabular-nums; }
.store-page .store-balance .btn { grid-column: 2; grid-row: 1 / span 2; min-height: 38px; border-radius: 12px; border-color: rgba(217,180,93,.4); color: var(--gold); }
.store-page .store-balance .btn:hover { background: rgba(217,180,93,.1); color: #f1d58f; }

/* ---------- Category tabs (radio driven) ---------- */
.store-shop { margin-top: 26px; }
.store-tab-input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; opacity: 0; }
.store-tabs { display: inline-flex; max-width: 100%; gap: 4px; padding: 4px; border-radius: 999px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.025); overflow-x: auto; scrollbar-width: none; }
.store-tabs::-webkit-scrollbar { display: none; }
.store-tabs label { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 999px; color: #a3ada7; font: 800 13px var(--font-heading); white-space: nowrap; cursor: pointer; user-select: none; transition: background .18s, color .18s, box-shadow .18s; }
.store-tabs label:hover { color: var(--text); background: rgba(255,255,255,.04); }
.store-tabs label b { min-width: 22px; height: 20px; display: inline-grid; place-items: center; padding: 0 6px; border-radius: 999px; background: rgba(255,255,255,.07); color: var(--text-soft); font-size: 11px; font-variant-numeric: tabular-nums; }
#store-tab-tables:checked ~ .store-tabs label[for="store-tab-tables"],
#store-tab-cues:checked ~ .store-tabs label[for="store-tab-cues"],
#store-tab-owned:checked ~ .store-tabs label[for="store-tab-owned"] { color: #f2fbf5; background: linear-gradient(180deg, rgba(104,211,145,.22), rgba(104,211,145,.10)); box-shadow: inset 0 0 0 1px rgba(104,211,145,.35); }
#store-tab-tables:checked ~ .store-tabs label[for="store-tab-tables"] b,
#store-tab-cues:checked ~ .store-tabs label[for="store-tab-cues"] b,
#store-tab-owned:checked ~ .store-tabs label[for="store-tab-owned"] b { background: rgba(104,211,145,.22); color: var(--green-bright); }
#store-tab-tables:focus-visible ~ .store-tabs label[for="store-tab-tables"],
#store-tab-cues:focus-visible ~ .store-tabs label[for="store-tab-cues"],
#store-tab-owned:focus-visible ~ .store-tabs label[for="store-tab-owned"] { outline: 2px solid var(--green); outline-offset: 2px; }

.store-panel { display: none; margin-top: 22px; }
#store-tab-tables:checked ~ .store-panel-tables,
#store-tab-cues:checked ~ .store-panel-cues,
#store-tab-owned:checked ~ .store-panel { display: block; }
#store-tab-owned:checked ~ .store-panel .store-item:not(.is-owned) { display: none; }
#store-tab-owned:checked ~ .store-panel-cues { margin-top: 34px; }
.store-panel .section-heading { align-items: flex-end; flex-wrap: wrap; }
.store-panel .section-heading h2 { margin-top: 4px; font: 900 22px/1.1 BigPoolDisplay, var(--font-heading); }
.store-panel .store-item-cosmetic { margin: 0; font-size: 12px; }

/* ---------- Item cards ---------- */
.store-page .store-grid { display: grid; gap: 16px; }
.store-page .store-grid-tables { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.store-page .store-grid-cues { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.store-page .store-item {
  position: relative; min-width: 0; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 18px; border: 1px solid rgba(255,255,255,.07);
  background: linear-gradient(180deg, #111712, #0b0f0c);
  box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 20px 50px -36px rgba(0,0,0,.9);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.store-page .store-item::before { content: ""; position: absolute; z-index: 2; inset: 0 0 auto 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(var(--r-rgb), .65), transparent); opacity: .7; pointer-events: none; }
.store-page .store-item:hover { transform: translateY(-3px); border-color: rgba(var(--r-rgb), .38); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 26px 60px -30px rgba(var(--r-rgb), .45); }
.store-page .store-item.is-equipped { border-color: rgba(104,211,145,.5); box-shadow: 0 0 0 1px rgba(104,211,145,.25), 0 22px 50px -30px rgba(104,211,145,.55); }

.store-page .store-item-art { position: relative; height: auto; display: grid; place-items: center; overflow: hidden; background: none; }
.store-page .store-item-art img { position: relative; z-index: 1; transition: transform .35s cubic-bezier(.2,.7,.2,1); }
/* Tables: the art fills the card top edge to edge on a rarity-tinted spotlight. */
.store-page .store-item-art.is-table { aspect-ratio: 1280 / 770; padding: 0; background: radial-gradient(70% 80% at 50% 45%, rgba(var(--r-rgb), .20), transparent 70%), linear-gradient(180deg, #151d17, #0b0f0c); }
.store-page .store-item-art.is-table img { width: 104%; max-width: none; height: auto; margin-top: 3%; object-fit: contain; filter: drop-shadow(0 14px 18px rgba(0,0,0,.6)); }
.store-page .store-item:hover .store-item-art.is-table img { transform: scale(1.035); }
/* Cues: laid on a strip of felt, the way they sit on the rail. */
.store-page .store-item-art.is-cue { height: 112px; padding: 0 14px; background:
    radial-gradient(60% 90% at 50% 50%, rgba(var(--r-rgb), .16), transparent 70%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.012) 0 2px, transparent 2px 5px),
    radial-gradient(130% 160% at 50% 40%, #1d5d39 0%, #11391f 55%, #0a2214 100%);
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.6), inset 0 10px 24px rgba(0,0,0,.35); }
.store-page .store-item-art.is-cue::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 9px; background: linear-gradient(180deg, #3a2414, #1d120a); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
.store-page .store-item-art.is-cue img { width: 108%; max-width: none; height: auto; transform: rotate(-3deg); filter: drop-shadow(0 9px 6px rgba(0,0,0,.55)); }
.store-page .store-item:hover .store-item-art.is-cue img { transform: rotate(-3deg) translateX(-10px); }

/* Rarity chip and owned / equipped state, pinned over the art. */
.store-page .store-item-art .store-rarity { position: absolute; z-index: 3; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; border: 1px solid rgba(var(--r-rgb), .45); background: rgba(7,9,8,.72); color: var(--r); font: 800 10px var(--font-heading); letter-spacing: 1.3px; text-transform: uppercase; backdrop-filter: blur(6px); box-shadow: 0 0 16px -4px rgba(var(--r-rgb), .55); }
.store-page .store-item-art .store-rarity::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--r); box-shadow: 0 0 8px var(--r); }
.store-state { position: absolute; z-index: 3; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); background: rgba(7,9,8,.72); color: var(--text-soft); font: 800 10px var(--font-heading); font-style: normal; letter-spacing: 1.2px; text-transform: uppercase; backdrop-filter: blur(6px); }
.store-state.is-equipped { border-color: rgba(104,211,145,.5); color: var(--green-bright); }
.store-state.is-equipped::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(104,211,145,.9); }

.store-page .store-item-copy { flex: 1; display: grid; grid-template-rows: 1fr auto; gap: 14px; padding: 14px 16px 16px; }
.store-page .store-item-copy h3 { margin: 0 0 4px; font: 800 17px/1.2 var(--font-heading); letter-spacing: -.01em; }
.store-page .store-item-copy p { min-height: 0; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.store-page .store-item footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.06); }
.store-price { min-width: 0; display: grid; gap: 3px; }
.store-price-main { display: inline-flex; align-items: center; gap: 7px; }
.store-price-main b { color: var(--text); font: 900 20px/1 BigPoolDisplay, var(--font-heading); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.store-price .coin { width: 20px; height: 20px; font-size: 10px; }
.store-price small { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font: 700 11px var(--font-heading); white-space: nowrap; }
.store-price small .coin { width: 14px; height: 14px; font-size: 8px; box-shadow: none; }
.store-page .store-price.is-free b { color: var(--text-soft); font: 800 15px/1.2 var(--font-heading); }
.store-page .store-item footer .btn { flex: none; min-width: 84px; min-height: 38px; border-radius: 12px; font-size: 13px; }
.store-page .store-item footer .btn:not(.btn-secondary) { background: linear-gradient(180deg, #86e6a9, var(--green)); box-shadow: 0 10px 24px -12px rgba(104,211,145,.8), inset 0 1px 0 rgba(255,255,255,.4); }
.store-page .store-item footer .btn-secondary { border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.04); }
.store-page .store-item footer .btn-secondary:hover:not(:disabled) { border-color: rgba(104,211,145,.45); color: var(--green-bright); }
.store-page .store-item.is-equipped footer .btn:disabled { opacity: 1; border-color: rgba(104,211,145,.35); background: rgba(104,211,145,.1); color: var(--green-bright); cursor: default; }

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
  .store-page .store-hero { grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); }
}

/* ---------- Phone ---------- */
@media (max-width: 720px) {
  .store-page { padding-top: 14px; }
  .store-page .store-hero { grid-template-columns: 1fr; gap: 18px; padding: 22px 16px 16px; border-radius: 20px; }
  .store-hero-art { display: none; }
  .store-page .store-hero h1 { margin-top: 8px; font-size: 28px; }
  .store-page .store-hero p { font-size: 13.5px; line-height: 1.5; }
  .store-hero-chips { margin-top: 12px; }
  .store-hero-chips .store-chip:last-child { display: none; }
  .store-hero-side { grid-template-columns: 1fr; gap: 8px; }
  /* One compact row: table thumbnail, then the cue on its felt. */
  .store-loadout { grid-template-columns: 76px minmax(0, 1fr); grid-template-rows: auto; align-items: center; gap: 6px 10px; padding: 10px; border-radius: 14px; }
  .store-loadout-table b { display: none; }
  .store-loadout-cue { min-height: 52px; gap: 4px; }
  .store-loadout-cue img { height: 16px; }
  .store-page .store-balance { padding: 10px 10px 10px 12px; border-radius: 14px; }
  .store-page .store-balance strong { font-size: 21px; }

  .store-shop { margin-top: 18px; }
  .store-tabs { display: flex; width: 100%; }
  .store-tabs label { flex: 1; justify-content: center; height: 36px; padding: 0 10px; font-size: 12.5px; }
  .store-panel { margin-top: 16px; }
  .store-panel .section-heading { margin-bottom: 12px; }
  .store-panel .section-heading h2 { font-size: 19px; }

  /* Two tables per row: the art carries the card, so the copy gets tighter. */
  .store-page .store-grid { gap: 10px; }
  .store-page .store-grid-tables { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .store-page .store-grid-cues { grid-template-columns: 1fr; }
  .store-page .store-item { border-radius: 16px; }
  .store-page .store-item-art .store-rarity { top: 7px; left: 7px; height: 20px; padding: 0 7px; font-size: 8.5px; letter-spacing: 1px; }
  .store-page .store-item-art .store-rarity::before { width: 5px; height: 5px; }
  .store-state { top: 7px; right: 7px; height: 20px; padding: 0 7px; font-size: 8.5px; }
  .store-page .store-item-copy { gap: 10px; padding: 10px 12px 12px; }
  .store-page .store-item-copy h3 { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .store-grid-tables .store-item-copy p { display: none; }
  .store-grid-tables .store-item footer { flex-direction: column; align-items: stretch; gap: 9px; padding-top: 10px; }
  .store-grid-tables .store-item footer .btn { width: 100%; min-height: 36px; }
  .store-page .store-price-main b { font-size: 17px; }
  .store-page .store-item-art.is-cue { height: 88px; }
  .store-grid-cues .store-item-copy p { -webkit-line-clamp: 1; }
}

@media (max-width: 360px) {
  .store-page .store-grid-tables { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .store-page .store-item, .store-page .store-item-art img, .store-tabs label { transition: none; }
  .store-page .store-item:hover { transform: none; }
  .store-page .store-item:hover .store-item-art.is-table img { transform: none; }
  .store-page .store-item:hover .store-item-art.is-cue img { transform: rotate(-3deg); }
}
