@font-face {
    font-family: "PTSans-Bold";
    font-weight: 700;
    font-style: normal;
    src: local("PTSans-Bold"),
         url("../fonts/PTSans-Bold.woff2") format("woff2"),
         url("../fonts/PTSans-Bold.woff") format("woff");
    font-display: swap;
}

html {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

*,
*::after,
*::before {
    -webkit-box-sizing: inherit;
    box-sizing: inherit;
}

ul[class],
ol[class] {
    padding: 0;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
ul[class],
ol[class],
li,
figure,
figcaption,
blockquote,
dl,
dd {
    margin: 0;
}

ul[class] {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

input,
button,
textarea,
select {
    font: inherit;
}

a {
    text-decoration: none;
}

.wrapper {
    min-height: 100vh;
    background-color: #63798a;
    padding: 24px 20px;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

.title {
    font-family: "Nunito", sans-serif;
    font-weight: 600;
    font-size: 28px;
    line-height: 28px;
    text-align: center;
    color: #fff;
    margin-bottom: 18px;
}

.title span {
    display: block;
    color: #ffe70f;
}

.card {
    background-color: #fff;
    border-radius: 22px;
    padding: 16px;
    z-index: 1;
    position: relative;
}

.card::before {
    content: "";
    position: absolute;
    bottom: -12px;
    left: 0;
    right: 0;
    height: 80%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 22px;
    z-index: -1;
}

.card::after {
    content: "";
    position: absolute;
    bottom: -24px;
    left: 0;
    right: 0;
    height: 80%;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 22px;
    z-index: -1;
}

.card:not(:last-child) {
    margin-bottom: 48px;
}

.card__inner {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: start;
    -ms-flex-align: start;
    align-items: flex-start;
    padding-bottom: 16px;
    border-bottom: 1px solid #eef2f7;
}

.card__avatar {
    display: block;
    width: 106px;
    height: 106px;
    border-radius: 50%;
    border: 1px solid #dee2e6;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    overflow: hidden;
    margin-right: 8px;
}

.card__avatar img {
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
    object-fit: cover;
}

.card__box {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: start;
    -ms-flex-align: start;
    align-items: flex-start;
    width: 100%;
}

.card__title {
    font-family: "Nunito", sans-serif;
    font-size: 24px;
    line-height: 22px;
    font-weight: 700;
    color: #474d56;
    margin-bottom: 12px;
}

/* Рейтинг на отдельной строке */
.card__rating-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    width: 100%;
}

.card__rating-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card__rating-stars {
    position: relative;
    display: inline-block;
    width: 143px;
    height: 25px;
    flex-shrink: 0;
}

.card__rating-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    background-image: url("../images/star-fill.svg");
    background-size: 143px 25px;
    z-index: 1;
}

.card__rating-meter {
    position: absolute;
    left: 0;
    top: 0;
    width: 143px;
    height: 25px;
    background-image: url("../images/star.svg");
    background-position: left top;
    z-index: 0;
}

/* Цифровое значение рейтинга */
.card__rating-value {
    font-family: "Nunito", sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #474d56;
    background: rgba(255, 231, 15, 0.1);
    padding: 3px 8px;
    border-radius: 6px;
    min-width: 40px;
    text-align: center;
}

/* Обновляем ширину для разных рейтингов */
.card__rating-fill[data-rating="1"] { width: 20%; }
.card__rating-fill[data-rating="2"] { width: 40%; }
.card__rating-fill[data-rating="3"] { width: 60%; }
.card__rating-fill[data-rating="4"] { width: 80%; }
.card__rating-fill[data-rating="5"] { width: 100%; }

.card__channel {
    display: inline-block;
    font-family: "Nunito", sans-serif;
    font-size: 14px;
    line-height: 21px;
    color: #44badc;
    font-weight: 400;
}

.card__text {
    padding: 16px 6%;
    font-family: "Nunito", sans-serif;
    font-size: 15px;
    line-height: 22px;
    color: #7f8894;
    font-weight: 400;
    text-align: justify;
    margin: 0 -16px;	
}

.card__text a {
    display: inline-block;
    text-decoration: underline;
    -webkit-text-decoration-skip-ink: none;
    text-decoration-skip-ink: none;
    color: #44badc;
}

/* Кнопка Посмотреть */
.card__view {
    display: block;
    text-align: center;
    background-color: #2ab885;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 15px 31px;
    font-family: "Nunito", sans-serif;
    font-size: 18px;
    line-height: 25px;
    color: #fff;
    font-weight: 500;
    -webkit-transition: .2s ease-out;
    transition: .2s ease-out;
    min-width: 160px;
    flex-shrink: 0;
}

.card__view:hover {
    background-color: #259f73;
}

/* Стили для голосования */
.card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eef2f7;
}

.card__vote {
    display: flex;
    gap: 10px;
}

.vote-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s ease;
    padding: 0;
}

.vote-btn:hover:not(:disabled) {
    transform: scale(1.1);
}

.vote-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.vote-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.vote-btn--up {
    color: #6c757d;
    border-color: #dee2e6;
}

.vote-btn--up:hover:not(:disabled) {
    border-color: #2ab885;
    color: #2ab885;
}

.vote-btn--up.vote-btn--active {
    background-color: #2ab885;
    border-color: #2ab885;
    color: white;
}

.vote-btn--down {
    color: #6c757d;
    border-color: #dee2e6;
}

.vote-btn--down:hover:not(:disabled) {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.vote-btn--down.vote-btn--active {
    background-color: #ff6b6b;
    border-color: #ff6b6b;
    color: white;
}

.vote-icon {
    font-size: 20px;
    line-height: 1;
}

/* Кнопка сброса голосов (только для отладки) */
.reset-votes-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    z-index: 1000;
    font-size: 12px;
    opacity: 0.7;
}

.reset-votes-btn:hover {
    opacity: 1;
}

/* Адаптивность */
@media (max-width: 768px) {
    .card__rating-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .card__rating-wrapper {
        width: 100%;
        justify-content: space-between;
    }
    
    .card__rating-stars {
        width: 120px;
        height: 21px;
    }
    
    .card__rating-fill,
    .card__rating-meter {
        width: 120px;
        height: 21px;
        background-size: 120px 21px;
    }
    
    .card__rating-value {
        font-size: 14px;
        padding: 2px 6px;
    }
    
    .card__inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .card__avatar {
        margin-right: 0;
        margin-bottom: 16px;
    }
    
    .card__box {
        align-items: center;
    }
    
    .card__footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .card__vote {
        justify-content: center;
    }
    
    .vote-btn {
        width: 40px;
        height: 40px;
    }
    
    .card__view {
        width: 100%;
        min-width: auto;
        margin: 0;
    }
}

@media (max-width: 480px) {
    .card__rating-stars {
        width: 100px;
        height: 18px;
    }
    
    .card__rating-fill,
    .card__rating-meter {
        width: 100px;
        height: 18px;
        background-size: 100px 18px;
    }
    
    .vote-btn {
        width: 36px;
        height: 36px;
    }
    
    .vote-icon {
        font-size: 16px;
    }
    
    .card__view {
        padding: 12px 20px;
        font-size: 16px;
    }
}