/* Season 4 power-up shop: Purchase buttons and checkout dialog. */
.buy-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.power-card .buy {
  font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer;
  padding: .5rem .9rem; border-radius: 999px; min-height: 44px;
  color: #1a1405; background: linear-gradient(180deg, #f6d77a, #d4a53a);
  border: 1px solid #f3dc97; box-shadow: 0 2px 10px rgba(212, 165, 58, .25);
  transition: transform .15s ease, box-shadow .15s ease;
}
.power-card .buy:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(212, 165, 58, .4); }
/* No confirmed price yet: visible, but not a purchase. */
.power-card .buy.pending, .power-card .buy.pending:hover {
  cursor: not-allowed; transform: none; box-shadow: none;
  color: #d8cfb8; background: transparent; border: 1px dashed #6b5520;
}
.power-card .buy:focus-visible, .shop-dialog :focus-visible { outline: 3px solid #fff2c4; outline-offset: 2px; }

/* Shop availability above the Singer powers cards (spans the whole card grid). */
.shop-avail {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem;
  padding: .75rem 1rem; border: 1px solid #6b5520; border-radius: 12px; background: rgba(217, 178, 95, .06);
}
.shop-avail[data-state="unavailable"], .shop-avail[data-state="error"] { border-color: #a3122c; background: rgba(163, 18, 44, .12); }
.shop-avail-text { flex: 1 1 16rem; margin: 0; font-size: .92rem; line-height: 1.45; }
.shop-avail[data-state="unavailable"] .shop-avail-text, .shop-avail[data-state="error"] .shop-avail-text { color: #ffb3a6; }
.shop-avail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.shop-avail-member, .shop-dialog .shop-member { color: #f6d77a; font-size: .9rem; text-underline-offset: 3px; }
.shop-avail-member { display: inline-flex; align-items: center; min-height: 44px; }
.shop-avail [hidden] { display: none !important; }
.shop-dialog .shop-member { display: inline-block; margin: -.5rem 0 .25rem; padding: .35rem 0; }

.shop-backdrop {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  padding: 1rem; background: rgba(0, 0, 0, .72); overflow-y: auto;
  animation: shop-fade .18s ease;
}
.shop-backdrop[hidden] { display: none; }
.shop-dialog {
  width: min(440px, 100%); max-height: calc(100dvh - 2rem); overflow-y: auto;
  background: #111; color: #f4efe2; border: 1px solid #6b5520; border-radius: 16px;
  padding: 1.25rem 1.25rem 1rem; box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
  animation: shop-rise .22s ease;
}
.shop-dialog h2 { margin: 0 0 .25rem; font-size: 1.25rem; color: #f6d77a; }
.shop-dialog .shop-price { margin: 0 0 1rem; font-size: 1rem; }
.shop-dialog .shop-price strong { font-size: 1.35rem; color: #fff; }
.shop-dialog label { display: block; font-weight: 600; margin: .75rem 0 .3rem; }
.shop-dialog input[type="search"], .shop-dialog select {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; /* no iOS zoom */
  padding: .6rem .7rem; border-radius: 10px; border: 1px solid #555; background: #1c1c1c; color: #f4efe2;
}
.shop-dialog select { min-height: 44px; }
.shop-dialog .shop-confirm { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; margin-top: 1rem; }
.shop-dialog .shop-confirm input { width: 1.2rem; height: 1.2rem; margin-top: .15rem; flex: none; accent-color: #d4a53a; }
.shop-dialog .shop-note { font-size: .85rem; color: #bdb5a2; margin: .9rem 0 0; line-height: 1.45; }
.shop-dialog .shop-status { min-height: 1.4em; margin: .8rem 0 0; font-size: .92rem; }
.shop-dialog .shop-status.error { color: #ff9b8a; }
.shop-dialog .shop-status.ok { color: #9be3a8; }
.shop-dialog .shop-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; margin-top: 1rem; }
.shop-dialog .shop-actions button {
  font: inherit; font-weight: 700; min-height: 44px; padding: .55rem 1rem; border-radius: 999px; cursor: pointer;
  border: 1px solid #6b5520; background: transparent; color: #f4efe2;
}
.shop-dialog .shop-actions .shop-go { background: linear-gradient(180deg, #f6d77a, #d4a53a); color: #1a1405; border-color: #f3dc97; }
.shop-dialog .shop-actions button:disabled { opacity: .45; cursor: not-allowed; }
.shop-dialog [hidden] { display: none !important; }
body.shop-open { overflow: hidden; }

@media (max-width: 420px) {
  .shop-backdrop { align-items: end; padding: 0; }
  .shop-dialog { border-radius: 16px 16px 0 0; max-height: 92dvh; }
  .shop-dialog .shop-actions button { flex: 1 1 auto; }
}
@keyframes shop-fade { from { opacity: 0; } }
@keyframes shop-rise { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) {
  .shop-backdrop, .shop-dialog { animation: none; }
  .power-card .buy { transition: none; }
  .power-card .buy:hover { transform: none; }
}
