:root {
    --game-list-border: rgba(130, 159, 190, 0.24);
    --game-list-panel: rgba(10, 23, 37, 0.92);
    --game-list-panel-strong: #0d1d2d;
    --game-list-blue: #49a7ff;
    --game-list-green: #45d39c;
}

.game-lists-page {
    color: #ecf5ff;
}

.game-list-scope-tabs,
.game-list-page-actions,
.game-list-reorder-toolbar,
.game-list-detail-actions,
.game-list-item__links {
    display: flex;
    align-items: center;
    gap: 10px;
}

.game-list-scope-tabs {
    margin: 14px 0 18px;
    border: 1px solid var(--game-list-border);
    background: rgba(8, 18, 29, 0.78);
}

.game-list-scope-tabs a {
    min-height: 44px;
    padding: 11px 20px;
    border-bottom: 2px solid transparent;
    color: #9fb0c2;
    text-decoration: none;
}

.game-list-scope-tabs a.is-active {
    color: #fff;
    border-bottom-color: var(--game-list-blue);
    background: rgba(36, 116, 198, 0.17);
}

.game-list-page-actions {
    justify-content: space-between;
    margin: 0 0 14px;
    color: #9fb0c2;
}

.game-list-button:not(.pm-button),
.game-list-add-trigger:not(.pm-button),
.library-game-card__actions .game-list-add-trigger:not(.pm-button) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 15px;
    border: 1px solid #317fd2;
    border-radius: 5px;
    background: #1768bd;
    color: #fff;
    font: inherit;
    line-height: 1.25;
    text-decoration: none;
    cursor: pointer;
}

.game-list-button:not(.pm-button):hover,
.game-list-add-trigger:not(.pm-button):hover {
    background: #2078d2;
}

.game-list-button:not(.pm-button).is-secondary {
    border-color: var(--game-list-border);
    background: rgba(15, 31, 48, 0.88);
}

.game-list-button:not(.pm-button):disabled {
    border-color: #394a5b;
    background: #1b2b3a;
    color: #8394a4;
    cursor: default;
}

.game-list-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.game-list-card,
.game-list-empty,
.game-list-detail-header,
.game-list-item {
    border: 1px solid var(--game-list-border);
    border-radius: 6px;
    background: var(--game-list-panel);
}

.game-list-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
}

.game-list-card__cover,
.game-list-item__image {
    position: relative;
    display: block;
    overflow: hidden;
    background: #08131f;
}

.game-list-card__cover {
    aspect-ratio: 460 / 215;
}

.game-list-card__cover img,
.game-list-item__image img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-list-image-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #52708d;
    font-weight: 800;
}

.game-list-image-fallback svg {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.game-list-card__body {
    display: grid;
    gap: 10px;
    padding: 14px;
}

.game-list-card__heading,
.game-list-detail-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.game-list-card h2,
.game-list-card h3,
.game-list-item h2,
.game-list-detail-header h1 {
    margin: 0;
    letter-spacing: 0;
}

.game-list-card h2,
.game-list-card h3 {
    font-size: 17px;
}

.game-list-card h2 a,
.game-list-card h3 a,
.game-list-item h2 a {
    color: #f4f8fc;
    text-decoration: none;
}

.game-list-card h2 a::after,
.game-list-card h3 a::after,
.game-list-item h2 a::after {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
}

.game-list-card__actions,
.game-list-item__links,
.game-list-remove {
    position: relative;
    z-index: 2;
}

.game-list-card__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.public-game-list-search {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) minmax(180px, 1.4fr) minmax(145px, .8fr) minmax(110px, .55fr) auto;
    align-items: end;
    gap: 10px;
    margin: 16px 0;
    padding: 14px;
    border: 1px solid var(--game-list-border);
    border-radius: 6px;
    background: rgba(8, 18, 29, 0.82);
}

.public-game-list-search label {
    display: grid;
    gap: 6px;
    min-width: 0;
    color: #9fb0c2;
    font-size: 12px;
}

.public-game-list-search input,
.public-game-list-search select {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid #30475e;
    border-radius: 4px;
    background: #07131f;
    color: #edf6ff;
    font: inherit;
}

.public-game-list-search__actions,
.game-list-engagement-actions {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
}

.public-game-list-search__actions {
    justify-content: flex-end;
}

.public-game-list-results-header {
    display: flex;
    justify-content: space-between;
    margin: 0 0 10px;
    color: #8fa2b5;
    font-size: 13px;
}

.public-game-list-results-header p {
    margin: 0;
}

.game-list-engagement-actions form {
    margin: 0;
}

.game-list-action-button:not(.pm-button),
.game-list-owner-note {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 7px 12px;
    border: 1px solid #345875;
    border-radius: 4px;
    background: #10263a;
    color: #cfe7fb;
    font: inherit;
    font-size: 13px;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}

.game-list-action-button:not(.pm-button):hover,
.game-list-action-button:not(.pm-button).is-active {
    border-color: #3f93de;
    background: #174e7e;
    color: #fff;
}

.game-list-action-button:not(.pm-button).is-save {
    border-color: #4b6695;
}

.game-list-action-button:not(.pm-button).is-save.is-active {
    border-color: #7768e8;
    background: #3b3478;
}

.game-list-owner-note {
    cursor: default;
    color: #9db1c3;
}

.public-game-list-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 20px 0 4px;
}

.public-game-list-pagination a,
.public-game-list-pagination span {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 7px 13px;
    border: 1px solid var(--game-list-border);
    border-radius: 4px;
    color: #bcd7ed;
    text-decoration: none;
}

.public-game-list-hero {
    display: grid;
    grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
    gap: 22px;
    margin: 16px 0;
    padding: 18px;
    border: 1px solid var(--game-list-border);
    border-radius: 6px;
    background: var(--game-list-panel);
}

.public-game-list-hero__cover {
    position: relative;
    overflow: hidden;
    aspect-ratio: 460 / 215;
    border-radius: 5px;
    background: #08131f;
}

.public-game-list-hero__cover img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.public-game-list-hero__body {
    min-width: 0;
}

.public-game-list-hero__body > p:first-child {
    margin: 0 0 5px;
    color: var(--game-list-blue);
    font-size: 12px;
    font-weight: 700;
}

.public-game-list-hero h1 {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: clamp(26px, 3vw, 40px);
    letter-spacing: 0;
}

.public-game-list-hero .game-list-engagement-actions {
    margin-top: 15px;
}

.public-game-list-edit-link {
    margin-top: 10px;
}

.game-list-management-dashboard {
    margin-top: 16px;
}

.game-list-card__actions form {
    margin: 0;
}

.game-list-card__delete {
    min-height: 40px;
    padding: 8px 13px;
    border: 1px solid rgba(245, 108, 108, 0.45);
    border-radius: 5px;
    color: #ffaaaa;
    background: rgba(81, 28, 34, 0.45);
    font: inherit;
    cursor: pointer;
}

.game-list-card p,
.game-list-detail-description,
.game-list-item p {
    margin: 0;
    color: #aebdcc;
    line-height: 1.65;
}

.game-list-card__body > p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.game-list-visibility {
    flex: 0 0 auto;
    padding: 3px 7px;
    border: 1px solid #4a6075;
    border-radius: 4px;
    color: #b9c7d5;
    font-size: 12px;
}

.game-list-visibility.is-public {
    border-color: rgba(69, 211, 156, 0.55);
    color: var(--game-list-green);
}

.game-list-card__meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
    border-top: 1px solid var(--game-list-border);
}

.game-list-card__meta div {
    padding: 9px 5px 0;
}

.game-list-card__meta dt {
    color: #71869a;
    font-size: 11px;
}

.game-list-card__meta dd {
    margin: 2px 0 0;
    color: #e5edf5;
    font-size: 13px;
}

.game-list-card__owner {
    font-size: 12px;
}

.game-list-card__owner a {
    position: relative;
    z-index: 2;
}

.game-list-empty {
    padding: 38px 22px;
    text-align: center;
}

.game-list-empty h2 {
    margin: 0 0 8px;
    font-size: 21px;
}

.game-list-empty p {
    margin: 0 0 18px;
    color: #aebdcc;
}

.game-list-alert {
    margin: 12px 0;
    padding: 11px 14px;
    border: 1px solid var(--game-list-border);
    background: rgba(21, 45, 67, 0.8);
}

.game-list-alert.is-error {
    border-color: rgba(245, 108, 108, 0.6);
    color: #ffb1b1;
}

.game-list-back-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    margin: 4px 0 0;
    color: #9fcdf8;
    text-decoration: none;
}

.game-list-back-link::before {
    content: "←";
    margin-right: 7px;
}

.game-list-detail-dashboard,
.game-list-public-layout {
    margin-top: 16px;
}

.game-list-detail-dashboard .game-list-detail-header {
    align-items: stretch;
    flex-direction: column;
}

.game-list-detail-dashboard .game-list-detail-actions {
    align-self: flex-end;
}

.game-list-detail-dashboard .game-list-items {
    grid-template-columns: 1fr;
}

.game-list-public-main {
    min-width: 0;
}

.game-list-detail-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin: 18px 0 14px;
    padding: 24px;
}

.game-list-detail-header > div:first-child {
    min-width: 0;
}

.game-list-detail-header > div > p:first-child {
    margin: 0 0 5px;
    color: var(--game-list-blue);
    font-size: 12px;
    font-weight: 700;
}

.game-list-detail-header h1 {
    overflow-wrap: anywhere;
    font-size: clamp(26px, 3vw, 40px);
}

.game-list-detail-description {
    max-width: 860px;
    margin-top: 10px;
}

.game-list-detail-meta {
    margin: 10px 0 0;
    color: #8095aa;
    font-size: 13px;
}

.game-list-reorder-toolbar {
    justify-content: space-between;
    margin-bottom: 10px;
}

.game-list-reorder-toolbar p {
    margin: 0;
    color: #8fa2b5;
    font-size: 13px;
}

.game-list-items {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.game-list-item {
    position: relative;
    display: grid;
    grid-template-columns: 30px 150px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 10px;
}

.game-list-item.is-dragging {
    opacity: 0.52;
}

.game-list-item__number {
    color: #6f859a;
    text-align: center;
}

.game-list-item__image {
    width: 150px;
    aspect-ratio: 460 / 215;
    border-radius: 4px;
}

.game-list-item__body {
    min-width: 0;
}

.game-list-item h2 {
    font-size: 15px;
}

.game-list-item p {
    margin-top: 5px;
    font-size: 12px;
}

.game-list-item__links {
    margin-top: 7px;
}

.game-list-item__links a,
.game-list-item__links button:not(.pm-button),
.game-list-remove:not(.pm-button),
.game-list-delete-form button:not(.pm-button) {
    border: 0;
    background: transparent;
    color: #78baff;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.game-list-remove:not(.pm-button),
.game-list-delete-form button:not(.pm-button) {
    color: #ff9a9a;
}

.game-list-dialog {
    width: min(620px, calc(100vw - 24px));
    max-height: min(760px, calc(100vh - 24px));
    padding: 0;
    overflow: auto;
    border: 1px solid #35506a;
    border-radius: 7px;
    background: #0b1927;
    color: #eef6ff;
}

.game-list-dialog::backdrop {
    background: rgba(0, 7, 14, 0.78);
}

.game-list-dialog__shell {
    display: grid;
    gap: 16px;
    padding: 20px;
}

.game-list-dialog__shell header,
.game-list-dialog__shell footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.game-list-dialog__shell header p,
.game-list-dialog__shell header h2 {
    margin: 0;
}

.game-list-dialog__shell header p {
    color: var(--game-list-blue);
    font-size: 11px;
}

.game-list-dialog__close {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--game-list-border);
    border-radius: 4px;
    background: transparent;
    color: #dce8f3;
    font-size: 24px;
    cursor: pointer;
}

.game-list-dialog label:not(.game-list-option),
.game-list-dialog fieldset {
    display: grid;
    gap: 7px;
    margin: 0;
    color: #dce6ef;
}

.game-list-dialog label span {
    color: #778b9d;
    font-size: 12px;
}

.game-list-dialog .game-list-field-error {
    color: #ffaaaa;
    font-size: 12px;
}

.game-list-dialog input[type="text"],
.game-list-dialog input[type="search"],
.game-list-dialog textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 12px;
    border: 1px solid #30475e;
    border-radius: 4px;
    background: #07131f;
    color: #fff;
    font: inherit;
}

.game-list-dialog fieldset {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px;
    border: 1px solid var(--game-list-border);
}

.game-list-dialog fieldset legend {
    padding: 0 6px;
}

.game-list-option-list,
.game-list-search-results {
    display: grid;
    gap: 8px;
}

.game-list-option,
.game-list-search-result {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 11px;
    border: 1px solid var(--game-list-border);
    border-radius: 5px;
    background: rgba(18, 38, 57, 0.8);
}

.game-list-search-result {
    grid-template-columns: 96px minmax(0, 1fr) auto;
}

.game-list-search-result__media {
    width: 96px;
    aspect-ratio: 460 / 215;
    overflow: hidden;
    border-radius: 4px;
    background: #102031;
}

.game-list-search-result__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-list-dialog__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

.game-list-dialog__hint {
    margin: 0;
    color: #91a5b8;
    font-size: 13px;
    line-height: 1.6;
}

.game-list-option strong,
.game-list-option small,
.game-list-search-result strong,
.game-list-search-result small {
    display: block;
}

.game-list-option small,
.game-list-search-result small,
.game-list-dialog__message {
    color: #91a5b8;
}

.game-list-option button,
.game-list-search-result button {
    min-height: 36px;
    padding: 7px 11px;
    border: 1px solid #2f78c5;
    border-radius: 4px;
    background: #145b9f;
    color: #fff;
    cursor: pointer;
}

.game-list-option button:disabled,
.game-list-search-result button:disabled {
    border-color: #394a5b;
    background: #1b2b3a;
    color: #8394a4;
    cursor: default;
}

.game-list-delete-form {
    padding: 0 20px 20px;
    text-align: right;
}

.game-list-toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 500;
    max-width: min(380px, calc(100vw - 36px));
    padding: 12px 15px;
    border: 1px solid #3f8edc;
    border-radius: 5px;
    background: #102b43;
    color: #fff;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 150ms ease, transform 150ms ease;
}

@media (max-width: 540px) {
    .game-list-search-result {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .game-list-search-result__media {
        width: 72px;
    }

    .game-list-search-result button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .game-list-dialog__footer {
        flex-direction: column-reverse;
    }

    .game-list-dialog__footer .game-list-button,
    .game-list-dialog__footer .pm-button {
        width: 100%;
        text-align: center;
    }
}

.game-list-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1100px) {
    .public-game-list-search {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .public-game-list-search__actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .game-list-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .game-list-items {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .public-game-list-search,
    .public-game-list-hero {
        grid-template-columns: 1fr;
    }

    .public-game-list-search__actions,
    .game-list-engagement-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .public-game-list-search__actions .game-list-button,
    .public-game-list-search__actions .pm-button,
    .game-list-engagement-actions form,
    .game-list-engagement-actions form button,
    .game-list-engagement-actions > a,
    .game-list-owner-note {
        box-sizing: border-box;
        width: 100%;
    }

    .game-list-grid {
        grid-template-columns: 1fr;
    }

    .game-list-detail-header {
        align-items: stretch;
        flex-direction: column;
        padding: 17px;
    }

    .game-list-card__actions,
    .game-list-detail-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .game-list-card__actions > .game-list-button,
    .game-list-card__actions form,
    .game-list-card__actions form .game-list-card__delete,
    .game-list-detail-actions .game-list-button {
        box-sizing: border-box;
        width: 100%;
        height: 46px;
        min-width: 0;
        min-height: 46px;
        text-align: center;
    }

    .game-list-item {
        grid-template-columns: 24px 96px minmax(0, 1fr);
        gap: 8px;
    }

    .game-list-item__image {
        width: 96px;
    }

    .game-list-remove {
        grid-column: 3;
        justify-self: start;
    }

    .game-list-reorder-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .game-list-dialog__shell {
        padding: 16px;
    }
}
