/* =====================================================================
   DECK GRID — five columns now
   ===================================================================== */

/* Bet | Win | Boosts | Socials | Refill. The boosts dock took the
   deck's spare width, which is what it was for. */
section.control-bar {
  grid-template-columns: auto auto auto minmax(0, 1fr) auto;
}

@media (max-width: 900px) {
  .spin-btn { max-width: 150px; }
  .shop-cta { max-width: 150px; }
  .spin-cluster { gap: 8px; }
}

@media (max-width: 720px) {
  section.control-bar {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  /* The links are the first thing that can go: they are not part of
     playing, and the footer on the landing page still has them. */
  .deck-socials { display: none; }

  .spin-cluster { flex-direction: row; align-items: center; gap: 6px; }
  .spin-btn { max-width: 108px; }
  .shop-cta { max-width: 78px; padding: 12px 4px; letter-spacing: 1px; }
  .refill-pill { min-width: 0; padding: 5px 10px; }
  .hud-plus { width: 17px; height: 17px; margin-left: 4px; font-size: 0.72rem; }
}

/* The refill button became a pill; the reduced-motion opt-out has to
   follow it or the pulse keeps running for people who asked it not to. */
@media (prefers-reduced-motion: reduce) {
  .refill-pill.is-ready,
  .spin-btn:not(:disabled),
  .spin-btn::after,
  .shop-cta-shine { animation: none; }
  .spin-btn::after, .shop-cta-shine { opacity: 0; }
}

/* The left rail packs to the TOP. It was spread across the full height,
   which pushed the utility buttons down into the band the mascot's
   speech bubble opens into — the two were fighting for the same corner. */
.rail-left { justify-content: flex-start; }

/* Modifiers are the one thing here that can grow without limit, so they
   are what gives when the rail runs short. */
.slot-machine .modifier-bar { flex: 0 1 auto; min-height: 0; }

/* The + is a badge on the tile's corner, not another item competing for
   the row's width — inline it was squeezing "173/125" and landing on
   top of the number it is meant to be offering to raise. */
.hud-spins, .hud-coins { position: relative; }

.hud-plus {
  position: absolute;
  top: -6px;
  right: -6px;
  margin: 0;
  z-index: 5;
}

@media (max-width: 720px) {
  /* One prize, legible, beats four ellipses. The rail shares its row
     with SHOP, SPIN and HOLD on a phone, and four chips in what is left
     of 375px could only ever render as "2…". */
  .prize-row:nth-child(n + 2) { display: none; }
  .prize-row { flex: 0 1 auto; padding: 5px 9px; }
  .prize-row-value { font-size: 0.78rem; }
  .prize-ladder { flex: 0 1 auto; }
}

/* =====================================================================
   THE INFO BUTTON — one icon, everywhere
   ---------------------------------------------------------------------
   The artwork is a black disc with a white glyph, which is invisible on
   this UI. Inverted it becomes a light disc with a dark glyph, which
   reads on every one of the four themes.
   ===================================================================== */

.info-btn,
.hud-level-info {
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  background: url('/assets/ui/shop/info.png') center / contain no-repeat;
  filter: invert(1) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
  opacity: 0.72;
  cursor: pointer;
  font-size: 0;              /* any text label is decorative now */
  transition: opacity 160ms ease, transform 160ms ease, filter 160ms ease;
}

.info-btn:hover,
.hud-level-info:hover,
.hud-level-info.open {
  opacity: 1;
  transform: scale(1.15);
  filter: invert(1) drop-shadow(0 0 6px rgba(34, 227, 255, 0.9));
}

/* The level bar's copy is small and sits inside a crowded row. */
.hud-level-info {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  border-radius: 50%;
}

.shop-card-info.info-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

/* =====================================================================
   THE SHINE — no more hard stop
   ---------------------------------------------------------------------
   The old keyframes parked the highlight off-screen for the pause and
   then jumped it back to the start, which reads as a stutter. The sweep
   now runs the whole cycle in one direction and simply spends most of
   that cycle out of frame, so there is nothing to jump back FROM.
   ===================================================================== */

@keyframes spinBtnShine {
  0%   { background-position: 190% 0; }
  32%  { background-position: -90% 0; }
  100% { background-position: -90% 0; }
}

@keyframes shopCtaShine {
  0%   { background-position: 190% 0; }
  28%  { background-position: -90% 0; }
  100% { background-position: -90% 0; }
}

/* Longer cycles so the visible sweep keeps its speed while the gap
   between sweeps does the waiting. */
.spin-btn::after { animation-duration: 5.2s; animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
.shop-cta-shine  { animation-duration: 4.4s; animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }

/* =====================================================================
   ACTIVE BOOSTS, IN THE RAIL
   ===================================================================== */

.active-boosts {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.active-boosts[hidden] { display: none; }

.boost-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--cyan-deep);
  background: linear-gradient(180deg, rgba(34, 227, 255, 0.16), rgba(0, 0, 0, 0.4));
  box-shadow: 0 0 12px rgba(34, 227, 255, 0.25);
  animation: boostChipIn 260ms ease-out both;
}

@keyframes boostChipIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

.boost-chip img {
  width: clamp(16px, 1.7vw, 22px);
  height: clamp(16px, 1.7vw, 22px);
  object-fit: contain;
}

.boost-chip-body { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }

.boost-chip-label {
  font-size: clamp(0.46rem, 0.7vw, 0.58rem);
  font-weight: 700;
  letter-spacing: 1px;
  color: #a8f4ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.boost-chip-detail {
  font-size: clamp(0.52rem, 0.8vw, 0.66rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

/* An armed one-shot is gold, not cyan — it is about to fire once rather
   than running down. */
.boost-chip.is-armed {
  border-color: var(--gold-deep);
  background: linear-gradient(180deg, rgba(255, 217, 77, 0.18), rgba(0, 0, 0, 0.4));
  box-shadow: 0 0 12px rgba(255, 184, 0, 0.3);
}

.boost-chip.is-armed .boost-chip-label { color: var(--gold); }

/* =====================================================================
   BULK QUANTITY ON SHOP CARDS
   ===================================================================== */

.shop-qty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 6px 0 2px;
}

.shop-qty-btn {
  min-width: 26px;
  padding: 3px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-dim);
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.07);
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease, transform 120ms ease;
}

.shop-qty-btn:hover {
  color: #06212b;
  border-color: var(--cyan);
  background: var(--cyan-bright);
}

.shop-qty-btn:active { transform: scale(0.9); }

.shop-qty-max { font-size: 0.58rem; letter-spacing: 1px; }

.shop-qty-value {
  min-width: 2.2ch;
  text-align: center;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
}

/* Prices scale with the balance; the card says so rather than quietly
   charging more than the number the player remembers. */
.shop-card-wealth {
  margin-top: 2px;
  font-size: 0.56rem;
  letter-spacing: 0.5px;
  color: var(--gold-deep);
  cursor: help;
}

.shop-card-store {
  margin-top: 2px;
  font-size: 0.56rem;
  letter-spacing: 0.5px;
  color: var(--cyan-deep);
}

/* =====================================================================
   THE BAG
   ===================================================================== */

.shop-bag-section {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border-dim);
}

.shop-bag-title {
  margin: 0 0 10px;
  font-size: 1rem;
  letter-spacing: 3px;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(255, 184, 0, 0.5);
}

/* Pops when something lands in it, so a purchase that flew here is
   acknowledged by the thing it flew to. */
.shop-bag-title.target-pop,
.shop-close.target-pop {
  animation: targetPop 520ms cubic-bezier(0.2, 1.5, 0.4, 1);
}

@keyframes targetPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.22); filter: brightness(1.6); }
  100% { transform: scale(1); }
}

.shop-bag {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
}

.shop-bag-empty {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.bag-item {
  position: relative;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-dim);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.35));
}

.bag-item.is-blocked { opacity: 0.55; }

.bag-item-count {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
}

.bag-item-icon { width: 30px; height: 30px; object-fit: contain; }
.bag-item-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }

.bag-item-label {
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bag-item-detail { font-size: 0.62rem; color: var(--text-dim); }

.bag-item-use {
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--cyan);
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.66rem;
  letter-spacing: 1px;
  color: #06212b;
  background: linear-gradient(180deg, #a8f4ff, #22e3ff 60%, #0a9fc0);
  transition: transform 120ms ease, box-shadow 200ms ease;
}

.bag-item-use:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(34, 227, 255, 0.7);
}

.bag-item-use:disabled {
  cursor: not-allowed;
  filter: grayscale(0.8) brightness(0.7);
}

/* =====================================================================
   FLIGHTS TO THE BAG / THE FLOOR
   ===================================================================== */

.reward-fly-chest,
.reward-fly-bag {
  width: 46px;
  height: 46px;
}

.fly-count-badge {
  position: fixed;
  transform: translate(-50%, -50%);
  padding: 3px 11px;
  border-radius: var(--radius-pill);
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  color: #1a0f00;
  background: linear-gradient(180deg, #fff3c4, #ffd94d 50%, #ffb800);
  box-shadow: 0 0 18px rgba(255, 184, 0, 0.8);
  pointer-events: none;
  z-index: 3000;
  animation: flyCountIn 1.6s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

@keyframes flyCountIn {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  22%  { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  36%  { transform: translate(-50%, -50%) scale(1); }
  78%  { opacity: 1; transform: translate(-50%, -140%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -190%) scale(0.9); }
}

