:root { color-scheme: dark; }
body { min-width: 280px; }
main { max-width: 1280px; }
body { background: #101721; }
.navbar { border-bottom: 1px solid #2c3745; }
#account-label { max-width: 240px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1rem 0; }
.page-heading > div { min-width: 0; }
.page-heading h1 { font-size: 1.5rem; margin: 0; overflow-wrap: anywhere; }
.page-heading .eyebrow, .page-heading #page-description { display: none; }
.library-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }
.library-toolbar .btn { white-space: nowrap; }
#library-platform-toggle { position: relative; flex-shrink: 0; }
.platform-filter-dot { position: absolute; top: .25rem; right: .25rem; width: .5rem; height: .5rem; border-radius: 50%; background: #84b6dc; }
#library-platform-tray { width: min(360px, 100vw); }
.platform-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.platform-choice { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .5rem; min-height: 100px; padding: .75rem; overflow-wrap: anywhere; color: #ecf3fa; border-color: #405268; }
.platform-choice img { width: 100%; height: 48px; object-fit: contain; filter: brightness(0) invert(1); }
.platform-choice .bi { height: 48px; font-size: 2rem; }
.platform-choice[aria-pressed="true"] { background: #223d53; border-color: #84b6dc; color: #fff; box-shadow: inset 0 0 0 1px #84b6dc; }
.library-filters { background: #192330; border: 1px solid #2c3745; padding: 1rem; border-radius: .6rem; margin-bottom: 1rem; }
.library-columns, .library-row { display: grid; grid-template-columns: minmax(0, 1fr) 100px; gap: 1rem; align-items: center; }
.library-columns { padding: .6rem 1rem; color: #aebdce; font-size: .8rem; }
.library-columns button { border: 0; padding: 0; text-align: left; background: transparent; color: inherit; }
.library-columns > span { text-align: right; }
.library-row { padding: 1rem; border: 1px solid #2c3745; background: #192330; border-radius: .6rem; margin-bottom: .5rem; }
.library-game { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 1rem; align-items: center; min-width: 0; }
.library-game > div { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.game-title { color: #ecf3fa; text-align: left; font-size: 1rem; font-weight: 600; background: transparent; border: 0; padding: 0; overflow-wrap: anywhere; text-decoration: none; }
.game-page-cover { display: block; max-width: 100%; max-height: 420px; margin: auto; object-fit: contain; }
.game-facts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: .4rem 1rem; margin-bottom: 1rem; }
.game-facts dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.game-facts dt { overflow-wrap: anywhere; }
#game-content a { overflow-wrap: anywhere; }
.artwork-preview { width: 100%; height: 230px; object-fit: contain; }
#game-artwork-results { overflow-wrap: anywhere; }
.game-title:hover { color: #9dcdee; }
.library-actions { position: relative; justify-self: end; }
.library-actions summary { color: #9dcdee; font-size: .85rem; }
.library-actions > div { position: absolute; right: 0; top: 100%; z-index: 1; width: min(320px, calc(100vw - 4rem)); margin-top: .5rem; padding: .75rem; background: #192330; border: 1px solid #405268; border-radius: .5rem; box-shadow: 0 .5rem 1rem #0005; }
.library-empty { padding: 3rem 1rem; text-align: center; border: 1px dashed #405268; border-radius: .6rem; color: #aebdce; }
.account-row { display: flex; flex-direction: column; gap: .6rem; padding: 1rem 0; border-bottom: 1px solid #2c3745; overflow-wrap: anywhere; }
.scanner-tools { padding: 1rem; background: #101721; border-radius: .5rem; }
.scan-result-section { margin-top: 1.5rem; padding: 1rem; border: 1px solid #405268; border-left: 4px solid #84b6dc; border-radius: .5rem; background: #192330; overflow-wrap: anywhere; }
.scan-result-section:empty { display: none; }
.scan-result-catalogue { border-left-color: #a6b5ff; background: #161e2c; }
.scan-result-cex > h2 { color: #9dcdee; }
.scan-result-catalogue > h2 { color: #b9c5ff; }
.provider-card-heading > strong { min-width: 0; }
.provider-logo { width: 36px; height: 28px; object-fit: contain; flex-shrink: 0; }
.provider-logo-wide { width: 84px; }
#scanner-container { max-width: 400px; height: 180px; position: relative; overflow: hidden; border-radius: .375rem; background: #000; }
#scanner-container video { position: absolute; top: 0; left: 0; display: block; width: 100%; height: auto; background: #000; }
#scanner-container canvas { display: none; }
.game-cover { width: 64px; height: 80px; object-fit: contain; flex-shrink: 0; }
.cover-unavailable { display: grid; place-items: center; flex-shrink: 0; border: 1px solid #405268; border-radius: .25rem; color: #aebdce; font-size: 1.5rem; }
img.cover-unavailable { border: 0; }
.game-card { min-height: 100px; }
dialog { width: min(94vw, 650px); max-height: 85vh; overflow: auto; color: var(--bs-body-color); background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); }
dialog:not([open]) { display: none; }
dialog::backdrop { background: #000a; }
#purchase-dialog { width: min(94vw, 480px); }
#purchase-panel, #create-panel, #catalogue-results h2 { scroll-margin-top: 5.5rem; }
#games .card-title { overflow-wrap: anywhere; }
#invite-link { font-size: .8rem; }
.database-game-summary { min-width: 0; overflow-wrap: anywhere; }
.database-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .4rem 1rem; }
.database-facts dd { margin: 0; overflow-wrap: anywhere; }
#database-preview-content { overflow-wrap: anywhere; }
.database-release { background: #192330; }
.database-linked-record { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem 1rem; align-items: start; }
.database-linked-record > div { min-width: 0; overflow-wrap: anywhere; }
.database-linked-record .btn { white-space: normal; }
#database-evidence pre { white-space: pre-wrap; overflow-wrap: anywhere; }
#database-detail .nav-link { padding: .5rem .65rem; }
#database-related .btn { white-space: normal; text-align: left; }
@media (max-width: 850px) {
  .library-columns { display: none; }
  .library-row { grid-template-columns: minmax(0, 1fr) auto; gap: .5rem 1rem; }
  .library-actions { align-self: center; }
}
@media (max-width: 576px) {
  #purchase-dialog { margin: auto auto 1rem; }
  .database-linked-record { grid-template-columns: minmax(0, 1fr); }
  .card-body { padding: .75rem; }
  .page-heading { align-items: start; }
  .page-heading > a { flex-shrink: 0; }
}
