/* Sohbet market penceresi */
.market-shop-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.market-shop-panel {
  width: min(720px, 100%);
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-lg, 0 24px 48px rgba(0, 0, 0, 0.2));
  overflow: hidden;
  color: var(--text-dark);
}

.market-shop-sticky {
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-white);
}

.market-shop-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 8px;
}

.market-shop-topbar h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
}

.market-shop-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  border-radius: var(--radius-sm, 8px);
  color: var(--text-mid);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.market-shop-close:hover {
  background: var(--bg-light);
  color: var(--text-dark);
}

.market-shop-close svg {
  width: 20px;
  height: 20px;
}

.market-shop-hint {
  padding: 0 16px 10px;
  margin: 0;
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.4;
}

.market-shop-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 16px 8px;
}

.market-shop-balance {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.market-shop-notice {
  margin: 0 16px 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.market-shop-notice--error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.market-shop-notice--success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

body.theme-dark .market-shop-notice--error {
  background: rgba(185, 28, 28, 0.2);
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.35);
}

body.theme-dark .market-shop-notice--success {
  background: rgba(4, 120, 87, 0.22);
  color: #a7f3d0;
  border-color: rgba(52, 211, 153, 0.35);
}

.market-shop-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 0 12px 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.market-shop-tab {
  flex-shrink: 0;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--bg, #f8fafc);
  color: var(--text, #334155);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.market-shop-tab:hover {
  border-color: var(--accent);
}

.market-shop-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.market-shop-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 20px;
}

.market-shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
}

.market-item-card {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  background: var(--bg, #fafbfc);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100%;
  position: relative;
}

.market-item-card--equipped {
  border-color: var(--accent, #2979ff);
  box-shadow: 0 0 0 1px rgba(41, 121, 255, 0.15);
}

.market-item-equipped-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--accent, #2979ff);
  color: #fff;
  line-height: 1.3;
}

.market-item-card--flash {
  grid-column: span 1;
}

.market-flash-preview-wrap {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  border-radius: 8px;
  background: var(--bg-white);
  border: 1px dashed var(--border);
}

.market-flash-preview {
  display: inline-block;
  font-weight: 700;
  font-size: 15px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-item-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin: 0 auto;
}

.market-item-placeholder {
  font-size: 32px;
  line-height: 72px;
  height: 72px;
}

.market-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #1e293b);
  line-height: 1.3;
}

.market-item-price {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

.market-item-card .btn {
  margin-top: auto;
}

.market-shop-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-light, #64748b);
  font-size: 14px;
}

.market-shop-footer {
  flex-shrink: 0;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--border, #e8e8e8);
  display: flex;
  justify-content: flex-end;
}

body.theme-dark .market-shop-overlay {
  background: rgba(0, 0, 0, 0.62);
}

body.theme-dark .market-shop-panel,
body.theme-dark .market-shop-sticky {
  background: var(--bg-white);
  border-color: var(--border);
  color: var(--text-dark);
}

body.theme-dark .market-shop-close:hover {
  background: var(--bg-light);
  color: var(--text-dark);
}

body.theme-dark .market-flash-preview-wrap {
  background: var(--bg, #252538);
}

.inventory-equipped-bar {
  margin: 0 16px 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg, #f1f5f9);
  border: 1px solid var(--border, #e2e8f0);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.inventory-equipped-nick {
  font-weight: 700;
  font-size: 14px;
}

.inventory-slot-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.inventory-slot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  margin-bottom: 10px;
  background: var(--bg, #fafbfc);
}

body.theme-dark .inventory-equipped-bar {
  background: var(--bg, #252538);
}

/* Flash nick — admin/market önizlemesi ile aynı iç span */
.nick-cosmetic-preview {
  display: inline-block;
  font-weight: inherit;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: baseline;
  transform-style: preserve-3d;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

.nick-cosmetic-preview.nick-fx-marquee-host {
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.nick-cosmetic-preview.nick-fx-marquee-host .nick-fx-marquee-track {
  display: inline-flex;
  max-width: none;
  white-space: nowrap;
  text-overflow: clip;
}

.member-name-row .nick-cosmetic-host {
  flex: 0 1 auto;
  max-width: 100%;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
}

.member-name-row .nick-cosmetic-preview {
  font-size: inherit;
}

.sidebar-user-header .user-header-name .nick-cosmetic-preview {
  font-size: 14px;
  text-align: left;
  margin: 0;
}

.sidebar-user-header .user-header-name .nick-cosmetic-host {
  display: block;
  text-align: left;
  max-width: 100%;
}

.online-user-text-col .nick-cosmetic-host {
  min-width: 0;
  max-width: 100%;
}

.nick-cosmetic-host {
  min-width: 0;
  max-width: 100%;
  font-weight: inherit;
}

/* sidebar avatar frame: avatar-frame.css + avatar-frame-fit.js */

@media (max-width: 520px) {
  .market-shop-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
