/* Personal cabinet only: the catalog and board retain their shared card styles. */
.collection-page .cabinet-pane { padding: 18px 36px 24px; }
/* Both control rows share the avatar's top and bottom edges. */
.collection-page .showcase-controls { display: grid; grid-template-columns: minmax(0, 1fr) 36px 96px; grid-template-rows: repeat(2, 44px); gap: 8px 12px; margin-bottom: 22px; }
.collection-page .showcase-heading, .collection-page .profile-identity, .collection-page .profile-overview { display: contents; }
.collection-page .profile-identity .profile-avatar { grid-column: 3; grid-row: 1 / 3; width: 96px; height: 96px; contain: none; border-radius: 0; font-size: 36px; }
.collection-page .profile-overview .showcase-header-actions { grid-column: 2; grid-row: 1 / 3; display: grid; width: 36px; height: 96px; grid-template-rows: repeat(2, 44px); align-items: stretch; gap: 8px; }
.collection-page .profile-overview .showcase-icon { width: 36px; height: 44px; align-items: center; line-height: 1; font-size: 21px; }
.showcase-header-actions { display: flex; align-items: center; justify-content: flex-end; flex: 0 0 auto; gap: 12px; }
.site-nav .showcase-support { display: inline-flex; align-items: center; gap: 7px; color: #ff3c95; text-decoration: none; white-space: nowrap; }
.showcase-support > span { font-size: 26px; line-height: 1; }
.site-nav .showcase-support:hover { color: #ff85bb; border-bottom-color: transparent; }
.showcase-icon { display: flex; align-items: center; justify-content: center; gap: 4px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--text); font-size: 23px; cursor: pointer; }
.showcase-icon:hover { color: var(--accent); background: #223340; }
.showcase-menu { position: relative; min-width: 0; }
.showcase-menu summary { list-style: none; cursor: pointer; }
.showcase-menu summary::-webkit-details-marker { display: none; }
.showcase-menu summary:focus-visible, .showcase-menu-content :is(a,button):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.showcase-menu[open] { z-index: 20; }
.showcase-menu-content { position: absolute; top: calc(100% + 6px); right: 0; z-index: 21; width: 210px; padding: 6px; border: 1px solid #385066; border-radius: 8px; background: #18252f; box-shadow: 0 8px 28px #0008; }
.showcase-menu:not([open]) > .showcase-menu-content { display: none; }
.showcase-menu-content form { margin: 0; }
.collection-page .showcase-menu-content :is(a,button) { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; margin: 0; padding: 9px 10px; border: 0; border-radius: 4px; background: transparent; color: var(--text); text-align: left; text-decoration: none; white-space: normal; font-size: 13px; cursor: pointer; }
.collection-page .showcase-menu-content :is(a,button):hover { background: #2c4050; color: var(--accent); }
.collection-page .showcase-menu-content .showcase-remove { color: #ffadb5; }
.collection-page .showcase-tabs { grid-column: 1; grid-row: 1; gap: 12px; flex-wrap: nowrap; align-items: stretch; min-width: 0; height: 44px; margin: 0; }
.collection-page .showcase-tabs > a { padding: 12px 10px; font-size: 14px; }
.showcase-more > summary { display: flex; align-items: center; gap: 9px; height: 100%; min-height: 44px; padding: 12px 10px; color: #b6c4d4; font-size: 14px; border-bottom: 3px solid transparent; }
.showcase-more.is-current > summary, .showcase-more[open] > summary { color: var(--accent); border-bottom-color: var(--accent); }
.showcase-more .showcase-menu-content { right: auto; left: 0; }
.collection-page .showcase-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 175px 170px 150px; align-items: center; gap: 12px; grid-column: 1; grid-row: 2; min-width: 0; max-width: none; margin: 0; }
.collection-page .showcase-toolbar label { grid-column: auto; gap: 0; }
.collection-page .showcase-toolbar select, .collection-page .showcase-toolbar input { height: 44px; border-color: #2b4355; background: #101d27; font-size: 14px; }
.collection-page .showcase-toolbar select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.showcase-search { position: relative; }
.collection-page .showcase-search input { padding:10px 44px 10px 38px; border:0; outline:0; box-shadow:none; }
.collection-page .showcase-search input:focus { border:0; outline:0; box-shadow:none; background:#1c303e; }
.showcase-search input::-webkit-search-cancel-button { -webkit-appearance:none; }
.showcase-search-icon { position:absolute; left:13px; top:50%; transform:translateY(-50%); width:18px; height:18px; color:#8da5b6; pointer-events:none; }
.collection-page .showcase-search-clear { display:flex; align-items:center; justify-content:center; position:absolute; right:4px; top:50%; transform:translateY(-50%); width:36px; height:36px; min-height:36px; margin:0; padding:0; border:0; border-radius:4px; background:transparent; color:var(--text); font-size:22px; cursor:pointer; }
.collection-page .showcase-add { gap: 6px; min-height: 44px; height: 44px; padding: 10px 14px; background: #29bdee; color: #071823; font-weight: 600; }
.showcase-add > span { font-size: 20px; line-height: 1; }
.collection-page .showcase-add:hover { background: #64d7ff; }
.collection-page .personal-category { margin: 0 0 24px; }
.collection-page .personal-category-parent > .personal-category { margin-left: 18px; }
.collection-page .personal-category-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 14px; margin: 0; font-size: 23px; }
.personal-category-summary { display: block; list-style: none; cursor: pointer; }
.personal-category-summary::-webkit-details-marker { display: none; }
.personal-category[open] > .personal-category-summary { margin-bottom: 12px; }
.personal-category-summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.personal-category-summary .personal-category-title::before { content: ''; flex: none; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); align-self: center; }
.personal-category[open] > .personal-category-summary .personal-category-title::before { transform: rotate(45deg); }
.personal-category-title > span { color: var(--muted); font-size: 13px; font-weight: 400; }
/* Размеры сетки, рамки, обложки и подписи задаёт общий CSS каталога. */
.collection-page .catalog-game.catalog-card { width: 100%; justify-self: start; position: relative; border-color: transparent; background: transparent; }
.collection-page .catalog-game.catalog-card:hover, .collection-page .catalog-game.catalog-card:focus-within { border-color: #319fbf; }
.collection-page .catalog-card h2 { order: 2; height: auto; min-height: 0; flex: 0 0 auto; font-weight: 400; align-items: flex-start; justify-content: flex-start; text-align: left; }
.collection-page .catalog-card[data-console="figures"] h2 { justify-content: center; text-align: center; }
/* Меню находится на обложке: пустая строка действий под подписью не нужна. */
.collection-page .catalog-card:not(.panini-card)::after { content: none; }
.collection-page .catalog-list { align-content: start; }
.collection-page .catalog-card .showcase-star { position: absolute; left: 6px; top: 6px; z-index: 2; display: block; margin: 0; }
.collection-page .showcase-star .catalog-star { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; min-height: 30px; padding: 5px; border: 0; border-radius: 5px; background: #0d1729df; color: #b6c5cf; }
.collection-page .showcase-star .catalog-star[aria-pressed="true"] { color: #ff4b9d; }
.collection-page .showcase-star [data-catalog-action-status] { position: absolute; width: 160px; padding: 8px; background: #17232f; }
.showcase-card-menu { position: absolute; right: 6px; top: 6px; z-index: 3; }
.showcase-card-menu > summary { display: flex; align-items: center; justify-content: center; width: 32px; height: 30px; border-radius: 5px; color: #fff; background: #0d1729e6; font-size: 23px; line-height: 1; }
.collection-page .showcase-card-menu .showcase-menu-content { width: 170px; max-width: calc(100vw - 48px); }
.collection-page .catalog-card:has(.showcase-menu[open]) { z-index: 20; }
.collection-page .panini-card :is(.panini-year,.panini-progress,.panini-album-state) { display: none; }
.collection-page .pane-footer { margin-top: 12px; }
.collection-page .cover-fallback { display: flex; align-items: center; justify-content: center; flex-direction: column; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (hover: hover) and (pointer: fine) {
  .showcase-card-menu:not([open]), .collection-page .showcase-star:has([aria-pressed="false"]) { opacity: 0; }
  .collection-page .catalog-card:hover :is(.showcase-card-menu,.showcase-star), .collection-page .catalog-card:focus-within :is(.showcase-card-menu,.showcase-star) { opacity: 1; }
}
@media (max-width: 1100px) {
  .collection-page .showcase-toolbar { grid-template-columns: minmax(0, 1fr) 120px 120px 110px; gap: 8px; }
  .collection-page .showcase-toolbar select { font-size: 12px; padding: 10px 8px; }
  .collection-page .showcase-tabs { gap: 0; }
  .collection-page .showcase-tabs > a, .collection-page .showcase-more > summary { font-size: 12px; padding: 10px 5px; gap: 5px; }
}
@media (max-width: 700px) {
  .collection-page .catalog-card :is(.showcase-card-menu,.showcase-star) { opacity: 1; }
  .collection-page .cabinet-pane { padding: 16px 18px 24px; }
  .collection-page .showcase-controls { grid-template-columns: minmax(0, 1fr) 36px 96px; grid-template-rows: 44px 44px auto auto; row-gap: 8px; }
  .collection-page .showcase-settings .showcase-menu-content { right: -108px; }
  .collection-page .showcase-tabs { grid-column: 1 / -1; grid-row: 3; height: auto; flex-wrap: wrap; }
  .collection-page .showcase-toolbar { grid-column: 1 / -1; grid-row: 4; }

  .collection-page .showcase-toolbar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 125px; }
  .collection-page .showcase-toolbar .showcase-search { grid-column: 1 / -1; }
  .collection-page .showcase-tabs { gap: 0; }
  .collection-page .showcase-tabs > a, .showcase-more > summary { font-size: 12px; padding: 10px 7px; gap: 5px; }
  .collection-page .personal-category-title { font-size: 21px; }
  .showcase-more .showcase-menu-content { left: auto; right: 0; }
}
@media (max-width: 500px) {
  .collection-page .cabinet-pane { padding: 14px; }


  .collection-page .showcase-toolbar { grid-template-columns: minmax(0, 1fr) 125px; }
  .collection-page .showcase-toolbar .showcase-search { grid-column: 1; }
  .collection-page .showcase-add { grid-column: 2; grid-row: 1; }
  .collection-page .showcase-toolbar select { font-size: 12px; padding: 10px 8px; }
  .collection-page .showcase-toolbar input { font-size: 12px; }
  .collection-page .showcase-card-menu .showcase-menu-content { width: 135px; padding: 4px; }
  .collection-page .showcase-card-menu .showcase-menu-content :is(a,button) { font-size: 12px; padding: 8px 6px; }
}

/* Переключатель списка и комплектов коллекции. */
.collection-page .showcase-toolbar {grid-template-columns:minmax(0,1fr) 150px 145px 260px}
.showcase-view-actions{display:flex;gap:8px;min-width:0}.showcase-view-actions .showcase-add{flex:1}
.collection-page .showcase-view { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; padding: 0; }
.showcase-view > svg { display: block; width: 24px; height: 24px; pointer-events: none; }
.collection-sets{--tile-columns:4;--tile-gap:22px;display:flex;flex-wrap:wrap;justify-content:center;gap:var(--tile-gap);padding:8px 5px 20px}
@media (min-width: 1101px) {
  .collection-sets:has(> .collection-set:nth-child(5):last-child) { --tile-columns: 5; }
}
@media (min-width: 1280px) {
  .collection-sets:has(> .collection-set:nth-child(6):last-child) { --tile-columns: 6; }
}
.collection-set{box-sizing:border-box;width:calc((100% + var(--tile-gap)) / var(--tile-columns) - var(--tile-gap));position:relative;display:grid;grid-template-rows:minmax(2.8em,auto) 1px minmax(0,1fr) auto;aspect-ratio:1;align-content:start;min-width:0;min-height:0;gap:8px;padding:14px;border:1px solid var(--border);border-radius:8px;background:#19232b;color:var(--text);font:inherit;cursor:pointer;text-align:left;box-shadow:4px 4px 0 #263946,8px 8px 0 #172630}
.collection-set:hover,.collection-set:focus-visible{border-color:var(--accent);outline-color:var(--accent)}
.collection-set-divider{display:block;width:100%;height:1px;background:var(--border)}
.collection-set-preview {
  --thumbnail-height: 55px;
  --thumbnail-gap: 4px;
  display: grid;
  grid-template-columns: repeat(auto-fill, 39px);
  grid-auto-rows: var(--thumbnail-height);
  align-content: start;
  gap: var(--thumbnail-gap);
  width: 100%;
  min-height: 0;
  max-height: max(0px, calc(round(down, 100% + var(--thumbnail-gap), var(--thumbnail-height) + var(--thumbnail-gap)) - var(--thumbnail-gap)));
  overflow: hidden;
}
.collection-set-preview img { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--card-image-background); }
.collection-set strong{font-size:16px;line-height:1.4;overflow-wrap:anywhere}.collection-set>span:last-child{font-size:12px;color:var(--muted)}
.collection-sets-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-bottom:12px;margin-bottom:16px;border-bottom:1px solid var(--border)}
.collection-page .collection-sets-back{display:inline-flex;align-items:center;justify-content:center;height:44px;min-height:44px;margin:0}
.collection-page .personal-category-sort-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-bottom:12px;border-bottom:1px solid var(--border)}
.collection-platform-sort{position:relative;flex:none;margin-left:auto}
.collection-page .collection-platform-sort-toggle{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:44px;height:44px;min-height:44px;padding:0;white-space:nowrap;font-size:13px;font-weight:700}
.collection-platform-sort-menu{position:absolute;right:0;top:calc(100% + 8px);z-index:30;display:grid;gap:4px;width:min(280px,calc(100vw - 56px));padding:8px;border:1px solid var(--border);border-radius:8px;background:#18252f;box-shadow:0 8px 28px #0008}
.collection-platform-sort-menu button{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:44px;border:1px solid transparent;border-radius:5px;background:transparent;color:var(--text);font:inherit;cursor:pointer}
.collection-platform-sort-menu button[aria-checked=true]{background:#233b4b;border-color:var(--accent);color:var(--accent)}
.collection-platform-sort-menu button:hover{background:#2c4050}
.collection-platform-sort-menu button:focus-visible,.collection-platform-sort-toggle:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.collection-platform-sort-note{margin:6px 4px 2px;font-size:12px;line-height:1.5;color:var(--muted)}
.collection-page [hidden]{display:none!important}
@media(max-width:1100px){.collection-sets{--tile-columns:3}.collection-page .showcase-toolbar{grid-template-columns:minmax(0,1fr) 110px 110px 220px}}
@media(max-width:700px){.collection-sets{--tile-columns:2}.collection-page .showcase-toolbar{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.collection-page .showcase-toolbar .showcase-search{grid-column:1/-1}.showcase-view-actions{grid-column:1/-1}}
@media(max-width:500px){.collection-page .showcase-toolbar .showcase-search{grid-column:1/-1}.collection-page .showcase-add{grid-column:auto;grid-row:auto}.collection-sets{--tile-gap:15px}.collection-set{padding:8px;font-size:13px}.collection-set strong{font-size:13px}}
@media(max-width:360px){.collection-sets{--tile-columns:1}}

.collection-catalog-dialog { width: calc(100vw - 32px); max-width: 1600px; height: calc(100dvh - 32px); max-height: calc(100dvh - 32px); box-sizing: border-box; margin: auto; padding: 0; border: 1px solid #436478; border-radius: 12px; background: #19232b; color: var(--text); overflow: hidden; }
.collection-catalog-dialog[open] { display: flex; flex-direction: column; }
.collection-catalog-dialog::backdrop { background: rgb(0 0 0 / 75%); }
.collection-catalog-dialog { contain: paint; isolation: isolate; }
.collection-catalog-heading { display: flex; align-items: center; gap: 16px; padding: 12px 60px 12px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.collection-catalog-tabs { display: flex; flex: 1; min-width: 0; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; padding: 3px; }
.collection-catalog-tabs a { display: flex; flex-shrink: 0; align-items: center; justify-content: center; min-height: 40px; padding: 8px 16px; border: 1px solid var(--border); border-radius: 6px; color: var(--text); text-decoration: none; white-space: nowrap; }
.collection-catalog-tabs a:hover, .collection-catalog-tabs a[aria-current="page"] { color: var(--accent); border-color: var(--accent); background: #233b4b; }
.collection-catalog-tabs a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.collection-catalog-heading .game-dialog-close { top: 12px; right: 12px; }
.collection-catalog-content.workspace { flex: 1; min-height: 0; width: 100%; margin: 0; padding: 0; overflow: hidden; }
.collection-catalog-content .catalog-panel { border: 0; border-radius: 0; }
.collection-catalog-content .catalog-section-tabs { display: none; }
.collection-catalog-status { position: absolute; right: 16px; bottom: 16px; z-index: 4; max-width: calc(100% - 32px); box-sizing: border-box; margin: 0; padding: 10px 14px; border: 1px solid var(--border); border-radius: 6px; background: #19232b; box-shadow: 0 4px 16px rgb(0 0 0 / 25%); }
.collection-catalog-status[hidden] { display: none; }
@media(max-width:500px) {
  .collection-catalog-dialog { width: calc(100vw - 12px); height: calc(100dvh - 12px); max-height: calc(100dvh - 12px); }
  .collection-catalog-heading { gap: 8px; padding: 10px 48px 10px 10px; }
  .collection-catalog-tabs { gap: 6px; }
  .collection-catalog-tabs a { padding: 8px 12px; font-size: 13px; }
  .collection-catalog-heading .game-dialog-close { top: 8px; right: 8px; }
}
