/* ============================================================
   shop.css — Mercado del Tiempo. Modal con dos pestañas (Runas /
   Mejoras) y paginación: altura fija, sin scroll. Las tarjetas se
   reutilizan en la sección showcase de la landing.
   ============================================================ */
.shop-overlay {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8,8,16,0.74);
  backdrop-filter: blur(6px);
}
.shop-overlay[hidden] { display: none; }

.shop-modal {
  width: min(720px, 100%);
  height: min(620px, 92vh);
  background: rgba(15,15,26,0.96);
  border: 1px solid var(--border);
  border-left: 2px solid var(--violet);
  clip-path: var(--cut);
  padding: 22px 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.shop-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.shop-titles { display: flex; flex-direction: column; gap: 3px; }
.shop-sub { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.06em; color: var(--muted); }
.shop-slots { margin-left: auto; display: flex; align-items: baseline; gap: 6px; }
.shop-slots-label { font-family: var(--font-mono); font-size: 0.56rem; letter-spacing: 0.2em; color: var(--muted); align-self: center; }
.shop-slots-num {
  font-family: var(--font-dseg);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--violet);
  text-shadow: 0 0 12px rgba(191,90,242,0.4);
  font-variant-numeric: tabular-nums;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}
.shop-slots-num.full {
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(0,229,255,0.55);
}
.shop-life { display: flex; align-items: baseline; gap: 6px; }
.shop-life-label { font-family: var(--font-mono); font-size: 0.56rem; letter-spacing: 0.2em; color: var(--muted); align-self: center; }
.shop-life-num {
  font-family: var(--font-dseg);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--green);
  text-shadow: 0 0 12px rgba(57,255,20,0.4);
  font-variant-numeric: tabular-nums;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}
.shop-life-num.dropping {
  color: var(--red);
  text-shadow: 0 0 16px rgba(255,45,85,0.75);
}
.shop-life-num.rising {
  color: var(--green);
  text-shadow: 0 0 16px rgba(57,255,20,0.6);
}
.shop-life-unit { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); }

/* ---- Pestañas ---- */
.shop-tabs { display: flex; gap: 8px; }
.shop-tab {
  flex: 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: 2px solid var(--border);
  padding: 11px 14px;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.shop-tab:hover { color: var(--text); }
.shop-tab.active {
  color: var(--text);
  border-bottom-color: var(--violet);
  background: linear-gradient(180deg, rgba(191,90,242,0.12), transparent);
}

/* ---- Rejilla de tarjetas (2×2 = PAGE_SIZE 4), altura fija sin scroll ---- */
.shop-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr; /* siempre 2 filas: tarjetas de tamaño estable */
  gap: 12px;
  overflow: hidden;
}

.shop-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 13px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--c, var(--muted));
  clip-path: var(--cut);
  min-height: 0;
}
.shop-card.broke { opacity: 0.55; }
.shop-card.owned { opacity: 0.9; border-top-color: var(--green); }

.shop-card-top { display: flex; align-items: center; gap: 8px; }
.shop-card-icon {
  font-size: 1.2rem;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--c, var(--text));
  border: 1px solid var(--border);
  background: rgba(8,8,16,0.5);
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
}
.shop-card-rarity {
  font-family: var(--font-mono);
  font-size: 0.54rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c, var(--muted));
}
.shop-card-count { margin-left: auto; font-family: var(--font-mono); font-size: 0.7rem; color: var(--text); }
.shop-card-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  color: var(--text);
}
.shop-card-desc {
  font-family: var(--font-ui);
  font-size: 0.86rem;
  line-height: 1.4;
  color: color-mix(in srgb, var(--text) 78%, transparent);
  margin: 0;
  flex: 1;
  overflow: hidden;
}

.shop-buy {
  align-self: flex-start;
  font-family: var(--font-dseg);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  color: var(--bg);
  background: var(--green);
  border: none;
  padding: 6px 15px;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
  box-shadow: 0 0 16px -6px var(--green);
  transition: transform 0.12s ease, filter 0.15s ease;
}
.shop-buy::before { content: "−"; opacity: 0.7; margin-right: 1px; }
.shop-buy:hover { transform: translateY(-1px); filter: brightness(1.08); }
.shop-buy:disabled {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  box-shadow: none;
  cursor: not-allowed;
}
.shop-buy:disabled::before { content: ""; margin: 0; }

.shop-owned {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  border: 1px solid rgba(57,255,20,0.4);
  padding: 6px 13px;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
}

/* ---- Paginación ---- */
.shop-pager { display: flex; align-items: center; justify-content: center; gap: 16px; }
.shop-pager-btn {
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  width: 38px; height: 32px;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
  transition: border-color 0.2s ease, color 0.2s ease;
}
.shop-pager-btn:hover:not(:disabled) { border-color: var(--violet); color: var(--violet); }
.shop-pager-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.shop-dots { display: flex; gap: 7px; }
.shop-dot { width: 8px; height: 8px; background: var(--border); border-radius: 50%; transition: background 0.2s ease; }
.shop-dot.on { background: var(--violet); box-shadow: 0 0 8px rgba(191,90,242,0.6); }

/* ============================================================
   Showcase de la tienda en la landing (read-only). Reutiliza las
   .shop-card pero con precio en vez de botón de compra.
   ============================================================ */
.tienda-board {
  width: min(760px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tienda-tabs { display: flex; gap: 8px; justify-content: center; }
.tienda-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.shop-price {
  align-self: flex-start;
  font-family: var(--font-dseg);
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  color: var(--green);
  border: 1px solid rgba(57,255,20,0.35);
  padding: 5px 13px;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
}
.shop-price::before { content: "−"; opacity: 0.6; margin-right: 1px; }

@media (max-width: 560px) {
  .shop-modal { height: min(640px, 92vh); }
  .shop-card-desc { font-size: 0.8rem; }
}
