:root {
  color-scheme: dark;
  --bg: #101113;
  --panel: #202226;
  --text: #f1f2f3;
  --muted: #91969f;
  --line: #ffffff12;
  --accent: #c1deb5;
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; border: 0; }
button:disabled { opacity: .28; cursor: default; }
button:focus-visible, a:focus-visible, .file-button:focus-within, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
button:hover:not(:disabled), .file-button:hover { background-color: #ffffff0c; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.library-header, #library { width: min(1280px, 100%); margin: auto; padding-inline: 40px; }
.library-header { height: 100px; display: flex; align-items: center; justify-content: space-between; }
.wordmark { font-size: 25px; font-weight: 700; letter-spacing: -1.5px; text-decoration: none; }
#library { padding-top: 14px; padding-bottom: 48px; }
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 34px 24px; }
.game-card { min-width: 0; }
.game-cover { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border-radius: 9px; overflow: hidden; background: #1c1e23; box-shadow: 0 1px 8px #0003; transition: transform .16s ease, box-shadow .16s ease; }
.game-cover:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 8px 25px #0007; }
.game-cover:disabled { opacity: 1; }
.game-cover > img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(var(--cover-scale, 1)); }
.cover-play { position: absolute; inset: 0; display: grid; place-items: center; background: #0003; opacity: 0; transition: opacity .16s; }
.cover-play > .icon { width: 32px; height: 32px; padding: 13px; box-sizing: content-box; border: 1px solid #ffffff50; border-radius: 50%; background: #111a; backdrop-filter: blur(10px); }
.game-cover:hover .cover-play, .game-cover:focus-visible .cover-play { opacity: 1; }
.game-actions { display: flex; justify-content: center; gap: 2px; padding: 9px 0 3px; }
.game-actions .icon-button { width: 36px; height: 34px; color: #a8acb5; }
.game-actions .icon { width: 20px; height: 20px; }
.game-title { margin: 3px 0 0; font-size: 14px; font-weight: 500; text-align: center; color: #d6d8dc; }
.icon { width: 24px; height: 24px; display: block; fill: currentColor; flex-shrink: 0; }
.icon-button { width: 40px; height: 40px; padding: 8px; background: transparent; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.quiet { color: #777e89; }
.download-state { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 12px; background: #0b0d11d9; font-size: 13px; font-variant-numeric: tabular-nums; }
.download-progress { width: 54%; height: 3px; appearance: none; border: 0; border-radius: 2px; background: #ffffff20; overflow: hidden; }
.download-progress::-webkit-progress-bar { background: #ffffff20; }
.download-progress::-webkit-progress-value, .download-progress::-moz-progress-bar { background: var(--accent); }
.message { color: var(--accent); font-size: 13px; }
.message:empty { display: none; }
.message.error { color: #ffb9ac; }
#global-status { margin: 0 0 20px; }
.player { position: fixed; inset: 0; z-index: 10; background: #000; }
#game-frame, #game-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.game-bar { position: absolute; z-index: 2; top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); display: flex; align-items: center; padding: 4px; border-radius: 10px; background: #17191de6; border: 1px solid #ffffff17; box-shadow: 0 4px 22px #0004; backdrop-filter: blur(16px); }
.bar-actions { display: flex; align-items: center; gap: 2px; }
.game-bar.is-collapsed .bar-actions { display: none; }
.game-bar.is-collapsed { opacity: .65; }
.game-bar.is-collapsed:hover, .game-bar.is-collapsed:focus-within { opacity: 1; }
.dual-icon { display: flex; width: 28px; align-items: center; justify-content: center; }
.dual-icon .icon { width: 17px; height: 20px; }
.bar-divider { width: 1px; height: 22px; margin: 0 5px; background: #ffffff1a; }
.save-close { display: flex; align-items: center; gap: 9px; height: 40px; background: transparent; padding: 0 12px 0 8px; border-radius: 6px; font-size: 13px; white-space: nowrap; }
.save-close .icon { width: 22px; height: 22px; }
.player-status { position: absolute; z-index: 3; top: 70px; left: 12px; max-width: min(440px, calc(100% - 24px)); padding: 12px 16px; border-radius: 8px; background: #17191df0; }
dialog { width: min(420px, calc(100% - 32px)); max-height: min(85dvh, 720px); padding: 24px; border: 1px solid #ffffff1c; border-radius: 14px; background: var(--panel); color: var(--text); box-shadow: 0 24px 90px #0008; }
dialog::backdrop { background: #050608b8; backdrop-filter: blur(5px); }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.dialog-heading > .icon-button { margin: -7px -8px 0 0; }
dialog h2 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.35px; }
.dialog-subtitle { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.muted { color: var(--muted); font-size: 13px; }
.save-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0; }
.action-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 43px; border: 1px solid #ffffff16; border-radius: 7px; padding: 9px 12px; background: #ffffff06; font-size: 13px; font-weight: 500; text-decoration: none; cursor: pointer; }
.action-button .icon { width: 19px; height: 19px; }
.action-button.primary { background: var(--accent); color: #172116; border-color: transparent; }
.action-button.compact { min-height: 36px; padding: 6px 10px; font-size: 12px; }
.file-button { position: relative; overflow: hidden; }
.file-button input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
#restore-preview { border-top: 1px solid var(--line); padding-top: 8px; }
.setting-row { display: flex; min-height: 51px; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); font-size: 13px; }
.setting-row input { appearance: none; width: 34px; height: 20px; flex-shrink: 0; border-radius: 12px; background: #ffffff20; cursor: pointer; position: relative; transition: background .15s; }
.setting-row input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #c6cad1; transition: transform .15s; }
.setting-row input:checked { background: var(--accent); }
.setting-row input:checked::after { transform: translateX(14px); background: #202923; }
.setting-row input:disabled { opacity: .3; cursor: default; }
.cache-setting { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 22px; }
.control-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 44px; font-size: 13px; }
.keys { display: flex; gap: 5px; align-items: center; color: var(--muted); }
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 29px; padding: 0 8px; border: 1px solid #ffffff24; border-bottom: 3px solid #0d0f12; border-radius: 5px; background: linear-gradient(#383c43, #2a2e34); color: #e3e5e9; box-shadow: 0 1px 0 #ffffff08 inset; font: 12px ui-sans-serif, system-ui, sans-serif; }
kbd.wide { min-width: 68px; }
.bar-shortcut { margin-top: 13px; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); }
.text-link { font-size: 13px; color: #c6d5c1; text-underline-offset: 3px; }
.site-header, body > main:not(#library) { max-width: 780px; margin: auto; padding: 24px; }
.site-header { display: flex; justify-content: space-between; }
.site-header .brand { text-decoration: none; font-weight: 650; }
.header-note, .lead, .subtle { color: var(--muted); }
.intro h1 { font-size: 34px; letter-spacing: -1px; }
.eyebrow { color: var(--muted); font-size: 11px; letter-spacing: .12em; }
@media (max-width: 600px) {
  .library-header, #library { padding-inline: 22px; }
  .library-header { height: 80px; }
  #library { padding-top: 6px; }
  .games { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 16px; }
  .game-title { font-size: 13px; }
  .game-bar { top: 8px; left: 8px; padding: 3px; }
  .game-bar .icon-button { width: 35px; height: 38px; padding: 6px; }
  .save-close { gap: 6px; padding-inline: 6px; font-size: 12px; }
  .bar-divider { margin-inline: 2px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
