/* ==========================================
   OSU! PROFILE SITE DESIGN SYSTEM & STYLES
   ========================================== */

/* --- Theme Variable Definitions --- */
:root {
    /* Base Color Tokens */
    --bg-dark: #090810;
    --bg-card: rgba(18, 16, 28, 0.6);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --text-main: #f3f2f8;
    --text-muted: #9491a3;
    
    /* Font Families */
    --font-header: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Difficulty Colors (osu! standards) */
    --diff-easy: #88b300;
    --diff-normal: #66ccff;
    --diff-hard: #ffcc22;
    --diff-insane: #ff66aa;
    --diff-expert: #8866ff;
    --diff-deluge: #a30000;
    --diff-overdose: #ff33aa;

    /* Grade Colors */
    --grade-ss: linear-gradient(135deg, #ffe066, #f5b041);
    --grade-s: linear-gradient(135deg, #5dade2, #2471a3);
    --grade-a: linear-gradient(135deg, #58d68d, #1e8449);
    --grade-b: linear-gradient(135deg, #bb8fce, #7d3c98);

    /* Animation Timings */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Mode Themed Variables --- */
body.theme-catch {
    --primary: #ffa200;
    --primary-glow: rgba(255, 162, 0, 0.15);
    --primary-solid: #ffcc00;
    --primary-gradient: linear-gradient(135deg, #ffd000, #ff8c00);
}

body.theme-standard {
    --primary: #ff66aa;
    --primary-glow: rgba(255, 102, 170, 0.15);
    --primary-solid: #ff66aa;
    --primary-gradient: linear-gradient(135deg, #ff85be, #d63384);
}

body.theme-mania {
    --primary: #3399cc;
    --primary-glow: rgba(51, 153, 204, 0.15);
    --primary-solid: #3399cc;
    --primary-gradient: linear-gradient(135deg, #5dade2, #2980b9);
}

body.theme-taiko {
    --primary: #ff4747;
    --primary-glow: rgba(255, 71, 71, 0.15);
    --primary-solid: #ff4747;
    --primary-gradient: linear-gradient(135deg, #ff7676, #c0392b);
}

/* --- Base Resets & Layout --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
}

/* --- Startup Page Loader --- */
.page-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #06050b;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loader-spinner {
    font-size: 3.5rem;
    color: var(--primary);
    filter: drop-shadow(0 0 15px var(--primary-glow));
    animation: pulse 1.5s infinite alternate ease-in-out;
    transition: color var(--transition-normal);
}

.loader-logo {
    font-family: var(--font-header);
    font-size: 2.5rem;
    font-weight: 950;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #fff 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: background var(--transition-normal);
}

.loader-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.8; }
    100% { transform: scale(1.05); opacity: 1; }
}

/* --- PFP Lightbox --- */
.pfp-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 3, 10, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: zoom-out;
}

.pfp-lightbox-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.pfp-lightbox-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    transform: scale(1);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: default;
}

.pfp-lightbox-overlay.hidden .pfp-lightbox-inner {
    transform: scale(0.75);
}

.pfp-lightbox-img {
    width: min(420px, 85vw);
    height: min(420px, 85vw);
    object-fit: cover;
    border-radius: 28px;
    border: 3px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.6),
        0 0 50px var(--primary-glow);
}

.pfp-lightbox-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.pfp-lightbox-name {
    font-family: var(--font-header);
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.pfp-lightbox-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* --- Custom Modal Dialog --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 3, 7, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-card {
    background: rgba(22, 20, 36, 0.95);
    border: 1px solid var(--border-hover);
    border-radius: 24px;
    padding: 30px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), 0 0 40px var(--primary-glow);
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.hidden .modal-card {
    transform: scale(0.85);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.modal-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: rgba(255, 162, 0, 0.1);
    border: 1px solid rgba(255, 162, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem;
    color: #ffa200;
}

.modal-title {
    font-family: var(--font-header);
    font-size: 1.3rem;
    font-weight: 800;
}

.modal-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.4;
}

.redirect-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 12px 18px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 25px;
}

.redirect-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.redirect-value {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-footer {
    display: flex;
    gap: 12px;
}

.modal-btn {
    flex: 1;
    padding: 14px;
    border-radius: 14px;
    font-family: var(--font-header);
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.btn-nope {
    background: rgba(239, 83, 80, 0.08);
    border: 1px solid rgba(239, 83, 80, 0.3);
    color: #ef5350;
}

.btn-nope:hover {
    background: rgba(239, 83, 80, 0.18);
    border-color: #ef5350;
    box-shadow: 0 0 15px rgba(239, 83, 80, 0.25);
}

.btn-confirm {
    background: linear-gradient(135deg, #66bb6a, #43a047);
    color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.25);
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.45);
}

/* --- Skeleton Shimmer Styling --- */
.skeleton {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02) !important;
    border-color: rgba(255, 255, 255, 0.03) !important;
}

.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.04) 50%, 
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-text {
    height: 1.5rem;
    border-radius: 6px;
    display: inline-block;
    width: 80%;
}

.skeleton-text.short {
    width: 45%;
}

.skeleton-text.micro {
    width: 25%;
    height: 0.8rem;
    margin-top: 4px;
}

.play-row-skeleton {
    height: 64px;
    border-radius: 16px;
    width: 100%;
}

/* --- Animated Background Blobs --- */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    animation: float 20s infinite alternate ease-in-out;
    transition: background-color var(--transition-normal);
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background-color: var(--primary);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 45vw;
    height: 45vw;
    background-color: #6c5ce7;
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 60%;
    width: 35vw;
    height: 35vw;
    background-color: #e056fd;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(8%, 8%) scale(1.1); }
}

/* --- Grid Pattern Overlay --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 24px 24px;
    z-index: -1;
    pointer-events: none;
}

/* --- Container --- */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* --- Glassmorphism Profile Card --- */
.profile-card {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 
        0 24px 80px rgba(0, 0, 0, 0.4), 
        0 0 50px var(--primary-glow);
    transition: box-shadow var(--transition-normal), border-color var(--transition-normal);
}

/* --- Header & Banner --- */
.profile-header {
    position: relative;
    padding: 120px 40px 30px;
    border-bottom: 1px solid var(--border-color);
}

.banner-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 160px;
    background: linear-gradient(120deg, var(--primary), #e040fb, #3399cc, var(--primary));
    background-size: 300% 300%;
    opacity: 0.18;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1), rgba(0,0,0,0));
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1), rgba(0,0,0,0));
    animation: banner-shift 8s ease infinite;
    transition: opacity var(--transition-normal);
}

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

.header-content {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 25px;
    flex-wrap: wrap;
}

/* Avatar Styling */
.avatar-container {
    position: relative;
    width: 130px;
    height: 130px;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    border: 3px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 1;
    background-color: #141221;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-avatar:hover {
    transform: scale(1.04);
    box-shadow: 0 0 22px var(--primary-glow);
}

.avatar-glow {
    position: absolute;
    top: -3px;
    left: -3px;
    width: calc(100% + 6px);
    height: calc(100% + 6px);
    border-radius: 22px;
    background: var(--primary-gradient);
    filter: blur(8px);
    opacity: 0.5;
    z-index: 0;
    transition: background var(--transition-normal);
}

.online-indicator {
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #00e676;
    border: 4px solid #141221;
    z-index: 2;
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.5);
}

/* User Meta Info */
.user-meta {
    flex: 1;
    min-width: 200px;
    margin-bottom: 5px;
}

.username-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 6px;
}

.username {
    font-family: var(--font-header);
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    line-height: 1;
    background: linear-gradient(90deg,
        #ffffff   0%,
        #ffe0a0  10%,
        #ffa200  22%,
        #e040fb  42%,
        #7c83fd  58%,
        #4fc3f7  70%,
        #ffa200  84%,
        #ffe0a0  93%,
        #ffffff 100%
    );
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: username-shine 9s linear infinite;
}

@keyframes username-shine {
    0%   { background-position: 0% center; }
    100% { background-position: 300% center; }
}

.country-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
    font-family: var(--font-header);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.country-badge:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.flag-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.user-title {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 12px;
}

.user-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tag {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.tag:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    color: var(--text-main);
    box-shadow: 0 0 10px var(--primary-glow);
    transform: translateY(-1px);
}

.tag i {
    font-size: 0.85em;
    color: var(--primary);
    transition: color var(--transition-normal);
}

/* Level Bar Widget */
.level-badge {
    flex-shrink: 0;
    margin-left: auto;
}

.level-bar-widget {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 160px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 14px;
}

.level-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.level-label {
    font-size: 0.62rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.level-value {
    font-family: var(--font-header);
    font-size: 1.45rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
    transition: color var(--transition-normal);
}

/* Blue override for Overview/Home average mode */
.level-value.home-avg {
    color: #4fc3f7;
}

.level-bar-track {
    width: 100%;
    height: 7px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
}

.level-bar-fill {
    height: 100%;
    border-radius: 99px;
    background: var(--primary-gradient);
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1), background 0.4s ease;
    box-shadow: 0 0 8px var(--primary-glow);
    min-width: 2px;
}

/* Blue bar fill for home average */
.level-bar-fill.home-avg {
    background: linear-gradient(90deg, #0288d1, #4fc3f7);
    box-shadow: 0 0 8px rgba(79, 195, 247, 0.4);
}

.level-percent {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
    transition: color var(--transition-normal);
    text-align: right;
}

/* Blue percent text for home mode */
.level-percent.home-avg {
    color: #4fc3f7;
}

/* --- Mode Switcher Navigation --- */
.nav-container {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.01);
    border-bottom: 1px solid var(--border-color);
}

.home-nav-row {
    display: flex;
    justify-content: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

#mode-home {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 10px 32px;
    border-radius: 30px;
    color: var(--text-muted);
    font-family: var(--font-header);
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-normal);
}

#mode-home:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.15);
}

#mode-home.active {
    color: #e040fb; /* Neon purple Overview theme color */
    border-color: #e040fb;
    background: rgba(224, 64, 251, 0.08);
    box-shadow: 0 0 15px rgba(224, 64, 251, 0.25);
}

.mode-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: none;
}

.mode-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 18px 10px;
    color: var(--text-muted);
    font-family: var(--font-header);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.mode-btn i {
    font-size: 1rem;
}

.mode-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.02);
}

.mode-btn.active {
    color: var(--primary-solid);
    border-bottom-color: var(--primary-solid);
    background: rgba(var(--primary-glow), 0.05);
}

/* --- Stats Grid Section --- */
.stats-section {
    padding: 35px 40px;
    border-bottom: 1px solid var(--border-color);
}

.ranks-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.rank-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 22px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.rank-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
    opacity: 0.4;
    transition: opacity var(--transition-fast);
}

.rank-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.rank-card.highlight-rank {
    background: radial-gradient(ellipse at bottom right, rgba(255, 204, 0, 0.06), rgba(255, 255, 255, 0.03));
}

.rank-card.highlight-rank::before {
    opacity: 1;
}

.rank-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 70%;
}

.card-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rank-number {
    font-family: var(--font-header);
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-main);
    line-height: 1.2;
}

.pp-text {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.pp-unit {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
}

.rank-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.rank-card:hover .rank-icon-wrapper {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
}

.trophy-glow {
    color: #ffd700;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
    animation: pulse-crown 2s infinite alternate ease-in-out;
}

@keyframes pulse-crown {
    0% { transform: scale(1); }
    100% { transform: scale(1.1) rotate(5deg); }
}

/* Detailed numerical statistics */
.details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.detail-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 14px;
    padding: 15px 18px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all var(--transition-fast);
}

.detail-card:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
    transform: translateX(2px);
}

.detail-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.95rem;
    color: var(--primary);
    transition: color var(--transition-normal);
}

.detail-content {
    display: flex;
    flex-direction: column;
    width: 70%;
}

.detail-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
}

.detail-value {
    font-family: var(--font-header);
    font-size: 1.15rem;
    font-weight: 750;
    color: var(--text-main);
}

/* --- Profile Body Grid: Plays & Sidebar --- */
.profile-body-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 30px;
    padding: 40px;
}

/* Section Title */
.section-title {
    font-family: var(--font-header);
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-icon-star {
    color: var(--primary);
    transition: color var(--transition-normal);
}

/* Top Plays List */
.plays-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.play-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    align-items: center;
    padding: 12px 18px;
    gap: 15px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.play-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-hover);
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Play index indicator */
.play-index {
    font-family: var(--font-header);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    width: 20px;
    text-align: center;
}

/* Grade Rank badge */
.play-grade {
    width: 38px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-header);
    font-size: 0.88rem;
    font-weight: 900;
    font-style: italic;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.play-grade.SS { background: var(--grade-ss); text-shadow: 0 0 5px rgba(245, 176, 65, 0.8); }
.play-grade.S { background: var(--grade-s); text-shadow: 0 0 5px rgba(36, 113, 163, 0.8); }
.play-grade.A { background: var(--grade-a); text-shadow: 0 0 5px rgba(30, 132, 73, 0.8); }
.play-grade.B { background: var(--grade-b); text-shadow: 0 0 5px rgba(125, 60, 152, 0.8); }

/* Play information metadata */
.play-info {
    flex: 1;
    min-width: 0;
}

.play-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.play-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.play-diff {
    font-weight: 600;
    color: var(--diff-color);
}

.play-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
    text-align: right;
}

.play-pp {
    font-family: var(--font-header);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    transition: color var(--transition-normal);
}

.play-pp-sub {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
}

.play-accuracy {
    font-size: 0.72rem;
    font-weight: 700;
    color: #4fc3f7;
}

/* Difficult Borders */
.play-row.diff-easy { border-left: 3.5px solid var(--diff-easy); }
.play-row.diff-normal { border-left: 3.5px solid var(--diff-normal); }
.play-row.diff-hard { border-left: 3.5px solid var(--diff-hard); }
.play-row.diff-insane { border-left: 3.5px solid var(--diff-insane); }
.play-row.diff-expert { border-left: 3.5px solid var(--diff-expert); }
.play-row.diff-deluge { border-left: 3.5px solid var(--diff-deluge); }
.play-row.diff-overdose { border-left: 3.5px solid var(--diff-overdose); }

/* --- Sidebar Details --- */
.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 22px;
}

.sidebar-title {
    font-family: var(--font-header);
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 18px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 10px;
}

.sidebar-title i {
    color: var(--primary);
    font-size: 0.9em;
    transition: color var(--transition-normal);
}

/* Info items */
.about-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.about-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.about-label {
    color: var(--text-muted);
    font-weight: 500;
}

.about-val {
    color: var(--text-main);
    font-weight: 600;
}

.text-highlight {
    color: var(--primary);
    font-weight: 700;
    transition: color var(--transition-normal);
}

/* Contact / Copy Box */
.discord-link-box {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 15px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.discord-link-box:hover {
    background: rgba(255, 255, 255, 0.025);
    border-color: rgba(255, 255, 255, 0.06);
}

.discord-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.discord-icon {
    font-size: 1.4rem;
    color: #5865f2;
}

.discord-text {
    display: flex;
    flex-direction: column;
}

.discord-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 600;
}

.discord-tag {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.2px;
}

.copy-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 6px;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.copy-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tooltip {
    position: absolute;
    top: -35px;
    right: 16px;
    background: var(--primary-gradient);
    color: #000;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
    transform: translateY(5px);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.osu-profile-link {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 14px;
    color: var(--text-main);
    font-family: var(--font-header);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.osu-profile-link:hover {
    background: var(--primary-gradient);
    color: #000;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--primary-glow);
}

.osu-profile-link i {
    font-size: 0.85em;
}

/* --- Footer --- */
.profile-footer {
    padding: 25px 40px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.1);
}

.profile-footer p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* --- Animations & Fades for dynamically updated content --- */
.fade-out {
    opacity: 0;
    transform: translateY(5px);
}

.fade-transition {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* --- Media Queries (Responsiveness) --- */
@media (max-width: 900px) {
    .profile-body-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 20px 10px;
    }
    
    .profile-header {
        padding: 100px 20px 25px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }
    
    .user-meta {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .username-row {
        justify-content: center;
    }
    
    .user-tags {
        justify-content: center;
    }
    
    .stats-section {
        padding: 25px 20px;
    }
    
    .ranks-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .details-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .mode-nav {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .profile-body-grid {
        padding: 25px 20px;
    }
    
    .play-row {
        padding: 10px 12px;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .mode-nav {
        grid-template-columns: 1fr;
    }
    
    .mode-btn {
        padding: 14px 10px;
        font-size: 0.88rem;
    }
    
    .username {
        font-size: 1.8rem;
    }
}

/* ==========================================
   SPOTLIGHT CARD & CHART LAYOUT REDESIGN
   ========================================== */

.play-spotlight-card {
    background: radial-gradient(ellipse at top left, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--border-hover);
    border-radius: 22px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    margin-bottom: 18px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 25px var(--primary-glow);
    transition: all var(--transition-fast);
}

.play-spotlight-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    opacity: 0.03;
    transition: opacity var(--transition-fast);
}

.play-spotlight-card:hover {
    transform: translateY(-3px) scale(1.005);
    border-color: var(--primary-solid);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), 0 0 35px var(--primary-glow);
}

.play-spotlight-card .play-index {
    font-family: var(--font-header);
    font-size: 1.1rem;
    font-weight: 850;
    color: var(--primary);
    width: 25px;
    text-align: center;
}

.play-spotlight-card .play-grade {
    width: 58px;
    height: 36px;
    border-radius: 8px;
    font-size: 1.25rem;
    font-weight: 900;
}

.play-spotlight-card .play-info {
    flex: 1;
}

.play-spotlight-card .play-title {
    font-family: var(--font-header);
    font-size: 1.22rem;
    font-weight: 850;
    line-height: 1.25;
    margin-bottom: 5px;
}

.play-spotlight-card .play-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.play-spotlight-card .play-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    text-align: right;
}

.play-spotlight-card .play-pp {
    font-family: var(--font-header);
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary-solid);
    text-shadow: 0 0 10px var(--primary-glow);
    line-height: 1;
}

.play-spotlight-card .play-pp-sub {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-muted);
}

.play-spotlight-card .play-accuracy {
    font-size: 0.85rem;
    font-weight: 850;
}

/* Difficult Borders for Spotlight Card */
.play-spotlight-card.diff-easy { border-left: 5px solid var(--diff-easy); }
.play-spotlight-card.diff-normal { border-left: 5px solid var(--diff-normal); }
.play-spotlight-card.diff-hard { border-left: 5px solid var(--diff-hard); }
.play-spotlight-card.diff-insane { border-left: 5px solid var(--diff-insane); }
.play-spotlight-card.diff-expert { border-left: 5px solid var(--diff-expert); }
.play-spotlight-card.diff-deluge { border-left: 5px solid var(--diff-deluge); }
.play-spotlight-card.diff-overdose { border-left: 5px solid var(--diff-overdose); }

/* Radar Skills Chart styling */
.chart-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 22px;
}

.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Home Skills chart is taller to fit mode legend */
#home-skills-chart-wrapper,
.home-sidebar-column .chart-container {
    height: 300px;
}

/* Make sure spotlight card looks compact on smaller viewports */
@media (max-width: 768px) {
    .play-spotlight-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 20px;
    }
    
    .play-spotlight-card .play-stats {
        align-items: flex-start;
        text-align: left;
        width: 100%;
        border-top: 1px solid var(--border-color);
        padding-top: 12px;
        margin-top: 4px;
    }
}

/* ==========================================
   HOMEPAGE DASHBOARD & COMPARISON CARD STYLES
   ========================================== */

.home-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    padding: 35px 40px;
    border-bottom: 1px solid var(--border-color);
}

.modes-comparison-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 15px;
}

.mode-comparison-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.mode-comparison-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Hover highlights per mode */
.mode-comparison-card.fruits:hover {
    border-color: #ffa200;
    box-shadow: 0 8px 25px rgba(255, 162, 0, 0.15);
}

.mode-comparison-card.standard:hover {
    border-color: #ff66aa;
    box-shadow: 0 8px 25px rgba(255, 102, 170, 0.15);
}

.mode-comparison-card.mania:hover {
    border-color: #3399cc;
    box-shadow: 0 8px 25px rgba(51, 153, 204, 0.15);
}

.mode-comparison-card.taiko:hover {
    border-color: #ff4747;
    box-shadow: 0 8px 25px rgba(255, 71, 71, 0.15);
}

/* Card Header */
.mode-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 8px;
}

.mode-card-title {
    font-family: var(--font-header);
    font-size: 0.95rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-main);
}

.mode-comparison-card.fruits .mode-card-title i { color: #ffa200; }
.mode-comparison-card.standard .mode-card-title i { color: #ff66aa; }
.mode-comparison-card.mania .mode-card-title i { color: #3399cc; }
.mode-comparison-card.taiko .mode-card-title i { color: #ff4747; }

.mode-badge-rank {
    font-size: 0.68rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.06);
    padding: 3px 8px;
    border-radius: 8px;
    color: var(--text-muted);
}

.mode-comparison-card:hover .mode-badge-rank {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.12);
}

/* India flag inside badge: hidden by default, visible on card hover */
.badge-flag {
    display: inline-block;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    font-size: 0.95em;
    vertical-align: middle;
}

.mode-comparison-card:hover .badge-flag {
    opacity: 1;
    transform: scale(1);
}

/* Card Body */
.mode-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mode-rank-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.mode-rank-label {
    color: var(--text-muted);
    font-weight: 500;
}

.mode-rank-val {
    color: var(--text-main);
    font-weight: 700;
}

/* PP Max Detail Box */
.mode-pp-max {
    margin-top: 6px;
    background: rgba(0, 0, 0, 0.18);
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.pp-max-label {
    font-size: 0.62rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: block;
}

.pp-max-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    gap: 8px;
}

.pp-max-title {
    color: var(--text-main);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 65%;
}

.pp-max-val {
    font-family: var(--font-header);
    font-weight: 800;
    color: var(--primary);
}

.mode-comparison-card.fruits .pp-max-val { color: #ffa200; }
.mode-comparison-card.standard .pp-max-val { color: #ff66aa; }
.mode-comparison-card.mania .pp-max-val { color: #3399cc; }
.mode-comparison-card.taiko .pp-max-val { color: #ff4747; }

/* --- Achievements Styling --- */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.achievement-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all var(--transition-fast);
}

.achievement-card:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
}

/* Borders for gold, silver, bronze achievement states */
.achievement-card.gold-badge { border-left: 4px solid #ffd700; }
.achievement-card.silver-badge { border-left: 4px solid #c0c0c0; }
.achievement-card.bronze-badge { border-left: 4px solid #cd7f32; }
.achievement-card.standard-badge { border-left: 4px solid #9c27b0; }

.achievement-icon-wrapper {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.gold-badge .achievement-icon-wrapper i {
    color: #ffd700;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.4));
}

.silver-badge .achievement-icon-wrapper i {
    color: #e0e0e0;
    filter: drop-shadow(0 0 5px rgba(224, 224, 224, 0.4));
}

.bronze-badge .achievement-icon-wrapper i {
    color: #cd7f32;
    filter: drop-shadow(0 0 5px rgba(205, 127, 50, 0.4));
}

.standard-badge .achievement-icon-wrapper i {
    color: #9c27b0;
    filter: drop-shadow(0 0 5px rgba(156, 39, 176, 0.4));
}

.achievement-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.achievement-title {
    font-family: var(--font-header);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
}

.achievement-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.35;
}

/* Hide helper */
.hidden {
    display: none !important;
}

/* Dashboard layout split column on Home screen */
.home-dashboard-layout {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

/* Responsiveness media queries for home */
@media (max-width: 1200px) {
    .modes-comparison-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .home-dashboard-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .home-section {
        padding: 25px 20px;
    }
}

@media (max-width: 600px) {
    .modes-comparison-grid {
        grid-template-columns: 1fr;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
    }
}

