/* Стили страницы «Общедоступные Билды». Переменные берутся из styles.css. */

.topnav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 9px 16px;
    border: 1px solid rgba(183, 105, 255, .3);
    border-radius: 14px;
    color: #d7c9e0;
    text-decoration: none;
    font-weight: 700;
    background: linear-gradient(180deg, rgba(45, 25, 63, .9), rgba(16, 10, 23, .95));
    transition: all .2s ease;
}

.nav-link:hover {
    border-color: rgba(210, 151, 255, .62);
    color: #fff;
    transform: translateY(-2px);
}

.nav-link.active {
    border-color: rgba(206, 146, 255, .55);
    color: #fff;
    background: linear-gradient(180deg, rgba(86, 42, 119, .72), rgba(34, 19, 47, .9));
    box-shadow: 0 0 24px rgba(132, 47, 214, .2);
}

.public-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    min-height: 44px;
}

.auth-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tg-login-btn,
.add-build-btn {
    font: inherit;
    font-weight: 700;
    color: #fff;
    border: 1px solid rgba(206, 146, 255, .48);
    border-radius: 14px;
    padding: 9px 18px;
    cursor: pointer;
    background: linear-gradient(180deg, rgba(86, 42, 119, .72), rgba(34, 19, 47, .9));
    transition: all .2s ease;
}

.tg-login-btn:hover,
.add-build-btn:hover {
    border-color: rgba(215, 155, 255, .75);
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(91, 35, 142, .22);
}

.add-build-btn.full {
    width: 100%;
    margin-top: 14px;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 5px 6px 5px 5px;
    border: 1px solid rgba(183, 105, 255, .28);
    border-radius: 999px;
    background: rgba(14, 10, 20, .6);
    backdrop-filter: blur(4px);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, rgba(44, 27, 58, .78), rgba(12, 8, 17, .92));
    color: #d9b5ff;
    font-weight: 800;
    overflow: hidden;
}

.user-avatar.empty {
    border: 1px solid rgba(183, 105, 255, .3);
}

.user-name {
    color: #f0e5f7;
    font-weight: 700;
    font-size: 14px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-btn {
    border: 1px solid rgba(255, 50, 50, .3);
    background: rgba(255, 50, 50, .1);
    color: #ff7b7b;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
}

.logout-btn:hover {
    background: rgba(255, 50, 50, .2);
    border-color: rgba(255, 50, 50, .5);
}

.builds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    align-items: start;
}

.build-card {
    background: linear-gradient(155deg, rgba(29, 18, 40, .94), rgba(10, 7, 15, .98));
    backdrop-filter: blur(12px);
    border: 1px solid rgba(183, 105, 255, .3);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 16px 38px rgba(0, 0, 0, .42), inset 0 1px rgba(255, 255, 255, .025);
    transition: border-color .22s ease, box-shadow .22s ease;
}

.build-card:hover {
    border-color: rgba(210, 151, 255, .62);
    box-shadow: 0 24px 52px rgba(0, 0, 0, .52), 0 0 34px rgba(132, 47, 214, .17);
}

.build-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.build-card-title h3 {
    margin: 0 0 4px;
    color: #f0e5f7;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.build-card-title small {
    color: #9e91a8;
    font-size: 12px;
}

.build-delete {
    flex: 0 0 auto;
    border: 1px solid rgba(255, 50, 50, .3);
    background: rgba(255, 50, 50, .1);
    color: #ff7b7b;
    border-radius: 12px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s ease;
}

.build-delete:hover {
    background: rgba(255, 50, 50, .2);
    border-color: rgba(255, 50, 50, .5);
}

.build-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rate-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(183, 105, 255, .3);
    background: rgba(14, 10, 20, .6);
    color: #d7c9e0;
    border-radius: 12px;
    padding: 8px 13px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s ease;
}

.rate-btn:hover {
    border-color: rgba(210, 151, 255, .62);
    transform: translateY(-1px);
}

.rate-btn.like.active {
    border-color: rgba(96, 184, 134, .6);
    background: rgba(96, 184, 134, .14);
    color: #bfe8cf;
    box-shadow: 0 0 22px rgba(96, 184, 134, .12);
}

.rate-btn.dislike.active {
    border-color: rgba(255, 111, 120, .6);
    background: rgba(255, 111, 120, .14);
    color: #ffb2bd;
    box-shadow: 0 0 22px rgba(255, 111, 120, .12);
}

.rate-btn .count {
    font-variant-numeric: tabular-nums;
}

.open-build {
    margin-left: auto;
    text-decoration: none;
    color: #d9b5ff;
    font-weight: 700;
    font-size: 13px;
    padding: 8px 12px;
    border: 1px solid rgba(183, 105, 255, .26);
    border-radius: 12px;
    background: rgba(168, 77, 255, .08);
    transition: all .2s ease;
}

.open-build:hover {
    border-color: rgba(210, 151, 255, .6);
    color: #fff;
}

.comments-toggle {
    border: 1px solid rgba(183, 105, 255, .26);
    background: rgba(14, 10, 20, .6);
    color: #d7c9e0;
    border-radius: 12px;
    padding: 8px 13px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s ease;
}

.comments-toggle:hover {
    border-color: rgba(210, 151, 255, .6);
}

.comments-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(183, 105, 255, .16);
}

.comments-loading,
.comments-empty,
.comment-login-hint {
    color: #82788f;
    font-size: 13px;
    padding: 10px 0;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
    max-height: 360px;
    overflow-y: auto;
}

.comment {
    background: rgba(14, 10, 20, .4);
    border: 1px solid rgba(183, 105, 255, .16);
    border-radius: 14px;
    padding: 12px 14px;
}

.comment-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.comment-head b {
    color: #e6daf0;
    font-size: 14px;
}

.comment-head small {
    color: #746a7e;
    font-size: 11px;
}

.comment-delete {
    margin-left: auto;
    width: 26px;
    height: 26px;
    border: 1px solid rgba(255, 50, 50, .3);
    background: rgba(255, 50, 50, .1);
    color: #ff7b7b;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.comment-delete:hover {
    background: rgba(255, 50, 50, .2);
}

.comment-text {
    margin: 0;
    color: #d2c9db;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-form textarea {
    min-height: 64px;
    resize: vertical;
    padding: 12px 14px;
    background: rgba(10, 8, 13, .8);
    border: 1px solid rgba(183, 105, 255, .25);
    border-radius: 14px;
    color: #fff;
    font: inherit;
    outline: none;
    transition: border-color .2s ease;
}

.comment-form textarea:focus {
    border-color: rgba(201, 139, 255, .6);
    box-shadow: 0 0 0 3px rgba(154, 75, 232, .1);
}

.comment-form button {
    align-self: flex-end;
    border: 1px solid rgba(206, 146, 255, .48);
    background: linear-gradient(180deg, rgba(86, 42, 119, .72), rgba(34, 19, 47, .9));
    color: #fff;
    border-radius: 12px;
    padding: 9px 20px;
    font-weight: 700;
    cursor: pointer;
}

.comment-form button:hover {
    border-color: rgba(215, 155, 255, .75);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 40px 20px;
    border: 1px solid rgba(183, 105, 255, .22);
    border-radius: 20px;
    background: linear-gradient(155deg, rgba(21, 13, 29, .94), rgba(10, 7, 15, .97));
    color: #c9bbd4;
    text-align: center;
}

.empty-state b {
    color: #eee6f8;
    font-size: 18px;
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.field > span {
    color: #c8a0ef;
    font-size: 13px;
    font-weight: 700;
}

.field input,
.field textarea {
    padding: 12px 14px;
    background: rgba(10, 8, 13, .8);
    border: 1px solid rgba(183, 105, 255, .25);
    border-radius: 14px;
    color: #fff;
    font: inherit;
    outline: none;
    transition: border-color .2s ease;
    resize: vertical;
}

.field input:focus,
.field textarea:focus {
    border-color: rgba(201, 139, 255, .6);
    box-shadow: 0 0 0 3px rgba(154, 75, 232, .1);
}

.field-hint {
    margin: 0 0 4px;
    color: #82788f;
    font-size: 12px;
    line-height: 1.5;
}

.field-hint code {
    color: #c8a0ef;
    background: rgba(168, 77, 255, .1);
    padding: 1px 6px;
    border-radius: 6px;
}

@media (max-width: 620px) {
    .builds-grid {
        grid-template-columns: 1fr;
    }
    .user-name {
        max-width: 90px;
    }
    .open-build {
        margin-left: 0;
    }
}
