/*
 * The Store.
 *
 * The shell, palette and motion come from season.css. What is here is the part
 * only a store needs: the tile grid, the confirm bar, and the purchase overlay.
 */

/* ---------------- body ---------------- */

.ar-body { flex: 1; min-height: 0; padding: 26px 30px; }

.ar-hero { text-align: center; padding: 26px 0 34px; }

.ar-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .34em;
  color: var(--dim);
  margin-bottom: 12px;
}

.ar-title {
  margin: 0;
  font-size: 64px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--ink);
}

.ar-sub { font-size: 11px; letter-spacing: .14em; color: var(--soft); margin-top: 14px; }

/* ---------------- a section ---------------- */

.ar-sec { margin-bottom: 26px; }

.ar-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

/*
 * The row titles carry the page.
 *
 * They were set at eleven pixels, the size of a field label, which left the
 * shelves reading as one long undifferentiated scroll: the only thing with any
 * weight on the page was the hero, and everything under it was a caption. At
 * the design's twenty six they do the job a shop's aisle signs do, which is to
 * be findable from the top of the page without reading anything.
 */
.ar-sec-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--ink);
  text-transform: uppercase;
}
.ar-sec-note { font-size: 12px; letter-spacing: .14em; color: var(--dim); }

/*
 * One line per row, scrolled sideways.
 *
 * A carousel rather than a grid because these are things to glance along and
 * pick from, not a catalogue to study. A grid of a dozen pushes everything
 * under it off the screen, so the second and third rows are never seen.
 *
 * Scroll snap rather than arrows and a JS index: the browser already does this
 * correctly with a trackpad, a touch screen and a keyboard, and none of that
 * can break.
 */
.ar-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 244px;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  /* Room for the lift on hover and the focus ring, which a hidden overflow clips. */
  padding: 4px 4px 14px;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
}

.ar-grid::-webkit-scrollbar { height: 6px; }
.ar-grid::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 999px; }

.ar-tile { scroll-snap-align: start; }

/* ---------------- a tile ---------------- */

.ar-tile {
  position: relative;
  height: 320px;
  background: var(--tile);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  padding: 0;
  border: 0;
  font: inherit;
  color: inherit;
  display: block;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .35);
  transition: box-shadow .18s ease, transform .18s ease;
}

.ar-tile:hover { transform: translateY(-3px); }
.ar-tile.is-on { box-shadow: 0 0 0 2px var(--ink), 0 8px 40px rgba(0, 0, 0, .5); }
.ar-tile.is-out { opacity: .55; }
.ar-tile:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

/*
 * The art. Lit with the item's own tint rather than showing a picture, because
 * the catalogue ships colours and not renders. A tile that reads as a distinct
 * object at a glance is the job; a placeholder box labelled "3D render" is not.
 */
.ar-art {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(78% 58% at 50% 74%, color-mix(in srgb, var(--tint, #3fdc6f) 55%, transparent), transparent 72%),
    radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--tint, #3fdc6f) 14%, transparent), transparent 62%),
    linear-gradient(168deg, #17171d, #0b0b0f);
}

/*
 * Pack artwork sits in the tile rather than filling it.
 *
 * Contained, not covered. Cover is right for a photograph used as a backdrop
 * and wrong for a product shot on a transparent background: the briefcase lost
 * forty nine percent of itself to the crop and the bags thirteen and twenty, so
 * what a buyer saw was a detail of a thing rather than the thing.
 *
 * Padded clear of the caption plate at the foot, which is fifty two pixels of
 * gradient before its own content starts.
 *
 * One rule, on the descendant selector, because there were two: .ar-art img and
 * .ar-art-img both matched this same element, and the first quietly won on
 * specificity. The padding from the second applied and its object-fit did not,
 * which is a hard thing to see and an easy thing to avoid by not writing the
 * pair in the first place.
 */
.ar-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 18px 18px 104px;
  object-fit: contain;
  display: block;
}

/* The glyph, when there is no photograph. Large, dim, and behind the text. */
/*
 * A shelf that has nothing on it yet.
 *
 * Stated at the height a row of tiles would occupy, so the page keeps its
 * rhythm and the shelf reads as reserved rather than as something that failed
 * to load.
 */
.ar-soon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 132px;
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .015);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--dim);
  text-align: center;
  padding: 20px;
}

.ar-glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 86px;
  line-height: 1;
  color: color-mix(in srgb, var(--tint, #3fdc6f) 70%, #fff 30%);
  opacity: .5;
  text-shadow: 0 0 44px color-mix(in srgb, var(--tint, #3fdc6f) 60%, transparent);
}

.ar-cap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(4, 4, 6, .72), transparent);
  border-radius: 14px 14px 0 0;
  pointer-events: none;
  z-index: 2;
}

.ar-cap-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; }
/*
 * The circled i, from the design.
 *
 * It replaces a star, which decorated the corner without telling anybody
 * anything, and it is on every tile rather than only the artifacts: a shopper
 * wanting to know what a thing is should not have to learn which categories
 * happen to explain themselves.
 */
.ar-cap-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid currentColor;
  background: rgba(6, 6, 9, .6);
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}
.ar-cap-info:hover { background: rgba(6, 6, 9, .9); }

.ar-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 52px 14px 14px;
  background: linear-gradient(180deg, transparent, rgba(4, 4, 6, .62) 30%, rgba(4, 4, 6, .94) 75%);
  border-radius: 0 0 14px 14px;
  pointer-events: none;
  z-index: 2;
}

.ar-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.ar-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  color: #fff;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ar-price { display: flex; align-items: baseline; gap: 7px; white-space: nowrap; }
/*
 * What the object is actually worth, said plainly.
 *
 * Never struck through. A strikethrough means "this used to cost that", and
 * this number is the retail value of the thing in the parcel. Presenting worth
 * as a former price manufactures a discount that does not exist, on a page that
 * takes money.
 */
.ar-worth { font-size: 10.5px; letter-spacing: .14em; color: var(--dim); margin-top: -4px; }

.ar-now { font-size: 12px; font-weight: 700; letter-spacing: .04em; }

.ar-acts { display: flex; align-items: center; gap: 8px; }

.ar-buy {
  pointer-events: auto;
  flex: 1;
  text-align: center;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  border-radius: 999px;
  padding: 10px 12px;
  border: 1px solid transparent;
  background: var(--green);
  color: #04120a;
  cursor: pointer;
  transition: filter .15s ease;
}

.ar-buy:hover:not(:disabled) { filter: brightness(1.12); }

.ar-buy:disabled,
.ar-buy.is-off {
  background: rgba(20, 20, 22, .8);
  color: var(--dim);
  border-color: var(--edge);
  cursor: default;
}

/* Secondary action on a tile: the info panel, or the link out to Arkade. */
.ar-alt {
  pointer-events: auto;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(20, 20, 22, .75);
  border: 1px solid var(--edge);
  color: var(--mute);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s ease, color .15s ease;
}

.ar-alt:hover { border-color: var(--mute); color: var(--ink); }

/* ---------------- bottom bar ---------------- */

.ar-bottom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 14px 26px;
  border-top: 1px solid var(--rule);
}

.ar-fine { font-size: 12px; letter-spacing: .14em; color: var(--dim); }

.ar-confirm {
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 28px;
  background: var(--green);
  color: #04120a;
  cursor: pointer;
  transition: filter .15s ease;
}

.ar-confirm:hover:not(:disabled) { filter: brightness(1.12); }

.ar-confirm:disabled {
  background: #141416;
  color: var(--dim);
  border-color: var(--edge);
  cursor: default;
}

.ar-after { font-size: 12px; letter-spacing: .14em; color: var(--dim); text-align: right; }
.ar-after.is-short { color: var(--red); }

/* ---------------- the purchase overlay ---------------- */

.fx {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 2, 4, .84);
  backdrop-filter: blur(12px);
  animation: fadeIn .25s ease;
}

.fx[hidden] { display: none; }

.fx-box { position: relative; width: 520px; max-width: 90vw; text-align: center; }

.fx-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 340px;
  height: 340px;
  margin: -170px 0 0 -170px;
  border: 1px solid var(--fx, #3fdc6f);
  border-radius: 50%;
  animation: ringOut 1.7s ease-out infinite;
  pointer-events: none;
}

.fx-ring:nth-of-type(2) { animation-delay: .55s; }
.fx-ring:nth-of-type(3) { animation-delay: 1.1s; }

.fx-part { position: absolute; top: 50%; left: 50%; pointer-events: none; }
.fx-part i { display: block; border-radius: 2px; animation: partFly .9s ease-out forwards; }

.fx-stamp {
  width: 92px;
  height: 92px;
  margin: 0 auto 24px;
  border: 2px solid var(--fx, #3fdc6f);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 40px;
  color: var(--fx, #3fdc6f);
  animation: popIn .45s cubic-bezier(.2, 1.6, .4, 1);
  box-shadow: 0 0 44px color-mix(in srgb, var(--fx, #3fdc6f) 35%, transparent);
}

.fx-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--fx, #3fdc6f);
  margin-bottom: 12px;
  animation: fadeUp .3s ease;
}

.fx-title {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  line-height: 1.1;
  margin-bottom: 10px;
  animation: fadeUp .35s ease;
}

.fx-title.is-amount { color: var(--fx, #3fdc6f); }
.fx-sub { font-size: 12px; letter-spacing: .1em; color: var(--mute); min-height: 18px; }

.fx-bar {
  position: relative;
  width: 260px;
  height: 3px;
  margin: 26px auto 0;
  background: var(--rule);
  border-radius: 2px;
  overflow: hidden;
}

.fx-bar i {
  position: absolute;
  top: 0;
  width: 40%;
  height: 100%;
  background: var(--fx, #3fdc6f);
  animation: barSweep .8s linear infinite;
}

.fx-steps { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 28px; }
.fx-step { display: flex; align-items: center; gap: 7px; font-size: 11px; letter-spacing: .16em; color: var(--dim); }
.fx-step i { display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--edge); }
.fx-step.is-done { color: var(--fx, #3fdc6f); }
.fx-step.is-done i { background: var(--fx, #3fdc6f); }
.fx-step.is-now { color: var(--fx, #3fdc6f); }
.fx-step.is-now i { background: var(--fx, #3fdc6f); box-shadow: 0 0 10px var(--fx, #3fdc6f); }

.fx-go {
  margin-top: 30px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  background: var(--fx, #3fdc6f);
  color: #060608;
  border: 0;
  border-radius: 999px;
  padding: 13px 34px;
  cursor: pointer;
  animation: fadeUp .35s ease;
}

.fx-go:hover { filter: brightness(1.15); }

/* ---------------- what they already hold ---------------- */

.ar-mine { margin-top: 34px; }
.ar-mine ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.ar-mine li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: rgba(255, 255, 255, .02);
  font-size: 13px;
}

.ar-mine b { font-weight: 700; }
.ar-mine .st { font-size: 12px; color: var(--mute); }
.ar-mine .tk { margin-left: auto; font-size: 12px; color: var(--dim); font-family: 'Space Mono', ui-monospace, monospace; }

.ar-empty { color: var(--dim); font-size: 13px; letter-spacing: .1em; }

/* ---------------- the info panel ---------------- */

.ar-sheet {
  width: min(440px, 92vw);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: var(--ink);
  padding: 26px;
  font-family: inherit;
}

.ar-sheet::backdrop { background: rgba(2, 2, 4, .7); backdrop-filter: blur(4px); }
.ar-sheet h3 { margin: 0 0 4px; font-size: 20px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.ar-sheet .game { margin: 0 0 16px; font-size: 11px; letter-spacing: .18em; color: var(--green); }
.ar-sheet p { margin: 0 0 12px; font-size: 13.5px; line-height: 1.6; color: #c9c9d1; }
.ar-sheet .why { color: var(--mute); }
.ar-sheet .price { font-size: 12px; letter-spacing: .12em; color: var(--dim); }

.ar-sheet-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: 0;
  color: var(--dim);
  font-size: 16px;
  cursor: pointer;
}

/*
 * The shelves on a narrow screen.
 *
 * These live here rather than in season.css, which is where they used to be
 * and where they did real damage. That file still carried the four-up grid
 * this row was before it became a carousel, so on a phone it was setting
 * grid-template-columns on a container whose flow is `column`. The first tile
 * landed in that one explicit full-width column and the rest went into 244px
 * implicit ones, which is why the first card ran off the right edge with its
 * price and its button cut off, and the ones behind it were a different size.
 *
 * A carousel only needs its column width changed. Narrower here so a second
 * card peeks in at the edge, which is what tells somebody the row scrolls.
 */
@media (max-width: 860px) {
  .ar-grid { grid-auto-columns: 208px; gap: 10px; }
  .ar-tile { height: 292px; }

  /*
   * The shelf label and its note stop sharing a line.
   *
   * Side by side they fit on a desktop and nowhere near it on a phone: the
   * note wrapped to three lines beside a twenty six pixel title and ran into
   * it. Stacked, the title still leads and the note reads as the caption it
   * is, rather than being dropped, which would lose the one line saying what
   * the shelf actually is.
   */
  .ar-sec-head { flex-direction: column; align-items: flex-start; gap: 2px; }
  .ar-sec-note { font-size: 11px; letter-spacing: .1em; }
}

@media (max-width: 520px) {
  .ar-grid { grid-auto-columns: 176px; }
  .ar-tile { height: 260px; }
  .ar-art img { padding: 12px 12px 88px; }
  .ar-sec-title { font-size: 21px; }
  .ar-name { font-size: 11px; }
  .ar-buy { padding: 9px 10px; font-size: 11px; }
}
