
/* Tronsoft Games Portal v17.0.0
   Modern UI Refresh
   Shared visual language for Game Portal, TIFE Portal, Library,
   Downloads, Leaderboards, and game detail pages. */

:root{
  --tg17-bg:#03111c;
  --tg17-panel:#111923;
  --tg17-panel-2:#081622;
  --tg17-border:rgba(148,163,184,.26);
  --tg17-border-blue:rgba(63,169,255,.58);
  --tg17-text:#f4f7fb;
  --tg17-muted:#aeb9c7;
  --tg17-blue:#42a5ff;
  --tg17-purple:#a855f7;
  --tg17-green:#19b76a;
  --tg17-radius:16px;
  --tg17-shadow:0 18px 44px rgba(0,0,0,.22);
}

body.tg-public-shell{
  background:
    radial-gradient(circle at 80% 0%, rgba(31,95,145,.10), transparent 28rem),
    linear-gradient(180deg,#020d16 0%,var(--tg17-bg) 100%);
  color:var(--tg17-text);
}

.portal-section,
.detail-panel,
.portal-card,
.game-facts,
.library-section,
.download-card,
.leaderboard-panel,
.player-feedback-bottom{
  border:1px solid var(--tg17-border);
  border-radius:var(--tg17-radius);
  background:linear-gradient(180deg,rgba(18,27,38,.96),rgba(7,19,30,.94));
  box-shadow:none;
}

.portal-card,
.download-card,
.game-detail-art,
.unified-game-tile{
  transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease;
}

.portal-card:hover,
.download-card:hover,
.game-detail-art:hover,
.unified-game-tile:hover{
  transform:translateY(-4px);
  border-color:var(--tg17-border-blue);
  box-shadow:var(--tg17-shadow);
}

.portal-hero,
.game-detail-hero{
  position:relative;
  overflow:hidden;
  border:1px solid var(--tg17-border);
  border-radius:22px;
  background:
    radial-gradient(circle at 85% 15%,rgba(66,165,255,.14),transparent 22rem),
    linear-gradient(135deg,rgba(17,25,35,.98),rgba(5,17,28,.96));
}

.portal-hero h1,
.game-detail-copy h1,
.portal-section h1,
.portal-section h2,
.detail-panel h2{
  letter-spacing:-.025em;
}

.portal-hero .eyebrow,
.unified-library-head .eyebrow,
.portal-card-kicker{
  color:var(--tg17-blue);
  letter-spacing:.12em;
  text-transform:uppercase;
  font-weight:800;
}

.portal-card-grid{
  gap:20px;
}

.portal-module-grid{
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
}

.portal-game-grid{
  grid-template-columns:repeat(4,minmax(0,1fr));
}

.portal-featured-game,
.library-game-card{
  overflow:hidden;
}

.portal-game-cover img,
.game-detail-art img,
.library-game-card img{
  width:100%;
  height:100%;
  object-fit:cover;
  transition:transform .24s ease;
}

.portal-featured-game:hover img,
.library-game-card:hover img,
.game-detail-art:hover img{
  transform:scale(1.025);
}

.btn,
button,
input[type="submit"],
input[type="button"]{
  min-height:44px;
  border-radius:10px;
  font-weight:750;
}

.btn.gold{
  background:var(--tg17-blue);
  border-color:var(--tg17-blue);
  color:#03111c;
}

.btn.gold:hover{
  filter:brightness(1.08);
}

.btn.ghost{
  border-color:var(--tg17-border-blue);
  color:#7cc5ff;
}

.game-facts{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:0;
  overflow:hidden;
}

.game-facts > div{
  min-height:88px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:16px 20px;
  border-right:1px solid var(--tg17-border);
}

.game-facts > div:last-child{
  border-right:0;
}

.game-facts span{
  color:var(--tg17-muted);
  font-size:.85rem;
}

.game-facts strong{
  font-size:1.06rem;
}

.resource-links a,
.version-timeline article{
  border:1px solid var(--tg17-border);
  border-radius:12px;
  background:rgba(5,17,28,.68);
}

.resource-links a:hover{
  border-color:var(--tg17-border-blue);
}

table{
  border-collapse:separate;
  border-spacing:0;
  width:100%;
  overflow:hidden;
  border:1px solid var(--tg17-border);
  border-radius:14px;
  background:rgba(5,17,28,.72);
}

th{
  background:rgba(18,27,38,.96);
  color:var(--tg17-muted);
  text-transform:uppercase;
  letter-spacing:.06em;
  font-size:.78rem;
}

th,td{
  padding:14px 16px;
  border-bottom:1px solid var(--tg17-border);
}

tr:last-child td{
  border-bottom:0;
}

tr:hover td{
  background:rgba(66,165,255,.045);
}

input,
select,
textarea{
  border:1px solid rgba(63,169,255,.42);
  border-radius:10px;
  background:#061521;
  color:var(--tg17-text);
}

input:focus,
select:focus,
textarea:focus{
  outline:2px solid rgba(66,165,255,.35);
  outline-offset:1px;
  border-color:var(--tg17-blue);
}

.notice,
.empty-state{
  border-radius:14px;
}

.portal-shell-bar{
  border-bottom:1px solid var(--tg17-border);
  background:rgba(3,13,22,.92);
  backdrop-filter:blur(12px);
}

.portal-subnav{
  gap:8px;
}

.portal-subnav a{
  border-radius:999px;
  padding:.55rem .9rem;
}

.portal-subnav a.active{
  background:rgba(66,165,255,.14);
  color:#79c5ff;
}

@media(max-width:1180px){
  .portal-game-grid{grid-template-columns:repeat(3,minmax(0,1fr));}
}

@media(max-width:860px){
  .portal-game-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .game-detail-columns{grid-template-columns:1fr !important;}
}

@media(max-width:560px){
  .portal-game-grid{grid-template-columns:1fr;}
  .portal-hero,
  .game-detail-hero{border-radius:16px;}
  .game-facts{grid-template-columns:1fr 1fr;}
}


.site-version{
    margin-left:auto;
    display:flex;
    align-items:center;
    font-size:11px;
    font-weight:600;
    color:#9aa7b6;
    letter-spacing:.05em;
    white-space:nowrap;
    opacity:.85;
    padding-left:16px;
}
.site-version:hover{opacity:1;}


/* v17.1.2 — full-screen public shell */
.wrap,
.site-header-inner,
.portal-shell-bar-inner{
  width:100%;
  max-width:none !important;
  margin-inline:0 !important;
  padding-left:clamp(14px,2vw,32px) !important;
  padding-right:clamp(14px,2vw,32px) !important;
  box-sizing:border-box;
}

.site-main{
  width:100%;
  max-width:none;
}

.tg-home,
.unified-library,
.tg17-game-portal,
.tg17-tife-portal,
.tg17-my-library,
.tg17-downloads,
.tg17-leaderboards,
.tg17-game-detail{
  width:100% !important;
  max-width:none !important;
  margin-inline:0 !important;
  padding-left:clamp(14px,2vw,32px) !important;
  padding-right:clamp(14px,2vw,32px) !important;
  box-sizing:border-box;
}

/* Clickable website version */
.site-version{
  margin-left:auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:28px;
  padding:.25rem .6rem;
  border:1px solid rgba(148,163,184,.25);
  border-radius:999px;
  background:rgba(255,255,255,.035);
  color:#9aa7b6;
  font:inherit;
  font-size:11px;
  font-weight:700;
  letter-spacing:.05em;
  white-space:nowrap;
  cursor:pointer;
}

.site-version:hover,
.site-version:focus-visible{
  color:#fff;
  border-color:rgba(66,165,255,.5);
  background:rgba(66,165,255,.1);
}

/* What's New dialog */
.whats-new-dialog[hidden]{
  display:none;
}

.whats-new-dialog{
  position:fixed;
  inset:0;
  z-index:5000;
  display:grid;
  place-items:center;
  padding:1rem;
}

.whats-new-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.68);
  backdrop-filter:blur(5px);
}

.whats-new-panel{
  position:relative;
  z-index:1;
  width:min(560px,calc(100vw - 2rem));
  max-height:min(80vh,720px);
  overflow:auto;
  padding:1.5rem;
  border:1px solid rgba(66,165,255,.4);
  border-radius:18px;
  background:linear-gradient(180deg,#111923,#071521);
  box-shadow:0 24px 80px rgba(0,0,0,.45);
}

.whats-new-panel h2{
  margin:.2rem 0 .8rem;
}

.whats-new-close{
  position:absolute;
  top:.75rem;
  right:.75rem;
  width:36px;
  height:36px;
  min-height:36px;
  padding:0;
  border:1px solid rgba(148,163,184,.24);
  border-radius:50%;
  background:rgba(255,255,255,.04);
  color:#fff;
  font-size:1.35rem;
  cursor:pointer;
}

.whats-new-meta{
  display:flex;
  justify-content:space-between;
  gap:1rem;
  margin-bottom:1rem;
  color:#aeb9c7;
  font-size:.9rem;
}

.whats-new-list{
  margin:0;
  padding-left:1.2rem;
}

.whats-new-list li{
  margin:.55rem 0;
}

body.has-modal-open{
  overflow:hidden;
}

@media(max-width:760px){
  .site-version{
    font-size:10px;
    padding:.2rem .45rem;
  }

  .whats-new-meta{
    flex-direction:column;
    gap:.25rem;
  }
}


/* v17.2.0 standard-game launch errors */
.game-launch-error{
  width:100%;
  max-width:none;
  padding-top:2rem;
  padding-bottom:3rem;
  box-sizing:border-box;
}

.game-launch-error .detail-panel{
  max-width:760px;
  margin:0 auto;
  padding:2rem;
}

.game-launch-error h1{
  margin:.25rem 0 .75rem;
}

.game-launch-error .hero-actions{
  display:flex;
  flex-wrap:wrap;
  gap:.75rem;
  margin-top:1.25rem;
}


/* v17.3.1 dynamic What's New release title */
.whats-new-release-title{
  margin:-.2rem 0 .8rem;
  color:#70c1ff;
  font-size:.95rem;
  font-weight:750;
}


/* v17.4.0 shared game-resource details */
.resource-links a > span:first-child{
  display:flex;
  flex-direction:column;
  gap:.12rem;
}

.resource-links a strong{
  font-size:.95rem;
}

.resource-links a small{
  color:var(--tg17-muted);
  font-size:.72rem;
}


/* v17.5.0 shared breadcrumbs */
.tg-breadcrumb{
  width:100%;
  margin:0 0 1rem;
  color:var(--tg17-muted);
  font-size:.84rem;
}

.tg-breadcrumb ol{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:.35rem;
  margin:0;
  padding:0;
  list-style:none;
}

.tg-breadcrumb li{
  display:inline-flex;
  align-items:center;
  gap:.35rem;
}

.tg-breadcrumb li:not(:last-child)::after{
  content:"›";
  color:rgba(174,185,199,.58);
}

.tg-breadcrumb a{
  color:#70c1ff;
  text-decoration:none;
}

.tg-breadcrumb a:hover,
.tg-breadcrumb a:focus-visible{
  text-decoration:underline;
}

.tg-breadcrumb [aria-current="page"]{
  color:var(--tg17-text);
  font-weight:700;
}

.game-library-breadcrumb{
  margin-top:.2rem;
  margin-bottom:1.1rem;
}

.game-detail-breadcrumb,
.game-launch-breadcrumb{
  margin-bottom:1rem;
}


/* v17.7.0 breadcrumb visibility hardening */
.tg-breadcrumb{
  display:block !important;
  visibility:visible !important;
  opacity:1 !important;
  position:relative;
  z-index:2;
  min-height:24px;
}


/* v17.7.1 — global full-screen layout
   Every shared public/admin page may use the full browser width. */

html,
body{
  width:100%;
  max-width:none;
  overflow-x:hidden;
}

body{
  margin:0;
}

.site-header,
.site-main,
.site-footer,
.portal-shell-bar,
main,
header,
footer{
  width:100%;
  max-width:none !important;
  box-sizing:border-box;
}

.wrap,
.container,
.content-wrap,
.page-wrap,
.page-container,
.site-header-inner,
.site-footer-inner,
.portal-shell-bar-inner,
.portal-content,
.portal-page,
.portal-section,
.account-page,
.admin-page,
.library-page,
.game-page,
.news-page,
.exploration-page,
.tife-page{
  width:100% !important;
  max-width:none !important;
  margin-left:0 !important;
  margin-right:0 !important;
  box-sizing:border-box !important;
}

.wrap,
.container,
.content-wrap,
.page-wrap,
.page-container,
.site-header-inner,
.site-footer-inner,
.portal-shell-bar-inner{
  padding-left:clamp(12px,2vw,34px) !important;
  padding-right:clamp(12px,2vw,34px) !important;
}

.tg-home,
.unified-library,
.game-detail-modern,
.game-launch-error,
.tg17-game-portal,
.tg17-tife-portal,
.tg17-my-library,
.tg17-downloads,
.tg17-leaderboards,
.tg17-game-detail{
  width:100% !important;
  max-width:none !important;
  margin-inline:0 !important;
  padding-left:clamp(12px,2vw,34px) !important;
  padding-right:clamp(12px,2vw,34px) !important;
  box-sizing:border-box !important;
}

/* Allow grids and tables to consume available horizontal space. */
.portal-card-grid,
.portal-module-grid,
.portal-game-grid,
.unified-icon-grid,
.resource-links,
.game-facts,
table{
  width:100%;
  max-width:none;
}

/* Preserve intentional constrained components. */
.whats-new-panel,
.modal-panel,
.dialog-panel,
.login-panel,
.register-panel,
.password-panel{
  width:min(100% - 2rem, 680px) !important;
  max-width:680px !important;
  margin-inline:auto !important;
}

.game-launch-error .detail-panel{
  max-width:900px !important;
  margin-inline:auto !important;
}

@media(max-width:760px){
  .wrap,
  .container,
  .content-wrap,
  .page-wrap,
  .page-container,
  .site-header-inner,
  .site-footer-inner,
  .portal-shell-bar-inner,
  .tg-home,
  .unified-library,
  .game-detail-modern,
  .game-launch-error,
  .tg17-game-portal,
  .tg17-tife-portal,
  .tg17-my-library,
  .tg17-downloads,
  .tg17-leaderboards,
  .tg17-game-detail{
    padding-left:10px !important;
    padding-right:10px !important;
  }
}


/* v17.7.3 — compact tiles across the entire site */

/* Shared tile grids */
.portal-card-grid,
.portal-module-grid,
.portal-game-grid,
.library-grid,
.download-grid,
.featured-grid,
.related-games,
.resource-card-grid,
.account-card-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(175px,1fr)) !important;
  gap:12px !important;
  align-items:start;
}

/* Shared compact tile surfaces */
.portal-card,
.portal-module-card,
.portal-featured-game,
.library-game-card,
.download-card,
.resource-card,
.account-card,
.related-game-card{
  min-width:0;
  overflow:hidden;
  border-radius:12px !important;
}

/* Compact artwork */
.portal-game-cover,
.portal-featured-game .cover,
.library-game-card .cover,
.download-card .cover,
.related-game-card .cover{
  aspect-ratio:3 / 4 !important;
  min-height:0 !important;
  overflow:hidden;
  border-radius:11px 11px 0 0 !important;
}

.portal-game-cover img,
.portal-featured-game img,
.library-game-card img,
.download-card img,
.related-game-card img{
  width:100% !important;
  height:100% !important;
  object-fit:cover !important;
}

/* Compact tile content */
.portal-card,
.portal-module-card,
.download-card,
.resource-card,
.account-card{
  padding:.72rem !important;
}

.portal-featured-game .content,
.library-game-card .content,
.download-card .content,
.related-game-card .content{
  padding:.62rem .65rem .72rem !important;
}

.portal-card h2,
.portal-card h3,
.portal-module-card h2,
.portal-module-card h3,
.portal-featured-game h2,
.portal-featured-game h3,
.library-game-card h2,
.library-game-card h3,
.download-card h2,
.download-card h3,
.related-game-card h2,
.related-game-card h3{
  margin:0 0 .22rem !important;
  font-size:.9rem !important;
  line-height:1.18 !important;
}

.portal-card p,
.portal-module-card p,
.portal-featured-game p,
.library-game-card p,
.download-card p,
.related-game-card p,
.resource-card p,
.account-card p{
  margin:.18rem 0 !important;
  font-size:.7rem !important;
  line-height:1.3 !important;
}

.portal-card .btn,
.portal-module-card .btn,
.portal-featured-game .btn,
.library-game-card .btn,
.download-card .btn,
.related-game-card .btn{
  min-height:34px !important;
  padding:.38rem .58rem !important;
  font-size:.68rem !important;
  border-radius:8px !important;
}

.portal-card-actions,
.portal-module-actions,
.download-actions,
.library-card-actions,
.related-game-actions{
  display:flex;
  flex-wrap:wrap;
  gap:.4rem !important;
  margin-top:.5rem !important;
}

/* Compact metadata and badges */
.portal-card .badge,
.portal-module-card .badge,
.portal-featured-game .badge,
.library-game-card .badge,
.download-card .badge,
.related-game-card .badge,
.status-badge,
.engine-badge,
.genre-badge{
  padding:.18rem .34rem !important;
  font-size:.56rem !important;
  border-radius:999px !important;
}

.portal-card-meta,
.portal-featured-meta,
.library-card-meta,
.download-meta,
.related-game-meta{
  display:flex;
  flex-wrap:wrap;
  gap:.32rem !important;
  margin-top:.4rem !important;
  font-size:.62rem !important;
  opacity:.72;
}

/* Keep dashboard/stat cards readable but tighter */
.portal-stat-grid,
.dashboard-stat-grid,
.stats-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr)) !important;
  gap:12px !important;
}

.portal-stat,
.dashboard-stat,
.stat-card{
  min-height:88px !important;
  padding:.8rem !important;
}

.portal-stat strong,
.dashboard-stat strong,
.stat-card strong{
  font-size:1.35rem !important;
}

.portal-stat span,
.dashboard-stat span,
.stat-card span{
  font-size:.72rem !important;
}

/* Resource links become compact tiles */
.resource-links{
  display:grid !important;
  grid-template-columns:repeat(auto-fill,minmax(175px,1fr)) !important;
  gap:10px !important;
}

.resource-links a{
  min-height:64px !important;
  padding:.62rem .7rem !important;
  border-radius:10px !important;
  font-size:.72rem !important;
}

.resource-links a strong{
  font-size:.78rem !important;
}

.resource-links a small{
  font-size:.62rem !important;
}

/* Related game / portal tiles responsive behavior */
@media(max-width:1100px){
  .portal-card-grid,
  .portal-module-grid,
  .portal-game-grid,
  .library-grid,
  .download-grid,
  .featured-grid,
  .related-games,
  .resource-card-grid,
  .account-card-grid{
    grid-template-columns:repeat(auto-fill,minmax(170px,1fr)) !important;
  }
}

@media(max-width:760px){
  .portal-card-grid,
  .portal-module-grid,
  .portal-game-grid,
  .library-grid,
  .download-grid,
  .featured-grid,
  .related-games,
  .resource-card-grid,
  .account-card-grid{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:10px !important;
  }

  .portal-stat-grid,
  .dashboard-stat-grid,
  .stats-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
}

@media(max-width:520px){
  .portal-card-grid,
  .portal-module-grid,
  .portal-game-grid,
  .library-grid,
  .download-grid,
  .featured-grid,
  .related-games,
  .resource-card-grid,
  .account-card-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }

  .portal-card h2,
  .portal-card h3,
  .portal-module-card h2,
  .portal-module-card h3,
  .portal-featured-game h2,
  .portal-featured-game h3,
  .library-game-card h2,
  .library-game-card h3,
  .download-card h2,
  .download-card h3,
  .related-game-card h2,
  .related-game-card h3{
    font-size:.84rem !important;
  }
}


/* v17.7.4 — visible breadcrumbs */
.tg-breadcrumb,
.game-library-breadcrumb,
.game-detail-breadcrumb{
  display:block !important;
  visibility:visible !important;
  opacity:1 !important;
  position:relative !important;
  z-index:3 !important;
  min-height:24px !important;
  margin-top:.25rem !important;
}


/* v17.7.6 — remove redundant TIFE Portal quick-link cards */
.tife-page .portal-quick-grid,
.tife-center .portal-quick-grid,
.tg17-tife-portal .portal-quick-grid,
.portal-tife .portal-quick-grid,
body[data-portal="tife"] .portal-quick-grid,
.tife-portal-quick-grid,
.tife-quick-grid{
  display:none !important;
}


/* v17.8.0 — Portal Page Refresh */

.portal-hero-premium,
.library-hero-premium,
.tife-hero-premium{
  position:relative;
  overflow:hidden;
  min-height:260px;
  display:grid;
  align-items:center;
  padding:clamp(1.5rem,3vw,3rem) !important;
  border:1px solid rgba(66,165,255,.32);
  border-radius:22px;
  background:
    radial-gradient(circle at 85% 18%,rgba(66,165,255,.18),transparent 20rem),
    radial-gradient(circle at 15% 80%,rgba(168,85,247,.10),transparent 18rem),
    linear-gradient(135deg,rgba(17,25,35,.98),rgba(4,16,27,.98));
  box-shadow:0 24px 70px rgba(0,0,0,.22);
}

.portal-hero-premium::after,
.library-hero-premium::after,
.tife-hero-premium::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(90deg,rgba(255,255,255,.025) 1px,transparent 1px),
    linear-gradient(rgba(255,255,255,.025) 1px,transparent 1px);
  background-size:42px 42px;
  mask-image:linear-gradient(to right,transparent,black 35%,black);
}

.portal-hero-premium h1,
.library-hero-premium h1,
.tife-hero-premium h1{
  max-width:900px;
  margin:.35rem 0 .8rem;
  font-size:clamp(2.4rem,4vw,4.5rem);
  line-height:1.02;
  letter-spacing:-.04em;
}

.portal-hero-premium p,
.library-hero-premium p,
.tife-hero-premium p{
  max-width:760px;
  font-size:1.02rem;
  line-height:1.55;
}

.portal-content-intro,
.library-content-intro{
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:2rem;
  margin:1.5rem 0 1rem;
  padding:1rem 0;
  border-bottom:1px solid var(--tg17-border);
}

.portal-content-intro h2,
.library-content-intro h2{
  margin:.2rem 0 .35rem;
  font-size:clamp(1.6rem,2.2vw,2.4rem);
}

.portal-content-intro p,
.library-content-intro p{
  max-width:760px;
  margin:0;
  color:var(--tg17-muted);
}

.portal-page .portal-section,
.tg17-my-library > section:not(.hero):not(.library-content-intro),
.tife-center > section:not(.tife-page-head){
  margin-top:1rem;
  padding:1.25rem;
  border:1px solid var(--tg17-border);
  border-radius:16px;
  background:linear-gradient(180deg,rgba(18,27,38,.96),rgba(7,19,30,.92));
}

.portal-page .section-heading,
.tg17-my-library .section-heading,
.tife-center .section-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  margin-bottom:1rem;
}

.portal-page .section-heading h2,
.tg17-my-library .section-heading h2,
.tife-center .section-heading h2{
  margin:.15rem 0;
  font-size:1.5rem;
}

.portal-page .section-heading a,
.tg17-my-library .section-heading a,
.tife-center .section-heading a{
  color:#70c1ff;
  text-decoration:none;
  font-size:.85rem;
  font-weight:700;
}

.portal-page .section-heading a:hover,
.tg17-my-library .section-heading a:hover,
.tife-center .section-heading a:hover{
  text-decoration:underline;
}

/* Remove any remaining redundant portal navigation blocks */
.portal-page > .portal-quick-grid,
.portal-page > .portal-module-grid,
.tg17-my-library > .portal-module-grid,
.tife-center > .portal-quick-grid,
.tife-center > .portal-module-grid,
.tg17-tife-portal > .portal-quick-grid,
.tg17-tife-portal > .portal-module-grid{
  display:none !important;
}

@media(max-width:760px){
  .portal-hero-premium,
  .library-hero-premium,
  .tife-hero-premium{
    min-height:220px;
    padding:1.25rem !important;
    border-radius:16px;
  }

  .portal-content-intro,
  .library-content-intro{
    align-items:flex-start;
    flex-direction:column;
    gap:.75rem;
  }
}

/* v17.8.1 functional wishlist */
.inline-collection-form{display:inline-flex;margin:0}
.inline-collection-form button{white-space:nowrap}
.tile-wishlist-form{display:flex;margin-top:.4rem}
.wishlist-tile-button{width:100%;min-height:30px;padding:.32rem .5rem;border:1px solid rgba(168,85,247,.55);border-radius:8px;background:rgba(168,85,247,.08);color:#d8b4fe;font:inherit;font-size:.67rem;font-weight:750;cursor:pointer}
.wishlist-tile-button:hover,.wishlist-tile-button:focus-visible{border-color:#a855f7;background:rgba(168,85,247,.16)}
.card-actions form,.hero-actions form{display:inline-flex}


/* v17.8.2 - Smaller portal titles */
.portal-hero-premium h1,
.library-hero-premium h1,
.tife-hero-premium h1,
.hero h1,
.tife-page-head h1{
  font-size:clamp(2.1rem,3.6vw,3.6rem) !important;
  line-height:1.05;
  letter-spacing:-0.03em;
}

@media (max-width:768px){
  .portal-hero-premium h1,
  .library-hero-premium h1,
  .tife-hero-premium h1,
  .hero h1,
  .tife-page-head h1{
    font-size:clamp(1.8rem,7vw,2.8rem) !important;
  }
}


/* v17.8.3 - Smaller titles on overview pages */
.overview-page h1,
.portal-overview h1,
.game-overview h1,
.tife-overview h1,
.library-overview h1,
.page-overview h1,
.overview-hero h1{
    font-size:clamp(1.9rem,3vw,3rem) !important;
    line-height:1.08;
    letter-spacing:-0.02em;
}

.overview-page .eyebrow + h1,
.portal-overview .eyebrow + h1{
    margin-bottom:.5rem;
}

@media (max-width:768px){
  .overview-page h1,
  .portal-overview h1,
  .game-overview h1,
  .tife-overview h1,
  .library-overview h1,
  .page-overview h1,
  .overview-hero h1{
      font-size:clamp(1.6rem,6vw,2.4rem) !important;
  }
}


/* v17.8.4 - Full-width portal title layout */
.portal-hero-premium,
.library-hero-premium,
.tife-hero-premium,
.overview-hero,
.portal-overview,
.overview-page{
  width:100% !important;
  max-width:none !important;
}

.portal-hero-premium h1,
.library-hero-premium h1,
.tife-hero-premium h1,
.overview-hero h1,
.portal-overview h1,
.overview-page h1{
  display:block;
  width:100% !important;
  max-width:none !important;
}

.portal-hero-premium p,
.library-hero-premium p,
.tife-hero-premium p{
  max-width:1000px;
}


/* v17.8.6 — remove redundant TIFE navigation-card groups */
body[data-portal="tife"] .portal-quick-grid,
body[data-portal="tife"] .portal-module-grid,
.tg17-tife-portal > .portal-quick-grid,
.tg17-tife-portal > .portal-module-grid,
.tife-center > .portal-quick-grid,
.tife-center > .portal-module-grid{
  display:none !important;
}

/* Ensure wishlist controls and breadcrumbs are visible */
.hero-actions .inline-collection-form,
.game-detail-copy > .inline-collection-form,
.card-actions .inline-collection-form{
  display:inline-flex !important;
}

.tg-breadcrumb,
.game-library-breadcrumb,
.game-detail-breadcrumb{
  display:block !important;
  visibility:visible !important;
  opacity:1 !important;
  min-height:24px !important;
  margin:.35rem 0 1rem !important;
}


/* v17.8.7 external-game wishlist */
.external-wishlist-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}
.external-wishlist-form label{display:flex;flex-direction:column;gap:.4rem}
.external-wishlist-form .full-width{grid-column:1/-1}
.external-wishlist-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}
.external-wishlist-card{padding:1rem;border:1px solid var(--tg17-border);border-radius:12px;background:rgba(5,17,28,.75)}
.external-wishlist-card h3{margin:.1rem 0 .55rem}
.external-wishlist-card p{font-size:.82rem}
@media(max-width:700px){.external-wishlist-form{grid-template-columns:1fr}.external-wishlist-form .full-width{grid-column:auto}}


/* v17.9.5 — full-width main navigation */
.site-header,
.main-nav,
.primary-nav,
.portal-main-nav,
.site-navigation,
nav[aria-label="Primary"],
nav[aria-label="Main navigation"]{
  width:100% !important;
  max-width:none !important;
  box-sizing:border-box !important;
}

.site-header-inner,
.main-nav-inner,
.primary-nav-inner,
.portal-main-nav-inner,
.site-navigation-inner{
  width:100% !important;
  max-width:none !important;
  margin:0 !important;
  padding-left:clamp(12px,2vw,34px) !important;
  padding-right:clamp(12px,2vw,34px) !important;
  box-sizing:border-box !important;
}

.main-nav > ul,
.primary-nav > ul,
.portal-main-nav > ul,
.site-navigation > ul,
nav[aria-label="Primary"] > ul,
nav[aria-label="Main navigation"] > ul{
  width:100% !important;
  max-width:none !important;
  display:flex !important;
  align-items:center;
  justify-content:space-between;
  gap:.65rem;
  margin:0 !important;
  padding:0 !important;
  box-sizing:border-box !important;
}

.main-nav li,
.primary-nav li,
.portal-main-nav li,
.site-navigation li{
  flex:0 1 auto;
}

@media(max-width:980px){
  .main-nav > ul,
  .primary-nav > ul,
  .portal-main-nav > ul,
  .site-navigation > ul,
  nav[aria-label="Primary"] > ul,
  nav[aria-label="Main navigation"] > ul{
    justify-content:flex-start;
    overflow-x:auto;
    scrollbar-width:thin;
  }
}

/* v17.9.5 — hover-help affordance */
.tg-hover-help{
  position:relative;
}

.tg-hover-help:hover,
.tg-hover-help:focus-visible{
  filter:brightness(1.08);
}

button.tg-hover-help,
a.tg-hover-help,
input.tg-hover-help{
  cursor:pointer;
}

/* v17.9.6 restored TIFE overview */
.tife-overview-section{margin-top:1rem;padding:1.25rem;border:1px solid var(--tg17-border);border-radius:16px;background:linear-gradient(180deg,rgba(18,27,38,.96),rgba(7,19,30,.92))}
.tife-overview-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(175px,1fr));gap:12px}
.tife-overview-card{display:flex;flex-direction:column;justify-content:space-between;min-height:150px;padding:.8rem;border:1px solid var(--tg17-border);border-radius:12px;background:rgba(4,15,25,.8)}
.tife-overview-card h3{margin:.45rem 0 .25rem;font-size:.92rem;line-height:1.2}.tife-overview-card h3 a{color:var(--tg17-text);text-decoration:none}.tife-overview-card p{margin:0;color:var(--tg17-muted);font-size:.7rem}.tife-overview-card .card-actions{margin-top:.75rem}
@media(max-width:760px){.tife-overview-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:520px){.tife-overview-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}


/* v17.9.7 — cover images on My Library tiles */
.community-game-grid,
.tife-adventure-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(175px,1fr));
  gap:12px;
}

.library-image-card{
  display:flex;
  flex-direction:column;
  overflow:hidden;
  padding:0 !important;
  border:1px solid var(--tg17-border);
  border-radius:12px;
  background:rgba(5,17,28,.82);
}

.library-card-cover{
  display:block;
  width:100%;
  aspect-ratio:3 / 4;
  overflow:hidden;
  background:linear-gradient(135deg,rgba(28,45,65,.95),rgba(8,19,31,.98));
  text-decoration:none;
}

.library-card-cover img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
}

.library-cover-fallback{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  height:100%;
  font-size:2rem;
  font-weight:800;
  letter-spacing:.08em;
  color:#8ec5ff;
}

.library-card-content{
  display:flex;
  flex-direction:column;
  flex:1;
  padding:.7rem;
}

.library-card-content > a{
  color:var(--tg17-text);
  text-decoration:none;
}

.library-card-content > a:hover,
.library-card-content > a:focus-visible{
  text-decoration:underline;
}

.library-card-content p{
  margin:.3rem 0 .6rem;
  font-size:.7rem;
  color:var(--tg17-muted);
}

.library-card-content .card-actions{
  margin-top:auto;
}

@media(max-width:760px){
  .community-game-grid,
  .tife-adventure-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media(max-width:520px){
  .community-game-grid,
  .tife-adventure-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}


/* v17.10.1 — Home hero edge-to-edge fallback */
body.home-page .portal-hero-premium,
body.home-page .hero,
.tg-home > .hero,
.tg-home > .portal-hero-premium{
  width:100vw !important;
  max-width:none !important;
  margin-left:calc(50% - 50vw) !important;
  margin-right:calc(50% - 50vw) !important;
  border-radius:0 !important;
  box-sizing:border-box !important;
}


/* v17.10.3 — logo left, main menu right */
.site-header{
  width:100%;
}

.site-header-inner{
  width:100% !important;
  max-width:none !important;
  display:flex !important;
  align-items:center !important;
  justify-content:flex-start !important;
  gap:1rem;
  padding-left:clamp(12px,2vw,32px) !important;
  padding-right:clamp(12px,2vw,32px) !important;
  box-sizing:border-box;
}

.site-brand{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:flex-start;
  gap:.65rem;
  margin:0 !important;
  margin-right:auto !important;
  text-decoration:none;
}

.site-brand-logo{
  display:block;
  max-width:none;
  height:auto;
}

.site-brand-tagline{
  white-space:nowrap;
}

.site-primary-navigation{
  flex:0 1 auto;
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:.85rem;
  width:auto !important;
  max-width:none !important;
  margin-left:auto !important;
}

.site-primary-links{
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:clamp(.35rem,.8vw,.85rem);
  width:auto !important;
  margin-left:auto !important;
}

.site-header-tools{
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:.55rem;
  flex:0 0 auto;
}

.site-menu-toggle{
  margin-left:auto;
}

@media(min-width:981px){
  .site-menu-toggle{
    display:none !important;
  }

  .site-primary-navigation{
    position:static !important;
    visibility:visible !important;
    opacity:1 !important;
    transform:none !important;
  }
}

@media(max-width:980px){
  .site-header-inner{
    flex-wrap:wrap;
  }

  .site-brand{
    margin-right:0 !important;
  }

  .site-menu-toggle{
    display:inline-flex !important;
    align-items:center;
    justify-content:center;
  }

  .site-primary-navigation{
    flex:1 0 100%;
    width:100% !important;
    justify-content:flex-start !important;
    margin-left:0 !important;
  }

  .site-primary-links{
    width:100% !important;
    justify-content:flex-start !important;
    overflow-x:auto;
    padding-bottom:.25rem;
    scrollbar-width:thin;
  }

  .site-header-tools{
    margin-left:auto;
  }
}

@media(max-width:620px){
  .site-brand-tagline{
    display:none;
  }

  .site-primary-navigation{
    align-items:stretch !important;
    flex-direction:column;
  }

  .site-primary-links{
    gap:.35rem;
  }

  .site-header-tools{
    width:100%;
    justify-content:flex-end !important;
  }
}

/* v17.10.4 visible full-width header and breadcrumbs */
.site-header.unified-site-header{width:100%!important;max-width:none!important;margin:0!important;padding:0!important}
.site-header.unified-site-header .site-header-inner{width:100%!important;max-width:none!important;min-height:60px;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:clamp(1rem,2vw,2.5rem)!important;margin:0!important;padding:0 clamp(18px,2.5vw,42px)!important;box-sizing:border-box!important}
.site-header.unified-site-header .site-brand{flex:0 0 auto!important;margin:0 auto 0 0!important;display:flex!important;align-items:center!important}
.site-header.unified-site-header .site-brand-logo{width:auto!important;max-width:180px!important;height:auto!important}
.site-header.unified-site-header .site-primary-navigation{flex:0 1 auto!important;width:auto!important;max-width:none!important;margin:0 0 0 auto!important;display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:clamp(.8rem,1.5vw,1.6rem)!important}
.site-header.unified-site-header .site-primary-links{width:auto!important;display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:clamp(1rem,2vw,2.4rem)!important;margin:0!important}
.site-header.unified-site-header .site-primary-link{flex:0 0 auto;white-space:nowrap}
.site-header.unified-site-header .site-header-tools{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:.75rem!important;flex:0 0 auto!important;margin-left:clamp(.5rem,1vw,1rem)!important}
.site-breadcrumb-bar{width:100%;min-height:38px;display:flex;align-items:center;border-top:1px solid rgba(255,255,255,.03);border-bottom:1px solid rgba(115,170,225,.16);background:rgba(5,14,23,.96)}
.site-breadcrumb-inner{width:100%;padding:0 clamp(18px,2.5vw,42px);box-sizing:border-box}
.site-auto-breadcrumb{min-height:38px;display:flex;align-items:center;gap:.55rem;color:#8fa0b3;font-size:.72rem;white-space:nowrap;overflow-x:auto}
.site-auto-breadcrumb a{color:#7fc4ff;text-decoration:none}.site-auto-breadcrumb a:hover{text-decoration:underline}
.site-auto-breadcrumb [aria-current="page"]{color:#d7e0ea;font-weight:650}.site-breadcrumb-separator{color:#546274}
@media(max-width:1180px){.site-header.unified-site-header .site-primary-links{gap:1rem!important}.site-header.unified-site-header .site-primary-link{font-size:.72rem}}
@media(max-width:980px){.site-header.unified-site-header .site-header-inner{flex-wrap:wrap}.site-header.unified-site-header .site-menu-toggle{display:inline-flex!important;margin-left:auto!important}.site-header.unified-site-header .site-primary-navigation{flex:1 0 100%!important;width:100%!important;margin:0!important;justify-content:flex-start!important;overflow-x:auto}.site-header.unified-site-header .site-primary-links{width:100%!important;justify-content:flex-start!important;overflow-x:auto}}


/* v17.10.5 — route-aware breadcrumbs */
.site-breadcrumb-bar{
  position:relative;
  z-index:30;
}

.site-auto-breadcrumb{
  width:100%;
  min-width:0;
}

.site-auto-breadcrumb > span,
.site-auto-breadcrumb > a{
  flex:0 0 auto;
}

.site-auto-breadcrumb > span[aria-current="page"]{
  max-width:min(52vw,720px);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* The global header breadcrumb is now the canonical trail. */
.site-main > .tg-breadcrumb,
.site-main .game-library-breadcrumb,
.site-main .game-detail-breadcrumb{
  display:none !important;
}


/* v17.10.6 — TIFE Portal matches Game Portal */
.portal-tife{
  width:100% !important;
  max-width:none !important;
  margin-inline:0 !important;
  padding-left:clamp(14px,2vw,32px) !important;
  padding-right:clamp(14px,2vw,32px) !important;
  box-sizing:border-box;
}

.portal-tife .portal-hero,
.portal-tife .portal-content-intro,
.portal-tife .portal-section,
.portal-tife .portal-status-grid{
  width:100%;
  max-width:none;
}

.portal-tife .portal-hero-logo img{
  width:min(320px,100%);
  max-height:170px;
  object-fit:contain;
}

.portal-tife .portal-featured-game{
  min-width:0;
}

.portal-tife .portal-game-cover{
  aspect-ratio:3 / 4;
}

.portal-tife .portal-featured-game-body{
  display:flex;
  flex-direction:column;
  min-width:0;
}

.portal-tife .portal-featured-game-body .card-actions{
  margin-top:auto;
}

@media(max-width:860px){
  .portal-tife .portal-hero{
    grid-template-columns:1fr !important;
  }

  .portal-tife .portal-hero-mark{
    display:none;
  }
}


/* v17.10.7 — Encyclopedia entry images */
.encyclopedia-images-enabled .encyclopedia-grid,
.encyclopedia-images-enabled .entry-grid,
.encyclopedia-images-enabled .article-grid,
.encyclopedia-images-enabled .resource-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(210px,1fr));
  gap:14px;
}

.encyclopedia-entry-with-image{
  position:relative;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  min-width:0;
  padding:0 !important;
  border:1px solid var(--tg17-border);
  border-radius:14px;
  background:linear-gradient(180deg,rgba(16,27,39,.96),rgba(5,16,27,.96));
}

.encyclopedia-entry-image{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  aspect-ratio:16 / 9;
  overflow:hidden;
  border-bottom:1px solid var(--tg17-border);
  background:
    radial-gradient(circle at 50% 35%,rgba(55,145,220,.16),transparent 55%),
    #06131f;
  text-decoration:none;
}

.encyclopedia-entry-image img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  transition:transform .2s ease,filter .2s ease;
}

.encyclopedia-entry-image img.is-fallback{
  object-fit:contain;
  padding:1.25rem;
  box-sizing:border-box;
}

.encyclopedia-entry-image:hover img,
.encyclopedia-entry-image:focus-visible img{
  transform:scale(1.035);
  filter:brightness(1.08);
}

.encyclopedia-entry-with-image > *:not(.encyclopedia-entry-image){
  margin-left:.85rem;
  margin-right:.85rem;
}

.encyclopedia-entry-with-image > :nth-child(2){
  margin-top:.8rem;
}

.encyclopedia-entry-with-image > :last-child{
  margin-bottom:.85rem;
}

.encyclopedia-entry-with-image h2,
.encyclopedia-entry-with-image h3,
.encyclopedia-entry-with-image h4{
  margin-bottom:.35rem;
}

.encyclopedia-entry-with-image p{
  color:var(--tg17-muted);
  font-size:.8rem;
  line-height:1.45;
}

@media(max-width:760px){
  .encyclopedia-images-enabled .encyclopedia-grid,
  .encyclopedia-images-enabled .entry-grid,
  .encyclopedia-images-enabled .article-grid,
  .encyclopedia-images-enabled .resource-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:480px){
  .encyclopedia-images-enabled .encyclopedia-grid,
  .encyclopedia-images-enabled .entry-grid,
  .encyclopedia-images-enabled .article-grid,
  .encyclopedia-images-enabled .resource-grid{
    grid-template-columns:1fr;
  }
}


/* v17.10.8 — Admin dashboard cleanup */
.admin-dashboard-cleanup-enabled .admin-cleanup-summary{
  margin:0 0 1rem;
  padding:.8rem 1rem;
  border:1px solid rgba(88,166,255,.28);
  border-radius:10px;
  background:rgba(34,92,150,.10);
  color:#b9d9f6;
  font-size:.78rem;
}

.admin-dashboard-cleanup-enabled .admin-card,
.admin-dashboard-cleanup-enabled .dashboard-card,
.admin-dashboard-cleanup-enabled .admin-dashboard-card,
.admin-dashboard-cleanup-enabled .admin-tile,
.admin-dashboard-cleanup-enabled .dashboard-tile{
  transition:opacity .14s ease,transform .14s ease;
}

.admin-dashboard-cleanup-enabled [data-admin-cleanup-removed="true"]{
  display:none !important;
}
