/* YouTuber Chaos Map Japan - Chaos Style */
/* YouTube Red Theme: #FF0000, #CC0000 */

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

body {
    font-family: 'Noto Sans JP', 'Roboto', sans-serif;
    background: linear-gradient(135deg, #1a0a0a 0%, #2d1515 50%, #0f0f0f 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
}

/* Background Scrolling Names */
.bg-titles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    opacity: 0.03;
}

.bg-title-row {
    display: flex;
    white-space: nowrap;
    animation: scrollLeft 60s linear infinite;
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    padding: 0.5rem 0;
}

.bg-title-row:nth-child(even) {
    animation: scrollRight 50s linear infinite;
}

.bg-title-row:nth-child(3n) {
    font-size: 1.5rem;
    animation-duration: 70s;
}

.bg-title-row span {
    margin-right: 3rem;
}

@keyframes scrollLeft {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes scrollRight {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

/* Ensure content is above background */
.header, .controls, .chaos-map, .footer, .detail-panel {
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    text-align: center;
    padding: 1.5rem 1rem;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 2px solid #ff0000;
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(90deg, #ff0000, #ff6666, #ffffff, #ff6666, #ff0000);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    -webkit-text-fill-color: #ff0000;
    font-size: 2.2rem;
}

.region-badge {
    background: #ff0000;
    -webkit-text-fill-color: #fff;
    font-size: 0.6rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}

.nav {
    position: absolute;
    right: 1rem;
}

.language-select {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

/* Main */
.main {
    max-width: 100%;
    margin: 0 auto;
    padding: 1rem 2rem;
}

/* Controls */
.controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.controls.controls-center {
    align-items: center;
}

.controls.controls-center .filter-group {
    justify-content: center;
}

.controls.controls-center .stats-summary {
    margin-left: 0;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-group label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    min-width: 60px;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
}

.filter-btn {
    padding: 0.4rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.filter-btn:hover {
    background: rgba(255, 0, 0, 0.3);
    border-color: #ff0000;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    border-color: transparent;
}

.sort-select {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.stats-summary {
    margin-left: auto;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.stats-summary span:first-child {
    font-weight: 700;
    color: #ff0000;
    font-size: 1.1rem;
}

/* Chaos Map Container */
.chaos-map {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 1rem;
    min-height: 400px;
}

/* YouTuber Card - Chaos Style */
.youtuber-card {
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    border: 3px solid transparent;
}

.youtuber-card::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #ff0000, #ff6666, #ffffff, #ff6666, #ff0000);
    background-size: 400% 400%;
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: gradientBorder 3s ease infinite;
}

.youtuber-card:hover::before {
    opacity: 1;
}

@keyframes gradientBorder {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.youtuber-card:hover {
    transform: scale(1.8) rotate(0deg) !important;
    z-index: 100;
    box-shadow:
        0 0 20px rgba(255, 0, 0, 0.6),
        0 0 40px rgba(255, 0, 0, 0.4),
        0 0 60px rgba(255, 0, 0, 0.2),
        0 8px 30px rgba(0, 0, 0, 0.5);
}

/* Glow color varies by rank */
.youtuber-card.size-xl:hover {
    box-shadow:
        0 0 25px rgba(255, 215, 0, 0.7),
        0 0 50px rgba(255, 215, 0, 0.5),
        0 0 75px rgba(255, 215, 0, 0.3),
        0 8px 30px rgba(0, 0, 0, 0.5);
}

.youtuber-card.size-lg:hover {
    box-shadow:
        0 0 20px rgba(255, 0, 0, 0.7),
        0 0 40px rgba(255, 0, 0, 0.5),
        0 0 60px rgba(255, 0, 0, 0.3),
        0 8px 30px rgba(0, 0, 0, 0.5);
}

.youtuber-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.youtuber-card .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.95));
    padding: 0.4rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: center;
}

.youtuber-card:hover .overlay {
    opacity: 1;
}

.youtuber-card .title {
    font-size: 0.65rem;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.youtuber-card .subs {
    font-size: 0.55rem;
    color: #ff6666;
    margin-top: 1px;
}

/* Size Classes based on score - Circular (Medium sizes) */
.youtuber-card.size-xl {
    width: 280px;
    height: 280px;
}

.youtuber-card.size-lg {
    width: 220px;
    height: 220px;
}

.youtuber-card.size-md {
    width: 170px;
    height: 170px;
}

.youtuber-card.size-sm {
    width: 130px;
    height: 130px;
}

.youtuber-card.size-xs {
    width: 100px;
    height: 100px;
}

/* Score Badge */
.score-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: linear-gradient(135deg, #ff0000, #ff6666);
    color: #fff;
    font-size: 0.6rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    z-index: 5;
}

/* Rank Badge */
.rank-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    z-index: 5;
}

.rank-badge.gold {
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #333;
}

.rank-badge.silver {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
    color: #333;
}

.rank-badge.bronze {
    background: linear-gradient(135deg, #cd7f32, #b87333);
    color: #fff;
}

.rank-badge.normal {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
}

/* Genre Tag on Card */
.genre-tag {
    position: absolute;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 0, 0, 0.9);
    color: #fff;
    font-size: 0.5rem;
    padding: 1px 5px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 5;
}

.youtuber-card:hover .genre-tag {
    opacity: 1;
}

/* Loading */
.loading {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: rgba(255, 255, 255, 0.6);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ff0000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Detail Panel */
.detail-panel {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background: linear-gradient(180deg, #1a0a0a 0%, #0f0f0f 100%);
    border-left: 2px solid #ff0000;
    transition: right 0.3s ease;
    z-index: 200;
    overflow-y: auto;
}

.detail-panel.open {
    right: 0;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
}

.close-btn:hover {
    color: #ff0000;
}

.detail-content {
    padding: 1.5rem;
}

.detail-banner {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.detail-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ff0000;
}

.detail-title {
    font-size: 1.3rem;
    font-weight: 700;
}

.detail-url {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.detail-genre {
    display: inline-block;
    background: #ff0000;
    color: #fff;
    padding: 0.25rem 0.7rem;
    border-radius: 6px;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.detail-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.detail-stat {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.detail-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ff0000;
}

.detail-stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.detail-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    max-height: 100px;
    overflow: hidden;
}

.detail-scores {
    margin-bottom: 1.5rem;
}

.detail-scores h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.score-bar {
    margin-bottom: 0.75rem;
}

.score-bar-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.score-bar-label {
    color: rgba(255, 255, 255, 0.7);
}

.score-bar-value {
    color: #ff0000;
    font-weight: 600;
}

.score-bar-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #cc0000, #ff0000);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.detail-latest-video {
    margin-bottom: 1.5rem;
}

.detail-latest-video h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.latest-video-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
}

.latest-video-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.latest-video-stats {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.detail-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.detail-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.detail-link.youtube {
    background: #ff0000;
    color: #fff;
}

.detail-link.youtube:hover {
    background: #cc0000;
    transform: translateY(-2px);
}

.detail-link.share {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.detail-link.share:hover {
    border-color: #ff0000;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 2rem;
}

.update-time {
    margin-top: 0.5rem;
}

/* No results */
.no-results {
    width: 100%;
    text-align: center;
    padding: 4rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Responsive */
/* Other Maps Navigation */
.other-maps {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.other-maps-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    margin-right: 0.5rem;
}

.other-map-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    color: #fff;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.other-map-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.other-map-link.anime {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(79, 70, 229, 0.2));
    border-color: rgba(99, 102, 241, 0.4);
}
.other-map-link.anime:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(79, 70, 229, 0.4));
}

.other-map-link.game {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.2), rgba(34, 197, 94, 0.2));
    border-color: rgba(74, 222, 128, 0.4);
}
.other-map-link.game:hover {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.4), rgba(34, 197, 94, 0.4));
}

.other-map-link.youtube {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.2));
    border-color: rgba(239, 68, 68, 0.4);
}
.other-map-link.youtube:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.4), rgba(220, 38, 38, 0.4));
}
.other-map-link.youtube.current {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.5), rgba(220, 38, 38, 0.5));
    border-color: rgba(239, 68, 68, 0.8);
    cursor: default;
}

.other-map-link.vtuber {
    background: linear-gradient(135deg, rgba(192, 132, 252, 0.2), rgba(147, 51, 234, 0.2));
    border-color: rgba(192, 132, 252, 0.4);
}
.other-map-link.vtuber:hover {
    background: linear-gradient(135deg, rgba(192, 132, 252, 0.4), rgba(147, 51, 234, 0.4));
}

.other-map-link.mobile {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.2));
    border-color: rgba(59, 130, 246, 0.4);
}

.other-map-link.manga {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.2));
    border-color: rgba(251, 191, 36, 0.4);
}

.other-map-link.coming-soon {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(100, 100, 100, 0.2) !important;
    border-color: rgba(100, 100, 100, 0.3) !important;
}
.other-map-link.coming-soon:hover {
    transform: none;
    box-shadow: none;
}

/* Responsive */
@media (max-width: 768px) {
    .other-maps {
        gap: 0.4rem;
        padding: 0.6rem 0.5rem;
    }
    .other-maps-label {
        width: 100%;
        text-align: center;
        margin-bottom: 0.3rem;
    }
    .other-map-link {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        position: static;
    }

    .logo {
        font-size: 1.5rem;
    }

    .filter-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-group label {
        min-width: auto;
    }

    .stats-summary {
        margin-left: 0;
        width: 100%;
        text-align: center;
    }

    .youtuber-card.size-xl {
        width: 200px;
        height: 200px;
    }

    .youtuber-card.size-lg {
        width: 160px;
        height: 160px;
    }

    .youtuber-card.size-md {
        width: 130px;
        height: 130px;
    }

    .youtuber-card.size-sm {
        width: 100px;
        height: 100px;
    }

    .youtuber-card.size-xs {
        width: 80px;
        height: 80px;
    }

    .detail-panel {
        width: 100%;
        right: -100%;
    }
}
