:root {
    --bg-blur: 8px;
    --text: #e7eef8;
    --muted: #b9c3d2;
    --line: rgba(255, 255, 255, 0.24);
    --shadow: 0 24px 45px rgba(0, 12, 38, 0.35);
    --radius-xl: 28px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: Manrope, "Segoe UI", sans-serif;
    color: var(--text);
    background: #0a1426 url("../img/bg.jpg") center center / cover no-repeat fixed;
    line-height: 1.45;
}

.bg-overlay {
    position: fixed;
    inset: 0;
    z-index: 0;
    backdrop-filter: blur(var(--bg-blur));
    background:
        radial-gradient(circle at 10% 10%, rgba(96, 156, 255, 0.16), transparent 52%),
        radial-gradient(circle at 86% 22%, rgba(129, 238, 255, 0.12), transparent 52%),
        linear-gradient(160deg, rgba(5, 15, 32, 0.65), rgba(10, 16, 24, 0.78));
}

.layout {
    position: relative;
    z-index: 1;
    width: min(1080px, calc(100% - 32px));
    margin: 26px auto 40px;
    display: grid;
    gap: 16px;
}

.card {
    border-radius: var(--radius-xl);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.glass {
    background: linear-gradient(130deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.08));
    backdrop-filter: blur(22px) saturate(130%);
    -webkit-backdrop-filter: blur(22px) saturate(130%);
}

.hero {
    padding: 22px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}

.eyebrow {
    margin: 0;
    color: var(--muted);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.16em;
}

h1, h2 {
    margin: 0;
    font-family: Unbounded, Manrope, sans-serif;
}

h1 {
    margin-top: 8px;
    font-size: clamp(1.4rem, 4vw, 2.1rem);
}

h2 {
    font-size: clamp(1rem, 3vw, 1.2rem);
    margin-bottom: 10px;
}

.subtitle {
    margin: 8px 0 0;
    color: #d6e2f2;
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.back-link, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #eff7ff;
    border-radius: 12px;
    border: 1px solid rgba(157, 220, 255, 0.45);
    background: rgba(117, 197, 255, 0.18);
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
}

.btn-ghost {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
}

.controls { padding: 16px; }

.search-form {
    display: grid;
    grid-template-columns: 220px minmax(240px, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.field-group {
    display: grid;
    gap: 6px;
}

.field-group label {
    font-size: 13px;
    color: #d5e2f2;
}

.field-grow { min-width: 0; }

.input {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #edf5ff;
    padding: 10px 12px;
    outline: none;
}

.buttons-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.info {
    padding: 16px;
}

.info ul {
    margin: 0;
    padding-left: 18px;
    color: #dbe8f8;
}

.info li { margin: 6px 0; }

.table-wrap { padding: 14px; }

.rating-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.rating-table th,
.rating-table td {
    padding: 12px 14px;
    text-align: left;
}

.rating-table th {
    background: rgba(7, 18, 41, 0.55);
    font-family: Unbounded, Manrope, sans-serif;
    font-size: 0.82rem;
    letter-spacing: 0.03em;
}

.rating-table td {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.rating-table tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.04);
}

.rating-table tbody tr {
    transition: background-color 0.15s ease;
}

.rating-table tbody tr:hover td {
    background: rgba(146, 212, 255, 0.1);
}

.place-cell, .score-cell {
    white-space: nowrap;
    width: 1%;
}

.score-cell { font-weight: 800; }

.username {
    margin-left: 8px;
    color: #9fb6cf;
}

.medal {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.gold { background: #ffd65c; }
.silver { background: #d5e1f0; }
.bronze { background: #d39b67; }

.muted-row td { opacity: 0.78; }

.highlight td {
    box-shadow: inset 0 0 0 1px rgba(255, 218, 113, 0.45);
    background: rgba(255, 227, 150, 0.08) !important;
}

.empty {
    text-align: center;
    padding: 28px 12px;
    color: #d6e2f2;
}

.pagination {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.page-indicator {
    color: #d5ddeb;
    font-weight: 600;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(3, 8, 20, 0.74);
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    width: min(760px, 100%);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: linear-gradient(130deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
    overflow: hidden;
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.modal-close {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.26);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.modal-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Censorship Overlay */
.modal-media-wrapper {
    position: relative;
    overflow: hidden;
}

.modal-media-wrapper.censored .modal-image {
    filter: blur(20px) brightness(0.4);
    transform: scale(1.05);
    transition: filter 0.5s ease, transform 0.5s ease;
}

.censored-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    cursor: pointer;
    transition: opacity 0.4s ease, transform 0.4s ease;
    background: linear-gradient(
        135deg,
        rgba(12, 20, 35, 0.85) 0%,
        rgba(30, 45, 70, 0.75) 50%,
        rgba(12, 20, 35, 0.85) 100%
    );
    backdrop-filter: blur(2px);
}

.modal-media-wrapper:not(.censored) .censored-overlay {
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
}

.censored-icon {
    width: 72px;
    height: 72px;
    margin-bottom: 16px;
    color: rgba(255, 200, 100, 0.9);
    animation: pulse-glow 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(255, 180, 80, 0.5));
}

.censored-icon svg {
    width: 100%;
    height: 100%;
}

@keyframes pulse-glow {
    0%, 100% {
        filter: drop-shadow(0 0 15px rgba(255, 180, 80, 0.4));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 0 25px rgba(255, 180, 80, 0.7));
        transform: scale(1.05);
    }
}

.censored-text {
    font-family: 'Unbounded', Manrope, sans-serif;
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    margin-bottom: 8px;
}

.censored-subtext {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Hover effect on overlay */
.censored-overlay:hover {
    background: linear-gradient(
        135deg,
        rgba(20, 35, 55, 0.9) 0%,
        rgba(45, 65, 95, 0.8) 50%,
        rgba(20, 35, 55, 0.9) 100%
    );
}

.censored-overlay:hover .censored-icon {
    transform: scale(1.1);
}

.tooltip {
    position: fixed;
    display: none;
    z-index: 1200;
    max-width: 360px;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(5, 14, 28, 0.92);
    color: #e6f0ff;
    font-size: 12px;
    pointer-events: none;
}

.tooltip-title {
    font-weight: 800;
    margin-bottom: 6px;
}

.tooltip-list {
    margin: 0;
    padding-left: 18px;
    line-height: 1.45;
}

.tooltip-list li {
    margin: 4px 0;
}

@media (max-width: 900px) {
    .layout { width: min(860px, calc(100% - 24px)); }

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

@media (max-width: 760px) {
    .layout {
        margin-top: 16px;
        gap: 12px;
    }

    .card { border-radius: 22px; }

    .hero,
    .controls,
    .info,
    .table-wrap {
        padding: 12px;
    }

    .hero-actions {
        width: 100%;
    }

    .rating-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

}
