* {
    box-sizing: border-box;
}

.vote-container {
    max-width: 1180px;
    margin: 36px auto 60px;
    padding: 0 18px;
}

.vote-container h1 {
    margin: 0 0 8px;
}

.vote-container h2,
.vote-container h3 {
    margin-top: 0;
}

.vote-intro {
    max-width: 720px;
    margin: 0 auto 32px;
    color: #cfcfcf;
    line-height: 1.5;
}

.vote-top-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    gap: 24px;
    align-items: start;
    text-align: left;
}

.vote-panel,
.rules-panel {
    padding: 22px;
}

.vote-panel label {
    display: block;
    margin-bottom: 7px;
    font-weight: bold;
}

.vote-search-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.vote-search-controls input {
    width: 100%;
    min-width: 0;
    padding: 10px 11px;
    border: 1px solid #303644;
    border-radius: 6px;
    background: #181b20;
    color: white;
    font: inherit;
}

.vote-search-controls input:focus-visible,
.vote-container button:focus-visible,
.vote-container a:focus-visible {
    outline: 2px solid #6aa9ff;
    outline-offset: 2px;
}

.muted-status {
    min-height: 20px;
    margin: 10px 0 8px;
    color: #cfcfcf;
    font-size: 14px;
}

.vote-search-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vote-search-result {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
    width: 100%;
    padding: 9px;
    border: 1px solid #303644;
    border-radius: 6px;
    background: #181b20;
    color: white;
    text-align: left;
    cursor: pointer;
}

.vote-search-result:hover,
.vote-search-result[aria-pressed="true"] {
    background: #1f2430;
}

.vote-search-result[aria-pressed="true"] {
    border-color: #6aa9ff;
}

.vote-result-thumbnail,
.selected-thumbnail {
    width: 112px;
    height: 63px;
    border-radius: 6px;
    object-fit: cover;
    background: #0c0e13;
}

.vote-result-thumbnail-fallback,
.selected-thumbnail-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #303644;
    color: #999;
    font-size: 12px;
}

.vote-result-info,
.selected-info {
    min-width: 0;
}

.vote-result-name,
.selected-name {
    color: #6aa9ff;
    font-weight: bold;
    overflow-wrap: anywhere;
}

.vote-result-creators,
.selected-creators {
    margin-top: 3px;
    color: #e0e0e0;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.vote-result-id,
.selected-id {
    margin-top: 3px;
    color: #999;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.selected-section {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #1f2430;
}

.selected-heading-row,
.leaderboard-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.selected-heading-row h3 {
    margin-bottom: 10px;
}

.small-button {
    padding: 7px 11px;
    font-size: 13px;
}

.selected-song {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid #303644;
    border-radius: 6px;
    background: #181b20;
}

.selected-name-link {
    color: #6aa9ff;
    font-weight: bold;
}

.eligibility-status {
    min-height: 42px;
    margin: 12px 0;
    color: #cfcfcf;
    line-height: 1.45;
}

.eligibility-status.success {
    color: #9fe0ae;
}

.eligibility-status.error {
    color: #ffaaaa;
}

button.primary {
    background: #356cba;
}

button.primary:hover:not(:disabled) {
    background: #437dce;
}

.vote-container button:disabled {
    cursor: default;
    opacity: 0.55;
}

.vote-button {
    width: 100%;
    font-size: 16px;
    font-weight: bold;
}

.rules-panel ul {
    margin: 0;
    padding-left: 22px;
    color: #e2e2e2;
    line-height: 1.55;
}

.rules-panel li + li {
    margin-top: 8px;
}

.reset-box {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid #1f2430;
}

.reset-label {
    color: #999;
    font-size: 13px;
}

.reset-value {
    margin-top: 3px;
    color: #6aa9ff;
    font-weight: bold;
}

.leaderboard-section {
    margin-top: 42px;
    text-align: left;
}

.leaderboard-heading-row {
    margin-bottom: 12px;
}

.leaderboard-heading-row h2 {
    margin-bottom: 4px;
}

.leaderboard-updated {
    color: #999;
    font-size: 13px;
}

.leaderboard-panel {
    overflow: hidden;
}

.leaderboard-header,
.leaderboard-row {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 100px;
    gap: 14px;
    align-items: center;
}

.leaderboard-header {
    padding: 10px 14px;
    border-bottom: 1px solid #303644;
    background: #11141a;
    color: #999;
    font-size: 13px;
    font-weight: bold;
}

.leaderboard-header div:last-child {
    text-align: right;
}

.leaderboard-rows {
    display: flex;
    flex-direction: column;
}

.leaderboard-row {
    padding: 11px 14px;
    border-bottom: 1px solid #1f2430;
    color: white;
}

.leaderboard-row:last-child {
    border-bottom: 0;
}

.leaderboard-row:hover {
    background: #1f2430;
    text-decoration: none;
}

.leaderboard-rank {
    color: #cfcfcf;
    font-weight: bold;
}

.leaderboard-name {
    color: #6aa9ff;
    font-weight: bold;
    overflow-wrap: anywhere;
}

.leaderboard-creators {
    margin-top: 2px;
    color: #999;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.leaderboard-votes {
    text-align: right;
    font-size: 18px;
    font-weight: bold;
}

.leaderboard-status {
    padding: 24px 14px;
    color: #cfcfcf;
    text-align: center;
}

.leaderboard-status:empty {
    display: none;
}

.leaderboard-pages {
    display: flex;
    align-items: center;
    gap: 5px;
}

.leaderboard-page-button {
    min-width: 38px;
    padding: 8px 10px;
}

.leaderboard-page-button[aria-current="page"] {
    background: #356cba;
}

.leaderboard-page-gap {
    padding: 0 2px;
    color: #999;
}

@media (max-width: 820px) {
    .vote-top-layout {
        grid-template-columns: 1fr;
    }

    .rules-panel {
        order: 2;
    }
}

@media (max-width: 560px) {
    .vote-container {
        margin-top: 24px;
        padding: 0 12px;
    }

    .vote-search-controls {
        grid-template-columns: 1fr;
    }

    .vote-search-result,
    .selected-song {
        grid-template-columns: 88px minmax(0, 1fr);
    }

    .vote-result-thumbnail,
    .selected-thumbnail {
        width: 88px;
        height: 50px;
    }

    .leaderboard-header,
    .leaderboard-row {
        grid-template-columns: 48px minmax(0, 1fr) 68px;
        gap: 8px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .leaderboard-votes {
        font-size: 16px;
    }

    .leaderboard-pagination {
        gap: 7px;
    }

    .leaderboard-pagination > button {
        padding-left: 10px;
        padding-right: 10px;
    }

    .leaderboard-pages .leaderboard-page-button:not([aria-current="page"]) {
        display: none;
    }

    .leaderboard-page-gap {
        display: none;
    }
}
