.collection-page {padding:24px;color:#111827;min-width:0;}
.collection-page h1 {font-size:28px;font-weight:650;line-height:1.25;}
.collection-intro {max-width:850px;margin:10px 0 0;color:#64748b;line-height:1.6;}
.collection-back {margin-bottom:14px;font-size:14px;}
.collection-filters,.collection-actions,.collection-pagination {display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:16px 0;}
.collection-filters input,.collection-filters select,.collection-filters button,.collection-actions a,.collection-pagination a,.collection-pagination span {min-height:42px;padding:8px 14px;border:1px solid #cbd5e1;border-radius:8px;max-width:100%;background:#fff;font-size:14px;line-height:1.25;color:#1f2937;}
.collection-filters input {min-width:0;flex:1;max-width:440px;}
.collection-filter-field {display:inline-flex;align-items:center;gap:8px;min-width:0;}
.collection-filter-field label {font-size:13px;font-weight:500;color:#475569;white-space:nowrap;}
.collection-filters button[type="submit"] {background:#0f172a;color:#fff;border-color:#0f172a;font-weight:600;cursor:pointer;padding:8px 18px;}
.collection-filters button[type="submit"]:hover {background:#1e293b;}
.collection-actions a {display:inline-flex;align-items:center;justify-content:center;gap:6px;text-decoration:none;font-weight:500;white-space:nowrap;}
.collection-actions a:first-child {background:#0f766e;color:#fff;border-color:#0f766e;font-weight:600;}
.collection-actions a:first-child:hover {background:#115e59;}
.collection-actions a:not(:first-child):hover {background:#f8fafc;border-color:#94a3b8;}
.collection-page .game-medium-tabs {display:inline-flex;flex-wrap:wrap;gap:3px;padding:3px;margin:14px 0 8px;background:#eef2f6;border:1px solid #dbe3eb;border-radius:10px;max-width:100%;}
.collection-page .game-medium-tabs a {display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:8px 13px;min-height:38px;border:0;border-radius:7px;text-decoration:none;font-size:13.5px;font-weight:500;color:#475569;white-space:nowrap;}
.collection-page .game-medium-tabs a:hover {color:#0f172a;}
.collection-page .game-medium-tabs a[aria-current="page"] {background:#0f172a;color:#fff;font-weight:600;box-shadow:0 1px 2px rgba(15,23,42,.12);}
.collection-page .game-medium-tabs span {font-size:.82em;opacity:.82;font-variant-numeric:tabular-nums;}
.collection-page .game-medium-note {font-size:13px;line-height:1.5;color:#64748b;margin:0 0 14px;max-width:75ch;}
.collection-pagination {gap:6px;}
.collection-pagination a,.collection-pagination span {display:inline-flex;align-items:center;justify-content:center;min-width:40px;min-height:40px;padding:6px 12px;text-decoration:none;font-weight:500;font-variant-numeric:tabular-nums;}
.collection-pagination a:hover {background:#f8fafc;border-color:#94a3b8;}
.collection-pagination span[aria-current="page"] {background:#0f172a;color:#fff;border-color:#0f172a;font-weight:600;}
.collection-pagination span[aria-hidden="true"] {border-color:transparent;background:transparent;min-width:24px;padding:6px 2px;color:#64748b;}
.collection-grid {display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,270px),1fr));gap:16px;}
.collection-card {padding:20px;border:1px solid #d1d5db;border-radius:10px;min-width:0;background:#fff;}
.collection-card h2 {font-size:19px;font-weight:600;margin-bottom:10px;line-height:1.4;}
.collection-card p {font-size:14px;line-height:1.65;color:#64748b;}
.collection-card footer {margin-top:16px;font-size:13px;color:#64748b;}
.collection-page a {text-decoration:underline;text-underline-offset:3px;}
.collection-actions a,.collection-page .game-medium-tabs a,.collection-pagination a,.collection-table a.result-win,.collection-table a.result-loss,.collection-table a.result-draw,.collection-table a.result-unknown {text-decoration:none;}
.collection-table-wrap {overflow-x:auto;max-width:100%;margin:14px 0;-webkit-overflow-scrolling:touch;}
.collection-table {width:100%;text-align:left;}
.collection-table th,.collection-table td {padding:12px;border-bottom:1px solid #e5e7eb;vertical-align:top;}
.collection-table th {white-space:nowrap;}
.collection-credit {color:#64748b;font-size:13.5px;line-height:1.55;}
.collection-children {margin:20px 0;}
.collection-children summary {font-weight:600;padding:10px 0;cursor:pointer;}
.collection-children ul {display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,240px),1fr));gap:12px;margin-top:12px;}
.collection-page [hidden] {display:none!important;}
.collection-filters a {display:inline-flex;align-items:center;min-height:42px;padding:8px 12px;}

.dark .collection-page {color:#f3f4f6;}
.dark .collection-card,.dark .collection-filters input,.dark .collection-filters select,.dark .collection-filters button,.dark .collection-actions a,.dark .collection-pagination a,.dark .collection-pagination span {background:#111827;border-color:#4b5563;color:#e5e7eb;}
.dark .collection-filter-field label {color:#9ca3af;}
.dark .collection-filters button[type="submit"] {background:#e2e8f0;color:#0f172a;border-color:#e2e8f0;}
.dark .collection-actions a:first-child {background:#0d9488;color:#fff;border-color:#0d9488;}
.dark .collection-page .game-medium-tabs {background:#192332;border-color:#334155;}
.dark .collection-page .game-medium-tabs a {color:#cbd5e1;}
.dark .collection-page .game-medium-tabs a[aria-current="page"] {background:#e2e8f0;color:#0f172a;}
.dark .collection-pagination span[aria-current="page"] {background:#e2e8f0;color:#0f172a;border-color:#e2e8f0;}
.dark .collection-pagination span[aria-hidden="true"] {background:transparent;border-color:transparent;color:#9ca3af;}
.dark .collection-intro,.dark .collection-card p,.dark .collection-card footer,.dark .collection-credit,.dark .collection-page .game-medium-note {color:#9ca3af;}
.dark .collection-table td,.dark .collection-table th {border-color:#374151;}

@media(max-width:600px){
  .collection-page {padding:14px 12px;}
  .collection-back {margin-bottom:10px;font-size:13px;}
  .collection-page h1 {font-size:22px;line-height:1.2;}
  .collection-page .archive-profile-identity {grid-template-columns:64px minmax(0,1fr);align-items:center;gap:8px 14px;padding-bottom:10px;}
  .collection-page .archive-profile-identity .profile-portrait {width:64px;}
  .collection-page .archive-profile-identity .profile-portrait-frame {width:64px;height:64px;border-radius:10px;}
  .collection-page .archive-profile-identity .profile-identity-main {display:contents;}
  .collection-page .archive-profile-identity h1 {margin:0;font-size:21px;align-self:center;}
  .collection-page .archive-profile-identity .collection-intro {grid-column:1/-1;margin:2px 0 0;font-size:13.5px;line-height:1.45;}
  .collection-actions {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:10px 0;}
  .collection-actions a {min-height:40px;padding:8px 10px;font-size:13.5px;}
  .collection-page .game-medium-tabs {display:flex;flex-wrap:nowrap;width:100%;margin:10px 0 6px;padding:3px;gap:2px;}
  .collection-page .game-medium-tabs a {flex:1 1 auto;min-height:38px;padding:7px 6px;font-size:12.5px;gap:4px;}
  .collection-page .game-medium-note {font-size:12px;line-height:1.45;margin:0 0 10px;}
  .collection-filters {align-items:flex-start;gap:8px;margin:10px 0 12px;}
  .collection-filters input {flex-basis:100%;}
  .collection-filters.collection-filters--archive {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;align-items:end;gap:8px;}
  .collection-filters.collection-filters--single {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:8px;}
  .collection-filter-field {display:flex;flex-direction:column;align-items:stretch;gap:3px;}
  .collection-filter-field label {font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:#64748b;}
  .collection-filter-field select {width:100%;min-height:40px;padding:6px 8px;font-size:13.5px;}
  .collection-filters.collection-filters--archive button[type="submit"],.collection-filters.collection-filters--single button[type="submit"] {min-height:40px;padding:0 16px;}
  .collection-credit {font-size:12.5px;}
  .collection-pagination {gap:5px;margin:10px 0 12px;flex-wrap:nowrap;overflow-x:auto;}
  .collection-pagination a,.collection-pagination span {min-height:36px;min-width:34px;padding:5px 9px;font-size:13px;white-space:nowrap;flex:0 0 auto;}
  .collection-pagination span[aria-hidden="true"] {min-width:16px;padding:5px 1px;}
  .collection-table th,.collection-table td {padding:9px 8px;font-size:13.5px;}
}

/* Opponent search filter field on /player-games and /game-collections */
.collection-filter-opponent input {width:200px;min-width:150px;}
.collection-filter-clear {font-size:13.5px;color:#475569;text-decoration:none;border-color:transparent!important;background:transparent!important;padding:8px 6px!important;}
.collection-filter-clear:hover {color:#0f172a;text-decoration:underline;}
.dark .collection-filter-clear {color:#9ca3af;}
.dark .collection-filter-clear:hover {color:#f3f4f6;}
@media(max-width:600px){
  .collection-filter-opponent {grid-column:1 / -1;}
  .collection-filter-opponent input {width:100%;min-width:0;min-height:40px;padding:6px 10px;font-size:14px;}
  .collection-filter-clear {grid-column:1 / -1;justify-self:start;min-height:32px;padding:4px 0!important;}
}
