body {
    background-color: #1a181d;
    background-image: url('https://cs-studios.net/img/stonewall.png'), linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5));
    color: #e0e0e0;
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(40, 37, 46, 0.85);
    border: 2px solid #b39454;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
    padding: 20px 40px;
}

h1,
h2 {
    font-family: 'MedievalSharp', cursive;
    color: #ffd700;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
    text-align: center;
    border-bottom: 1px solid #b39454;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

h1 {
    font-size: 3.5rem;
    margin-bottom: 0;
}

.subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: #c0c0c0;
    margin-top: 5px;
    margin-bottom: 40px;
}

section {
    margin-bottom: 50px;
}

@keyframes shimmer {
    0% {
        background-color: rgba(255, 255, 255, 0.05);
    }

    50% {
        background-color: rgba(255, 255, 255, 0.1);
    }

    100% {
        background-color: rgba(255, 255, 255, 0.05);
    }
}

.loading-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.loading-container .placeholder {
    width: 250px;
    height: 200px;
    background: #333;
    border-radius: 10px;
    animation: shimmer 1.5s infinite;
}

#podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    min-height: 350px;
}

.podium-place {
    text-align: center;
    width: 250px;
}

.podium-place .frame {
    background: linear-gradient(45deg, #a07c3b, #ffd700, #a07c3b);
    border: 5px solid #6b5523;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.podium-place img {
    width: 128px;
    height: 128px;
    border-radius: 5px;
}

.podium-place .banner {
    background-image: url('https://cs-studios.net/img/banner.png');
    background-size: 100% 100%;
    padding: 15px;
    margin-top: -10px;
    color: #4a3c1f;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 50% 100%, 0 85%);
    min-height: 120px;
}

.podium-place .name {
    font-family: 'MedievalSharp', cursive;
    font-size: 1.8rem;
    font-weight: bold;
    margin-top: 10px;
}

.podium-place .title {
    font-size: 1.1rem;
    font-style: italic;
    color: #6c582c;
}

.podium-place .value {
    font-size: 1rem;
    font-weight: bold;
    margin-top: 5px;
}

.podium-place.rank-1 {
    order: 2;
    transform: translateY(-40px);
}

.podium-place.rank-2 {
    order: 1;
}

.podium-place.rank-3 {
    order: 3;
}

.podium-place.rank-1 .frame {
    background: linear-gradient(45deg, #ffd700, #fff2a8, #ffd700);
}

.podium-place.rank-2 .frame {
    background: linear-gradient(45deg, #c0c0c0, #e8e8e8, #c0c0c0);
}

.podium-place.rank-3 .frame {
    background: linear-gradient(45deg, #cd7f32, #e8a86f, #cd7f32);
}

#podium-runners-up {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.runners-up-list {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #7a6332;
    border-radius: 8px;
    padding: 10px 20px;
    min-width: 300px;
}

.runner-up-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 15px;
}

.runner-up-row:last-child {
    border-bottom: none;
}

.rank-number {
    font-weight: bold;
    color: #b39454;
    width: 25px;
}

.runner-head img {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    vertical-align: middle;
}

.runner-name {
    flex-grow: 1;
    color: #e0e0e0;
}

.runner-value {
    font-weight: bold;
    color: #ffd700;
}

#legends-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.legend-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #7a6332;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.card-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: opacity 0.3s;
}

.legend-hover-details {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 24, 29, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 10px;
    box-sizing: border-box;
    opacity: 0;
    overflow-y: auto;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
    scrollbar-width: none;
}

.legend-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.legend-card h3 {
    margin: 0 0 5px 0;
    color: #e8c97e;
    font-family: 'MedievalSharp', cursive;
    font-size: 1.5rem;
}

.legend-card .description {
    font-size: 0.9rem;
    color: #b0b0b0;
    font-style: italic;
    margin-bottom: 15px;
    flex-grow: 1;
}

.legend-card .player-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.legend-card img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #b39454;
}

.legend-card .player-name {
    font-weight: bold;
    font-size: 1.1rem;
}

.legend-card .stat-value {
    margin-top: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
}

.legend-card:hover .legend-hover-details {
    opacity: 1;
    pointer-events: auto;
}

.legend-card:hover .card-content {
    opacity: 0.2;
    filter: blur(2px);
}

.legend-hover-details::-webkit-scrollbar {
    width: 4px;
}

.legend-hover-details::-webkit-scrollbar-thumb {
    background: #555;
}

.hover-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    border-bottom: 1px solid #444;
    padding-bottom: 4px;
    font-size: 0.85rem;
}

.hover-row:last-child {
    border: none;
}

.hover-row.rank-gold .hover-rank,
.hover-row.rank-gold .hover-name,
.hover-row.rank-gold .hover-val {
    color: #ffd700;
    font-weight: bold;
}

.hover-rank {
    color: #b39454;
    margin-right: 8px;
    font-weight: bold;
    min-width: 20px;
}

.hover-row img {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border-radius: 2px;
}

.hover-name {
    flex-grow: 1;
    color: #ccc;
}

.hover-val {
    color: #ffd700;
    font-size: 0.85rem;
}

.more-indicator {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: #555;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-5px);
    }

    60% {
        transform: translateX(-50%) translateY(-3px);
    }
}

#advancements-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.tab {
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #7a6332;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
    text-transform: capitalize;
}

.tab:hover,
.tab.active {
    background-color: #b39454;
    color: #1a181d;
    font-weight: bold;
}

#advancements-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.advancement-tile {
    background: #2b2830;
    padding: 10px;
    border-radius: 5px;
    border-left: 5px solid #555;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 80px;
    opacity: 0.6;
}

.advancement-tile.achieved {
    background: #3c3846;
    border-left-color: #ffd700;
    opacity: 1;
}

.advancement-tile.achieved .adv-title {
    color: #ffd700;
}

.adv-title {
    font-weight: bold;
    color: #999;
}

.adv-description {
    font-size: 0.85rem;
    color: #bbb;
    margin-top: 5px;
}

.adv-players {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 26px;
}

.adv-players img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #ffd700;
    cursor: pointer;
}

.advancement-category {
    display: none;
}

.advancement-category.active {
    display: contents;
}

#achievement-ranking-wrapper {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #444;
}

#achievement-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 15px;
    margin-bottom: 20px;
    height: 200px;
}

.ach-podium-place {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transition: transform 0.2s;
}

.ach-podium-place:hover {
    transform: translateY(-5px);
}

.ach-podium-place.rank-1 {
    order: 2;
    margin-bottom: 20px;
}

.ach-podium-place.rank-2 {
    order: 1;
    margin-bottom: 0px;
}

.ach-podium-place.rank-3 {
    order: 3;
    margin-bottom: -10px;
    opacity: 0.9;
}

.ach-avatar {
    position: relative;
}

.ach-avatar img {
    border-radius: 50%;
    border: 3px solid #b39454;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    background: #000;
}

.ach-podium-place.rank-1 img {
    width: 80px;
    height: 80px;
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.ach-podium-place.rank-2 img {
    width: 64px;
    height: 64px;
    border-color: #c0c0c0;
}

.ach-podium-place.rank-3 img {
    width: 64px;
    height: 64px;
    border-color: #cd7f32;
}

.ach-crown {
    font-size: 2.5rem;
    margin-bottom: -5px;
    animation: float 3s infinite ease-in-out;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.ach-rank-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: #333;
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: bold;
    line-height: 20px;
    border: 1px solid #777;
}

.ach-name {
    margin-top: 8px;
    font-weight: bold;
    font-size: 1rem;
    color: #e0e0e0;
}

.ach-score {
    font-size: 0.9rem;
    color: #ffd700;
    font-family: 'Roboto';
}

#achievement-list-container {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

#toggle-ranking-btn {
    background: transparent;
    border: 1px solid #555;
    color: #888;
    padding: 5px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

#toggle-ranking-btn:hover {
    border-color: #b39454;
    color: #b39454;
}

#achievement-list {
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #333;
}

.ach-list-row {
    display: flex;
    align-items: center;
    padding: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ach-list-row:last-child {
    border: none;
}

.ach-list-rank {
    width: 30px;
    text-align: left;
    color: #666;
    font-size: 0.9rem;
}

.ach-list-row img {
    border-radius: 3px;
    margin-right: 10px;
}

.ach-list-name {
    flex-grow: 1;
    text-align: left;
    font-size: 0.95rem;
    color: #ccc;
}

.ach-list-score {
    font-weight: bold;
    color: #b39454;
}

.tooltip {
    position: fixed;
    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #ffd700;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
    transform: translate(10px, 10px);
}

.footer {
    text-align: center;
    margin-top: 40px;
    padding: 10px 0;
    font-size: 0.9rem;
    color: #8892b0;
}

.footer a {
    color: #b39454;
    text-decoration: none;
    transition: color 0.3s;
}

.footer a:hover {
    color: #ffd700;
}

.adv-players img {
    transition: transform 0.2s;
    border: 1px solid #555;
}

.adv-players img.first-achiever {
    border: 2px solid #ffd700;
    box-shadow: 0 0 5px #ffd700;
    position: relative;
    z-index: 2;
    animation: goldenGlimmer 2s infinite alternate;
    transform: scale(1.1);
    margin: 0 3px;
}

@keyframes goldenGlimmer {
    0% {
        box-shadow: 0 0 4px #ffd700, 0 0 2px rgba(255, 215, 0, 0.5);
        border-color: #b39454;
    }

    100% {
        box-shadow: 0 0 12px #ffd700, 0 0 8px #fff;
        border-color: #fff2a8;
    }
}

.adv-players img:hover {
    transform: scale(1.3);
    z-index: 10;
}

#fun-facts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.fun-fact-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #7a6332;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 220px;
}

.fun-fact-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    background: rgba(40, 37, 46, 0.9);
}

.ff-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.ff-title {
    font-family: 'MedievalSharp', cursive;
    color: #b39454;
    font-size: 1.2rem;
    margin-bottom: 10px;
    font-weight: bold;
}

.ff-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
    width: 100%;
}

.ff-stat {
    font-size: 1.4rem;
    font-weight: bold;
    color: #e0e0e0;
    margin-bottom: 5px;
}

.ff-desc {
    font-size: 0.95rem;
    color: #ccc;
    line-height: 1.4;
    font-style: normal;
}

.ff-desc strong {
    color: #e0e0e0;
    font-weight: 700;
}