.game-profiles-settings {
    margin-top: 25px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
    color: #263238;
}

.game-profiles-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.game-profiles-title { margin: 0; color: #263238; }
.game-profiles-help { margin: 7px 0 0; color: #607d8b; line-height: 1.55; }
.game-profiles-add {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 9px 15px;
    border: 0;
    border-radius: 5px;
    background: #315fd4;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
}
.game-profiles-add:focus-visible,
.game-profile-action:focus-visible,
.game-profile-modal button:focus-visible,
.game-profile-modal input:focus-visible,
.game-profile-modal select:focus-visible {
    outline: 3px solid rgba(49, 95, 212, .3);
    outline-offset: 2px;
}

.game-profiles-state { min-height: 22px; margin-top: 14px; color: #607d8b; }
.game-profiles-state.error { color: #b42318; }
.game-profiles-list { margin-top: 5px; }
.game-profile-game-group { padding-top: 18px; border-top: 1px solid #dde3e8; }
.game-profile-game-group + .game-profile-game-group { margin-top: 18px; }
.game-profile-game-title { margin: 0 0 11px; font-size: 18px; color: #1f2937; }
.game-profile-server-title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 13px 0 5px;
    color: #455a64;
    font-size: 14px;
    font-weight: 700;
}
.game-profile-server-title img { width: 24px; height: 24px; object-fit: contain; image-rendering: auto; }
.game-profile-row {
    display: grid;
    grid-template-columns: minmax(150px, 1.2fr) minmax(180px, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-top: 1px solid #edf0f2;
}
.game-profile-name { min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.game-profile-default { color: #a26800; margin-right: 5px; }
.game-profile-meta { color: #607d8b; font-size: 13px; line-height: 1.55; }
.game-profile-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.game-profile-action {
    min-height: 36px;
    padding: 7px 11px;
    border: 1px solid #b8c2cc;
    border-radius: 5px;
    background: #fff;
    color: #263238;
    cursor: pointer;
    font-weight: 700;
}
.game-profile-action.primary { border-color: #315fd4; color: #244aa8; }
.game-profile-action.danger { border-color: #d9a3a0; color: #a1241d; }
.game-profile-action:disabled { opacity: .55; cursor: not-allowed; }

.game-profile-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1550;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, .66);
    box-sizing: border-box;
}
.game-profile-modal-overlay.open { display: flex; }
.game-profile-modal {
    width: min(460px, calc(100% - 32px));
    max-height: calc(100vh - 32px);
    max-height: calc(100svh - 32px);
    overflow-y: auto;
    padding: 22px;
    border-radius: 8px;
    background: #fff;
    color: #263238;
    box-shadow: 0 18px 52px rgba(0, 0, 0, .32);
    box-sizing: border-box;
}
.game-profile-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.game-profile-modal-title { margin: 0; font-size: 21px; }
.game-profile-modal-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #eef1f4;
    color: #455a64;
    cursor: pointer;
    font-size: 24px;
}
.game-profile-field { display: grid; gap: 7px; margin-top: 15px; }
.game-profile-field[hidden] { display: none; }
.game-profile-field label { font-weight: 700; color: #37474f; }
.game-profile-field input,
.game-profile-field select {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #b8c2cc;
    border-radius: 5px;
    background: #fff;
    color: #263238;
    font: inherit;
    box-sizing: border-box;
}
.game-profile-field select:disabled { color: #546e7a; background: #f2f4f5; }
.game-profile-default-field { display: flex; align-items: flex-start; gap: 9px; margin-top: 17px; color: #455a64; }
.game-profile-default-field input { margin-top: 3px; }
.game-profile-modal-feedback { min-height: 22px; margin-top: 12px; color: #b42318; }
.game-profile-modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 17px; }
.game-profile-modal-button {
    min-height: 40px;
    padding: 9px 16px;
    border: 0;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 700;
}
.game-profile-modal-button.cancel { background: #e7ebee; color: #37474f; }
.game-profile-modal-button.submit { background: #315fd4; color: #fff; }
.game-profile-modal-button:disabled { opacity: .55; cursor: not-allowed; }
body.game-profile-modal-open { overflow: hidden; }

@media (max-width: 720px) {
    .game-profiles-settings { padding: 17px 15px; }
    .game-profiles-header { flex-direction: column; }
    .game-profiles-add { width: 100%; }
    .game-profile-row { grid-template-columns: minmax(0, 1fr); gap: 7px; }
    .game-profile-actions { justify-content: flex-start; }
    .game-profile-action { flex: 1 1 110px; }
    .game-profile-modal { width: calc(100% - 32px); padding: 19px; }
    .game-profile-modal-actions { align-items: stretch; flex-direction: column-reverse; }
    .game-profile-modal-button { width: 100%; }
}
