/* ==========================================================================
   CDA Rankings - Game Voting
   ========================================================================== */

.ranking-page {
    max-width: 860px;
    margin: 0 auto;
    padding: 2.5em 1.25em 1.5em;
}

/* Header */
.ranking-header {
    text-align: center;
    margin-bottom: 1.75em;
}

.ranking-title {
    font-size: 2.2em;
    font-weight: 800;
    margin: 0 0 0.25em;
    color: #fff;
    letter-spacing: -0.02em;
}

.ranking-description {
    color: rgba(255, 255, 255, 0.55);
    font-size: 1.05em;
    margin: 0 0 0.8em;
    line-height: 1.5;
}

.ranking-stats {
    display: flex;
    gap: 0.5em;
    justify-content: center;
    align-items: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9em;
}

.ranking-stats strong {
    color: #f86a22;
    font-weight: 700;
}

.ranking-stat-dot {
    color: rgba(255, 255, 255, 0.15);
}

/* Toolbar */
.ranking-toolbar {
    margin-bottom: 1.5em;
}

/* Search */
.ranking-search {
    position: relative;
    max-width: 100%;
}

.ranking-search input[type="text"] {
    width: 100%;
    padding: 0.85em 1em 0.85em 2.8em !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 10px;
    color: #fff;
    font-size: 0.95em;
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.ranking-search input[type="text"]:focus {
    border-color: rgba(248, 106, 34, 0.4) !important;
    background: rgba(255, 255, 255, 0.07) !important;
    box-shadow: 0 0 0 3px rgba(248, 106, 34, 0.08);
}

.ranking-search input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.ranking-search-icon {
    position: absolute;
    left: 0.85em;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.25);
    pointer-events: none;
}

/* Game list */
.ranking-list {
    display: flex;
    flex-direction: column;
}

/* Game card */
.ranking-card {
    display: flex;
    align-items: center;
    gap: 1.1em;
    padding: 0.7em 0.9em;
    border-radius: 10px;
    margin-bottom: 2px;
    transition: background 0.15s;
    will-change: transform;
}

.ranking-card:hover {
    background: rgba(255, 255, 255, 0.04);
}

.ranking-card.is-voted {
    background: rgba(248, 106, 34, 0.06);
}

.ranking-card.is-voted:hover {
    background: rgba(248, 106, 34, 0.09);
}

/* Position number */
.ranking-position {
    flex-shrink: 0;
    width: 2.5em;
    text-align: right;
    font-size: 0.9em;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.2);
    font-variant-numeric: tabular-nums;
}

.ranking-card:nth-child(-n+3) .ranking-position {
    color: #f86a22;
    font-size: 1em;
}

/* Cover */
.ranking-cover {
    flex-shrink: 0;
    width: 138px;
    height: 64px;
    border-radius: 6px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.ranking-cover img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
}

.ranking-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.15);
}

/* Info */
.ranking-info {
    flex: 1;
    min-width: 0;
}

.ranking-game-title {
    font-size: 1.05em;
    font-weight: 600;
    margin: 0;
    color: #fff;
    line-height: 1.3;
}

.ranking-game-year {
    display: inline-block;
    margin-top: 0.15em;
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.3);
}

/* Vote button */
.ranking-vote-btn {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: inherit;
    line-height: 1;
    padding: 0;
}

.ranking-vote-btn:hover {
    background: rgba(248, 106, 34, 0.12);
    border-color: rgba(248, 106, 34, 0.35);
    color: #f86a22;
    transform: translateY(-1px);
}

.ranking-vote-btn.voted {
    background: rgba(248, 106, 34, 0.14);
    border-color: #f86a22;
    color: #f86a22;
}

.ranking-vote-btn.voted:hover {
    background: rgba(248, 106, 34, 0.2);
}

.ranking-vote-btn.is-loading {
    opacity: 0.4;
    pointer-events: none;
}

.vote-arrow {
    transition: transform 0.2s;
}

.ranking-vote-btn.voted .vote-arrow {
    transform: scale(1.15);
}

.vote-count {
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

/* Empty search */
.ranking-empty-search {
    text-align: center;
    padding: 4em 1em;
    color: rgba(255, 255, 255, 0.3);
}

.ranking-empty-search p {
    margin-top: 0.75em;
    font-size: 0.95em;
}

/* Footer attribution */
.ranking-footer {
    text-align: center;
    padding: 2.5em 0 0.5em;
    color: rgba(255, 255, 255, 0.18);
    font-size: 0.75em;
}

.ranking-footer a {
    color: rgba(255, 255, 255, 0.25);
    text-decoration: none;
}

.ranking-footer a:hover {
    color: rgba(255, 255, 255, 0.45);
    text-decoration: underline;
}

/* ==========================================================================
   Light mode
   ========================================================================== */

.lights-on .ranking-title {
    color: #23212c;
}

.lights-on .ranking-description {
    color: rgba(0, 0, 0, 0.45);
}

.lights-on .ranking-stats {
    color: rgba(0, 0, 0, 0.35);
}

.lights-on .ranking-stat-dot {
    color: rgba(0, 0, 0, 0.12);
}

.lights-on .ranking-search input[type="text"] {
    background: rgba(0, 0, 0, 0.03) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    color: #23212c;
}

.lights-on .ranking-search input[type="text"]:focus {
    background: #fff !important;
    border-color: rgba(248, 106, 34, 0.4) !important;
    box-shadow: 0 0 0 3px rgba(248, 106, 34, 0.06);
}

.lights-on .ranking-search input[type="text"]::placeholder {
    color: rgba(0, 0, 0, 0.3);
}

.lights-on .ranking-search-icon {
    color: rgba(0, 0, 0, 0.25);
}

.lights-on .ranking-card:hover {
    background: rgba(0, 0, 0, 0.025);
}

.lights-on .ranking-card.is-voted {
    background: rgba(248, 106, 34, 0.04);
}

.lights-on .ranking-card.is-voted:hover {
    background: rgba(248, 106, 34, 0.07);
}

.lights-on .ranking-position {
    color: rgba(0, 0, 0, 0.18);
}

.lights-on .ranking-card:nth-child(-n+3) .ranking-position {
    color: #f86a22;
}

.lights-on .ranking-cover {
    background: #000;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.lights-on .ranking-cover-placeholder {
    color: rgba(0, 0, 0, 0.12);
}

.lights-on .ranking-game-title {
    color: #23212c;
}

.lights-on .ranking-game-year {
    color: rgba(0, 0, 0, 0.35);
}

.lights-on .ranking-vote-btn {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.35);
}

.lights-on .ranking-vote-btn:hover {
    background: rgba(248, 106, 34, 0.08);
    border-color: rgba(248, 106, 34, 0.3);
    color: #f86a22;
}

.lights-on .ranking-vote-btn.voted {
    background: rgba(248, 106, 34, 0.08);
    border-color: #f86a22;
    color: #f86a22;
}

.lights-on .ranking-vote-btn.voted:hover {
    background: rgba(248, 106, 34, 0.14);
}

.lights-on .ranking-empty-search {
    color: rgba(0, 0, 0, 0.25);
}

.lights-on .ranking-footer {
    color: rgba(0, 0, 0, 0.15);
}

.lights-on .ranking-footer a {
    color: rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 600px) {
    .ranking-page {
        padding: 1.5em 0.75em 1em;
    }

    .ranking-title {
        font-size: 1.6em;
    }

    .ranking-description {
        font-size: 0.95em;
    }

    .ranking-card {
        gap: 0.7em;
        padding: 0.6em 0.5em;
    }

    .ranking-position {
        width: 1.8em;
        font-size: 0.85em;
    }

    .ranking-cover {
        width: 103px;
        height: 48px;
    }

    .ranking-game-title {
        font-size: 0.92em;
    }

    .ranking-vote-btn {
        width: 48px;
        height: 48px;
    }

    .ranking-vote-btn .vote-arrow {
        width: 16px;
        height: 16px;
    }

    .vote-count {
        font-size: 0.7em;
    }
}
