* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --gold: #FFC107;        
    --orange: #FF5722;      
    --brown-dark: #261405;  
    --gold-blur: rgba(255, 193, 7, 0.15);
    --dark: #0A0705;      
    --card-bg: rgba(38, 20, 5, 0.9); 
    --terminal-green: #AEEA00; 
}

body {
    background-color: var(--dark);
    color: white;
    font-family: 'Space Grotesk', sans-serif;
    min-height: 100vh;
    width: 100vw;
    overflow-x: hidden;
    overflow-y: auto;
    background: radial-gradient(circle at center, #3d1a05 0%, #0a0705 100%);
}

.hidden { display: none !important; }

#landing-page {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at center, #5e290a 0%, #0a0705 100%);
    z-index: 1000;
    pointer-events: all;
}

#main-dashboard.hidden {
    display: none !important;
}

.glass-login-card {
    width: 90%; 
    max-width: 400px; 
    padding: 60px 40px;
    background: var(--card-bg); 
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 40px; 
    text-align: center; 
    backdrop-filter: blur(25px);
    box-shadow: 0 0 60px rgba(255, 87, 34, 0.1);
    position: relative;
    overflow: hidden;
    pointer-events: all;
}

.hero-logo {
    width: 60px; 
    height: auto;
    filter: drop-shadow(0 0 10px var(--pink));
    margin-bottom: 25px;
}

.glass-login-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 2px;
    background: var(--gold);
    opacity: 0.3;
    box-shadow: 0 0 10px var(--gold);
    animation: scan 3s linear infinite;
}

@keyframes scan {
    0% { top: 0%; }
    100% { top: 100%; }
}

.protocol-title { 
    font-size: 1.4rem; 
    letter-spacing: 6px; 
    color: var(--gold); 
    margin-bottom: 5px; 
}
.protocol-subtitle { 
    font-size: 10px; 
    color: #666; 
    letter-spacing: 2px; 
    margin-bottom: 30px; 
}

#initialXHandle {
    width: 100%;
    background: #000;
    border: 2px solid #3d2516;
    padding: 18px;
    border-radius: 15px;
    color: var(--gold) !important;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    transition: all 0.3s ease;
    outline: none;
    margin-bottom: 20px;
}

#initialXHandle:focus {
    border-color: var(--gold);
    box-shadow: 0 0 20px var(--gold-blur);
    background: rgba(255, 193, 7, 0.05);
}

.init-button {
    width: 100%;
    padding: 18px;
    background: var(--gold);
    color: #000;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 2px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-transform: uppercase;
}

.init-button:hover {
    transform: scale(1.02) translateY(-3px);
    box-shadow: 0 10px 30px var(--gold);
    background: #fff;
}


.hero-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; 
    width: 100%;
}
.handle-header {
    font-size: 2.2rem; font-weight: 800; color: #fff;
    margin-bottom: 20px; text-transform: uppercase;
    text-shadow: 0 0 15px var(--gold-blur);
}

.main-card {
    background: var(--card-bg); border-radius: 40px;
    padding: 60px 40px; width: 100%; max-width: 480px;
    display: flex; flex-direction: column; align-items: center;
    border: 2px solid rgba(255, 193, 7, 0.15);
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

.avatar-wrap {
    position: relative; width: 220px; height: 220px; margin-bottom: 40px;
}

.avatar-wrap::after {
    content: ''; position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%); width: 130%; height: 130%;
    background: radial-gradient(circle, rgba(255, 87, 34, 0.2) 0%, transparent 70%);
    z-index: 1; pointer-events: none;
}

.floating-avatar {
    width: 100%; 
    height: auto; 
    position: relative; 
    z-index: 2;
    filter: drop-shadow(0 0 25px var(--orange));
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.progress-container { 
    width: 100%; 
    max-width: 350px; 
}

.prog-labels {
    display: flex; justify-content: space-between; margin-bottom: 12px;
    font-size: 11px; font-weight: 700; color: var(--gold); letter-spacing: 2px;
}

.track {
    background: #111; height: 14px; border-radius: 20px;
    width: 100%; overflow: hidden; border: 1px solid #222;
}

.fill {
    background: linear-gradient(90deg, #5d4037, var(--gold), var(--orange));
    height: 100%; width: 0%; border-radius: 20px;
    box-shadow: 0 0 15px var(--gold);
    transition: width 1s cubic-bezier(0.17, 0.67, 0.83, 0.67);
}

.points-sub { 
    margin-top: 15px; 
    font-weight: 700; 
    text-align: center; 
}
.points-sub span { 
    color: var(--gold); 
    font-size: 1.2rem; 
}

.top-nav {
    height: 80px; display: flex; justify-content: space-between;
    align-items: center; padding: 0 40px; border-bottom: 1px solid #222;
    background: rgba(0,0,0,0.8); backdrop-filter: blur(10px);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
    gap: 30px;
    padding: 40px;
    min-height: calc(100vh - 80px);
}

.sidebar-header {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 193, 7, 0.2);
    position: relative;
}

.sidebar-header::after {
    content: '● STATUS_LIVE';
    font-size: 9px;
    letter-spacing: 1px;
    color: var(--terminal-green); 
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.sidebar-header:hover {
    text-shadow: 2px 0px var(--cyan), -2px 0px #ff0000;
    cursor: default;
}

.sidebar {
    overflow: hidden; 
}

.user-profile { 
    display: flex; 
    background: #111; 
    border-radius: 8px; 
    border: 1px solid #333; 
    overflow: hidden; 
}
.operator-tag { 
    background: var(--gold); 
    color: #000; 
    padding: 5px 10px; 
    font-size: 10px; 
    font-weight: bold; 
}
.handle-text { 
    padding: 5px 15px; 
    font-size: 13px; 
}

#wallet-gate {
    margin-top: 30px;
    padding: 25px;
    background: rgba(255, 193, 7, 0.03);
    border: 1px dashed var(--gold);
    border-radius: 20px;
    animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
    from { box-shadow: 0 0 5px rgba(255, 0, 255, 0.1); }
    to { box-shadow: 0 0 20px rgba(255, 0, 255, 0.2); }
}

.unlock-msg {
    font-size: 12px;
    letter-spacing: 3px;
    color: var(--gold);
    margin-bottom: 15px;
    font-weight: 700;
    text-align: center;
}

.unlock-area {
    margin-top: 20px;
    padding: 25px;
    background: rgba(0, 255, 255, 0.03);
    border: 1px solid var(--cyan);
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.1);
}

.submit-btn {
    margin-top: 10px;
    width: 100%;
    padding: 14px;
    background: var(--gold);
    border: none;
    color: #000;
    font-weight: 900;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: 0.3s;
}

.submit-btn:hover {
    background: #fff;
    box-shadow: 0 0 20px #fff;
}

#ethWallet {
    width: 100%;
    background: #000;
    border: 1px solid #333;
    padding: 15px;
    border-radius: 10px;
    color: #00ff00; 
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    margin-bottom: 15px;
    outline: none;
    transition: border 0.3s;
}

#ethWallet:focus {
    border-color: var(--gold);
}

.quest-list {
    display: flex;
    flex-direction: column; 
    gap: 15px;
    margin-top: 15px;
    max-height: 420px; 
    overflow-y: auto;
    overflow-x: hidden; 
    padding: 10px 12px 10px 5px;
}

.quest-list::-webkit-scrollbar {
    width: 4px;
}
.quest-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.quest-list::-webkit-scrollbar-thumb {
    background: var(--gold);
    box-shadow: 0 0 10px var(--orange);
    border-radius: 10px;
}

.quest-info {
    flex-grow: 1;
}

.quest-name {
    display: block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    margin-bottom: 4px;
}

.quest-reward {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    color: var(--orange);
    font-weight: 500;
    opacity: 0.8;
}

.quest-item {
    background: rgba(15, 15, 15, 0.6);
    border: 1px solid rgba(255, 193, 7, 0.1);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center; 
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
    flex-shrink: 0;
    width: 100%;
    min-height: 85px;
}

.quest-item::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, transparent 50%, var(--gold) 50%);
    opacity: 0.5;
}

.quest-item:hover {
    background: rgba(255, 193, 7, 0.08);
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 0, 255, 0.15);
}

.quest-item .icon {
    font-size: 1.5rem;
    color: var(--gold);
    margin-bottom: 5px;
    filter: drop-shadow(0 0 5px var(--gold));
}

.quest-icon-box {
    width: 45px;
    height: 45px;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--gold);
    flex-shrink: 0;
}

.quest-item .name {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #eee;
    text-transform: uppercase;
}

.quest-item .reward {
    align-self: flex-start;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: var(--cyan);
    border: 1px solid var(--cyan);
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(0, 255, 255, 0.05);
}

.quest-item.done {
    opacity: 0.4;
    filter: grayscale(1);
    border-style: dashed;
    pointer-events: none;
    border-color: var(--terminal-green);
    background: rgba(0, 255, 65, 0.05);
}

.quest-item.done .quest-icon-box {
    background: var(--terminal-green);
    color: #000;
    border-color: var(--terminal-green);
}

.protocol-title, .handle-header {
    position: relative;
    text-shadow: 0.05em 0 0 var(--orange),
                -0.025em -0.05em 0 rgba(255, 193, 7, 0.75),
                0.025em 0.05em 0 rgba(255, 255, 255, 0.75);
    animation: glitch 500ms infinite;
}

.protocol-title::before, .protocol-title::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

@keyframes glitch {
    0% {
        text-shadow: 0.05em 0 0 rgba(243, 87, 15, 0.75),
                    -0.05em -0.025em 0 rgba(0, 255, 255, 0.749),
                    -0.025em 0.05em 0 rgba(255, 255, 0, 0.75);
    }
    14% {
        text-shadow: 0.05em 0 0 rgba(243, 87, 15, 0.75),
                    -0.05em -0.025em 0 rgba(0, 255, 255, 0.75),
                    -0.025em 0.05em 0 rgba(255, 255, 0, 0.75);
    }
    15% {
        text-shadow: 0.05em 0 0 rgba(243, 87, 15, 0.75),
                    0.025em 0.025em 0 rgba(0, 255, 255, 0.75),
                    -0.05em -0.05em 0 rgba(255, 255, 0, 0.75);
    }
    49% {
        text-shadow: -0.05em -0.025em 0 rgba(255, 0, 255, 0.75),
                    0.025em 0.025em 0 rgba(0, 255, 255, 0.75),
                    -0.05em -0.05em 0 rgba(255, 255, 0, 0.75);
    }
    50% {
        text-shadow: 0.025em 0.05em 0 rgba(255, 0, 255, 0.75),
                    0.05em 0 0 rgba(0, 255, 255, 0.75),
                    0 -0.05em 0 rgba(255, 255, 0, 0.75);
    }
    99% {
        text-shadow: 0.025em 0.05em 0 rgba(255, 0, 255, 0.75),
                    0.05em 0 0 rgba(0, 255, 255, 0.75),
                    0 -0.05em 0 rgba(255, 255, 0, 0.75);
    }
    100% {
        text-shadow: -0.025em 0 0 rgba(255, 0, 255, 0.75),
                    -0.025em -0.025em 0 rgba(0, 255, 255, 0.75),
                    -0.025em -0.05em 0 rgba(255, 255, 0, 0.75);
    }
}

::-webkit-scrollbar { 
    width: 5px; 
}
::-webkit-scrollbar-track { 
    background: transparent; 
}
::-webkit-scrollbar-thumb { 
    background: #333; 
    border-radius: 10px; 
}
::-webkit-scrollbar-thumb:hover { 
    background: var(--gold); 
}

.user-profile button:hover {
    color: var(--gold) !important;
    text-shadow: 0 0 10px var(--gold);
    background: rgba(255, 0, 255, 0.1) !important;
}

#toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(10, 10, 10, 0.9);
    border-left: 4px solid var(--gold);
    color: white;
    padding: 15px 25px;
    border-radius: 4px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    animation: slideIn 0.3s ease forwards;
    backdrop-filter: blur(10px);
}

.toast.success { 
    border-left-color: var(--terminal-green); 
}
.toast.error { 
    border-left-color: #ff0000; 
}

@keyframes slideIn {
    from { 
        transform: translateX(100%); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0); 
        opacity: 1; 
    }
}

#loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

#loading-overlay.hidden {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden;
}

.terminal-loader {
    width: 250px; 
    text-align: 
    center; 
}
.loader-text { 
    color: var(--gold); 
    font-size: 12px; 
    margin-bottom: 10px; 
    letter-spacing: 3px; 
}
.loader-bar { 
    height: 2px; 
    background: #222; 
    position: relative; 
    overflow: hidden; 
}

.loader-bar::after {
    content: '';
    position: absolute;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gold);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

#reset-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 12000;
    backdrop-filter: blur(10px);
}

.modal-content {
    background: #0a0a0a;
    border: 1px solid #ff0000;
    padding: 30px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.2);
}

.modal-header {
    color: #ff0000;
    font-weight: 800;
    letter-spacing: 4px;
    margin-bottom: 20px;
}

.modal-content p {
    font-size: 12px;
    line-height: 1.6;
    color: #888;
    margin-bottom: 30px;
}

.modal-actions {
    display: flex;
    gap: 15px;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: 0.3s;
}

.modal-btn.cancel { 
    background: #222; 
    color: white; 
}
.modal-btn.confirm { 
    background: #ff0000; 
    color: black; 
}

.modal-btn:hover { 
    transform: translateY(-2px); 
    filter: brightness(1.2); 
}

.unlock-area.locked-state {
    opacity: 0.5;
    filter: grayscale(0.8);
    cursor: not-allowed;
    border: 1px dashed #444;
    box-shadow: none;
}

.submit-btn.locked {
    background: #333;
    color: #666;
    cursor: not-allowed;
    box-shadow: none;
}

#lock-status-msg.locked {
    color: #888;
}

.success-unlock-text {
    margin-top: 15px;
    font-size: 13px;
    font-weight: 800;
    color: #00ffffbf;
    text-align: center;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: simple-pulse 2s infinite ease-in-out;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

@keyframes simple-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.98); }
}

.logout-trigger {
    background: none;
    border: none;
    border-left: 1px solid #333;
    color: #ff0000;
    padding: 0 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.logout-trigger svg {
    width: 18px;
    height: 18px;
    filter: drop-shadow(0 0 5px rgba(255, 0, 0, 0.3));
}

.logout-trigger:hover {
    color: var(--pink);
    background: rgba(255, 0, 255, 0.1) !important;
}

.logout-trigger:hover svg {
    filter: drop-shadow(0 0 8px var(--pink));
}

.secure-input {
    margin-top: 10px; 
    border-radius: 15px; 
    background: #000; 
    border: 2px solid #222; 
    color: var(--pink); 
    text-align: center; 
    width: 100%; 
    padding: 18px; 
    outline: none; 
    font-weight: bold; 
    letter-spacing: 5px;
    
    -webkit-text-security: disc;
    text-security: disc;
}

.secure-input::placeholder {
    -webkit-text-security: none;
    text-security: none;
    letter-spacing: normal;
}

.wallet-connected {
    border: 1px solid var(--terminal-green) !important;
    color: var(--terminal-green) !important;
    background: rgba(174, 234, 0, 0.1) !important;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.2);
}

#social-input-area {
    animation: slideUp 0.5s ease forwards;
}

#social-input-area .init-button {
    background: var(--gold);
    color: #000;
    font-weight: 800;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}


@media (max-width: 900px) {
    .dashboard-grid {
        display: flex;
        flex-direction: column;
        padding: 20px;
    }

    .sidebar {
        width: 100%;
        margin-top: 20px;
    }

    .main-card {
        padding: 30px 20px;
    }

    .handle-header {
        font-size: 1.5rem;
    }
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 193, 7, 0.1);
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
}

.leaderboard-list::-webkit-scrollbar {
    width: 4px;
}

.leaderboard-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}

.leaderboard-list::-webkit-scrollbar-thumb {
    background: var(--gold);
    box-shadow: 0 0 5px var(--orange);
    border-radius: 10px;
}

.leader_row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    transition: 0.3s;
}

.leader_row:first-child {
    background: rgba(255, 193, 7, 0.08);
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.leader_rank {
    font-weight: 800;
    color: var(--gold);
    font-size: 14px;
    width: 35px;
}

.leader_wallet {
    font-family: 'Courier New', monospace;
    color: #aaa;
    font-size: 12px;
    flex-grow: 1;
}

.leader_points {
    font-weight: 700;
    color: var(--orange);
    font-size: 13px;
    text-shadow: 0 0 10px rgba(255, 87, 34, 0.3);
}

.leader_row:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.02);
}

.refresh-btn {
    background: none;
    border: none;
    color: var(--gold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    opacity: 0.6;
}

.refresh-btn:hover {
    opacity: 1;
    transform: rotate(180deg);
}

.refresh-btn:active {
    transform: scale(0.9);
}
