@font-face {

    font-family: 'sstroman';
    src: url('../content/fonts/SSTRg.TTF') format('truetype');

}

@font-face {

    font-family: 'sstlight';
    src: url('../content/fonts/SSTLight.TTF') format('truetype');

}

@font-face {

    font-family: 'sstmedium';
    src: url('../content/fonts/SSTMedium.TTF') format('truetype');

}

@font-face {

    font-family: 'sstbold';
    src: url('../content/fonts/SSTBold.TTF') format('truetype');

}

* {

    -ms-overflow-style: none;  /* Internet Explorer 10+ */
    scrollbar-width: none;  /* Firefox, Safari 18.2+, Chromium 121+ */

}

html {

    overflow: hidden;

}

body {

    margin: 0;
    padding: 0;
    overflow: hidden;

    background: #000;
    color: #fff;
    font-family: "sstroman", sans-serif;

}

/* ---------- backgrounds: two layers that crossfade ---------- */

.bg {

    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;          /* the real visible height on phones */
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;       /* same behavior as background-size: cover */
    z-index: -1;
    pointer-events: none;

    opacity: 0;
    transition: opacity 0.7s ease;

}

.bg.show { opacity: 1; }

/* tint used when a game has no background of its own */

.tint {

    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-color: transparent;
    opacity: 0.45;
    -webkit-mask-image: radial-gradient(ellipse at 25% 35%, #000 0%, transparent 75%);
    mask-image: radial-gradient(ellipse at 25% 35%, #000 0%, transparent 75%);
    transition: background-color 0.9s ease;

}

body.party .bg {

    animation: party 3s linear infinite;

}

@keyframes party {

    from { filter: hue-rotate(0deg) saturate(3); }
    to   { filter: hue-rotate(360deg) saturate(3); }

}

/* ---------- layout ---------- */

.ps5-dashboard {

    width: 100vw;
    height: 100vh;
    height: 100dvh;

    display: grid;


    grid-template-rows:

        minmax(6.1vw, 11vh)
        minmax(12.5vw, 18vh)
        1fr;

    grid-template-columns: minmax(0, 1fr);   /* the important line */

    overflow: clip;          /* like hidden, but doesn't break the sticky top bar */

}

/* ---------- top bar ---------- */

.top-bar {

    position: sticky;        /* follows the top of the screen when the page scrolls */
    top: 0;

    display: flex;
    align-items: center;

    z-index: 2;

    margin-top: -0.21vw;

}

.top-bar::before {

    content: "";
    position: fixed;         /* covers the top of the screen, not just the bar */
    top: 0;
    left: 0;
    width: 100%;
    height: 160vh;           /* extends a bit below the bar so the fade is soft */
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.35) 0%,
        rgba(0, 0, 0, 0) 100%
    );
    pointer-events: none;
    z-index: -1;             /* behind the text, above the video/background */

}

.tabs {

    display: flex;
    gap: clamp(3.5vh, 4vw, 4vw);

}


.tabs p {

    position: relative;
    left: clamp(4vh, 4.8vw, 4.8vw);

    font-family: "sstlight";

    font-size: clamp(
        1.90vw,
        3.43vh,
        3.43vh
    );

    color: #b6b6b6;

    cursor: pointer;
    -webkit-tap-highlight-color: transparent;

    transition:
        color 0.1s ease,
        transform 0.1s ease;

}


.tabs p::after {

    content: attr(data-text);
    position: absolute;
    inset: 0;

    font-family: "sstbold";
    color: rgb(255, 255, 255);

    font-size: clamp(
        1.90vw,
        3.30vh,
        3.30vh
    );

    opacity: 0;
    transition: opacity 0.2s ease;

}


.tabs p:hover,
.tabs p.active {

    color: transparent;
    transform: scale(1.05);

}

.tabs p:hover::after,
.tabs p.active::after {

    opacity: 1;

}

.hour {

    margin-left: auto;
    margin-right: clamp(3vh, 4.6vw, 4.6vw);
    display: flex;
    align-items: center;
    gap: 1.5vw;

}


.hour p {

    margin: 0;

    font-family: "sstlight";

    font-size: clamp(
        1.90vw,
        3.43vh,
        3.43vh
    );

    color: #ffffff;
    cursor: pointer;

}

.hour p .seconds {

    display: inline-block;
    vertical-align: top;      /* fixes the baseline shift */
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;      /* prevents wrapping while max-width is small */
    transition:
        opacity 0.3s ease,
        max-width 0.3s ease;

}

.hour p:hover .seconds,
.hour p.active .seconds,
.hour p.always-seconds .seconds {

    opacity: 1;
    max-width: 3ch;

}

.hour p .digit {

    display: inline-block;
    width: 1ch;            /* every digit takes the width of a "0" */
    text-align: center;

}

.tools {

    display: flex;
    align-items: center;
    position: absolute;
    margin-top: 0.5vh;

    margin-left: auto;
    right: clamp(27vw, 40vh, 40vh);

    gap: clamp(2vh, 2vw, 2vw);

    width: clamp(
        2vw,
        3.5vh,
        3.5vh
    );


    filter: invert(100%) sepia(4%) saturate(96%) hue-rotate(260deg) brightness(113%) contrast(88%);

    transition:
        color 0.2s ease,
        transform 0.2s ease;

}

/* too little room: the clock disappears and the tools take the place on the right (see checkTools in app.js) */
.top-bar.no-clock .hour { display: none; }
.top-bar.no-clock .tools { right: clamp(10vw, 14vh, 14vh); }

.tools.hidden {

    visibility: hidden;   /* not display:none, so we can still measure it */
    opacity: 0;
    transition: opacity 0.2s ease;

}

.tools img {

    cursor: pointer;
    -webkit-tap-highlight-color: transparent;

    transition: transform 0.1s ease;

}

.tools img:hover,
.tools img.active {

    transform: scale(1.20);

}

/* ---------- carousel ---------- */

.main-content {

    position: relative;
    z-index: 2;

}

.carousel {

    --small: 50cqh;      /* unselected tile size */
    --large: 76cqh;      /* selected tile size */
    --gap: clamp(1.6vh, 0.5vw, 12vw);

    container-type: size;

    display: flex;
    align-items: center;

    padding-left: clamp(8vh, 8.5vw, 8.5vw);   /* same left offset as your tabs */
    height: 100%;
    touch-action: pan-y;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform-origin: left center;

}


.carousel-track {

    display: flex;
    align-items: flex-start;
    gap: var(--gap);
    height: var(--large);

    transform: translateX(calc(var(--i, 0) * (var(--small) + var(--gap)) * -1));
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);

}

.carousel.unfocused {

    opacity: 0.4;
    transform: scale(0.8);

}

.game {

    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    position: relative;
    flex: 0 0 auto;
    width: var(--small);
    height: var(--small);

    background-color: #222;
    background-size: cover;
    background-position: center;
    border-radius: clamp(2vh, 1vw, 1vw);

    cursor: pointer;
    opacity: 0.92;

    outline: 0.3vh solid transparent;
    outline-offset: 0.5vh;

    transition:
        width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
        height 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
        opacity 0.35s ease,
        outline-color 0.3s ease,
        box-shadow 0.3s ease;

}

.game.active {

    width: var(--large);
    height: var(--large);
    opacity: 1;

    outline: 0.3vh solid #fff;
    outline-offset: 0.5vh;
    box-shadow: 0 0 3vh rgba(255, 255, 255, 0.25);

}

.carousel.cards-active .game.active {

    outline-color: transparent;
    box-shadow: none;

}

.game .title {

    position: absolute;
    top: 73%;
    left: calc(100% + 2.5vh);
    white-space: normal;
    max-width: calc(50cqw - var(--large) / 2 - 4vh);
    line-height: 1.15;
    width: max-content;

    font-family: "sstbold";
    font-size: clamp(1.90vw, 3.30vh, 3.30vh);
    color: #fff;

    opacity: 0;
    transform: translate(-1vh, 0);
    transition: opacity 0.18s ease, transform 0.25s ease;

}

.game.active .title {

    opacity: 1;
    transform: translate(0, 0);

}


/* ============================================================
   STORE (the tile before Welcome: add your own games)
   ============================================================ */

button.play-btn { border: none; font-family: "sstbold"; }

/* a game added without a picture shows its first letter */

.game .initial {

    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-family: "sstbold";
    font-size: 5vh;
    color: #fff;
    opacity: 0.85;
    transition: font-size 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none;

}

.game.active .initial { font-size: 9vh; }

/* the "Add a game" window */

.store-form {

    display: flex;
    flex-direction: column;
    gap: 0.7em;

}

.store-form .row { margin: 0; background: rgba(255, 255, 255, 0.08); }



.store-submit {

    padding: 0.8em 1.2em;
    border: 0.2vh solid transparent;
    border-radius: 0.6em;
    outline: none;
    background: #4f7cff;
    color: #fff;
    font: inherit;
    cursor: pointer;

}

.store-submit.active,
.store-submit:focus-visible { border-color: #fff; }



.store-sub {

    margin: 2vh 0 0;
    font-family: "sstbold";
    font-weight: normal;
    font-size: 1.1em;

}

/* ============================================================
   BOTTOM BAR
   .bottom-bar is just a container. Each game in the carousel can
   name a panel (game.panel in the JS); the matching .bar-panel is
   shown and every other one is hidden. To add a new layout:
   1. add <section class="bar-panel panel-xxx" data-panel="xxx">
   2. style it with .panel-xxx
   3. set panel: "xxx" on a game in the carousel
   ============================================================ */

.bottom-bar {

    position: relative;
    z-index: 2;
    min-height: 0;

}

.bar-panel {

    position: absolute;
    inset: 0;

    padding: clamp(8vh, 8.5vw, 8.5vw);
    padding-bottom: clamp(7vw, 3vh, 3vh);
    padding-top: clamp(4vw, 13vh, 13vh);

    box-sizing: border-box;
    transform-origin: center;
    overflow: hidden;

    font-size: clamp(
        0.7vw,
        2vh,
        2vh
    );

    /* hidden by default; kept in layout (visibility, not display) so it can still be measured */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(3vh);

    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        visibility 0s linear 0.3s;   /* wait for the fade-out before hiding */

}

.bar-panel.visible {

    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;

    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        visibility 0s;

}

.bar-panel.visible.unfocused {

    opacity: 0.4;
    transform: scale(0.8);

}

.bar-panel .card {

    outline: 0.3vh solid transparent;
    outline-offset: 0.5vh;
    cursor: pointer;

    transition:
        transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
        box-shadow 0.3s ease,
        outline-color 0.3s ease;

}

.bar-panel .card.active {

    transform: scale(1.03);
    outline-color: #fff;
    box-shadow: 0 0 3vh rgba(255, 255, 255, 0.25);
    z-index: 1;

}

/* ---------- cards ---------- */

/* the title sits on top and the body fills the rest, so they can never overlap.
   the card is a size container: its text shrinks when the card gets short
   (e.g. very wide screens), instead of spilling out */

.card {

    position: relative;
    display: flex;
    flex-direction: column;
    container-type: size;

    background: rgba(0, 0, 0, 0.707);
    backdrop-filter: blur(1vh);

    border-radius: clamp(0.7vh, 0.5vw, 0.5vw);
    overflow: hidden;

}

.card,
.card * {

    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;

}

.card > * {

    font-size: min(1em, 13cqh);

}

.bottom-titles {

    position: relative;
    z-index: 1;              /* floats over the catalog / gallery images */
    flex: 0 0 auto;
    margin: 0;
    padding: 0.6em 0.9em 0;
    color: #ffffff;
    font-family: "sstroman";
    pointer-events: none;

}

.catalog p:first-child { 

    height: 4vh; 
    width: clamp(7vw, 13.4vh, 13.4vh);  
    border-radius: 0 0.3vh 1vh 0.3vh; 
    background: rgba(0, 0, 0, 0.48);

}

.gallery p:first-child {

    height: 4vh; 
    width: clamp(3vw, 7vh, 7vh);  
    border-radius: 0 0.3vh 1vh 0.3vh; 
    background: rgba(0, 0, 0, 0.68);

}

.card-body {

    flex: 1;
    min-height: 0;
    padding: 0.3em 1em 0.8em;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    justify-content: safe flex-end;   /* if it doesn't fit, cut the bottom instead of covering the title */
    gap: 0.35em;
    overflow: hidden;

}

.card-body p { margin: 0; }

.card-body.row-body {

    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    align-content: flex-end;
    align-content: safe flex-end;
    column-gap: 0.8em;

}

.muted { color: #a8a8a8; font-size: 0.85em; }

.big {

    font-family: "sstbold";
    font-size: 2em;
    line-height: 1.05;

}

.big small { font-family: "sstlight"; font-size: 0.55em; color: #aaa; }

.bar {

    height: 0.4em;
    border-radius: 1em;
    background: rgba(255, 255, 255, 0.15);
    overflow: hidden;

}

.bar-fill {

    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #4f7cff, #9fb7ff);
    transition: width 0.8s ease;

}

/* ---------- panel: welcome (3 columns) ---------- */

.panel-welcome {

    display: grid;
    grid-template-columns: repeat(3, minmax(30vh, 1fr));
    grid-template-rows: repeat(3, minmax(12vh, 1fr));
    gap: clamp(1.2vh, 0.7vw, 0.7vw);
    margin-top: clamp(-17vw, -5vh, -5vh);
    padding-bottom: clamp(9vh, 5vw, 5vw);

}

/* column 1 */

.panel-welcome .trophies   { grid-column: 1; grid-row: 1; }
.panel-welcome .controller { grid-column: 1; grid-row: 2; }
.panel-welcome .storage    { grid-column: 1; grid-row: 3; }

/* column 2 */

.panel-welcome .catalog    { grid-column: 2; grid-row: 1 / span 2; }
.panel-welcome .news       { grid-column: 2; grid-row: 3; }

/* column 3 */

.panel-welcome .wishlist   { grid-column: 3; grid-row: 1; }
.panel-welcome .gallery    { grid-column: 3; grid-row: 2 / span 2; }

/* slideshow images (catalog + gallery): stacked, one visible at a time */

.catalog-images,
.gallery-images {

    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;

    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;

}

.catalog-images.current {

    opacity: 0.75;

}


.gallery-images.current {

    opacity: 0.80;

}

.catalog,
.gallery { 
    
    backdrop-filter: none; 

}

.gallery-empty {

    position: absolute;
    left: 1em;
    bottom: 1em;
    margin: 0;
    display: none;

}

.gallery.empty .gallery-empty { display: block; }

.weather-icon { font-size: 2.4em; line-height: 1; }

.greeting { flex-basis: 100%; }

.wish-preview {

    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.9em;

}

.wish-preview li {

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0.1em 0;

}

.wish-preview li:not(.muted)::before { 
    
    content: "· "; 
    color: #e4e4e4; 

}

/* image: content/images/controller.png */

.pad-icon {

    width: 3.5em;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease, filter 0.3s ease;

}

.controller.connected .pad-icon { opacity: 1; filter: drop-shadow(0 0 0.5em #4f9dff); }

/* ---------- panel: game (Play button + info) ---------- */

.panel-game {

    display: flex;
    flex-direction: column;
    gap: 3vh;

}

.game-actions {

    display: flex;
    align-items: center;
    gap: 2.5vh;

}

.play-btn {

    display: inline-flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.65em 2.8em 0.65em 2.8em;
    border-radius: 3em;
    background: rgba(255, 255, 255, 0.7);
    color: #000;
    font-family: "sstbold";
    font-size: 1.5em;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;

    outline: 0.3vh solid transparent;
    outline-offset: 0.5vh;
    transition:
        transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
        outline-color 0.25s ease,
        box-shadow 0.25s ease;

}


.play-btn:hover,
.play-btn.active {

    transform: scale(1.06);
    outline-color: #fff;
    box-shadow: 0 0 3vh rgba(255, 255, 255, 0.35);

}

.game-status {

    margin: 0;
    color: #ddd;

}

.game-info {

    display: grid;
    grid-template-columns: repeat(3, minmax(28vh, 1fr));
    gap: clamp(1.2vh, 0.7vw, 0.7vw);
    height: clamp(14vh, 20vh, 24vh);

}

.panel-game .card { cursor: default; }

.info-card .host {

    font-family: "sstmedium";
    font-size: 1.15em;
    word-break: break-all;

}

/* the panel's contents slide in again when another game is selected */

.panel-game.swap .game-actions,
.panel-game.swap .game-info {

    animation: swapIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;

}

.panel-game.swap .game-info { animation-delay: 0.05s; }

@keyframes swapIn {

    from { opacity: 0; transform: translateY(1.5vh); }

}

.dot {

    display: inline-block;
    width: 0.6em;
    height: 0.6em;
    margin-right: 0.5em;
    border-radius: 50%;
    background: #999;
    vertical-align: 0.05em;

}

.dot.on  { background: #3ddc84; box-shadow: 0 0 0.6em #3ddc84; }
.dot.off { background: #ff5a5a; }
.dot.web { background: #4f9dff; }

/* ============================================================
   STACKED (narrow screens)
   When the 3 columns no longer fit side by side, the cards stack
   in a single column and the whole page scrolls vertically, with
   snapping. The top bar stays stuck to the top of the screen.
   Keep this query in sync with stackedMQ in app.js.
   ============================================================ */

@media (max-aspect-ratio: 1103/1000) {

    html {

        overflow-x: hidden;
        overflow-y: auto;
        scroll-snap-type: y mandatory;
        scroll-padding-top: 12vh;   /* cards snap just below the top bar */

    }

    body { overflow: visible; }

    .ps5-dashboard {

        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        scroll-snap-align: start;   /* snap point to get back to the carousel */

    }

    .top-bar {

        z-index: 3;              /* above the cards that scroll under it */
        background: rgba(0, 0, 0, 0.62);
        border-radius: 0 0 4vh 4vh;
        backdrop-filter: blur(1.5vh);
        -webkit-backdrop-filter: blur(1.5vh);
        height: clamp(10vh, 10vh, 20vw);

    }

    .top-bar::before { display: none; }

    .bottom-bar { display: grid; }

    .bar-panel {

        position: relative;
        inset: auto;
        grid-area: 1 / 1;
        margin-top: 0;
        padding: 2vh 4vh 6vh;
        overflow: visible;
        transform-origin: top center;

    }

    /* only the visible panel takes space, so the page is as long as its cards */
    .bar-panel:not(.visible) { display: none; }

    @starting-style {

        .bar-panel.visible { opacity: 0; transform: translateY(3vh); }

    }

    .panel-welcome {

        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: none;
        grid-auto-rows: 16vh;
        gap: 1.2vh;

    }

    .panel-welcome .card {

        grid-column: 1;
        grid-row: auto;

    }

    .panel-welcome .catalog,
    .panel-welcome .gallery {

        grid-row: span 2;

    }

    .bar-panel .card,
    .game-actions {

        scroll-snap-align: start;

    }

    .game-info {

        grid-template-columns: minmax(0, 1fr);
        grid-auto-rows: 16vh;
        gap: 1.2vh;
        height: auto;

    }

}

/* ---------- boot screen ---------- */

.boot {

    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2vh;
    background: radial-gradient(circle at center, rgba(20, 30, 60, 0.85), rgba(0, 0, 0, 0.97) 70%);
    backdrop-filter: blur(2vh);
    -webkit-backdrop-filter: blur(2vh);
    cursor: pointer;
    transition: opacity 0.8s ease, transform 0.8s ease;

}

.boot.gone {

    opacity: 0;
    transform: scale(1.08);
    pointer-events: none;

}

.boot-logo {

    margin: 0;
    font-family: "sstbold";
    font-size: clamp(6vh, 8vw, 14vh);
    letter-spacing: 0.05em;
    background: linear-gradient(90deg, #fff, #9fb7ff, #fff);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: pulse 2s ease-in-out infinite;

}

@keyframes pulse { 50% { opacity: 0.9; } }

/* ---------- modals (sized with vw / vh only) ---------- */

.modal {

    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(1.2vh);
    -webkit-backdrop-filter: blur(1.2vh);

}

.modal.open {

    display: flex;
    animation: modalIn 0.2s ease;

}

.modal.open .panel { animation: panelIn 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }

@keyframes modalIn { from { opacity: 0; } }
@keyframes panelIn { from { transform: translateY(2vh) scale(0.97); } }

.panel {

    width: min(92vw, 70vh);
    height: 72vh;
    display: flex;
    flex-direction: column;
    padding: 2.4vh;
    box-sizing: border-box;
    border-radius: 1.4vh;
    background: rgba(18, 18, 22, 0.92);
    border: 0.1vh solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2vh 6vh rgba(0, 0, 0, 0.6);
    font-size: clamp(2vh, 1.2vw, 2.6vh);
    overflow-y: scroll;


}

.panel h2 {

    margin: 0 0 1.6vh;
    font-family: "sstbold";
    font-weight: normal;
    font-size: 1.5em;

}

.panel input[type=text] {

    width: 100%;
    box-sizing: border-box;
    padding: 0.7em 0.9em;
    border: 0.2vh solid transparent;
    border-radius: 0.6em;
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font: inherit;
    font-size: 1.1em;

}

.panel input[type=text]:focus,
.panel input[type=text].active { border-color: #fff; }

.list {

    margin: 1.2vh 0 0;
    padding: 0;
    list-style: none;
    overflow-y: auto;

}

.list .empty { padding: 1em; text-align: center; }

.row {

    display: flex;
    align-items: center;
    gap: 0.9em;
    width: 100%;
    box-sizing: border-box;
    margin: 0.15em 0;
    padding: 0.7em 0.9em;
    border: 0.2vh solid transparent;
    border-radius: 0.6em;
    outline: none;
    background: transparent;
    color: #fff;
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;

}

.row:hover { background: rgba(255, 255, 255, 0.06); }

.row.active,
.row:focus-visible {

    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;

}

.row > span:first-child { flex: 1; }

.row .grow { flex: 1; min-width: 0; }

.row small { color: #a8a8a8; }

.row .arrow { color: #888; font-size: 1.2em; }

.row.danger { color: #ff8080; }

.row img {

    width: 2.6em;
    height: 2.6em;
    flex: 0 0 auto;
    border-radius: 0.5em;
    object-fit: cover;
    background: #222;

}

.switch {

    flex: 0 0 auto !important;
    position: relative;
    width: 2.6em;
    height: 1.4em;
    border-radius: 1em;
    background: #444;
    transition: background 0.2s ease;

}

.switch::after {

    content: "";
    position: absolute;
    top: 0.2em;
    left: 0.2em;
    width: 1em;
    height: 1em;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s ease;

}

.row.on .switch { background: #4f7cff; }

.row.on .switch::after { transform: translateX(1.2em); }

.row input[type=range] {

    flex: 0 0 40%;
    accent-color: #4f7cff;

}

.trophy .grade { font-size: 1.6em; }

.trophy.locked { opacity: 0.45; }

.wish-form { display: flex; gap: 0.6em; }

.wish-form button {

    padding: 0 1.2em;
    border: none;
    border-radius: 0.6em;
    background: #4f7cff;
    color: #fff;
    font: inherit;
    cursor: pointer;

}

.keys {

    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.2vh;

}

.keys th,
.keys td {

    padding: 0.55em 0.4em;
    text-align: left;
    border-bottom: 0.1vh solid rgba(255, 255, 255, 0.08);

}

.keys th { color: #a8a8a8; font-family: "sstlight"; font-weight: normal; }

/* ---------- toasts ---------- */

.toasts {

    position: fixed;
    top: 12vh;
    right: 2.4vw;
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 1vh;
    pointer-events: none;
    font-size: clamp(13px, 1.9vh, 18px);

}

.toast {

    display: flex;
    align-items: center;
    gap: 0.9em;
    min-width: 16em;
    padding: 0.9em 1.2em;
    border-radius: 0.8em;
    background: rgba(20, 20, 26, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 1vh 3vh rgba(0, 0, 0, 0.5);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.35s ease;

}

.toast.show { transform: none; opacity: 1; }

/* text color of the notifications: --toast-title is the first line, --toast-detail the second */
.toast-text {

    --toast-title: #ffffff;
    --toast-detail: #b0b0b0;

    color: var(--toast-title);

}

.toast-text small { color: var(--toast-detail); }

.toast-icon { font-size: 1.8em; }

@media (prefers-reduced-motion: reduce) {

    .boot-logo,
    body.party .bg { animation: none; }

}

/* >>> IPOD PLUGIN: START <<<
   To remove the iPod, delete everything between the START and END markers.
   (Also see the markers in index.html and app.js.)
   ============================================================
   iPod (iframe, bottom right corner)
   The iframe is exactly the size of the iPod (421 x 708 ratio) so
   it never blocks clicks on the dashboard around it.
   ============================================================ */

.ipod-dock {

    --h: min(47vh, 140vw);              /* height of the iPod on screen: change this one value to resize it */

    position: fixed;
    right: 2vh;
    bottom: 2vh;
    z-index: 40;
    height: var(--h);
    width: calc(var(--h) * var(--aspect, 0.5946));   /* 421 : 708, the shape of the iPod page (wider while lyrics are showing) */
    max-width: 96vw;
    overflow: hidden;                   /* the iframe inside is bigger before it is scaled down */
    filter: drop-shadow(0 1.5vh 3vh rgba(0, 0, 0, 0.55));

    visibility: hidden;
    pointer-events: none;
    transform: translateY(calc(100% + 3vh));   /* closed: below the bottom edge of the screen */

    transition:
        transform 0.35s cubic-bezier(0.5, 0, 0.9, 0.4),
        width 0.3s ease,
        visibility 0s linear 0.35s;             /* hidden once it has left the screen */

}

.ipod-dock.open {

    visibility: visible;
    pointer-events: auto;
    transform: none;

    transition:
        transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
        width 0.3s ease,
        visibility 0s;

}

/* the iPod page shows lyrics beside the iPod: the frame is 809 wide instead of 421 (the iPod keeps its size) */
.ipod-dock.lyrics {

    --aspect: 1.1427;

}

.ipod-dock iframe {

    /* the iPod page is always shown at its own size (421 x 708) and scaled to the dock by app.js */
    position: absolute;
    bottom: 0;
    left: 0;
    display: block;
    width: 421px;
    height: 708px;
    transform-origin: bottom left;
    border: 0;
    background: transparent;
    color-scheme: normal;

}

/* phones: about 70% of the screen width, clear of the system bar at the bottom */
@media (max-width: 700px) {

    .ipod-dock {

        --h: min(56vh, 118vw);

        right: 3vw;
        bottom: calc(2vh + env(safe-area-inset-bottom, 0px));

    }

}

/* touch screens: a small handle above the iPod to close it (hidden with a mouse) */
.ipod-handle {

    display: none;
    position: absolute;
    top: -5.5vh;
    left: 50%;
    transform: translateX(-50%);
    width: 44vw;
    height: 5.5vh;
    padding: 0;
    border: 0;
    background: transparent;
    -webkit-tap-highlight-color: transparent;

}

.ipod-handle::before {

    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 16vw;
    height: 0.8vh;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 1.2vh rgba(0, 0, 0, 0.45);
    transform: translate(-50%, -50%);

}

@media (pointer: coarse) { .ipod-handle { display: block; } }

/* >>> IPOD PLUGIN: END <<< */

/* ============================================================
   Light theme (Settings > Light theme adds the "light" class to <html>)
   ============================================================ */

.light body { 
    
    background: #eceef4; 
    color: #14161c; 

}

/* a lighter wash over the backgrounds */

.light .bg { filter: brightness(1.18) saturate(0.85); }

/* top bar */

.light .top-bar::before { 
    
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.425) 0%, rgba(255, 255, 255, 0) 100%); 

}

.light .tabs p { color: #494949; }

.light .tabs p:hover,
.light .tabs p.active { 
    
    color: transparent; 

}

.light .tabs p::after { color: #14161c; }

.light .hour p { color: #14161c; }

.light .tools { filter: none; }

/* the Welcome tile: its logo is white on a dark tile, so the tile is inverted (light tile, dark logo);
   its outline is set to black so that it comes out white after the inversion */

.light .game.welcome,
.light .game.store { 
    
    background-color: rgba(0, 0, 0, 0.7); 
    filter: invert(1) ;

}   /* black inverts to pure white; brightness whitens a grey baked into the image */

.light .game { 
    
    background-color: rgba(255, 255, 255, 0.8); 
    opacity: 0.92;

}

.light .game.welcome .title,
.light .game.store .title { filter: invert(1); }

.light .game.welcome.active,
.light .game.store.active { 
    
    outline-color: #000000; 
    box-shadow: 0 0 3vh rgba(0, 0, 0, 0.25); 

}

.light .carousel.cards-active .game.welcome.active,
.light .carousel.cards-active .game.store.active { 
    
    outline-color: transparent; 
    box-shadow: none; 

}

.light .store-submit.active,
.light .store-submit:focus-visible { border-color: #20232c; }

.light .store-form .row { background: rgba(0, 0, 0, 0.06); }

.light .game .initial { color: #20232c; }

/* cards */

.light .card { 
    
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0.4vh 1.6vh rgba(0, 0, 0, 0.12);  
    backdrop-filter: blur(0.3vh); 

}


.light .bottom-titles {

    color: #20232c; 

}

.light .bottom-titles::before { 
    
    background: none;

}
.light .catalog p:first-child { 

    background: rgba(255, 255, 255, 0.77);

}


.light .gallery p:first-child { 

    background: rgba(255, 255, 255, 0.77);

}

.light .catalog,
.light .gallery { 
    
    backdrop-filter: none; 

}

.light .catalog-images.current,
.light .gallery-images.current { 
    
    opacity: 0.90 ;

}

.light .card-body { color: #20232c; }

.light .muted { color: #3c3f46; }

.light .wish-preview li:not(.muted)::before { 
    
    content: "· "; 
    color: #202020; 

}

.light .big small { color: #666a75; }

.light .bar { background: rgba(0, 0, 0, 0.12); }

.light .game-status { color: #3c3f46; }

/* start screen */

.light .boot { 
    
    background: radial-gradient(circle at center, rgba(236, 241, 255, 0.92), rgba(250, 251, 255, 0.98) 70%); 

}

.light .boot-logo { 
    
    background: linear-gradient(90deg, #20232c, #4f7cff, #20232c); 
    background-size: 200% 100%; background-clip: text;
    -webkit-background-clip: text; color: transparent; 

}

/* overlays: search, settings, trophies, wishlist, controls */

.light .modal { background: rgba(225, 228, 238, 0.55); }


.light .panel {

    background: rgba(255, 255, 255, 0.95); 
    border-color: rgba(0, 0, 0, 0.1); 
    box-shadow: 0 2vh 6vh rgba(0, 0, 0, 0.25);

}

.light .panel input[type=text] { 

    background: rgba(0, 0, 0, 0.06); 
    color: #20232c; 

}

.light .panel input[type=text]:focus,
.light .panel input[type=text].active { 
    
    border-color: #20232c; 

}

.light .row { color: #20232c; }

.light .row:hover { background: rgba(0, 0, 0, 0.05); }

.light .row.active,
.light .row:focus-visible { 
    
    background: rgba(0, 0, 0, 0.08); 
    border-color: #20232c; 

}

.light .row small { color: #5b5f6a; }

.light .row.danger { color: #d03030; }

.light .row img { background: #ddd; }

.light .switch { background: #b8bcc8; }

.light .row.on .switch { background: #4f7cff; }

.light .keys th,
.light .keys td { border-bottom-color: rgba(0, 0, 0, 0.1); }


.light .keys th { color: #5b5f6a; }

/* notifications */
.light .toasts { color: #20232c; }

.light .toast { 
    
    background: rgba(255, 255, 255, 0.96); 
    border-color: rgba(0, 0, 0, 0.1); 
    box-shadow: 0 1vh 3vh rgba(0, 0, 0, 0.2); 

}

.light .toast small { color: #5b5f6a; }

.light .toast-text { 
    
    --toast-title: #20232c; 
    --toast-detail: #5b5f6a;

}

/* settings rows that show a value (Wallpaper) */

.row .value { 
    
    flex: 0 1 auto; 
    margin-left: auto;
    white-space: nowrap; 
    color: #a8a8a8; }

.light .row .value { color: #5b5f6a; }

/* light theme: the names under the carousel */

.light .game .title { color: #20232c; }

/* no mouse cursor while the controller is being used (it comes back when the mouse moves) */

.pad-mode,
.pad-mode * { cursor: none !important; }

@media (max-aspect-ratio: 1103/1000) {

    .light .top-bar {

        background: rgba(255, 255, 255, 0.62);
        z-index: 3;              /* above the cards that scroll under it */
        border-radius: 0 0 4vh 4vh;
        backdrop-filter: blur(1.5vh);
        -webkit-backdrop-filter: blur(1.5vh);
        height: clamp(10vh, 10vh, 20vw);

    }

}