/* ═══════════════ LIBRARY MODULE ═══════════════ */

/* Layout */
.lib-container {
  display: flex;
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  overflow: hidden;
}

.lib-list-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow-y: auto;
}

/* Tabs */
.lib-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.lib-tab {
  background: transparent;
  border: none;
  color: var(--text3);
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.lib-tab:hover { color: var(--text2); }
.lib-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Online Toolbar */
.lib-online-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 14px;
  margin-bottom: 16px;
}
.lib-online-user-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.lib-online-label {
  color: var(--text3);
  font-weight: 500;
}
.lib-online-edit {
  display: flex;
  align-items: center;
  gap: 6px;
}
.lib-account-selector-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.lib-account-select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  max-width: 260px;
}
.lib-account-select:focus {
  border-color: var(--accent);
}
.lib-account-badge {
  font-size: 10px;
  font-family: 'IBM Plex Mono', monospace;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(218, 165, 32, 0.15);
  color: var(--accent);
  border: 1px solid rgba(218, 165, 32, 0.3);
  margin-left: 6px;
  vertical-align: middle;
}
.lib-input-sm {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  outline: none;
}
.lib-input-sm:focus {
  border-color: var(--accent);
}
.btn-xs {
  padding: 2px 6px;
  font-size: 11px;
}
.lib-online-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lib-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.lib-action-btn:hover:not(:disabled) {
  background: rgba(173, 98, 255, 0.14);
  border-color: var(--accent, #ad62ff);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(173, 98, 255, 0.25);
}

.lib-action-btn:active:not(:disabled) {
  transform: translateY(0);
}

.lib-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.lib-btn-icon {
  font-size: 13.5px;
  line-height: 1;
}

/* Specific button accents */
.lib-btn-sync {
  background: rgba(173, 98, 255, 0.08);
  border-color: rgba(173, 98, 255, 0.3);
  color: #e9d5ff;
}

.lib-btn-sync:hover:not(:disabled) {
  background: rgba(173, 98, 255, 0.22);
  border-color: var(--accent);
  color: #ffffff;
}

.lib-btn-import {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.35);
  color: #ddd6fe;
}

.lib-btn-import:hover:not(:disabled) {
  background: rgba(139, 92, 246, 0.25);
  border-color: #a78bfa;
  color: #ffffff;
}

.lib-btn-scan {
  background: linear-gradient(135deg, rgba(173, 98, 255, 0.28) 0%, rgba(139, 92, 246, 0.18) 100%);
  border: 1px solid var(--accent, #ad62ff);
  color: #f3e8ff;
  box-shadow: 0 2px 10px rgba(173, 98, 255, 0.2);
}

.lib-btn-scan:hover:not(:disabled) {
  background: linear-gradient(135deg, #ad62ff 0%, #8b5cf6 100%);
  color: #0e0c14;
  border-color: #c084fc;
  font-weight: 700;
  box-shadow: 0 4px 18px rgba(173, 98, 255, 0.45);
}

.lib-online-status {
  font-size: 11.5px;
  color: var(--text3);
  width: 100%;
  font-family: 'IBM Plex Mono', monospace;
  padding: 4px 0 0 2px;
  min-height: 20px;
  transition: all 0.2s ease;
}
.lib-online-status.active {
  color: #38bdf8;
}
.lib-online-status.success {
  color: #4ade80;
}
.lib-online-status.error {
  color: #f87171;
}

/* Omnibar Search & Filter Box */
.lib-search-bar {
  margin-bottom: 12px;
}
.lib-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.lib-search-icon {
  position: absolute;
  left: 11px;
  font-size: 13px;
  color: var(--text3);
  pointer-events: none;
  transition: color 0.2s ease;
}
.lib-search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 32px 7px 32px;
  color: var(--text);
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}
.lib-search-input:focus {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--accent, #ad62ff);
  box-shadow: 0 0 0 3px rgba(173, 98, 255, 0.18), inset 0 1px 3px rgba(0, 0, 0, 0.2);
}
.lib-search-input::placeholder {
  color: var(--text3);
  font-size: 12px;
}
.lib-search-clear {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text3);
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  line-height: 1;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lib-search-clear:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

/* Speed & Category Filter Bar */
.lib-filter-bar {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.lib-speed-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.lib-speed-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  user-select: none;
}
.lib-speed-pill:hover {
  background: var(--surface2);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.15);
}
.lib-speed-pill.active {
  background: rgba(218, 165, 32, 0.15);
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(218, 165, 32, 0.2);
  font-weight: 600;
}

/* Table */
.lib-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.lib-table th, .lib-table td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
}
.lib-table th {
  color: var(--text3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.lib-table tbody tr {
  cursor: pointer;
  transition: background 0.15s;
}
.lib-table tbody tr:hover {
  background: var(--surface2);
}

.outcome-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}
.outcome-Win { background: rgba(46, 204, 113, 0.2); color: #2ecc71; }
.outcome-Loss { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }
.outcome-Draw { background: rgba(149, 165, 166, 0.2); color: #95a5a6; }

/* Game Source & Opening Badges in Table */
.lib-opp-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.lib-opp-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.lib-opp-name {
  font-weight: 500;
}
.lib-side-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  vertical-align: middle;
  cursor: help;
}
.lib-side-dot.white {
  background: #f0d9b5;
  border: 1.5px solid #d4b896;
  box-shadow: 0 0 4px rgba(240, 217, 181, 0.45);
}
.lib-side-dot.black {
  background: #272522;
  border: 1.5px solid #756d64;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.7);
}
.lib-game-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}
.lib-source-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.lib-source-arena {
  background: rgba(218, 165, 32, 0.15);
  color: #facc15;
  border: 1px solid rgba(218, 165, 32, 0.3);
}
.lib-source-bot {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.lib-source-online,
.lib-source-chess_com,
.lib-source-chess-com {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.lib-source-lichess {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}
.lib-source-tournament {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.3);
}
.lib-opening-badge {
  font-size: 11px;
  color: var(--text2);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 3px;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.lib-eco-code {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  color: var(--accent);
  font-size: 10px;
}

.lib-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

/* ═══════════════════════════════════════════════════════════
   GAME COLLECTIONS MODULE (Option A: Responsive Grid)
   ═══════════════════════════════════════════════════════════ */

.gv-modal-box {
  background: var(--bg2, #181622);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  width: 92%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
  padding: 20px 22px;
  color: var(--text, #f0f0f0);
}

.lib-collections-content {
  color: var(--text, #f0f0f0);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.lib-collections-browser {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

/* Toolbar */
.lib-collections-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 4px;
}

.lib-col-search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 440px;
  min-width: 220px;
}

.lib-col-search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 8px;
  padding: 8px 32px 8px 34px;
  color: var(--text, #f0f0f0);
  font-size: 13px;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.lib-col-search-input:focus {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--accent, #ad62ff);
  box-shadow: 0 0 0 3px rgba(173, 98, 255, 0.18), inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.lib-col-search-box .lib-search-icon {
  position: absolute;
  left: 11px;
  font-size: 13px;
  color: var(--text3, #8a889b);
  pointer-events: none;
}

.lib-col-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.lib-col-sort-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 8px;
  padding: 2px 10px;
  transition: border-color 0.15s;
}

.lib-col-sort-wrap:hover {
  border-color: rgba(173, 98, 255, 0.35);
}

.lib-col-sort-icon {
  color: var(--text3, #8a889b);
  font-size: 12px;
}

.lib-col-sort-select {
  background: transparent;
  color: var(--text, #f0f0f0);
  border: none;
  font-size: 12.5px;
  padding: 6px 4px;
  cursor: pointer;
  outline: none;
}

.lib-col-sort-select option {
  background: #181622;
  color: #f0f0f0;
}

.lib-btn-new-col {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #ad62ff 0%, #8b5cf6 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(173, 98, 255, 0.3);
  white-space: nowrap;
}

.lib-btn-new-col:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(173, 98, 255, 0.45);
  filter: brightness(1.08);
}

.lib-btn-new-col:active {
  transform: translateY(0);
}

/* ─── Responsive Grid ─── */
.lib-collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  width: 100%;
}

/* Quick Create Dash Card */
.lib-col-create-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 154px;
  border: 1.5px dashed rgba(173, 98, 255, 0.35);
  background: rgba(173, 98, 255, 0.03);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  user-select: none;
}

.lib-col-create-card:hover {
  background: rgba(173, 98, 255, 0.08);
  border-color: var(--accent, #ad62ff);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(173, 98, 255, 0.15);
}

.lib-col-create-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(173, 98, 255, 0.15);
  color: var(--accent, #ad62ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  transition: transform 0.2s;
}

.lib-col-create-card:hover .lib-col-create-icon {
  transform: scale(1.1);
}

.lib-col-create-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text, #f0f0f0);
}

.lib-col-create-sub {
  font-size: 11.5px;
  color: var(--text3, #8a889b);
}

/* Rich Collection Card */
.lib-col-grid-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 154px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  overflow: hidden;
}

.lib-col-grid-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(173, 98, 255, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 16px rgba(173, 98, 255, 0.12);
}

.lib-col-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.lib-col-card-emoji-box {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(173, 98, 255, 0.12);
  border: 1px solid rgba(173, 98, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.08);
}

.lib-col-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.4;
  transition: opacity 0.15s;
}

.lib-col-grid-card:hover .lib-col-card-actions {
  opacity: 1;
}

.lib-col-card-action-btn {
  background: transparent;
  border: none;
  color: var(--text3, #8a889b);
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}

.lib-col-card-action-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.lib-col-card-action-btn.del:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

.lib-col-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
  min-width: 0;
}

.lib-col-card-title {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text, #f0f0f0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lib-col-card-desc {
  font-size: 11.5px;
  color: var(--text3, #8a889b);
  line-height: 1.4;
  height: 32px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lib-col-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.lib-col-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(173, 98, 255, 0.15);
  color: #c084fc;
  border: 1px solid rgba(173, 98, 255, 0.25);
}

.lib-col-card-time {
  font-size: 11px;
  color: var(--text3, #8a889b);
  opacity: 0.8;
}

/* ─── Collection Detail View ─── */
.lib-collection-detail-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
}

.lib-col-detail-header-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.045) 0%, rgba(173, 98, 255, 0.03) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.lib-col-breadcrumb {
  display: flex;
  align-items: center;
}

.lib-breadcrumb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--accent, #ad62ff);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 10px;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.lib-breadcrumb-btn:hover {
  background: rgba(173, 98, 255, 0.15);
  border-color: var(--accent, #ad62ff);
  color: #ffffff;
  transform: translateX(-2px);
}

.lib-back-arrow {
  font-size: 13px;
  transition: transform 0.18s;
}

.lib-breadcrumb-btn:hover .lib-back-arrow {
  transform: translateX(-2px);
}

.lib-col-detail-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.lib-col-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.lib-col-detail-avatar {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(173, 98, 255, 0.15);
  border: 1px solid rgba(173, 98, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(173, 98, 255, 0.2);
}

.lib-col-header-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.lib-col-header-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lib-col-header-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text, #f0f0f0);
}

.lib-col-badge-count {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 12px;
  background: rgba(173, 98, 255, 0.2);
  color: #c084fc;
  border: 1px solid rgba(173, 98, 255, 0.3);
}

.lib-col-header-desc {
  margin: 0;
  font-size: 12px;
  color: var(--text3, #8a889b);
}

.lib-col-header-details {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: var(--text2, #c4c2d4);
  font-style: italic;
}

.lib-col-chess-results-header-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent, #ad62ff);
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.lib-col-chess-results-header-link:hover { opacity: 1; text-decoration: underline; }

/* Chess-Results link chip on collection cards */
.lib-col-chess-results-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent, #ad62ff);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.15s;
}
.lib-col-chess-results-link:hover { opacity: 1; text-decoration: underline; }

/* Details line on collection cards */
.lib-col-card-details {
  font-size: 10.5px;
  color: var(--text2, #c4c2d4);
  font-style: italic;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* FIDE link badge in game cards */
.lib-col-fide-link {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--accent, #ad62ff);
  text-decoration: none;
  background: rgba(173, 98, 255, 0.12);
  border: 1px solid rgba(173, 98, 255, 0.25);
  border-radius: 4px;
  padding: 1px 4px;
  margin-left: 3px;
  line-height: 1.3;
  transition: background 0.15s;
}
.lib-col-fide-link:hover { background: rgba(173, 98, 255, 0.25); }

.lib-col-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ─── Collection Games Toolbar (Filter / Search) ─── */
.lib-col-games-toolbar {
  display: flex;
  align-items: center;
  width: 100%;
}

.lib-col-game-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 320px;
}

.lib-col-game-filter-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 28px 6px 30px;
  color: var(--text, #f0f0f0);
  font-size: 12px;
  outline: none;
  transition: all 0.2s;
}

.lib-col-game-filter-input:focus {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--accent, #ad62ff);
  box-shadow: 0 0 0 2px rgba(173, 98, 255, 0.15);
}

.lib-col-game-search-wrap .lib-search-icon {
  position: absolute;
  left: 9px;
  font-size: 11.5px;
  color: var(--text3, #8a889b);
  pointer-events: none;
}

/* ─── Compact Collection Game Cards ─── */
.lib-col-games-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.lib-col-game-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 11px 15px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.lib-col-game-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(173, 98, 255, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.lib-col-card-left-section {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 220px;
}

.lib-col-res-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 6px;
  text-align: center;
  min-width: 50px;
  flex-shrink: 0;
}

.lib-col-res-white {
  background: rgba(250, 204, 21, 0.16);
  color: #fef08a;
  border: 1px solid rgba(250, 204, 21, 0.35);
}

.lib-col-res-black {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.lib-col-res-draw {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.lib-col-players-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.lib-col-player-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #f0f0f0);
}

.lib-col-piece-icon {
  font-size: 13px;
  line-height: 1;
}

.lib-col-elo-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text3, #8a889b);
}

.lib-col-card-mid-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.lib-col-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lib-col-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text3, #8a889b);
}

.lib-col-card-right-section {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.lib-col-btn-open {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(173, 98, 255, 0.15);
  border: 1px solid rgba(173, 98, 255, 0.3);
  color: #d8b4fe;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.lib-col-btn-open:hover {
  background: var(--accent, #ad62ff);
  border-color: var(--accent, #ad62ff);
  color: #ffffff;
  transform: translateY(-1px);
}

.lib-col-game-del {
  color: var(--text3, #8a889b);
  transition: all 0.15s;
  padding: 6px 10px;
  border-radius: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 13px;
}

.lib-col-game-del:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

/* Save Picker Item */
.col-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.col-picker-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.col-picker-item.selected {
  background: rgba(173, 98, 255, 0.15);
  border-color: rgba(173, 98, 255, 0.5);
}

.lib-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text3, #8a889b);
  text-align: center;
  gap: 10px;
}

.lib-empty-state .empty-icon {
  font-size: 36px;
  opacity: 0.6;
}

/* ═══════════════ SHARED COLLECTION VIEW ═══════════════ */
body.shared-collection-view .lib-tabs,
body.shared-collection-view .topbar-hamburger,
body.shared-collection-view #lib-collections-toolbar,
body.shared-collection-view #lib-col-back-btn,
body.shared-collection-view #lib-col-add-game-btn,
body.shared-collection-view #lib-col-export-btn,
body.shared-collection-view #lib-col-delete-btn,
body.shared-collection-view #lib-col-edit-btn,
body.shared-collection-view .game-edit-btn,
body.shared-collection-view .lib-col-game-del,
body.shared-collection-view #lib-empty-add-game-btn,
#page-library-hub.shared-collection-view .lib-tabs,
#page-library-hub.shared-collection-view .topbar-hamburger,
#page-library-hub.shared-collection-view #lib-collections-toolbar,
#page-library-hub.shared-collection-view #lib-col-back-btn,
#page-library-hub.shared-collection-view #lib-col-add-game-btn,
#page-library-hub.shared-collection-view #lib-col-export-btn,
#page-library-hub.shared-collection-view #lib-col-delete-btn,
#page-library-hub.shared-collection-view #lib-col-edit-btn,
#page-library-hub.shared-collection-view .game-edit-btn,
#page-library-hub.shared-collection-view .lib-col-game-del,
#page-library-hub.shared-collection-view #lib-empty-add-game-btn {
  display: none !important;
}

/* Edit button styling in collection header and game card */
.game-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 7px;
  background: transparent;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: 6px;
  color: var(--text3, #8a889b);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.game-edit-btn:hover {
  background: rgba(173, 98, 255, 0.15);
  border-color: rgba(173, 98, 255, 0.4);
  color: #ad62ff;
}

.lib-card-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text3, #8a889b);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.lib-card-edit-btn:hover {
  background: rgba(173, 98, 255, 0.15);
  color: #ad62ff;
  border-color: rgba(173, 98, 255, 0.3);
}





