:root {
  color-scheme: dark;
  --background: #1b2533;
  --panel: #171d25;
  --line: #2c394a;
  --text: #e0e6ed;
  --muted: #8f9eaf;
  --accent: #75b9ec;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); font: 14px/1.5 system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button, input, select { color: var(--text); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.site-header { height: 76px; padding: 0 32px; display: flex; align-items: center; gap: 48px; background: var(--panel); border-bottom: 1px solid #111820; }
.brand { font-size: 23px; font-weight: 750; letter-spacing: -.8px; }
.brand span { font-weight: 400; }
.brand small { margin-left: 2px; font-size: 12px; color: var(--muted); font-weight: 400; }
.current-page { align-self: stretch; display: flex; align-items: center; border-bottom: 3px solid var(--accent); color: var(--accent); font-size: 14px; }
.library { min-height: calc(100vh - 76px); }
main { padding: 28px 32px 60px; min-width: 0; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding-bottom: 24px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.heading { display: flex; align-items: baseline; gap: 13px; }
h1 { font-size: 23px; font-weight: 500; margin: 0; white-space: nowrap; }
#count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.controls { display: flex; align-items: center; gap: 20px; }
input, select { border: 1px solid #354456; border-radius: 3px; background: #141d29; }
input { padding: 9px 12px; width: 220px; min-width: 0; }
input::placeholder { color: #7d8da0; }
.sort { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; white-space: nowrap; }
select { padding: 9px 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 22px; }
.card { min-width: 0; background: #19212d; border: 1px solid #29374a; border-radius: 3px; overflow: hidden; transition: border-color .15s; }
.card:hover { border-color: var(--accent); }
.cover { aspect-ratio: 16 / 10; background: linear-gradient(145deg, var(--cover-color), #1a2638); display: flex; align-items: center; justify-content: center; position: relative; }
.initials { color: #ffffffb8; font-size: 52px; font-weight: 300; letter-spacing: -2px; }
.play { position: absolute; right: 10px; bottom: 10px; padding: 5px 10px; color: #d5ebfb; background: #111c2dd9; font-size: 11px; border: 1px solid #ffffff25; border-radius: 3px; }
.card:hover .play { background: #68a8d3; color: #101c28; }
.details { padding: 13px 15px 16px; }
.details h2 { font-size: 15px; font-weight: 550; margin: 0 0 3px; overflow-wrap: anywhere; }
.genre { color: var(--muted); font-size: 11px; }
.details p { font-size: 12px; color: #9aabba; margin: 9px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; white-space: pre-wrap; }
.empty { padding: 90px 20px; text-align: center; color: var(--muted); }
.empty h2 { margin: 0 0 8px; font-size: 18px; font-weight: 500; color: #b7c3d1; }
.empty p { margin: 0; font-size: 13px; }
.error { color: #edb2b2; padding: 14px; border: 1px solid #755050; background: #332a30; }
.error button { background: transparent; border: 0; text-decoration: underline; color: inherit; }
[hidden] { display: none !important; }
@media (min-width: 1600px) { .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); } }
@media (max-width: 1000px) { .toolbar { align-items: flex-start; flex-direction: column; } .controls { width: 100%; } input { flex: 1; } main { padding: 25px 22px 50px; } }
@media (max-width: 640px) {
  .site-header { padding: 0 20px; height: 64px; gap: 28px; }
  .brand { font-size: 21px; }
  .brand small { display: none; }
  .library { display: block; min-height: calc(100vh - 64px); }
  main { padding: 22px 16px 40px; }
  .controls { gap: 12px; }
  .sort { font-size: 0; }
  .sort select { font-size: 12px; max-width: 140px; }
  input { width: 0; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .initials { font-size: 36px; }
  .details { padding: 10px; }
  .details h2 { font-size: 13px; }
  .play { right: 6px; bottom: 6px; padding: 3px 7px; }
}
@media (prefers-reduced-motion: reduce) { .card { transition: none; } }

.capsule { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.has-capsule .capsule { opacity: 1; }
.has-capsule .initials { visibility: hidden; }
.cover .play { z-index: 1; }

.card { display: block; padding: 0; width: 100%; color: var(--text); text-align: left; font: inherit; }
.card.offline .cover { filter: saturate(.35); }
.card.offline .play { background: #332c2d; color: #e5b8ae; }
.capsule { transition: opacity .2s ease; }
.recent { margin-bottom: 32px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: center; }
.section-heading h2 { font-size: 17px; font-weight: 500; margin: 0; }
.local-note { color: var(--muted); font-size: 11px; margin: 5px 0 15px; }
.quiet { border: 0; background: transparent; color: var(--muted); padding: 8px; font-size: 12px; }
.quiet:hover { color: var(--text); }
.skeleton { aspect-ratio: 4/3; border-radius: 3px; background: linear-gradient(100deg,#263346 25%,#34465c 45%,#263346 65%); background-size: 200% 100%; animation: shimmer 1.8s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
dialog { width: min(850px,94vw); max-height: 90vh; padding: 26px; border: 1px solid #43566c; border-radius: 7px; background: #1b2533; color: var(--text); box-shadow: 0 25px 100px #0008; }
dialog::backdrop { background: #060d17c9; backdrop-filter: blur(4px); }
.dialog-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; }
.dialog-heading h2 { margin: 0; font-size: 27px; overflow-wrap: anywhere; }
#closeDetails { font-size: 28px; line-height: 1; }
.badges { display:flex; gap:6px; flex-wrap:wrap; margin:12px 0 20px; }
.badge { font-size:11px; padding:4px 8px; border:1px solid #394d63; border-radius:3px; color:#b9d2e6; }
.gallery > .cover { max-height: 340px; }
.screenshot-stage { aspect-ratio:16/9; display:flex; align-items:center; justify-content:center; background:#111923; overflow:hidden; border-radius:3px; }
.screenshot-stage > img { width:100%; height:100%; object-fit:contain; }
.screenshot-error { color:var(--muted); }
.thumbnails { display:flex; gap:9px; margin-top:10px; overflow-x:auto; padding:3px; }
.thumbnails button { width:100px; height:64px; padding:2px; flex:0 0 auto; background:#141d29; border:2px solid transparent; border-radius:3px; }
.thumbnails button[aria-pressed=true] { border-color:var(--accent); }
.thumbnails img { width:100%; height:100%; object-fit:cover; }
#gameSummary { color:#b9c7d5; font-size:14px; white-space:pre-wrap; overflow-wrap:anywhere; }
dialog section h3 { font-size:14px; margin:22px 0 8px; font-weight:600; }
.prose { color:#9eafc0; white-space:pre-wrap; overflow-wrap:anywhere; }
.launch-bar { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-top:25px; padding-top:20px; border-top:1px solid var(--line); }
#gameAvailability { font-size:12px; color:var(--muted); }
.launch { background:#72b9e4; color:#102334; padding:11px 22px; border-radius:4px; font-weight:650; white-space:nowrap; }
.launch[aria-disabled=true] { background:#344251; color:#85919f; cursor:default; }
@media (max-width:640px) { dialog { padding:18px; } .launch-bar { flex-direction:column; align-items:stretch; } .launch { text-align:center; } .dialog-heading h2 { font-size:22px; } .recent .grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (prefers-reduced-motion:reduce) { .skeleton { animation:none; } .capsule { transition:none; } }
