/* Nexus Game — store page styles (library, cards, game dialog) */

.main-area { padding-top: 26px; padding-bottom: 80px; }

/* Search row */
.search-row { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.search-field { position: relative; flex: 1; min-width: 220px; }
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted-2); display: inline-flex;
}
.search-field input {
  width: 100%; padding: 11px 14px 11px 38px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: .92rem;
  outline: none; transition: border-color .12s, box-shadow .12s;
}
.search-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.stat { font-size: .84rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Headings */
.wrap-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 18px;
}
.wrap-head h1 { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; }
.wrap-head h2 { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; }
.count { color: var(--accent); }
.hint { font-size: .82rem; }

/* Card grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; text-align: left; padding: 0;
  transition: transform .14s, border-color .14s; color: var(--text);
}
button.card { cursor: pointer; }
.card:hover:not(.unavailable) { transform: translateY(-3px); border-color: var(--border-strong); }
.card.unavailable { opacity: .55; cursor: not-allowed; }
.card .thumb { position: relative; aspect-ratio: 16 / 9; background: var(--bg-2); overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .thumb .no-art {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted-2); background: linear-gradient(135deg, var(--surface-2), var(--bg-2));
}
.card .thumb .no-art .icon { width: 34px; height: 34px; }
.card .veil { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(10, 13, 22, .65)); pointer-events: none; }
.card .badge { position: absolute; top: 8px; right: 8px; }
.card .acc-pill {
  position: absolute; left: 8px; bottom: 8px;
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(10, 13, 22, .75); color: #9db9ff;
  font-size: .7rem; font-weight: 700; padding: 3px 9px; border-radius: 999px;
}
.card.unavailable .acc-pill { color: var(--muted-2); }
.card .body { padding: 11px 12px 13px; }
.card .name {
  font-size: .9rem; font-weight: 700; line-height: 1.3; margin-bottom: 5px; min-height: 2.4em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .meta { display: flex; justify-content: space-between; font-size: .74rem; color: var(--muted-2); font-variant-numeric: tabular-nums; }

#library-h { scroll-margin-top: 90px; }
.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: 28px auto 0; }
.pager-btn {
  min-width: 40px; height: 40px; padding: 0 12px; border-radius: 10px; font: inherit; font-size: .88rem; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); cursor: pointer;
  font-variant-numeric: tabular-nums; transition: border-color .15s var(--ease), background .15s var(--ease);
}
.pager-btn:hover:not(:disabled) { border-color: var(--border-strong); }
.pager-btn:disabled { cursor: default; opacity: .4; }
.pager-btn[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; opacity: 1; }
.pager-gap { min-width: 20px; text-align: center; color: var(--muted-2); }
@media (max-width: 600px) {
  .pager { gap: 4px; }
  .pager-btn { min-width: 36px; height: 38px; padding: 0 8px; }
}

/* Notifications */
.notif-wrap { position: relative; }
.notif-dot {
  position: absolute; top: 7px; right: 7px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--danger); border: 2px solid var(--surface);
}
.notif-drop {
  position: absolute; right: 0; top: 46px; width: 320px; max-height: 360px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow); z-index: 100; padding: 6px 0;
}
/* On a phone the bell sits mid-header, so a dropdown anchored to it would
   run off the left edge: pin it under the header, full width instead. */
@media (max-width: 600px) {
  .notif-drop { position: fixed; top: 62px; left: 12px; right: 12px; width: auto; }
}
.notif-item { padding: 11px 15px; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: 0; }
.notif-item.unread { background: var(--accent-soft); }
.notif-item .msg { font-size: .87rem; }
.notif-item .when { font-size: .74rem; color: var(--muted); margin-top: 3px; }
.notif-empty { padding: 18px; text-align: center; color: var(--muted); font-size: .86rem; }

/* Game dialog */
.game-dialog { width: min(560px, calc(100vw - 32px)); padding: 0; }
.game-hero { aspect-ratio: 16 / 7; background: var(--bg-2); overflow: hidden; }
.game-hero img { width: 100%; height: 100%; object-fit: cover; }
.game-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.game-head h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; }
.game-sub { font-size: .85rem; margin-top: 3px; }

.guest-box {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center; padding: 22px 16px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2);
}
.guest-box p { font-size: .86rem; color: var(--muted); max-width: 36ch; }
.guest-icon {
  width: 46px; height: 46px; border-radius: 13px;
  background: var(--accent-soft); color: var(--accent); display: grid; place-items: center;
}
.guest-icon .icon { width: 22px; height: 22px; }

.dialog-actions.no-border { border-top: 0; padding: 4px 0 0; }

@media (max-width: 680px) {
  .main-area { padding-top: 18px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .wrap-head h1 { font-size: 1.2rem; }
  .game-head h2 { font-size: 1.12rem; }
  .card .name { font-size: .84rem; }
}
@media (max-width: 380px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

.game-hero { background: linear-gradient(135deg, var(--bg-2), var(--bg-3, var(--bg-2))); }
.game-hero img[data-hidden="true"] { display: none; }

/* ===== Partner referral banner (visits.js) =====
   Only the store page carries #partner-banner, so the rule lives here rather
   than pulling in partner.css — whose generic `.card` was overriding the card
   grid above (24px padding and a larger radius, leaving the artwork inset). */
.partner-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; margin: 16px 0 4px;
  border-radius: var(--radius); font-size: .92rem;
  background: var(--success-soft); color: var(--text);
  border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
}
.partner-banner-icon { color: var(--success); display: inline-flex; }

/* ===== Shared credential pieces =====
   These class names ship in store.html but no stylesheet defined them, so the
   credential rows collapsed into plain stacked text.
   (.btn-block and .form-note are shared with partner.html and live in site.css.) */
.acc-switch {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
  padding: 10px 14px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border);
}
.acc-switch-label { font-size: .82rem; color: var(--muted); font-weight: 600; }
.acc-switch-ctrl { display: inline-flex; align-items: center; gap: 8px; }
.acc-idx { font-size: .84rem; color: var(--muted); min-width: 3.5ch; text-align: center; }

.cred-field {
  display: grid; grid-template-columns: 90px minmax(0, 1fr);
  align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.cred-field:last-of-type { border-bottom: 0; }
.cred-key { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cred-value { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.cred-value .mono { overflow-wrap: anywhere; }

@media (max-width: 480px) {
  .cred-field { grid-template-columns: 1fr; gap: 4px; align-items: start; }
}
