.app-form-wrapper {
    max-width: 920px;
    margin: 0 auto 2rem;
}

.app-form {
    color: #cdd6f4;
    background: #1e1e2e;
    border: 1px solid #313244;
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.app-form-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    background: rgba(17, 17, 27, 0.6);
    border-bottom: 1px solid #313244;
}

.app-form-header-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #1e1e2e;
    background: #fab387;
}

.app-form-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: #cdd6f4;
}

.app-form-subtitle {
    margin: 2px 0 0;
    font-size: 0.85rem;
    color: #a6adc8;
}

.app-form-body {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 28px;
    padding: 24px;
}

.app-form-cover {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.app-form-cover-preview {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: 14px;
    overflow: hidden;
    background: #313244;
    border: 1px solid #45475a;
}

.app-form-cover-preview img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-form-cover-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #6c7086;
}

.app-form-cover-placeholder .bi {
    font-size: 2.2rem;
}

.app-form-fields {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.app-form-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.app-form-section + .app-form-section {
    padding-top: 20px;
    border-top: 1px solid #313244;
}

.app-form-section-title {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #a6adc8;
}

.app-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.app-form-field {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.app-form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #cdd6f4;
}

.app-form-input,
.app-form-file {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    font-size: 0.95rem;
    color: #cdd6f4;
    background: #11111b;
    border: 1px solid #45475a;
    border-radius: 10px;
    color-scheme: dark;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.app-form-select {
    appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%23a6adc8' d='M1.6 5.2 8 11.6l6.4-6.4-1.2-1.2L8 9.2 2.8 4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.app-form-input:focus,
.app-form-file:focus {
    outline: none;
    border-color: #fab387;
    box-shadow: 0 0 0 3px rgba(250, 179, 135, 0.2);
}

.app-form-file {
    height: auto;
    padding: 6px;
    font-size: 0.8rem;
}

.app-form-file::file-selector-button {
    margin-right: 10px;
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    color: #cdd6f4;
    background: #313244;
    cursor: pointer;
}

.app-form-file::file-selector-button:hover {
    color: #1e1e2e;
    background: #fab387;
}

.app-form-hint {
    font-size: 0.75rem;
    color: #a6adc8;
}

.app-form-title-row {
    display: flex;
    gap: 8px;
}

.app-form-igdb-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #fab387;
    border-radius: 10px;
    font-weight: 600;
    color: #fab387;
    background: transparent;
    transition: background 0.15s ease, color 0.15s ease;
}

.app-form-igdb-button:hover {
    color: #1e1e2e;
    background: #fab387;
}

.app-form-status {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 4px;
    border-radius: 12px;
    background: #11111b;
    border: 1px solid #313244;
}

.app-form-status-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    border-radius: 9px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #a6adc8;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.app-form-status-option:hover {
    color: #fff;
    background: #313244;
}

.app-form-status-input,
.app-form-flag-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.app-form-errors {
    margin: 16px 24px 0;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(243, 139, 168, 0.12);
    border: 1px solid rgba(243, 139, 168, 0.4);
}

.app-form-status-option:has(.app-form-status-input:checked) {
    color: #1e1e2e;
    background: #fab387;
}

.app-form-status-option:has(.app-form-status-input:disabled) {
    opacity: 0.4;
    cursor: not-allowed;
}

.app-form-status-option:has(.app-form-status-input:focus-visible),
.app-form-flag:has(.app-form-flag-input:focus-visible) {
    outline: 2px solid #fab387;
    outline-offset: 2px;
}

.app-form-flags {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.app-form-flag {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #a6adc8;
    background: #11111b;
    border: 1px solid #313244;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.app-form-flag .bi {
    font-size: 1.05rem;
    color: #6c7086;
}

.app-form-flag:hover {
    border-color: #45475a;
}

.app-form-field[hidden],
.app-form-flag[hidden] {
    display: none;
}

.app-form-flag:has(.app-form-flag-input:disabled) {
    opacity: 0.4;
    cursor: not-allowed;
}

.app-form-flag:has(.app-form-flag-input:checked) {
    color: #cdd6f4;
    border-color: #fab387;
    background: rgba(250, 179, 135, 0.1);
}

.app-form-flag:has(.app-form-flag-input:checked) .bi {
    color: #fab387;
}

.app-form-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    background: rgba(17, 17, 27, 0.6);
    border-top: 1px solid #313244;
}

.app-form-multiple {
    margin-right: auto;
    min-height: 42px;
    cursor: pointer;
}

.app-form-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 18px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s ease, filter 0.15s ease;
}

.app-form-button-secondary {
    color: #cdd6f4;
    background: #313244;
}

.app-form-button-secondary:hover {
    color: #fff;
    background: #45475a;
}

.app-form-button-primary {
    color: #173404;
    background: #a6e3a1;
}

.app-form-button-primary:hover {
    filter: brightness(1.08);
}

.app-form ul {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.8rem;
    color: #f38ba8;
}

.app-form-wrapper-narrow {
    max-width: 420px;
    margin-top: 6vh;
}

.app-form-wrapper-medium {
    max-width: 720px;
}

.app-form-wrapper-medium > .section-header {
    margin-top: 0;
}

.app-form-header-centered {
    flex-direction: column;
    text-align: center;
    padding: 28px 24px 20px;
}

.app-form-logo {
    border-radius: 14px;
}

.app-form-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
}

.app-form-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.app-form-input-group > .bi {
    position: absolute;
    left: 12px;
    color: #6c7086;
    pointer-events: none;
}

.app-form-input-group > .app-form-input {
    padding-left: 38px;
}

.app-form-input-group:focus-within > .bi {
    color: #fab387;
}

.app-form-button-block {
    width: 100%;
    justify-content: center;
}

.app-form-body-single {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.app-form-body-profile {
    grid-template-columns: 180px minmax(0, 1fr);
}

.app-form-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.app-form-avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 3rem;
    color: #6c7086;
    background: #313244;
    border: 3px solid #45475a;
}

.app-form-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-form-avatar .app-form-field {
    width: 100%;
}

.user-list {
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
    background: #1e1e2e;
    border: 1px solid #313244;
    border-radius: 18px;
    overflow: hidden;
}

.user-list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
}

.user-list-item + .user-list-item {
    border-top: 1px solid #313244;
}

.user-list-avatar {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
}

.user-list-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.user-list-name {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-weight: 700;
    color: #cdd6f4;
}

.user-list-meta {
    font-size: 0.8rem;
    color: #a6adc8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-list-badge {
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #cdd6f4;
    background: #313244;
}

.user-list-badge-admin {
    color: #1e1e2e;
    background: #fab387;
}

.user-list-action {
    margin: 0;
}

.user-list-delete {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f38ba8;
    background: #313244;
    transition: background 0.15s ease, color 0.15s ease;
}

.user-list-delete:hover,
.user-list-delete:focus-visible {
    color: #fff;
    background: #e64553;
}

.user-list-empty {
    padding: 24px;
    text-align: center;
    color: #a6adc8;
}

@media (max-width: 767.98px) {
    .app-form-body {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
        padding: 18px;
    }

    .app-form-cover {
        flex-direction: row;
        align-items: flex-start;
    }

    .app-form-cover-preview {
        flex: 0 0 110px;
    }

    .app-form-body-profile {
        grid-template-columns: minmax(0, 1fr);
    }

    .app-form-wrapper-narrow {
        margin-top: 2vh;
    }

    .app-form-cover .app-form-field {
        flex: 1;
        min-width: 0;
    }

    .app-form-flags {
        grid-template-columns: minmax(0, 1fr);
    }

    .app-form-status-option span {
        font-size: 0.8rem;
    }

    .app-form-footer {
        padding: 14px 18px;
    }

    .app-form-button {
        flex: 1;
        justify-content: center;
    }
}

.igdb-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: #11111b;
    border: 1px solid #45475a;
    border-radius: 14px;
    margin-top: 4px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    max-height: min(480px, 60vh);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.igdb-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.igdb-result-item:hover {
    background: rgba(250, 179, 135, 0.12);
}

.igdb-result-item + .igdb-result-item {
    border-top: 1px solid rgba(255,255,255,0.07);
}

.igdb-result-cover {
    width: 36px;
    height: 48px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
}

.igdb-no-cover {
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.3);
    font-size: 1.1rem;
}

.igdb-result-title {
    font-size: 0.9rem;
    color: rgba(230,237,243,0.95);
    font-weight: 500;
}

.igdb-result-meta {
    font-size: 0.78rem;
    color: rgba(230,237,243,0.5);
    margin-top: 2px;
}

.igdb-no-results {
    padding: 12px 14px;
    color: rgba(230,237,243,0.5);
    font-size: 0.875rem;
}

@media (max-width: 575.98px) {
    .app-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.app-created-games {
    padding: 20px 24px;
    color: #cdd6f4;
    background: #1e1e2e;
    border: 1px solid #313244;
    border-radius: 18px;
}

.app-created-games-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.app-created-games-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.app-created-games-count {
    margin: 2px 0 0;
    font-size: 0.8rem;
    color: #a6adc8;
}

.app-created-games-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.app-created-game {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    background: #11111b;
    border: 1px solid #313244;
    border-radius: 12px;
    animation: app-created-game-in 0.25s ease-out;
}

.app-created-game:first-child {
    border-color: #a6e3a1;
}

.app-created-game-cover {
    flex: 0 0 auto;
    width: 40px;
    height: 54px;
    object-fit: cover;
    border-radius: 6px;
}

.app-created-game-cover-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c7086;
    background: #313244;
}

.app-created-game-info {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.app-created-game-title {
    overflow: hidden;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.app-created-game-meta {
    font-size: 0.75rem;
    color: #a6adc8;
}

.app-created-game-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #a6adc8;
    background: transparent;
    border: none;
    border-radius: 8px;
}

.app-created-game-remove:hover {
    color: #f38ba8;
    background: rgba(243, 139, 168, 0.12);
}

@keyframes app-created-game-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
}

@media (max-width: 576px) {
    .app-form-footer {
        flex-wrap: wrap;
    }

    .app-form-multiple {
        flex: 1 1 100%;
    }

    .app-created-games-header {
        flex-direction: column;
        align-items: stretch;
    }
}
