/* 全部游戏 (home-library.mjs): a stage over a wheel of every cover. The hall's hero and shelves step aside while it is
   open. The stage is the hero's night panel; its cover is the chosen game's own (game-collection.css draws it), and
   its key is the hero's light key. The wheel holds the chosen cover in the middle, ringed in ink; the others rest a
   step smaller and dimmer. Motion keeps to 70ms press, 180ms state and 240ms entrance; reduced motion moves nothing. */
.home-page .home-library[hidden],body.home-page[data-hall-view=all] :is(.home-intro,.home-continue,.home-shelves,.early-award){display:none!important}
.home-page .home-library{--tile:176px;display:flex;flex-direction:column;gap:16px;min-width:0;margin:20px 0 32px}

/* The way in: a quiet key at the end of the first tier's heading, after its arrows. */
.home-shelf-tools>.home-all-games{order:1;display:inline-flex;align-items:center;gap:8px;min-height:36px;margin-left:8px;padding:0 14px 0 11px;border-radius:18px;background:var(--home-control-bg);color:#d4d4d4;font:500 14px/20px var(--sans);white-space:nowrap;transition:background-color 180ms cubic-bezier(.2,.8,.2,1),color 180ms cubic-bezier(.2,.8,.2,1)}
.home-shelf-tools>.home-all-games svg{width:16px;height:16px;fill:currentColor;stroke:none}
.home-shelf-tools>.home-all-games:active{transform:translateY(1px);transition-duration:70ms}
.home-shelf-tools>.home-all-games:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media(hover:hover){.home-shelf-tools>.home-all-games:hover{background:var(--home-control-hover);color:#ededed}}

/* The bar: back, the view's name and how many, the two steps. */
.home-library-head{display:flex;align-items:center;gap:12px;min-height:44px;min-width:0}
.home-library-back{display:inline-flex;align-items:center;gap:4px;flex:none;min-height:44px;margin:0;padding:0 14px 0 8px;border:0;border-radius:12px;background:var(--home-control-bg);color:#d4d4d4;font:500 15px/20px var(--sans);cursor:pointer;transition:background-color 180ms cubic-bezier(.2,.8,.2,1)}
.home-library-back svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.home-library-back:active{transform:translateY(1px);transition-duration:70ms}
.home-library-head h2{margin:0;min-width:0;color:var(--ink);font:600 24px/32px var(--sans);letter-spacing:-.02em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.home-library-head h2:is(:lang(zh),:lang(ja),:lang(ko)){letter-spacing:0}
.home-library-count{flex:none;color:var(--mute);font:400 15px/20px var(--sans);font-variant-numeric:tabular-nums}
.home-library-steps{display:flex;gap:6px;flex:none;margin-left:auto}

/* The stage: the chosen game, large. */
.home-library-stage{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);align-items:center;gap:40px;min-width:0;padding:28px;border-radius:24px;background:#0f0f0f}
.home-library-cover{min-width:0}
.home-page .home-library-cover .card-art{width:100%;border-radius:16px;--art-h:80%}
.home-page .home-library-cover .card-art[data-enter]{animation:home-library-enter 240ms cubic-bezier(.22,1,.36,1)}
@keyframes home-library-enter{from{opacity:0;transform:translateY(6px)}}
.home-library-info{display:flex;flex-direction:column;align-items:flex-start;gap:12px;min-width:0}
.home-library-info h3{margin:0;max-width:100%;color:var(--ink);font:600 44px/52px var(--sans);letter-spacing:-.03em;overflow-wrap:anywhere}
.home-library-info h3:is(:lang(zh),:lang(ja),:lang(ko)){letter-spacing:0}
.home-library-meta{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;margin:0;color:var(--mute);font:400 16px/24px var(--sans)}
.home-library-meta>span:not(:last-child)::after{content:'';display:inline-block;width:4px;height:4px;margin:0 0 0 14px;border-radius:50%;background:#555;vertical-align:middle} /* the dot ends a line that wraps, never starts one */
.home-library-meta>.home-library-new{color:var(--ink)}
.home-page .home-library-play{margin-top:20px}
.home-library-position{margin:4px 0 0;color:var(--soft);font:400 14px/20px var(--sans);font-variant-numeric:tabular-nums}

/* The wheel: every cover in a row that scrolls sideways, room on both sides so the first and last can come to the
   middle too. No scrollbar; keys, a wheel, a trackpad and a swipe move it. */
.home-library-wheel{position:relative;display:flex;gap:14px; /* positioned: a cover's offsetLeft is measured in the wheel (home-library.mjs centres it) */min-width:0;margin:0 -10px;padding:14px max(10px,calc(50% - var(--tile) / 2)) 16px;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;scrollbar-width:none}
.home-library-wheel::-webkit-scrollbar{display:none}
.home-library-tile{flex:none;width:var(--tile);margin:0;padding:0;border:0;border-radius:12px;background:none;cursor:pointer;scroll-snap-align:center;touch-action:manipulation;-webkit-tap-highlight-color:transparent;opacity:.5;transform:scale(.9);transition:opacity 180ms cubic-bezier(.2,.8,.2,1),transform 240ms cubic-bezier(.22,1,.36,1)}
.home-page .home-library-tile .card-art{width:100%;border-radius:12px;outline:0 solid transparent;outline-offset:4px;transition:outline-color 180ms cubic-bezier(.2,.8,.2,1)}
.home-library-tile[aria-selected=true]{opacity:1;transform:none}
.home-page .home-library-tile[aria-selected=true] .card-art{outline:2px solid #8d8d8d}
.home-library-tile:focus{outline:none}
.home-page .home-library-tile[aria-selected=true]:focus-visible .card-art{outline:3px solid var(--ink)} /* where the keys are: the ring in full ink */
.home-library-tile:active{transform:scale(.97);transition-duration:70ms}
.home-library-tile[aria-selected=true]:active{transform:scale(.985)}
@media(hover:hover){
 .home-library-back:hover{background:var(--home-control-hover);color:#ededed}
 .home-library-tile:not([aria-selected=true]):hover{opacity:.85}
}
.home-library-back:focus-visible,.home-library-steps .shelf-arrow:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* A narrower column: the cover over its words. */
@container home-main (width <= 900px){
 .home-library-stage{grid-template-columns:minmax(0,1fr);gap:20px;padding:20px}
 .home-library-info h3{font-size:34px;line-height:42px}
 .home-page .home-library-play{margin-top:8px}
 .home-page .home-library{--tile:150px}
}
@media(max-width:760px){
 .home-page .home-library{--tile:132px;gap:12px;margin-top:12px}
 .home-library-head h2{font-size:20px;line-height:28px}
 .home-library-steps{display:none} /* a phone swipes */
 .home-library-stage{padding:14px;border-radius:20px}
 .home-library-info h3{font-size:28px;line-height:36px}
 .home-shelf-tools>.home-all-games>span{display:none} /* the grid alone; its name stays its accessible name */
 .home-library-meta{font-size:15px}
 .home-library-wheel{gap:10px;margin-inline:calc(-1 * var(--shelf-gutter,16px));padding-inline:max(var(--shelf-gutter,16px),calc(50% - var(--tile) / 2));scroll-snap-type:x mandatory}
}
@media(prefers-reduced-motion:reduce){
 .home-library-tile,.home-page .home-library-tile .card-art,.home-library-back{transition:none}
 .home-page .home-library-cover .card-art[data-enter]{animation:none}
}
@media(forced-colors:active){
 .home-page .home-library-tile[aria-selected=true] .card-art{outline:3px solid Highlight}
 .home-library-stage{outline:1px solid CanvasText}
}
