* {
    box-sizing: border-box;
}

body {
    background-color: #1A1A1E;
    color: white;
    font-family: 'Inter', sans-serif;
    margin: 0px;
    overflow: hidden;
}

.navbar {
    display: flex;
    justify-content: left;
    align-items: center;
    background-color: #121214;
    height: 60px;
    color: white;
    border-bottom: 1px solid #2A2A2D;
}

.logo {
    display: flex;
    width: 240px;
    align-self: stretch;
    align-items: center;
    justify-content: center;
    padding: 0 px;
    font-family:'Jost';
    font-size: 24px;
    font-weight: 600;
    color: white;
    border-right: 1px solid #2A2A2D;
}

.nav-links {
    display: flex;
    align-self: stretch;
    height: 100%;
}

.nav-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    width: 140px;
    max-width: 140px;
    text-decoration: none;
    font-family:'Jost';
    font-size: 20px;
    font-weight: 600;
    color: white;
    border-right: 1px solid #2A2A2D;
    user-select: none;
}

.nav-button:hover {
    background-color: #1a1a1e;
    transition: 0.15s;
}

.nav-profile {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: 60px;
    height: 60px;
    border-left: 1px solid #2A2A2D;
    border-bottom: 1px solid #2A2A2D;
}

.nav-profile.logged-in {
    margin-left: 0;
}

.nav-profile.logged-out {
    width: auto;
    padding: 0 20px;
    border-left: none;
}

.nav-profile img {
    width: 60px;
    height: 60px;
}

.nav-avatar-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #5865F2;
    color: white;
    font-weight: bold;
    font-size: 24px;
}

.logout-container {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.logout-btn {
    color: #A0A0AB;
    font-size: 14px;
    margin-right: 20px;
    text-decoration: none;
    font-weight: 500;
    transition: 0.15s;
}

.logout-btn:hover {
    color: white;
}

.login-btn {
    background-color: #5865F2;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    transition: 0.15s;
}

.login-btn:hover {
    background-color: #4752C4;
}

.main-body {
    display: flex;
    height: calc(100vh - 60px);
    overflow: hidden;
}

.sidebar {
    width: 240px;
    background-color: #121214;
    border-right: 1px solid #2A2A2D;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

#filter-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    flex: 1;
    overflow-y: auto;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-title {
    font: 500 14px 'Manrope', sans-serif;
    color: #A0A0AB;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
    cursor: pointer;
    outline: none;
}

input[type="range"]::-webkit-slider-runnable-track {
    background: #2F2F37;
    border: 1px solid #2A2A2D;
    height: 8px;
    border-radius: 4px;
}

input[type="range"]::-moz-range-track {
    background: #2F2F37;
    border: 1px solid #2A2A2D;
    height: 8px;
    border-radius: 4px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: #A0A0AB;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    margin-top: -5px;
}
input[type="range"]::-webkit-slider-thumb:hover {
    background: #FFFFFF;
}
input[type="range"]::-moz-range-thumb {
    background: #A0A0AB;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    border: 0;
}
input[type="range"]::-moz-range-thumb:hover {
    background: #FFFFFF;
}

.filter-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    background: #474753;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 14px;
    font: 600 13px 'Manrope', sans-serif;
    flex-shrink: 0;
    user-select: none;
}

.filter-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-button,
.reset-button {
    display: block;
    width: 100%;
    background: #474753;
    border: 0;
    color: white;
    padding: 10px 16px;
    border-radius: 6px;
    font: 600 14px 'Manrope', sans-serif;
    cursor: pointer;
    text-align: center;
    outline: none;
    text-decoration: none;
}

.filter-button:hover {
    background: #FFFFFF;
    color: #121214;
    transition: 200ms;
}

.filter-button:active {
    background: #E0E0E5;
}

.reset-button {
    background: #2F2F37;
}

.reset-button:hover {
    background: #474753;
    transition: 200ms;
}


.content-area {
    display: grid;
    grid-template-columns: repeat(auto-fill, 500px);
    grid-auto-rows: min-content;
    gap: 20px;
    padding: 60px 40px;
    justify-content:center;
    overflow-y: auto;
    flex-grow: 1;
    min-width: 0;
    background-color: #1A1A1E;
    scrollbar-width: thin;
    scrollbar-color: #474753 transparent;
}

.content-area::-webkit-scrollbar,
#add-game-form textarea::-webkit-scrollbar {
    width: 8px;
}

.content-area::-webkit-scrollbar-track,
#add-game-form textarea::-webkit-scrollbar-track {
    background: transparent;
}

.content-area::-webkit-scrollbar-thumb,
#add-game-form textarea::-webkit-scrollbar-thumb {
    background: #474753;
    border-radius: 4px;
}

.content-area::-webkit-scrollbar-thumb:hover,
#add-game-form textarea::-webkit-scrollbar-thumb:hover {
    background: #A0A0AB;
}

/* Оформление Карточек игр*/

.game-card {
    display: flex;
    align-items: stretch;
    background-color: #2F2F37;
    height: 132px;
    width: 500px;
}

.card-image {
    width: 225px;
    height: 132px;
    object-fit: cover;
    user-select: none;
}

.card-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
    padding-left:10px;
    padding-right:10px;
    padding-top:5px;
    justify-content: space-between;
}

.card-title {
    color: white;
    font-size: 20px;
    font-family: 'Manrope';
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.card-tag {
    padding: 3px 6px;
    background-color: #474753;
    color: white;
    font-size: 12px;
    font-family: 'Manrope';
    font-weight: 400;
    white-space: nowrap;
}

/* Оформление оценок друзей*/
/* Оформление оценок друзей*/
/* Оформление оценок друзей*/

.card-friends {
    display: flex;
    justify-content: left;
    align-items:center;
    height: 74px;
    user-select: none;
}

.card-friends-ratings {
    display: flex;
    flex-direction: row-reverse;
    padding: 7px;
    background-color: #474753;
    border-radius: 24px;
    height:auto;
    width:fit-content;
}

.friend-rating {
    position: relative;
    width: 34px;
    height: 34px;
    margin-left: -10px;
}
.friend-rating:last-child {
    position: relative;
    width: 34px;
    height: 34px;
    margin-left: 0px;
}

.friend-rating img {
    width: 100%; 
    height: 100%;
    border-radius: 50%;
    border: 1px solid #2F2F37;
    object-fit: cover;
}

.friend-avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid #2F2F37;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #5865F2;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.score-badge {
    position: absolute;
    bottom:0;
    right:0;
    display:flex;
    justify-content: center;
    align-items:center;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    border: 1px solid #2F2F37;
    color:#2F2F37;
    font-size: 10px;
    font-family: 'Inter';
    font-weight: 500;
}

.score-1 {
    background-color: #EF2626;
}

.score-2 {
    background-color: #F24E30;
}

.score-3 {
    background-color: #F97316;
}

.score-4 {
    background-color: #FB923C;
}

.score-5 {
    background-color: #EAB308;
}

.score-6 {
    background-color: #CCE82F;
}

.score-7 {
    background-color: #9AD33E;
}

.score-8 {
    background-color: #68BF4C;
}

.score-9 {
    background-color: #36AA5B;
}

.score-10 {
    background-color: #05968A;
}

.card-actions {
    display:flex;
    flex-direction:column;
    align-items:center;
    width: 44px;
    height: 132px;
    border-left: 1px solid #242428;
    user-select: none;
}

.card-actions-button {
    width: 44px;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    border: none;
    border-top: 1px solid #242428;
    color: white;
    cursor: pointer;
}

.card-actions-button-self-raiting {
    width: 44px;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 24px;
    font-family: 'Inter';
    font-weight: 700;
}

.rating-dropdown-container {
    position: relative;
    display: inline-block;
}

.rating-dropdown-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    width: 275px;
    box-sizing: border-box;
    background-color: #2F2F37;
    border: 1px solid #242428;
    border-radius: 0;
    padding: 0;
    z-index: 100;
}

.rating-dropdown-container[open] .rating-dropdown-menu {
    display: block;
}

.rating-dropdown-container summary {
    list-style: none;
}

.rating-dropdown-container summary::-webkit-details-marker {
    display: none;
}

.rating-dropdown-menu form {
    display: flex;
    flex-direction: row-reverse;
    margin: 0;
    width: 100%;
}

.rating-dropdown-menu button {
    flex: 1;
    aspect-ratio: 1 / 1;
    box-sizing: border-box;
    border: none;
    border-right: 1px solid #242428;
    border-radius: 0;
    color: white;
    background-color: transparent;
    font-family: 'Inter';
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.1s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.rating-dropdown-menu button:first-child {
    border-right: none;
}

.rating-dropdown-menu button:hover {
    background-color: #3b3b44;
}

.delete-dropdown-container {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 44px;
}

.delete-dropdown-container summary {
    list-style: none;
    width: 100%;
    height: 100%;
    cursor: pointer;
}
.delete-dropdown-container summary::-webkit-details-marker {
    display: none;
}

.delete-dropdown-menu {
    display: none;
    position: absolute;
    bottom: 0;
    right: 100%;
    width: 231px;
    height: 132px;
    background-color: #2F2F37;
    border: 1px solid #EF2626;
    padding: 10px;
    z-index: 110;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.delete-dropdown-container[open] .delete-dropdown-menu {
    display: flex;
}

.delete-confirm-btn {
    background-color: #EF2626;
    color: white;
    border: none;
    padding: 6px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    font-family: 'Inter';
    font-size: 14px;
    transition: background-color 0.2s;
}

.delete-confirm-btn:hover {
    background-color: #F24E30;
}

.sidebar-bottom-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    width: 100%;
    height: 60px;
    text-decoration: none;
    font-family: 'Jost';
    font-size: 20px;
    font-weight: 600;
    color: white;
    background-color: transparent;
    border: none;
    border-top: 1px solid #2A2A2D;
    cursor: pointer;
    user-select: none;
    margin-top: auto;
}
.sidebar-bottom-btn:hover {
    background-color: #1a1a1e;
    transition: 0.15s;
}

.modal-sprout {
    position: absolute;
    left: 240px;
    bottom: 0;
    width: 300px;
    background-color: #121214;
    border: 1px solid #2A2A2D;
    border-left: none;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 10;
    box-shadow: 4px 4px 15px rgba(0,0,0,0.5);
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: bottom left;
}
.modal-sprout.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}
.modal-header h3 {
    margin: 0;
    font-family: 'Jost';
    font-size: 18px;
}
#close-modal-btn {
    background: none;
    border: none;
    color: #A0A0AB;
    font-size: 24px;
    cursor: pointer;
}
#close-modal-btn:hover {
    color: white;
}
#add-game-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.form-row {
    display: flex;
    gap: 10px;
}
.form-row input {
    flex: 1;
    min-width: 0;
}
#add-game-form input,
#add-game-form select,
#add-game-form textarea {
    background-color: #1A1A1E;
    border: 1px solid #2A2A2D;
    color: white;
    padding: 10px;
    border-radius: 0;
    font-family: 'Inter', sans-serif;
    outline: none;
}
#add-game-form option {
    background-color: #1A1A1E;
    color: white;
}
#add-game-form textarea {
    resize: none;
    field-sizing: content;
    max-height: 160px;
    min-height: 40px;
    scrollbar-width: thin;
    scrollbar-color: #474753 transparent;
}
#add-game-form input:focus,
#add-game-form select:focus,
#add-game-form textarea:focus {
    border-color: #FFFFFF;
}
#add-game-form input[type="file"] {
    padding: 8px;
    font-size: 13px;
    color: #A0A0AB;
    cursor: pointer;
}
#add-game-form input[type="file"]::file-selector-button {
    background-color: #2F2F37;
    border: 1px solid #2A2A2D;
    color: white;
    padding: 5px 10px;
    border-radius: 0;
    cursor: pointer;
    margin-right: 10px;
    font-family: 'Inter', sans-serif;
}
#add-game-form input[type="file"]::file-selector-button:hover {
    background-color: #474753;
}

#add-game-form input[type="number"]::-webkit-outer-spin-button,
#add-game-form input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
#add-game-form input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.add-mode-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 5px;
    background-color: #1E1E24;
    padding: 4px;
    border-radius: 0;
}

.mode-btn {
    flex: 1;
    background-color: transparent;
    color: #A0A0AB;
    border: none;
    padding: 6px 0;
    border-radius: 0;
    cursor: pointer;
    font-family: 'Inter';
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
}

.mode-btn.active {
    background-color: #474753;
    color: white;
}

.add-section-flex {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hidden-section {
    display: none !important;
}

.add-input-group-sm {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.textarea-auto-resize {
    overflow-y: hidden;
}

.char-count-label {
    font-size: 11px;
    color: #6C6C75;
    align-self: flex-end;
}

.add-input-group-md {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-label-hint {
    font-size: 12px;
    color: #A0A0AB;
    margin-left: 2px;
}

.steam-help-text {
    font-size: 11px;
    color: #6C6C75;
    margin-left: 2px;
    line-height: 1.4;
}

.modal-divider {
    border: none;
    border-top: 1px solid #474753;
    margin: 5px 0;
}

.add-submit-btn {
    margin-top: 10px;
}

.delete-summary-btn {
    color: #EF2626;
    font-size: 26px;
    line-height: 44px;
    text-align: center;
}

.delete-confirm-title {
    color: white;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 14px;
    text-align: center;
}

.delete-confirm-form {
    margin: 0;
    width: 100%;
}

.flash-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    grid-column: 1 / -1;
    margin-bottom: 20px;
}

.flash-message {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    font-family: 'Inter', sans-serif;
}

.flash-message.success {
    background-color: rgba(54, 170, 91, 0.15);
    border-color: rgba(54, 170, 91, 0.4);
    color: #4ade80;
}

.flash-message.error {
    background-color: rgba(239, 38, 38, 0.15);
    border-color: rgba(239, 38, 38, 0.4);
    color: #fca5a5;
}

.flash-message.warning {
    background-color: rgba(234, 179, 8, 0.15);
    border-color: rgba(234, 179, 8, 0.4);
    color: #fde047;
}

.flash-close {
    background: none;
    border: none;
    color: currentColor;
    font-size: 20px;
    cursor: pointer;
    padding: 0 0 0 10px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.flash-close:hover {
    opacity: 1;
}