.home-chart-section {
    overflow: hidden;
    border-color: rgba(105, 216, 206, 0.28);
    background:
        linear-gradient(110deg, rgba(10, 13, 16, 0.97), rgba(25, 14, 31, 0.91)),
        url("../images/magic407-studio-banner-v1.png") right center / cover no-repeat;
}

.home-chart-section [hidden] {
    display: none !important;
}

.home-chart-head {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    overflow: hidden;
    gap: 24px;
    margin-bottom: 14px;
    padding: 18px 20px;
    border: 1px solid rgba(255, 177, 93, 0.5);
    border-left: 4px solid #ffb15d;
    border-radius: 6px;
    background:
        linear-gradient(100deg, rgba(4, 6, 8, 0.98), rgba(74, 37, 13, 0.34) 58%, rgba(14, 10, 22, 0.96));
    box-shadow:
        0 15px 38px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 220, 162, 0.12);
}

.home-chart-head::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    content: "";
    background: linear-gradient(90deg, #ffb15d 0 58%, #69d8ce 78%, transparent);
}

.home-chart-brand {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: center;
    min-width: 0;
    gap: 17px;
}

.home-chart-brand > div {
    min-width: 0;
}

.home-chart-logo {
    width: 88px;
    height: 88px;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.48));
}

.home-chart-head h2 {
    margin: 0;
    color: #fffaf1;
    font-size: clamp(1.65rem, 2.15vw, 2.3rem);
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
    text-shadow: 0 0 22px rgba(255, 177, 93, 0.16);
}

.home-chart-head p:last-child {
    max-width: 720px;
    margin: 9px 0 0;
    font-size: 0.9rem;
    line-height: 1.45;
}

.home-chart-head .eyebrow {
    margin-bottom: 7px;
    color: #f3c17e;
    font-size: 0.66rem;
    font-weight: 900;
}

.home-chart-round {
    display: grid;
    min-width: 184px;
    gap: 3px;
    padding: 11px 16px;
    border: 1px solid rgba(105, 216, 206, 0.34);
    border-left: 3px solid #69d8ce;
    border-radius: 4px;
    background: rgba(4, 9, 12, 0.58);
}

.home-chart-round span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.home-chart-round strong {
    color: #fff;
    font-size: 1.45rem;
    line-height: 1;
}

.home-chart-status {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 130px;
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--muted);
    font-weight: 800;
}

.home-chart-status svg {
    width: 20px;
    color: var(--orange-soft);
    animation: home-chart-spin 1.1s linear infinite;
}

.home-chart-status.is-error svg {
    animation: none;
}

.home-chart-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-right: 1px solid rgba(255, 138, 42, 0.3);
    border-left: 1px solid rgba(255, 138, 42, 0.3);
}

.home-chart-item {
    display: grid;
    grid-template-columns: 40px 54px minmax(0, 1fr) 64px 104px;
    align-items: center;
    gap: 12px;
    min-height: 94px;
    padding: 9px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
}

.home-chart-item.is-alarm {
    border-left: 3px solid #f3c17e;
    background: linear-gradient(90deg, rgba(220, 155, 84, 0.14), rgba(211, 83, 185, 0.06), rgba(255, 255, 255, 0.02));
}

.home-chart-position {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    justify-self: center;
    border: 1px solid var(--orange-soft);
    border-radius: 50%;
    color: var(--orange-soft);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.home-chart-position::before {
    content: none;
}

.home-chart-item:nth-child(even) .home-chart-position {
    border-color: #69d8ce;
    color: #69d8ce;
}

.home-chart-list > .home-chart-item:first-child {
    border-top: 1px solid rgba(255, 238, 157, 0.72);
    background:
        linear-gradient(90deg, rgba(255, 205, 72, 0.36), rgba(190, 126, 22, 0.17) 48%, rgba(255, 235, 151, 0.035));
    box-shadow:
        inset 3px 0 0 #ffd45f,
        inset 0 0 46px rgba(255, 211, 95, 0.13);
}

.home-chart-list > .home-chart-item:first-child .home-chart-position {
    border-color: #fff2ad;
    color: #211300;
    background: linear-gradient(145deg, #fff4b8, #f2c744 58%, #b97708);
    box-shadow: 0 0 20px rgba(255, 215, 101, 0.42);
    font-weight: 900;
}

.home-chart-list > .home-chart-item:nth-child(2) {
    background:
        linear-gradient(90deg, rgba(205, 214, 224, 0.2), rgba(98, 108, 120, 0.1) 48%, rgba(255, 255, 255, 0.02));
    box-shadow:
        inset 3px 0 0 #d9e0e8,
        inset 0 0 42px rgba(214, 222, 232, 0.06);
}

.home-chart-list > .home-chart-item:nth-child(2) .home-chart-position {
    border-color: #f1f4f7;
    color: #111419;
    background: linear-gradient(145deg, #f5f7fa, #aeb7c1 58%, #6f7984);
    box-shadow: 0 0 16px rgba(217, 224, 232, 0.22);
    font-weight: 900;
}

.home-chart-list > .home-chart-item:nth-child(3) {
    background:
        linear-gradient(90deg, rgba(178, 105, 50, 0.24), rgba(99, 55, 24, 0.12) 48%, rgba(255, 255, 255, 0.02));
    box-shadow:
        inset 3px 0 0 #c57a3e,
        inset 0 0 42px rgba(180, 105, 50, 0.07);
}

.home-chart-list > .home-chart-item:nth-child(3) .home-chart-position {
    border-color: #e6ad78;
    color: #180d06;
    background: linear-gradient(145deg, #e7aa72, #a75f2c 58%, #683718);
    box-shadow: 0 0 16px rgba(197, 122, 62, 0.24);
    font-weight: 900;
}

.home-chart-cover {
    width: 54px;
    height: 54px;
}

.home-chart-cover img {
    width: 100%;
    height: 100%;
    border: 1px solid rgba(255, 138, 42, 0.35);
    border-radius: 6px;
    object-fit: cover;
    background: #09090d;
}

.home-chart-preview {
    display: flex;
    grid-area: player;
    order: 4;
    align-items: center;
    width: min(100%, 330px);
    gap: 6px;
    margin-top: 3px;
}

.home-chart-preview button {
    display: grid;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    place-items: center;
    padding: 0;
    border: 1px solid #ffb15d;
    border-radius: 50%;
    color: #18100a;
    background: #ffb15d;
    cursor: pointer;
}

.home-chart-preview button.is-playing {
    border-color: #69d8ce;
    background: #69d8ce;
}

.home-chart-preview button svg {
    width: 12px;
    fill: currentColor;
}

.home-chart-preview input[type="range"] {
    min-width: 72px;
    flex: 1 1 auto;
    height: 16px;
    margin: 0;
    accent-color: #ff9a3d;
    cursor: pointer;
}

.home-chart-preview span {
    flex: 0 0 56px;
    color: var(--muted);
    font-size: 0.6rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.home-chart-copy {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "artist badges"
        "title title"
        "player player";
    align-items: center;
    column-gap: 8px;
    row-gap: 1px;
    min-width: 0;
}

.home-chart-copy h3 {
    grid-area: title;
    order: 2;
    overflow: hidden;
    margin: 2px 0 0;
    color: #f8f5ef;
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: 0;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.home-chart-copy p {
    grid-area: artist;
    order: 1;
    overflow: hidden;
    margin: 0;
    color: #e9a458;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1.1;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.home-chart-item:nth-child(even) .home-chart-copy p {
    color: #69d8ce;
}

.home-chart-list > .home-chart-item:first-child .home-chart-copy p {
    color: #ffd45f;
}

.home-chart-list > .home-chart-item:nth-child(2) .home-chart-copy p {
    color: #e3e9ef;
}

.home-chart-list > .home-chart-item:nth-child(3) .home-chart-copy p {
    color: #d98a4b;
}

.home-chart-badges {
    display: flex;
    grid-area: badges;
    order: 3;
    align-items: center;
    justify-self: end;
    flex-wrap: nowrap;
    gap: 4px;
    margin-top: 0;
}

.home-chart-badges > span {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    gap: 4px;
    padding: 1px 5px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 4px;
    color: var(--muted);
    font-size: 0.54rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.home-chart-badges > span.is-up {
    border-color: rgba(52, 211, 153, 0.42);
    color: #63d69d;
}

.home-chart-badges > span.is-down {
    border-color: rgba(255, 132, 125, 0.42);
    color: #ff847d;
}

.home-chart-badges > span.is-new,
.home-chart-badges > span.is-alarm {
    border-color: rgba(243, 193, 126, 0.48);
    color: #f3c17e;
}

.home-chart-badges svg {
    width: 12px;
}

.home-chart-votes {
    text-align: center;
}

.home-chart-votes strong,
.home-chart-votes span {
    display: block;
}

.home-chart-votes strong {
    font-size: 1.25rem;
}

.home-chart-votes span {
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 800;
}

.home-chart-vote {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 104px;
    min-height: 38px;
    gap: 7px;
    border: 1px solid rgba(255, 138, 42, 0.72);
    border-radius: 6px;
    color: #160d08;
    background: #ff9a3d;
    font-weight: 900;
    cursor: pointer;
}

.home-chart-vote svg {
    width: 16px;
}

.home-chart-vote.is-voted {
    border-color: rgba(52, 211, 153, 0.5);
    color: #63d69d;
    background: rgba(52, 211, 153, 0.1);
}

.home-chart-vote.is-voted svg {
    fill: currentColor;
}

.home-chart-vote:disabled {
    opacity: 0.68;
    cursor: default;
}

.home-chart-alarm {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px 16px;
    border-top: 1px solid rgba(243, 193, 126, 0.35);
    border-bottom: 1px solid rgba(243, 193, 126, 0.35);
    background: linear-gradient(90deg, rgba(220, 155, 84, 0.15), rgba(211, 83, 185, 0.08), transparent);
}

.home-chart-alarm > svg {
    width: 26px;
    color: #f3c17e;
}

.home-chart-alarm div {
    display: grid;
    gap: 2px;
}

.home-chart-alarm span {
    color: #f3c17e;
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
}

.home-chart-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-top: 20px;
}

.home-chart-footer > span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.home-chart-footer .text-link {
    gap: 8px;
}

.home-chart-footer svg {
    width: 17px;
}

@keyframes home-chart-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 760px) {
    .home-chart-head {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 16px;
    }

    .home-chart-round {
        min-width: 0;
        padding: 10px 12px;
        border-top: 1px solid rgba(105, 216, 206, 0.34);
        border-left: 3px solid #69d8ce;
    }

    .home-chart-brand {
        grid-template-columns: 68px minmax(0, 1fr);
        gap: 12px;
    }

    .home-chart-logo {
        width: 68px;
        height: 68px;
    }

    .home-chart-item {
        grid-template-columns: 32px 50px minmax(0, 1fr);
        gap: 8px;
        padding-block: 10px;
    }

    .home-chart-cover {
        width: 50px;
        height: 50px;
    }

    .home-chart-copy {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "artist"
            "title"
            "badges"
            "player";
    }

    .home-chart-badges {
        justify-self: start;
        margin-top: 3px;
    }

    .home-chart-votes {
        grid-column: 2;
        text-align: left;
    }

    .home-chart-votes strong,
    .home-chart-votes span {
        display: inline;
    }

    .home-chart-vote {
        grid-column: 3;
        grid-row: 2;
        justify-self: end;
        width: 98px;
        min-height: 36px;
    }

    .home-chart-preview {
        gap: 6px;
    }

    .home-chart-preview span {
        flex-basis: 57px;
        font-size: 0.54rem;
    }

    .home-chart-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-chart-status svg {
        animation: none;
    }
}
