/* Game Library presentation: Environment is the primary semantic color. */
.game-library-controls .library-filters .filter-button.active:not(.is-filter-active) {
  border-color: #4b525e;
  background: #293039;
  color: var(--text);
}

.game-library-controls .library-filters .filter-button.is-filter-active,
.game-library-scopes [data-library-scope]:not([data-library-scope="all"])[aria-pressed="true"],
.game-library-scopes .review-queue-button[aria-pressed="true"] {
  border-color: var(--accent-pink);
  background: var(--accent-pink-wash);
  color: var(--accent-pink-soft);
  box-shadow: inset 0 -3px 0 var(--accent-pink), 0 0 0 1px color-mix(in srgb, var(--accent-pink) 18%, transparent);
}

.game-library-controls .filter-selects select.is-filter-active {
  border-color: var(--accent-pink);
  background: color-mix(in srgb, var(--accent-pink) 9%, #152028);
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--accent-pink), 0 0 0 2px color-mix(in srgb, var(--accent-pink) 10%, transparent);
  font-weight: 800;
}

.game-library-filter-status {
  display: flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  min-height: 44px;
  gap: 10px;
  padding: 5px 6px 5px 12px;
  border: 1px solid color-mix(in srgb, var(--accent-pink) 48%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent-pink) 8%, var(--surface));
}

.game-library-filter-count {
  color: var(--accent-pink-soft);
  font: 800 10px 'DM Mono';
  letter-spacing: .55px;
  text-transform: uppercase;
}

.game-library-clear-filters {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--accent-pink) 48%, var(--line));
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: 800 11px Manrope;
}

.game-library-clear-filters:hover,
.game-library-clear-filters:focus-visible {
  outline: none;
  border-color: var(--accent-pink);
  background: var(--accent-pink-wash);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-pink) 13%, transparent);
}

.game-library-empty .ghost-button {
  min-height: 44px;
  margin-top: 16px;
}

.game-card,
.game-list-row {
  --game-environment-color: var(--accent, var(--text-muted));
}

.game-card::before {
  background: var(--game-environment-color);
}

.game-card .library-card-media,
.game-list-row .library-card-media {
  position: relative;
  overflow: hidden;
  border-style: solid;
  border-color: color-mix(in srgb, var(--game-environment-color) 46%, var(--line));
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--game-environment-color) 10%, transparent), transparent 62%),
    var(--surface);
  color: var(--game-environment-color);
}

.game-card .library-card-media::after,
.game-list-row .library-card-media::after {
  content: "";
  position: absolute;
  inset: auto 10px 8px;
  height: 2px;
  border-radius: 99px;
  background: var(--game-environment-color);
  opacity: .75;
}

.game-card .library-card-media > span,
.game-list-row .library-card-media > span {
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--game-environment-color) 25%, transparent));
}

.game-card-title h2 {
  text-wrap: balance;
}

.game-environment-row {
  display: flex;
  margin: 9px 0 10px;
}

.tag.environment-tag {
  border-color: color-mix(in srgb, var(--metadata-color) 72%, transparent);
  background: color-mix(in srgb, var(--metadata-color) 16%, transparent);
  color: var(--metadata-color);
  box-shadow: inset 3px 0 0 var(--metadata-color);
  font-weight: 800;
}

.game-card .game-card-summary {
  color: var(--text-muted);
  line-height: 1.5;
}

.game-role-summary {
  display: block;
  margin: 7px 0 0;
  overflow: hidden;
  color: color-mix(in srgb, var(--text) 76%, var(--text-muted));
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.picker-game .game-role-summary {
  white-space: nowrap;
}

.game-card .game-secondary-meta,
.game-list-row .game-secondary-meta {
  align-items: center;
  margin-top: 13px;
}

/* Tenets are framework metadata, not another structural color system. */
.game-card .framework-item-badge,
.game-list-row .framework-item-badge {
  border-color: #4b4d5c;
  background: #20212c;
  color: #c4c6d1;
  box-shadow: none;
}

.game-card .focus-subject-tag,
.game-list-row .focus-subject-tag {
  border-color: color-mix(in srgb, var(--metadata-color) 42%, transparent);
  background: color-mix(in srgb, var(--metadata-color) 8%, transparent);
  color: color-mix(in srgb, var(--metadata-color) 82%, white);
}

.game-card .library-item-markers,
.game-list-row .library-item-markers {
  color: var(--text-muted);
}

.game-card .library-mine-marker,
.game-list-row .library-mine-marker {
  border-color: #51535f;
  background: #1c1d27;
  color: #c6c8d1;
}

.game-card .library-bookmark,
.game-list-row .library-bookmark {
  border-color: #4f515d;
  background: #1b1c25;
  color: #b9bbc5;
}

.game-card .library-bookmark.is-saved,
.game-list-row .library-bookmark.is-saved {
  border-color: #858793;
  background: #d8d9de;
  color: #181921;
}

/* List mode is an intentionally dense index, while Cards retain the rich preview. */
.game-list,
.lesson-list {
  display: grid;
  gap: 7px;
}

.compact-library-row {
  --compact-list-accent: var(--accent, var(--text-muted));
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 70px;
  padding: 8px 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 3px solid var(--compact-list-accent);
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface-raised) 96%, var(--compact-list-accent));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
  transition: border-color .16s ease, background-color .16s ease, transform .16s ease;
}

.game-list-row {
  --compact-list-accent: var(--game-environment-color);
}

.compact-library-row:hover {
  border-color: color-mix(in srgb, var(--compact-list-accent) 58%, var(--line));
  background: color-mix(in srgb, var(--compact-list-accent) 4%, var(--surface-raised));
  transform: translateX(2px);
}

.game-list-row.compact-library-row > .environment-artwork--list,
.lesson-list-row.compact-library-row > .lesson-artwork--compact {
  width: 52px;
  height: 52px;
  min-height: 0;
  aspect-ratio: 1;
  border-radius: 7px;
}

.game-list-row.compact-library-row > .environment-artwork--list img,
.lesson-list-row.compact-library-row > .lesson-artwork--compact img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compact-list-copy {
  min-width: 0;
}

.compact-list-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.compact-list-title-row h2,
.game-list-row .game-list-copy h2 {
  display: -webkit-box;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
  overflow-wrap: break-word;
  text-overflow: clip;
  white-space: normal;
  word-break: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.compact-list-title-row .game-status,
.compact-list-title-row .archived-badge {
  flex: 0 0 auto;
  padding: 3px 5px;
  font-size: 8px;
}

.compact-list-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin-top: 5px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.15;
  white-space: nowrap;
}

.compact-list-meta > * {
  flex: 0 0 auto;
}

.compact-list-meta .tag,
.compact-list-meta .program-badge {
  padding: 3px 6px;
  font-size: 8px;
  line-height: 1.1;
}

.compact-list-meta .program-badge-group {
  gap: 4px;
}

.compact-list-meta .library-item-markers {
  display: contents;
}

.compact-list-meta .library-mine-marker {
  padding: 3px 5px;
  font-size: 8px;
}

.compact-list-classification,
.compact-list-count,
.compact-list-meta .game-creator {
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-list-classification {
  max-width: 190px;
  color: color-mix(in srgb, var(--compact-list-accent) 38%, var(--text));
  font-weight: 700;
}

.compact-list-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.compact-list-actions .library-bookmark,
.compact-list-open {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
}

.compact-list-open {
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  text-decoration: none;
}

.compact-list-open:hover,
.compact-list-open:focus-visible {
  border-color: color-mix(in srgb, var(--compact-list-accent) 62%, var(--line));
  outline: none;
  background: color-mix(in srgb, var(--compact-list-accent) 10%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--compact-list-accent) 12%, transparent);
}

.lesson-library-view-row {
  margin-top: 12px;
}

@media (max-width: 620px) {
  .game-library-filter-status {
    justify-content: space-between;
    width: 100%;
  }

  .game-library-clear-filters {
    min-height: 44px;
  }

  .game-card {
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: 13px;
    min-height: 0;
  }

  .game-card .library-card-media {
    width: 48px;
  }

  .game-card .library-card-media::after,
  .game-list-row .library-card-media::after {
    inset-inline: 8px;
  }

  .game-card .game-card-title h2 {
    font-size: 18px;
    line-height: 1.12;
  }

  .game-list-row {
    grid-template-columns: 48px minmax(0, 1fr) auto;
  }

  .compact-library-row {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 66px;
    padding: 6px 7px;
  }

  .game-list-row.compact-library-row > .environment-artwork--list,
  .lesson-list-row.compact-library-row > .lesson-artwork--compact {
    width: 48px;
    height: 48px;
  }

  .compact-list-classification {
    max-width: 120px;
  }

  .game-list-meta .environment-tag {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .game-list-meta .classification-tag {
    display: none;
  }

  .game-list-meta .library-item-markers {
    display: none;
  }
}

@media (max-width: 360px) {
  .compact-library-row {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 6px;
    min-height: 62px;
    padding: 5px;
  }

  .game-list-row.compact-library-row > .environment-artwork--list,
  .lesson-list-row.compact-library-row > .lesson-artwork--compact {
    width: 44px;
    height: 44px;
  }

  .compact-list-actions {
    gap: 0;
  }

  .compact-list-title-row h2,
  .game-list-row .game-list-copy h2 {
    font-size: 13px;
  }

  .compact-list-meta .classification-tag,
  .game-list-meta .program-badge-group,
  .compact-list-meta .game-creator {
    display: none;
  }

  .compact-list-classification {
    max-width: 88px;
  }

  .game-list-meta .environment-tag {
    max-width: 100%;
  }
}

/* Editorial browsing pilot. IDs and page-content scopes deliberately exclude
   Lesson Library, game pickers and Game Detail despite their shared classes. */
.workspace:has(.game-library-controls,.game-library-empty-library) .topbar {
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
  padding-block: 0 24px;
  border-bottom: 1px solid var(--divider);
}
.workspace:has(.game-library-controls,.game-library-empty-library) .topbar .page-header-copy #page-title {
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  clip-path: none;
  text-shadow: none;
  font: 800 calc(2.25rem * var(--text-display-scale))/1.15 var(--font-body);
  letter-spacing: -.045em;
  white-space: normal;
  overflow-wrap: anywhere;
}
.workspace:has(.game-library-controls,.game-library-empty-library) #page-title::after,
.workspace:has(.game-library-controls,.game-library-empty-library) .page-identity-visual::after { display: none; }
.workspace:has(.game-library-controls,.game-library-empty-library) .page-identity-visual {
  border: 0;
  background: none;
  box-shadow: none;
  clip-path: none;
}
.workspace:has(.game-library-controls,.game-library-empty-library) .app-history-controls {
  position: static;
  display: flex;
  width: fit-content;
  margin-bottom: 20px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
}
.workspace:has(.game-library-controls,.game-library-empty-library) .app-history-controls button { min-height: 44px; border-radius: 6px; }
.workspace:has(.game-library-controls,.game-library-empty-library) :is(a,button,input,select):focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  box-shadow: none;
}
.workspace .game-library-controls { gap: 20px; margin: 0 0 32px; }
.workspace .game-library-controls .library-scope-row { gap: 12px; }
.workspace .game-library-controls .library-scope-label { font-family: var(--font-body); letter-spacing: .02em; text-transform: none; }
.workspace .game-library-controls :is(button,input,select) { min-height: 44px; border-radius: 6px; }
.workspace .game-library-controls .library-search-field { width: min(100%,560px); }
.workspace .game-library-controls .library-search { width: 100%; padding-block: 12px; font-weight: 500; }
.workspace .game-library-controls .library-filters { gap: 8px; }
.workspace .game-library-controls .filter-selects { gap: 12px; }
.workspace .game-library-controls .filter-selects select { flex: 1 1 190px; min-width: 0; max-width: 100%; }
.workspace .game-library-controls .game-library-filter-status {
  flex-wrap: wrap;
  width: auto;
  justify-content: flex-start;
  gap: 8px 16px;
  padding: 0;
  border: 0;
  background: none;
}
.workspace .game-library-controls .game-library-filter-count { font-family: var(--font-body); font-size: calc(.8125rem * var(--text-metadata-scale)); letter-spacing: 0; text-transform: none; }
.workspace .game-library-controls :is(.is-filter-active,[data-library-scope][aria-pressed="true"],.review-queue-button[aria-pressed="true"]) { box-shadow: inset 0 -2px 0 var(--accent-pink); }
#game-library-results .library-view-row { gap: 16px; margin: 0 0 20px; padding-bottom: 16px; border-bottom: 1px solid var(--divider); }
#game-library-results .library-view-row button { min-height: 44px; border-radius: 6px; }
#game-library-results .game-grid { grid-template-columns: repeat(auto-fill,minmax(min(100%,360px),1fr)); gap: 24px; }
#game-library-results .game-card {
  grid-template-columns: 72px minmax(0,1fr);
  grid-template-rows: auto 1fr auto;
  align-content: start;
  gap: 0 20px;
  padding: 24px;
  border: 0;
  border-top: 2px solid var(--game-environment-color);
  border-radius: 6px;
  background: var(--surface);
  background-image: none;
  box-shadow: none;
  transform: none;
}
#game-library-results .game-card::before { display: none; }
#game-library-results .game-card > .library-card-media {
  width: 72px;
  height: 72px;
  min-height: 0;
  border: 0;
  border-radius: 4px;
  box-shadow: none;
}
#game-library-results .library-card-media::after { display: none; }
#game-library-results .game-card-title { align-items: flex-start; gap: 8px; }
#game-library-results .game-card-title h2 {
  font: 800 calc(1.25rem * var(--text-display-scale))/1.3 var(--font-body);
  letter-spacing: -.025em;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}
#game-library-results .game-card-summary { margin-block: 16px 8px; font-size: calc(.875rem * var(--text-reading-scale)); line-height: 1.6; }
#game-library-results .game-role-summary { font-size: calc(.8125rem * var(--text-metadata-scale)); font-weight: 500; line-height: 1.5; }
#game-library-results .game-card .game-secondary-meta { margin-top: 16px; gap: 8px; }
#game-library-results .game-card footer { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--divider); background: none; gap: 12px; flex-wrap: wrap; }
#game-library-results .game-card footer time { font-family: var(--font-body); text-transform: none; letter-spacing: 0; }
#game-library-results .card-link { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 4px; }
#game-library-results :is(.tag,.library-mine-marker) { border: 0; border-radius: 4px; box-shadow: none; white-space: normal; overflow: visible; text-overflow: clip; }
#game-library-results .environment-tag { padding-left: 0; background: none; font-weight: 700; }
#game-library-results .library-mine-marker { padding-left: 0; background: none; }
#game-library-results .game-status { font-family: var(--font-body); font-size: calc(.6875rem * var(--text-metadata-scale)); line-height: 1.4; white-space: normal; }
#game-library-results .game-search-match-reason { padding: 8px 0; border: 0; border-radius: 0; background: none; }
#game-library-results .game-list { gap: 0; }
#game-library-results .game-list-row {
  grid-template-columns: 52px minmax(0,1fr) auto;
  gap: 16px;
  padding: 20px 0;
  border: 0;
  border-bottom: 1px solid var(--divider);
  border-radius: 0;
  background: none;
  box-shadow: none;
  transform: none;
  overflow: visible;
}
#game-library-results .game-list-row > .environment-artwork--list { width: 52px; height: 52px; border: 0; border-radius: 4px; box-shadow: none; }
#game-library-results .compact-list-title-row { flex-wrap: wrap; gap: 8px 12px; }
#game-library-results .game-list-copy h2 { display: block; font: 800 calc(1rem * var(--text-display-scale))/1.4 var(--font-body); letter-spacing: -.015em; overflow: visible; overflow-wrap: anywhere; -webkit-line-clamp: unset; }
#game-library-results .compact-list-meta { flex-wrap: wrap; gap: 8px; margin-top: 8px; overflow: visible; white-space: normal; line-height: 1.5; }
#game-library-results .compact-list-meta :is(.tag,.program-badge,.library-mine-marker) { font-size: calc(.6875rem * var(--text-metadata-scale)); line-height: 1.4; }
#game-library-results .compact-list-meta :is(.classification-tag,.program-badge-group,.game-creator) { display: inline-flex; max-width: 100%; overflow: visible; white-space: normal; }
#game-library-results .compact-list-meta .library-item-markers { display: contents; }
#game-library-results .compact-list-actions { gap: 4px; }
#game-library-results .compact-list-open { border-radius: 6px; }
#game-library-results .library-pagination button { min-width: 44px; min-height: 44px; }
#game-library-results .game-library-empty,
.workspace .game-library-empty-library { padding: 48px 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
#game-library-results .game-library-empty h2,
.workspace .game-library-empty-library h2 { font-family: var(--font-body); letter-spacing: -.025em; }
@media(max-width:760px) {
  .workspace:has(.game-library-controls,.game-library-empty-library) .topbar .page-header-copy #page-title { font-size: calc(1.75rem * var(--text-display-scale)); }
  .workspace .game-library-controls .filter-selects { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .workspace .game-library-controls .library-search-field { width: 100%; }
  #game-library-results .game-card { grid-template-columns: 56px minmax(0,1fr); gap: 0 16px; padding: 20px 16px; }
  #game-library-results .game-card > .library-card-media { width: 56px; height: 56px; }
  #game-library-results .game-list-row { grid-template-columns: 44px minmax(0,1fr); gap: 12px; }
  #game-library-results .game-list-row > .environment-artwork--list { width: 44px; height: 44px; }
  #game-library-results .compact-list-actions { grid-column: 2; justify-self: end; }
}
@media(max-width:380px) {
  .workspace .game-library-controls .filter-selects { grid-template-columns: minmax(0,1fr); }
}
html[data-text-scale-level="accessibility"] #game-library-results .game-grid { grid-template-columns: minmax(0,1fr); }
html[data-text-scale-level="accessibility"] #game-library-results .game-card { grid-template-columns: minmax(0,1fr); }
html[data-text-scale-level="accessibility"] #game-library-results .game-card > .library-card-media { margin-bottom: 16px; }
html[data-text-scale-level="accessibility"] .workspace .game-library-controls .filter-selects { display: grid; grid-template-columns: minmax(0,1fr); }

/* Auxiliary Owner workflows remain available without competing with Games. */
.workspace .game-library-controls .owner-process-grid { gap: 16px; margin: 0; }
.workspace .game-library-controls .owner-process-card {
  min-height: 64px;
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--text-primary);
  box-shadow: none;
}
.workspace .game-library-controls .owner-process-card::before { display: none; }
.workspace .game-library-controls .owner-process-card .owner-process-icon { flex-basis: 20px; width: 20px; height: 24px; border: 0; border-radius: 0; background: none; }
.workspace .game-library-controls .owner-process-card strong { font-size: var(--text-body); }
.workspace .game-library-controls .owner-process-card small { color: var(--text-muted); line-height: 1.5; }
@media(max-width:620px) {
  .workspace .game-library-controls .owner-process-grid { gap: 4px; }
}
html[data-text-scale-level="accessibility"] #game-library-results .game-card .library-card-body { grid-column: 1; }
html[data-text-scale-level="accessibility"] #game-library-results .game-card footer { grid-column: 1; }
#game-library-results .game-card footer { grid-row: 3; }
#game-library-results .game-card :is(.tag,.program-badge,.library-mine-marker) { font-size: calc(.6875rem * var(--text-metadata-scale)); }
#game-library-results .game-card footer time { font-size: calc(.75rem * var(--text-metadata-scale)); }
.workspace .game-library-controls .library-search-clear { width: 44px; }
.workspace .game-library-controls .library-search { padding-right: 52px; }
.workspace:has(.game-library-controls,.game-library-empty-library) .top-action { min-height: 44px; }
@media(max-width:760px) {
  .workspace .game-library-controls .filter-selects select:last-child:nth-child(odd) { grid-column: 1/-1; }
}
#game-library-results .game-revision-marker { max-width: 100%; white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
html[data-text-scale-level="accessibility"] #game-library-results .game-card .library-card-body { padding-right: 0; }

/* Media-ready Game Library cards. The hero frame is intentionally generic so
   a future photograph/poster can replace the derived sprite without changing
   the card's content hierarchy. */
#game-library-results .game-grid {
  grid-template-columns: repeat(auto-fill,minmax(min(100%,330px),1fr));
  align-items: stretch;
  gap: 24px;
}
#game-library-results .game-library-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb,var(--accent) 26%,var(--divider));
  border-top-width: 1px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 16px 34px rgba(0,0,0,.16);
  isolation: isolate;
  transition: border-color .18s ease,box-shadow .18s ease,transform .18s ease;
}
#game-library-results .game-library-card::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
  content: "";
  opacity: .85;
  pointer-events: none;
}
#game-library-results .game-card-media-frame {
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;
  background: #080d13;
}
#game-library-results .game-card-media-frame::after {
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(180deg,transparent,rgba(3,7,11,.58));
  content: "";
  pointer-events: none;
}
#game-library-results .game-library-card .environment-artwork--hero {
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 16/9;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
#game-library-results .game-library-card .environment-artwork--hero img {
  object-fit: cover;
  object-position: center 48%;
  image-rendering: pixelated;
}
#game-library-results .game-library-card .library-bookmark {
  top: 14px;
  right: 14px;
  z-index: 4;
  border-color: rgba(255,255,255,.42);
  background: rgba(7,12,18,.82);
  color: #f7faf8;
  box-shadow: 0 8px 20px rgba(0,0,0,.24);
  backdrop-filter: blur(8px);
}
#game-library-results .game-library-card .library-bookmark.is-saved {
  border-color: rgba(255,255,255,.72);
  background: #f2f5f2;
  color: #182026;
}
#game-library-results .game-library-card .library-card-body {
  flex: 1 1 auto;
  padding: 20px 20px 10px;
}
#game-library-results .game-library-card .game-card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 12px;
}
#game-library-results .game-library-card .game-card-title h2 {
  flex: 1 1 210px;
  font: 800 calc(1.25rem * var(--text-display-scale))/1.25 var(--font-body);
  letter-spacing: -.028em;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}
#game-library-results .game-library-context {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 7px;
  min-width: 0;
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: calc(.75rem * var(--text-metadata-scale));
  font-weight: 700;
  line-height: 1.45;
}
#game-library-results .game-library-context span:not([aria-hidden]) { min-width: 0; overflow-wrap: anywhere; }
#game-library-results .game-library-context span:first-child { color: var(--accent); }
#game-library-results .game-library-card .game-card-summary {
  display: -webkit-box;
  margin: 16px 0 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: calc(.875rem * var(--text-reading-scale));
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
#game-library-results .game-library-card .library-item-markers {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 16px;
  color: var(--text-muted);
}
#game-library-results .game-library-card .library-mine-marker {
  padding: 0;
  background: none;
  color: var(--text-muted);
  font-weight: 650;
}
#game-library-results .game-library-card .game-queue-decision {
  position: relative;
  z-index: 2;
  margin: 8px 20px 0;
}
#game-library-results .game-library-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 20px 0;
  padding: 14px 0 18px;
  border-top: 1px solid var(--divider);
  background: none;
}
#game-library-results .game-library-card footer time {
  color: var(--text-muted);
  font: 600 calc(.6875rem * var(--text-metadata-scale))/1.4 var(--font-body);
  letter-spacing: 0;
  text-transform: none;
}
#game-library-results .game-card-open {
  color: var(--text-primary);
  font-size: calc(.75rem * var(--text-metadata-scale));
  font-weight: 800;
  white-space: nowrap;
}
#game-library-results .game-card-hit-area {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  min-height: 0;
  padding: 0;
  border-radius: inherit;
}
#game-library-results .game-library-card:has(.game-card-hit-area:focus-visible) {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}
#game-library-results .game-card-hit-area:focus-visible { outline: none; }

/* List View keeps the same information hierarchy in a denser, predictable row. */
#game-library-results .game-list-row {
  grid-template-columns: 52px minmax(0,1fr) auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 14px 0;
}
#game-library-results .game-list-row > .environment-artwork--list {
  width: 52px;
  height: 52px;
  align-self: start;
}
#game-library-results .game-list-copy { min-width: 0; }
#game-library-results .game-list-copy h2 {
  display: -webkit-box;
  overflow: hidden;
  font: 800 calc(1rem * var(--text-display-scale))/1.35 var(--font-body);
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
#game-library-results .game-list-row .game-library-context {
  margin-top: 4px;
  font-size: calc(.6875rem * var(--text-metadata-scale));
}
#game-library-results .game-list-row .library-item-markers {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 9px;
  margin-top: 5px;
}
#game-library-results .game-list-row .library-mine-marker {
  padding: 0;
  background: none;
  color: var(--text-muted);
}
#game-library-results .compact-list-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 5px;
}
#game-library-results .compact-list-actions .library-bookmark {
  position: static;
  grid-column: auto;
  grid-row: auto;
}
#game-library-results .compact-list-open { flex: 0 0 44px; width: 44px; height: 44px; }

@media(hover:hover) and (pointer:fine) {
  #game-library-results .game-library-card:hover {
    border-color: color-mix(in srgb,var(--accent) 52%,var(--divider));
    box-shadow: 0 20px 42px rgba(0,0,0,.22);
    transform: translateY(-2px);
  }
}
@media(max-width:760px) {
  #game-library-results .game-grid { grid-template-columns: minmax(0,1fr); gap: 18px; }
  #game-library-results .game-library-card { padding: 0; }
  #game-library-results .game-library-card .library-card-body { padding: 18px 16px 8px; }
  #game-library-results .game-library-card footer { margin-inline: 16px; }
  #game-library-results .game-library-card .game-queue-decision { margin-inline: 16px; }
  #game-library-results .game-list-row { grid-template-columns: 44px minmax(0,1fr) auto; gap: 10px; }
  #game-library-results .game-list-row > .environment-artwork--list { width: 44px; height: 44px; }
  #game-library-results .compact-list-actions { grid-column: 3; justify-self: end; }
}
@media(max-width:360px) {
  #game-library-results .compact-list-actions { gap: 2px; }
  #game-library-results .compact-list-actions .library-bookmark,
  #game-library-results .compact-list-open { width: 42px; height: 42px; flex-basis: 42px; }
}
@media(prefers-reduced-motion:reduce) {
  #game-library-results .game-library-card { transition: none; }
  #game-library-results .game-library-card:hover { transform: none; }
}
html[data-text-scale-level="accessibility"] #game-library-results .game-library-card { display: flex; }
html[data-text-scale-level="accessibility"] #game-library-results .game-library-card .environment-artwork--hero { margin: 0; }
html[data-text-scale-level="accessibility"] #game-library-results .game-list-row { grid-template-columns: 44px minmax(0,1fr); align-items: start; }
html[data-text-scale-level="accessibility"] #game-library-results .compact-list-actions { grid-column: 2; justify-self: start; margin-top: 8px; }
