
/* --- 1. BASE & RESET --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #111111;
    font-family: "Raleway", sans-serif;
    padding-bottom: 120px;
    color: #ffffff;
}

a {
    text-decoration: none;
    color: rgb(38, 38, 255);
}

ul { color: #a1a1a1; font-size: 13px; }
li { color: #858585; font-size: 13px; }

h2 {
    font-size: 16px;
    margin-bottom: 8px;
}

p {
    font-size: 12px;
    color: #cfcfcf;
    line-height: 1.5;
}

/* --- 2. BRANDING & HEADER --- */
.Logo {
    font-family: "Raleway", sans-serif;
    font-weight: 900;
    font-size: 48px;
    line-height: 1;
    position: absolute;
    top: 16px;
    left: 16px;
}

.logo-rlb { color: #ffffff; }
.logo-dot { color: #555; }
.logo-lol { color: chartreuse; }

.login-icon {
    position: fixed;
    right: 20px;
    top: 20px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    border-radius: 50%;
    z-index: 10;
}

.login-icon:hover { opacity: 1; }

.api-site {
    position: absolute;
    padding: 3px 6px;
    color: #111111;
    background-color: chartreuse;
    border-radius: 5px;
    font-family: "Cascadia Code", monospace;
    font-size: 10px;
    font-weight: 700;
    top: 38px;
    right: 70px;
    box-shadow: 0.4rem 0.4rem #05060f;
    transform: translate(0%, -50%);
}

/* --- 3. LEADERBOARD --- */
.leaderboard {
    position: relative;
    top: 80px;
    left: 0;
    width: 100%;
    border-collapse: collapse;
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 20px;
}

.leaderboard th {
    color: chartreuse;
    border-bottom: 1px solid #222;
    padding: 12px 24px;
    text-align: left;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.leaderboard td {
    padding: 14px 24px;
    border-bottom: 1px solid #1a1a1a;
    color: #666;
    font-size: 14px;
    transition: color 0.15s;
}

.leaderboard tr:hover td {
    background: #161616;
    color: #ffffff;
}

#leaderboard td img {
    display: inline-block;
    vertical-align: middle;
}

/* Ranking Colors */
.gold td   { color: #FFD700; }
.silver td { color: #C0C0C0; }
.bronze td { color: #cd7f32; }

.gold td:first-child,
.silver td:first-child,
.bronze td:first-child { font-weight: 700; }

.badge {
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 500;
    margin-left: 5px;
}

.tier-ultra { background: #EEEDFE; color: #534AB7; }
.tier-rich { background: #FAEEDA; color: #854F0B; }
.tier-invested { background: #EAF3DE; color: #3B6D11; }
.tier-new { background: transparent; color: #999; }

/* --- 4. POPUP FRAMEWORK (Shared Modal Styles) --- */
.background {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 990;
}

.background.active { display: block; }

/* .popup-section, */
.token-popup,
.username-popup-div {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    /* width: 90%; */
	max-width: 470px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 20px;
    padding: 1.5rem 3.5rem 1.5rem 1.5rem;
    flex-direction: row;
    align-items: center;
    gap: 1rem;            
    z-index: 1000;
    width: fit-content;
}

.popup-section {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;

    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 20px;
    padding: 2rem;

    width: 90%;
    max-width: 340px;
    max-height: 80vh;

    flex-direction: column;
    gap: 1.2rem;
    z-index: 1000;

    overflow-y: auto;
    overflow-x: hidden;
}

.settings-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    /* width: 90%; */
	/* max-width: 470px; */
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 20px;
    padding: 1.5rem 3.5rem 1.5rem 1.5rem;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
    width: fit-content;
}

.token-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;

    /* flex-direction: column; */
    align-items: stretch;
    gap: 1rem;

    width: 90%;
    max-width: 470px;

    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 20px;
    padding: 1.5rem;
    z-index: 1000;
}

/* .popup-section.active, */
.username-popup-div.active { 
	display: flex;
	width: fit-content;
}

.popup-section.active {
    display: flex;
}

.settings-popup.active {
    display: flex;
}

.token-popup.active {
    display: flex;
}

/* General Popup Layout */
.popup-section::-webkit-scrollbar { display: none; }

/* Popup Header & Footer */
.popup-header h2 { font-size: 20px; font-weight: 600; color: #ffffff; }
.popup-header p { color: #666; font-size: 13px; }
.popup-footer { font-size: 13px; color: #666; text-align: center; }

/* Close Buttons */
.close-window, .close-token-popup {
    position: absolute;
    width: 32px;
    right: 20px;
    top: 20px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    z-index: 1001;
}

.close-token-popup { top: 50%; transform: translate(0%, -50%); right: 30px; }
.close-window:hover, .close-token-popup:hover { opacity: 1; }

.username-note {
    display: block;
    font-size: 10px;
    color: gray;
    margin-top: -14px;
    margin-bottom: 0;
}

.username-note + .popup-field {
    margin-top: -16px;
}

/* --- 5. FORM ELEMENTS & BUTTONS --- */
.popup-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.popup-field label {
    font-size: 12px;
    color: #888;
    letter-spacing: 0.04em;
}

.popup-field input {
    width: 100%;
    background: #222222 !important;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    color: #ffffff !important;
    padding: 10px 12px;
    font-size: 14px;
    font-family: 'Raleway', sans-serif;
    outline: none;
    transition: border-color 0.15s;
}

.popup-field input:focus { border-color: #7fff00; }
.popup-field input::placeholder { color: #444; }

/* Main Action Buttons */
.popup-submit {
    width: 100%;
    padding: 11px;
    background: chartreuse;
    color: #111111;
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Raleway', sans-serif;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.popup-submit:hover { background: #b8ff00; }
.popup-submit:active { transform: scale(0.97); }

/* --- 6. SPECIFIC POPUP: SETTINGS --- */
.settings-popup {
    width: 90%;
    max-width: 320px;
    padding: 2rem;
    flex-direction: column;
    gap: 1rem;
}

.settings-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 1rem;
    border-bottom: 1px solid #2a2a2a;
}

.settings-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-username {
    font-size: 22px;
    font-weight: 600;
    color: #ffffff;
    cursor: grab;
}

.settings-pfp-wrapper {
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.settings-pfp {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #2a2a2a;
}

.settings-pfp-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.settings-pfp-wrapper:hover .settings-pfp-overlay { opacity: 1; }

.settings-fields {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-btn {
    width: 100%;
    padding: 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    background: transparent;
    border: 1px solid #444;
}

.settings-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-btn.logout { color: #888; }
.settings-btn.logout:hover { border-color: #ff6b6b; color: #ff6b6b; }

.settings-btn img { width: 14px; height: 14px; filter: invert(1); opacity: 0.6; }

/* --- 7. SPECIFIC POPUP: TOKEN PURCHASE --- */
.token-popup {
    width: 90%;
    max-width: 320px;
    padding: 1.2rem 0.8rem;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.token-header h2 {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translate(-50%, 0%);
    font-size: 30px;
    white-space: nowrap;
}

.token-header p {
    position: absolute;
    top: 68px;
    left: 50%;
    transform: translate(-50%, 0%);
    color: #666;
    font-size: 13px;
    white-space: nowrap;
}

.token-button {
    width: 90%;
    height: 40px;
    border-radius: 999px;
    border: 1px solid chartreuse;
    color: #7fff00;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    background: transparent;
}

.token-button:hover { background: chartreuse; color: #111; }

.sale-text {
	color: red;
	font-size: 75%;
	margin-left: 6px;
	vertical-align: middle;
}

/* --- 8. SPECIFIC POPUP: PROFILE/USERNAME --- */
.popup-profile {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #2a2a2a;
    flex-shrink: 0;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.profile-username {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
    font-weight: 500;
    font-size: 15px;
}

.profile-bio {
    font-size: 12px;
    color: #999;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}

.profile-stats { color: chartreuse; font-size: 13px; font-family: 'JetBrains Mono', monospace; }
.profile-member-since { color: #444; font-size: 11px; font-family: 'JetBrains Mono', monospace; }
.view-profile { color: chartreuse; font-size: 11px; cursor: pointer; }

/* --- 9. SHARED COMPONENTS & UTILITIES --- */

/* Counter Component */
.counter {
    margin-top: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

.counter .value {
    width: 60px;
    text-align: center;
    font-size: 22px;
    font-weight: bold;
    color: #7fff00;
    background: transparent;
    border: none;
    outline: none;
    font-family: 'JetBrains Mono', monospace;
    text-shadow: 0 0 5px rgba(127,255,0,0.4);
}

.value::-webkit-outer-spin-button,
.value::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.value {
    appearance: textfield;
}

.counter .minus, .counter .plus {
    font-size: 22px;
    background: none;
    border: none;
    color: #7fff00;
    cursor: pointer;
    transition: text-shadow 0.2s, transform 0.1s;
}

.counter .minus:hover, .counter .plus:hover {
    text-shadow: 0 0 6px #7fff00;
    transform: scale(1.2);
}

/* Tuturial modal */
.onboarding-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    z-index: 99999;
    font-family: 'JetBrains Mono', monospace;
}

.onboarding-box {
    width: 380px;
    background: rgba(25,25,25,0.92);
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    padding: 22px;
    color: white;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
}

.accept-button {
    background: #7cff00;
    color: black;
    padding: 6px 20px;
    border-radius: 10px;
    font-size: 12px;
    cursor: pointer;
    border: none;
}

.hidden {
    display: none;
}

/* Toast Notifications */
#toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: #888;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 9999;
    max-width: 300px;
}

#toast.show { opacity: 1; transform: translateY(0); }
#toast.success { border-color: chartreuse; color: chartreuse; }
#toast.hello   { border-color: yellow;     color: yellow;     }
#toast.error   { border-color: #ff6b6b;    color: #ff6b6b;    }

/* Floating Utility Buttons */
.token-opener {
    position: fixed;
    bottom: 20px;
    left: 70px;
    right: 112px; /* was 70px — now clears both reload and jump-to-me */
    height: 32px;
    border-radius: 999px;
    border: 1px solid chartreuse;
    color: #7fff00;
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    z-index: 5;
    font-family: 'JetBrains Mono', monospace;
}

.token-opener:hover { background: chartreuse; color: #111; }

#info-btn, .reload-btn {
    position: fixed;
    bottom: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #333;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 5;
}

#info-btn { left: 20px; font-size: 13px; }
.reload-btn { right: 20px; }

#info-btn:hover, .reload-btn:hover { border-color: chartreuse; color: white; }
.reload-btn:hover { color: chartreuse; }

.reload-btn img {
    width: 16px;
    height: 16px;
    filter: brightness(1) invert(1);
    opacity: 0.5;
    transition: opacity 0.2s;
}

.reload-btn:hover img { opacity: 1; }

.jump-to-me-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #333;
    color: #666;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 5;
}

.jump-to-me-btn:hover {
    border-color: chartreuse;
    color: chartreuse;
}

.jump-to-me-btn img {
    width: 16px;
    height: 16px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.jump-to-me-btn:hover img { opacity: 1; }

/* default position — no jump button present */
.reload-btn { right: 20px; }
.token-opener { right: 70px; }

/* when logged in and jump button is showing, shift everything left */
body.has-jump-btn .jump-to-me-btn { display: flex; }
body.has-jump-btn .reload-btn { right: 62px; }
body.has-jump-btn .token-opener { right: 112px; }

/* Highlight when scrolled to */
#my-row {
    transition: background-color 0.3s ease;
}

#my-row.jump-highlight {
    animation: jump-blink 1.2s ease-out;
}

@keyframes jump-blink {
    0%   { background-color: rgba(255, 255, 255, 0.05); }
    50%  { background-color: rgba(255, 255, 255, 0.01); }
    100% { background-color: transparent; }
}

/* Miscellaneous */
.link-text { color: chartreuse; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.info-text { font-size: 14px; color: #a1a1a1; line-height: 1.3; }
.dev-badge { color: #b000ff; font-size: 11px; font-family: 'JetBrains Mono', monospace; }
h3 { color: white; }

/* Media */
@media (max-width: 480px) {
    .username-popup-div {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .profile-info {
        align-items: center;
    }
}