h1 {
    font-size: 2em;
}
h2 {
    font-size: 1.5em;
}

h1, h2, h3, h4, h5, h6 {
    font-family: Comfortaa, Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
    font-weight: 400;
}
.navbar .navbar-brand,
.navbar .nav-link,
.navbar .navbar-text {
    font-family: Comfortaa, Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
    font-weight: 300;
}
.empty-state-text {
    font-family: Comfortaa, Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
    font-weight: 300;
    font-size: 1.2em;
}
body {
    font-family: Raleway, Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
    font-weight: 300;
}

/*****************************************************************************/

html[data-bs-theme="dark"] .list-group-hover .list-group-item:hover {
    background-color: rgba(255, 255, 255, .05);
}
.list-group-hover .list-group-item:hover {
    background-color: rgba(0, 0, 0, .05);
}

/*****************************************************************************/

.card .card-body .card-body-collapse {
    padding: 0 !important;
}

.input-group .form-control.dropdown {
    border-top-right-radius: var(--bs-border-radius) !important;
    border-bottom-right-radius: var(--bs-border-radius) !important;
}

/*****************************************************************************/

#header-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
}

#header-decoration div {
    width: 5px;
    height: 19px;
}
#header-decoration.play div {
    width: 5px;
    height: 16px;
}

#header-decoration .decor-red {
    background-color: #dc3545;
}
#header-decoration .decor-green {
    background-color: #198754;
}
#header-decoration .decor-blue {
    background-color: #0d6efd;
}

/*****************************************************************************/

#drop-overlay {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 100 !important;
}
.drop-overlay-caption {
    margin-top: 45vh;
}
.drop-overlay-caption i {
    font-size: 5em;
}
.drop-overlay-caption p {
    font-size: 1.5em;
}

/*****************************************************************************/

#keyboard-control-focus {
    text-transform: uppercase;
}
#modal-keyboard-control:focus #keyboard-control-focus {
    visibility: hidden;
}
#modal-keyboard-control #keyboard-control-focus {
    visibility: visible;
}

#keyboard-control-button, #gamepad-control-button {
    font-size: 1.5em;
}

/*****************************************************************************/

a.game-name {
    color: var(--bs-heading-color);
    text-decoration: none;
}
a.game-name:hover {
    text-decoration: underline;
}

button#theme, button#localization {
    color: var(--bs-heading-color);
    text-decoration: none;
}

.game-description div {
    text-justify: auto;
}

.game-tags .game-tag {
    opacity: .5;
}
.game-tags:hover .game-tag {
    opacity: 1;
}

/*****************************************************************************/

:root {
    --pt-bg: #080b0f;
    --pt-panel: #11161c;
    --pt-panel-soft: #171d24;
    --pt-line: rgba(255, 255, 255, .1);
    --pt-text-muted: #96a0ad;
    --pt-cyan: #18d3e8;
    --pt-orange: #f4a340;
}

body {
    background:
        radial-gradient(900px 420px at 50% -180px, rgba(24, 211, 232, .14), transparent 70%),
        linear-gradient(135deg, #080b0f 0%, #0b1015 55%, #11100e 100%);
    background-attachment: fixed;
}

#navbar {
    background: rgba(8, 11, 15, .88) !important;
    border-bottom: 1px solid var(--pt-line);
    backdrop-filter: blur(16px);
}

#navbar .navbar-brand {
    color: var(--pt-cyan) !important;
    letter-spacing: .12em;
    text-transform: uppercase;
}

#navbar .nav-link {
    color: var(--pt-text-muted) !important;
    letter-spacing: .06em;
    text-transform: uppercase;
    transition: color .2s ease;
}

#navbar .nav-link:hover,
#navbar .nav-link:focus {
    color: #fff !important;
}

.library-toolbar {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(240px, 2fr) minmax(240px, 2fr);
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--pt-line);
    border-radius: 8px;
    background: rgba(17, 22, 28, .72);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .18);
}

.library-toolbar > div {
    margin: 0 !important;
    width: auto;
}

.library-toolbar .d-grid {
    display: flex !important;
    gap: 8px;
}

.library-toolbar form {
    margin: 0 !important;
    flex: 1;
}

.library-toolbar #btn-upload,
.library-toolbar form button {
    height: 42px;
    white-space: nowrap;
}

.library-toolbar .input-group-text,
.library-toolbar .form-control,
.library-toolbar .form-select {
    min-height: 42px;
    background: var(--pt-panel) !important;
    border-color: var(--pt-line) !important;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 18px;
}

.library-card {
    position: relative;
    min-width: 0;
    aspect-ratio: 3 / 4;
    overflow: visible;
    border: 1px solid var(--pt-line);
    border-radius: 8px;
    background: var(--pt-panel);
    isolation: isolate;
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.library-card:hover {
    z-index: 2;
    transform: translateY(-5px);
    border-color: rgba(24, 211, 232, .65);
    box-shadow: 0 18px 35px rgba(0, 0, 0, .4), 0 0 0 1px rgba(24, 211, 232, .12);
}

.library-card-cover,
.library-card-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.library-card-cover {
    border-radius: 8px;
    overflow: hidden;
}

.library-card-overlay {
    border-radius: 8px;
    pointer-events: none;
}

.library-card-cover {
    z-index: -2;
    object-fit: cover;
    background: linear-gradient(145deg, #1c242d, #0d1116);
}

.library-card-cover-empty {
    display: grid;
    place-items: center;
    color: #59636e;
    font-size: 3rem;
}

.library-card-overlay {
    z-index: -1;
    background: linear-gradient(180deg, rgba(5, 8, 11, .06) 28%, rgba(5, 8, 11, .42) 48%, rgba(5, 8, 11, .97) 100%);
}

.library-card-body {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 16px 14px 14px;
}

.library-card .row {
    align-items: flex-start;
    margin: 0;
}

.library-card .row > div:first-child {
    width: calc(100% - 34px);
}

.library-card .row > div:last-child {
    width: 34px;
    padding: 0;
}

.library-card .lead {
    font-size: .98rem;
    line-height: 1.25;
}

.library-card a.game-name {
    color: #fff;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.library-card .game-description {
    display: -webkit-box;
    overflow: hidden;
    color: var(--pt-text-muted) !important;
    font-size: .78rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.library-card .game-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.library-card .game-tag {
    max-width: 100%;
    overflow: hidden;
    border-color: rgba(24, 211, 232, .7) !important;
    color: var(--pt-cyan) !important;
    font-size: .62rem;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.library-card .dropdown .btn {
    border: 0;
    color: #fff;
}

.library-card .dropdown-menu {
    z-index: 20;
}

.library-favorite-form {
    z-index: 10;
}

.library-hero {
    position: relative;
    min-height: 270px;
    overflow: hidden;
    border: 1px solid var(--pt-line);
    border-radius: 8px;
    background: var(--pt-panel);
}

.library-hero-cover,
.library-hero-shade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.library-hero-cover {
    object-fit: cover;
    object-position: center 30%;
    opacity: .72;
}

.library-hero-shade {
    background: linear-gradient(90deg, rgba(8, 11, 15, .98) 0%, rgba(8, 11, 15, .78) 38%, rgba(8, 11, 15, .16) 100%);
}

.library-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 270px;
    max-width: 560px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 32px;
}

.library-kicker {
    color: var(--pt-cyan);
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.library-hero h2 {
    margin: 8px 0;
    color: #fff;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
}

.library-hero p {
    display: -webkit-box;
    overflow: hidden;
    color: var(--pt-text-muted);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.library-favorite-form {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
}

.library-favorite {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 50%;
    background: rgba(8, 11, 15, .72);
    color: var(--pt-orange);
    line-height: 1;
}

.library-favorite:hover,
.library-favorite:focus {
    border-color: var(--pt-orange);
    background: rgba(8, 11, 15, .95);
    color: #ffd477;
}

.auth-shell {
    margin-top: 8vh;
}

.auth-shell > h1 {
    color: #fff;
    font-size: 2.2rem;
}

.auth-shell .card,
.settings-links,
.upload-queue,
.netplay-list {
    overflow: hidden;
    border: 1px solid var(--pt-line);
    border-radius: 8px;
    background: rgba(17, 22, 28, .82);
    box-shadow: 0 18px 45px rgba(0, 0, 0, .2);
}

.auth-shell .card-body {
    padding: 26px;
}

.settings-links .list-group-item,
.upload-queue .list-group-item,
.netplay-list .list-group-item {
    border-color: var(--pt-line);
    background: transparent;
    color: #e6e9ee;
    transition: background-color .2s ease, padding-left .2s ease;
}

.settings-links .list-group-item:hover,
.netplay-list .list-group-item:hover {
    padding-left: 24px;
    background: var(--pt-panel-soft);
    color: var(--pt-cyan);
}

.upload-queue .list-group-item {
    padding: 18px;
}

.netplay-list .game-name {
    color: #fff;
}

@media (max-width: 767.98px) {
    .library-toolbar {
        grid-template-columns: 1fr;
    }

    .library-toolbar .d-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
    }

    .games-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .library-card-body {
        padding: 12px 10px 10px;
    }

    .library-hero-content {
        min-height: 230px;
        padding: 22px;
    }

    .auth-shell {
        margin-top: 4vh;
    }

    .auth-shell .card-body {
        padding: 18px;
    }
}
