/* ==========================================================
   neur0doku-shop.css
   Layout for the shop screen only. Colors come from
   neur0doku-theme.css — nothing here should hardcode a color
   or reach for a site --token. Self-contained: this page loads
   neur0doku-theme.css + neur0doku-components.css (for
   .nd-icon-btn) alongside this file, so the .nd-tabs/.nd-tab-btn
   rules here are a standalone pill-toggle, same pattern as
   neur0doku-quests.css — not a dependency on any modal-tab styling.
   ========================================================== */

.neur0doku-shop {
  max-width: 460px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

/* ---------- top bar: back + thread balance ---------- */
.nd-shop-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.nd-shop-balance {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: var(--nd-surface);
  border: 1px solid var(--nd-border);
  box-shadow: 0 3px 8px var(--nd-shadow);
  font-weight: 700;
  color: var(--nd-text);
}
.nd-thread-icon { font-size: 1.1rem; }

/* ---------- Bean Vixen's counter ---------- */
.nd-shop-keeper-panel {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--nd-surface);
  border: 1px solid var(--nd-border);
  border-radius: 1.1rem;
  box-shadow: 0 4px 12px var(--nd-shadow);
  padding: 0.9rem;
  margin-bottom: 1.25rem;
}

.nd-shop-keeper-avatar {
  flex-shrink: 0;
  width: 5.5rem;
  aspect-ratio: 1;
  border-radius: 0.9rem;
  overflow: hidden;
  background: var(--nd-surface-soft);
  border: 1px solid var(--nd-border);
}
.nd-shop-keeper-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* neur0doku_shop-keeper0.png is a single static frame for now — this
     idle bob is the placeholder for "alive." A real multi-frame
     spritesheet can swap in later without touching layout: replace
     the <img> with whatever the sprite needs and drop this animation. */
  animation: nd-shop-keeper-bob 3.2s ease-in-out infinite;
}
@keyframes nd-shop-keeper-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@media (prefers-reduced-motion: reduce) {
  .nd-shop-keeper-avatar img { animation: none; }
}

.nd-shop-keeper-speech { flex: 1; min-width: 0; }
.nd-shop-keeper-name {
  margin: 0 0 0.2rem;
  font-family: ui-rounded, 'SF Pro Rounded', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 800;
  color: var(--nd-accent);
  font-size: 1rem;
}
.nd-shop-keeper-text {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--nd-text-soft);
  min-height: 2.4em;
}
.nd-shop-get-btn {
  margin-top: 0.6rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--nd-button-border);
  background: var(--nd-button-bg);
  color: var(--nd-button-ink);
  font-family: ui-rounded, 'SF Pro Rounded', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}
.nd-shop-get-btn:hover { background: var(--nd-button-bg-hover); }
.nd-shop-get-btn:focus-visible { outline: 2px solid var(--nd-focus); outline-offset: 2px; }
.nd-shop-get-btn[hidden] { display: none; }

/* ---------- category tabs ---------- */
.nd-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.nd-tab-btn {
  flex: 1;
  border: 1px solid var(--nd-button-border);
  background: var(--nd-surface);
  color: var(--nd-text-soft);
  font-family: ui-rounded, 'SF Pro Rounded', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.6rem 0.5rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.nd-tab-btn.is-active {
  background: var(--nd-button-bg);
  color: var(--nd-button-ink);
  border-color: var(--nd-button-border);
}
.nd-tab-btn:focus-visible { outline: 2px solid var(--nd-focus); outline-offset: 2px; }

/* ---------- item grid ---------- */
.nd-shop-panel[hidden] { display: none; }

.nd-shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.nd-shop-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem 0.4rem 0.7rem;
  border-radius: 1rem;
  background: var(--nd-surface);
  border: 2px solid var(--nd-border);
  box-shadow: 0 3px 8px var(--nd-shadow);
  cursor: pointer;
  font: inherit;
  text-align: center;
  color: var(--nd-text);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.nd-shop-item:hover { transform: translateY(-1px); }
.nd-shop-item:focus-visible { outline: 2px solid var(--nd-focus); outline-offset: 2px; }
.nd-shop-item.is-selected { border-color: var(--nd-accent); }

.nd-shop-item-art {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 0.7rem;
  overflow: hidden;
  background: var(--nd-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.nd-shop-item-art img { width: 100%; height: 100%; object-fit: cover; }
.nd-shop-item-thread { font-size: 1.6rem; }

.nd-shop-item.is-locked .nd-shop-item-art img { filter: grayscale(1); opacity: 0.45; }
.nd-shop-item.is-locked { cursor: default; }

.nd-shop-item-name {
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.2;
}
.nd-shop-item-cost {
  font-size: 0.72rem;
  color: var(--nd-text-soft);
}

.nd-shop-section-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--nd-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0.5rem 0 0.6rem;
}

.nd-shop-placeholder {
  background: var(--nd-surface-soft);
  border: 1px dashed var(--nd-border);
  border-radius: 1rem;
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--nd-text-soft);
  font-size: 0.82rem;
  line-height: 1.5;
}

.nd-shop-note {
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: var(--nd-text-soft);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .nd-shop-item { transition: none; }
}