*,
*::before,
*::after {
    box-sizing: border-box;
    font-family: sans-serif;
}

* {
    margin: 0;
    padding: 0;
}

html,
body,
section {
    height: 100%;
}

button {
    border: none;
    outline: none;
}

main {
    position: relative;
}

.stacked {
    width: 100%;
    height: 100%;

    position: absolute;
    top: 0;
    left: 0;

    pointer-events: none;
}

.viewport {
    overflow: hidden;
    cursor: grab;

    pointer-events: auto;
}

.viewport.panning * {
    cursor: grabbing !important;
}

.bubbles-container {
    --transition-time: 1s;
    --max-bubble-size: 15vw;
    --pad: calc(10px + var(--max-bubble-size) / 2);

    height: 100%;
    padding: var(--pad);

    background-color: #e0e0e0;
    transform-origin: 0 0;
    position: relative;

    transition: transform 0.05s ease-out;
}

.bubbles-container.transition {
    transition: transform calc(var(--transition-time) / 1.5) ease-out;
}

.bubble {
    display: flex;
    justify-content: center;
    align-items: center;

    color: white;
    font-weight: bold;
    text-decoration: none;

    --width: calc(var(--size) * var(--max-bubble-size));
    width: var(--width);
    height: var(--width);
    font-size: calc(var(--width) / 4);

    border-radius: 50%;

    position: absolute;
    --add: calc(var(--pad) - (var(--width) / 2));
    left: calc(var(--add) + (var(--x) * (100% - 2 * var(--pad))));
    top: calc(var(--add) + (var(--y) * (100% - 2 * var(--pad))));

    cursor: pointer;
    user-select: none;
}

.bubble.transition {
    transition:
        left var(--transition-time) cubic-bezier(0.45, 0, 0.55, 1),
        top var(--transition-time) cubic-bezier(0.45, 0, 0.55, 1),
        width var(--transition-time) cubic-bezier(0.45, 0, 0.55, 1),
        height var(--transition-time) cubic-bezier(0.45, 0, 0.55, 1),
        font-size var(--transition-time) cubic-bezier(0.45, 0, 0.55, 1),
        transform 0.2s ease-out,
        filter 0.2s ease-out,
        box-shadow 0.2s ease-out;
}

.bubble:hover {
    z-index: 5;

    transform: scale(1.2);
    filter: brightness(1.1);
    box-shadow:
        0 5px 10px rgba(0, 0, 0, 0.3),
        inset 0 0 0 5px rgba(255, 255, 255, 0.4);
}

.measure-bubble {
    visibility: hidden;
    transition: none !important;

    --size: 1;
    --x: 0;
    --y: 0;
}


.stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    color: #fff;

    clip-path: circle(0px at 50% 50%);

    z-index: 15;
    opacity: 0;
    pointer-events: none;
    transition: clip-path 5s ease-in-out, opacity 0s ease-in-out;
}

.stats.active {
    opacity: 1;
    pointer-events: auto;
}

#disclaimer {
    position: fixed;
    bottom: 10px;

    width: 100%;

    font-size: 12px;
    text-align: center;

    color: #666;
    z-index: 100;
    pointer-events: none;
}

.overlay {
    display: flex;
    justify-content: center;
    position: relative;

    padding: 10px;

    pointer-events: none;
}

.overlay > div {
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;

    background-color: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);

    color: white;
}

.axis {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;

    position: absolute;

    font-size: 14px;
    font-weight: bold;

    z-index: 10;
}

.axis.x {
    width: 80%;
    height: 35px;

    padding-inline: 20px;

    bottom: 30px;
}

.axis.y {
    flex-direction: column;

    width: 35px;
    height: 80%;

    padding-block: 20px;

    left: 30px;
    top: 50%;
    transform: translateY(-50%);
}

.axis.x::before, .axis.x::after, .axis.y::before, .axis.y::after {
    content: '';
    flex-grow: 1;
    background-color: white;
}

.axis.x::before, .axis.x::after {
    height: 2px;
}
.axis.y::before, .axis.y::after {
    width: 2px;
}

.axis span {
  display: inline-block;
  white-space: nowrap;
}

.axis.y span {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.axis .arrow-head {
    width: 10px;
    height: 10px;

    position: absolute;

    border-top: 2px solid white;
    border-right: 2px solid white;
}

.axis.x .arrow-head {
    right: 20px;
    transform: rotate(45deg);
}

.axis.y .arrow-head {
    left: 50%;
    top: 20px;

    transform: translateX(-50%) rotate(-45deg);
}

.slider-area {
    --thumb-size: 28px;
    --slider-height: 8px;
    --y-margin: 15px;
    --x-margin: 5px;

    display: flex;
    justify-content: space-between;
    align-items: end;

    width: 70%;
    height: fit-content;

    position: relative;
    z-index: 20;
}

.slider-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;

    position: relative;
    margin: var(--y-margin) 8px;
}

.slider-controller {
    margin-bottom: calc(var(--y-margin) + var(--slider-height) / 2);
    transform: translateY(50%);

    cursor: pointer;
    pointer-events: auto;
    user-select: none;
}

.slider-area .slider-controller:first-child {
    margin-left: var(--x-margin);
}
.slider-area .slider-controller:last-child {
    margin-right: var(--x-margin);
}

.slider {
    width: 100%;
    height: var(--slider-height);

    border-radius: 4px;

    appearance: none;
    background: white;

    outline: none;
    cursor: pointer;
    pointer-events: auto;
}

/*.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;

    position: relative;
    width: var(--thumb-size);
    height: var(--thumb-size);

    border-radius: 50%;
    background: #333;

    cursor: pointer;
}*/

.slider-label {
    position: absolute;

    bottom: calc(var(--slider-height) / 2);
    transform: translateX(calc(-50% + var(--thumb-size) / 2)) translateY(50%);

    background: #333;
    color: white;

    padding: 3px 6px;
    border-radius: 4px;

    font-size: 14px;
    font-weight: bold;

    cursor: pointer;
    pointer-events: none;
}

.slider-ticks {
    display: flex;
    justify-content: space-between;
    position: relative;

    width: calc(100% - var(--thumb-size));
    height: 30px;

    font-size: 12px;
    font-weight: bold;

    color: white;
    padding-bottom: 5px;
}

.slider-ticks span {
    display: flex;
    flex-direction: column;
    align-items: center;

    position: absolute;
    top: 0px;
    transform: translateX(-50%);
}

.slider-ticks span::after {
    display: block;
    content: '';

    width: 2px;
    height: 10px;

    padding-bottom: 5px;
    background: white;
}
