.portal-search{position:relative}
.portal-search-results{position:absolute;top:calc(100% + 8px);left:0;right:0;max-height:min(520px,70vh);overflow:auto;padding:8px;background:#0d120f;border:1px solid #2b372f;border-radius:16px;box-shadow:0 24px 70px rgba(0,0,0,.48)}
.portal-search-results[hidden]{display:none}
.portal-search-result{display:grid;grid-template-columns:54px minmax(0,1fr);gap:10px;align-items:center;padding:8px;border-radius:11px;color:#e7eee8}
.portal-search-result:hover,.portal-search-result:focus-visible{background:#172019}
.portal-search-result img{width:54px;height:54px;border-radius:9px;object-fit:cover}
.portal-search-result span{min-width:0;display:grid;gap:3px}
.portal-search-result strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.portal-search-result small{color:#87948a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.portal-search-empty{padding:18px;color:#87948a;text-align:center;font-size:13px}

.portal-my-games-dialog{width:min(760px,calc(100vw - 28px));max-height:min(760px,calc(100vh - 36px));padding:0;border:1px solid #314038;border-radius:22px;background:#0d120f;color:var(--text);box-shadow:0 30px 90px rgba(0,0,0,.6)}
.portal-my-games-dialog::backdrop{background:rgba(0,0,0,.68);backdrop-filter:blur(5px)}
.library-dialog-head{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:17px 19px;border-bottom:1px solid #232d26;background:#0d120ff2;backdrop-filter:blur(12px)}
.library-dialog-head strong{font-size:20px}
.library-dialog-close{width:36px;height:36px;border:1px solid #2c3830;border-radius:10px;background:#121813;color:#cdd6cf;font-size:24px;line-height:1;cursor:pointer}
.library-dialog-close:hover{border-color:#63834d;color:var(--lime)}
.library-dialog-body{padding:18px;overflow:auto}
.library-section+.library-section{margin-top:24px;padding-top:20px;border-top:1px solid #222c24}
.library-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.library-section-head h3{margin:0;font-size:17px}
.library-count{color:#748178;font-size:12px}
.library-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.library-tile{position:relative;display:grid;grid-template-columns:72px minmax(0,1fr);gap:12px;align-items:center;min-height:90px;padding:9px 44px 9px 9px;border:1px solid #273229;border-radius:15px;background:#111712}
.library-tile:hover{border-color:#4d653e;background:#151d17}
.library-tile>a{display:contents;color:inherit}
.library-tile img{width:72px;height:72px;border-radius:11px;object-fit:cover}
.library-tile-copy{min-width:0;display:grid;gap:5px}
.library-tile-copy strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.library-tile-copy small{color:#87948a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.library-favorite{position:absolute;right:9px;top:9px;width:32px;height:32px;border:1px solid #344137;border-radius:9px;background:#0d120f;color:#9eaba1;cursor:pointer}
.library-favorite:hover,.library-favorite.active{border-color:var(--lime);color:var(--lime);background:#142016}
.library-empty{padding:20px;border:1px dashed #2a352c;border-radius:14px;color:#87948a;text-align:center;line-height:1.5}

.favorite-toggle.active{border-color:var(--lime)!important;color:var(--lime)!important;background:#142016!important}
.favorite-toggle .favorite-star{font-size:16px;color:inherit}

.continue-section{padding:6px 0 24px}
.continue-strip{display:flex;gap:12px;overflow-x:auto;padding:2px 2px 10px;scrollbar-width:thin}
.continue-card{flex:0 0 112px;display:grid;gap:7px;color:#dfe8e1}
.continue-card img{width:112px;height:112px;border-radius:18px;object-fit:cover;border:1px solid #2b372f;transition:.18s transform,.18s border-color}
.continue-card:hover img{transform:translateY(-2px);border-color:#63834d}
.continue-card strong{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.continue-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.continue-title h2{margin:0;font-size:clamp(22px,3vw,30px)}
.continue-title a{color:var(--lime);font-size:12px;font-weight:800}

.games-view-note{margin:8px 0 20px;color:#87948a}
.games-empty{grid-column:1/-1;padding:34px 20px;border:1px dashed #2c382f;border-radius:18px;color:#87948a;text-align:center}
.games-result-card .game-card-body{display:grid;gap:4px}
.games-result-meta{font-size:12px;color:#87948a}

@media(max-width:900px){
  .portal-search-results{left:-4px;right:-4px}
}
@media(max-width:620px){
  .portal-search-results{position:fixed;left:8px;right:8px;top:54px;max-height:56vh}
  .library-grid{grid-template-columns:1fr}
  .portal-my-games-dialog{width:calc(100vw - 16px)}
  .library-dialog-body{padding:14px}
}
