:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #070b18;
  color: #101828;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top left, rgba(67, 111, 255, .28), transparent 30%), radial-gradient(circle at top right, rgba(0, 214, 201, .18), transparent 28%), #070b18; }
a { color: #3b63ff; }
button, input { font: inherit; }
button, .button-link { border: 0; border-radius: 14px; background: linear-gradient(135deg, #4263ff, #06b6d4); color: white; padding: 12px 18px; cursor: pointer; box-shadow: 0 16px 36px rgba(40, 92, 255, .28); transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease; }
button:hover, .button-link:hover { transform: translateY(-1px); box-shadow: 0 20px 44px rgba(40, 92, 255, .34); }
button.secondary, .button-link.secondary { background: rgba(255, 255, 255, .88); color: #182033; box-shadow: 0 12px 28px rgba(15, 23, 42, .1); }
button:disabled { opacity: .55; cursor: not-allowed; }
.button-link { display: inline-flex; justify-content: center; align-items: center; text-decoration: none; }
input { width: 100%; border: 1px solid rgba(148, 163, 184, .28); border-radius: 14px; padding: 13px 14px; background: rgba(255, 255, 255, .9); color: #111827; outline: none; }
input:focus { border-color: rgba(66, 99, 255, .7); box-shadow: 0 0 0 4px rgba(66, 99, 255, .12); }
label { display: grid; gap: 8px; font-weight: 650; }

.card { background: rgba(255, 255, 255, .94); border: 1px solid rgba(255, 255, 255, .68); border-radius: 24px; padding: 28px; box-shadow: 0 24px 80px rgba(0, 0, 0, .22); }
.narrow { max-width: 500px; margin: 10vh auto; }
.muted { color: #667085; }
.message { min-height: 24px; color: #3157d5; }
form { display: grid; gap: 18px; }

.library-page { color: #e5eefc; }
.library-shell { max-width: 1360px; margin: 0 auto; padding: 34px; }
.library-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 28px; align-items: stretch; padding: 38px; border: 1px solid rgba(255,255,255,.16); border-radius: 34px; background: linear-gradient(135deg, rgba(18, 27, 58, .92), rgba(18, 44, 76, .76)); box-shadow: 0 30px 100px rgba(0,0,0,.32); }
.library-hero::after { content: ""; position: absolute; inset: auto -80px -160px auto; width: 420px; height: 420px; border-radius: 999px; background: radial-gradient(circle, rgba(6, 182, 212, .34), transparent 65%); pointer-events: none; }
.hero-copy, .hero-stats { position: relative; z-index: 1; }
.eyebrow { display: inline-flex; margin-bottom: 10px; color: #67e8f9; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.hero-copy h1 { margin: 0; font-size: clamp(42px, 7vw, 76px); line-height: .95; letter-spacing: -.06em; }
.hero-copy p { max-width: 680px; margin: 18px 0 0; color: #b9c7dc; font-size: 17px; }
.hero-actions { display: flex; gap: 12px; margin-top: 26px; }
.hero-stats { display: grid; grid-template-columns: 1fr; gap: 14px; }
.hero-stats div { display: grid; gap: 6px; padding: 22px; border: 1px solid rgba(255,255,255,.14); border-radius: 24px; background: rgba(255,255,255,.08); backdrop-filter: blur(18px); }
.hero-stats strong { font-size: 34px; letter-spacing: -.04em; }
.hero-stats span { color: #a8b5ca; }

.card-glass { border: 1px solid rgba(255,255,255,.16); border-radius: 26px; background: rgba(255,255,255,.1); backdrop-filter: blur(20px); box-shadow: 0 24px 80px rgba(0,0,0,.22); }
.library-toolbar { position: sticky; top: 16px; z-index: 5; display: grid; grid-template-columns: minmax(260px, 1fr) auto auto auto; gap: 12px; align-items: center; margin: 22px 0; padding: 14px; }
.search-wrap { display: flex; align-items: center; gap: 10px; border-radius: 18px; padding: 0 14px; background: rgba(255,255,255,.92); color: #475467; }
.search-wrap span { font-size: 22px; color: #4263ff; }
.search-wrap input { border: 0; box-shadow: none; background: transparent; padding-left: 0; }
.status-pill { display: inline-flex; max-width: 100%; margin: 0 0 22px; padding: 10px 14px; border: 1px solid rgba(103, 232, 249, .22); border-radius: 999px; background: rgba(8, 20, 42, .72); color: #c7d2fe; }

.library-content { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; }
.games-panel { min-width: 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.section-heading h2 { margin: 0; color: #f8fbff; font-size: 26px; letter-spacing: -.03em; }
.section-heading.compact { margin-bottom: 12px; }
.hint { color: #9fb1ca; font-size: 14px; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.game-card { position: relative; overflow: hidden; min-height: 210px; display: grid; align-content: space-between; gap: 18px; padding: 18px; border: 1px solid rgba(255,255,255,.12); border-radius: 26px; background: linear-gradient(145deg, rgba(255,255,255,.13), rgba(255,255,255,.06)); box-shadow: 0 20px 60px rgba(0,0,0,.18); transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.game-card::before { content: ""; position: absolute; inset: -70px -70px auto auto; width: 170px; height: 170px; border-radius: 999px; background: radial-gradient(circle, rgba(66, 99, 255, .32), transparent 65%); }
.game-card:hover { transform: translateY(-4px); border-color: rgba(103, 232, 249, .42); background: linear-gradient(145deg, rgba(255,255,255,.18), rgba(255,255,255,.08)); }
.game-card.selected { border-color: rgba(34, 211, 238, .8); box-shadow: 0 22px 70px rgba(6, 182, 212, .18); }
.select-line { position: relative; z-index: 1; display: inline-flex; grid-template-columns: auto auto; align-items: center; justify-content: start; width: fit-content; gap: 8px; padding: 8px 10px; border-radius: 999px; background: rgba(255,255,255,.1); color: #dbeafe; font-size: 13px; }
.select-line input { width: 16px; height: 16px; accent-color: #22d3ee; }
.cover-mark { position: relative; z-index: 1; display: inline-flex; width: 58px; height: 58px; align-items: center; justify-content: center; border-radius: 18px; background: linear-gradient(135deg, rgba(103, 232, 249, .9), rgba(99, 102, 241, .95)); color: white; font-weight: 900; letter-spacing: -.05em; }
.game-card h3 { position: relative; z-index: 1; margin: 0; color: #fff; font-size: 18px; line-height: 1.35; }
.meta-row { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.meta-row span { padding: 6px 9px; border-radius: 999px; background: rgba(15, 23, 42, .44); color: #cbd5e1; font-size: 12px; }
.empty-state { grid-column: 1 / -1; padding: 40px; border: 1px dashed rgba(255,255,255,.22); border-radius: 24px; color: #b9c7dc; text-align: center; }

.download-panel { position: sticky; top: 112px; padding: 18px; }
.download-panel textarea { width: 100%; min-height: 520px; resize: vertical; border: 1px solid rgba(255,255,255,.16); border-radius: 20px; padding: 16px; background: rgba(2, 6, 23, .72); color: #e2e8f0; font: 13px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; outline: none; }

@media (max-width: 1020px) {
  .library-hero, .library-content { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); }
  .download-panel { position: static; }
}

@media (max-width: 720px) {
  .narrow { margin: 5vh 14px; }
  .library-shell { padding: 16px; }
  .library-hero { padding: 24px; border-radius: 26px; }
  .hero-stats { grid-template-columns: 1fr; }
  .library-toolbar { position: static; grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .section-heading { align-items: start; flex-direction: column; }
}
