/* The store page. DESIGN.md revision 3 skin tokens only: a skin or season
   restyles it through :root, like the game. */
.store-client [hidden] {
  display: none !important;
}
.store-client {
  min-width: 320px;
  color: var(--text);
}
.store-shell {
  max-width: 1280px;
  display: grid;
  gap: 24px;
  padding: 24px;
}
.store-header h1 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.store-header p,
.store-panel p {
  max-width: 70ch;
  line-height: 1.5;
}
.store-header p {
  color: var(--text-muted);
}
.store-stamp {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--down);
  border-radius: 999px;
  color: var(--down);
  background: var(--down-soft);
  font-weight: 600;
  font-size: var(--font-small);
}
.store-panel {
  display: grid;
  gap: 12px;
  padding: 20px;
  min-width: 0;
}
.store-notice {
  margin: 0;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--sheet);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.store-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.store-button,
.store-client input,
.store-client select {
  min-height: 48px;
  min-width: 48px;
  font-size: 1rem;
}
.store-button {
  padding: 10px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--sheet);
  font-weight: 600;
  cursor: pointer;
  overflow-wrap: anywhere;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.store-button:hover:not(:disabled) {
  border-color: var(--text-muted);
}
.store-primary {
  border-color: var(--accent);
  color: var(--on-accent);
  background: var(--accent);
  font-weight: 700;
}
.store-primary:hover:not(:disabled) {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}
.store-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.store-button:focus-visible,
.store-client input:focus-visible,
.store-client select:focus-visible,
.store-more summary:focus-visible,
.store-terms-details summary:focus-visible,
.store-wallet-option:focus-visible,
.store-link-button:focus-visible {
  outline: 4px solid var(--blue);
  outline-offset: 3px;
}
.store-client label {
  font-weight: 600;
}
.store-client input,
.store-client select {
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: var(--sunken);
  border-radius: var(--radius);
  font: inherit;
  max-width: 100%;
  width: 100%;
}
.store-vitals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
}
.store-market {
  display: grid;
  gap: 16px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.store-good {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  min-height: 48px;
  min-width: 48px;
}
@media (max-width: 400px) {
  .store-panel {
    padding: 16px;
  }
  .store-actions > .store-button {
    flex: 1 1 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .store-client *,
  .store-client *::before,
  .store-client *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* The challenge is signed byte for byte: keep its line breaks when copied. */
.store-challenge {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  border-color: var(--processing);
}

/* Shared store roles (DESIGN.md "Store surfaces and podiums"): the
   held-pass summary is a raised card, and a recorded receipt panel keeps
   the panel plus the settled bar on its lead edge. */
#store-pass-counts:not(:empty) {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  background: var(--card);
}

#store-receipt {
  box-shadow:
    var(--shadow),
    inset 6px 0 0 var(--receipt);
}

.store-wallet {
  display: grid;
  gap: 0.5rem;
  margin-block: 0.75rem;
}

.store-wallet select {
  font: inherit;
}

/* Three steps to a ranked run: connect, confirm, play. The header marks the
   step the page is on; the rest stay quiet. */
.store-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: store-step;
}
.store-steps li {
  counter-increment: store-step;
  padding: 10px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-weight: 600;
  font-size: var(--font-small);
  text-align: center;
  overflow-wrap: anywhere;
}
.store-steps li::before {
  content: counter(store-step) ". ";
}
.store-steps[data-step="connect"] li[data-step-name="connect"],
.store-steps[data-step="confirm"] li[data-step-name="confirm"],
.store-steps[data-step="play"] li[data-step-name="play"] {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* The one button each step needs: full width and easy to hit. */
.store-wide {
  width: 100%;
  min-height: 56px;
  font-size: 1.125rem;
}
.store-buy-options {
  display: grid;
  gap: 12px;
}
.store-connected {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.store-fine {
  color: var(--text-muted);
  font-size: var(--font-small);
}
/* The status line stays in place for screen readers but takes no room
   until it has something to say. */
.store-notice:empty {
  min-height: 0;
  padding: 0;
  border-width: 0;
}

/* Manual sign-in, other ways to pay and the raw order fields stay one tap
   away, folded so the main path is the only thing on screen. */
.store-more {
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.store-more > :not(summary) {
  margin-top: 12px;
}
.store-more summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
}
#store-sign-in[data-signed-in="true"] .store-wallet,
#store-sign-in[data-signed-in="true"] .store-more {
  display: none;
}

/* The weekly prize pools sit in the header, so a player sees what a ranked
   run can win before connecting anything. */
.store-prizes {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--highlight);
  border-radius: var(--radius);
  background: var(--highlight-soft);
}
.store-prizes h2 {
  margin: 0;
  color: var(--highlight);
  font-size: var(--font-small);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.store-prizes .store-fine,
.store-prizes-note {
  margin: 0;
}
.store-prizes-note {
  font-size: var(--font-small);
  font-weight: 600;
}
.store-prizes-tiers {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.store-prizes-tier {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.store-prizes-name {
  font-weight: 700;
}
.store-prizes-pool {
  color: var(--highlight);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
/* This week's share of the passes, filling toward the pool's minimum; once
   it passes the minimum the bar stays full and the pool keeps climbing. */
.store-prizes-meter {
  grid-column: 1 / -1;
  height: 6px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}
.store-prizes-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--highlight);
  transition: width 400ms ease-out;
}
.store-prizes-live {
  grid-column: 1 / -1;
  font-size: var(--font-small);
  font-variant-numeric: tabular-nums;
}
.store-prizes-meter[data-growing="true"] + .store-prizes-live {
  color: var(--highlight);
  font-weight: 700;
}
@media (prefers-reduced-motion: reduce) {
  .store-prizes-fill {
    transition: none;
  }
}
.store-prizes-places {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: var(--font-small);
  font-variant-numeric: tabular-nums;
}

/* The ranked streak sits under the pools: its pot so far, its milestones
   and, once a wallet is connected, that wallet's ranked days this week. */
.store-streak {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.store-streak p {
  margin: 0;
}
.store-streak-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.store-streak-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}
.store-streak-days li {
  padding: 4px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--font-small);
  text-align: center;
}
.store-streak-days li[data-played="true"] {
  border-color: var(--highlight);
  background: var(--highlight-soft);
  color: var(--highlight);
  font-weight: 700;
}
.store-streak-you {
  margin-top: 4px;
  font-size: var(--font-small);
  font-weight: 600;
}

/* The terms tick sits above Connect wallet and stays on screen once the
   wallet is connected, because buying asks for it too. */
.store-terms {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}
.store-client .store-terms-accept {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  font-weight: 400;
  font-size: var(--font-small);
  line-height: 1.45;
  cursor: pointer;
}
.store-client .store-terms-accept input {
  width: 24px;
  height: 24px;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}
.store-terms-details summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
}
.store-terms-text {
  max-height: 50vh;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--sunken);
  font-size: var(--font-small);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* R3.1 connection surface: the connect sheet, its wallet rows and the
   advanced dialog. Everything stays in revision-1 tokens; every control
   keeps the 48px floor; long wallet names and addresses wrap instead of
   overflowing, at 375px as at 1280px. */
.store-sheet {
  width: min(420px, calc(100vw - 32px));
  max-width: 420px;
  max-height: min(80vh, 720px);
  overflow-y: auto;
  margin: auto;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--sheet);
  color: var(--text);
  box-shadow: var(--shadow);
}
.store-sheet-body {
  display: grid;
  gap: 12px;
  padding: 20px;
}
/* Stripe's onramp frame sizes itself between 320px and 500px wide, so its
   sheet may use the whole screen width on phones and keeps no side padding
   around the frame; the copy and Close keep the usual gutter. */
.store-sheet.store-onramp-sheet {
  width: min(540px, 100vw);
  max-width: 540px;
  border-inline-width: 0;
}
.store-onramp-sheet .store-sheet-body {
  padding-inline: 0;
}
.store-onramp-sheet .store-sheet-body > :not(.store-onramp-element) {
  margin-inline: 20px;
}
.store-onramp-element {
  min-width: 0;
}
.store-sheet-heading {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 4vw, 1.5rem);
  line-height: 1.2;
}
.store-wallet-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.store-wallet-option {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.store-wallet-option:disabled {
  color: var(--text-muted);
  background: var(--sunken);
  cursor: not-allowed;
}
.store-wallet-badge {
  flex: none;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--sunken);
  color: var(--text-muted);
  font-size: var(--font-small);
  overflow-wrap: anywhere;
}
.store-wallet-badge-recent {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}
.store-link-button {
  min-height: 48px;
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  font-size: var(--font-small);
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.store-connected {
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--sunken);
  color: var(--text);
  font-size: var(--font-small);
  overflow-wrap: anywhere;
}
.store-apps {
  display: grid;
  gap: 8px;
  margin: 0;
}
