/* Ranking Overlay & Modal */
.ranking-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.ranking-modal {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #333;
    font-family: 'Outfit', sans-serif;
}

.ranking-modal h2 {
    color: #4a2c2a;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

/* Score Display */
.score-display {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
}

.score-display p {
    margin: 0.5rem 0;
    color: #64748b;
    font-size: 1rem;
}

.score-display p.final-score {
    font-size: 1.8rem;
    color: #ec4899;
    /* Pink */
    font-weight: bold;
    margin-top: 0.5rem;
}

.penalty {
    color: #ef4444 !important;
    font-weight: bold;
}

/* Input Group */
.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #64748b;
}

.input-group input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1.2rem;
    text-align: center;
    transition: 0.2s;
    font-family: inherit;
}

.input-group input:focus {
    border-color: #ec4899;
    outline: none;
}

/* Buttons */
.btn-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.ranking-modal .primary-btn,
.ranking-modal .secondary-btn {
    padding: 0.8rem 1.5rem;
    width: auto;
    font-size: 0.9rem;
}

.ranking-modal .secondary-btn {
    color: #64748b;
    border-color: #cbd5e1;
}

/* Leaderboard */
.leaderboard {
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.rank-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
    overflow-y: auto;
    max-height: 300px;
    border-top: 1px solid #e2e8f0;
}

.rank-item {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 1rem;
}

.rank-item:nth-child(even) {
    background: #f8fafc;
}

.rank-item.top-rank {
    font-weight: bold;
    color: #0f172a;
    background: #fff1f2;
    /* Light Pink tint */
}

.rank-num {
    width: 30px;
    text-align: center;
    font-weight: bold;
    color: #ec4899;
}

.rank-name {
    flex: 1;
    text-align: left;
    margin: 0 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-score {
    font-family: monospace;
    font-weight: 600;
}

.no-data {
    padding: 2rem;
    color: #94a3b8;
    font-style: italic;
}