/* ==========================================================================
   The Nintendo DS shelf (games.html).

   Replaces the old horizontal scroll-snap rows of mixed PC/PS1/PS2/Dreamcast
   thumbnails. The center window keeps its size; only the shelf inside it
   scrolls, so the header, menu, badges, player and footer never move.
   ========================================================================== */

td.windowbody#gamespage {
    height: 420px;
    padding: 0;
    background:
        repeating-linear-gradient(0deg, rgba(255,255,255,.35) 0 1px, transparent 1px 22px),
        linear-gradient(170deg, #cfe6ff 0%, #ded2ff 48%, #ffd9f2 100%);
}

#dsShelf {
    width: 596px;
    max-width: 100%;
    height: 420px;
    box-sizing: border-box;
    padding: 6px 8px 7px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-family: 'W95FA';
}

/* ---- header ------------------------------------------------------------- */

.ds-top { flex: none; display: flex; align-items: center; gap: 8px; }

.ds-heading {
    font-family: '2Credits';
    font-size: 17px;
    color: #d43ea0;
    text-shadow: 1px 1px 0 #fff;
    letter-spacing: 1px;
}

.ds-heading img { width: 16px; vertical-align: -3px; }

.ds-count {
    margin-left: auto;
    font-family: 'ModernDOS';
    font-size: 10px;
    color: #23407a;
    background: #cfe6ff;
    border: 1px solid #fff;
    box-shadow: inset -1px -1px #6f8fc4;
    padding: 1px 6px;
}

/* ---- the scrolling shelf ------------------------------------------------ */

#dsGrid {
    flex: 1;
    min-height: 0;
    overflow-y: auto;          /* only this scrolls -- the page does not */
    overflow-x: hidden;
    padding: 10px;
    background: #fffdf2;
    box-shadow: inset -2px -2px #fff, inset 2px 2px #9a7fd0;

    display: grid;
    grid-template-columns: repeat(2, 1fr);   /* two big covers per row */
    gap: 14px 12px;
    align-content: start;

    scrollbar-width: thin;
    scrollbar-color: #ff9ada #e9dcff;
}

/* Windows-flavoured scrollbar for browsers that still do the old thing */
#dsGrid::-webkit-scrollbar { width: 15px; }
#dsGrid::-webkit-scrollbar-track {
    background: #e9dcff;
    box-shadow: inset 1px 1px #9a7fd0, inset -1px -1px #fff;
}
#dsGrid::-webkit-scrollbar-thumb {
    background: linear-gradient(#ffd6f2, #ff9ada);
    box-shadow: inset -2px -2px #c0338d, inset 2px 2px #fff;
}
#dsGrid::-webkit-scrollbar-thumb:hover { background: linear-gradient(#fff, #ff9ada); }

/* ---- a game card -------------------------------------------------------- */

.ds-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 7px 6px 8px;
    text-decoration: none;
    background: linear-gradient(#fff, #f4ecff);
    box-shadow: inset -2px -2px #b98fd6, inset 2px 2px #fff, 2px 2px 0 rgba(90,40,120,.22);
    cursor: url(../cursor/cur905.gif), pointer;
    transition: transform .12s;
}

.ds-card:hover {
    transform: translateY(-3px);
    background: linear-gradient(#fff, #ffeaf8);
    box-shadow: inset -2px -2px #c0338d, inset 2px 2px #fff, 3px 4px 0 rgba(90,40,120,.3);
}

.ds-card:active { transform: translateY(0); }

.ds-cover {
    width: 100%;
    aspect-ratio: 256 / 230;      /* every cover reads the same size... */
    object-fit: contain;          /* ...without squashing any of them */
    display: block;
    background: #efe8ff;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px #b98fd6, 2px 2px 0 rgba(90,40,120,.3);
}

.ds-card:hover .ds-cover { box-shadow: 0 0 0 1px #ff9ada, 2px 2px 0 rgba(192,51,141,.35); }

.ds-name {
    font-size: 12px;
    line-height: 1.25;
    color: #3d2f6b;
    text-align: center;
    min-height: 30px;
    display: flex;
    align-items: center;
}

.ds-meta {
    font-family: 'ModernDOS';
    font-size: 9px;
    color: #8a7fb0;
    text-align: center;
    min-height: 11px;
}

.ds-meta .ds-tag {
    background: #e9dcff;
    color: #5b4a9c;
    padding: 0 3px;
}

.ds-meta .ds-tag.is-missing { background: #ffe0e0; color: #a3474f; }

.ds-play {
    font-family: 'W95FA';
    font-size: 11px;
    font-weight: bold;
    color: #6b1247;
    background: linear-gradient(#ffd6f2, #ff9ada);
    box-shadow: inset -2px -2px #c0338d, inset 2px 2px #fff, 1px 1px 0 rgba(90,40,120,.35);
    padding: 3px 14px;
    border: none;
    pointer-events: none;          /* the whole card is the link */
}

.ds-card:hover .ds-play { background: linear-gradient(#fff, #ff9ada); }

/* ---- footer ------------------------------------------------------------- */

.ds-foot {
    flex: none;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'ModernDOS';
    font-size: 10px;
    color: #6b5ba8;
}

#dsHint { flex: 1; }

.ds-foot a {
    color: #3d2f6b;
    text-decoration: none;
    background: linear-gradient(#fff, #e9dcff);
    box-shadow: inset -2px -2px #9a7fd0, inset 2px 2px #fff;
    padding: 2px 7px;
}

.ds-foot a:hover { color: #d43ea0; }
.ds-foot a img { width: 13px; vertical-align: -3px; }

/* three across if the window is ever given more room */
@media (min-width: 900px) {
    #dsShelf { width: 100%; }
    #dsGrid { grid-template-columns: repeat(3, 1fr); }
}
