:root {
    --clicker-dark: #233D4D;
    --clicker-yellow: #FCCA46;
}

.logo-container {
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.logo-click-target {
    display: flex;
    align-items: center;
    max-width: 100%;
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: transform 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.logo-click-target img {
    -webkit-user-drag: none;
}

.logo-click-target:hover {
    transform: scale(1.05);
}

.logo-click-target.is-clicking {
    animation: clicker-pop 180ms ease-out;
}

.logo-click-target:focus-visible,
.clicker-button:focus-visible,
.skill-node:focus-visible {
    outline: 4px solid #FFFFFF;
    outline-offset: 4px;
}

.clicker-readout[hidden],
.clicker-panel[hidden],
.clicker-panel [hidden],
.clicker-readout [hidden] {
    display: none;
}

.clicker-readout {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.section .clicker-count {
    max-width: none;
    color: var(--clicker-dark);
    font-size: var(--count-size, 160px);
    font-weight: 700;
    line-height: 0.8;
    text-align: left;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Shrinks the count as it grows so it stays on one line next to the logo. */
.clicker-readout[data-size="medium"] {
    --count-size: 128px;
}

.clicker-readout[data-size="small"] {
    --count-size: 96px;
}

.section .clicker-banter,
.section .clicker-banter p {
    max-width: 560px;
    color: var(--clicker-dark);
    font-size: 48px;
    line-height: 1;
    text-align: left;
}

.banter-container {
    position: relative;
    display: flex;
    align-items: stretch;
    max-width: 100%;
    margin-top: 12px;
    padding-right: 24px;
}

.section .clicker-banter {
    max-height: 3em;
    min-width: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.clicker-banter::-webkit-scrollbar {
    display: none;
}

.banter-scrollbar {
    position: absolute;
    top: 0;
    right: 0;
    width: 18px;
    height: 100%;
    appearance: none;
    -webkit-appearance: none;
    writing-mode: vertical-lr;
    direction: rtl;
    background: transparent;
    cursor: pointer;
    touch-action: pan-x;
}

.banter-scrollbar::-webkit-slider-runnable-track {
    width: 4px;
    background: rgb(35 61 77 / 35%);
    border-radius: 8px;
}

.banter-scrollbar::-webkit-slider-thumb {
    width: 10px;
    height: 48px;
    margin-left: -3px;
    appearance: none;
    -webkit-appearance: none;
    background: var(--clicker-dark);
    border-radius: 8px;
}

.banter-scrollbar::-moz-range-track {
    width: 4px;
    background: rgb(35 61 77 / 35%);
    border-radius: 8px;
}

.banter-scrollbar::-moz-range-thumb {
    width: 10px;
    height: 48px;
    background: var(--clicker-dark);
    border: 0;
    border-radius: 8px;
}

.section .clicker-banter p + p {
    margin-top: 2em;
}

.clicker-banter:focus-visible,
.banter-scrollbar:focus-visible {
    outline: 3px solid var(--clicker-dark);
    outline-offset: 3px;
}

.clicker-panel {
    width: min(680px, 88vw);
    margin-top: 24px;
    padding: 18px 24px;
    color: var(--clicker-yellow);
    background: var(--clicker-dark);
    border-radius: 16px;
    text-align: center;
}

.section .clicker-sub,
.section .clicker-status {
    color: var(--clicker-yellow);
    font-size: 32px;
    line-height: 1.05;
    max-width: none;
}

.clicker-status:empty {
    display: none;
}

#prestige-progress::before {
    content: ' · ';
}

.clicker-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 12px 0;
}

.clicker-button {
    padding: 4px 14px;
    color: var(--clicker-dark);
    background: var(--clicker-yellow);
    border: 3px solid var(--clicker-yellow);
    border-radius: 10px;
    font: 700 28px/1 'Dongle', sans-serif;
    cursor: pointer;
    transition: transform 0.12s ease, opacity 0.12s ease;
}

.clicker-button:hover:not(:disabled) {
    transform: scale(1.04);
}

.clicker-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.prestige-button {
    display: block;
    width: 100%;
    margin: 12px 0;
    padding: 10px 14px;
    color: var(--clicker-dark);
    background: var(--clicker-yellow);
    border: 3px solid var(--clicker-yellow);
    border-radius: 14px;
    font: 700 64px/1 'Dongle', sans-serif;
    cursor: pointer;
    transition: transform 0.12s ease;
}

.prestige-button[hidden] {
    display: none;
}

.prestige-button:hover {
    transform: scale(1.02);
}

.prestige-button:focus-visible {
    outline: 4px solid #FFFFFF;
    outline-offset: 4px;
}

.clicker-cost {
    display: block;
    font-weight: 400;
}

.skill-tree,
.restart-section {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 2px solid rgb(252 202 70 / 65%);
}

.skill-tree h2 {
    color: var(--clicker-yellow);
    font-size: 42px;
    line-height: 1;
}

.skill-tree #skill-list {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.skill-tree #skill-list::-webkit-scrollbar {
    display: none;
}

.skill-scrollbar {
    display: block;
    width: 100%;
    height: 18px;
    margin-top: 6px;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    cursor: pointer;
    touch-action: pan-y;
}

.skill-scrollbar::-webkit-slider-runnable-track {
    height: 4px;
    background: rgb(252 202 70 / 35%);
    border-radius: 8px;
}

.skill-scrollbar::-webkit-slider-thumb {
    width: 48px;
    height: 10px;
    margin-top: -3px;
    appearance: none;
    -webkit-appearance: none;
    background: var(--clicker-yellow);
    border-radius: 8px;
}

.skill-scrollbar::-moz-range-track {
    height: 4px;
    background: rgb(252 202 70 / 35%);
    border-radius: 8px;
}

.skill-scrollbar::-moz-range-thumb {
    width: 48px;
    height: 10px;
    background: var(--clicker-yellow);
    border: 0;
    border-radius: 8px;
}

.skill-scrollbar:focus-visible {
    outline: 4px solid #FFFFFF;
    outline-offset: 4px;
}

.skill-tree #skill-list > ul {
    width: max-content;
    margin: 0 auto;
}

.skill-tree ul {
    --tree-line: 2px solid var(--clicker-yellow);
    position: relative;
    display: flex;
    justify-content: center;
    padding-top: 20px;
    list-style: none;
}

.skill-tree #skill-list > ul {
    padding-top: 8px;
}

.skill-tree li {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 6px 0;
}

.skill-tree #skill-list > ul > li {
    padding-top: 0;
}

.skill-tree li::before,
.skill-tree li::after {
    content: '';
    position: absolute;
    top: 0;
    right: 50%;
    width: 50%;
    height: 20px;
    border-top: var(--tree-line);
}

.skill-tree li::after {
    right: auto;
    left: 50%;
    border-left: var(--tree-line);
}

.skill-tree li:only-child::before,
.skill-tree li:only-child::after {
    display: none;
}

.skill-tree li:only-child {
    padding-top: 0;
}

.skill-tree li:first-child::before,
.skill-tree li:last-child::after {
    border: 0;
}

.skill-tree li:last-child::before {
    border-right: var(--tree-line);
}

.skill-tree ul ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    height: 20px;
    border-left: var(--tree-line);
}

.skill-node {
    width: 150px;
    padding: 4px 8px;
    color: var(--clicker-yellow);
    background: transparent;
    border: 3px solid var(--clicker-yellow);
    border-radius: 10px;
    font: 700 24px/1 'Dongle', sans-serif;
    cursor: pointer;
}

.skill-node[data-status="available"]:hover {
    background: rgb(252 202 70 / 20%);
}

.skill-node[data-status="locked"] {
    cursor: not-allowed;
    opacity: 0.5;
}

.skill-node[data-status="owned"] {
    color: var(--clicker-dark);
    background: var(--clicker-yellow);
    cursor: default;
}

@keyframes clicker-pop {
    0% { transform: scale(1); }
    35% { transform: scale(0.88); }
    70% { transform: scale(1.07); }
    100% { transform: scale(1); }
}

@media (max-width: 800px) {
    .logo-click-target {
        flex-direction: column;
        align-items: center;
    }

    .clicker-readout {
        align-items: center;
    }

    .section .clicker-count {
        text-align: center;
    }

    .clicker-readout {
        --count-size: 96px;
    }

    .clicker-readout[data-size="medium"] {
        --count-size: 76px;
    }

    .clicker-readout[data-size="small"] {
        --count-size: 56px;
    }

    .prestige-button {
        font-size: 48px;
    }

    .section .clicker-banter,
    .section .clicker-banter p {
        font-size: 32px;
        text-align: center;
    }

    .clicker-panel {
        padding: 14px;
    }

    .section .clicker-sub,
    .section .clicker-status {
        font-size: 26px;
    }

    .run-total,
    #prestige-progress:not([hidden]) {
        display: block;
        white-space: nowrap;
    }

    #prestige-progress::before {
        content: none;
    }

    .clicker-button {
        font-size: 24px;
    }

    .skill-node {
        width: 108px;
        font-size: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .logo-click-target,
    .clicker-button {
        transition: none;
    }

    .logo-click-target.is-clicking {
        animation-duration: 1ms;
    }
}
