addLayer("sp", {
    name: "super progress", // This is optional, only used in a few places, If absent it just uses the layer id.
    symbol: "‰", // This appears on the layer's node. Default is the id with the first letter capitalized
    position: 0, // Horizontal position within a row. By default it uses the layer id and sorts in alphabetical order
    startData() { return {
        unlocked: false,
		points: new Decimal(0)
    }},
    color: "#107f76",
    requires: 15000, // Can be a function that takes requirement increases into account
    resource: "super progress points", // Name of prestige currency
    baseResource: "points", // Name of resource prestige is based on
    baseAmount() {return player.points}, // Get the current amount of baseResource
    type: "normal", // normal: cost to gain currency depends on amount gained. static: cost depends on how much you already have
    exponent: 0.5, // Prestige currency exponent
    gainMult() { // Calculate the multiplier for main currency from bonuses
        return new Decimal(1)
    },
    gainExp() { // Calculate the exponent on main currency from bonuses
        return new Decimal(1)
    },
    row: 1, // Row the layer is in on the tree (0 is the first row)
    hotkeys: [
        {key: "s", description: "S: Reset for super progress points", onPress(){if (canReset(this.layer)) doReset(this.layer)}},
    ],
    onPrestige(gain) {
        if (player.p.points.eq(0)) { player.ach.has45 = true }
    },
    bars: {
        eta: {
            direction: RIGHT,
            width: 300,
            height: 50,
            progress() { return player[this.layer].points.div(getEtaCost()) },
            display() {
                return "Eta - Level " + getEtaLevel() + " (" + player[this.layer].points + "/" + getEtaCost()
                    + ")<br>Effect: +" + getEtaEffect() + " to point gen."
            },
            fillStyle: {backgroundColor: "#107f76"}
        },
        theta: {
            direction: RIGHT,
            width: 300,
            height: 50,
            progress() { return player[this.layer].points.div(getThetaCost()) },
            display() {
                return "Theta - Level " + getThetaLevel() + " (" + player[this.layer].points + "/" + getThetaCost()
                    + ")<br>Effect: x" + getThetaEffect() + " to PP."
            },
            fillStyle: {backgroundColor: "#107f76"},
            unlocked() { return getEtaLevel().gt(0) }
        },
        iota: {
            direction: RIGHT,
            width: 300,
            height: 50,
            progress() { return player[this.layer].points.div(getIotaCost()) },
            display() {
                return "Iota - Level " + getIotaLevel() + " (" + player[this.layer].points + "/" + getIotaCost()
                    + ")<br>Effect: ^" + getIotaEffect() + " to point gen."
            },
            fillStyle: {backgroundColor: "#107f76"},
            unlocked() { return getThetaLevel().gt(0) }
        },
        kappa: {
            direction: RIGHT,
            width: 300,
            height: 50,
            progress() { return player[this.layer].points.div(getKappaCost()) },
            display() {
                return "Kappa - Level " + getKappaLevel() + " (" + player[this.layer].points + "/" + getKappaCost()
                    + ")<br>Effect: x" + getKappaEffect() + " to softcap."
            },
            fillStyle: {backgroundColor: "#107f76"},
            unlocked() { return getIotaLevel().gt(0) }
        },
        lambda: {
            direction: RIGHT,
            width: 300,
            height: 50,
            progress() { return player[this.layer].points.div(getLambdaCost()) },
            display() {
                return "Lambda - Level " + getLambdaLevel() + " (" + player[this.layer].points + "/" + getLambdaCost()
                    + ")<br>Effect: x" + getLambdaEffect() + " to point gen."
            },
            fillStyle: {backgroundColor: "#107f76"},
            unlocked() { return getKappaLevel().gt(0) }
        },
    },
    buyables: {
        11: {
            title: "Much more progress",
            effect() { return Decimal.div(getBuyableAmount(this.layer, this.id), 20).add(1) },
            cost() { return Decimal.pow(getBuyableAmount(this.layer, this.id), 1.2).mul(3).add(20) },
            display() {
                return "Increase PP gain.<br><br>Amount: " + getBuyableAmount(this.layer, this.id)
                    + ".<br>Effect: ^" + this.effect(getBuyableAmount(this.layer, this.id)) + ".<br>Cost: "
                    + this.cost(getBuyableAmount(this.layer, this.id)) + " total super levels."
            },
            canAfford() { return Decimal.gte(getTotalSuperLevel(), this.cost()) },
            buy() { addBuyables(this.layer, this.id, 1) }
        },
        12: {
            title: "Super point booster",
            effect() { return Decimal.pow(getBuyableAmount(this.layer, this.id), 1.3).add(1) },
            cost() { return Decimal.pow(getBuyableAmount(this.layer, this.id), 1.2).mul(5).add(25) },
            display() {
                return "Increase point gen.<br><br>Amount: " + getBuyableAmount(this.layer, this.id)
                    + ".<br>Effect: ^" + this.effect(getBuyableAmount(this.layer, this.id)) + ".<br>Cost: "
                    + this.cost(getBuyableAmount(this.layer, this.id)) + " total super levels."
            },
            canAfford() { return Decimal.gte(getTotalSuperLevel(), this.cost()) },
            buy() { addBuyables(this.layer, this.id, 1) }
        },
    },
    clickables: {
        11: {
            display() { return "Hold to gain SPP" },
            canClick() { return true },
            onClick() { if (canReset(this.layer)) doReset(this.layer) },
            onHold() { if (canReset(this.layer)) doReset(this.layer) }
        }
    },
    tabFormat: {
        "super levels": {
            content: [
                "main-display",
                ["row", ["prestige-button", ["clickable", 11]]],
                "resource-display",
                ["raw-html", () => "You have " + getTotalSuperLevel() + " super level" + (getTotalSuperLevel().eq(1) ? "" : "s") + "."],
                "blank",
                "blank",
                ["bar", "eta"],
                ["bar", "theta"],
                ["bar", "iota"],
                ["bar", "kappa"],
                ["bar", "lambda"],
            ]
        },
        "super buyables": {
            content: [
                "main-display",
                ["row", ["prestige-button", ["clickable", 11]]],
                "resource-display",
                ["raw-html", () => "You have " + getTotalSuperLevel() + " super level" + (getTotalSuperLevel().eq(1) ? "" : "s") + "."],
                "blank",
                "blank",
                "buyables",
            ],
            unlocked() { return getTotalSuperLevel().gte(18) }
        },
    },
    layerShown(){ return player.points.gte(10000) || player[this.layer].unlocked },
    branches: ['p'],
})