/* ─────────────────────────────────────────────────────────
   GAME PLATFORM — store, library, wallet, developer, chat
   Reuses the design tokens from app.css; only adds layout
   for the new pages.
   ───────────────────────────────────────────────────────── */

/* page gutters for list-style pages */
.catalog-page.narrow { max-width: 1040px; }
.catalog-page.narrow > :not(.catalog-header),
.catalog-page.pad > :not(.catalog-header) { margin-left: 64px; margin-right: 64px; }
.catalog-page.narrow > .catalog-header + *,
.catalog-page.pad > .catalog-header + * { margin-top: 28px; }
.screenshot-strip,
.detail-hero ~ .dm-block,
.manage-grid,
.back-link ~ .dnd-form,
.back-link ~ .catalog-header ~ .dnd-form { margin-left: 64px; margin-right: 64px; }
.detail-hero ~ .dm-block { margin-top: 28px; }
.section-title { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 32px 0 12px; }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); }
.pad { padding: 12px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.pos { color: var(--green); }
.neg { color: var(--ink-50); }
.clickable { cursor: pointer; }

.btn.ghost { border-color: var(--rule); background: transparent; }
.btn.ghost:hover { border-color: var(--ink); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.xs { padding: 1px 6px; font-size: 11px; margin-left: auto; }

/* store cards + buy box */
.price-badge {
  position: absolute; right: 10px; bottom: 10px;
  background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 12px; padding: 3px 8px;
}
.detail-cover.cover-wide { aspect-ratio: 16 / 9; background-size: cover; background-position: center; background-color: var(--paper-2); }
.buy-box { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 20px; padding: 16px; border: 1px solid var(--rule); background: var(--paper-2); }
.buy-price { font-family: var(--display); font-size: 26px; font-weight: 600; margin-right: 8px; }
.screenshot-strip { display: flex; gap: 12px; overflow-x: auto; padding: 24px 0 8px; }
.screenshot-strip img { height: 180px; border: 1px solid var(--rule); display: block; }
.screenshot-strip.small { margin: 0; padding: 8px 0; }
.screenshot-strip.small img { height: 90px; }
.screenshot-strip .shot { position: relative; }
.screenshot-strip .shot .btn { position: absolute; top: 4px; right: 4px; background: var(--paper); }
.review-form { margin-bottom: 20px; }
.review-choice { display: flex; gap: 8px; }
.review { border-top: 1px solid var(--rule-soft); padding: 14px 0; }
.review-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.review-verdict { font-weight: 600; }
.review-verdict.good { color: var(--green); }
.review-verdict.bad { color: var(--red); }
.review p { margin: 6px 0 0; white-space: pre-wrap; }

/* list rows (cart, library, wishlist, friends) */
.line-list { display: flex; flex-direction: column; border: 1px solid var(--rule); }
.line-item { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--rule-soft); }
.line-item:last-child { border-bottom: none; }
.line-thumb { width: 120px; aspect-ratio: 16 / 9; background: var(--paper-3) center / cover no-repeat; flex-shrink: 0; display: block; }
.line-thumb.sm { width: 64px; }
.line-main { flex: 1; min-width: 0; }
.line-main a { color: var(--ink); text-decoration: none; }
.line-price { font-family: var(--mono); white-space: nowrap; }
.line-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.checkout-box { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 20px; padding: 20px; border: 1px solid var(--ink); }

/* payments */
.sim-card { max-width: 480px; margin: 60px auto; padding: 32px; border: 1px dashed var(--rust); background: var(--paper-2); text-align: center; }
.sim-amount { font-family: var(--display); font-size: 40px; font-weight: 600; margin: 12px 0 4px; }
.wallet-card { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding: 24px; border: 1px solid var(--rule); background: var(--paper-2); }
.wallet-balance { font-family: var(--display); font-size: 36px; font-weight: 600; }
.wallet-topup { display: flex; gap: 8px; flex-wrap: wrap; }

/* developer */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stat-card { padding: 16px 18px; border: 1px solid var(--rule); background: var(--paper-2); }
.stat-card.accent { border-color: var(--rust); background: var(--rust-soft); }
.stat-value { font-family: var(--display); font-size: 24px; font-weight: 600; margin-top: 4px; }
.manage-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; margin-top: 24px; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* avatars + presence */
.avatar { position: relative; width: 40px; height: 40px; border-radius: 50%; background: var(--rust-soft); color: var(--rust); display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 13px; font-weight: 600; flex-shrink: 0; }
.avatar.lg { width: 64px; height: 64px; font-size: 20px; }
.avatar.xs { width: 24px; height: 24px; font-size: 9px; }
.avatar-spacer { width: 40px; flex-shrink: 0; }
.presence { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--muted); border: 2px solid var(--paper); }
.avatar.xs .presence { width: 8px; height: 8px; }
.presence.on { background: var(--green); }
.profile-form { display: flex; gap: 20px; align-items: flex-start; }

/* ── chat (communities, channels, DMs) ── */
.chat-shell { display: grid; grid-template-columns: 72px 240px 1fr 220px; height: 100vh; border-left: 1px solid var(--rule); }
.chat-rail { background: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; overflow-y: auto; }
.rail-item { width: 48px; height: 48px; border-radius: 50%; background: var(--ink-soft); color: var(--paper); display: flex; align-items: center; justify-content: center; text-decoration: none; font-family: var(--mono); font-size: 14px; border: none; cursor: pointer; transition: border-radius .15s, background .15s; flex-shrink: 0; }
.rail-item:hover, .rail-item.active { border-radius: 14px; background: var(--rust); }
.rail-item.add { color: var(--green); font-size: 22px; }
.rail-sep { width: 32px; height: 2px; background: var(--ink-50); }
.chat-side, .chat-members { background: var(--paper-2); border-right: 1px solid var(--rule); overflow-y: auto; padding: 8px; }
.chat-members { border-right: none; border-left: 1px solid var(--rule); }
.chat-side-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 8px 12px; border-bottom: 1px solid var(--rule); margin-bottom: 8px; gap: 8px; }
.chat-side-label { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 10px 8px 6px; }
.chat-channel { display: flex; align-items: center; gap: 8px; padding: 6px 8px; color: var(--ink-50); text-decoration: none; border-radius: var(--radius); font-size: 14px; }
.chat-channel:hover { background: var(--hover-tint); color: var(--ink); }
.chat-channel.active { background: var(--paper-3); color: var(--ink); font-weight: 600; }
.chat-channel .hash { color: var(--muted); width: 16px; text-align: center; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rust); margin-left: auto; }
.chat-new-channel input { width: 100%; margin-top: 8px; padding: 6px 8px; font-size: 13px; border: 1px dashed var(--rule); background: transparent; color: var(--ink); }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--paper); }
.chat-main-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--rule); }
.chat-status { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-left: auto; }
.chat-status.on { background: var(--green); }
.chat-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; }
.chat-msg { display: flex; gap: 12px; padding: 6px 8px; position: relative; border-radius: var(--radius); }
.chat-msg.grouped { padding-top: 1px; }
.chat-msg:hover { background: var(--hover-tint); }
.chat-msg-body { flex: 1; min-width: 0; }
.chat-msg-head { display: flex; gap: 8px; align-items: baseline; }
.chat-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.chat-image { max-width: min(420px, 100%); max-height: 320px; margin-top: 6px; border: 1px solid var(--rule); display: block; }
.chat-file { margin-top: 6px; padding: 8px 12px; border: 1px solid var(--rule); background: var(--paper-2); cursor: pointer; color: var(--ink); font: inherit; }
.chat-msg-tools { display: none; position: absolute; right: 8px; top: -10px; background: var(--paper); border: 1px solid var(--rule); box-shadow: var(--shadow-sm); }
.chat-msg:hover .chat-msg-tools { display: flex; }
.chat-msg-tools button { border: none; background: none; cursor: pointer; padding: 4px 8px; color: var(--ink); }
.chat-edit { width: 100%; padding: 6px 8px; font: inherit; border: 1px solid var(--rust); background: var(--paper); color: var(--ink); }
.chat-typing { height: 18px; padding: 0 24px; font-size: 12px; color: var(--muted); font-style: italic; }
.chat-composer { display: flex; gap: 8px; align-items: center; padding: 10px 20px 18px; }
.chat-composer input { flex: 1; min-width: 0; padding: 12px 14px; font: inherit; border: 1px solid var(--rule); background: var(--paper-2); color: var(--ink); }
.chat-composer.readonly { color: var(--muted); font-size: 13px; justify-content: center; }
.chat-attach { cursor: pointer; font-size: 20px; padding: 0 4px; }
.chat-member { display: flex; align-items: center; gap: 8px; padding: 5px 8px; font-size: 13.5px; }
.chat-member.offline { opacity: .55; }
.role-tag { font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; color: var(--rust); }
.chat-explore { padding: 32px; overflow-y: auto; }

@media (max-width: 1100px) {
  .chat-shell { grid-template-columns: 64px 200px 1fr; }
  .chat-members { display: none; }
  .manage-grid { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  .catalog-page.narrow > :not(.catalog-header),
  .catalog-page.pad > :not(.catalog-header),
  .screenshot-strip,
  .detail-hero ~ .dm-block,
  .manage-grid,
  .back-link ~ .dnd-form,
  .back-link ~ .catalog-header ~ .dnd-form { margin-left: 16px; margin-right: 16px; }
  .chat-shell { grid-template-columns: 56px 1fr; height: auto; min-height: 100vh; }
  .chat-side { display: none; }
  .line-item { flex-wrap: wrap; }
  .line-thumb { width: 88px; }
  .profile-form { flex-direction: column; }
}
