:root {
  --bg: #050814;
  --panel: rgba(20, 26, 46, .72);
  --panel-solid: #121a30;
  --line: rgba(255, 255, 255, .1);
  --line-2: rgba(255, 255, 255, .18);
  --text: #f4f6fb;
  --muted: #aab3cc;
  --dim: #6f7896;
  --ps: #0070d1;
  --ps-light: #2d8cff;
  --focus: 0 0 0 3px #fff, 0 0 26px rgba(255, 255, 255, .45), 0 18px 40px rgba(0, 0, 0, .55);
  --font: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; user-select: none; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 0; height: 0; }

.stage { position: relative; height: 100vh; overflow: hidden; }
.stage.enter { animation: stageIn .45s var(--ease) both; }
@keyframes stageIn { from { opacity: 0; transform: scale(1.03); } }

/* ---------- background ---------- */
.bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.bg-layer {
  position: absolute; inset: 0; background-size: cover; background-position: center 20%;
  opacity: 0; transition: opacity .8s ease, transform 12s ease-out, filter .6s;
  transform: scale(1.06);
}
.bg-layer.show { opacity: 1; transform: scale(1); }
.bg-layer.soft { filter: blur(40px) saturate(1.4) brightness(.7); transform: scale(1.2); }
.bg-layer.show.soft { transform: scale(1.15); }
#trailer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s ease; }
#trailer.show { opacity: 1; }
.bg-shade {
  position: absolute; inset: 0; transition: background .6s;
  background:
    linear-gradient(180deg, rgba(5,8,20,.75) 0%, rgba(5,8,20,0) 30%),
    linear-gradient(0deg, rgba(5,8,20,.92) 0%, rgba(5,8,20,.35) 38%, rgba(5,8,20,0) 60%),
    linear-gradient(270deg, rgba(5,8,20,.7) 0%, rgba(5,8,20,0) 55%);
}
.stage.deep .bg-shade { background: rgba(5, 8, 20, .82); }
.stage.deep .bg-layer, .stage.deep #trailer { filter: blur(18px) brightness(.8); }
.stage.deep .game-info { opacity: .35; transition: opacity .4s; }
.stage.lib .bg-shade { background: rgba(5, 8, 20, .9); }
.stage.lib .bg-layer, .stage.lib #trailer { filter: blur(30px); }

/* ---------- top bar ---------- */
.topbar {
  position: relative; z-index: 5; height: 64px;
  display: flex; align-items: center; padding-inline-start: 40px;
  -webkit-app-region: drag;
}
.tabs { display: flex; gap: 30px; -webkit-app-region: no-drag; }
.tab { position: relative; font-size: 19px; font-weight: 700; color: rgba(255,255,255,.55); padding: 6px 0; transition: color .2s; }
.tab:hover { color: rgba(255,255,255,.85); }
.tab.active { color: #fff; }
.tab.active::after { content: ""; position: absolute; inset-inline: 0; bottom: -2px; height: 3px; border-radius: 3px; background: #fff; box-shadow: 0 0 12px rgba(255,255,255,.7); }
.drag { flex: 1; }
.top-icons { display: flex; align-items: center; gap: 6px; -webkit-app-region: no-drag; margin-inline-end: 14px; }
.top-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: rgba(255,255,255,.8); transition: .2s; }
.top-btn:hover, .top-btn.kf { background: rgba(255,255,255,.14); color: #fff; }
.pad-status { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #7cc4ff; animation: padIn .5s var(--ease); }
.pad-status svg { width: 24px; height: 24px; filter: drop-shadow(0 0 8px rgba(45,140,255,.8)); }
@keyframes padIn { from { transform: scale(0); } }
.clock { font-size: 17px; font-weight: 600; min-width: 64px; text-align: center; color: #fff; direction: ltr; }
.win-controls { display: flex; height: 100%; -webkit-app-region: no-drag; }
.win-controls button { width: 50px; height: 100%; display: grid; place-items: center; color: rgba(255,255,255,.6); transition: .15s; }
.win-controls svg { width: 12px; height: 12px; stroke-width: 1.4; }
.win-controls button:hover { background: rgba(255,255,255,.08); color: #fff; }
.win-controls .close:hover { background: #e81123; }

/* ---------- views ---------- */
.view { position: absolute; inset: 64px 0 0; z-index: 2; overflow-y: auto; scroll-behavior: smooth; }
.view.fade-in { animation: viewIn .4s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(12px); } }

/* ---------- tile row ---------- */
.screen { position: relative; height: calc(100vh - 64px); }
/* sizes must match TILE in launcher.js */
.tiles-wrap { position: relative; padding-top: 14px; height: calc(var(--tile-focus, 230px) * 1.5 + 66px); overflow: hidden; }
.tiles { display: flex; align-items: flex-start; gap: 18px; transition: transform .38s var(--ease); will-change: transform; }
.tile-item { flex: none; width: var(--tile, 180px); cursor: pointer; transition: width .3s var(--ease); }
.tile-item.focus { width: var(--tile-focus, 230px); }
.tile {
  position: relative; width: 100%; aspect-ratio: 2/3; border-radius: 18px;
  background-size: cover; background-position: center;
  box-shadow: 0 10px 24px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.08);
  transition: box-shadow .3s, opacity .3s, transform .3s;
  opacity: .78; overflow: hidden;
  display: grid; place-items: center;
}
.tile-item:hover .tile { opacity: 1; }
.tile-item.focus .tile { opacity: 1; box-shadow: var(--focus); }
.zone-actions .tile-item.focus .tile, .zone-details .tile-item.focus .tile { box-shadow: 0 0 0 2px rgba(255,255,255,.6), 0 18px 40px rgba(0,0,0,.55); }
.tile img.ic { width: 64px; height: 64px; filter: drop-shadow(0 6px 14px rgba(0,0,0,.5)); }
.tile .ph-letter { font-size: 54px; font-weight: 900; }
.tile.special { background: rgba(255,255,255,.1); backdrop-filter: blur(20px); border: 1px solid var(--line-2); }
.tile.special svg { width: 48px; height: 48px; stroke-width: 1.6; }
.tile .cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.tile .live { position: absolute; top: 10px; inset-inline-start: 10px; width: 12px; height: 12px; border-radius: 50%; background: #2ee59d; box-shadow: 0 0 10px #2ee59d; z-index: 2; }
.tile-name {
  margin-top: 12px; text-align: center; font-size: 14px; font-weight: 600; color: rgba(255,255,255,.7); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 2px 10px rgba(0,0,0,.7); transition: color .3s, font-size .3s;
}
.tile-item.focus .tile-name { font-size: 17px; font-weight: 800; color: #fff; }

/* ---------- game info (first screen) ---------- */
.game-info { position: absolute; inset-inline-start: 56px; bottom: 74px; width: min(680px, 60vw); }
.game-info > * { animation: infoIn .5s var(--ease) both; }
.game-info > :nth-child(2) { animation-delay: .05s; }
.game-info > :nth-child(3) { animation-delay: .1s; }
.game-info > :nth-child(4) { animation-delay: .15s; }
@keyframes infoIn { from { opacity: 0; transform: translateY(16px); } }
.g-logo { display: block; max-width: 520px; max-height: 170px; object-fit: contain; object-position: right bottom; margin-bottom: 18px; filter: drop-shadow(0 6px 24px rgba(0,0,0,.6)); }
.g-title { font-size: 54px; font-weight: 900; line-height: 1.1; margin-bottom: 14px; text-shadow: 0 4px 30px rgba(0,0,0,.6); letter-spacing: -.01em; }
.g-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: #dfe4f2; font-size: 15px; font-weight: 600; margin-bottom: 26px; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.g-meta .sep { width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,.5); }
.mc { padding: 1px 9px; border-radius: 6px; font-weight: 800; font-size: 14px; color: #fff; text-shadow: none; }
.mc.good { background: #2ea84d; } .mc.mid { background: #e0a800; color: #222; } .mc.bad { background: #d53b3b; }
.g-actions { display: flex; align-items: center; gap: 14px; }
.btn-play {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-width: 230px; height: 60px; padding: 0 34px; border-radius: 32px;
  background: #fff; color: #0b1020; font-size: 20px; font-weight: 800;
  box-shadow: 0 12px 34px rgba(0,0,0,.4);
  transition: transform .2s var(--ease), box-shadow .2s;
}
.btn-play svg { width: 22px; height: 22px; fill: #0b1020; stroke: none; }
.btn-play:hover { transform: scale(1.03); }
.btn-play.running { background: #2ee59d; }
.btn-round {
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.14); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,.2);
  transition: .2s var(--ease);
}
.btn-round svg { width: 24px; height: 24px; }
.btn-round:hover { background: rgba(255,255,255,.24); }
.btn-round.fav-on { color: #ff4f8b; }
.btn-round.fav-on svg { fill: #ff4f8b; }
.kf { box-shadow: var(--focus) !important; transform: scale(1.06); }
.btn-play.kf { transform: scale(1.06); }
.g-sub { display: flex; gap: 22px; margin-top: 22px; color: var(--muted); font-size: 14px; font-weight: 600; }
.g-sub span { display: inline-flex; align-items: center; gap: 7px; }
.g-sub svg { width: 16px; height: 16px; }
.scroll-hint { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.5); animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translate(-50%, 6px); } }

/* ---------- details (below the fold) ---------- */
.details { padding: 10px 56px 120px; }
.d-title { font-size: 22px; font-weight: 800; margin: 26px 0 16px; }
.d-row { display: flex; align-items: flex-start; gap: 18px; overflow-x: auto; padding: 10px 6px 20px; margin: -10px -6px 0; scroll-behavior: smooth; }
.card {
  flex: none; height: 260px; border-radius: 18px; overflow: hidden; scroll-margin: 90px 0 90px;
  background: var(--panel); backdrop-filter: blur(24px); border: 1px solid var(--line);
  transition: transform .25s var(--ease), box-shadow .25s; cursor: pointer;
}
.card:hover { transform: translateY(-3px); }
.card.kf { transform: scale(1.03); }
.card-overview { width: 460px; padding: 24px 26px; cursor: default; }
.card-overview h4, .card-info h4 { font-size: 17px; font-weight: 800; margin-bottom: 10px; }
.card-overview p { color: #cfd5e6; line-height: 1.85; font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tag { padding: 4px 12px; border-radius: 20px; background: rgba(255,255,255,.1); font-size: 13px; font-weight: 600; }
.card-shot { width: 462px; background-size: cover; background-position: center; }
.card-trailer { position: relative; }
.card-trailer::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%;
  background: rgba(0,0,0,.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5.5v13a1 1 0 0 0 1.5.86l11-6.5a1 1 0 0 0 0-1.72l-11-6.5A1 1 0 0 0 8 5.5Z'/%3E%3C/svg%3E") center / 28px no-repeat;
  backdrop-filter: blur(6px); border: 2px solid rgba(255,255,255,.6);
}
.card-info { width: 380px; padding: 22px 24px; cursor: default; }
.info-row { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.info-row:last-child { border-bottom: 0; }
.info-row span { color: var(--muted); }
.info-row b { font-weight: 700; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.info-row b.ltr { direction: ltr; }

/* ---------- library ---------- */
.library { padding: 18px 56px 110px; }
.lib-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; flex-wrap: wrap; }
.lib-head h1 { font-size: 30px; font-weight: 900; }
.lib-head h1 small { font-size: 16px; color: var(--muted); font-weight: 600; margin-inline-start: 8px; }
.lib-tools { display: flex; align-items: center; gap: 10px; }
.search { position: relative; width: 280px; }
.search svg { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--dim); width: 18px; height: 18px; }
.search input { width: 100%; height: 44px; border-radius: 24px; padding-inline: 42px 16px; background: rgba(255,255,255,.08); border: 1px solid var(--line-2); outline: none; transition: .2s; }
.search input::placeholder { color: var(--dim); }
.search input:focus { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.5); }
.pill { height: 44px; padding: 0 20px; border-radius: 24px; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; background: rgba(255,255,255,.1); border: 1px solid var(--line-2); transition: .2s; white-space: nowrap; }
.pill svg { width: 18px; height: 18px; }
.pill:hover { background: rgba(255,255,255,.18); }
.pill.primary { background: #fff; color: #0b1020; border-color: #fff; }
.pill.primary:hover { background: #e6ecff; }
.pill.danger { background: #e5354f; border-color: #e5354f; color: #fff; }
.pill.spinning svg { animation: spin 1s linear infinite; }
.pill:disabled { opacity: .4; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.pill-select { height: 44px; padding: 0 18px; border-radius: 24px; background: rgba(255,255,255,.1); border: 1px solid var(--line-2); outline: none; cursor: pointer; }
.pill-select option { background: var(--panel-solid); }
.chips { display: flex; gap: 10px; margin-bottom: 26px; flex-wrap: wrap; }
.chip { height: 38px; padding: 0 18px; border-radius: 20px; font-weight: 700; font-size: 14px; color: var(--muted); background: rgba(255,255,255,.06); border: 1px solid var(--line); transition: .2s; display: inline-flex; align-items: center; gap: 8px; }
.chip:hover { color: #fff; }
.chip.active { background: #fff; color: #0b1020; border-color: #fff; }
.chip i { font-style: normal; opacity: .6; font-size: 12.5px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile, 180px), 1fr)); gap: 26px 20px; }
.lib-item { cursor: pointer; animation: itemIn .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 22ms); }
@keyframes itemIn { from { opacity: 0; transform: translateY(14px); } }
.lib-art { position: relative; aspect-ratio: 2/3; border-radius: 16px; background-size: cover; background-position: center; box-shadow: 0 10px 26px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.08); transition: transform .25s var(--ease), box-shadow .25s; display: grid; place-items: center; overflow: hidden; }
.lib-art img.ic { width: 54px; height: 54px; }
.lib-art .cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lib-art .badge, .lib-art .heart { z-index: 2; }
.lib-art .ph-letter { font-size: 46px; font-weight: 900; }
.lib-item:hover .lib-art { transform: translateY(-4px); }
.lib-item.kf .lib-art { box-shadow: var(--focus); transform: scale(1.05); }
.lib-item.kf { box-shadow: none !important; transform: none; }
.lib-name { margin-top: 10px; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-sub { color: var(--dim); font-size: 12px; font-weight: 600; }
.badge { position: absolute; top: 8px; inset-inline-end: 8px; padding: 1px 8px; border-radius: 7px; font-size: 10.5px; font-weight: 800; background: rgba(0,0,0,.6); backdrop-filter: blur(8px); direction: ltr; }
.heart { position: absolute; bottom: 8px; inset-inline-end: 8px; width: 24px; height: 24px; }
.heart svg { width: 18px; height: 18px; fill: #ff4f8b; stroke: #ff4f8b; filter: drop-shadow(0 2px 6px rgba(0,0,0,.6)); }
.empty { text-align: center; padding: 70px 20px; }
.empty h3 { font-size: 24px; font-weight: 800; margin-bottom: 10px; }
.empty p { color: var(--muted); max-width: 480px; margin: 0 auto 24px; line-height: 1.9; }
.empty-actions { display: flex; justify-content: center; gap: 12px; }

/* ---------- controller hints ---------- */
.hints {
  position: absolute; z-index: 6; bottom: 18px; inset-inline-end: 40px;
  display: flex; gap: 22px; padding: 8px 18px; border-radius: 24px;
  background: rgba(5, 8, 20, .55); backdrop-filter: blur(20px); border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 600; color: #dfe4f2;
}
.hint { display: inline-flex; align-items: center; gap: 8px; }
.hint[data-act] { cursor: pointer; border-radius: 10px; padding: 4px 8px; margin: -4px -8px; transition: background .2s; }
.hint[data-act]:hover { background: rgba(255,255,255,.08); }
.glyph { min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; display: inline-grid; place-items: center; font-size: 13px; font-weight: 900; direction: ltr; background: rgba(255,255,255,.14); }
.glyph.ps { font-family: 'Segoe UI Symbol', 'Segoe UI', sans-serif; background: rgba(255,255,255,.12); width: 24px; padding: 0; font-size: 14px; }
.g-cross { color: #8ab4ff; } .g-circle { color: #ff6b6b; } .g-square { color: #ff7ff8; } .g-triangle { color: #3fe0a5; }
.g-a { background: #2fa84f; color: #fff; } .g-b { background: #d7373f; color: #fff; } .g-x { background: #2a6fdb; color: #fff; } .g-y { background: #e3b11c; color: #222; }
.glyph.kb { border-radius: 6px; font-size: 11.5px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); }

/* ---------- news panel ---------- */
.news {
  position: fixed; z-index: 45; top: 64px; bottom: 0; inset-inline-end: 0; width: min(420px, 92vw);
  background: rgba(10, 14, 28, .94); backdrop-filter: blur(30px); border-inline-start: 1px solid var(--line-2);
  box-shadow: 30px 0 60px rgba(0,0,0,.5); display: flex; flex-direction: column; animation: newsIn .35s var(--ease) both;
}
@keyframes newsIn { from { transform: translateX(-40px); opacity: 0; } }
.news-head { display: flex; align-items: center; gap: 6px; padding: 18px 20px 10px; }
.news-head h3 { flex: 1; font-size: 20px; font-weight: 900; }
.news-body { flex: 1; overflow-y: auto; padding: 0 20px 30px; }
.news-body h4 { font-size: 15px; font-weight: 800; margin: 18px 0 10px; color: #fff; }
.news-body h4 small { color: var(--dim); font-weight: 600; font-size: 12px; margin-inline-start: 6px; }
.news-card { display: block; border-radius: 14px; overflow: hidden; margin-bottom: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line); cursor: pointer; transition: .2s var(--ease); }
.news-card:hover, .news-card.kf { transform: translateX(-4px); border-color: rgba(255,255,255,.4); }
.news-img { position: relative; aspect-ratio: 460 / 215; background-size: cover; background-position: center; }
.news-img .badge { top: 8px; inset-inline-end: 8px; background: #2ee59d; color: #032; }
.news-info { padding: 10px 12px 12px; }
.news-info b { display: block; font-size: 15px; font-weight: 800; }
.news-info small { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.news-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.news-tags .tag { font-size: 11.5px; padding: 2px 9px; }
.news-tags .mc { font-size: 12px; }
.news-empty, .news-foot { color: var(--dim); font-size: 13px; margin: 8px 0; }
.news-loading { color: var(--muted); padding: 30px 0; text-align: center; display: grid; gap: 14px; }
/* in-app news detail */
.news-detail { animation: fade .2s both; }
.nd-hero { aspect-ratio: 16/9; border-radius: 12px; background-size: cover; background-position: center; border: 1px solid var(--line); margin-bottom: 14px; }
.nd-title { font-size: 20px; font-weight: 900; margin-bottom: 10px; }
.nd-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.nd-meta .owned { color: #2ee59d; }
.nd-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.nd-desc { color: #cfd5e6; line-height: 1.9; font-size: 14.5px; margin-bottom: 20px; }
.nd-actions { display: flex; flex-direction: column; gap: 10px; }
.nd-btn { height: 46px; border-radius: 12px; font-weight: 800; background: rgba(255,255,255,.08); border: 1px solid var(--line-2); color: #fff; cursor: pointer; }
.nd-btn.primary { background: linear-gradient(135deg, var(--ps-light), var(--ps)); border: 0; }
.nd-btn:hover { filter: brightness(1.12); }
.nd-btn.kf { box-shadow: 0 0 0 3px #fff; }

.lic-box { border: 1px solid var(--line-2); border-radius: 14px; padding: 16px; margin-bottom: 14px; background: rgba(45,140,255,.06); }
.lic-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lic-head b.on { color: #2ee59d; } .lic-head b.off { color: #ff5d7a; }
.lic-head span { color: var(--muted); font-size: 13.5px; }
.lic-fp { margin-top: 8px; color: var(--dim); font-size: 12.5px; }
.lic-fp code { color: #9fb3d6; direction: ltr; font-family: monospace; }
.pad-wake-status { font-size: 12.5px; color: var(--muted); padding: 0 6px 12px; line-height: 1.8; }
.pad-wake-status b { color: #fff; }

/* add a custom platform */
.add-plat { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.add-plat input { flex: 1; min-width: 140px; height: 40px; padding: 0 14px; border-radius: 12px; background: rgba(0,0,0,.3); border: 1px solid var(--line-2); outline: none; user-select: text; }
.add-plat input.ltr { direction: ltr; text-align: left; }
.add-plat input:focus { border-color: #fff; }
.add-plat .pill { height: 40px; font-size: 13.5px; }
.plat .src-badge { font-size: 10.5px; margin-inline-start: 6px; vertical-align: middle; }

/* ---------- showcase (idle) mode ---------- */
.topbar, .tiles-wrap, .game-info, .hints, .details { transition: opacity 1.1s ease; }
.stage.idle .topbar, .stage.idle .tiles-wrap, .stage.idle .game-info, .stage.idle .hints, .stage.idle .details { opacity: 0; pointer-events: none; }
.stage.idle .bg-shade { background: linear-gradient(0deg, rgba(5,8,20,.6) 0%, rgba(5,8,20,0) 28%); }
.stage.idle .bg-layer.show { transform: scale(1.12); transition: opacity .8s ease, transform 30s linear; }
body.idle { cursor: none; }
.idle-badge {
  position: fixed; z-index: 7; bottom: 40px; inset-inline-start: 56px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  animation: fade 1.6s .6s both; pointer-events: none;
}
.idle-badge img { max-width: 340px; max-height: 120px; object-fit: contain; filter: drop-shadow(0 6px 24px rgba(0,0,0,.7)); opacity: .92; }
.idle-badge b { font-size: 34px; font-weight: 900; text-shadow: 0 4px 24px rgba(0,0,0,.7); }
.idle-badge small { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: rgba(255,255,255,.7); padding: 6px 14px; border-radius: 20px; background: rgba(0,0,0,.35); backdrop-filter: blur(10px); }

/* ---------- control center ---------- */
.cc {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 55; padding: 90px 30px 30px;
  background: linear-gradient(0deg, rgba(5,8,20,.98) 62%, rgba(5,8,20,0));
  animation: ccIn .32s var(--ease) both;
}
@keyframes ccIn { from { transform: translateY(40px); opacity: 0; } }
.cc-stats { display: flex; justify-content: center; gap: 28px; margin-bottom: 18px; color: var(--muted); font-weight: 600; font-size: 14px; }
.cc-stats span { display: inline-flex; align-items: center; gap: 8px; }
.cc-stats b { color: #fff; font-weight: 800; direction: ltr; }
.cc-stats .meter { width: 70px; height: 5px; border-radius: 4px; background: rgba(255,255,255,.12); overflow: hidden; }
.cc-stats .meter i { display: block; height: 100%; background: var(--ps-light); border-radius: 4px; transition: width .6s; }
.cc-row { display: flex; justify-content: safe center; gap: 8px; overflow-x: auto; padding: 8px 4px 4px; scroll-behavior: smooth; }
.cc-item { flex: none; }
.cc-item {
  width: 104px; height: 122px; border-radius: 20px; padding: 14px 12px 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 6px;
  background: rgba(255,255,255,.08); border: 1px solid var(--line); transition: .2s var(--ease); cursor: pointer;
}
.cc-item svg { width: 28px; height: 28px; stroke-width: 1.8; }
.cc-item b { font-size: 13.5px; font-weight: 700; text-align: center; line-height: 1.3; }
.cc-item small { font-size: 12.5px; color: var(--muted); font-weight: 700; direction: ltr; }
.cc-item.on small { color: #6cd3ff; }
.cc-item:hover { background: rgba(255,255,255,.14); }
.cc-item.kf { background: #fff; color: #0b1020; transform: translateY(-6px) scale(1.04); box-shadow: 0 16px 40px rgba(0,0,0,.5) !important; }
.cc-item.kf small { color: #39425e; }
.cc-adj { display: flex; gap: 6px; }
.cc-adj button { width: 26px; height: 22px; border-radius: 8px; background: rgba(127,127,127,.25); font-weight: 900; line-height: 1; }

/* ---------- volume / zoom OSD ---------- */
.osd {
  position: fixed; top: 78px; left: 50%; transform: translateX(-50%); z-index: 95;
  display: flex; align-items: center; gap: 14px; padding: 12px 22px; border-radius: 30px;
  background: rgba(18,24,44,.94); backdrop-filter: blur(24px); border: 1px solid var(--line-2);
  box-shadow: 0 16px 40px rgba(0,0,0,.5); animation: toastIn .25s var(--ease) both;
}
.osd svg { width: 22px; height: 22px; }
.osd-bar { width: 200px; height: 6px; border-radius: 6px; background: rgba(255,255,255,.15); overflow: hidden; }
.osd-bar i { display: block; height: 100%; background: #fff; border-radius: 6px; transition: width .15s; }
.osd b { min-width: 46px; text-align: center; direction: ltr; font-weight: 800; }

/* ---------- platforms ---------- */
.plat-list { display: flex; flex-direction: column; gap: 10px; max-height: 56vh; overflow-y: auto; margin: 0 -6px; padding: 4px 6px; }
.plat { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.plat.missing { opacity: .45; }
.plat-logo { width: 46px; height: 46px; border-radius: 12px; flex: none; display: grid; place-items: center; font-weight: 900; font-size: 15px; color: #fff; direction: ltr; }
.plat-body { flex: 1; min-width: 0; }
.plat-body b { display: block; font-size: 15.5px; }
.plat-state { font-size: 12.5px; color: var(--dim); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.plat-state i { width: 8px; height: 8px; border-radius: 50%; background: #59607a; }
.plat-state.run i { background: #2ee59d; box-shadow: 0 0 8px #2ee59d; }
.plat-opts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; }
.plat-opts label { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); font-weight: 600; cursor: pointer; }
.plat-opts input { accent-color: var(--ps-light); width: 15px; height: 15px; }
.plat .pill { height: 38px; padding: 0 16px; font-size: 13.5px; }
.note { font-size: 13px; color: var(--muted); line-height: 1.8; background: rgba(45,140,255,.08); border: 1px solid rgba(45,140,255,.25); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; }
.muted { color: var(--dim); font-size: 13px; }
/* hidden or minimized: freeze every animation so the window costs nothing until it's back */
body.asleep *, body.asleep *::before, body.asleep *::after { animation-play-state: paused !important; }
/* platform sign-ins in the backup window */
.acc-box { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(46,229,157,.06); border: 1px solid rgba(46,229,157,.22); display: flex; flex-direction: column; gap: 8px; }
.acc-head b { display: block; font-weight: 800; }
.acc-head small, .acc-box > small { color: var(--dim); font-size: 12.5px; line-height: 1.7; }
.acc-box .warn { color: #ff8a9b; }
.acc-box .acc-wait { color: #ffd27a; }
.acc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.acc-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; background: rgba(255,255,255,.08); border: 1px solid var(--line-2); }
.acc-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #2ee59d; box-shadow: 0 0 8px #2ee59d; }
.acc-chip.wait::before { background: #ffd27a; box-shadow: 0 0 8px #ffd27a; }
.acc-chip i { font-style: normal; font-weight: 500; color: var(--dim); font-size: 11.5px; }
.field select { width: 100%; height: 46px; padding: 0 14px; border-radius: 14px; background: rgba(0,0,0,.3); border: 1px solid var(--line-2); outline: none; }
.field select option { background: var(--panel-solid); }

/* ---------- context menu ---------- */
.ctx {
  position: fixed; z-index: 50; min-width: 250px; padding: 8px;
  border-radius: 18px; background: rgba(18, 24, 44, .92); backdrop-filter: blur(30px);
  border: 1px solid var(--line-2); box-shadow: 0 30px 60px rgba(0,0,0,.6);
  animation: pop .16s ease-out both;
}
@keyframes pop { from { opacity: 0; transform: scale(.95); } }
.ctx button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; font-weight: 600; text-align: start; }
.ctx button svg { width: 18px; height: 18px; color: var(--muted); }
.ctx button:hover, .ctx button.kf { background: #fff; color: #0b1020; box-shadow: none !important; transform: none; }
.ctx button:hover svg, .ctx button.kf svg { color: #0b1020; }
.ctx hr { border: 0; height: 1px; background: var(--line); margin: 6px 8px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(2, 4, 12, .7); backdrop-filter: blur(10px); animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.modal-card { width: min(500px, 92vw); max-height: 94vh; overflow-y: auto; padding: 28px; border-radius: 24px; background: linear-gradient(180deg, #18213d, #10162b); border: 1px solid var(--line-2); box-shadow: 0 40px 90px rgba(0,0,0,.65); animation: modalIn .3s var(--ease) both; }
.modal-card.wide { width: min(660px, 94vw); }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.modal-card h3 { font-size: 21px; font-weight: 800; margin-bottom: 18px; }
.modal-card p { color: var(--muted); line-height: 1.8; margin-bottom: 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; color: var(--muted); font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.field input { width: 100%; height: 46px; padding: 0 16px; border-radius: 14px; background: rgba(0,0,0,.3); border: 1px solid var(--line-2); outline: none; user-select: text; }
.field input:focus { border-color: #fff; }
.field input.ltr { direction: ltr; text-align: left; font-family: Consolas, monospace; font-size: 13px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.modal .kf { box-shadow: 0 0 0 3px #fff !important; transform: none; }
.toggle-row { display: flex; align-items: center; gap: 14px; padding: 14px 6px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 12px; }
.toggle-row:last-of-type { border-bottom: 0; }
.toggle-row div { flex: 1; }
.toggle-row b { display: block; font-weight: 700; }
.toggle-row small { color: var(--dim); }
.switch { position: relative; width: 50px; height: 28px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 20px; background: rgba(255,255,255,.15); transition: .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + span { background: var(--ps-light); }
.switch input:checked + span::after { right: 25px; }

/* scan + review */
.scan-head { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.scan-head h3 { margin-bottom: 2px; }
.scan-phase { color: var(--muted); margin: 0 !important; }
.radar { position: relative; width: 58px; height: 58px; flex: none; border-radius: 50%; background: radial-gradient(circle, rgba(45,140,255,.3), transparent 70%); }
.radar span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--ps-light); animation: ping 1.8s ease-out infinite; opacity: 0; }
.radar span:nth-child(2) { animation-delay: .6s; }
.radar span:nth-child(3) { animation-delay: 1.2s; }
@keyframes ping { 0% { transform: scale(.3); opacity: 1; } 100% { transform: scale(1.2); opacity: 0; } }
.scan-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.scan-stats div { padding: 14px; border-radius: 16px; background: rgba(0,0,0,.25); border: 1px solid var(--line); text-align: center; }
.scan-stats b { display: block; font-size: 28px; font-weight: 900; }
.scan-stats small { color: var(--dim); }
.scan-path { direction: ltr; text-align: left; font-family: Consolas, monospace; font-size: 11.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 14px; }
.bar { height: 4px; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; }
.bar span { display: block; height: 100%; width: 40%; border-radius: 4px; background: var(--ps-light); box-shadow: 0 0 14px var(--ps-light); animation: barMove 1.1s ease-in-out infinite; }
@keyframes barMove { from { transform: translateX(160%); } to { transform: translateX(-260%); } }
.review-tools { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 10px; color: var(--muted); font-weight: 700; }
.review-list { max-height: 48vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin: 0 -6px; padding: 4px 6px; }
.review-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; cursor: pointer; background: rgba(255,255,255,.04); border: 1px solid var(--line); transition: .15s; }
.review-item:hover { background: rgba(255,255,255,.09); }
.review-item.dup { opacity: .65; }
button.review-item { width: 100%; text-align: start; font: inherit; color: inherit; }
.review-item.current { border-color: rgba(45,140,255,.6); background: rgba(45,140,255,.1); }
.review-icon svg { width: 22px; height: 22px; color: #fff; }
.review-icon { width: 42px; height: 42px; border-radius: 10px; flex: none; display: grid; place-items: center; font-weight: 900; font-size: 18px; }
.review-icon img { width: 30px; height: 30px; }
.review-text { flex: 1; min-width: 0; }
.review-text b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.review-text small { display: block; direction: ltr; text-align: right; color: var(--dim); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-badge { padding: 2px 9px; border-radius: 8px; font-size: 11px; font-weight: 800; background: rgba(255,255,255,.1); direction: ltr; }
.dup-badge { padding: 2px 9px; border-radius: 8px; font-size: 11px; font-weight: 700; background: rgba(224,168,0,.18); color: #ffd25e; white-space: nowrap; }
.check { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check i { width: 22px; height: 22px; flex: none; border-radius: 7px; border: 2px solid var(--line-2); position: relative; transition: .15s; }
.check input:checked + i { background: var(--ps-light); border-color: var(--ps-light); }
.check input:checked + i::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(0,0,0,.92); animation: fade .2s both; cursor: zoom-out; }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.8); animation: modalIn .3s var(--ease) both; }
.light-count { position: absolute; bottom: 24px; color: var(--muted); font-weight: 700; direction: ltr; }

/* ---------- drop ---------- */
.drop { position: fixed; inset: 0; z-index: 75; display: grid; place-items: center; background: rgba(5,8,20,.85); backdrop-filter: blur(10px); animation: fade .15s both; }
.drop * { pointer-events: none; }
.drop-box { width: 440px; padding: 50px 30px; border-radius: 28px; text-align: center; border: 2px dashed rgba(255,255,255,.5); background: rgba(255,255,255,.05); }
.drop-box svg { width: 54px; height: 54px; color: #fff; margin-bottom: 14px; }
.drop-box h3 { font-size: 22px; font-weight: 800; }
.drop-box p { color: var(--muted); margin-top: 6px; }

/* ---------- launch splash (PS5 style) ---------- */
.splash { position: fixed; inset: 0; z-index: 80; background: #000; display: grid; place-items: center; overflow: hidden; animation: fade .3s both; }
.splash-bg { position: absolute; inset: 0; background-size: cover; background-position: center 20%; animation: splashBg 2.4s var(--ease) both; }
.splash-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(0,0,0,.2), rgba(0,0,0,.85)); }
@keyframes splashBg { from { transform: scale(1.25); filter: brightness(.3); } to { transform: scale(1.05); filter: brightness(.85); } }
.splash-content { position: relative; display: flex; flex-direction: column; align-items: center; gap: 40px; }
.splash-art { animation: splashArt .9s var(--ease) .15s both; text-align: center; }
.splash-art img { max-width: 560px; max-height: 220px; filter: drop-shadow(0 10px 40px rgba(0,0,0,.8)); }
.splash-art h2 { font-size: 56px; font-weight: 900; text-shadow: 0 6px 40px rgba(0,0,0,.8); }
@keyframes splashArt { from { opacity: 0; transform: scale(.85); } }
.splash-note { margin-top: 18px; color: #cfd5e6; font-weight: 600; font-size: 16px; animation: fade .4s both; }
.modal .pill svg { width: 18px; height: 18px; }
.splash-ring { width: 46px; height: 46px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: #fff; animation: spin .9s linear infinite, fade .4s .5s both; }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 22px; border-radius: 30px; background: rgba(18, 24, 44, .94); backdrop-filter: blur(24px); border: 1px solid var(--line-2); box-shadow: 0 16px 40px rgba(0,0,0,.5); font-weight: 600; animation: toastIn .4s var(--ease) both; }
.toast svg { width: 22px; height: 22px; color: #7cc4ff; }
.toast.error { border-color: rgba(255, 84, 112, .5); }
.toast.out { animation: toastOut .3s ease-in both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-16px); } }

@media (max-width: 1100px) {
  .game-info { width: 72vw; }
  .g-title { font-size: 42px; }
  .search { width: 200px; }
}
