:root {
    --bg: #0f0f0f;
    --card-bg: #1a1a1a;
    --text: #ffffff;
    --text-light: #bbbbbb;
    --accent: #2a2a2a;
    --accent-hover: #3a3a3a;
    --border: #252525;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    --primary: #ffe555;
    --primary-hover: #ffff00;
    --secondary: #44aaff;
    --secondary-hover: #66bbff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
}

.top-nav {
    background: #252525;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2.5rem;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.logo:hover {
    opacity: 0.85;
}

.logo img {
    height: 36px;
    width: auto;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--primary);
}

.notice-btn {
    color: var(--text-light);
}

.notice-btn:hover {
    color: var(--primary);
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin: 2.5rem 0;
    padding: 0 2rem;
}

.category-tab {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.25rem;
    font-weight: 700;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    border-radius: 2px 2px 0 0;
    transition: all 0.2s ease;
}

.category-tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
}

.category-tab.active {
    color: var(--text);
    border-bottom-color: var(--primary);
}

.demon-list-tab {
    max-width: 1000px;
    margin: 0 auto 3rem auto;
    padding: 0 2rem;
}

.demon-entry {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 2px;
    position: relative;
    transition: all 0.2s ease;
    min-height: 140px;
}

.demon-entry:hover {
    border-color: var(--primary);
    transform: translateY(-0.5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.demon-place {
    font-size: 2.25rem;
    font-weight: 900;
    margin-right: 1.75rem;
    min-width: 3.5rem;
    text-align: center;
}

.demon-video {
    margin-right: 1.75rem;
}

.video-icon {
    width: 260px;
    height: 146px;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: opacity 0.2s ease;
}

.video-icon:hover {
    opacity: 0.85;
}

.demon-info {
    flex: 1;
}

.demon-info h2 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.demon-info p {
    color: var(--text-light);
    margin: 0.35rem 0;
    font-size: 1rem;
}

.level-id {
    display: inline-block;
    background: var(--accent);
    padding: 0.25rem 0.6rem;
    font-size: 0.9rem;
    margin-left: 0.5rem;
    color: var(--text-light);
    border-radius: 2px;
}

.list-points {
    position: absolute;
    top: 1.25rem;
    right: 1.75rem;
    background: rgba(255, 85, 85, 0.15);
    color: #ff5555;
    padding: 0.35rem 0.75rem;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 2px;
}

.victors-count {
    position: absolute;
    bottom: 1.25rem;
    right: 1.75rem;
    background: rgba(68, 170, 255, 0.15);
    color: var(--secondary);
    padding: 0.35rem 0.75rem;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 2px;
}

.level-details-card {
    max-width: 1000px;
    margin: 2.5rem auto;
    padding: 2.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 2px;
}

.back-link {
    display: inline-block;
    color: var(--text-light);
    text-decoration: none;
    margin-bottom: 1.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 2px;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.back-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

#level-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.6rem;
    text-align: center;
}

.level-creator {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    text-align: center;
}

.level-description {
    margin-bottom: 2rem;
    color: var(--text-light);
    text-align: center;
    font-size: 1rem;
}

.level-video {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.level-video iframe {
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 2px;
}

.level-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
    background: var(--accent);
    padding: 2rem;
    border-radius: 2px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-weight: 700;
    color: var(--text-light);
    font-size: 0.9rem;
}

.stat-item div:last-child {
    font-size: 1rem;
}

.level-victors-section h3 {
    font-size: 1.85rem;
    margin-bottom: 1.25rem;
}

.victor-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--accent);
    margin-bottom: 0.6rem;
    gap: 1rem;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.victor-item:hover {
    background: var(--accent-hover);
    transform: translateX(2px);
}

.victor-name {
    font-weight: 600;
    font-size: 1rem;
}

.victor-percent {
    color: var(--secondary);
    font-weight: 700;
    font-size: 1rem;
}

.victor-device {
    color: var(--text-light);
    font-size: 0.95rem;
}

.victor-video-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.victor-video-btn:hover {
    background: rgba(68, 170, 255, 0.15);
}

.victor-video-btn svg {
    width: 24px;
    height: 24px;
    fill: var(--secondary);
}

.leaderboard-header {
    text-align: center;
    margin: 2.5rem 0;
    padding: 0 2rem;
}

.leaderboard-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.6rem;
}

.leaderboard-header p {
    color: var(--text-light);
    font-size: 1.2rem;
}

.leaderboard-container {
    max-width: 1000px;
    margin: 0 auto 3rem auto;
    padding: 0 2rem;
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 2px;
    transition: all 0.2s ease;
    min-height: 100px;
}

.leaderboard-entry:hover {
    border-color: var(--primary);
    transform: translateY(-0.5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.player-place {
    font-size: 2.25rem;
    font-weight: 900;
    margin-right: 1.75rem;
    min-width: 3.5rem;
    text-align: center;
}

.player-info {
    flex: 1;
}

.player-info h2 {
    font-size: 1.4rem;
    margin-bottom: 0.4rem;
}

.player-points {
    font-size: 1.2rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    text-align: center;
    min-width: 105px;
    border-radius: 2px;
}

.player-points.tier-bronze {
    background: rgba(139, 69, 19, 0.2);
    color: #CD853F;
}

.player-points.tier-silver {
    background: rgba(192, 192, 192, 0.2);
    color: #C0C0C0;
}

.player-points.tier-gold {
    background: rgba(255, 215, 0, 0.2);
    color: #FFD700;
}

.player-points.tier-platinum {
    background: rgba(229, 228, 226, 0.2);
    color: #E5E4E2;
}

.player-points.tier-diamond {
    background: rgba(185, 242, 255, 0.2);
    color: #B9F2FF;
}

.player-points.tier-emerald {
    background: rgba(80, 200, 120, 0.2);
    color: #50C878;
}

.player-points.tier-sapphire {
    background: rgba(15, 82, 186, 0.2);
    color: #4169E1;
}

.player-points.tier-ruby {
    background: rgba(224, 17, 95, 0.2);
    color: #E0115F;
}

.player-points.tier-obsidian {
    background: rgba(60, 60, 60, 0.3);
    color: #A9A9A9;
}

.player-points.tier-mythic {
    background: rgba(255, 107, 53, 0.2);
    color: #FF6B35;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    width: 90%;
    max-width: 520px;
    border-radius: 2px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    margin: 0;
    color: var(--primary);
    font-size: 1.5rem;
}

.modal-close {
    color: var(--text-light);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
    padding: 0.3rem 0.6rem;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-size: 1rem;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.modal-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.modal-btn-primary {
    background: var(--primary);
    color: #000;
}

.modal-btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-0.5px);
}

.modal-btn-secondary {
    background: var(--accent);
    color: var(--text);
    border: 1px solid var(--border);
}

.modal-btn-secondary:hover {
    background: var(--accent-hover);
    transform: translateY(-0.5px);
}

.demon-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.demon-title a:hover {
    color: var(--primary);
}

.user-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.user-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1.25rem;
}

.user-rank-points {
    display: flex;
    justify-content: center;
    gap: 3.5rem;
}

.user-rank, .user-points {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.rank-label, .points-label {
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
}

.rank-value {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--primary);
}

.points-value {
    font-size: 2.2rem;
    font-weight: 900;
    padding: 0.5rem 1rem;
    border-radius: 2px;
}

.user-completions-section {
    margin-top: 2.5rem;
}

.section-divider {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    margin: 2.5rem 0 1.25rem 0;
    padding: 1.25rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.completions-list {
    margin: 1.25rem 0;
}

.completion-item {
    background: var(--accent);
    padding: 1.15rem;
    margin: 0.6rem 0;
    border-left: 3px solid var(--primary);
    border-radius: 2px;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.completion-item:hover {
    background: var(--accent-hover);
    transform: translateX(2px);
}

.loading-text, .no-data {
    text-align: center;
    color: var(--text-light);
    padding: 2.5rem;
    font-size: 1.05rem;
}

@media screen and (max-width: 1024px) {
    .demon-list-tab,
    .level-details-card,
    .leaderboard-container {
        max-width: 100%;
        padding: 0 1.5rem;
    }
}

@media screen and (max-width: 768px) {
    body {
        font-size: 15px;
    }

    .top-nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .logo img {
        height: 32px;
    }

    .logo-text {
        font-size: 1.2rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .nav-link {
        padding: 0.5rem 0.9rem;
        font-size: 0.95rem;
    }

    .category-tabs {
        flex-wrap: wrap;
        gap: 1rem;
        margin: 1.5rem 0;
    }

    .category-tab {
        font-size: 1.1rem;
        padding: 0.5rem 1rem;
    }

    .demon-list-tab,
    .leaderboard-container {
        padding: 0 1rem;
    }

    .demon-entry,
    .leaderboard-entry {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem;
        min-height: auto;
    }

    .demon-place,
    .player-place {
        font-size: 1.85rem;
        margin-bottom: 0.75rem;
        margin-right: 0;
    }

    .demon-video {
        margin: 0 0 1rem 0;
        width: 100%;
    }

    .video-icon {
        width: 100%;
        height: auto;
    }

    .demon-info h2,
    .player-info h2 {
        font-size: 1.25rem;
    }

    .demon-info p {
        font-size: 0.95rem;
    }

    .list-points,
    .victors-count {
        position: static;
        display: inline-block;
        margin: 0.5rem 0.5rem 0 0;
        font-size: 0.85rem;
    }

    .level-details-card {
        padding: 1.5rem;
        margin: 1.5rem auto;
    }

    #level-header h1 {
        font-size: 2rem;
    }

    .level-creator {
        font-size: 1.1rem;
    }

    .level-description {
        font-size: 0.95rem;
    }

    .level-stats {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }

    .level-victors-section h3 {
        font-size: 1.5rem;
    }

    .victor-item {
        flex-wrap: wrap;
        padding: 0.9rem;
    }

    .victor-name,
    .victor-percent,
    .victor-device {
        font-size: 0.95rem;
    }

    .leaderboard-header h1 {
        font-size: 2rem;
    }

    .leaderboard-header p {
        font-size: 1.1rem;
    }

    .player-points {
        font-size: 1.1rem;
        padding: 0.45rem 0.9rem;
        min-width: 85px;
    }

    .user-header h1 {
        font-size: 2rem;
    }

    .user-rank-points {
        gap: 2rem;
    }

    .rank-value,
    .points-value {
        font-size: 1.8rem;
    }

    .section-divider {
        font-size: 1.3rem;
    }

    .completion-item {
        padding: 1rem;
        font-size: 0.95rem;
    }

    .modal-content {
        width: 95%;
        max-width: none;
    }

    .modal-header {
        padding: 1.25rem;
    }

    .modal-header h2 {
        font-size: 1.3rem;
    }

    .modal-body {
        padding: 1.25rem;
    }

    .modal-body p {
        font-size: 0.95rem;
    }

    .modal-buttons {
        flex-direction: column;
    }

    .modal-btn {
        width: 100%;
        padding: 0.7rem 1.25rem;
        font-size: 0.95rem;
    }
}

@media screen and (max-width: 480px) {
    .demon-entry,
    .leaderboard-entry {
        padding: 1rem;
    }

    .demon-place,
    .player-place {
        font-size: 1.65rem;
    }

    .category-tabs {
        flex-direction: column;
        align-items: stretch;
    }

    .category-tab {
        text-align: center;
    }
}