/* Front page / game library in the 2014 Aapeli layout.
   Loaded after classic.css. The selectors are scoped to main.library-home so
   they win over the legacy library.css rules for the same class names. */

main.library-home [hidden]{display:none!important}

/* ---------- catalogue box (right column) ---------- */
main.library-home #game-search{width:150px;max-width:40vw;height:20px;box-sizing:border-box}

/* search sits above the category boxes; the box title holds the two tabs */
main.library-home .catalogue-search{margin:2px 0 0 10px}
main.library-home .games-box>.title ul.tabs{padding-left:10px}

/* one 630px inner box per category, stacked, as on the 2014 games page */
main.library-home .categories{display:block;margin:0;padding:0;border:0;background:none}
main.library-home .category{margin:10px 0 0;overflow:visible}
main.library-home .category:after{display:block}
main.library-home .category>.ibcontent{padding:5px 0 0 13px}

/* game icons: 90x80, six per row, 13px apart, name and players below */
main.library-home .game-grid{display:grid;grid-template-columns:repeat(6,90px);gap:0 13px;padding:0}
main.library-home .game-entry{width:90px;min-width:0;padding:0 0 5px;text-align:center}
main.library-home .game-entry .game,main.library-home .game{display:block;width:90px;min-height:0;padding:0;border:0;border-radius:0;background:none;box-shadow:none;transform:none;transition:none;color:#09f;font:11px/13px tahoma,"dejavu sans condensed",arial,helvetica,sans-serif;text-align:center}
main.library-home .game:hover{background:none;box-shadow:none;transform:none;text-decoration:none}
main.library-home .game:hover strong{text-decoration:underline}
main.library-home .game .gameimg-90x80{display:block;margin:0 0 2px}
main.library-home .game strong{display:block;margin:0;color:#09f;font:bold 11px/13px tahoma,"dejavu sans condensed",arial,helvetica,sans-serif;overflow-wrap:anywhere}
main.library-home .game .player-count{display:block;margin:0;color:#000;font-size:10px;line-height:13px}
main.library-home .game .language-availability{color:#999;font-size:10px;line-height:12px}

main.library-home #game-empty{margin:10px;padding:0;color:#000;text-align:left}

/* ---------- yesterday's most played (left column) ---------- */
main.library-home .top-played-box{margin:0 0 10px}
main.library-home .top-played-games{display:block;min-height:0;margin:0;padding:0 0 0 10px;background:none;counter-reset:rank}
main.library-home .top-played-games .game-entry{display:block;width:auto;padding:0;text-align:left;counter-increment:rank}
main.library-home .top-played-games .game-entry:nth-child(n+7){display:block}
main.library-home .top-played-games .game-entry+.game-entry{border-top:1px solid #d6e9f7}
main.library-home .top-played-games .game{display:grid;grid-template-columns:18px 45px 1fr;grid-auto-rows:min-content;column-gap:8px;width:auto;padding:4px 0;text-align:left;align-content:center;min-height:40px}
main.library-home .top-played-games .game:before{content:counter(rank) ".";grid-column:1;grid-row:1/span 4;align-self:center;color:#369;font:bold 13px/15px tahoma,"dejavu sans condensed",arial,helvetica,sans-serif;text-align:right}
main.library-home .top-played-games .gameimg-90x80{grid-column:2;grid-row:1/span 4;align-self:center;margin:0;zoom:.5}
main.library-home .top-played-games .game>:not(.gameimg-90x80){grid-column:3}
main.library-home .top-played-games .game strong{font-size:11px;line-height:14px}
main.library-home .top-played-games .played-time{display:block;color:#666;font-size:10px;line-height:13px}
/* the long title has to fit the 320px box on one line */
main.library-home .all-time-box .title h2{font-size:15px}
main.library-home .top-played-games.collapsed .game-entry:nth-child(n+6){display:none}
main.library-home .top-played-more{margin:6px 0 0;text-align:right}
main.library-home .top-played-more button.more{display:inline-block;margin:0;padding:0 20px 0 0;border:0;background:url(themes_common_img_icons_15x15_continue.png) no-repeat 100% 50%;color:#09f;font:bold 11px/15px tahoma,"dejavu sans condensed",arial,helvetica,sans-serif;cursor:pointer}
main.library-home .top-played-more button.more:hover{text-decoration:underline}
main.library-home .top-played-box .stats-since{margin:6px 0 0 10px;color:#666;font-size:10px;line-height:13px}
main.library-home .top-played-box .stats-since:empty{display:none}

/* narrow screens: the 310px inner box, three games per row */
@media(max-width:680px){
  main.library-home .category.ib630{width:310px;max-width:100%;margin-left:auto;margin-right:auto;background-image:url(themes_site_playforia_img_innerbox-310-bg.png)}
  main.library-home .category.ib630:before{background-image:url(themes_site_playforia_img_innerbox-310-top.png)}
  main.library-home .category.ib630:after{background-image:url(themes_site_playforia_img_innerbox-310-bottom.png)}
  main.library-home .category>.ibcontent{padding-left:8px}
  main.library-home .game-grid{grid-template-columns:repeat(3,90px);gap:0 11px}
  /* both tabs on one row under the box title */
  main.library-home .games-box>.title ul.tabs{flex:1 0 100%;flex-wrap:nowrap;justify-content:center;padding:0 8px}
  main.library-home .games-box>.title ul.tabs li>button{padding-left:7px;padding-right:7px}
  main.library-home .games-box>.title ul.tabs li.active>button{font-size:11px;font-weight:bold}
}
@media(max-width:360px){
  main.library-home .game-grid{grid-template-columns:repeat(2,90px)}
}

/* no data for the left column: centre the catalogue instead of leaving a gap */
main.library-home .col.c320:not(:has(.box:not([hidden]))){display:none}
main.library-home .col.c320:not(:has(.box:not([hidden])))+.col.c650{margin-inline:auto}
