:root {
    --bg-dark: #07080a;
    --bg-card: rgba(15, 17, 23, 0.75);
    --bg-card-hover: rgba(22, 25, 35, 0.88);
    --border-color: rgba(255, 255, 255, 0.12);
    --border-highlight: rgba(255, 255, 255, 0.45);
    --primary: #ffffff;
    --primary-glow: rgba(255, 255, 255, 0.25);
    --text-main: #f8fafc;
    --text-muted: #8e95a5;
    --silver: #d1d5db;
    --danger: #ef4444;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Background Shader Canvas */
#waves-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.ambient-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    top: -150px;
    right: -150px;
    z-index: 0;
    filter: blur(120px);
    pointer-events: none;
}

/* App Wrapper */
.app-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 2.5rem;
    background: rgba(8, 9, 12, 0.82);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    text-decoration: none;
    cursor: pointer;
}

.brand-logo-img {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.brand:hover .brand-logo-img {
    transform: scale(1.06);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.4);
}

.brand-text h1 {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-link:hover, .nav-link.active {
    color: #ffffff;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

/* User Pill */
.user-pill {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.35rem 0.9rem;
    background: rgba(18, 20, 28, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.user-pill:hover {
    border-color: #ffffff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.25);
}

.user-pill img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.user-pill .pill-nick {
    font-weight: 600;
    font-size: 0.92rem;
    color: #fff;
}

.uid-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.55rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 20px;
    color: #ffffff;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.5px;
}

.uid-badge.creator {
    background: #ffffff;
    color: #07080a;
    border-color: #ffffff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.65rem 1.3rem;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: #ffffff;
    color: #07080a;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: #f1f5f9;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.btn-lg {
    padding: 0.95rem 1.9rem;
    font-size: 1.05rem;
    border-radius: 12px;
}

/* Main Content Views */
.main-content {
    flex: 1;
    max-width: 1180px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    width: 100%;
}

.view-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3.5rem 1rem 3.5rem;
    max-width: 850px;
    margin: 0 auto;
}

.hero-avatar-display {
    width: 90px;
    height: 90px;
    margin: 0 auto 1.5rem;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 35px rgba(255, 255, 255, 0.2);
    overflow: hidden;
    position: relative;
}

.hero-avatar-display img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-title {
    font-size: 3.6rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1rem;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.hero-description {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 2.2rem;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

/* Stats Counter Row */
.stats-row {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 3.5rem;
}

.stat-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.2rem 2.2rem;
    border-radius: 14px;
    backdrop-filter: blur(10px);
    text-align: center;
    min-width: 190px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 0.3rem;
    display: block;
}

.stat-num {
    font-size: 1.9rem;
    font-weight: 800;
    color: #ffffff;
    font-family: var(--font-mono);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.8rem;
    border-radius: 16px;
    backdrop-filter: blur(12px);
    transition: all 0.25s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-highlight);
    background: var(--bg-card-hover);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.08);
}

.feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
    font-weight: 700;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.92rem;
}

/* PROFILE VIEW */
.profile-view-container {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 2rem;
}

.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 2rem;
    backdrop-filter: blur(14px);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.profile-avatar-wrapper {
    position: relative;
    margin-bottom: 1.2rem;
    display: inline-block;
}

.profile-avatar-img {
    width: 100px;
    height: 100px;
    border-radius: 22px;
    background: #0f1117;
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.2);
    object-fit: cover;
}

.profile-username {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
    color: #fff;
}

.profile-uid-large {
    margin: 0.5rem auto 1.2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1.2rem;
    border-radius: 30px;
    font-size: 1.05rem;
    font-weight: 800;
    font-family: var(--font-mono);
}

.profile-details-list {
    text-align: left;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.profile-detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
}

.profile-detail-label {
    color: var(--text-muted);
}

.profile-detail-val {
    color: #fff;
    font-weight: 600;
}

.status-editor {
    margin-top: 1.2rem;
    text-align: left;
}

.status-editor label {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    display: block;
}

.status-input-group {
    display: flex;
    gap: 0.5rem;
}

.input-field {
    width: 100%;
    padding: 0.65rem 0.95rem;
    background: rgba(12, 14, 20, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: #fff;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: #ffffff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

/* Launcher Card in Profile */
.profile-content {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.launcher-banner-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 2.2rem;
    backdrop-filter: blur(14px);
}

.launcher-title-wrap h2 {
    font-size: 1.7rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.launcher-badge-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 0.6rem;
    margin-bottom: 1.2rem;
}

.badge-pill {
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.badge-pill.active {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

.download-cta-box {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: rgba(10, 12, 16, 0.7);
    padding: 1.4rem;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.download-btn-main {
    background: #ffffff;
    color: #07080a;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 800;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.3);
    transition: all 0.25s ease;
}

.download-btn-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 35px rgba(255, 255, 255, 0.5);
    background: #f1f5f9;
}

.download-meta-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.download-meta-info strong {
    color: #fff;
}

/* Admin Card */
.admin-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
}

.admin-card h3 {
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.admin-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.upload-form {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

/* LEADERBOARD VIEW */
.leaderboard-header {
    text-align: center;
    margin-bottom: 2rem;
}

.leaderboard-header h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
    color: #ffffff;
}

.leaderboard-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    overflow: hidden;
    backdrop-filter: blur(12px);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.leaderboard-table th {
    background: rgba(12, 14, 20, 0.95);
    padding: 1rem 1.4rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-table td {
    padding: 1rem 1.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.92rem;
}

.leaderboard-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.player-cell {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.player-cell img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(4, 5, 8, 0.85);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-box {
    background: #0d0f15;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 35px rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.3rem 1.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #fff;
}

.modal-tabs {
    display: flex;
    background: rgba(8, 10, 14, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-tab-btn {
    flex: 1;
    padding: 0.85rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.modal-tab-btn.active {
    color: #ffffff;
    border-bottom-color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.modal-body {
    padding: 1.6rem;
}

.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    font-weight: 500;
}

.form-group small {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.3rem;
}

.form-banner-tip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    font-size: 0.8rem;
    color: #e2e8f0;
    margin-bottom: 1.2rem;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    background: #11141c;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.85rem 1.3rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.88rem;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid #ffffff;
}

.toast.error {
    border-left: 4px solid var(--danger);
}

@keyframes slideIn {
    from { transform: translateX(40px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Footer */
.footer {
    border-top: 1px solid var(--border-color);
    background: rgba(8, 9, 12, 0.9);
    padding: 1.8rem 2.5rem;
    margin-top: auto;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.6rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #ffffff;
}

@media (max-width: 900px) {
    .profile-view-container {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 2.6rem;
    }

    .navbar {
        padding: 1rem 1.4rem;
    }

    .nav-links {
        display: none;
    }
}
